@ -327,6 +327,18 @@ class MainWindow(QtWidgets.QMainWindow):
self . setVisible ( False )
#self.systemTray.buildContextMenu() #Don't. This crashes Qt through some delayed execution of who knows what. Workaround: tray context menu now say "Show/Hide" and not only the actual state.
def toggleSplitSessionView ( self , state : bool ) :
self . ui . actionSplit_Session_View_The_Other_Way . blockSignals ( True )
if state :
orientation = QtCore . Qt . Vertical #this is weird. Is the Qt enum wrongly labeled? This splits in an upper and lower part.
else :
orientation = QtCore . Qt . Horizontal
self . ui . actionSplit_Session_View_The_Other_Way . setChecked ( state ) #This funtion can be called by functions, e.g. restoreWindowSettings on startup.
self . ui . hSplitterLauncherClients . setOrientation ( orientation )
self . ui . actionSplit_Session_View_The_Other_Way . blockSignals ( False )
def _askBeforeQuit ( self , nsmSessionName ) :
""" If you quit while in a session ask what to do.
The TrayIcon context menu uses different functions and directly acts , without a question """
@ -404,6 +416,7 @@ class MainWindow(QtWidgets.QMainWindow):
self . ui . actionChangelog . triggered . connect ( self . changelog . show )
self . ui . actionRebuild_Program_Database . triggered . connect ( self . updateProgramDatabase )
self . ui . actionSettings . triggered . connect ( self . _reactMenu_settings )
self . ui . actionSplit_Session_View_The_Other_Way . toggled . connect ( self . toggleSplitSessionView )
self . ui . actionHide_in_System_Tray . triggered . connect ( lambda : self . toggleVisible ( force = False ) )
self . ui . actionMenuQuit . triggered . connect ( self . menuRealQuit )
@ -431,6 +444,7 @@ class MainWindow(QtWidgets.QMainWindow):
#settings.setValue("visible", self.isVisible()) Deprecated. see restoreWindowSettings
settings . setValue ( " recentlyOpenedSessions " , self . recentlyOpenedSessions . get ( ) )
settings . setValue ( " tab " , self . ui . tabbyCat . currentIndex ( ) )
settings . setValue ( " sessionSplitOrientationNonDefault " , self . ui . actionSplit_Session_View_The_Other_Way . isChecked ( ) )
def restoreWindowSettings ( self ) :
""" opposite of storeWindowSettings. Read there. """
@ -442,11 +456,13 @@ class MainWindow(QtWidgets.QMainWindow):
" windowState " : self . restoreState ,
" recentlyOpenedSessions " : self . recentlyOpenedSessions . load ,
" tab " : lambda i : self . ui . tabbyCat . setCurrentIndex ( int ( i ) ) ,
" sessionSplitOrientationNonDefault " : lambda b : self . toggleSplitSessionView ( bool ( b ) ) ,
}
types = {
" recentlyOpenedSessions " : list ,
" tab " : int ,
" sessionSplitOrientationNonDefault " : bool ,
}
for key in settings . allKeys ( ) :