[gnome-applets/gtk3: 21/23] battstat: Fix the build with gtk3



commit 0721993b455b7ee1ca34a3f63e9200fde21607c5
Author: Christian Persch <chpe gnome org>
Date:   Thu Oct 28 14:56:59 2010 +0200

    battstat: Fix the build with gtk3

 battstat/Makefile.am       |    2 +-
 battstat/battstat.h        |    3 ---
 battstat/battstat_applet.c |   35 +----------------------------------
 battstat/properties.c      |    1 -
 4 files changed, 2 insertions(+), 39 deletions(-)
---
diff --git a/battstat/Makefile.am b/battstat/Makefile.am
index a9599e3..1953246 100644
--- a/battstat/Makefile.am
+++ b/battstat/Makefile.am
@@ -90,7 +90,7 @@ org.gnome.panel.applet.BattstatAppletFactory.service: $(service_in_files)
 
 CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) $(schemas_DATA)
 
-uidir = $(datadir)/gnome-2.0/ui
+uidir = $(pkgdatadir)/ui
 ui_DATA = battstat-applet-menu.xml
 
 EXTRA_DIST = 							\
diff --git a/battstat/battstat.h b/battstat/battstat.h
index cdcd230..9b7acfd 100644
--- a/battstat/battstat.h
+++ b/battstat/battstat.h
@@ -112,9 +112,6 @@ typedef struct _ProgressData {
   /* label changed type (% <-> h:mm) and must be refreshed */
   gboolean refresh_label;
 
-  /* so we don't have to alloc/dealloc this every refresh */
-  GdkGC *pixgc;
-
   /* the main table that contains the visual elements */
   GtkWidget *table;
 
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index dc077e1..c669c2b 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -233,31 +233,6 @@ initialise_global_pixmaps( void )
     gdk_pixbuf_new_from_xpm_data ((const char **) warning_small_xpm);
 }
 
-/* For non-truecolour displays, each GdkColor has to have a palette entry
-   allocated for it.  This should only be done once for the entire display.
-*/
-static void
-allocate_battery_colours( void )
-{
-  GdkColormap *colourmap;
-  int i;
-
-  colourmap = gdk_colormap_get_system();
-
-  /* assumed: all the colour arrays have the same number of elements */
-  for( i = 0; i < G_N_ELEMENTS( orange ); i++ )
-  {
-     gdk_colormap_alloc_color( colourmap, &darkorange[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &darkyellow[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &darkred[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &darkgreen[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &orange[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &yellow[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &red[i], FALSE, TRUE );
-     gdk_colormap_alloc_color( colourmap, &green[i], FALSE, TRUE );
-  }
-}
-
 /* Our backends may be either event driven or poll-based.
  * If they are event driven then we know this the first time we
  * receive an event.
@@ -308,7 +283,6 @@ static_global_initialisation (int no_hal, ProgressData *battstat)
   if (!first_time)
     return NULL;
 
-  allocate_battery_colours();
   initialise_global_pixmaps();
   err = power_management_initialise (no_hal, status_change_callback);
 
@@ -425,7 +399,7 @@ battery_full_notify (GtkWidget *applet)
 			GTK_ICON_LOOKUP_USE_BUILTIN,
 			NULL);
 	
-	NotifyNotification *n = notify_notification_new (_("Your battery is now fully recharged"), "", /* "battery" */ NULL, applet);
+	NotifyNotification *n = notify_notification_new (_("Your battery is now fully recharged"), "", /* "battery" */ NULL);
 
 	/* XXX: it would be nice to pass this as a named icon */
 	notify_notification_set_icon_from_pixbuf (n, icon);
@@ -472,7 +446,6 @@ battery_full_dialog (GtkWidget *applet)
 			    G_OBJECT (dialog));
 
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
   hbox = gtk_hbox_new (FALSE, 6);
   pixbuf = gtk_icon_theme_load_icon (
 		gtk_icon_theme_get_default (),
@@ -633,8 +606,6 @@ battery_low_dialog( ProgressData *battery, BatteryStatus *info )
 
   gtk_container_set_border_width (GTK_CONTAINER (battery->battery_low_dialog),
 		  6);
-  gtk_dialog_set_has_separator (GTK_DIALOG (battery->battery_low_dialog),
-		  FALSE);
   hbox = gtk_hbox_new (FALSE, 6);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
   pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
@@ -1142,9 +1113,6 @@ destroy_applet( GtkWidget *widget, ProgressData *battstat )
   if (battstat->timeout_id)
     g_source_remove (battstat->timeout_id);
 
-  if( battstat->pixgc )
-    g_object_unref( G_OBJECT(battstat->pixgc) );
-
   g_object_unref( G_OBJECT(battstat->status) );
   g_object_unref( G_OBJECT(battstat->percent) );
   g_object_unref( G_OBJECT(battstat->battery) );
@@ -1619,7 +1587,6 @@ battstat_applet_fill (PanelApplet *applet)
   battstat->horizont = TRUE;
   battstat->battery_low_dialog = NULL;
   battstat->battery_low_label = NULL;
-  battstat->pixgc = NULL;
   battstat->timeout = -1;
   battstat->timeout_id = 0;
 
diff --git a/battstat/properties.c b/battstat/properties.c
index 83f5d21..eed71c1 100644
--- a/battstat/properties.c
+++ b/battstat/properties.c
@@ -438,7 +438,6 @@ prop_cb (GtkAction    *action,
    gtk_dialog_set_default_response (GTK_DIALOG (battstat->prop_win),
 		   GTK_RESPONSE_CLOSE);
    gtk_window_set_resizable (GTK_WINDOW (battstat->prop_win), FALSE);
-   gtk_dialog_set_has_separator (GTK_DIALOG (battstat->prop_win), FALSE);
    
    g_signal_connect (G_OBJECT (battstat->prop_win), "response",
    		     G_CALLBACK (response_cb), battstat);



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