This repository was archived by the owner on Aug 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## [ Unreleased] [ unrealeased ]
44### Added
5+ - Display current project name in window title
56
67### Changed
78 - Use mono fonts in sub-windows
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ def __init__(self):
5656 if has_setting ("window/state" ):
5757 self .restoreState (get_setting ("window/state" ))
5858
59+ if has_setting ("current_project" ):
60+ self .set_window_title (get_setting ("current_project" ))
61+
5962 def closeEvent (self , event ):
6063 set_setting ("window/geometry" , self .saveGeometry ())
6164 set_setting ("window/state" , self .saveState ())
@@ -295,6 +298,10 @@ def get_breakpoint_viewer(self):
295298 def get_expression_viewer (self ):
296299 return self .expression_viewer
297300
301+ def set_window_title (self , project_name ):
302+ title = "pugdebug / %s " % project_name
303+ self .setWindowTitle (title )
304+
298305 def set_debugging_status (self , status ):
299306 self .permanent_statusbar .set_debugging_status (status )
300307
Original file line number Diff line number Diff line change 2121from pugdebug .models .documents import PugdebugDocuments
2222from pugdebug .models .file_browser import PugdebugFileBrowser
2323from pugdebug .models .projects import PugdebugProjects
24- from pugdebug .models .settings import get_setting , save_settings
24+ from pugdebug .models .settings import get_setting , set_setting , save_settings
2525
2626
2727class Pugdebug (QObject ):
@@ -275,13 +275,23 @@ def load_project(self, project):
275275
276276 Get the settings for the project and load them as the current
277277 application settings.
278+
279+ Set the current project name in the window title.
280+
281+ Set the current project name setting in application settings.
278282 """
279283 project_settings = project .get_settings ()
280284
281285 changed_settings = save_settings (project_settings )
282286
283287 self .handle_settings_changed (changed_settings )
284288
289+ project_name = project .get_project_name ()
290+
291+ self .main_window .set_window_title (project_name )
292+
293+ set_setting ('current_project' , project_name )
294+
285295 def file_browser_item_activated (self , index ):
286296 """Handle when file browser item gets activated
287297
You can’t perform that action at this time.
0 commit comments