示例#1
0
 def init_repo_root_url(self):
     if self.repo_root_url is None and self.svn.is_in_a_or_a_working_copy(
             self.url):
         action = rabbitvcs.ui.action.SVNAction(self.svn,
                                                notification=False,
                                                run_in_thread=False)
         self.repo_root_url = action.run_single(self.svn.get_repo_root_url,
                                                self.url)
示例#2
0
    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()
示例#3
0
    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()
示例#4
0
 def init_repo_root_url(self):
     if self.repo_root_url is None and self.svn.is_in_a_or_a_working_copy(self.url):
         action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False, run_in_thread=False)
         self.repo_root_url = action.run_single(self.svn.get_repo_root_url, self.url)