Skip to content

Instantly share code, notes, and snippets.

@gmircea
Created May 30, 2014 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmircea/2d93b6c2e60319db089e to your computer and use it in GitHub Desktop.
Save gmircea/2d93b6c2e60319db089e to your computer and use it in GitHub Desktop.
Checkbox "Show unversioned files" toggle
Index: commit.py
===================================================================
--- commit.py (revision 1647)
+++ commit.py (working copy)
@@ -73,7 +73,7 @@
self.base_dir = base_dir
self.vcs = rabbitvcs.vcs.VCS()
self.items = []
-
+ self.initt = False
self.files_table = rabbitvcs.ui.widget.Table(
self.get_widget("files_table"),
[gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH,
@@ -100,7 +100,7 @@
}
)
self.files_table.allow_multiple()
- self.get_widget("toggle_show_unversioned").set_active(not self.SHOW_UNVERSIONED)
+ self.get_widget("toggle_show_unversioned").set_active(self.SHOW_UNVERSIONED)
self.message = rabbitvcs.ui.widget.TextView(
self.get_widget("message"),
(message and message or "")
@@ -110,7 +110,7 @@
for path in paths:
if self.vcs.is_in_a_or_a_working_copy(path):
self.paths.append(path)
-
+ self.initt = True
#
# Helper functions
#
@@ -200,7 +200,9 @@
self.changes[row[1]] = self.TOGGLE_ALL
def on_toggle_show_unversioned_toggled(self, widget, data=None):
-
+ if not self.initt:
+ return
+
self.SHOW_UNVERSIONED = not self.SHOW_UNVERSIONED
self.populate_files_table()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment