|
@@ -48,6 +48,8 @@ class MainWindow(QMainWindow):
|
|
|
def initMenuBar(self):
|
|
|
|
|
|
bar = self.menuBar()
|
|
|
+
|
|
|
+
|
|
|
file = bar.addMenu("&File")
|
|
|
|
|
|
new = QAction("&New Project",self)
|
|
@@ -62,10 +64,6 @@ class MainWindow(QMainWindow):
|
|
|
self.save_action.setShortcut("Ctrl+Shift+s")
|
|
|
file.addAction(self.save_action)
|
|
|
|
|
|
- self.save_action = QAction("&Save Project as",self)
|
|
|
- self.save_action.setShortcut("Ctrl+Shift+s")
|
|
|
- file.addAction(self.save_action)
|
|
|
-
|
|
|
self.docset_action = QAction("&Document Settings",self)
|
|
|
self.docset_action.setShortcut("Ctrl+d")
|
|
|
file.addAction(self.docset_action)
|
|
@@ -98,24 +96,38 @@ class MainWindow(QMainWindow):
|
|
|
|
|
|
view = bar.addMenu("&View")
|
|
|
|
|
|
- designview = QAction("&Design",self)
|
|
|
- designview.setShortcut("F1")
|
|
|
- view.addAction(designview)
|
|
|
-
|
|
|
contentview = QAction("&Content",self)
|
|
|
- contentview.setShortcut("F2")
|
|
|
+ contentview.setShortcut("F1")
|
|
|
view.addAction(contentview)
|
|
|
|
|
|
- versionview = QAction("&Version",self)
|
|
|
+ designview = QAction("&Design",self)
|
|
|
+ designview.setShortcut("F2")
|
|
|
+ view.addAction(designview)
|
|
|
+
|
|
|
+ versionview = QAction("&Version")
|
|
|
versionview.setShortcut("F3")
|
|
|
view.addAction(versionview)
|
|
|
|
|
|
+ self.menuview = QAction("&Show Menu", self)
|
|
|
+ self.menuview.setCheckable(True)
|
|
|
+ self.menuview.setShortcutContext(Qt.ApplicationShortcut)
|
|
|
+ self.menuview.setShortcut('F4')
|
|
|
+ view.addAction(self.menuview)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
view.triggered[QAction].connect(self.onviewmenutrigger)
|
|
|
|
|
|
+
|
|
|
|
|
|
about = bar.addMenu("About")
|
|
|
about.addAction("&Website")
|
|
|
|
|
|
+ self.menuisvisible = True
|
|
|
+
|
|
|
+
|
|
|
def onfilemenutrigger(self, q):
|
|
|
print(q.text()+" is triggered")
|
|
|
if q.text() == "&New Project":
|
|
@@ -186,6 +198,7 @@ class MainWindow(QMainWindow):
|
|
|
self,
|
|
|
'Save Project',
|
|
|
self.core.dialog_path
|
|
|
+
|
|
|
)[0]
|
|
|
|
|
|
try:
|
|
@@ -246,12 +259,34 @@ class MainWindow(QMainWindow):
|
|
|
|
|
|
def onviewmenutrigger(self, q):
|
|
|
print(q.text()+" is triggered")
|
|
|
- if q.text() == "&Design":
|
|
|
+ if q.text() == "&Content":
|
|
|
self.mainstack.setCurrentIndex(0)
|
|
|
- elif q.text() == "&Content":
|
|
|
+ elif q.text() == "&Design":
|
|
|
self.mainstack.setCurrentIndex(1)
|
|
|
elif q.text() == "&Version":
|
|
|
self.mainstack.setCurrentIndex(2)
|
|
|
+ elif q.text() == "&Show Menu":
|
|
|
+ self.toggleMenu()
|
|
|
+
|
|
|
+ def toggleMenu(self):
|
|
|
+ self.menuisvisible = not self.menuisvisible
|
|
|
+ if self.menuisvisible:
|
|
|
+ print('show menu')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ self.menuview.setChecked(True)
|
|
|
+ else:
|
|
|
+ print('hide menu')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ self.menuview.setChecked(False)
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -300,12 +335,12 @@ class MainWindow(QMainWindow):
|
|
|
def initMainStack(self):
|
|
|
self.mainstack = QStackedWidget()
|
|
|
|
|
|
- self.designstack = design.DesignStack(self.core)
|
|
|
self.contentstack = content.ContentStack(self.core)
|
|
|
+ self.designstack = design.DesignStack(self.core)
|
|
|
self.versionstack = QLabel("Version (git).")
|
|
|
|
|
|
- self.mainstack.addWidget(self.designstack)
|
|
|
self.mainstack.addWidget(self.contentstack)
|
|
|
+ self.mainstack.addWidget(self.designstack)
|
|
|
self.mainstack.addWidget(self.versionstack)
|
|
|
|
|
|
self.mainstack.setCurrentIndex(self.core.mw_curstack)
|