gyrus r360 - in trunk: . src
- From: csaavedra svn gnome org
- To: svn-commits-list gnome org
- Subject: gyrus r360 - in trunk: . src
- Date: Sun, 12 Oct 2008 12:14:41 +0000 (UTC)
Author: csaavedra
Date: Sun Oct 12 12:14:41 2008
New Revision: 360
URL: http://svn.gnome.org/viewvc/gyrus?rev=360&view=rev
Log:
2008-10-12 Francisco Rojas <frojas alumnos utalca cl>
* configure.in: Remove the dependency on libgnomeui
* src/gyrus-main-app.c (gyrus_main_app_init), (menu_item_select_cb),
(menu_item_deselect_cb), (connect_proxy_cb),
(disconnect_proxy_cb): Replace GnomeAppbar with GtkStatusbar and
GtkProgressBar.
Remove dependence on obsolete libgnomeui. Fixes bug #555919.
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/src/gyrus-main-app.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Sun Oct 12 12:14:41 2008
@@ -23,15 +23,13 @@
GTK_REQUIRED=2.6.0
LIBGLADE_REQUIRED=2.0.0
-LIBGNOMEUI_REQUIRED=2.6.0
GNET_REQUIRED=2.0.0
GCONF_REQUIRED=2.0.0
GTK_PRINT_REQUIRED=2.10.0
PKG_CHECK_MODULES(GYRUS,
gtk+-2.0 >= $GTK_REQUIRED
- libglade-2.0 >= $LIBGLADE_REQUIRED
- libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
+ libglade-2.0 >= $LIBGLADE_REQUIRED
gnet-2.0 >= $GNET_REQUIRED
gconf-2.0 >= $GCONF_REQUIRED
gtk+-unix-print-2.0 >= $GTK_PRINT_REQUIRED)
Modified: trunk/src/gyrus-main-app.c
==============================================================================
--- trunk/src/gyrus-main-app.c (original)
+++ trunk/src/gyrus-main-app.c Sun Oct 12 12:14:41 2008
@@ -27,7 +27,7 @@
#include <gtk/gtk.h>
#include <glade/glade.h>
-#include <libgnomeui/libgnomeui.h>
+#include <stdlib.h>
#include "glib/gi18n.h"
#include "gyrus-dialog-mailbox-new.h"
@@ -46,15 +46,30 @@
/*** Gyrus Main Application Private Data ***/
struct _GyrusMainAppPrivate {
GtkWidget *notebook;
+ GtkWidget *statusbar;
+ GtkWidget *progress_bar;
GtkUIManager *ui_manager;
GtkActionGroup *actions_window;
GtkActionGroup *actions_server;
GtkActionGroup *actions_mailbox;
GtkActionGroup *actions_acl_item;
+ guint tip_message_cid;
};
static void gyrus_main_app_about (void);
+static void
+connect_proxy_cb (GtkUIManager *manager,
+ GtkAction *action,
+ GtkWidget *proxy,
+ GyrusMainApp *app);
+
+static void
+disconnect_proxy_cb (GtkUIManager *manager,
+ GtkAction *action,
+ GtkWidget *proxy,
+ GyrusMainApp *app);
+
/*** Class Callbacks ***/
static void
@@ -422,7 +437,6 @@
{
GtkWidget *main_vbox;
- GtkWidget *appbar;
GtkWidget *menubar;
GtkWidget *toolbar;
GtkAccelGroup *accel_group;
@@ -479,7 +493,12 @@
g_error_free (error);
exit (EXIT_FAILURE);
}
-
+
+ g_signal_connect (app->priv->ui_manager, "connect_proxy",
+ G_CALLBACK (connect_proxy_cb), app);
+ g_signal_connect (app->priv->ui_manager, "disconnect_proxy",
+ G_CALLBACK (disconnect_proxy_cb), app);
+
menubar = gtk_ui_manager_get_widget (app->priv->ui_manager, "/MainMenu");
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, FALSE, 0);
@@ -493,13 +512,24 @@
gtk_box_pack_start (GTK_BOX (main_vbox), app->priv->notebook,
TRUE, TRUE, 0);
- appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_USER);
- gtk_box_pack_start (GTK_BOX (main_vbox), appbar,
+ app->priv->statusbar = gtk_statusbar_new ();
+
+ app->priv->progress_bar = gtk_progress_bar_new ();
+
+ app->priv->tip_message_cid =
+ gtk_statusbar_get_context_id (GTK_STATUSBAR (app->priv->statusbar),
+ "tip_message");
+
+ gtk_box_pack_end (GTK_BOX (app->priv->statusbar), app->priv->progress_bar,
+ FALSE, FALSE, 0);
+
+ gtk_box_pack_start (GTK_BOX (main_vbox), app->priv->statusbar,
FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (app),
main_vbox);
+
gtk_widget_show_all (main_vbox);
}
@@ -725,3 +755,57 @@
return 0;
}
+
+static void
+menu_item_select_cb (GtkMenuItem *proxy, GyrusMainApp *app)
+{
+ GtkAction *action;
+ char *message;
+
+ action = g_object_get_data (G_OBJECT (proxy), "gtk-action");
+
+ g_return_if_fail (action != NULL);
+
+ g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
+
+ if (message) {
+ gtk_statusbar_push (GTK_STATUSBAR (app->priv->statusbar),
+ app->priv->tip_message_cid, message);
+ g_free (message);
+ }
+}
+
+static void
+menu_item_deselect_cb (GtkMenuItem *proxy, GyrusMainApp *app)
+{
+ gtk_statusbar_pop (GTK_STATUSBAR (app->priv->statusbar),
+ app->priv->tip_message_cid);
+}
+
+static void
+connect_proxy_cb (GtkUIManager *manager,
+ GtkAction *action,
+ GtkWidget *proxy,
+ GyrusMainApp *app)
+{
+ if (GTK_IS_MENU_ITEM (proxy)) {
+ g_signal_connect (proxy, "select",
+ G_CALLBACK (menu_item_select_cb), app);
+ g_signal_connect (proxy, "deselect",
+ G_CALLBACK (menu_item_deselect_cb), app);
+ }
+}
+
+static void
+disconnect_proxy_cb (GtkUIManager *manager,
+ GtkAction *action,
+ GtkWidget *proxy,
+ GyrusMainApp *app)
+{
+ if (GTK_IS_MENU_ITEM (proxy)) {
+ g_signal_handlers_disconnect_by_func
+ (proxy, G_CALLBACK (menu_item_select_cb), app);
+ g_signal_handlers_disconnect_by_func
+ (proxy, G_CALLBACK (menu_item_deselect_cb), app);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]