gnome-packagekit r330 - in trunk: . data help help/C help/C/figures po src



Author: rhughes
Date: Thu Oct  9 16:58:36 2008
New Revision: 330
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=330&view=rev

Log:
from git, lots of new translations

Added:
   trunk/data/gpk-service-pack.desktop.in
   trunk/data/gpk-service-pack.glade
   trunk/src/gpk-service-pack.c
Modified:
   trunk/NEWS
   trunk/configure.ac
   trunk/data/Makefile.am
   trunk/data/gnome-packagekit.schemas.in
   trunk/data/gpk-application.glade
   trunk/help/C/figures/gpk-application-groups.png
   trunk/help/C/gnome-packagekit.xml
   trunk/help/Makefile.am
   trunk/po/POTFILES.in
   trunk/src/.gitignore
   trunk/src/Makefile.am
   trunk/src/gpk-application.c
   trunk/src/gpk-common.c
   trunk/src/gpk-common.h
   trunk/src/gpk-error.c
   trunk/src/gpk-prefs.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Thu Oct  9 16:58:36 2008
@@ -1,3 +1,30 @@
+Version 0.3.6
+~~~~~~~~~~~~~~
+Released: 2008-10-06
+
+* Translations
+ - Updated Finnish translation (Ilkka Tuohela)
+
+* New
+ - Add pk-action-removing and pk-action-cleanup animated icons (Mike Langlie)
+ - Show vendor specific 'More information' when we fail to find packages (Richard Hughes)
+ - Turn off hardware HAL integration by default (Richard Hughes)
+
+* Bugfix:
+ - Correctly pluralise the codec installer dialogs (Richard Hughes)
+ - Allow double clicking on an application in the run dialog. Fixes fd#17845 (Richard Hughes)
+ - Set the window title if we go from being modal to non-modal (Richard Hughes)
+ - Pass up the exec name, not the application name to GpkClient so we can special case the
+   gstreamer plugin installer, and use window properties instead (Richard Hughes)
+ - Set an interaction mode for the client used in GpkDbus so we don't get a finished dialog (Richard Hughes)
+ - Menu item tooltips should be phrased as imperative verbs (Richard Hughes)
+ - Always force width to avoid the dialog width changing between phases (Richard Hughes)
+ - Mark some more text translatable to fix fd#17899 (Richard Hughes)
+ - Make the search button much smaller (without the icon) to fix fd#17874 (Richard Hughes)
+ - Now we set the locale, don't use PkExtra to set the translation summary (Richard Hughes)
+ - Fix segfault in gpk_package_id_name_version if id was null (Ville-Pekka Vainio)
+ - Fix message in gpk-application if the required query returns no packages (Ville-Pekka Vainio)
+
 Version 0.3.5
 ~~~~~~~~~~~~~~
 Released: 2008-09-29

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Oct  9 16:58:36 2008
@@ -1,6 +1,6 @@
 AC_PREREQ(2.52)
 
-AC_INIT(gnome-packagekit, 0.3.6)
+AC_INIT(gnome-packagekit, 0.3.7)
 AC_CONFIG_SRCDIR(src)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)

Modified: trunk/data/Makefile.am
==============================================================================
--- trunk/data/Makefile.am	(original)
+++ trunk/data/Makefile.am	Thu Oct  9 16:58:36 2008
@@ -12,6 +12,7 @@
 desktop_in_files =					\
 	gpk-install-file.desktop.in			\
 	gpk-install-catalog.desktop.in			\
+	gpk-service-pack.desktop.in			\
 	gpk-prefs.desktop.in				\
 	gpk-application.desktop.in			\
 	gpk-update-viewer.desktop.in			\
@@ -32,6 +33,7 @@
 	gpk-application.glade				\
 	gpk-update-viewer.glade				\
 	gpk-prefs.glade					\
+	gpk-service-pack.glade				\
 	gpk-signature.glade				\
 	gpk-error.glade					\
 	gpk-log.glade					\
@@ -64,6 +66,7 @@
 DISTCLEANFILES =					\
 	gpk-repo.desktop				\
 	gpk-prefs.desktop				\
+	gpk-service-pack.desktop			\
 	gpk-update-viewer.desktop			\
 	gpk-install-catalog.desktop			\
 	gpk-install-file.desktop			\

Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in	(original)
+++ trunk/data/gnome-packagekit.schemas.in	Thu Oct  9 16:58:36 2008
@@ -290,6 +290,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-packagekit/application/category_groups</key>
+      <applyto>/apps/gnome-packagekit/application/category_groups</applyto>
+      <owner>gnome-packagekit</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>If we should show the category group menu</short>
+        <long>If we should show the category group menu. This is more complete and custom to the distribution, but takes longer to populate</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-packagekit/repo/show_details</key>
       <applyto>/apps/gnome-packagekit/repo/show_details</applyto>
       <owner>gnome-packagekit</owner>

Modified: trunk/data/gpk-application.glade
==============================================================================
--- trunk/data/gpk-application.glade	(original)
+++ trunk/data/gpk-application.glade	Thu Oct  9 16:58:36 2008
@@ -531,38 +531,10 @@
                                         <property name="can_focus">True</property>
                                         <property name="response_id">0</property>
                                         <child>
