[meld] Avoid selecting invalid repositories as default on load
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Avoid selecting invalid repositories as default on load
- Date: Sat, 21 Aug 2010 22:42:28 +0000 (UTC)
commit cc1b436fd833c452d82b3041ac1413a2bf958439
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Aug 22 08:34:49 2010 +1000
Avoid selecting invalid repositories as default on load
meld/vcview.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/meld/vcview.py b/meld/vcview.py
index a58cdce..883a4f4 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -230,7 +230,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.combobox_vcs.get_model().clear()
tooltip_texts = [_("Choose one Version Control"),
_("Only one Version Control in this directory")]
- default_active = 0
+ default_active = -1
+ valid_vcs = []
# Try to keep the same VC plugin active on refresh()
for idx, avc in enumerate(vcs):
# See if the necessary version control command exists. If so,
@@ -247,6 +248,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
# controlled repository is invalid or corrupted
err_str = _("Invalid Repository")
else:
+ valid_vcs.append(idx)
if (self.vc is not None and
self.vc.__class__ == avc.__class__):
default_active = idx
@@ -257,6 +259,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
else:
self.combobox_vcs.get_model().append([avc.NAME, avc, True])
+ if valid_vcs and default_active == -1:
+ default_active = min(valid_vcs)
+
if gtk.pygtk_version >= (2, 12, 0):
self.combobox_vcs.set_tooltip_text(tooltip_texts[len(vcs) == 1])
self.combobox_vcs.set_sensitive(len(vcs) > 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]