Пример #1
0
    def __init__(self, path, branch1=None, branch2=None):
        InterfaceView.__init__(self, "branch-merge", "Merge")

        self.path = path
        self.branch1 = branch1
        self.branch2 = branch2
        self.vcs = rabbitvcs.vcs.VCS()
Пример #2
0
    def __init__(self, path=None, url=None, revision=None):
        InterfaceView.__init__(self, "checkout", "Checkout")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"),
            helper.get_repository_paths()
        )

        # We must set a signal handler for the Gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.repositories.set_child_signal(
            "key-release-event",
            self.on_repositories_key_released
        )

        self.destination = helper.get_user_path()
        if path is not None:
            self.destination = path
            self.get_widget("destination").set_text(S(path).display())

        if url is not None:
            self.repositories.set_child_text(url)

        self.complete = False
Пример #3
0
 def __init__(self, name="", value="", recurse=True):
     InterfaceView.__init__(self, "dialogs/property", "Property")
     
     self.save_name = name
     self.save_value = value
     
     self.name = rabbitvcs.ui.widget.ComboBox(
             self.get_widget("property_name"),
             [   # default svn properties
                 'svn:author',
                 'svn:autoversioned',
                 'svn:date',
                 'svn:eol-style',
                 'svn:executable',
                 'svn:externals',
                 'svn:ignore',
                 'svn:keywords',
                 'svn:log',
                 'svn:mergeinfo',
                 'svn:mime-type',
                 'svn:needs-lock',
                 'svn:special',
                 ]
             )
     self.name.set_child_text(name)
     
     self.value = rabbitvcs.ui.widget.TextView(
         self.get_widget("property_value"), 
         value
     )
     
     self.recurse = self.get_widget("property_recurse")
     self.recurse.set_active(recurse)
Пример #4
0
    def __init__(self, path):
        InterfaceView.__init__(self, "manager", "Manager")
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)
        
        self.get_widget("Manager").set_title(_("Remote Repository Manager"))
        self.get_widget("items_label").set_markup(_("<b>Remote Repositories</b>"))
        
        self.selected_branch = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"),
            [gobject.TYPE_STRING, gobject.TYPE_STRING], 
            [_("Name"), _("Host")],
            callbacks={
                "mouse-event":   self.on_treeview_mouse_event,
                "key-event":     self.on_treeview_key_event,
                "cell-edited":   self.on_treeview_cell_edited_event
            },
            flags={
                "sortable": True,
                "sort_on": 0,
                "editable": [0,1]
            }
        )

        self.load()
Пример #5
0
    def __init__(self, paths, base_dir):
        """
        
        @type  paths:   list of strings
        @param paths:   A list of local paths.
        
        """

        InterfaceView.__init__(self, "commit", "Commit")

        # Modify the Commit window to what we need for Create Patch
        window = self.get_widget("Commit")
        window.set_title(_("Create Patch"))
        window.resize(640, 400)
        self.get_widget("commit_to_box").hide()
        self.get_widget("add_message_box").hide()

        self.paths = paths
        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.activated_cache = {}

        self.common = rabbitvcs.util.helper.get_common_directory(paths)

        if not self.vcs.is_versioned(self.common):
            rabbitvcs.ui.dialog.MessageBox(
                _("The given path is not a working copy"))
            raise SystemExit()

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"), [
                gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH,
                gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING
            ], [
                rabbitvcs.ui.widget.TOGGLE_BUTTON,
                _("Path"),
                _("Extension"),
                _("Text Status"),
                _("Property Status")
            ],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated": self.on_files_table_row_activated,
                "mouse-event": self.on_files_table_mouse_event,
                "key-event": self.on_files_table_key_event
            },
            flags={
                "sortable": True,
                "sort_on": 1
            })
        self.files_table.allow_multiple()

        self.items = None
        self.initialize_items()
Пример #6
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/create_folder", "CreateFolder")

        self.folder_name = self.get_widget("folder_name")
        self.textview = rabbitvcs.ui.widget.TextView(
            self.get_widget("log_message"),
            _("Added a folder to the repository"))
Пример #7
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/previous_messages", "PreviousMessages")

        self.message = rabbitvcs.ui.widget.TextView(
            self.get_widget("prevmes_message")
        )

        self.message_table = rabbitvcs.ui.widget.Table(
            self.get_widget("prevmes_table"),
            [gobject.TYPE_STRING, gobject.TYPE_STRING], 
            [_("Date"), _("Message")],
            filters=[{
                "callback": rabbitvcs.ui.widget.long_text_filter,
                "user_data": {
                    "column": 1,
                    "cols": 80
                }
            }],
            callbacks={
                "cursor-changed": self.on_prevmes_table_cursor_changed,
                "row-activated":  self.on_prevmes_table_row_activated
            }
        )
        self.entries = rabbitvcs.util.helper.get_previous_messages()
        if self.entries is None:
            return None
        
        for entry in self.entries:
            self.message_table.append([entry[0],entry[1]])
        
        if len(self.entries) > 0:
            self.message.set_text(self.entries[0][1])