-                                          <widget class="GtkAlignment" id="alignment5">
+                                          <widget class="GtkLabel" id="label_button_find">
                                             <property name="visible">True</property>
-                                            <property name="xscale">0</property>
-                                            <property name="yscale">0</property>
-                                            <child>
-                                              <widget class="GtkHBox" id="hbox6">
-                                                <property name="visible">True</property>
-                                                <property name="spacing">2</property>
-                                                <child>
-                                                  <widget class="GtkImage" id="image4">
-                                                    <property name="visible">True</property>
-                                                    <property name="stock">gtk-find</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" id="label_button_find">
-                                                    <property name="visible">True</property>
-                                                    <property name="label">Fi_nd</property>
-                                                    <property name="use_underline">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">1</property>
-                                                  </packing>
-                                                </child>
-                                              </widget>
-                                            </child>
+                                            <property name="label" translatable="yes">Fi_nd</property>
+                                            <property name="use_underline">True</property>
                                           </widget>
                                         </child>
                                       </widget>
@@ -583,38 +555,10 @@
                                         <property name="can_focus">True</property>
                                         <property name="response_id">0</property>
                                         <child>
-                                          <widget class="GtkAlignment" id="alignment2">
+                                          <widget class="GtkLabel" id="label_button_cancel">
                                             <property name="visible">True</property>
-                                            <property name="xscale">0</property>
-                                            <property name="yscale">0</property>
-                                            <child>
-                                              <widget class="GtkHBox" id="hbox3">
-                                                <property name="visible">True</property>
-                                                <property name="spacing">2</property>
-                                                <child>
-                                                  <widget class="GtkImage" id="image2">
-                                                    <property name="visible">True</property>
-                                                    <property name="stock">gtk-dialog-error</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkLabel" id="label_button_cancel">
-                                                    <property name="visible">True</property>
-                                                    <property name="label">_Cancel</property>
-                                                    <property name="use_underline">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">1</property>
-                                                  </packing>
-                                                </child>
-                                              </widget>
-                                            </child>
+                                            <property name="label" translatable="yes">_Cancel</property>
+                                            <property name="use_underline">True</property>
                                           </widget>
                                         </child>
                                       </widget>
@@ -648,7 +592,7 @@
                               <widget class="GtkScrolledWindow" id="scrolledwindow_groups">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
                                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                                 <property name="shadow_type">GTK_SHADOW_IN</property>
                                 <child>

Added: trunk/data/gpk-service-pack.desktop.in
==============================================================================
--- (empty file)
+++ trunk/data/gpk-service-pack.desktop.in	Thu Oct  9 16:58:36 2008
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Encoding=UTF-8
+_Name=Service Pack Creator
+_GenericName=Service Pack Creator
+_Comment=Create service packs for sharing with other computers
+Icon=x-system-software-sources
+Exec=gpk-service-pack
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;System;X-Red-Hat-Base;
+StartupNotify=true
+

Added: trunk/data/gpk-service-pack.glade
==============================================================================
--- (empty file)
+++ trunk/data/gpk-service-pack.glade	Thu Oct  9 16:58:36 2008
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.4 on Thu Oct  9 16:21:25 2008 -->
+<glade-interface>
+  <widget class="GtkWindow" id="window_pack">
+    <property name="title" translatable="yes">Service Pack Generator</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <child>
+      <widget class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="border_width">9</property>
+        <property name="spacing">9</property>
+        <child>
+          <widget class="GtkFrame" id="frame_type">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="top_padding">9</property>
+                <property name="bottom_padding">6</property>
+                <property name="left_padding">21</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="spacing">3</property>
+                    <child>
+                      <widget class="GtkRadioButton" id="radiobutton_updates">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Create an archive of all the pending updates</property>
+                        <property name="response_id">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkRadioButton" id="radiobutton_package">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Create an archive of a specific package</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">radiobutton_updates</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment4">
+                        <property name="visible">True</property>
+                        <property name="left_padding">22</property>
+                        <child>
+                          <widget class="GtkEntry" id="entry_package">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label8">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Contents of service pack&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="frame_details">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment2">
+                <property name="visible">True</property>
+                <property name="top_padding">9</property>
+                <property name="left_padding">21</property>
+                <child>
+                  <widget class="GtkTable" id="table1">
+                    <property name="visible">True</property>
+                    <property name="n_rows">2</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">6</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <widget class="GtkFileChooserButton" id="filechooserbutton_directory">
+                        <property name="visible">True</property>
+                        <property name="preview_widget_active">False</property>
+                        <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+                        <property name="use_preview_label">False</property>
+                        <property name="do_overwrite_confirmation">True</property>
+                        <property name="local_only">False</property>
+                        <property name="title" translatable="yes">Save New Service Pack</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkFileChooserButton" id="filechooserbutton_exclude">
+                        <property name="visible">True</property>
+                        <property name="preview_widget_active">False</property>
+                        <property name="do_overwrite_confirmation">True</property>
+                        <property name="local_only">False</property>
+                        <property name="title" translatable="yes">Select A Package List File</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label9">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Service pack destination:</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox3">
+                        <property name="visible">True</property>
+                        <child>
+                          <widget class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Destination file list:</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Details&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="frame_progress">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment3">
+                <property name="visible">True</property>
+                <property name="top_padding">9</property>
+                <property name="left_padding">21</property>
+                <child>
+                  <widget class="GtkProgressBar" id="progressbar_percentage">
+                    <property name="visible">True</property>
+                    <property name="show_text">True</property>
+                    <property name="text" translatable="yes"></property>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label10">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Progress&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHButtonBox" id="hbuttonbox1">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="button_help">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-help</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button_create">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="has_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">Create</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="pack_type">GTK_PACK_END</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button_close">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-close</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="pack_type">GTK_PACK_END</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Modified: trunk/help/C/figures/gpk-application-groups.png
==============================================================================
Binary files. No diff available.

