From acc7f891bdccbd58d92b957a20a0cb10f6a7513e Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Thu, 26 Mar 2009 13:51:06 +0200 Subject: Add gnome_program_init with LIBGNOMEUI_MODULE. --- src/applet-main.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index 62faab0..51e3c93 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -20,7 +20,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include +#include #define SYMBOL_NAME "get_menu_item" #define ICONS_DIR (DATADIR G_DIR_SEPARATOR_S "indicator-applet" G_DIR_SEPARATOR_S "icons") @@ -34,6 +36,13 @@ static void cw_panel_background_changed (PanelApplet *applet, GdkPixmap *pixmap, GtkWidget *menubar); +/* ****************** * + * Global Variables * + * ****************** */ + +static GnomeProgram *program = NULL; + + /************* * main * ***********/ @@ -172,7 +181,20 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) GtkWidget *menubar; gint i; gint indicators_loaded = 0; - + static gboolean first_time = FALSE; + + if (!first_time) + { + gint argc = 1; + gchar *argv[2] = { "indicator-applet", NULL}; + + first_time = TRUE; + program = gnome_program_init ("indicator-applet", "0.1", + LIBGNOMEUI_MODULE, argc, argv, + GNOME_PROGRAM_STANDARD_PROPERTIES, + NULL); + } + /* Set panel options */ gtk_container_set_border_width(GTK_CONTAINER (applet), 0); panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR); -- cgit v1.2.3 From f6bd9e6f57bb14d2bfbee3a184e54beb79269f77 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Mar 2009 13:24:38 -0500 Subject: ATK name for Eitan --- src/applet-main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index 51e3c93..8de2358 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -199,6 +199,8 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) gtk_container_set_border_width(GTK_CONTAINER (applet), 0); panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR); panel_applet_setup_menu(applet, menu_xml, menu_verbs, NULL); + atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)), + "indicator-applet"); /* Init some theme/icon stuff */ gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), -- cgit v1.2.3 From 1f7ae08ced7b7be7d852139e73dde71de68da2f7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Mar 2009 16:01:46 -0500 Subject: Changing license in about box to make sense. --- src/applet-main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index 8de2358..0dbb665 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -126,16 +126,15 @@ about_cb (BonoboUIComponent *ui_container, }; static gchar *license[] = { - N_("The Indicator Applet is free software; you can redistribute it and/or modify " - "it under the terms of the GNU General Public License as published by " - "the Free Software Foundation; either version 3 of the License."), - N_("This program is distributed in the hope that it will be useful, " - "but WITHOUT ANY WARRANTY; without even the implied warranties of " - "MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR " - "PURPOSE. See the GNU General Public License for more details."), - N_("You should have received a copy of the GNU General Public License " - "along with this program; if not, write to the Free Software " - "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA "), + N_("This program is free software: you can redistribute it and/or modify it " + "under the terms of the GNU General Public License version 3, as published " + "by the Free Software Foundation."), + N_("This program is distributed in the hope that it will be useful, but " + "WITHOUT ANY WARRANTY; without even the implied warranties of " + "MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR " + "PURPOSE. See the GNU General Public License for more details."), + N_("You should have received a copy of the GNU General Public License along " + "with this program. If not, see ."), NULL }; gchar *license_i18n; -- cgit v1.2.3 From 045b2579c670b16bac9e7c13ede6bd2780edf83e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Mar 2009 16:06:23 -0500 Subject: Switching the case for 'No Indicators' to make it a label to still support right click through. --- src/applet-main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index 0dbb665..7f7b260 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -224,10 +224,6 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) g_signal_connect_after(menubar, "expose-event", G_CALLBACK(menubar_on_expose), menubar); gtk_container_set_border_width(GTK_CONTAINER(menubar), 0); - gtk_container_add(GTK_CONTAINER(applet), menubar); - panel_applet_set_background_widget(applet, menubar); - gtk_widget_show(menubar); - /* load 'em */ if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL); @@ -240,10 +236,13 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) } if (indicators_loaded == 0) { - GtkWidget * item = gtk_menu_item_new_with_label("No Indicators"); - gtk_widget_set_sensitive(item, FALSE); - gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item); + GtkWidget * item = gtk_label_new("No Indicators"); + gtk_container_add(GTK_CONTAINER(applet), item); gtk_widget_show(item); + } else { + gtk_container_add(GTK_CONTAINER(applet), menubar); + panel_applet_set_background_widget(applet, menubar); + gtk_widget_show(menubar); } /* Background of applet */ -- cgit v1.2.3 From d917e8b68804e839d8cac4c8af9b4600e3e67308 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Mar 2009 16:10:58 -0500 Subject: Comment for label --- src/applet-main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index 7f7b260..ee738b4 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -236,6 +236,7 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) } if (indicators_loaded == 0) { + /* A label to allow for click through */ GtkWidget * item = gtk_label_new("No Indicators"); gtk_container_add(GTK_CONTAINER(applet), item); gtk_widget_show(item); -- cgit v1.2.3 From 02501d7edadbf3d3d3b9f2ab9a560bfe0b197af3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 27 Mar 2009 23:17:22 -0500 Subject: Patch from Gabor Kelemen to make the license and 'No Indicators' message translatable. --- src/applet-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/applet-main.c') diff --git a/src/applet-main.c b/src/applet-main.c index ee738b4..fdd7a23 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -139,7 +139,7 @@ about_cb (BonoboUIComponent *ui_container, }; gchar *license_i18n; - license_i18n = g_strjoinv ("\n\n", license); + license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL); gtk_show_about_dialog(NULL, "version", "0.1", @@ -237,7 +237,7 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) if (indicators_loaded == 0) { /* A label to allow for click through */ - GtkWidget * item = gtk_label_new("No Indicators"); + GtkWidget * item = gtk_label_new(_("No Indicators")); gtk_container_add(GTK_CONTAINER(applet), item); gtk_widget_show(item); } else { -- cgit v1.2.3