[empathy] Replace EphySpinner by GtkSpinner



commit f9d98f63fe3eaf8b3871df629445343c59d6da76
Author: Xavier Claessens <xclaesse gmail com>
Date:   Tue Apr 13 16:02:53 2010 +0200

    Replace EphySpinner by GtkSpinner
    
    Fixes bug #598446

 configure.ac                      |    2 +-
 src/Makefile.am                   |    1 -
 src/empathy-accounts-dialog.c     |   12 +-
 src/empathy-main-window.c         |   38 +-
 src/empathy-map-view.c            |   17 +-
 src/empathy-new-chatroom-dialog.c |   17 +-
 src/ephy-spinner.c                |  976 -------------------------------------
 src/ephy-spinner.h                |   69 ---
 8 files changed, 43 insertions(+), 1089 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8c9f24a..f9db12d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ AC_COPYRIGHT([
 
 # Minimal version required
 GLIB_REQUIRED=2.22.0
-GTK_REQUIRED=2.18.0
+GTK_REQUIRED=2.20.0
 GCONF_REQUIRED=1.2.0
 TELEPATHY_GLIB_REQUIRED=0.11.1
 TELEPATHY_LOGGER=0.1.1
diff --git a/src/Makefile.am b/src/Makefile.am
index 18edc7f..9b35e9b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,7 +41,6 @@ libempathy_accounts_common_la_SOURCES =					\
 	empathy-import-pidgin.c empathy-import-pidgin.h			\
 	empathy-import-widget.c empathy-import-widget.h			\
 	empathy-import-utils.c empathy-import-utils.h			\
-	ephy-spinner.c ephy-spinner.h					\
 	$(NULL)
 
 libempathy_accounts_common_la_LIBADD =					\
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index f76d509..59bad47 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -52,7 +52,6 @@
 #include "empathy-accounts-dialog.h"
 #include "empathy-import-dialog.h"
 #include "empathy-import-utils.h"
-#include "ephy-spinner.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
 #include <libempathy/empathy-debug.h>
@@ -264,7 +263,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
             gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
                 GTK_MESSAGE_INFO);
 
-            ephy_spinner_start (EPHY_SPINNER (priv->throbber));
+            gtk_spinner_start (GTK_SPINNER (priv->throbber));
             gtk_widget_show (priv->throbber);
             gtk_widget_hide (priv->image_status);
             break;
@@ -308,7 +307,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
                message = _("Offline â?? No Network Connection");
 
             g_object_unref (connectivity);
-            ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
+            gtk_spinner_stop (GTK_SPINNER (priv->throbber));
             gtk_widget_show (priv->image_status);
             gtk_widget_hide (priv->throbber);
             break;
@@ -317,7 +316,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
             gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
                 GTK_MESSAGE_WARNING);
 
-            ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
+            gtk_spinner_stop (GTK_SPINNER (priv->throbber));
             gtk_widget_hide (priv->image_status);
             gtk_widget_hide (priv->throbber);
         }
@@ -328,7 +327,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
 
       gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
           GTK_MESSAGE_WARNING);
-      ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
+      gtk_spinner_stop (GTK_SPINNER (priv->throbber));
       gtk_widget_show (priv->image_status);
       gtk_widget_hide (priv->throbber);
     }
@@ -2047,8 +2046,7 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog)
   gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
 
   /* set up spinner */