Modified: trunk/help/C/gnome-packagekit.xml
==============================================================================
--- trunk/help/C/gnome-packagekit.xml	(original)
+++ trunk/help/C/gnome-packagekit.xml	Thu Oct  9 16:58:36 2008
@@ -504,6 +504,71 @@
  </para>
 </section>
 
+<section id="service-pack">
+  <title>Service Pack Creator</title>
+  <figure>
+    <title>Service pack creator</title>
+    <screenshot>
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="figures/gpk-service-pack.png" format="PNG"/>
+        </imageobject>
+      </mediaobject>
+    </screenshot>
+  </figure>
+  <para>
+    This tool can be opened using <menuchoice><guimenu>Applications</guimenu>
+    <guisubmenu>System Tools</guisubmenu>
+    <guimenuitem>Service Pack Creator</guimenuitem></menuchoice>.
+  </para>
+  <para>
+    A service pack is a tarball which contains a set of packages and their dependencies.
+    To explain better what a service pack is, it is best to show a few use-cases.
+  </para>
+  <orderedlist numeration="arabic">
+    <listitem>
+      <para>
+        You have seven desktops you've just installed with Fedora 9.
+        Each one needs to have 204Mb of updates installed.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        You have a laptop that needs network drivers before it can download updates,
+        and you have a similar up to date laptop with internet access nearby.
+        The network drivers require a few dependencies, and other packages to be
+        upgraded before they will install.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        You frequently install Linux on other peoples computers.
+        You carry around a live-cd and a pendrive with a single 204Mb file
+        <filename>Fedora-updates-SP1.servicepack</filename> which contains all the
+        updates since last week.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        A free software magazine wants to distribute patent encumbered multimedia
+        plugins and programs with the latest Fedora release DVD.
+        They want a way in which even the most lazy user can get the things
+        installed without much fuss.
+      </para>
+    </listitem>
+  </orderedlist>
+  <para>
+    Internally, the pack file is just an uncompressed tarball, with the packages
+    and a single metadata.conf file inside.
+    The metadata file is just the distribution identifier and the time of creation.
+    This ensures you don't try installing a <filename>fedora-9-i386</filename>
+    service pack on a <filename>ubuntu-intrepid-ppc</filename> machine.
+  </para>
+  <para>
+    <command>pkgenpack</command> is a command line tool for creating service pack files.
+  </para>
+</section>
+
 <section id="auto-updates">
   <title>Automatic Updates</title>
   <para>

Modified: trunk/help/Makefile.am
==============================================================================
--- trunk/help/Makefile.am	(original)
+++ trunk/help/Makefile.am	Thu Oct  9 16:58:36 2008
@@ -17,6 +17,7 @@
 	figures/gpk-added-deps.png \
 	figures/gpk-remove-confirm.png \
 	figures/gpk-updates.png \
+	figures/gpk-service-pack.png \
 	figures/gpk-updates-warning.png
 
 DOC_LINGUAS = el es oc pl sv

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Thu Oct  9 16:58:36 2008
@@ -16,6 +16,8 @@
 data/gpk-prefs.glade
 data/gpk-repo.desktop.in
 data/gpk-repo.glade
+data/gpk-service-pack.desktop.in
+data/gpk-service-pack.glade
 data/gpk-signature.glade
 data/gpk-update-icon.desktop.in
 data/gpk-update-viewer.desktop.in
@@ -31,10 +33,10 @@
 src/gpk-client-run.c
 src/gpk-client-signature.c
 src/gpk-client-untrusted.c
-src/gpk-enum.c
 src/gpk-common.c
 src/gpk-consolekit.c
 src/gpk-dialog.c
+src/gpk-enum.c
 src/gpk-error.c
 src/gpk-firmware.c
 src/gpk-hardware.c
@@ -47,8 +49,8 @@
 src/gpk-log.c
 src/gpk-prefs.c
 src/gpk-repo.c
+src/gpk-service-pack.c
 src/gpk-smart-icon.c
 src/gpk-update-icon.c
 src/gpk-update-viewer.c
 src/gpk-watch.c
-

Modified: trunk/src/.gitignore
==============================================================================
--- trunk/src/.gitignore	(original)
+++ trunk/src/.gitignore	Thu Oct  9 16:58:36 2008
@@ -25,6 +25,7 @@
 gpk-update-viewer
 gpk-backend-status
 gpk-self-test
+gpk-service-pack
 gpk-log
 .svn
 

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Thu Oct  9 16:58:36 2008
@@ -32,6 +32,7 @@
 	gpk-application					\
 	gpk-repo					\
 	gpk-prefs					\
+	gpk-service-pack				\
 	gpk-install-catalog				\
 	gpk-install-local-file				\
 	gpk-install-mime-type				\
