{"thread":{"id":"11456","subject":"[PATCH ugit] Allow user to choose history browser tool","startedAt":"2008-01-03T12:08:17Z","lastAt":"2008-01-03T22:39:21Z","messageCount":3,"participants":["Marco Costalba","David","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64383","messageId":"e5bfff550801030408w1512e458x136f6be0371c13c2@mail.gmail.com","threadId":"11456","inReplyTo":null,"subject":"[PATCH ugit] Allow user to choose history browser tool","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2008-01-03T12:08:17Z","receivedAt":"2008-01-03T12:08:17Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":" Instead of hard linking gitk let the user set\n the preferred history visualization tool in settings dialog.\n\nSigned-off by:  Marco Costalba <mcostalba@gmail.com>\n---\n\nA thing I was not able to figure out is how to save the settings\nso that at restart of ugit the saved setting is found\nagain (instead of selecting the default 'gitk')\n\nAnyhow a really nice tool this ugit thing, you managed to\nplaying catch-up with git-gui really fast.\n\n\n ugitlibs/controllers.py    |    6 ++++--\n ugitlibs/models.py         |    6 +++++-\n ugitlibs/utilcontroller.py |    5 ++++-\n ui/optionsgui.ui           |   39 +++++++++++++++++++++++++++------------\n 4 files changed, 40 insertions(+), 16 deletions(-)\n\ndiff --git a/ugitlibs/controllers.py b/ugitlibs/controllers.py\nindex 411f1c1..6ad7b43 100644\n--- a/ugitlibs/controllers.py\n+++ b/ugitlibs/controllers.py\n@@ -441,11 +441,13 @@ class Controller(QObserver):\n\n \tdef viz_all(self):\n \t\t'''Visualizes the entire git history using gitk.'''\n-\t\tutils.fork('gitk','--all')\n+\t\tbrowser = self.model.get_history_browser()\n+\t\tutils.fork(browser,'--all')\n\n \tdef viz_current(self):\n \t\t'''Visualizes the current branch's history using gitk.'''\n-\t\tutils.fork('gitk', self.model.get_branch())\n+\t\tbrowser = self.model.get_history_browser()\n+\t\tutils.fork(browser, self.model.get_branch())\n\n \t# These actions monitor window resizes, splitter changes, etc.\n \tdef move_event(self, event):\ndiff --git a/ugitlibs/models.py b/ugitlibs/models.py\nindex 3c7ec9b..fe71362 100644\n--- a/ugitlibs/models.py\n+++ b/ugitlibs/models.py\n@@ -117,6 +117,7 @@ class Model(model.Model):\n \t\t\t'ugit.fontui.size':12,\n \t\t\t'ugit.fontdiff': '',\n \t\t\t'ugit.fontdiff.size':12,\n+\t\t\t'ugit.history_browser_line': 'gitk',\n \t\t\t}\n\n \t\tdefault_dict = self.__config_defaults\n@@ -251,7 +252,10 @@ class Model(model.Model):\n \t\t\t\tself.subtree_types.append(self.types[idx])\n \t\t\t\tself.subtree_sha1s.append(self.sha1s[idx])\n \t\t\t\tself.subtree_names.append(name)\n-\t\n+\n+\tdef get_history_browser(self):\n+\t\treturn self.get_param('global.ugit.history_browser_line')\n+\n \tdef get_tree_node(self, idx):\n \t\treturn (self.get_types()[idx],\n \t\t\tself.get_sha1s()[idx],\ndiff --git a/ugitlibs/utilcontroller.py b/ugitlibs/utilcontroller.py\nindex 12a7399..c6f87a7 100644\n--- a/ugitlibs/utilcontroller.py\n+++ b/ugitlibs/utilcontroller.py\n@@ -108,12 +108,15 @@ class OptionsController(QObserver):\n\n \t\t\t'global.ugit.fontui.size': 'main_font_spinbox',\n \t\t\t'global.ugit.fontui': 'main_font_combo',\n+\n+\t\t\t'global.ugit.history_browser_line': 'history_browser_line',\n \t\t}\n\n \t\tfor m,v in model_to_view.iteritems():\n \t\t\tself.model_to_view(m,v)\n\n \t\tself.add_signals('textChanged(const QString&)',\n+\t\t\t\tview.history_browser_line,\n \t\t\t\tview.local_name_line,\n \t\t\t\tview.global_name_line,\n \t\t\t\tview.local_email_line,\n@@ -132,7 +135,7 @@ class OptionsController(QObserver):\n \t\t\t\tview.global_diffcontext_spinbox,\n \t\t\t\tview.local_verbosity_spinbox,\n \t\t\t\tview.global_verbosity_spinbox)\n-\t\n+\n \t\tself.add_signals('currentFontChanged(const QFont&)',\n \t\t\t\tview.main_font_combo,\n \t\t\t\tview.diff_font_combo)\ndiff --git a/ui/optionsgui.ui b/ui/optionsgui.ui\nindex 31bff84..a6fc1cf 100644\n--- a/ui/optionsgui.ui\n+++ b/ui/optionsgui.ui\n@@ -8,8 +8,8 @@\n    <rect>\n     <x>0</x>\n     <y>0</y>\n-    <width>543</width>\n-    <height>313</height>\n+    <width>598</width>\n+    <height>399</height>\n    </rect>\n   </property>\n   <property name=\"windowTitle\" >\n@@ -23,7 +23,7 @@\n      </property>\n     </widget>\n    </item>\n-   <item row=\"0\" column=\"1\" >\n+   <item row=\"0\" column=\"1\" colspan=\"2\" >\n     <widget class=\"QSpinBox\" name=\"main_font_spinbox\" >\n      <property name=\"minimum\" >\n       <number>8</number>\n@@ -33,7 +33,7 @@\n      </property>\n     </widget>\n    </item>\n-   <item row=\"0\" column=\"2\" colspan=\"4\" >\n+   <item row=\"0\" column=\"3\" colspan=\"4\" >\n     <widget class=\"QFontComboBox\" name=\"main_font_combo\" >\n      <property name=\"currentFont\" >\n       <font>\n@@ -49,7 +49,7 @@\n      </property>\n     </widget>\n    </item>\n-   <item row=\"1\" column=\"1\" >\n+   <item row=\"1\" column=\"1\" colspan=\"2\" >\n     <widget class=\"QSpinBox\" name=\"diff_font_spinbox\" >\n      <property name=\"minimum\" >\n       <number>8</number>\n@@ -59,19 +59,33 @@\n      </property>\n     </widget>\n    </item>\n-   <item row=\"1\" column=\"2\" colspan=\"4\" >\n+   <item row=\"1\" column=\"3\" colspan=\"4\" >\n     <widget class=\"QFontComboBox\" name=\"diff_font_combo\" >\n      <property name=\"fontFilters\" >\n       <set>QFontComboBox::MonospacedFonts</set>\n      </property>\n      <property name=\"currentFont\" >\n       <font>\n-       <family>Courier</family>\n+       <family>Liberation Mono</family>\n       </font>\n      </property>\n     </widget>\n    </item>\n-   <item row=\"2\" column=\"0\" colspan=\"3\" >\n+   <item row=\"2\" column=\"0\" >\n+    <widget class=\"QLabel\" name=\"label_11\" >\n+     <property name=\"text\" >\n+      <string>History browser</string>\n+     </property>\n+    </widget>\n+   </item>\n+   <item row=\"2\" column=\"1\" colspan=\"6\" >\n+    <widget class=\"QLineEdit\" name=\"history_browser_line\" >\n+     <property name=\"text\" >\n+      <string/>\n+     </property>\n+    </widget>\n+   </item>\n+   <item row=\"3\" column=\"0\" colspan=\"4\" >\n     <widget class=\"QGroupBox\" name=\"local_groupbox\" >\n      <property name=\"title\" >\n       <string>Local Repository</string>\n@@ -151,7 +165,7 @@\n      </layout>\n     </widget>\n    </item>\n-   <item row=\"2\" column=\"3\" colspan=\"3\" >\n+   <item row=\"3\" column=\"4\" colspan=\"3\" >\n     <widget class=\"QGroupBox\" name=\"globalGroupBox\" >\n      <property name=\"title\" >\n       <string>Global (All Repositories)</string>\n@@ -231,7 +245,7 @@\n      </layout>\n     </widget>\n    </item>\n-   <item row=\"3\" column=\"0\" colspan=\"4\" >\n+   <item row=\"4\" column=\"0\" colspan=\"5\" >\n     <spacer>\n      <property name=\"orientation\" >\n       <enum>Qt::Horizontal</enum>\n@@ -244,7 +258,7 @@\n      </property>\n     </spacer>\n    </item>\n-   <item row=\"3\" column=\"4\" >\n+   <item row=\"4\" column=\"5\" >\n     <widget class=\"QPushButton\" name=\"save_button\" >\n      <property name=\"text\" >\n       <string>Save</string>\n@@ -254,7 +268,7 @@\n      </property>\n     </widget>\n    </item>\n-   <item row=\"3\" column=\"5\" >\n+   <item row=\"4\" column=\"6\" >\n     <widget class=\"QPushButton\" name=\"cancel_button\" >\n      <property name=\"text\" >\n       <string>Cancel</string>\n@@ -264,4 +278,5 @@\n   </layout>\n  </widget>\n  <resources/>\n+ <connections/>\n </ui>\n-- \n1.5.4.rc2.14.geab82\n"},{"id":"64385","messageId":"402731c90801030435h1d726e81sf24ad3eca5bd029f@mail.gmail.com","threadId":"11456","inReplyTo":"e5bfff550801030408w1512e458x136f6be0371c13c2@mail.gmail.com","subject":"Re: [PATCH ugit] Allow user to choose history browser tool","fromName":"David","fromEmail":"davvid@gmail.com","sentAt":"2008-01-03T12:35:01Z","receivedAt":"2008-01-03T12:35:01Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Jan 3, 2008 4:08 AM, Marco Costalba <mcostalba@gmail.com> wrote:\n>  Instead of hard linking gitk let the user set\n>  the preferred history visualization tool in settings dialog.\n>\n> Signed-off by:  Marco Costalba <mcostalba@gmail.com>\n> ---\n>\n\nVery nice, thank you!\nI've applied this and fixed it so that the setting shows up on restart.\n-David\n"},{"id":"64402","messageId":"20080103223920.GA17530@coredump.intra.peff.net","threadId":"11456","inReplyTo":"e5bfff550801030408w1512e458x136f6be0371c13c2@mail.gmail.com","subject":"Re: [PATCH ugit] Allow user to choose history browser tool","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-03T22:39:21Z","receivedAt":"2008-01-03T22:39:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jan 03, 2008 at 01:08:17PM +0100, Marco Costalba wrote:\n\n>  Instead of hard linking gitk let the user set\n>  the preferred history visualization tool in settings dialog.\n\nThis is the exact situation that the 'git view' builtin alias was\ndesigned for. If every porcelain which spawned a viewer used 'git view',\nthen the user would only need to configure one place (but note that 'git\nview' has never even made it out of next, so I am not recommending it\ninstead of your patch, but just making a note).\n\n-Peff\n"}]}