aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRael <rael.gc@gmail.com>2015-10-17 07:41:00 -0300
committerRael <rael.gc@gmail.com>2015-10-17 07:41:00 -0300
commit33314d7527dd9d27444d2d5d25ec0abc858d63fe (patch)
tree2cab0a9ad9faa5a0c054dbe6ff30f0c7708d7779
parent503f33a6908862506c374a3933c39117143a54b2 (diff)
downloadscudcloud-33314d7527dd9d27444d2d5d25ec0abc858d63fe.zip
scudcloud-33314d7527dd9d27444d2d5d25ec0abc858d63fe.tar.gz
scudcloud-33314d7527dd9d27444d2d5d25ec0abc858d63fe.tar.bz2
Saving menubar state (#251)
-rwxr-xr-xscudcloud-1.0/lib/scudcloud.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scudcloud-1.0/lib/scudcloud.py b/scudcloud-1.0/lib/scudcloud.py
index af4fb0c..c590b09 100755
--- a/scudcloud-1.0/lib/scudcloud.py
+++ b/scudcloud-1.0/lib/scudcloud.py
@@ -104,7 +104,12 @@ class ScudCloud(QtGui.QMainWindow):
def toggleMenuBar(self):
menu = self.menuBar()
- menu.setVisible(menu.isHidden())
+ state = menu.isHidden()
+ menu.setVisible(state)
+ if state:
+ self.settings.setValue("Menu", "False")
+ else:
+ self.settings.setValue("Menu", "True")
def restore(self):
geometry = self.settings.value("geometry")
@@ -204,6 +209,10 @@ class ScudCloud(QtGui.QMainWindow):
showSystray = self.settings.value("Systray") == "True"
self.menus["file"]["systray"].setChecked(showSystray)
self.menus["file"]["close"].setEnabled(showSystray)
+ # Restore menu visibility
+ visible = self.settings.value("Menu")
+ if visible is not None and visible == "False":
+ menu.setVisible(False)
def enableMenus(self, enabled):
self.menus["file"]["preferences"].setEnabled(enabled == True)