@@ -188,6 +189,15 @@
 	$(LIBSEXY_LIBS)					\
 	$(NULL)
 
+gpk_service_pack_SOURCES =				\
+	gpk-service-pack.c				\
+	$(shared_SOURCES)				\
+	$(NULL)
+
+gpk_service_pack_LDADD =				\
+	$(shared_LIBS)					\
+	$(NULL)
+
 gpk_prefs_SOURCES =					\
 	egg-debug.c					\
 	egg-debug.h					\

Modified: trunk/src/gpk-application.c
==============================================================================
--- trunk/src/gpk-application.c	(original)
+++ trunk/src/gpk-application.c	Thu Oct  9 16:58:36 2008
@@ -2019,56 +2019,6 @@
 			1, gtk_get_current_event_time());
 }
 
-#define PK_PACKAGE_LIST_LOCATION	"/var/lib/PackageKit/package-list.txt"
-
-/**
- * gpk_application_create_completion_model:
- *
- * Creates a tree model containing the completions
- **/
-static GtkTreeModel *
-gpk_application_create_completion_model (void)
-{
-	PkPackageList *list;
-	guint i;
-	guint length;
-	gboolean ret;
-	const PkPackageObj *obj;
-	GHashTable *hash;
-	gpointer data;
-	GtkListStore *store;
-	GtkTreeIter iter;
-
-	store = gtk_list_store_new (1, G_TYPE_STRING);
-	hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-	list = pk_package_list_new ();
-	ret = pk_package_list_add_file (list, PK_PACKAGE_LIST_LOCATION);
-	if (!ret) {
-		egg_warning ("no package list, try running pk-generate-package-list as root");
-		return NULL;
-	}
-
-	length = pk_package_list_get_size (list);
-	for (i=0; i<length; i++) {
-		obj = pk_package_list_get_obj (list, i);
-		if (obj == NULL || obj->id == NULL || obj->id->name == NULL) {
-			egg_warning ("obj invalid!");
-			break;
-		}
-		data = g_hash_table_lookup (hash, (gpointer) obj->id->name);
-		if (data == NULL) {
-			/* append just the name */
-			g_hash_table_insert (hash, g_strdup (obj->id->name), GINT_TO_POINTER (1));
-			gtk_list_store_append (store, &iter);
-			gtk_list_store_set (store, &iter, 0, obj->id->name, -1);
-		}
-	}
-	g_hash_table_unref (hash);
-	g_object_unref (list);
-
-	return GTK_TREE_MODEL (store);
-}
-
 /**
  *  * gpk_application_about_dialog_url_cb:
  *   **/
@@ -2888,9 +2838,7 @@
 	GtkWidget *main_window;
 	GtkWidget *widget;
 	GtkEntryCompletion *completion;
-	GtkTreeModel *completion_model;
 	GtkTreeSelection *selection;
-	gboolean autocomplete;
 	gboolean enabled;
 	gboolean ret;
 	GError *error = NULL;
@@ -3223,25 +3171,12 @@
 	widget = glade_xml_get_widget (application->priv->glade_xml, "entry_text");
 
 	/* autocompletion can be turned off as it's slow */
-	autocomplete = gconf_client_get_bool (application->priv->gconf_client, GPK_CONF_AUTOCOMPLETE, NULL);
-	if (autocomplete) {
+	ret = gconf_client_get_bool (application->priv->gconf_client, GPK_CONF_AUTOCOMPLETE, NULL);
+	if (ret) {
 		/* create the completion object */
-		completion = gtk_entry_completion_new ();
-
-		/* assign the completion to the entry */
+		completion = gpk_package_entry_completion_new ();
 		gtk_entry_set_completion (GTK_ENTRY (widget), completion);
 		g_object_unref (completion);
-
-		/* create a tree model and use it as the completion model */
-		completion_model = gpk_application_create_completion_model ();
-		if (completion_model != NULL) {
-			gtk_entry_completion_set_model (completion, completion_model);
-			g_object_unref (completion_model);
-
-			/* use model column 0 as the text column */
-			gtk_entry_completion_set_text_column (completion, 0);
-			gtk_entry_completion_set_inline_completion (completion, TRUE);
-		}
 	}
 
 	/* set focus on entry text */

Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c	(original)
+++ trunk/src/gpk-common.c	Thu Oct  9 16:58:36 2008
@@ -33,6 +33,7 @@
 #include <polkit-gnome/polkit-gnome.h>
 
 #include <pk-package-id.h>
+#include <pk-package-list.h>
 #include <pk-enum.h>
 #include <pk-common.h>
 
@@ -342,6 +343,82 @@
 	return NULL;
 }
 