Пример #8
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/loading", "Loading")

        self.get_widget("loading_cancel").set_sensitive(False)

        self.pbar = rabbitvcs.ui.widget.ProgressBar(self.get_widget("pbar"))
        self.pbar.start_pulsate()
Пример #9
0
    def __init__(self, path1=None, revision1=None, path2=None, revision2=None):
        InterfaceView.__init__(self, "changes", "Changes")
        
        self.vcs = rabbitvcs.vcs.VCS()

        self.MORE_ACTIONS_CALLBACKS = [
            None,
            self.on_more_actions_view_unified_diff
        ]

        self.more_actions = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("more_actions"),
            self.MORE_ACTIONS_ITEMS
        )
        self.more_actions.set_active(0)

        repo_paths = rabbitvcs.util.helper.get_repository_paths()
        self.first_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("first_urls"), 
            repo_paths
        )
        self.first_urls_browse = self.get_widget("first_urls_browse")

        self.second_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("second_urls"), 
            repo_paths
        )
        self.second_urls_browse = self.get_widget("second_urls_browse")
Пример #10
0
    def __init__(self, paths, base_dir=None):
        InterfaceView.__init__(self, "revert", "Revert")

        self.paths = paths
        self.base_dir = base_dir
        self.last_row_clicked = None
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []

        self.statuses = self.vcs.statuses_for_revert(paths)
        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"),
            [gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH,
                gobject.TYPE_STRING],
            [rabbitvcs.ui.widget.TOGGLE_BUTTON, _("Path"), _("Extension")],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event
            }
        )

        self.initialize_items()
Пример #11
0
    def __init__(self, path, revision=None):
        InterfaceView.__init__(self, "manager", "Manager")

        self.path = path

        self.get_widget("right_side").show()
        self.get_widget("Manager").set_size_request(695, -1)
        self.get_widget("Manager").set_title(_("Tag Manager"))
        self.get_widget("items_label").set_markup(_("<b>Tags</b>"))

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        self.revision_obj = self.git.revision(revision)

        self.selected_tag = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"), [gobject.TYPE_STRING],
            [_("Tag")],
            callbacks={
                "mouse-event": self.on_treeview_mouse_event,
                "key-event": self.on_treeview_key_event
            },
            flags={
                "sortable": True,
                "sort_on": 0
            })
        self.initialize_detail()
        self.load(self.show_add)
Пример #12
0
    def __init__(self, title=None, message=""):
        InterfaceView.__init__(self, "dialogs/text_change", "TextChange")
        if title:
            self.get_widget("TextChange").set_title(title)

        self.textview = rabbitvcs.ui.widget.TextView(
            self.get_widget("textchange_message"), message)
Пример #13
0
    def __init__(self, path):
        InterfaceView.__init__(self, "manager", "Manager")
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        self.get_widget("right_side").hide()
        self.get_widget("Manager").set_title(_("Remote Repository Manager"))
        self.get_widget("items_label").set_markup(
            _("<b>Remote Repositories</b>"))

        self.selected_branch = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"),
            [GObject.TYPE_STRING, GObject.TYPE_STRING],
            [_("Name"), _("Host")],
            callbacks={
                "mouse-event": self.on_treeview_mouse_event,
                "key-event": self.on_treeview_key_event,
                "cell-edited": self.on_treeview_cell_edited_event
            },
            flags={
                "sortable": False,
                "sort_on": 0,
                "editable": [0, 1]
            })

        self.load()
Пример #14
0
    def __init__(self, path1=None, revision1=None, path2=None, revision2=None):
        InterfaceView.__init__(self, "changes", "Changes")

        self.vcs = rabbitvcs.vcs.VCS()

        self.MORE_ACTIONS_CALLBACKS = [
            None,
            self.on_more_actions_view_unified_diff
        ]

        self.more_actions = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("more_actions"),
            self.MORE_ACTIONS_ITEMS
        )
        self.more_actions.set_active(0)

        repo_paths = helper.get_repository_paths()
        self.first_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("first_urls"),
            repo_paths
        )
        self.first_urls_browse = self.get_widget("first_urls_browse")

        self.second_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("second_urls"),
            repo_paths
        )
        self.second_urls_browse = self.get_widget("second_urls_browse")
