示例#1
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
示例#2
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])
示例#3
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()
示例#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):
        InterfaceView.__init__(self, "dialogs/loading", "Loading")

        self.pbar = rabbitvcs.ui.widget.ProgressBar(
            self.get_widget("pbar")
        )
        self.pbar.start_pulsate()
示例#6
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)
示例#7
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()
示例#8
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()
示例#9
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()
示例#10
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
        )
示例#11
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)
示例#12
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()
示例#13
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()
示例#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):
        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")
        )
示例#16
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()
示例#17
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
示例#18
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
示例#19
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
     )
示例#20
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()
示例#21
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()
示例#22
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)
    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()
示例#24
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
        )
示例#25
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)
示例#26
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")
示例#27
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)
示例#28
0
    def on_key_pressed(self, widget, data):
        if InterfaceView.on_key_pressed(self, widget, data):
            return True

        if data.state & (gtk.gdk.CONTROL_MASK) and gtk.gdk.keyval_name(data.keyval) == "Return":
            self.on_ok_clicked(widget)
            return True
示例#29
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)
示例#30
0
    def on_key_pressed(self, widget, data):
        if InterfaceView.on_key_pressed(self, widget, data):
            return True

        if (data.state & (Gdk.ModifierType.CONTROL_MASK) and
                Gdk.keyval_name(data.keyval) == "Return"):
            self.on_ok_clicked(widget)
            return True
示例#31
0
文件: dialog.py 项目: zwr8/rabbitvcs
    def __init__(self, filename=""):

        InterfaceView.__init__(self, "dialogs/conflict_decision",
                               "ConflictDecision")
        self.get_widget("filename").set_text(filename)
示例#32
0
    def __init__(self, path, branch=None):
        InterfaceView.__init__(self, "branch-merge", "Merge")

        self.path = path
        self.branch = branch
        self.vcs = rabbitvcs.vcs.VCS()
示例#33
0
    def __init__(self, base_dir=None):
        """
        Provides an interface to the settings library.
        """

        InterfaceView.__init__(self, "settings", "Settings")

        self.checker_service = None
        self.settings = rabbitvcs.util.settings.SettingsManager()

        self.get_widget("enable_attributes").set_active(
            int(self.settings.get("general", "enable_attributes")))
        self.get_widget("enable_emblems").set_active(
            int(self.settings.get("general", "enable_emblems")))
        self.get_widget("enable_recursive").set_active(
            int(self.settings.get("general", "enable_recursive")))
        self.get_widget("enable_highlighting").set_active(
            int(self.settings.get("general", "enable_highlighting")))
        self.get_widget("enable_colorize").set_active(
            int(self.settings.get("general", "enable_colorize")))
        self.get_widget("show_debug").set_active(
            int(self.settings.get("general", "show_debug")))
        self.get_widget("enable_subversion").set_active(
            int(self.settings.get("HideItem", "svn")) == 0)
        self.get_widget("enable_git").set_active(
            int(self.settings.get("HideItem", "git")) == 0)
        self.get_widget("enable_hg").set_active(
            int(self.settings.get("HideItem", "hg")) == 0)
        dtfs = []
        dt = datetime.datetime.today()
        # Disambiguate day.
        if dt.day <= 12:
            dt = datetime.datetime(dt.year, dt.month, dt.day + 12, dt.hour,
                                   dt.minute, dt.second)
        for format, label in self.dtformats:
            if label is None:
                label = helper.format_datetime(dt, format)
            dtfs.append([format, label])
        self.datetime_format = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("datetime_format"), dtfs, 2, 1)
        self.datetime_format.set_active_from_value(
            self.settings.get("general", "datetime_format"))
        self.default_commit_message = rabbitvcs.ui.widget.TextView(
            self.get_widget("default_commit_message"))
        self.default_commit_message.set_text(
            S(self.settings.get_multiline("general",
                                          "default_commit_message")).display())
        self.get_widget("diff_tool").set_text(
            S(self.settings.get("external", "diff_tool")).display())
        self.get_widget("diff_tool_swap").set_active(
            int(self.settings.get("external", "diff_tool_swap")))
        self.get_widget("merge_tool").set_text(
            S(self.settings.get("external", "merge_tool")).display())
        self.get_widget("cache_number_repositories").set_text(
            S(self.settings.get("cache", "number_repositories")).display())
        self.get_widget("cache_number_messages").set_text(
            S(self.settings.get("cache", "number_messages")).display())

        self.logging_type = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("logging_type"),
            ["None", "Console", "File", "Both"])
        val = self.settings.get("logging", "type")
        if not val:
            val = "Console"
        self.logging_type.set_active_from_value(val)

        self.logging_level = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("logging_level"),
            ["Debug", "Info", "Warning", "Error", "Critical"])
        val = self.settings.get("logging", "level")
        if not val:
            val = "Debug"
        self.logging_level.set_active_from_value(val)

        # Git Configuration Editor
        show_git = False
        self.file_editor = None
        if base_dir:
            vcs = rabbitvcs.vcs.VCS()
            git_config_files = []
            if vcs.is_in_a_or_a_working_copy(base_dir) and vcs.guess(
                    base_dir)["vcs"] == rabbitvcs.vcs.VCS_GIT:
                git = vcs.git(base_dir)
                git_config_files = git.get_config_files(base_dir)

                self.file_editor = rabbitvcs.ui.widget.MultiFileTextEditor(
                    self.get_widget("git_config_container"),
                    _("Config file:"),
                    git_config_files,
                    git_config_files,
                    show_add_line=False)
                show_git = True

        if show_git:
            self.get_widget("pages").get_nth_page(5).show()
        else:
            self.get_widget("pages").get_nth_page(5).hide()

        self._populate_checker_tab()
    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 = 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_HIDDEN_OBJECT,
                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": 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
            },
            flags={
                "sortable": True,
                "sort_on": 2
            })
        self.files_table.allow_multiple()

        self.items = None
        self.initialize_items()
