Example #1
0
        def reload_packages(self, added_pub=True):
                if len(self.pub_new_tasks) > 0:
                        if added_pub:
                                self.pub_new_tasks.pop(0)
                        if len(self.pub_new_tasks) > 0:
                                self.__add_new_pub()
                                return

                if len(self.pkg_install_tasks) > 0:
                        self.api_o = gui_misc.get_api_object(self.image_dir, self.pr,
                            self.w_webinstall_dialog)
                        self.__install_pkgs()
                else:
                        self.__exit_app()
Example #2
0
    def reload_packages(self, added_pub=True):
        if len(self.pub_new_tasks) > 0:
            if added_pub:
                self.pub_new_tasks.pop(0)
            if len(self.pub_new_tasks) > 0:
                self.__add_new_pub()
                return

        if len(self.pkg_install_tasks) > 0:
            self.api_o = gui_misc.get_api_object(self.image_dir, self.pr,
                                                 self.w_webinstall_dialog)
            self.__install_pkgs()
        else:
            self.__exit_app()
Example #3
0
        def __init__(self, image_dir):
                global_settings.client_name = gui_misc.get_wi_name()
                self.image_dir = image_dir
    
                try:
                        self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"]
                except KeyError:
                        self.application_dir = "/"
                misc.setlocale(locale.LC_ALL, "")
                for module in (gettext, gtk.glade):
                        module.bindtextdomain("pkg", os.path.join(
                            self.application_dir,
                            "usr/share/locale"))
                        module.textdomain("pkg")
                gui_misc.init_for_help(self.application_dir)
                self.pub_pkg_list = None
                self.pr = progress.NullProgressTracker()
                self.pub_new_tasks = []
                self.pkg_install_tasks = []
                self.icon_theme = gtk.icon_theme_get_default()
                icon_location = os.path.join(self.application_dir, ICON_LOCATION)
                self.icon_theme.append_search_path(icon_location)
                self.param = None
                self.disabled_pubs = {}
                self.repo_gui = None
                self.first_run = True

                # Webinstall Dialog
                builder = gtk.Builder()
                self.gladefile = os.path.join(self.application_dir,
                        "usr/share/package-manager/packagemanager.ui")
                builder.add_from_file(self.gladefile)
                self.w_webinstall_dialog = \
                        builder.get_object("webinstalldialog")
                
                self.w_webinstall_proceed = \
                        builder.get_object("proceed_button")
                self.w_webinstall_cancel = \
                        builder.get_object("cancel_button")
                self.w_webinstall_help = \
                        builder.get_object("help_button")
                self.w_webinstall_close = \
                        builder.get_object("close_button")
                self.w_webinstall_proceed_label = \
                        builder.get_object("proceed_new_repo_label")
                self.w_webinstall_toplabel = \
                        builder.get_object("webinstall_toplabel")
                self.w_webinstall_frame = \
                        builder.get_object("webinstall_frame")
                self.w_webinstall_image = \
                        builder.get_object("pkgimage")
                self.window_icon = gui_misc.get_icon(self.icon_theme, 
                    'packagemanager', 48)
                self.w_webinstall_image.set_from_pixbuf(self.window_icon)
                self.w_webinstall_info_label = \
                        builder.get_object("label19")

                self.w_webinstall_textview = \
                        builder.get_object("webinstall_textview")  
                infobuffer = self.w_webinstall_textview.get_buffer()
                infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD)
                infobuffer.create_tag("disabled", foreground="#757575") #Close to DimGrey

                self.__setup_signals()
 
                self.w_webinstall_dialog.set_icon(self.window_icon)
                self.api_o = gui_misc.get_api_object(self.image_dir, self.pr,
                    self.w_webinstall_dialog)
                gui_misc.setup_logging()
Example #4
0
    def __init__(self, image_dir):
        global_settings.client_name = gui_misc.get_wi_name()
        self.image_dir = image_dir

        try:
            self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"]
        except KeyError:
            self.application_dir = "/"
        misc.setlocale(locale.LC_ALL, "")
        for module in (gettext, gtk.glade):
            module.bindtextdomain(
                "pkg", os.path.join(self.application_dir, "usr/share/locale"))
            module.textdomain("pkg")
        gui_misc.init_for_help(self.application_dir)
        self.pub_pkg_list = None
        self.pr = progress.NullProgressTracker()
        self.pub_new_tasks = []
        self.pkg_install_tasks = []
        self.icon_theme = gtk.icon_theme_get_default()
        icon_location = os.path.join(self.application_dir, ICON_LOCATION)
        self.icon_theme.append_search_path(icon_location)
        self.param = None
        self.disabled_pubs = {}
        self.repo_gui = None
        self.first_run = True

        # Webinstall Dialog
        builder = gtk.Builder()
        self.gladefile = os.path.join(
            self.application_dir,
            "usr/share/package-manager/packagemanager.ui")
        builder.add_from_file(self.gladefile)
        self.w_webinstall_dialog = \
                builder.get_object("webinstalldialog")

        self.w_webinstall_proceed = \
                builder.get_object("proceed_button")
        self.w_webinstall_cancel = \
                builder.get_object("cancel_button")
        self.w_webinstall_help = \
                builder.get_object("help_button")
        self.w_webinstall_close = \
                builder.get_object("close_button")
        self.w_webinstall_proceed_label = \
                builder.get_object("proceed_new_repo_label")
        self.w_webinstall_toplabel = \
                builder.get_object("webinstall_toplabel")
        self.w_webinstall_frame = \
                builder.get_object("webinstall_frame")
        self.w_webinstall_image = \
                builder.get_object("pkgimage")
        self.window_icon = gui_misc.get_icon(self.icon_theme, 'packagemanager',
                                             48)
        self.w_webinstall_image.set_from_pixbuf(self.window_icon)
        self.w_webinstall_info_label = \
                builder.get_object("label19")

        self.w_webinstall_textview = \
                builder.get_object("webinstall_textview")
        infobuffer = self.w_webinstall_textview.get_buffer()
        infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD)
        infobuffer.create_tag("disabled",
                              foreground="#757575")  #Close to DimGrey

        self.__setup_signals()

        self.w_webinstall_dialog.set_icon(self.window_icon)
        self.api_o = gui_misc.get_api_object(self.image_dir, self.pr,
                                             self.w_webinstall_dialog)
        gui_misc.setup_logging()