Пример #15
0
    def __init__(self, paths, base_dir=None, message=None):
        """

        @type  paths:   list of strings
        @param paths:   A list of local paths.

        """
        InterfaceView.__init__(self, "commit", "Commit")

        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"), [
                GObject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_HIDDEN_OBJECT,
                rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_STRING,
                rabbitvcs.ui.widget.TYPE_STATUS, GObject.TYPE_STRING
            ], [
                rabbitvcs.ui.widget.TOGGLE_BUTTON, "",
                _("Path"),
                _("Extension"),
                _("Text Status"),
                _("Property Status")
            ],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 2
                }
            }],
            callbacks={
                "row-activated": self.on_files_table_row_activated,
                "mouse-event": self.on_files_table_mouse_event,
                "key-event": self.on_files_table_key_event,
                "row-toggled": self.on_files_table_toggle_event
            },
            flags={
                "sortable": True,
                "sort_on": 2
            })
        self.files_table.allow_multiple()
        self.get_widget("toggle_show_unversioned").set_active(
            self.SHOW_UNVERSIONED)
        if not message:
            message = self.SETTINGS.get_multiline("general",
                                                  "default_commit_message")
        self.message = rabbitvcs.ui.widget.TextView(self.get_widget("message"),
                                                    message)

        self.paths = []
        for path in paths:
            if self.vcs.is_in_a_or_a_working_copy(path):
                self.paths.append(S(path))

        self.commit_and_push = False
        self.repository_selector = None
        self.is_git = False
        self.datetime_format = "%y.%m.%d (%a) %p %I:%M"
Пример #16
0
    def __init__(self, path, pattern=""):
        InterfaceView.__init__(self, "ignore", "Ignore")

        self.path = path
        self.pattern = pattern

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        ignore_files = self.git.get_ignore_files(path)
        ignore_file_labels = []

        path_dir = os.path.abspath(self.path)
        if os.path.isfile(path_dir):
            path_dir = os.path.dirname(path_dir)

        for ignore_file in ignore_files:
            label = path
            if ignore_file.startswith(path_dir):
               label = ignore_file[len(path_dir)+1:]

            ignore_file_labels.append(label)

        text = ""
        if pattern != path:
            text = pattern

        self.file_editor = rabbitvcs.ui.widget.MultiFileTextEditor(
            self.get_widget("fileeditor_container"),
            _("Ignore file:"),
            ignore_file_labels,
            ignore_files,
            show_add_line=True,
            line_content=text
        )
Пример #17
0
    def __init__(self, path, revision_range = None):
        InterfaceView.__init__(self, "merge", "Merge")
        
        self.revision_range = revision_range
        
        self.assistant = self.get_widget("Merge")
        
        self.path = path
        
        self.page = self.assistant.get_nth_page(0)
        self.last_page = None
        
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        if not self.svn.has_merge2():
            self.get_widget("mergetype_range_opt").set_sensitive(False)
            self.get_widget("mergetype_tree_opt").set_active(True)
            self.get_widget("mergetype_reintegrate_opt").set_active(False) 
            self.get_widget("mergeoptions_only_record").set_active(False)

        if not self.svn.has_merge_reintegrate():
            self.get_widget("mergetype_reintegrate_opt").set_sensitive(False)

        self.assistant.set_page_complete(self.page, True)
        self.assistant.set_forward_page_func(self.on_forward_clicked)
        
        self.repo_paths = rabbitvcs.util.helper.get_repository_paths()

        # Keeps track of which stages should be marked as complete
        self.type = None

        self.initialize_root_url()
Пример #18
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/loading", "Loading")

        self.pbar = rabbitvcs.ui.widget.ProgressBar(
            self.get_widget("pbar")
        )
        self.pbar.start_pulsate()
Пример #19
0
    def __init__(self, path, revision=""):
        InterfaceView.__init__(self, "manager", "Manager")

        self.path = path
        
        self.get_widget("right_side").show()
        self.get_widget("Manager").set_size_request(695, -1)
        self.get_widget("Manager").set_title(_("Branch Manager"))
        self.get_widget("items_label").set_markup(_("<b>Branches</b>"))

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)
        self.revision = self.git.revision(revision)
        
        self.selected_branch = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"),
            [rabbitvcs.ui.widget.TYPE_MARKUP], 
            [_("Branch")],
            callbacks={
                "mouse-event":   self.on_treeview_mouse_event,
                "key-event":     self.on_treeview_key_event
            }
        )
        self.initialize_detail()
        self.load()
        
        if self.revision:
            revision_branches = self.git.branch_list(self.revision)
            self.show_edit(revision_branches[0].name)
        else:
            self.show_add()
Пример #20
0
    def __init__(self, path, revision=None):
        if os.path.isdir(path):
            MessageBox(_("Cannot annotate a directory"))
            raise SystemExit()
            return

        InterfaceView.__init__(self, "annotate", "Annotate")

        self.get_widget("Annotate").set_title(_("Annotate - %s") % path)
        self.vcs = rabbitvcs.vcs.VCS()

        sm = SettingsManager()
        self.datetime_format = sm.get("general", "datetime_format")
        self.colorize = sm.get("general", "enable_colorize")

        self.log_by_order = []
        self.log_by_revision = {}
        self.author_background = {}
        self.history = [revision or "HEAD"]
        self.history_index = 0
        self.loading_dialog = None

        self.table = self.build_table()
        self.revision = self.get_widget("revision")
        self.history_first = Clickable(self.get_widget("history_first"))
        self.history_prev = Clickable(self.get_widget("history_prev"))
        self.history_next = Clickable(self.get_widget("history_next"))
        self.history_last = Clickable(self.get_widget("history_last"))
        self.history_first.connect("single-click", self.on_history_first)
        self.history_prev.connect("single-click", self.on_history_prev)
        self.history_prev.connect("long-click", self.history_popup_menu)
        self.history_next.connect("single-click", self.on_history_next)
        self.history_next.connect("long-click", self.history_popup_menu)
        self.history_last.connect("single-click", self.on_history_last)
        self.set_history_sensitive()
