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

Anders F Bjorklund afb at xfce.org
Mon Oct 8 09:22:34 CEST 2007


Author: afb
Date: 2007-10-08 07:22:33 +0000 (Mon, 08 Oct 2007)
New Revision: 3314

Modified:
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
Log:
disable dist-upgrade when not using apt

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-07 22:30:26 UTC (rev 3313)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-08 07:22:33 UTC (rev 3314)
@@ -1,4 +1,4 @@
-/*  $Id:$
+/*  $Id$
  *
  *  xfce4-smartpm-plugin - a package manager applet for the xfce4 panel
  *  Copyright (c) 2007 Anders F Bjorklund <afb at users.sourceforge.net>
@@ -849,12 +849,18 @@
         gpointer user_data)
 {
   SmartPlugin *smart = user_data;
+  GtkWidget *button;
   gint manager;
 
   manager = gtk_combo_box_get_active(combo);
 
   smart_set_manager (smart, manager);
 
+  button = g_object_get_data (G_OBJECT (plugin), "dist-upgrade");
+
+  if (button != NULL)
+  gtk_widget_set_sensitive (button, smart->package_manager == PACKAGE_MANAGER_APT);
+
   if (smart->show_application) /* change the application icon too */
   smart_size_changed (smart->plugin, smart->current_icon_size, smart);
 }
@@ -1177,6 +1183,8 @@
     }
   else if (response == GTK_RESPONSE_OK)
     {
+      g_object_set_data (G_OBJECT (smart->plugin), "dist-upgrade", NULL);
+
       /* remove the dialog data from the plugin */
       g_object_set_data (G_OBJECT (smart->plugin), "dialog", NULL);
       
@@ -1321,6 +1329,9 @@
   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);
 
+  g_object_set_data (G_OBJECT (plugin), "dist-upgrade", button);
+  gtk_widget_set_sensitive (button, smart->package_manager == PACKAGE_MANAGER_APT);
+
   /* center dialog on the screen */
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
 




More information about the Goodies-commits mailing list