-  priv->throbber = ephy_spinner_new ();
-  ephy_spinner_set_size (EPHY_SPINNER (priv->throbber), GTK_ICON_SIZE_SMALL_TOOLBAR);
+  priv->throbber = gtk_spinner_new ();
 
   priv->image_status = gtk_image_new_from_icon_name (
             empathy_icon_name_for_presence (
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 031e23d..3d367df 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -56,7 +56,6 @@
 #include "empathy-accounts-dialog.h"
 #include "empathy-chat-manager.h"
 #include "empathy-main-window.h"
-#include "ephy-spinner.h"
 #include "empathy-preferences.h"
 #include "empathy-about-dialog.h"
 #include "empathy-debug-window.h"
@@ -94,6 +93,7 @@ typedef struct {
 	GtkWidget              *window;
 	GtkWidget              *main_vbox;
 	GtkWidget              *throbber;
+	GtkWidget              *throbber_tool_item;
 	GtkWidget              *presence_toolbar;
 	GtkWidget              *presence_chooser;
 	GtkWidget              *errors_vbox;
@@ -508,9 +508,11 @@ main_window_update_status (EmpathyMainWindow *window)
 
 	/* Update the spinner state */
 	if (connecting) {
-		ephy_spinner_start (EPHY_SPINNER (window->throbber));
+		gtk_spinner_start (GTK_SPINNER (window->throbber));
+		gtk_widget_show (window->throbber_tool_item);
 	} else {
-		ephy_spinner_stop (EPHY_SPINNER (window->throbber));
+		gtk_spinner_stop (GTK_SPINNER (window->throbber));
+		gtk_widget_hide (window->throbber_tool_item);
 	}
 
 	/* Update widgets sensibility */
@@ -1155,7 +1157,7 @@ main_window_help_contents_cb (GtkAction         *action,
 }
 
 static gboolean
-main_window_throbber_button_press_event_cb (GtkWidget         *throbber_ebox,
+main_window_throbber_button_press_event_cb (GtkWidget         *throbber,
 					    GdkEventButton    *event,
 					    EmpathyMainWindow *window)
 {
@@ -1165,7 +1167,7 @@ main_window_throbber_button_press_event_cb (GtkWidget         *throbber_ebox,
 	}
 
 	empathy_accounts_dialog_show_application (
-			gtk_widget_get_screen (GTK_WIDGET (throbber_ebox)),
+			gtk_widget_get_screen (GTK_WIDGET (throbber)),
 			NULL, FALSE, FALSE);
 
 	return FALSE;
@@ -1318,7 +1320,6 @@ empathy_main_window_show (void)
 	EmpathyConf              *conf;
 	GtkWidget                *sw;
 	GtkToggleAction          *show_offline_widget;
-	GtkWidget                *ebox;
 	GtkAction                *show_map_widget;
 	GtkToolItem              *item;
 	gboolean                  show_offline;
@@ -1430,24 +1431,21 @@ empathy_main_window_show (void)
 	gtk_toolbar_insert (GTK_TOOLBAR (window->presence_toolbar), item, -1);
 
 	/* Set up the throbber */
-	ebox = gtk_event_box_new ();
-	gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
-	gtk_widget_set_tooltip_text (ebox, _("Show and edit accounts"));
-	g_signal_connect (ebox,
-			  "button-press-event",
-			  G_CALLBACK (main_window_throbber_button_press_event_cb),
-			  window);
-	gtk_widget_show (ebox);
-
-	window->throbber = ephy_spinner_new ();
-	ephy_spinner_set_size (EPHY_SPINNER (window->throbber), GTK_ICON_SIZE_LARGE_TOOLBAR);
-	gtk_container_add (GTK_CONTAINER (ebox), window->throbber);
+	window->throbber = gtk_spinner_new ();
+	gtk_widget_set_size_request (window->throbber, 16, -1);
+	gtk_widget_set_tooltip_text (window->throbber, _("Show and edit accounts"));
+	gtk_widget_set_has_window (GTK_WIDGET (window->throbber), TRUE);
+	gtk_widget_set_events (window->throbber, GDK_BUTTON_PRESS_MASK);
+	g_signal_connect (window->throbber, "button-press-event",
+		G_CALLBACK (main_window_throbber_button_press_event_cb),
+		window);
 	gtk_widget_show (window->throbber);
 
 	item = gtk_tool_item_new ();
-	gtk_container_add (GTK_CONTAINER (item), ebox);
+	gtk_container_set_border_width (GTK_CONTAINER (item), 6);
 	gtk_toolbar_insert (GTK_TOOLBAR (window->presence_toolbar), item, -1);
-	gtk_widget_show (GTK_WIDGET (item));
+	gtk_container_add (GTK_CONTAINER (item), window->throbber);
+	window->throbber_tool_item = GTK_WIDGET (item);
 
 	list_iface = EMPATHY_CONTACT_LIST (empathy_contact_manager_dup_singleton ());
 	monitor = empathy_contact_list_get_monitor (list_iface);
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 2996a61..52b071e 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -41,7 +41,6 @@
 #include <libempathy-gtk/empathy-ui-utils.h>
 
 #include "empathy-map-view.h"
-#include "ephy-spinner.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_LOCATION
 #include <libempathy/empathy-debug.h>
@@ -70,9 +69,15 @@ map_view_state_changed (ChamplainView *view,
 
   g_object_get (G_OBJECT (view), "state", &state, NULL);
   if (state == CHAMPLAIN_STATE_LOADING)
-    ephy_spinner_start (EPHY_SPINNER (window->throbber));
+    {
+      gtk_spinner_start (GTK_SPINNER (window->throbber));
+      gtk_widget_show (window->throbber);
+    }
   else
-    ephy_spinner_stop (EPHY_SPINNER (window->throbber));
+    {
+      gtk_spinner_stop (GTK_SPINNER (window->throbber));
+      gtk_widget_hide (window->throbber);
+    }
 }
 
 static gboolean
@@ -434,10 +439,8 @@ empathy_map_view_show (void)
   window->members_changed_id = g_signal_connect (window->contact_list,
       "members-changed", G_CALLBACK (members_changed_cb), window);
 
-  window->throbber = ephy_spinner_new ();
-  ephy_spinner_set_size (EPHY_SPINNER (window->throbber),
-      GTK_ICON_SIZE_LARGE_TOOLBAR);
-  gtk_widget_show (window->throbber);
+  window->throbber = gtk_spinner_new ();
+  gtk_widget_set_size_request (window->throbber, 16, 16);
   gtk_container_add (GTK_CONTAINER (throbber_holder), window->throbber);
 
   /* Set up map view */
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c
index c814e44..9cd4398 100644
--- a/src/empathy-new-chatroom-dialog.c
+++ b/src/empathy-new-chatroom-dialog.c
@@ -43,7 +43,6 @@
 #include <libempathy-gtk/empathy-ui-utils.h>
 
 #include "empathy-new-chatroom-dialog.h"
-#include "ephy-spinner.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
 #include <libempathy/empathy-debug.h>
@@ -235,9 +234,7 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
 	new_chatroom_dialog_model_setup (dialog);
 
 	/* Add throbber */
-	dialog->throbber = ephy_spinner_new ();
-	ephy_spinner_set_size (EPHY_SPINNER (dialog->throbber), GTK_ICON_SIZE_LARGE_TOOLBAR);
-	gtk_widget_show (dialog->throbber);
+	dialog->throbber = gtk_spinner_new ();
 	gtk_table_attach (GTK_TABLE (dialog->table_info),
 			  dialog->throbber,
 			  2, 3, 0, 1,
@@ -491,7 +488,8 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
 		dialog->room_list = NULL;
 	}
 
-	ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
+	gtk_spinner_stop (GTK_SPINNER (dialog->throbber));
+	gtk_widget_hide (dialog->throbber);
 	new_chatroom_dialog_model_clear (dialog);
 
 	if (dialog->account != NULL) {
@@ -553,7 +551,8 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
 
 		listing = empathy_tp_roomlist_is_listing (dialog->room_list);
 		if (listing) {
-			ephy_spinner_start (EPHY_SPINNER (dialog->throbber));
+			gtk_spinner_start (GTK_SPINNER (dialog->throbber));
+			gtk_widget_show (dialog->throbber);
 		}
 	}
 
@@ -659,9 +658,11 @@ new_chatroom_dialog_listing_cb (EmpathyTpRoomlist        *room_list,
 
 	/* Update the throbber */
 	if (listing) {
-		ephy_spinner_start (EPHY_SPINNER (dialog->throbber));
+		gtk_spinner_start (GTK_SPINNER (dialog->throbber));
+		gtk_widget_show (dialog->throbber);
 	} else {
-		ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
+		gtk_spinner_stop (GTK_SPINNER (dialog->throbber));
+		gtk_widget_hide (dialog->throbber);
 	}
 }
 



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