Browse Source

Option in Control menu to split the session view between horizontally and vertically

master
Nils 2 years ago
parent
commit
7b200c3f83
  1. 4
      CHANGELOG
  2. 4
      engine/start.py
  3. 5
      qtgui/designer/mainwindow.py
  4. 9
      qtgui/designer/mainwindow.ui
  5. 16
      qtgui/mainwindow.py

4
CHANGELOG

@ -5,6 +5,10 @@ Two empty lines before the next entry.
External contributors notice at the end of the line: (LastName, FirstName / nick)
## 2022-01-15 0.3.1
Option in Control menu to split the session view between horizontally and vertically
The session list now dynamically expands to the needed with.
Better log messages
Fix regression and workarounds for crashes introduced by a recent PyQt update.
This CHANGELOG is now available through the programs help menu directly.

4
engine/start.py

@ -58,10 +58,10 @@ args = parser.parse_args()
import logging
if args.verbose: #development
logging.basicConfig(level=logging.INFO, format='[' + METADATA["name"] + '] %(levelname)s %(asctime)s %(name)s: %(message)s',)
logging.basicConfig(level=logging.INFO, format='[' + METADATA["shortName"] + '] %(levelname)s %(asctime)s %(name)s: %(message)s',)
#logging.getLogger().setLevel(logging.INFO) #development
else: #production
logging.basicConfig(level=logging.ERROR, format='[' + METADATA["name"] + '] %(levelname)s %(asctime)s %(name)s: %(message)s',)
logging.basicConfig(level=logging.ERROR, format='[' + METADATA["shortName"] + '] %(levelname)s %(asctime)s %(name)s: %(message)s',)
#logging.getLogger().setLevel(logging.ERROR) #production

5
qtgui/designer/mainwindow.py

@ -275,9 +275,13 @@ class Ui_MainWindow(object):
self.actionManual.setObjectName("actionManual")
self.actionChangelog = QtWidgets.QAction(MainWindow)
self.actionChangelog.setObjectName("actionChangelog")
self.actionSplit_Session_View_The_Other_Way = QtWidgets.QAction(MainWindow)
self.actionSplit_Session_View_The_Other_Way.setCheckable(True)
self.actionSplit_Session_View_The_Other_Way.setObjectName("actionSplit_Session_View_The_Other_Way")
self.menuControl.addAction(self.actionManual)
self.menuControl.addAction(self.actionChangelog)
self.menuControl.addAction(self.actionRebuild_Program_Database)
self.menuControl.addAction(self.actionSplit_Session_View_The_Other_Way)
self.menuControl.addAction(self.actionHide_in_System_Tray)
self.menuControl.addAction(self.actionSettings)
self.menuControl.addAction(self.actionMenuQuit)
@ -378,3 +382,4 @@ class Ui_MainWindow(object):
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionManual.setText(_translate("MainWindow", "Manual"))
self.actionChangelog.setText(_translate("MainWindow", "News and Changelog"))
self.actionSplit_Session_View_The_Other_Way.setText(_translate("MainWindow", "Split Session View the other way"))

9
qtgui/designer/mainwindow.ui

@ -566,6 +566,7 @@
<addaction name="actionManual"/>
<addaction name="actionChangelog"/>
<addaction name="actionRebuild_Program_Database"/>
<addaction name="actionSplit_Session_View_The_Other_Way"/>
<addaction name="actionHide_in_System_Tray"/>
<addaction name="actionSettings"/>
<addaction name="actionMenuQuit"/>
@ -738,6 +739,14 @@
<string>News and Changelog</string>
</property>
</action>
<action name="actionSplit_Session_View_The_Other_Way">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Split Session View the other way</string>
</property>
</action>
</widget>
<resources/>
<connections/>

16
qtgui/mainwindow.py

@ -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():

Loading…
Cancel
Save