Skip to content

Commit d5128a2

Browse files
committed
Change App ID to enable run from .exe and .PY simultaneously.
1 parent d3207f4 commit d5128a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
class SingleInstanceApplication(QApplication):
1919
def __init__(self, *args, **kwargs) -> None:
2020
super().__init__(*args, **kwargs)
21+
app_id = "Albayan" if sys.argv[0].endswith(".exe") else "Albayan_Source"
2122
self.setApplicationName(program_name)
22-
self.server_name = "Albayan"
23+
self.server_name = app_id
2324
self.local_server = QLocalServer(self)
24-
self.shared_memory = QSharedMemory("Albayan")
25+
self.shared_memory = QSharedMemory(app_id)
2526
self.is_running = self.shared_memory.attach()
2627
self.volume_controller = VolumeController()
2728
self.installEventFilter(self)

0 commit comments

Comments
 (0)