Ver código fonte

display current project path on title bar

Bachir Soussi Chiadmi 7 anos atrás
pai
commit
dea7c22ba3
1 arquivos alterados com 13 adições e 4 exclusões
  1. 13 4
      app.py

+ 13 - 4
app.py

@@ -29,7 +29,7 @@ class Core():
       # restore previous preferences
       # restore previous preferences
 
 
       self.restorePreferences()
       self.restorePreferences()
-
+      self._mw = False
       self.temp = tempfile.mkdtemp()
       self.temp = tempfile.mkdtemp()
       # print(self.temp)
       # print(self.temp)
 
 
@@ -39,10 +39,20 @@ class Core():
          self.tempcwd = True
          self.tempcwd = True
          self.initnewproject()
          self.initnewproject()
 
 
-
       self.server = server.Server(self.temp)
       self.server = server.Server(self.temp)
       self.compiler = compiler.Compiler(self.temp)
       self.compiler = compiler.Compiler(self.temp)
 
 
+   @property
+   def mainwindow(self):
+      return self.mainwindow
+
+   @mainwindow.setter
+   def mainwindow(self, mw):
+      if not self._mw:
+         self._mw = mw
+         if not self.tempcwd:
+            self._mw.setWindowTitle("Cascade – "+self.cwd)
+
 
 
    def restorePreferences(self):
    def restorePreferences(self):
       # print("restorePreferences")
       # print("restorePreferences")
@@ -87,6 +97,7 @@ class Core():
          shutil.copytree(self.cwd, cwd)
          shutil.copytree(self.cwd, cwd)
          self.cwd = cwd
          self.cwd = cwd
          self.tempcwd = False
          self.tempcwd = False
+         self._mw.setWindowTitle("Cascade – "+self.cwd)
 
 
    def quit(self):
    def quit(self):
       self.savePreferences()
       self.savePreferences()
@@ -109,8 +120,6 @@ class MainWindow(QMainWindow):
       self.initMenuBar()
       self.initMenuBar()
 
 
       self.initMainStack()
       self.initMainStack()
-      # self.shortcut = QShortcut(QKeySequence("Ctrl+Q"), self)
-      # self.shortcut.activated.connect(self.quit)
 
 
       self.show()
       self.show()