diff options
| author | Michael Vogt <egon@top> | 2005-11-30 17:25:15 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@top> | 2005-11-30 17:25:15 +0100 |
| commit | 8d81801fa5371feeab82aebfc72a7000ff0f3c78 (patch) | |
| tree | 66d1f6f0f176f8782133348c84f30f769ce282b4 | |
| parent | 833798ff12afd3ce84176ff0c832d5cb87e37dd1 (diff) | |
| download | python-apt-8d81801fa5371feeab82aebfc72a7000ff0f3c78.tar.gz | |
* show button when new distro is available
| -rw-r--r-- | UpdateManager/UpdateManager.py | 38 | ||||
| -rw-r--r-- | data/UpdateManager.glade | 82 | ||||
| -rw-r--r-- | update-manager | 4 |
3 files changed, 106 insertions, 18 deletions
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 08d8c0b1..0693dfe2 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -189,7 +189,7 @@ class UpdateManager(SimpleGladeApp): #self.treeview_update.set_fixed_height_mode(True) self.treeview_update.append_column(self.cb) - self.cb.set_visible(False); + self.cb.set_visible(False) self.treeview_update.append_column(c0) self.treeview_update.set_search_column(LIST_NAME) @@ -624,25 +624,31 @@ class UpdateManager(SimpleGladeApp): dialog.run() dialog.destroy() + def on_button_dist_upgrade_clicked(self, button): + print "on_button_dist_upgrade_clicked" + + def new_dist_available(self, name): - #print name + print "new_dist_available: %s" % name # check if the user already knowns about this dist - seen = self.gconfclient.get_string("/apps/update-manager/seen_dist") - if name == seen: - return + #seen = self.gconfclient.get_string("/apps/update-manager/seen_dist") + #if name == seen: + # return - msg = "<big><b>%s</b></big>\n\n%s" % (_("There is a new release of Ubuntu available!"), _("A new release with the codename '%s' is available. Please see http://www.ubuntulinux.org/ for upgrade instructions.") % name) - dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_INFO, - gtk.BUTTONS_CLOSE, "") - dialog.set_markup(msg) - check = gtk.CheckButton(_("Never show this message again")) - check.show() - dialog.vbox.pack_start(check) - dialog.run() - if check.get_active(): - self.gconfclient.set_string("/apps/update-manager/seen_dist",name) - dialog.destroy() + #msg = "<big><b>%s</b></big>\n\n%s" % (_("There is a new release of Ubuntu available!"), _("A new release with the codename '%s' is available. Please see http://www.ubuntulinux.org/ for upgrade instructions.") % name) + #dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_INFO, + # gtk.BUTTONS_CLOSE, "") + #dialog.set_markup(msg) + #check = gtk.CheckButton(_("Never show this message again")) + #check.show() + #dialog.vbox.pack_start(check) + #dialog.run() + #if check.get_active(): + # self.gconfclient.set_string("/apps/update-manager/seen_dist",name) + #dialog.destroy() + self.frame_new_release.show() + self.label_new_release.set_markup("<b>New distibution release codename '%s' available</b>" % name) # code that does the meta release file checking def check_meta_release(self): diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index a52cb14a..cbd1c3da 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -87,6 +87,88 @@ The following packages are found to be upgradable. You can upgrade them by using </child> <child> + <widget class="GtkFrame" id="frame_new_release"> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox_new_release"> + <property name="border_width">6</property> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkLabel" id="label_new_release"> + <property name="visible">True</property> + <property name="label"><b>New relesae available</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button_dist_upgrade"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Upgrade</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_dist_upgrade_clicked" last_modification_time="Wed, 30 Nov 2005 15:42:07 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> <widget class="GtkProgressBar" id="progressbar_cache"> <property name="visible">True</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> diff --git a/update-manager b/update-manager index 43d52dff..341aa034 100644 --- a/update-manager +++ b/update-manager @@ -49,7 +49,7 @@ if __name__ == "__main__": dialog.destroy() sys.exit(1) - #data_dir="/usr/share/update-manager/" - data_dir="/tmp/xxx/share/update-manager/" + data_dir="/usr/share/update-manager/" + #data_dir="/tmp/xxx/share/update-manager/" app = UpdateManager(data_dir) app.main() |