Пример #21
0
    def __init__(self, path=None, url=None, revision=None):
        InterfaceView.__init__(self, "checkout", "Checkout")
        
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"), 
            rabbitvcs.util.helper.get_repository_paths()
        )
        
        # We must set a signal handler for the gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.repositories.set_child_signal(
            "key-release-event", 
            self.on_repositories_key_released
        )

        self.destination = rabbitvcs.util.helper.get_user_path()
        if path is not None:
            self.destination = path
            self.get_widget("destination").set_text(path)

        if url is not None:
            self.repositories.set_child_text(url)
        
        self.complete = False
Пример #22
0
    def __init__(self, path, revision=None):
        InterfaceView.__init__(self, "branch", "Branch")

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        self.path = path
        self.revision = revision

        status = self.vcs.status(self.path)

        repo_paths = rabbitvcs.util.helper.get_repository_paths()
        self.from_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("from_urls"), repo_paths)
        self.to_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("to_urls"),
            rabbitvcs.util.helper.get_repository_paths())

        repository_url = self.svn.get_repo_url(path)
        self.from_urls.set_child_text(repository_url)
        self.to_urls.set_child_text(repository_url)

        self.message = rabbitvcs.ui.widget.TextView(self.get_widget("message"))

        self.revision_selector = rabbitvcs.ui.widget.RevisionSelector(
            self.get_widget("revision_container"),
            self.svn,
            revision=revision,
            url_combobox=self.from_urls,
            expand=True)

        if (self.revision is None and status.has_modified()):
            self.revision_selector.set_kind_working()
Пример #23
0
    def __init__(self, path, revision=None):
        InterfaceView.__init__(self, "manager", "Manager")
        
        self.path = path
        
        self.get_widget("right_side").show()        
        self.get_widget("Manager").set_size_request(695, -1)
        self.get_widget("Manager").set_title(_("Tag Manager"))
        self.get_widget("items_label").set_markup(_("<b>Tags</b>"))
                
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        self.revision_obj = self.git.revision(revision)
        
        self.selected_tag = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"),
            [gobject.TYPE_STRING], 
            [_("Tag")],
            callbacks={
                "mouse-event":   self.on_treeview_mouse_event,
                "key-event":     self.on_treeview_key_event
            },
            flags={
                "sortable": True,
                "sort_on": 0
            }
        )
        self.initialize_detail()
        self.load(self.show_add)
Пример #24
0
    def __init__(self, path, pattern=""):
        InterfaceView.__init__(self, "ignore", "Ignore")

        self.path = path
        self.pattern = pattern

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        ignore_files = self.git.get_ignore_files(path)
        ignore_file_labels = []

        path_dir = os.path.abspath(self.path)
        if os.path.isfile(path_dir):
            path_dir = os.path.dirname(path_dir)

        for ignore_file in ignore_files:
            label = path
            if ignore_file.startswith(path_dir):
                label = ignore_file[len(path_dir) + 1:]

            ignore_file_labels.append(label)

        text = ""
        if pattern != path:
            text = pattern

        self.file_editor = rabbitvcs.ui.widget.MultiFileTextEditor(
            self.get_widget("fileeditor_container"),
            _("Ignore file:"),
            ignore_file_labels,
            ignore_files,
            show_add_line=True,
            line_content=text)
Пример #25
0
    def __init__(self, path, revision=""):
        InterfaceView.__init__(self, "manager", "Manager")

        self.path = path

        self.get_widget("right_side").show()
        self.get_widget("Manager").set_size_request(695, -1)
        self.get_widget("Manager").set_title(_("Branch Manager"))
        self.get_widget("items_label").set_markup(_("<b>Branches</b>"))

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)
        self.revision = self.git.revision(revision)

        self.selected_branch = None
        self.items_treeview = rabbitvcs.ui.widget.Table(
            self.get_widget("items_treeview"),
            [rabbitvcs.ui.widget.TYPE_MARKUP], [_("Branch")],
            callbacks={
                "mouse-event": self.on_treeview_mouse_event,
                "key-event": self.on_treeview_key_event
            })
        self.initialize_detail()
        self.load()

        if self.revision:
            revision_branches = self.git.branch_list(self.revision)
            self.show_edit(revision_branches[0].name)
        else:
            self.show_add()
