Skip to content

Commit 91649c0

Browse files
fix conditionals
1 parent 850e1df commit 91649c0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/MainWindow.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def start_listen(self):
311311
"BitCapIPR",
312312
"UDP listening on 0.0.0.0[:8888,11503,14235]...\nPress the 'IP Report' button on miner after this dialog.",
313313
)
314-
if not self.isVisible():
314+
if self.sys_tray and not self.isVisible():
315315
self.sys_tray.showMessage(
316316
"IPR Listener: Start",
317317
"Started Listening on 0.0.0.0[:8888,:11503,:14235]...",
@@ -340,7 +340,7 @@ def stop_listen(self, timeout=False):
340340
self.inactive.stop()
341341
if self.actionEnableIDTable.isChecked():
342342
self.tableWidget.setRowCount(0)
343-
if not self.isVisible():
343+
if self.sys_tray and not self.isVisible():
344344
self.sys_tray.showMessage(
345345
"IPR Listener: Stop",
346346
"Stopping listeners...",
@@ -402,7 +402,7 @@ def show_confirm(self):
402402
confirm.lineIPField.setText(ip)
403403
confirm.lineMACField.setText(mac)
404404
self.children.append(confirm)
405-
if not self.isVisible():
405+
if self.sys_tray and not self.isVisible():
406406
if self.sys_tray.receivers(self.sys_tray.messageClicked) > 0:
407407
self.children[-2].show()
408408
self.sys_tray.messageClicked.disconnect()
@@ -556,7 +556,7 @@ def save_settings(self):
556556
"Configuration",
557557
"Successfully wrote settings to config."
558558
)
559-
559+
560560
def set_logger_level(self):
561561
logger.manager.root.setLevel(self.comboLogLevel.currentText())
562562
logger.log(logger.manager.root.level, f" change logger to level {self.comboLogLevel.currentText()}.")
@@ -600,7 +600,7 @@ def toggle_visibility(self):
600600
self.setVisible(not self.isVisible())
601601

602602
def close_to_tray_or_exit(self):
603-
if self.comboOnWindowClose.currentIndex() == 1:
603+
if self.sys_tray and self.comboOnWindowClose.currentIndex() == 1:
604604
self.toggle_visibility()
605605
self.sys_tray.show()
606606
self.sys_tray.showMessage(
@@ -623,7 +623,7 @@ def close_root_logger(self, log):
623623
log.root.removeHandler(handler)
624624

625625
def quit(self):
626-
if not self.isVisible():
626+
if self.sys_tray and not self.isVisible():
627627
self.toggle_visibility()
628628
self.thread.stop_listeners()
629629
self.thread.exit()

0 commit comments

Comments
 (0)