Show warning when quitting while any tabs are active

This commit is contained in:
Micah Lee 2019-10-27 16:18:56 -07:00
parent 654fccc009
commit b7a095d64d
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 50 additions and 22 deletions

View file

@ -116,6 +116,16 @@ class TabWidget(QtWidgets.QTabWidget):
if self.count() == 0:
self.new_tab_clicked()
def are_tabs_active(self):
"""
See if there are active servers in any open tabs
"""
for tab_id in self.tabs:
mode = self.tabs[tab_id].get_mode()
if mode.server_status.status != mode.server_status.STATUS_STOPPED:
return True
return False
def resizeEvent(self, event):
# Make sure to move new tab button on each resize
super(TabWidget, self).resizeEvent(event)