Пример #26
0
    def __init__(self, message):
        InterfaceView.__init__(self, "dialogs/message_box", "MessageBox")
        self.get_widget("messagebox_message").set_text(message)

        dialog = self.get_widget("MessageBox")
        dialog.run()
        dialog.destroy()
Пример #27
0
    def __init__(self, path, revision_range=None):
        InterfaceView.__init__(self, "merge", "Merge")

        self.revision_range = revision_range

        self.assistant = self.get_widget("Merge")

        self.path = path

        self.page = self.assistant.get_nth_page(0)
        self.last_page = None

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if not self.svn.has_merge2():
            self.get_widget("mergetype_range_opt").set_sensitive(False)
            self.get_widget("mergetype_tree_opt").set_active(True)
            self.get_widget("mergetype_reintegrate_opt").set_active(False)
            self.get_widget("mergeoptions_only_record").set_active(False)

        if not self.svn.has_merge_reintegrate():
            self.get_widget("mergetype_reintegrate_opt").set_sensitive(False)

        self.assistant.set_page_complete(self.page, True)
        self.assistant.set_forward_page_func(self.on_forward_clicked)

        self.repo_paths = rabbitvcs.util.helper.get_repository_paths()

        # Keeps track of which stages should be marked as complete
        self.type = None

        self.initialize_root_url()
Пример #28
0
    def __init__(self, paths, base_dir=None):
        InterfaceView.__init__(self, "revert", "Revert")

        self.paths = paths
        self.base_dir = base_dir
        self.last_row_clicked = None
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []

        self.statuses = self.vcs.statuses_for_revert(paths)
        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"),
            [gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH,
                gobject.TYPE_STRING],
            [rabbitvcs.ui.widget.TOGGLE_BUTTON, _("Path"), _("Extension")],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event
            }
        )

        self.initialize_items()
Пример #29
0
    def __init__(self, paths, base_dir=None):
        InterfaceView.__init__(self, "add", "Add")

        self.window = self.get_widget("Add")
        self.window.set_title(_("Stage"))

        self.paths = paths
        self.base_dir = base_dir
        self.last_row_clicked = None
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(self.paths[0])
        self.items = None
        self.statuses = self.git.STATUSES_FOR_STAGE
        self.show_ignored = False
        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"), 
            [gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH, 
                gobject.TYPE_STRING], 
            [rabbitvcs.ui.widget.TOGGLE_BUTTON, _("Path"), _("Extension")],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event
            }
        )

        self.initialize_items()
Пример #30
0
    def __init__(self, paths, base_dir=None, message=None):
        """

        @type  paths:   list of strings
        @param paths:   A list of local paths.

        """
        InterfaceView.__init__(self, "commit", "Commit")

        self.isInitDone = False
        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"), [
                GObject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH,
                GObject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_STATUS,
                GObject.TYPE_STRING
            ], [
                rabbitvcs.ui.widget.TOGGLE_BUTTON,
                _("Path"),
                _("Extension"),
                _("Text Status"),
                _("Property Status")
            ],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated": self.on_files_table_row_activated,
                "mouse-event": self.on_files_table_mouse_event,
                "key-event": self.on_files_table_key_event,
                "row-toggled": self.on_files_table_toggle_event
            },
            flags={
                "sortable": True,
                "sort_on": 1
            })
        self.files_table.allow_multiple()
        self.get_widget("toggle_show_unversioned").set_active(
            self.SHOW_UNVERSIONED)
        msgtextview = self.get_widget("message")
        self.message = rabbitvcs.ui.widget.TextView(
            msgtextview, (message and message or ""))
        messagebuf = msgtextview.get_buffer()
        messagebuf.connect("changed", self.on_message_changed)
        self.on_message_changed(messagebuf)

        self.paths = []
        for path in paths:
            if self.vcs.is_in_a_or_a_working_copy(path):
                self.paths.append(path)

        self.isInitDone = True
Пример #31
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/create_folder", "CreateFolder")

        self.folder_name = self.get_widget("folder_name")
        self.textview = rabbitvcs.ui.widget.TextView(
            self.get_widget("log_message"), 
            _("Added a folder to the repository")
        )
Пример #32
0
    def __init__(self, path):
        InterfaceView.__init__(self, "push", "Push")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()

        sm = rabbitvcs.util.settings.SettingsManager()
        self.datetime_format = sm.get("general", "datetime_format")
Пример #33
0
    def __init__(self, path):
        '''
        Initialises the UI.
        '''
        InterfaceView.__init__(self, "property_editor", "PropertyEditor")

        note = rabbitvcs.ui.wraplabel.WrapLabel(PROP_EDITOR_NOTE)
        note.set_hexpand(True)
        note.set_use_markup(True)

        self.get_widget("note_box").add(note)
        self.get_widget("note_box").show_all()

        self.path = path

        self.get_widget("wc_text").set_text(self.get_local_path(os.path.realpath(path)))

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if not self.svn.is_versioned(self.path):
            rabbitvcs.ui.dialog.MessageBox(_("File is not under version control."))
            self.close()
            return

        self.get_widget("remote_uri_text").set_text(self.svn.get_repo_url(path))

        self.table = rabbitvcs.ui.widget.Table(
            self.get_widget("table"),
            [GObject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_ELLIPSIZED,
             GObject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_STATUS],
            [_("Name"), _("Value"), _("Reserved"), _("Status")],

            filters=[
                {
                    "callback": rabbitvcs.ui.widget.long_text_filter,
                    "user_data": {
                        "cols": 0,
                        "column": 1
                    }
                },

                {
                    "callback": rabbitvcs.ui.widget.translate_filter,
                    "user_data": {
                        "column": 3
                    }
                }],

            callbacks={
                "row-activated":  self.on_table_row_activated,
                "mouse-event":   self.on_table_mouse_event,
                "key-event":     self.on_table_key_event
            }
        )
        self.table.allow_multiple()

        self.refresh()
Пример #34
0
    def __init__(self, paths, base_dir=None, message=None):
        """
        
        @type  paths:   list of strings
        @param paths:   A list of local paths.
        
        """
        InterfaceView.__init__(self, "commit", "Commit")

        # TODO read from settings
        self.ignore_file_name = '.rabbitignore'
        self.local_ignore_files_pattern = []

        self.isInitDone = False
        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []
        self.hide_local_ignore_files = False

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"),
            [gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH, 
                gobject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_STATUS,
                gobject.TYPE_STRING], 
            [rabbitvcs.ui.widget.TOGGLE_BUTTON, _("Path"), _("Extension"), 
                _("Text Status"), _("Property Status")],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event,
                "row-toggled":   self.on_files_table_toggle_event
            },
            flags={
                "sortable": True, 
                "sort_on": 1
            }
        )
        self.files_table.allow_multiple()
        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 "")
        )

        self.paths = []
        for path in paths:
            if self.vcs.is_in_a_or_a_working_copy(path):
                self.paths.append(path)

        self.isInitDone = True
Пример #35
0
    def __init__(self, callback_cancel=None, visible=True):
        InterfaceView.__init__(self)

        if visible:
            self.show()

        self.callback_cancel = callback_cancel
        self.was_canceled_by_user = False
        self.canceled = False
Пример #36
0
    def __init__(self, paths):
        InterfaceView.__init__(self, "git-update", "Update")

        self.paths = paths
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(paths[0])

        self.repository_selector = rabbitvcs.ui.widget.GitRepositorySelector(
            self.get_widget("repository_container"), self.git)
Пример #37
0
    def __init__(self, callback_cancel=None, visible=True):
        InterfaceView.__init__(self)

        if visible:
            self.show()

        self.callback_cancel = callback_cancel
        self.was_canceled_by_user = False
        self.canceled = False
Пример #38
0
    def __init__(self, path, branch=None):
        InterfaceView.__init__(self, "branch-merge", "Merge")

        self.path = path
        self.branch = branch
        self.vcs = rabbitvcs.vcs.VCS()

        sm = rabbitvcs.util.settings.SettingsManager()
        self.datetime_format = sm.get("general", "datetime_format")
Пример #39
0
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/loading", "Loading")
    
        self.get_widget("loading_cancel").set_sensitive(False)

        self.pbar = rabbitvcs.ui.widget.ProgressBar(
            self.get_widget("pbar")
        )
        self.pbar.start_pulsate()
Пример #40
0
 def __init__(self, title=None, message=""):
     InterfaceView.__init__(self, "dialogs/text_change", "TextChange")
     if title:
         self.get_widget("TextChange").set_title(title)
     
     self.textview = rabbitvcs.ui.widget.TextView(
         self.get_widget("textchange_message"), 
         message
     )
Пример #41
0
    def __init__(self, path):
        '''
        Initialises the UI.
        '''
        InterfaceView.__init__(self, "property_editor", "PropertyEditor")

        note = rabbitvcs.ui.wraplabel.WrapLabel(PROP_EDITOR_NOTE)
        note.set_hexpand(True)
        note.set_use_markup(True)

        self.get_widget("note_box").add(note)
        self.get_widget("note_box").show_all()

        self.path = path

        self.get_widget("wc_text").set_text(
            self.get_local_path(os.path.realpath(path)))

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if not self.svn.is_versioned(self.path):
            rabbitvcs.ui.dialog.MessageBox(
                _("File is not under version control."))
            self.close()
            return

        self.get_widget("remote_uri_text").set_text(
            self.svn.get_repo_url(path))

        self.table = rabbitvcs.ui.widget.Table(
            self.get_widget("table"), [
                GObject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_ELLIPSIZED,
                GObject.TYPE_STRING, rabbitvcs.ui.widget.TYPE_STATUS
            ],
            [_("Name"), _("Value"),
             _("Reserved"), _("Status")],
            filters=[{
                "callback": rabbitvcs.ui.widget.long_text_filter,
                "user_data": {
                    "cols": 0,
                    "column": 1
                }
            }, {
                "callback": rabbitvcs.ui.widget.translate_filter,
                "user_data": {
                    "column": 3
                }
            }],
            callbacks={
                "row-activated": self.on_table_row_activated,
                "mouse-event": self.on_table_mouse_event,
                "key-event": self.on_table_key_event
            })
        self.table.allow_multiple()

        self.refresh()
Пример #42
0
    def __init__(self, path, revision=None):
        if os.path.isdir(path):
            MessageBox(_("Cannot annotate a directory"))
            raise SystemExit()
            return

        InterfaceView.__init__(self, "annotate", "Annotate")

        self.get_widget("Annotate").set_title(_("Annotate - %s") % path)
        self.vcs = rabbitvcs.vcs.VCS()
Пример #43
0
 def __init__(self, path=None):
     InterfaceView.__init__(self, "dialogs/delete_confirmation", "DeleteConfirmation")
     
     if path:
         path = "\"%s\"" % os.path.basename(path)
     else:
         path = _("the selected item(s)")
         
     msg = self.get_widget("message").get_label().replace("%item%", path)
     self.get_widget("message").set_label(msg)
Пример #44
0
    def __init__(self, path, revision=None):
        if os.path.isdir(path):
            MessageBox(_("Cannot annotate a directory"))
            raise SystemExit()
            return
            
        InterfaceView.__init__(self, "annotate", "Annotate")

        self.get_widget("Annotate").set_title(_("Annotate - %s") % path)
        self.vcs = rabbitvcs.vcs.VCS()
Пример #45
0
    def __init__(self, paths, base_dir):
        """
        
        @type  paths:   list of strings
        @param paths:   A list of local paths.
        
        """

        InterfaceView.__init__(self, "commit", "Commit")

        # Modify the Commit window to what we need for Create Patch
        window = self.get_widget("Commit")
        window.set_title(_("Create Patch"))
        window.resize(640, 400)
        self.get_widget("commit_to_box").hide()
        self.get_widget("add_message_box").hide()

        self.paths = paths
        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.activated_cache = {}
        
        self.common = rabbitvcs.util.helper.get_common_directory(paths)

        if not self.vcs.is_versioned(self.common):
            rabbitvcs.ui.dialog.MessageBox(_("The given path is not a working copy"))
            raise SystemExit()

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"),
            [gobject.TYPE_BOOLEAN, rabbitvcs.ui.widget.TYPE_PATH, 
                gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING], 
            [rabbitvcs.ui.widget.TOGGLE_BUTTON, _("Path"), _("Extension"), 
                _("Text Status"), _("Property Status")],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 1
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event
            },
            flags={
                "sortable": True, 
                "sort_on": 1
            }
        )
        self.files_table.allow_multiple()
        
        self.items = None
        self.initialize_items()
Пример #46
0
    def __init__(self, paths):
        InterfaceView.__init__(self, "git-update", "Update")

        self.paths = paths
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(paths[0])

        self.repository_selector = rabbitvcs.ui.widget.GitRepositorySelector(
            self.get_widget("repository_container"),
            self.git
        )
Пример #47
0
 def __init__(self, realm="", host="", 
         issuer="", valid_from="", valid_until="", fingerprint=""):
         
     InterfaceView.__init__(self, "dialogs/certificate", "Certificate")
     
     self.get_widget("cert_realm").set_label(realm)
     self.get_widget("cert_host").set_label(host)
     self.get_widget("cert_issuer").set_label(issuer)
     to_str = _("to")
     self.get_widget("cert_valid").set_label(
         "%s %s %s" % (valid_from, to_str, valid_until)
     )
     self.get_widget("cert_fingerprint").set_label(fingerprint)
Пример #48
0
    def __init__(self, paths, base_dir=None):
        """

        @type  paths:   list of strings
        @param paths:   A list of local paths.

        """
        InterfaceView.__init__(self, "altdiff", "AltDiff")

        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []

        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"), [
                rabbitvcs.ui.widget.TYPE_HIDDEN_OBJECT,
                rabbitvcs.ui.widget.TYPE_HIDDEN_OBJECT,
                rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_STRING,
                rabbitvcs.ui.widget.TYPE_STATUS, GObject.TYPE_STRING
            ], [
                "", "",
                _("Path"),
                _("Extension"),
                _("Text Status"),
                _("Property Status")
            ],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 2
                }
            }],
            callbacks={
                "row-activated": self.on_files_table_row_activated,
                "mouse-event": self.on_files_table_mouse_event,
                "key-event": self.on_files_table_key_event,
                "row-toggled": self.on_files_table_toggle_event
            },
            flags={
                "sortable": True,
                "sort_on": 2
            })
        self.files_table.allow_multiple()
        self.get_widget("toggle_show_unversioned").set_active(
            self.SHOW_UNVERSIONED)

        self.paths = []
        for path in paths:
            if self.vcs.is_in_a_or_a_working_copy(path):
                self.paths.append(S(path))