示例#35
0
文件: dialog.py 项目: zwr8/rabbitvcs
    def __init__(self, realm="", may_save=True):
        InterfaceView.__init__(self, "dialogs/ssl_client_cert_prompt",
                               "SSLClientCertPrompt")

        self.get_widget("sslclientcert_realm").set_label(realm)
        self.get_widget("sslclientcert_save").set_sensitive(may_save)
示例#36
0
文件: dialog.py 项目: zwr8/rabbitvcs
 def __init__(self, message=_("Are you sure you want to continue?")):
     InterfaceView.__init__(self, "dialogs/confirmation", "Confirmation")
     self.get_widget("confirm_message").set_text(message)
示例#37
0
    def __init__(self, realm="", may_save=True):
        InterfaceView.__init__(self, "dialogs/authentication",
                               "Authentication")

        self.get_widget("auth_realm").set_label(realm)
        self.get_widget("auth_save").set_sensitive(may_save)
示例#38
0
 def __init__(self, path):
     InterfaceView.__init__(self, "clean", "Clean")
     self.vcs = rabbitvcs.vcs.VCS()
     self.git = self.vcs.git(path)
     self.path = path
示例#39
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"),
            rabbitvcs.util.helper.get_repository_paths())
        if self.url:
            self.urls.set_child_text(
                rabbitvcs.util.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)

        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:
            rabbitvcs.util.helper.save_repository_path(url)
            self.load()
示例#40
0
    def __init__(self, path):
        InterfaceView.__init__(self, "push", "Push")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
示例#41
0
文件: dialog.py 项目: zwr8/rabbitvcs
 def __init__(self):
     InterfaceView.__init__(self, "dialogs/mark_resolved_prompt",
                            "MarkResolvedPrompt")
示例#42
0
文件: dialog.py 项目: zwr8/rabbitvcs
    def __init__(self):
        InterfaceView.__init__(self, "dialogs/name_email_prompt",
                               "NameEmailPrompt")

        self.dialog = self.get_widget("NameEmailPrompt")
示例#43
0
    def __init__(self, base_dir=None):
        """
        Provides an interface to the settings library.
        """

        InterfaceView.__init__(self, "settings", "Settings")

        self.settings = rabbitvcs.util.settings.SettingsManager()

        langs = []
        language = os.environ.get('LANGUAGE', None)
        if language:
            langs += language.split(":")

        self.language = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("language"), langs)
        self.language.set_active_from_value(
            self.settings.get("general", "language"))
        self.get_widget("enable_attributes").set_active(
            int(self.settings.get("general", "enable_attributes")))
        self.get_widget("enable_emblems").set_active(
            int(self.settings.get("general", "enable_emblems")))
        self.get_widget("enable_recursive").set_active(
            int(self.settings.get("general", "enable_recursive")))
        self.get_widget("show_debug").set_active(
            int(self.settings.get("general", "show_debug")))
        self.get_widget("diff_tool").set_text(
            self.settings.get("external", "diff_tool"))
        self.get_widget("diff_tool_swap").set_active(
            int(self.settings.get("external", "diff_tool_swap")))
        self.get_widget("merge_tool").set_text(
            self.settings.get("external", "merge_tool"))
        self.get_widget("cache_number_repositories").set_text(
            str(self.settings.get("cache", "number_repositories")))
        self.get_widget("cache_number_messages").set_text(
            str(self.settings.get("cache", "number_messages")))

        self.logging_type = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("logging_type"),
            ["None", "Console", "File", "Both"])
        val = self.settings.get("logging", "type")
        if not val:
            val = "Console"
        self.logging_type.set_active_from_value(val)

        self.logging_level = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("logging_level"),
            ["Debug", "Info", "Warning", "Error", "Critical"])
        val = self.settings.get("logging", "level")
        if not val:
            val = "Debug"
        self.logging_level.set_active_from_value(val)

        # Git Configuration Editor
        show_git = False
        self.file_editor = None
        if base_dir:
            vcs = rabbitvcs.vcs.VCS()
            git_config_files = []
            if vcs.is_in_a_or_a_working_copy(base_dir) and vcs.guess(
                    base_dir)["vcs"] == rabbitvcs.vcs.VCS_GIT:
                git = vcs.git(base_dir)
                git_config_files = git.get_config_files(base_dir)

                self.file_editor = rabbitvcs.ui.widget.MultiFileTextEditor(
                    self.get_widget("git_config_container"),
                    _("Config file:"),
                    git_config_files,
                    git_config_files,
                    show_add_line=False)
                show_git = True

        if show_git:
            self.get_widget("pages").get_nth_page(5).show()
        else:
            self.get_widget("pages").get_nth_page(5).hide()

        self._populate_checker_tab()
示例#44
0
 def __init__(self, path, revision=None):
     InterfaceView.__init__(self, "update", "Update")
     self.path = path
     self.revision = revision
     self.vcs = rabbitvcs.vcs.VCS()