[Goodies-commits] r3302 - xfce4-smartpm-plugin/trunk/src

Anders F Bjorklund afb at xfce.org
Thu Oct 4 23:53:44 CEST 2007


Author: afb
Date: 2007-10-04 21:53:44 +0000 (Thu, 04 Oct 2007)
New Revision: 3302

Modified:
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
   xfce4-smartpm-plugin/trunk/src/xfcesmart.h
Log:
add dist-upgrade boolean setting

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-04 20:47:27 UTC (rev 3301)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-04 21:53:44 UTC (rev 3302)
@@ -581,7 +581,7 @@
       tempfile = g_strdup_printf("%s%s%s-apt", g_get_tmp_dir(), G_DIR_SEPARATOR_S, g_get_user_name());
       argv[0] = APT_UPDATE;
       argv[1] = "--simulate";
-      argv[2] = "dist-upgrade";
+      argv[2] = (smart->dist_upgrade) ? "dist-upgrade" : "upgrade";
       argv[3] = "--option"; /* regular cache files is only writable by root */
       argv[4] = pkgcache = g_strdup_printf("Dir::Cache::pkgcache=%spkg.cache", tempfile);
       argv[5] = "--option"; /* regular cache files is only writable by root */
@@ -718,6 +718,7 @@
       /* save the settings */
       xfce_rc_write_int_entry  (rc, "interval", smart->check_interval);
       xfce_rc_write_bool_entry (rc, "upgrade", smart->upgrade_directly);
+      xfce_rc_write_bool_entry (rc, "dist-upgrade", smart->dist_upgrade);
       xfce_rc_write_int_entry (rc, "manager", smart->package_manager);
       xfce_rc_write_bool_entry (rc, "appicon", smart->show_application);
 
@@ -750,6 +751,7 @@
           /* read the settings */
           smart->check_interval = xfce_rc_read_int_entry (rc, "interval", 0);
           smart->upgrade_directly =  xfce_rc_read_bool_entry (rc, "upgrade", TRUE);
+          smart->dist_upgrade =  xfce_rc_read_bool_entry (rc, "dist-upgrade", TRUE);
           smart->package_manager = xfce_rc_read_int_entry (rc, "manager", PACKAGE_MANAGER_SMART);
           smart->show_application =  xfce_rc_read_bool_entry (rc, "appicon", TRUE);
 
@@ -766,6 +768,7 @@
 
   smart->check_interval = 0;
   smart->upgrade_directly = TRUE;
+  smart->dist_upgrade = TRUE;
   smart->package_manager = PACKAGE_MANAGER_SMART;
   smart->show_application = TRUE;
 }
@@ -894,6 +897,15 @@
   smart->upgrade_directly = gtk_toggle_button_get_active(button);
 }
 
+static void
+smart_checkbox3_toggle_cb(GtkToggleButton *button,
+        gpointer user_data)
+{
+  SmartPlugin *smart = user_data;
+
+  smart->dist_upgrade = gtk_toggle_button_get_active(button);
+}
+
 static SmartPlugin *
 smart_new (XfcePanelPlugin *plugin)
 {
@@ -1303,6 +1315,12 @@
   g_signal_connect (G_OBJECT(button),"toggled", G_CALLBACK(smart_checkbox2_toggle_cb), smart);
   gtk_box_pack_start (GTK_BOX(vbox),button,TRUE,TRUE,0);
 
+  button = gtk_check_button_new_with_label(_("Smart upgrade to newer release (dist-upgrade)"));
+  gtk_widget_show (button);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), smart->dist_upgrade);
+  g_signal_connect (G_OBJECT(button),"toggled", G_CALLBACK(smart_checkbox3_toggle_cb), smart);
+  gtk_box_pack_start (GTK_BOX(vbox),button,TRUE,TRUE,0);
+
   /* center dialog on the screen */
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
 

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.h
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.h	2007-10-04 20:47:27 UTC (rev 3301)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.h	2007-10-04 21:53:44 UTC (rev 3302)
@@ -54,6 +54,7 @@
     /* panel settings */
     gint check_interval;
     gboolean upgrade_directly;
+    gboolean dist_upgrade;
     gint package_manager;
     gboolean show_application;
 }




More information about the Goodies-commits mailing list