Пример #49
0
    def __init__(self, paths, base_dir=None):
        InterfaceView.__init__(self, "noskiptree", "Noskiptree")

        self.paths = paths
        self.base_dir = base_dir
        self.last_row_clicked = None
        self.vcs = rabbitvcs.vcs.VCS()
        self.items = []
        self.show_ignored = False
        self.file_make = False
        self.is_git = True
        self.show_no_skipped = False
        self.statuses = ["normal", "modified", "missing"]
        
        
        # TODO Remove this when there is svn support
        if rabbitvcs.vcs.guess(self.paths[0])['vcs'] == rabbitvcs.vcs.VCS_SVN:
            self.is_git = False
        elif rabbitvcs.vcs.guess(self.paths[0])['vcs'] == rabbitvcs.vcs.VCS_GIT:
            self.is_git = True
        else:
            return

        columns = [[GObject.TYPE_BOOLEAN,
                    rabbitvcs.ui.widget.TYPE_HIDDEN_OBJECT,
                    rabbitvcs.ui.widget.TYPE_PATH,
                    GObject.TYPE_STRING],
                   [rabbitvcs.ui.widget.TOGGLE_BUTTON, "", _("Path"),
                    _("Extension")]]


        self.files_table = rabbitvcs.ui.widget.Table(
            self.get_widget("files_table"),
            columns[0],
            columns[1],
            filters=[{
                "callback": rabbitvcs.ui.widget.path_filter,
                "user_data": {
                    "base_dir": base_dir,
                    "column": 2
                }
            }],
            callbacks={
                "row-activated":  self.on_files_table_row_activated,
                "mouse-event":   self.on_files_table_mouse_event,
                "key-event":     self.on_files_table_key_event
            }
        )

        self.initialize_items()
Пример #50
0
 def __init__(self, title=None, label=None, current_text=None):
     InterfaceView.__init__(self, "dialogs/one_line_text_change", "OneLineTextChange")
     if title:
         self.get_widget("OneLineTextChange").set_title(title)
     
     self.new_text = self.get_widget("new_text")
     self.label = self.get_widget("label")
     
     if label:
         self.label.set_text(label)
     
     if current_text:
         self.new_text.set_text(current_text)
 
     self.dialog = self.get_widget("OneLineTextChange")
Пример #51
0
    def __init__(self, paths, base_dir=None, message=None):
        """
        
        @type  paths:   list of strings
        @param paths:   A list of local paths.
        
        """
        InterfaceView.__init__(self, "commit", "Commit")

        self.base_dir = base_dir
        self.vcs = rabbitvcs.vcs.VCS()

        self.paths = []
        for path in paths:
            if self.vcs.is_in_a_or_a_working_copy(path):
                self.paths.append(path)
Пример #52
0
 def __init__(self, name="", value="", recurse=True):
     InterfaceView.__init__(self, "dialogs/property", "Property")
     
     self.save_name = name
     self.save_value = value
     
     self.name = self.get_widget("property_name")
     self.name.set_text(name)
     
     self.value = rabbitvcs.ui.widget.TextView(
         self.get_widget("property_value"), 
         value
     )
     
     self.recurse = self.get_widget("property_recurse")
     self.recurse.set_active(recurse)
Пример #53
0
    def __init__(self, text):
        InterfaceView.__init__(self, "dialogs/error_notification", "ErrorNotification")
        
        notice = rabbitvcs.ui.wraplabel.WrapLabel(ERROR_NOTICE)
        notice.set_use_markup(True)
        
        self.get_widget("notice_box").pack_start(notice)        
        self.get_widget("notice_box").show_all()

        self.textview = rabbitvcs.ui.widget.TextView(
            self.get_widget("error_text"), 
            text,
            spellcheck=False
        )
        
        self.textview.view.modify_font(pango.FontDescription("monospace"))
        
        dialog = self.get_widget("ErrorNotification")
        dialog.run()
        dialog.destroy()
Пример #54
0
 def __init__(self, path):
     InterfaceView.__init__(self, "import", "Import")
     
     self.get_widget("Import").set_title(_("Import - %s") % path)
     
     self.path = path
     self.vcs = rabbitvcs.vcs.VCS()
     self.svn = self.vcs.svn()
     
     if self.svn.is_in_a_or_a_working_copy(path):
         self.get_widget("repository").set_text(self.svn.get_repo_url(path))
     
     self.repositories = rabbitvcs.ui.widget.ComboBox(
         self.get_widget("repositories"), 
         rabbitvcs.util.helper.get_repository_paths()
     )
     
     self.message = rabbitvcs.ui.widget.TextView(
         self.get_widget("message")
     )