+/**
+ * gpk_package_entry_completion_model_new:
+ *
+ * Creates a tree model containing completions from the system package list
+ **/
+static GtkTreeModel *
+gpk_package_entry_completion_model_new (void)
+{
+	PkPackageList *list;
+	guint i;
+	guint length;
+	gboolean ret;
+	const PkPackageObj *obj;
+	GHashTable *hash;
+	gpointer data;
+	GtkListStore *store;
+	GtkTreeIter iter;
+
+	store = gtk_list_store_new (1, G_TYPE_STRING);
+	hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+	list = pk_package_list_new ();
+	ret = pk_package_list_add_file (list, PK_SYSTEM_PACKAGE_LIST_FILENAME);
+	if (!ret) {
+		egg_warning ("no package list, try refreshing");
+		return NULL;
+	}
+
+	length = pk_package_list_get_size (list);
+	for (i=0; i<length; i++) {
+		obj = pk_package_list_get_obj (list, i);
+		if (obj == NULL || obj->id == NULL || obj->id->name == NULL) {
+			egg_warning ("obj invalid!");
+			break;
+		}
+		data = g_hash_table_lookup (hash, (gpointer) obj->id->name);
+		if (data == NULL) {
+			/* append just the name */
+			g_hash_table_insert (hash, g_strdup (obj->id->name), GINT_TO_POINTER (1));
+			gtk_list_store_append (store, &iter);
+			gtk_list_store_set (store, &iter, 0, obj->id->name, -1);
+		}
+	}
+	g_hash_table_unref (hash);
+	g_object_unref (list);
+
+	return GTK_TREE_MODEL (store);
+}
+
+/**
+ * gpk_package_entry_completion_new:
+ *
+ * Creates a %GtkEntryCompletion containing completions from the system package list
+ **/
+GtkEntryCompletion *
+gpk_package_entry_completion_new (void)
+{
+	GtkEntryCompletion *completion;
+	GtkTreeModel *model;
+
+	/* create a tree model and use it as the completion model */
+	completion = gtk_entry_completion_new ();
+	model = gpk_package_entry_completion_model_new ();
+	if (model == NULL)
+		return completion;
+
+	/* set the model for our completion model */
+	gtk_entry_completion_set_model (completion, model);
+	g_object_unref (model);
+
+	/* use model column 0 as the text column */
+	gtk_entry_completion_set_text_column (completion, 0);
+	gtk_entry_completion_set_inline_completion (completion, TRUE);
+
+	return completion;
+}
+
 /***************************************************************************
  ***                          MAKE CHECK TESTS                           ***
  ***************************************************************************/

Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h	(original)
+++ trunk/src/gpk-common.h	Thu Oct  9 16:58:36 2008
@@ -23,8 +23,11 @@
 #define __GPK_COMMON_H
 
 #include <glib-object.h>
+#include <gtk/gtk.h>
+
 #include <pk-enum.h>
 #include <pk-package-id.h>
+
 #include "gpk-animated-icon.h"
 
 G_BEGIN_DECLS
@@ -87,6 +90,7 @@
 							 PkStatusEnum	 status,
 							 GtkIconSize	 size);
 gchar		*gpk_strv_join_locale			(gchar		**array);
+GtkEntryCompletion	*gpk_package_entry_completion_new	(void);
 
 G_END_DECLS
 

Modified: trunk/src/gpk-error.c
==============================================================================
--- trunk/src/gpk-error.c	(original)
+++ trunk/src/gpk-error.c	Thu Oct  9 16:58:36 2008
@@ -96,6 +96,8 @@
 	/* show window */
 	widget = glade_xml_get_widget (glade_xml, "window_error");
 	gtk_window_present_with_time (GTK_WINDOW (widget), timestamp);
+	gtk_window_set_title (GTK_WINDOW (widget), "");
+	gtk_window_set_icon_name (GTK_WINDOW (widget), GPK_ICON_SOFTWARE_INSTALLER);
 
 	/* wait for button press */
 	gtk_main ();

Modified: trunk/src/gpk-prefs.c
==============================================================================
--- trunk/src/gpk-prefs.c	(original)
+++ trunk/src/gpk-prefs.c	Thu Oct  9 16:58:36 2008
@@ -33,7 +33,6 @@
 #include <gconf/gconf-client.h>
 
 #include <pk-control.h>
-#include <pk-client.h>
 
 #include <gpk-common.h>
 #include <gpk-gnome.h>
@@ -57,7 +56,7 @@
  * pk_button_help_cb:
  **/
 static void
-pk_button_help_cb (GtkWidget *widget, gboolean  data)
+pk_button_help_cb (GtkWidget *widget, gpointer data)
 {
 	gpk_gnome_help ("prefs");
 }
@@ -343,7 +342,6 @@
 	GtkWidget *main_window;
 	GtkWidget *widget;
 	PkBitfield roles;
-	PkClient *client;
 	PkControl *control;
 	EggUnique *egg_unique;
 	gboolean ret;
@@ -391,8 +389,6 @@
 	g_signal_connect (egg_unique, "activated",
 			  G_CALLBACK (gpk_prefs_activated_cb), NULL);
 
-	client = pk_client_new ();
-
 	/* get actions */
 	control = pk_control_new ();
 	roles = pk_control_get_actions (control, NULL);
@@ -439,7 +435,6 @@
 	gtk_main ();
 
 	g_object_unref (glade_xml);
-	g_object_unref (client);
 unique_out:
 	g_object_unref (egg_unique);
 

