Ejemplo n.º 1
0
    def create_uninstall_box(self):
        main_table = gtk.Table(2, 2)
        main_table.set_row_spacings(CONTENT_ROW_SPACING)
        uninstall_title_label = Label(_("On uninstalling the software"))

        # mini_check_button
        self.delete_check_button = CheckButton(_("Delete configuration files"))
        self.delete_check_button.set_active(get_purg_flag())
        self.delete_check_button.connect("toggled", lambda w: set_purge_flag(self.delete_check_button.get_active()))

        main_table.attach(uninstall_title_label, 0, 2, 0, 1, yoptions=gtk.FILL)
        main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL)
        main_table.attach(self.delete_check_button, 0, 1, 2, 3, yoptions=gtk.FILL)

        return main_table
Ejemplo n.º 2
0
    def create_uninstall_box(self):
        main_table = gtk.Table(2, 2)
        main_table.set_row_spacings(CONTENT_ROW_SPACING)
        uninstall_title_label = Label(_("On uninstalling the software"))

        # mini_check_button
        self.delete_check_button = CheckButton(_("Delete configuration files"))
        self.delete_check_button.set_active(get_purg_flag())
        self.delete_check_button.connect("toggled", lambda w: set_purge_flag(self.delete_check_button.get_active()))

        main_table.attach(uninstall_title_label, 0, 2, 0, 1, yoptions=gtk.FILL)
        main_table.attach(create_separator_box(), 0, 2, 1, 2, yoptions=gtk.FILL)
        main_table.attach(self.delete_check_button, 0, 1, 2, 3, yoptions=gtk.FILL)

        return main_table
Ejemplo n.º 3
0
    def button_press(self, column, offset_x, offset_y):
        if column == 0:
            if self.is_in_icon_area(column, offset_x, offset_y):
                global_event.emit("switch-to-detail-page", self.pkg_name)
                global_event.emit("set-cursor", None)
            elif self.is_in_name_area(column, offset_x, offset_y):
                global_event.emit("switch-to-detail-page", self.pkg_name)
                global_event.emit("set-cursor", None)
        else:
            if self.status == self.STATUS_NORMAL:
                if self.is_in_button_area(column, offset_x, offset_y):
                    self.status = self.STATUS_CONFIRM

                    if self.redraw_request_callback:
                        self.redraw_request_callback(self)
                elif self.is_in_star_area(column, offset_x, offset_y):
                    global_event.emit("grade-pkg", self.pkg_name,
                                      self.grade_star)
            elif self.status == self.STATUS_CONFIRM:
                if self.is_confirm_button_area(column, offset_x, offset_y):
                    self.status = self.STATUS_WAIT_ACTION
                    self.status_text = _("Waiting for uninstall")

                    if self.redraw_request_callback:
                        self.redraw_request_callback(self)

                    global_event.emit("uninstall-pkg", self.pkg_name,
                                      get_purg_flag())
                elif self.is_cancel_button_area(column, offset_x, offset_y):
                    self.status = self.STATUS_NORMAL

                    if self.redraw_request_callback:
                        self.redraw_request_callback(self)
            elif self.status == self.STATUS_WAIT_ACTION:
                if self.is_cancel_button_area(column, offset_x, offset_y):
                    self.status = self.STATUS_NORMAL

                    global_event.emit("remove-wait-action",
                                      [(self.pkg_name, ACTION_UNINSTALL)])

                    if self.redraw_request_callback:
                        self.redraw_request_callback(self)
 def button_press(self, column, offset_x, offset_y):
     if column == 0:
         if self.is_in_icon_area(column, offset_x, offset_y):
             global_event.emit("switch-to-detail-page", self.pkg_name)    
             global_event.emit("set-cursor", None)    
         elif self.is_in_name_area(column, offset_x, offset_y):
             global_event.emit("switch-to-detail-page", self.pkg_name)    
             global_event.emit("set-cursor", None)    
     else:
         if self.status == self.STATUS_NORMAL:
             if self.is_in_button_area(column, offset_x, offset_y):
                 self.status = self.STATUS_CONFIRM
             
                 if self.redraw_request_callback:
                     self.redraw_request_callback(self)            
             elif self.is_in_star_area(column, offset_x, offset_y):
                 global_event.emit("grade-pkg", self.pkg_name, self.grade_star)
         elif self.status == self.STATUS_CONFIRM:
             if self.is_confirm_button_area(column, offset_x, offset_y):
                 self.status = self.STATUS_WAIT_ACTION
                 self.status_text = _("Waiting for uninstall")
                 
                 if self.redraw_request_callback:
                     self.redraw_request_callback(self)
                     
                 global_event.emit("uninstall-pkg", self.pkg_name, get_purg_flag())
             elif self.is_cancel_button_area(column, offset_x, offset_y):
                 self.status = self.STATUS_NORMAL
                 
                 if self.redraw_request_callback:
                     self.redraw_request_callback(self)
         elif self.status == self.STATUS_WAIT_ACTION:
             if self.is_cancel_button_area(column, offset_x, offset_y):
                 self.status = self.STATUS_NORMAL
                 
                 global_event.emit("remove-wait-action", [(str((self.pkg_name, ACTION_UNINSTALL)))])
                 
                 if self.redraw_request_callback:
                     self.redraw_request_callback(self)