After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 164847 - [PATCH] status options in panel tray icon
[PATCH] status options in panel tray icon
Status: RESOLVED WONTFIX
Product: gnome-jabber
Classification: Deprecated
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Martyn Russell
Martyn Russell
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2005-01-21 19:00 UTC by Reed Hedges
Modified: 2011-04-21 08:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch adds status items to system tray menu (4.07 KB, patch)
2005-03-13 21:30 UTC, Reed Hedges
none Details | Review

Description Reed Hedges 2005-01-21 19:00:15 UTC
This makes the panel (tray) icon right-click menu be a presence menu (same as in
the roster), plus the existing items:


diff -Naur gnome-jabber-0.4/src/gj_gtk_roster.c
gnome-jabber-0.4.rh1/src/gj_gtk_roster.c
--- gnome-jabber-0.4/src/gj_gtk_roster.c        2005-01-21 16:31:46.000000000 +0000
+++ gnome-jabber-0.4.rh1/src/gj_gtk_roster.c    2005-01-21 16:30:21.000000000 +0000
@@ -361,6 +361,7 @@

 /* other */
 static gboolean gj_gtk_roster_unregister (GjRosterWindow *window);
+static void gj_add_custom_status_menu_items(GtkWidget* menu, GjRosterWindow*
window);

 /* events */
 static gboolean gj_gtk_roster_handle_next_event (GjRosterWindow *window,
GjRosterItem ri);
@@ -4304,14 +4305,22 @@
        GtkWidget *item = NULL;
        /*   GtkWidget *image = NULL; */

-       menu = gtk_menu_new ();
+       /* XXX rh menu = gtk_menu_new (); */
+  menu =
gj_gtk_presence_menu_new((GjMenuCallback)gj_gtk_roster_menu_presence_cb, window);
+
+       item = gtk_separator_menu_item_new ();
+       gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
+
+  gj_add_custom_status_menu_items(menu, window);
+
+
+       item = gtk_separator_menu_item_new ();
+       gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);

        item = gtk_menu_item_new_with_mnemonic (_("Show/Hide Window"));
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
        g_signal_connect ((gpointer) item, "activate", G_CALLBACK
(gj_gtk_roster_menu_show_window_cb), window);

-       item = gtk_separator_menu_item_new ();
-       gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);

        /*   item = gtk_image_menu_item_new_with_mnemonic ("New _Message"); */
        /*   image = gtk_image_new_from_stock (GJ_STOCK_MESSAGE_NORMAL,
GTK_ICON_SIZE_MENU); */
@@ -5548,6 +5557,35 @@
        }
 }

+static void gj_add_custom_status_menu_items(GtkWidget* menu, GjRosterWindow*
window)
+{
+
+  gint i;
+  gchar *show = NULL;
+  gchar *status = NULL;
+  gchar *priority = NULL;
+
+  for(i = 1; gj_config_get_pp_index(i, &show, &status, &priority); i++) {
+    GjPresenceShow show_int = 0;
+    gint priority_int = 0;
+    const gchar *stock_id = NULL;
+    GtkWidget *image = NULL;
+    GtkWidget *item = NULL;
+
+    priority_int = atoi (priority);
+    show_int = gj_translate_presence_show_str (show);
+    stock_id = gj_gtk_presence_to_stock_id (GjPresenceTypeAvailable, show_int);
+
+    item = gtk_image_menu_item_new_with_label (status);
+    image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
+    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+    gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
+    g_object_set_data (G_OBJECT (item), "id", GINT_TO_POINTER (i));
+    g_signal_connect ((gpointer) item, "activate",
+          G_CALLBACK (gj_gtk_roster_menu_presence_preset_cb), window);
+  }
+}
+

 static void on_eventbox_presence_image_button_press_event (GtkWidget *widget,
GdkEventButton *event, GjRosterWindow *window)
 {
@@ -5555,42 +5593,12 @@
                GtkWidget *menu = NULL;
                GtkWidget *item = NULL;

-               gint i = 0;

                menu = gj_gtk_presence_menu_new
((GjMenuCallback)gj_gtk_roster_menu_presence_cb, window);

                item = gtk_separator_menu_item_new ();
                gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
-
-               /* should be done better */
-               for (i = 1; i < 100; i++) {
-                       gchar *show = NULL;
-                       gchar *status = NULL;
-                       gchar *priority = NULL;
-
-                       GjPresenceShow show_int = 0;
-                       gint priority_int = 0;
-
-                       const gchar *stock_id = NULL;
-                       GtkWidget *image = NULL;
-
-                       if (!gj_config_get_pp_index (i, &show, &status,
&priority)) {
-                               break;
-                       }
-
-                       priority_int = atoi (priority);
-                       show_int = gj_translate_presence_show_str (show);
-                       stock_id = gj_gtk_presence_to_stock_id
(GjPresenceTypeAvailable, show_int);-
-                       item = gtk_image_menu_item_new_with_label (status);
-                       image = gtk_image_new_from_stock (stock_id,
GTK_ICON_SIZE_MENU);
-                       gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM
(item), image);
-                       gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), item);
-                       g_object_set_data (G_OBJECT (item), "id",
GINT_TO_POINTER (i));
-                       g_signal_connect ((gpointer) item, "activate",
-                                         G_CALLBACK
(gj_gtk_roster_menu_presence_preset_cb), window);
-               }
-
+    gj_add_custom_status_menu_items(menu, window);
                gtk_widget_show_all (menu);

                gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
Comment 1 Thierry Moisan 2005-03-13 03:22:16 UTC
Thanks for the patch! But could you send it as an attachment and not as text?
Comment 2 Reed Hedges 2005-03-13 21:30:55 UTC
Created attachment 38653 [details] [review]
Patch adds status items to system tray menu
Comment 3 Akhil Laddha 2011-04-21 08:58:10 UTC
gnome-jabber development has been stalled and it has been unmaintained for a few years now. Maintainers don't have future development plan so i am closing the bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.