From: <sal...@li...> - 2012-05-08 19:33:43
|
Revision: 3259 http://salix.svn.sourceforge.net/salix/?rev=3259&view=rev Author: gapan Date: 2012-05-08 19:33:37 +0000 (Tue, 08 May 2012) Log Message: ----------- Add a dialog to ask for package removal. Make sure all dialogs are presented in the center of the screen. Modified Paths: -------------- salix-codecs-installer/branches/python/src/salix-codecs-installer salix-codecs-installer/branches/python/src/salix-codecs-installer.glade Modified: salix-codecs-installer/branches/python/src/salix-codecs-installer =================================================================== --- salix-codecs-installer/branches/python/src/salix-codecs-installer 2012-05-08 09:09:24 UTC (rev 3258) +++ salix-codecs-installer/branches/python/src/salix-codecs-installer 2012-05-08 19:33:37 UTC (rev 3259) @@ -584,7 +584,8 @@ break step +=1 if success: - gtk.main_quit() + self.dialog_update.hide() + self.messagedialog_uninstall.show() else: #FIXME #check if this actually pops up as it's supposed to, after @@ -619,6 +620,15 @@ else: i[0] = True + @threaded + def on_button_uninstall_clicked(self, widget): + gtk.gdk.threads_enter() + self.messagedialog_uninstall.hide() + gtk.gdk.threads_leave() + cmd = ['/sbin/spkg', '-d', 'salix-codecs-installer'] + process = subprocess.Popen(cmd) + gtk.main_quit() + def on_messagedialog_delete_event(self, widget, event): gtk.main_quit() @@ -627,7 +637,7 @@ def on_messagedialog_dir_error_response(self, widget, event): gtk.main_quit() - + def gtk_main_quit(self, widget, data=None): gtk.main_quit() @@ -685,6 +695,12 @@ self.treeviewcolumn_pkgdesc.set_title(_('Description')) # + # Remove package dialog + # + self.messagedialog_uninstall = builder.get_object('messagedialog_uninstall') + + + # # All packages are already installed dialog # self.messagedialog_nopkgs = builder.get_object('messagedialog_nopkgs') Modified: salix-codecs-installer/branches/python/src/salix-codecs-installer.glade =================================================================== --- salix-codecs-installer/branches/python/src/salix-codecs-installer.glade 2012-05-08 09:09:24 UTC (rev 3258) +++ salix-codecs-installer/branches/python/src/salix-codecs-installer.glade 2012-05-08 19:33:37 UTC (rev 3259) @@ -6,6 +6,7 @@ <property name="border_width">5</property> <property name="title" translatable="yes">Install multimedia codecs?</property> <property name="resizable">False</property> + <property name="window_position">center-always</property> <property name="icon_name">salix-codecs-installer</property> <property name="type_hint">normal</property> <signal name="close" handler="gtk_main_quit"/> @@ -199,10 +200,11 @@ <object class="GtkMessageDialog" id="messagedialog_sources_error"> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> + <property name="resizable">False</property> <property name="window_position">center-always</property> <property name="icon_name">dialog-error</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="message_type">error</property> <property name="buttons">ok</property> <property name="text" translatable="yes">There was an error connecting to one of the repositories. Make sure you have a working internet connection and the right sources specified in /etc/slapt-get/slapt-getrc.</property> @@ -428,10 +430,11 @@ <object class="GtkMessageDialog" id="messagedialog_pkginstall_error"> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> + <property name="resizable">False</property> <property name="window_position">center-always</property> <property name="icon_name">dialog-error</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="message_type">error</property> <property name="buttons">ok</property> <property name="text" translatable="yes">There was an error installing one of the packages. Please, make sure there is enough available space in your hard drive and that it is mounted with write permissions and try again.</property> @@ -459,8 +462,10 @@ <object class="GtkMessageDialog" id="messagedialog_nopkgs"> <property name="border_width">5</property> <property name="title" translatable="yes">Nothing to install</property> + <property name="resizable">False</property> + <property name="window_position">center-always</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="text" translatable="yes">All codec packages are already installed.</property> <signal name="delete_event" handler="on_messagedialog_delete_event"/> <signal name="response" handler="on_messagedialog_response"/> @@ -503,10 +508,11 @@ <object class="GtkMessageDialog" id="messagedialog_dir_error"> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> + <property name="resizable">False</property> <property name="window_position">center-always</property> <property name="icon_name">dialog-error</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="message_type">error</property> <property name="buttons">ok</property> <property name="text" translatable="yes">It seems you don't have the permissions to write the repository files.</property> @@ -534,10 +540,11 @@ <object class="GtkMessageDialog" id="messagedialog_repo_checksum"> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> + <property name="resizable">False</property> <property name="window_position">center-always</property> <property name="icon_name">dialog-error</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="message_type">error</property> <property name="buttons">ok</property> <property name="text" translatable="yes">Error verifying repository checksum. You could be using a compromised repository. Please, check your package sources.</property> @@ -565,10 +572,11 @@ <object class="GtkMessageDialog" id="messagedialog_pkg_checksum"> <property name="border_width">5</property> <property name="title" translatable="yes">Error</property> + <property name="resizable">False</property> <property name="window_position">center-always</property> <property name="icon_name">dialog-error</property> <property name="type_hint">normal</property> - <property name="skip_taskbar_hint">True</property> + <property name="urgency_hint">True</property> <property name="message_type">error</property> <property name="buttons">ok</property> <property name="text" translatable="yes">Error verifying package checksum. This is probably due to a bad download. Please, check your internet connection.</property> @@ -593,4 +601,68 @@ </object> </child> </object> + <object class="GtkMessageDialog" id="messagedialog_uninstall"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Done!</property> + <property name="resizable">False</property> + <property name="window_position">center-always</property> + <property name="icon_name">salix-codecs-installer</property> + <property name="type_hint">normal</property> + <property name="urgency_hint">True</property> + <property name="message_type">question</property> + <property name="text" translatable="yes">Codecs installation was succesfully completed. Would you like to remove the codecs installer from your system?</property> + <signal name="delete_event" handler="on_messagedialog_delete_event"/> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox16"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area16"> + <property name="visible">True</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="button_uninstall_no"> + <property name="label">gtk-quit</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="gtk_main_quit"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button_uninstall"> + <property name="label">gtk-remove</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_button_uninstall_clicked"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">button_uninstall_no</action-widget> + <action-widget response="0">button_uninstall</action-widget> + </action-widgets> + </object> </interface> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |