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

Anders F Bjorklund afb at xfce.org
Wed Apr 16 11:50:11 CEST 2008


Author: afb
Date: 2008-04-16 09:50:10 +0000 (Wed, 16 Apr 2008)
New Revision: 4585

Modified:
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
   xfce4-smartpm-plugin/trunk/src/xfcesmart.h
Log:
add new su_instead_of_sudo setting

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2008-04-16 05:01:35 UTC (rev 4584)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2008-04-16 09:50:10 UTC (rev 4585)
@@ -843,6 +843,7 @@
       xfce_rc_write_int_entry (rc, "manager", smart->package_manager);
       xfce_rc_write_bool_entry (rc, "appicon", smart->show_application);
       xfce_rc_write_bool_entry (rc, "notify", smart->show_notifications);
+      xfce_rc_write_bool_entry (rc, "su", smart->su_instead_of_sudo);
 
       /* close the rc file */
       xfce_rc_close (rc);
@@ -877,6 +878,7 @@
           smart->package_manager = xfce_rc_read_int_entry (rc, "manager", PACKAGE_MANAGER_SMART);
           smart->show_application =  xfce_rc_read_bool_entry (rc, "appicon", TRUE);
           smart->show_notifications =  xfce_rc_read_bool_entry (rc, "notify", FALSE);
+          smart->su_instead_of_sudo =  xfce_rc_read_bool_entry (rc, "su", FALSE);
 
           /* cleanup */
           xfce_rc_close (rc);
@@ -895,6 +897,7 @@
   smart->package_manager = PACKAGE_MANAGER_SMART;
   smart->show_application = TRUE;
   smart->show_notifications = FALSE;
+  smart->su_instead_of_sudo = FALSE;
 }
 
 
@@ -1032,7 +1035,7 @@
 {
   SmartPlugin *smart = user_data;
 
-  smart->upgrade_directly = gtk_toggle_button_get_active(button);
+  smart->su_instead_of_sudo = gtk_toggle_button_get_active(button);
 }
 
 static void
@@ -1041,6 +1044,15 @@
 {
   SmartPlugin *smart = user_data;
 
+  smart->upgrade_directly = gtk_toggle_button_get_active(button);
+}
+
+static void
+smart_checkbox5_toggle_cb(GtkToggleButton *button,
+        gpointer user_data)
+{
+  SmartPlugin *smart = user_data;
+
   smart->dist_upgrade = gtk_toggle_button_get_active(button);
 }
 
@@ -1473,16 +1485,22 @@
   gtk_widget_set_sensitive (button, FALSE);
 #endif
   
+  button = gtk_check_button_new_with_label(_("Use su for authentication (instead of sudo)"));
+  gtk_widget_show (button);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), smart->su_instead_of_sudo);
+  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);
+
   button = gtk_check_button_new_with_label(_("Upgrade on launch (if upgrades available)"));
   gtk_widget_show (button);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), smart->upgrade_directly);
-  g_signal_connect (G_OBJECT(button),"toggled", G_CALLBACK(smart_checkbox3_toggle_cb), smart);
+  g_signal_connect (G_OBJECT(button),"toggled", G_CALLBACK(smart_checkbox4_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_checkbox4_toggle_cb), smart);
+  g_signal_connect (G_OBJECT(button),"toggled", G_CALLBACK(smart_checkbox5_toggle_cb), smart);
   gtk_box_pack_start (GTK_BOX(vbox),button,TRUE,TRUE,0);
 
   g_object_set_data (G_OBJECT (plugin), "dist-upgrade", button);

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.h
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.h	2008-04-16 05:01:35 UTC (rev 4584)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.h	2008-04-16 09:50:10 UTC (rev 4585)
@@ -1,4 +1,4 @@
-/*  $Id:$
+/*  $Id$
  *
  *  Copyright (c) 2007 Anders F Bjorklund <afb at users.sourceforge.net>
  *
@@ -58,6 +58,7 @@
     gint package_manager;
     gboolean show_application;
     gboolean show_notifications;
+    gboolean su_instead_of_sudo;
 }
 SmartPlugin;
 




More information about the Goodies-commits mailing list