Added: trunk/src/gpk-service-pack.c
==============================================================================
--- (empty file)
+++ trunk/src/gpk-service-pack.c	Thu Oct  9 16:58:36 2008
@@ -0,0 +1,486 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <locale.h>
+
+#include <glade/glade.h>
+#include <gtk/gtk.h>
+#include <math.h>
+#include <string.h>
+#include <dbus/dbus-glib.h>
+#include <gconf/gconf-client.h>
+
+#include <pk-common.h>
+#include <pk-client.h>
+#include <pk-control.h>
+#include <pk-service-pack.h>
+
+#include "egg-debug.h"
+#include "egg-unique.h"
+
+#include "gpk-common.h"
+#include "gpk-error.h"
+#include "gpk-gnome.h"
+#include "gpk-enum.h"
+
+static GladeXML *glade_xml = NULL;
+static gboolean updates = TRUE;
+guint pulse_id = 0;
+
+/**
+ * gpk_pack_get_default_filename:
+ **/
+static gchar *
+gpk_pack_get_default_filename (const gchar *name, const gchar *directory)
+{
+	gchar *filename = NULL;
+	gchar *distro_id;
+	gchar *iso_time = NULL;
+
+	distro_id = pk_get_distro_id ();
+	if (name != NULL) {
+		filename = g_strdup_printf ("%s/%s-%s.servicepack", directory, name, distro_id);
+	} else {
+		iso_time = pk_iso8601_present ();
+		/* don't include the time, just use the date prefix */
+		iso_time[10] = '\0';
+		filename = g_strdup_printf ("%s/updates-%s-%s.servicepack", directory, iso_time, distro_id);
+	}
+	g_free (distro_id);
+	g_free (iso_time);
+	return filename;
+}
+/**
+ * gpk_pack_button_help_cb:
+ **/
+static void
+gpk_pack_button_help_cb (GtkWidget *widget, gpointer data)
+{
+	gpk_gnome_help ("service-pack");
+}
+
+/**
+ * gpk_pack_widgets_activate:
+ **/
+static void
+gpk_pack_widgets_activate (gboolean enable)
+{
+	GtkWidget *widget;
+	if (!updates) {
+		widget = glade_xml_get_widget (glade_xml, "entry_package");
+		gtk_widget_set_sensitive (widget, enable);
+	}
+	widget = glade_xml_get_widget (glade_xml, "radiobutton_updates");
+	gtk_widget_set_sensitive (widget, enable);
+	widget = glade_xml_get_widget (glade_xml, "radiobutton_package");
+	gtk_widget_set_sensitive (widget, enable);
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_directory");
+	gtk_widget_set_sensitive (widget, enable);
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_exclude");
+	gtk_widget_set_sensitive (widget, enable);
+	widget = glade_xml_get_widget (glade_xml, "button_create");
+	gtk_widget_set_sensitive (widget, enable);
+	widget = glade_xml_get_widget (glade_xml, "button_close");
+	gtk_widget_set_sensitive (widget, enable);
+}
+
+/**
+ * gpk_pack_package_cb:
+ **/
+static void
+gpk_pack_package_cb (PkServicePack *pack, const PkPackageObj *obj, gpointer data)
+{
+	GtkWidget *widget;
+	gchar *text;
+	widget = glade_xml_get_widget (glade_xml, "progressbar_percentage");
+	text = g_strdup_printf ("%s-%s.%s", obj->id->name, obj->id->version, obj->id->arch);
+	gtk_progress_bar_set_text (GTK_PROGRESS_BAR(widget), text);
+	g_free (text);
+}
+
+/**
+ * gpk_pack_percentage_pulse_cb:
+ **/
+static gboolean
+gpk_pack_percentage_pulse_cb (gpointer data)
+{
+	GtkWidget *widget;
+	widget = glade_xml_get_widget (glade_xml, "progressbar_percentage");
+	gtk_progress_bar_pulse (GTK_PROGRESS_BAR(widget));
+	return TRUE;
+}
+
+/**
+ * gpk_pack_set_percentage:
+ **/
+static void
+gpk_pack_set_percentage (guint percentage)
+{
+	GtkWidget *widget;
+	widget = glade_xml_get_widget (glade_xml, "progressbar_percentage");
+
+	/* no info */
+	if (percentage == 101) {
+		/* set pulsing */
+		if (pulse_id == 0)
+			pulse_id = g_timeout_add (100, gpk_pack_percentage_pulse_cb, NULL);
+		return;
+	}
+
+	/* clear pulse */
+	if (pulse_id != 0) {
+		g_source_remove (pulse_id);
+		pulse_id = 0;
+	}
+	
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(widget), percentage / 100.0f);
+}
+
+/**
+ * gpk_pack_percentage_cb:
+ **/
+static void
+gpk_pack_percentage_cb (PkServicePack *pack, guint percentage, gpointer data)
+{
+	gpk_pack_set_percentage (percentage);
+}
+
+/**
+ * gpk_pack_progress_changed_cb:
+ **/
+static void
+gpk_pack_progress_changed_cb (PkClient *client, guint percentage, guint subpercentage,
+			      guint elapsed, guint remaining, gpointer data)
+{
+	gpk_pack_set_percentage (percentage);
+}
+
+/**
+ * gpk_pack_resolve:
+ **/
+static gchar *
+gpk_pack_resolve (const gchar *package)
+{
+	GtkWidget *widget;
+	PkPackageList *list = NULL;
+	gchar *package_id = NULL;
+	gchar **packages;
+	gchar *text;
+	PkClient *client;
+	GError *error = NULL;
+	const PkPackageObj *obj;
+	gboolean ret = FALSE;
+	guint len;
+
+	client = pk_client_new ();
+	pk_client_set_use_buffer (client, TRUE, NULL);
+	pk_client_set_synchronous (client, TRUE, NULL);
+	g_signal_connect (client, "progress-changed", G_CALLBACK (gpk_pack_progress_changed_cb), NULL);
+
+	/* resolve */
+	packages = g_strsplit (package, ";", 0);
+	ret = pk_client_resolve (client, pk_bitfield_value (PK_FILTER_ENUM_NEWEST), packages, &error);
+	if (!ret) {
+		egg_warning ("failed to resolve: %s", error->message);
+		g_error_free (error);
+		goto out;
+	}
+
+	/* get the deps */
+	list = pk_client_get_package_list (client);
+	len = pk_package_list_get_size (list);
+
+	/* display errors if not exactly one match */
+	if (len == 0) {
+		widget = glade_xml_get_widget (glade_xml, "window_pack");
+		text = g_strdup_printf (_("No package '%s' found!"), package);
+		gpk_error_dialog_modal (GTK_WINDOW (widget), _("Create error"), text, NULL);
+		g_free (text);
+		goto out;
+	} else if (len > 1) {
+		widget = glade_xml_get_widget (glade_xml, "window_pack");
+		text = g_strdup_printf (_("More than one possible package '%s' found!"), package);
+		gpk_error_dialog_modal (GTK_WINDOW (widget), _("Create error"), text, NULL);
+		g_free (text);
+		goto out;
+	}
+
+	/* convert to a text package id */
+	obj = pk_package_list_get_obj (list, 0);
+	package_id = pk_package_id_to_string (obj->id);
+
+out:
+	if (list != NULL)
+		g_object_unref (list);
+	g_object_unref (client);
+	g_strfreev (packages);
+	return package_id;
+}
+
+/**
+ * gpk_pack_button_create_cb:
+ **/
+static void
+gpk_pack_button_create_cb (GtkWidget *widget2, gpointer data)
+{
+	GtkWidget *widget;
+	const gchar *package = NULL;
+	gchar *directory;
+	gchar *filename;
+	gchar *exclude;
+	gchar *package_id;
+	PkServicePack *pack;
+	PkPackageList *list = NULL;
+	GError *error = NULL;
+	gboolean ret;
+
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_directory");
+	directory = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(widget));
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_exclude");
+	exclude = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(widget));
+
+	/* fall back to the system copy */
+	if (exclude == NULL)
+		exclude = g_strdup (PK_SYSTEM_PACKAGE_LIST_FILENAME);
+
+	if (!updates) {
+		widget = glade_xml_get_widget (glade_xml, "entry_package");
+		package = gtk_entry_get_text (GTK_ENTRY(widget));
+	}
+
+	gpk_pack_widgets_activate (FALSE);
+	widget = glade_xml_get_widget (glade_xml, "frame_progress");
+	gtk_widget_show (widget);
+
+	/* resolve name to ID */
+	package_id = gpk_pack_resolve (package);
+	if (package_id == NULL)
+		goto back;
+
+	/* get the exclude list */
+	list = pk_package_list_new ();
+	ret = pk_package_list_add_file (list, exclude);
+	if (!ret) {
+		widget = glade_xml_get_widget (glade_xml, "window_pack");
+		gpk_error_dialog_modal (GTK_WINDOW (widget), _("Create error"), _("Cannot read destination package list"), NULL);
+		goto out;
+	}
+
+	/* use a default filename */
+	filename = gpk_pack_get_default_filename (package, directory);
+
+	/* create pack and set initial values */
+	pack = pk_service_pack_new ();
+	g_signal_connect (pack, "package", G_CALLBACK (gpk_pack_package_cb), pack);
+	g_signal_connect (pack, "percentage", G_CALLBACK (gpk_pack_percentage_cb), pack);
+	pk_service_pack_set_filename (pack, filename);
+	pk_service_pack_set_temp_directory (pack, NULL);
+	pk_service_pack_set_exclude_list (pack, list);
+
+	if (updates)
+		ret = pk_service_pack_create_for_updates (pack, &error);
+	else
+		ret = pk_service_pack_create_for_package_id (pack, package_id, &error);
+	if (!ret) {
+		widget = glade_xml_get_widget (glade_xml, "window_pack");
+		gpk_error_dialog_modal (GTK_WINDOW (widget), _("Create error"), _("Cannot create service pack"), error->message);
+		g_error_free (error);
+	}
+	g_object_unref (pack);
+
+back:
+	gpk_pack_widgets_activate (TRUE);
+	widget = glade_xml_get_widget (glade_xml, "frame_progress");
+	gtk_widget_hide (widget);
+
+out:
+	if (list != NULL)
+		g_object_unref (list);
+	g_free (package_id);
+	g_free (directory);
+	g_free (exclude);
+}
+
+/**
+ * ggpk_pack_activated_cb
+ **/
+static void
+ggpk_pack_activated_cb (EggUnique *egg_unique, gpointer data)
+{
+	GtkWidget *widget;
+	widget = glade_xml_get_widget (glade_xml, "window_prefs");
+	gtk_window_present (GTK_WINDOW (widget));
+}
+
+/**
+ * ggpk_pack_radio_updates_cb:
+ **/
+static void
+ggpk_pack_radio_updates_cb (GtkWidget *widget2, gpointer data)
+{
+	GtkWidget *widget;
+	egg_debug ("got updates");
+	widget = glade_xml_get_widget (glade_xml, "entry_package");
+	gtk_widget_set_sensitive (widget, FALSE);
+	updates = TRUE;
+}
+
+/**
+ * ggpk_pack_radio_package_cb:
+ **/
+static void
+ggpk_pack_radio_package_cb (GtkWidget *widget2, gpointer data)
+{
+	GtkWidget *widget;
+	egg_debug ("got package");
+	widget = glade_xml_get_widget (glade_xml, "entry_package");
+	gtk_widget_set_sensitive (widget, TRUE);
+	updates = FALSE;
+}
+
+/**
+ * main:
+ **/
+int
+main (int argc, char *argv[])
+{
+	gboolean verbose = FALSE;
+	gboolean program_version = FALSE;
+	GOptionContext *context;
+	GtkWidget *main_window;
+	GtkWidget *widget;
+	GtkFileFilter *filter;
+	GtkEntryCompletion *completion;
+	PkBitfield roles;
+	PkControl *control;
+	EggUnique *egg_unique;
+	gboolean ret;
+	GConfClient *client;
+
+	const GOptionEntry options[] = {
+		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
+		  _("Show extra debugging information"), NULL },
+		{ "version", '\0', 0, G_OPTION_ARG_NONE, &program_version,
+		  _("Show the program version and exit"), NULL },
+		{ NULL}
+	};
+
+	setlocale (LC_ALL, "");
+
+	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+
+	if (! g_thread_supported ())
+		g_thread_init (NULL);
+	dbus_g_thread_init ();
+	g_type_init ();
+
+	context = g_option_context_new (NULL);
+	g_option_context_set_summary(context, _("Software Update Preferences"));
+	g_option_context_add_main_entries (context, options, NULL);
+	g_option_context_parse (context, &argc, &argv, NULL);
+	g_option_context_free (context);
+
+	if (program_version) {
+		g_print (VERSION "\n");
+		return 0;
+	}
+
+	egg_debug_init (verbose);
+	gtk_init (&argc, &argv);
+
+	/* are we already activated? */
+	egg_unique = egg_unique_new ();
+	ret = egg_unique_assign (egg_unique, "org.freedesktop.PackageKit.ServicePack");
+	if (!ret)
+		goto unique_out;
+	g_signal_connect (egg_unique, "activated",
+			  G_CALLBACK (ggpk_pack_activated_cb), NULL);
+
+	/* get actions */
+	control = pk_control_new ();
+	roles = pk_control_get_actions (control, NULL);
+	g_object_unref (control);
+
+	glade_xml = glade_xml_new (GPK_DATA "/gpk-service-pack.glade", NULL, NULL);
+	main_window = glade_xml_get_widget (glade_xml, "window_pack");
+
+	/* Hide window first so that the dialogue resizes itself without redrawing */
+	gtk_widget_hide (main_window);
+	gtk_window_set_icon_name (GTK_WINDOW (main_window), GPK_ICON_SOFTWARE_SOURCES);
+
+	/* Get the main window quit */
+	g_signal_connect_swapped (main_window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
+
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_exclude");
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("Package list files"));
+	gtk_file_filter_add_pattern (filter, "*.package-list");
+	gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(widget), filter);
+
+	widget = glade_xml_get_widget (glade_xml, "filechooserbutton_directory");
+	filter = gtk_file_filter_new ();
+	gtk_file_filter_set_name (filter, _("Service pack files"));
+	gtk_file_filter_add_pattern (filter, "*.servicepack");
+	gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(widget), filter);
+
+	widget = glade_xml_get_widget (glade_xml, "radiobutton_updates");
+	g_signal_connect (widget, "clicked", G_CALLBACK (ggpk_pack_radio_updates_cb), NULL);
+	widget = glade_xml_get_widget (glade_xml, "radiobutton_package");
+	g_signal_connect (widget, "clicked", G_CALLBACK (ggpk_pack_radio_package_cb), NULL);
+
+	widget = glade_xml_get_widget (glade_xml, "button_close");
+	g_signal_connect_swapped (widget, "clicked", G_CALLBACK (gtk_main_quit), NULL);
+	widget = glade_xml_get_widget (glade_xml, "button_create");
+	g_signal_connect (widget, "clicked", G_CALLBACK (gpk_pack_button_create_cb), NULL);
+	widget = glade_xml_get_widget (glade_xml, "button_help");
+	g_signal_connect (widget, "clicked", G_CALLBACK (gpk_pack_button_help_cb), NULL);
+
+	widget = glade_xml_get_widget (glade_xml, "frame_progress");
+	gtk_widget_hide (widget);
+
+	/* autocompletion can be turned off as it's slow */
+	client = gconf_client_get_default ();
+	ret = gconf_client_get_bool (client, GPK_CONF_AUTOCOMPLETE, NULL);
+	if (ret) {
+		/* create the completion object */
+		completion = gpk_package_entry_completion_new ();
+		widget = glade_xml_get_widget (glade_xml, "entry_package");
+		gtk_entry_set_completion (GTK_ENTRY (widget), completion);
+		g_object_unref (completion);
+	}
+
+	gtk_widget_show (main_window);
+
+	/* wait */
+	gtk_main ();
+
+	g_object_unref (glade_xml);
+unique_out:
+	g_object_unref (egg_unique);
+
+	return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]