From 0b75dc9f028fe1a7dc2e34d54601fb97bd7afe88 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Mon, 4 Mar 2024 21:01:37 -0800 Subject: [PATCH] prefs: expose cola.refreshonfocus on cola.inotify Make it easier to configure the inotify File System Change Monitoring and Refresh-on-Focus features. Related-to: #1374 Signed-off-by: David Aguilar --- CHANGES.rst | 11 +++++++++++ cola/models/prefs.py | 4 ++++ cola/widgets/prefs.py | 19 ++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index c3266747..0e82dbeb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,14 @@ +.. _v4.6.2: + +v4.6.2 +====== + +Usability, bells and whistles +----------------------------- +* The `cola.refreshonfocus` and `cola.inotify` configuration settings are now accessible + from the `git cola config` settings dialog. + + .. _v4.6.1: v4.6.1 diff --git a/cola/models/prefs.py b/cola/models/prefs.py index a62bd51e..175a436c 100644 --- a/cola/models/prefs.py +++ b/cola/models/prefs.py @@ -29,6 +29,7 @@ FONTDIFF = 'cola.fontdiff' HIDPI = 'cola.hidpi' HISTORY_BROWSER = 'gui.historybrowser' ICON_THEME = 'cola.icontheme' +INOTIFY = 'cola.inotify' LINEBREAK = 'cola.linebreak' LOGDATE = 'cola.logdate' MAXRECENT = 'cola.maxrecent' @@ -39,6 +40,7 @@ MERGE_VERBOSITY = 'merge.verbosity' MERGETOOL = 'merge.tool' MOUSE_ZOOM = 'cola.mousezoom' PATCHES_DIRECTORY = 'cola.patchesdirectory' +REFRESH_ON_FOCUS = 'cola.refreshonfocus' RESIZE_BROWSER_COLUMNS = 'cola.resizebrowsercolumns' SAFE_MODE = 'cola.safemode' SAVEWINDOWSETTINGS = 'cola.savewindowsettings' @@ -114,6 +116,7 @@ class Defaults: expandtab = False history_browser = 'gitk' icon_theme = 'default' + inotify = True linebreak = True maxrecent = 8 mergetool = difftool @@ -122,6 +125,7 @@ class Defaults: merge_summary = True merge_verbosity = 2 mouse_zoom = True + refresh_on_focus = False resize_browser_columns = False save_window_settings = True safe_mode = False diff --git a/cola/widgets/prefs.py b/cola/widgets/prefs.py index 65899b88..993c374b 100644 --- a/cola/widgets/prefs.py +++ b/cola/widgets/prefs.py @@ -164,6 +164,19 @@ scissors self.display_untracked = qtutils.checkbox(checked=True) self.show_path = qtutils.checkbox(checked=True) + self.refresh_on_focus = qtutils.checkbox(checked=False) + tooltip = N_( + 'Refresh repository state whenever the window is focused or un-minimized' + ) + self.refresh_on_focus.setToolTip(tooltip) + + tooltip = N_( + 'Enable file system change monitoring using ' + 'inotify on Linux and win32event on Windows' + ) + self.inotify = qtutils.checkbox(checked=True) + self.inotify.setToolTip(tooltip) + self.logdate = qtutils.combo(prefs.date_formats()) tooltip = N_( 'The date-time format used when displaying dates in Git DAG.\n' @@ -188,11 +201,13 @@ scissors self.add_row(N_('User Name'), self.name) self.add_row(N_('Email Address'), self.email) + self.add_row(N_('Patches Directory'), self.patches_directory) self.add_row(N_('Log Date Format'), self.logdate) self.add_row(N_('Commit Message Cleanup'), self.commit_cleanup) self.add_row(N_('Merge Verbosity'), self.merge_verbosity) self.add_row(N_('Number of Diff Context Lines'), self.diff_context) - self.add_row(N_('Patches Directory'), self.patches_directory) + self.add_row(N_('Refresh on Focus'), self.refresh_on_focus) + self.add_row(N_('Enable File System Change Monitoring'), self.inotify) self.add_row(N_('Summarize Merge Commits'), self.merge_summary) self.add_row( N_('Automatically Load Commit Message Template'), self.autotemplate @@ -226,6 +241,7 @@ scissors Defaults.display_untracked, ), prefs.ENABLE_GRAVATAR: (self.enable_gravatar, Defaults.enable_gravatar), + prefs.INOTIFY: (self.inotify, Defaults.inotify), prefs.LOGDATE: (self.logdate, Defaults.logdate), prefs.MERGE_DIFFSTAT: (self.merge_diffstat, Defaults.merge_diffstat), prefs.MERGE_SUMMARY: (self.merge_summary, Defaults.merge_summary), @@ -234,6 +250,7 @@ scissors self.patches_directory, Defaults.patches_directory, ), + prefs.REFRESH_ON_FOCUS: (self.refresh_on_focus, Defaults.refresh_on_focus), prefs.SAFE_MODE: (self.safe_mode, Defaults.safe_mode), prefs.SHOW_PATH: (self.show_path, Defaults.show_path), prefs.USER_NAME: (self.name, ''), -- 2.11.4.GIT