def on_urls_key_released(self, widget, data, userdata): if Gdk.keyval_name(data.keyval) == "Return": helper.save_repository_path(self.urls.get_active_text()) self.load()
def __init__(self, url): InterfaceView.__init__(self, "browser", "Browser") self.vcs = rabbitvcs.vcs.VCS() self.svn = self.vcs.svn() self.url = "" if self.svn.is_in_a_or_a_working_copy(url): action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False, run_in_thread=False) self.url = action.run_single(self.svn.get_repo_url, url) elif self.svn.is_path_repository_url(url): self.url = url self.urls = rabbitvcs.ui.widget.ComboBox(self.get_widget("urls"), helper.get_repository_paths()) if self.url: self.urls.set_child_text(helper.unquote_url(self.url)) # We must set a signal handler for the Gtk.Entry inside the combobox # Because glade will not retain that information self.urls.set_child_signal("key-release-event", self.on_urls_key_released) self.revision_selector = rabbitvcs.ui.widget.RevisionSelector( self.get_widget("revision_container"), self.svn, url_combobox=self.urls, expand=True) self.items = [] self.list_table = rabbitvcs.ui.widget.Table( self.get_widget("list"), [ rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_INT, GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_FLOAT ], [_("Path"), _("Revision"), _("Size"), _("Author"), _("Date")], filters=[{ "callback": self.file_filter, "user_data": { "column": 0 } }, { "callback": self.revision_filter, "user_data": { "column": 1 } }, { "callback": self.size_filter, "user_data": { "column": 2 } }, { "callback": self.date_filter, "user_data": { "column": 4 } }], filter_types=[ GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING ], callbacks={ "file-column-callback": self.file_column_callback, "row-activated": self.on_row_activated, "mouse-event": self.on_list_table_mouse_event }, flags={"sortable": True}) self.url_clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) self.repo_root_url = None if self.url: helper.save_repository_path(url) self.load()
def on_refresh_clicked(self, widget): helper.save_repository_path(self.urls.get_active_text()) self.load()
def __init__(self, url): InterfaceView.__init__(self, "browser", "Browser") self.vcs = rabbitvcs.vcs.VCS() self.svn = self.vcs.svn() self.url = "" if self.svn.is_in_a_or_a_working_copy(url): action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False, run_in_thread=False) self.url = action.run_single(self.svn.get_repo_url, url) elif self.svn.is_path_repository_url(url): self.url = url self.urls = rabbitvcs.ui.widget.ComboBox( self.get_widget("urls"), helper.get_repository_paths() ) if self.url: self.urls.set_child_text(helper.unquote_url(self.url)) # We must set a signal handler for the Gtk.Entry inside the combobox # Because glade will not retain that information self.urls.set_child_signal( "key-release-event", self.on_urls_key_released ) self.revision_selector = rabbitvcs.ui.widget.RevisionSelector( self.get_widget("revision_container"), self.svn, url_combobox=self.urls, expand=True ) self.items = [] self.list_table = rabbitvcs.ui.widget.Table( self.get_widget("list"), [rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_INT, GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_FLOAT], [_("Path"), _("Revision"), _("Size"), _("Author"), _("Date")], filters=[{ "callback": self.file_filter, "user_data": { "column": 0 } },{ "callback": self.revision_filter, "user_data": { "column": 1 } },{ "callback": self.size_filter, "user_data": { "column": 2 } },{ "callback": self.date_filter, "user_data": { "column": 4 } }], filter_types=[GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING], callbacks={ "file-column-callback": self.file_column_callback, "row-activated": self.on_row_activated, "mouse-event": self.on_list_table_mouse_event }, flags={ "sortable": True } ) self.clipboard = None self.url_clipboard = Gtk.Clipboard() self.repo_root_url = None if self.url: helper.save_repository_path(url) self.load()
def on_urls_key_released(self, widget, event, *args): if Gdk.keyval_name(event.keyval) == "Return": helper.save_repository_path(self.urls.get_active_text()) self.load()