Example #1
0
    def __init__(self):
        # Create a global client we can use to do VCS related stuff
        self.vcs_client = VCS()

        self.status_checker = StatusChecker()

        self.status_checker.assert_version(EXT_VERSION)

        self.items_cache = {}
Example #2
0
    def __init__(self, path, vcs=None, claim_domain=True):
        rabbitvcs.ui.GtkBuilderWidgetWrapper.__init__(
            self, claim_domain=claim_domain)

        self.path = path
        self.vcs = vcs or rabbitvcs.vcs.VCS()
        self.checker = StatusChecker()

        self.get_widget("file_name").set_text(os.path.basename(path))

        self.status = self.checker.check_status(path,
                                                recurse=False,
                                                invalidate=False,
                                                summary=False)

        self.get_widget("vcs_type").set_text(self.status.vcs_type)

        self.get_widget("content_status").set_text(
            helper.to_text(self.status.simple_content_status()))
        self.get_widget("prop_status").set_text(
            helper.to_text(self.status.simple_metadata_status()))

        self.set_icon_from_status(self.get_widget("content_status_icon"),
                                  self.status.simple_content_status())

        self.set_icon_from_status(self.get_widget("prop_status_icon"),
                                  self.status.simple_metadata_status())

        self.set_icon_from_status(self.get_widget("vcs_icon"),
                                  self.status.single, Gtk.IconSize.DIALOG)

        additional_info = self.get_additional_info()
        if additional_info:
            additional_props_table = rabbitvcs.ui.widget.KeyValueTable(
                additional_info)
            additional_props_table.show()

            file_info_table = rabbitvcs.ui.widget.Box(
                self.get_widget("file_info_table"), vertical=True)
            file_info_table.pack_start(additional_props_table,
                                       expand=False,
                                       fill=False,
                                       padding=0)
Example #3
0
    def __init__(self):
        threading.currentThread().setName("RabbitVCS extension thread")

        self.status_checker = StatusChecker()
Example #4
0
    def __init__(self):
        factory = Gtk.IconFactory()

        rabbitvcs_icons = [
            "scalable/actions/rabbitvcs-settings.svg",
            "scalable/actions/rabbitvcs-export.svg",
            "scalable/actions/rabbitvcs-properties.svg",
            "scalable/actions/rabbitvcs-show_log.svg",
            "scalable/actions/rabbitvcs-delete.svg",
            "scalable/actions/rabbitvcs-run.svg",
            "scalable/actions/rabbitvcs-unlock.svg",
            "scalable/actions/rabbitvcs-dbus.svg",
            "scalable/actions/rabbitvcs-rename.svg",
            "scalable/actions/rabbitvcs-help.svg",
            "scalable/actions/rabbitvcs-update.svg",
            "scalable/actions/rabbitvcs-diff.svg",
            "scalable/actions/rabbitvcs-resolve.svg",
            "scalable/actions/rabbitvcs-about.svg",
            "scalable/actions/rabbitvcs-add.svg",
            "scalable/actions/rabbitvcs-changes.svg",
            "scalable/actions/rabbitvcs-createpatch.svg",
            "scalable/actions/rabbitvcs-merge.svg",
            "scalable/actions/rabbitvcs-drive.svg",
            "scalable/actions/rabbitvcs-stop.svg",
            "scalable/actions/rabbitvcs-checkout.svg",
            "scalable/actions/rabbitvcs-import.svg",
            "scalable/actions/rabbitvcs-branch.svg",
            "scalable/actions/rabbitvcs-refresh.svg",
            "scalable/actions/rabbitvcs-editconflicts.svg",
            "scalable/actions/rabbitvcs-monkey.svg",
            "scalable/actions/rabbitvcs-applypatch.svg",
            "scalable/actions/rabbitvcs-switch.svg",
            "scalable/actions/rabbitvcs-lock.svg",
            "scalable/actions/rabbitvcs-annotate.svg",
            "scalable/actions/rabbitvcs-compare.svg",
            "scalable/actions/rabbitvcs-revert.svg",
            "scalable/actions/rabbitvcs-bug.svg",
            "scalable/actions/rabbitvcs-cleanup.svg",
            "scalable/actions/rabbitvcs-clear.svg",
            "scalable/actions/rabbitvcs-unstage.svg",
            "scalable/actions/rabbitvcs-emblems.svg",
            "scalable/actions/rabbitvcs-relocate.svg",
            "scalable/actions/rabbitvcs-reset.svg",
            "scalable/actions/rabbitvcs-asynchronous.svg",
            "scalable/actions/rabbitvcs-commit.svg",
            "scalable/actions/rabbitvcs-checkmods.svg",
            "scalable/apps/rabbitvcs.svg", "scalable/apps/rabbitvcs-small.svg",
            "16x16/actions/rabbitvcs-push.png"
        ]

        rabbitvcs_icon_path = get_icon_path()
        for rel_icon_path in rabbitvcs_icons:
            icon_path = "%s/%s" % (rabbitvcs_icon_path, rel_icon_path)
            file = os.path.basename(rel_icon_path)
            (root, ext) = os.path.splitext(file)

            pixbuf = GdkPixbuf.Pixbuf.new_from_file(icon_path)
            iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
            factory.add(root, iconset)

        factory.add_default()

        # Create a global client we can use to do VCS related stuff
        self.vcs_client = VCS()

        self.status_checker = StatusChecker()

        self.status_checker.assert_version(EXT_VERSION)

        self.items_cache = {}