From 334e3310302a6828d7dd2c7d4f7ef85c069b776f Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 20 Jul 2006 04:25:44 +0000 Subject: [PATCH] * src/plugins/Checkpoint.py (Checkpoint.init_gui): Detect whether rcs program is present and modify UI accordingly. * src/plugins/checkpoint.glade: Add hidden warning label. svn: r7049 --- gramps2/ChangeLog | 3 + gramps2/src/plugins/Checkpoint.py | 10 ++ gramps2/src/plugins/checkpoint.glade | 188 ++++++++++++++++++--------- 3 files changed, 136 insertions(+), 65 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 6d8ad8269..1ba7cb7b1 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,7 @@ 2006-07-19 Alex Roitman + * src/plugins/Checkpoint.py (Checkpoint.init_gui): Detect whether + rcs program is present and modify UI accordingly. + * src/plugins/checkpoint.glade: Add hidden warning label. * src/plugins/StatisticsChart.py (StatisticsChartOptions.get_report_filters): Add custom filters. * src/plugins/Calendar.py (FilterWidget.get_filters): Add custom diff --git a/gramps2/src/plugins/Checkpoint.py b/gramps2/src/plugins/Checkpoint.py index 4d9866906..bc80024a1 100644 --- a/gramps2/src/plugins/Checkpoint.py +++ b/gramps2/src/plugins/Checkpoint.py @@ -59,6 +59,10 @@ from PluginUtils import Tool, register_tool # Constants # #------------------------------------------------------------------------- +if os.sys.platform == "win32": + _rcs_found = os.system("rcs -V >nul 2>nul") == 0 +else: + _rcs_found = os.system("dot -V >/dev/null 2>/dev/null") == 0 # Some message strings rcs_setup_failure_msg = [ @@ -148,6 +152,12 @@ class Checkpoint(Tool.Tool, ManagedWindow.ManagedWindow): self.rcs_rb.connect('toggled',self.rcs_toggled) + # Disable RCS if the rcs binary is not available + # and show the normally hidden warning + if not _rcs_found: + self.rcs_rb.set_sensitive(False) + self.glade.get_widget('warning_label').show() + self.title = _("Checkpoint Data") window = self.glade.get_widget('top') self.set_window(window,self.glade.get_widget('title'),self.title) diff --git a/gramps2/src/plugins/checkpoint.glade b/gramps2/src/plugins/checkpoint.glade index 7fd061adb..34ca4fa99 100644 --- a/gramps2/src/plugins/checkpoint.glade +++ b/gramps2/src/plugins/checkpoint.glade @@ -16,6 +16,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST + True + False True @@ -116,6 +118,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -188,6 +194,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -230,6 +240,10 @@ 0.5 0 10 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -251,6 +265,10 @@ 0.5 12 12 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -263,14 +281,14 @@ 12 True - 5 + 6 4 False 6 12 - + True <b>Revision control system</b> False @@ -282,6 +300,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -316,28 +338,75 @@ - + True - True - C_ustom commands - True - GTK_RELIEF_NORMAL - True - False - False - True - rcs + Retrieval: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 1 - 4 - 2 - 3 + 2 + 3 + 5 + 6 fill + + + True + True + True + True + 0 + + True + * + False + + + 3 + 4 + 5 + 6 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 3 + 4 + 4 + 5 + + + + True @@ -351,10 +420,37 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 3 + 4 + 5 + fill + + + + + + + True + True + C_ustom commands + True + GTK_RELIEF_NORMAL + True + False + False + True + rcs + + + 1 + 4 3 4 fill @@ -363,11 +459,11 @@ - - True - Retrieval: + + <b><i>Please install the rcs package +to enable the default functionality.</i></b> False - False + True GTK_JUSTIFY_LEFT False False @@ -375,58 +471,20 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 2 - 3 - 4 - 5 + 4 + 2 + 3 fill - - - - True - True - True - True - 0 - - True - * - False - - - 3 - 4 - 3 - 4 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 3 - 4 - 4 - 5 - - - 0