diff options
-rwxr-xr-x | autogen.sh | 2 | ||||
-rw-r--r-- | configure.ac | 53 | ||||
-rw-r--r-- | data/GNOME_IndicatorApplet.server.in.in | 4 | ||||
-rw-r--r-- | libindicate/server.c | 2 | ||||
-rw-r--r-- | src/applet-main.c | 70 |
5 files changed, 102 insertions, 29 deletions
@@ -9,4 +9,4 @@ which gnome-autogen.sh || { USE_GNOME2_MACROS=1 \ USE_COMMON_DOC_BUILD=yes \ -. gnome-autogen.sh +gnome-autogen.sh --enable-gtk-doc diff --git a/configure.ac b/configure.ac index cb11502..90d75c7 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/applet-main.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-applet, 0.1.3) +AM_INIT_AUTOMAKE(indicator-applet, 0.1.4) AM_MAINTAINER_MODE @@ -39,7 +39,8 @@ PANEL_REQUIRED_VERSION=2.0.0 DBUS_REQUIRED_VERSION=0.76 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION - libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION) + libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION + libgnomeui-2.0) AC_SUBST(APPLET_CFLAGS) AC_SUBST(APPLET_LIBS) @@ -90,6 +91,24 @@ AM_CONDITIONAL(USE_GIR, test "x$gir_ok" = "xyes") ########################### GTK_DOC_CHECK([1.4]) +GNOME_DOC_INIT +GNOME_COMPILE_WARNINGS + +############################## +# Custom Junk +############################## + +AC_DEFUN([AC_DEFINE_PATH], [ + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_path=`eval echo [$]$2` + ac_define_path=`eval echo [$]ac_define_path` + $1="$ac_define_path" + AC_SUBST($1) + ifelse($3, , + AC_DEFINE_UNQUOTED($1, "$ac_define_path"), + AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3)) +]) ########################### # Internationalization @@ -98,9 +117,39 @@ GTK_DOC_CHECK([1.4]) GETTEXT_PACKAGE=indicator-applet AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default gettext domain]) +AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory]) AM_GLIB_GNU_GETTEXT +############################## +# ./configure Flags messings +############################## + +cflags_set=${CFLAGS+set} +# find the actual value for $prefix that we'll end up with +REAL_PREFIX= +if test "x$prefix" = "xNONE"; then + REAL_PREFIX=$ac_default_prefix +else + REAL_PREFIX=$prefix +fi + +# Have to go $sysconfdir->$prefix/etc->/usr/local/etc +# if you actually know how to code shell then fix this :-) +SYSCONFDIR_TMP="$sysconfdir" +old_prefix=$prefix +prefix=$REAL_PREFIX +EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP` +prefix=$old_prefix +AC_SUBST(EXPANDED_SYSCONFDIR) + +dnl Save flags to aclocal +ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + +AC_DEFINE_PATH(PREFIX, "${prefix}", [prefix directory]) +AC_DEFINE_PATH(SYSCONFDIR, "${sysconfdir}", [system configuration dir]) +AC_DEFINE_PATH(LIBDIR, "${libdir}", [system configuration dir]) + ########################### # Files ########################### diff --git a/data/GNOME_IndicatorApplet.server.in.in b/data/GNOME_IndicatorApplet.server.in.in index 96a553c..c576246 100644 --- a/data/GNOME_IndicatorApplet.server.in.in +++ b/data/GNOME_IndicatorApplet.server.in.in @@ -6,8 +6,8 @@ <item value="IDL:Bonobo/GenericFactory:1.0"/> <item value="IDL:Bonobo/Unknown:1.0"/> </oaf_attribute> - <oaf_attribute name="name" type="string" _value="Indicator Applet Factory"/> - <oaf_attribute name="description" type="string" _value="Indicator Applet Factory"/> + <oaf_attribute name="name" type="string" value="Indicator Applet Factory"/> + <oaf_attribute name="description" type="string" value="Indicator Applet Factory"/> <oaf_attribute name="bonobo:environment" type="stringv"> <item value="DBUS_SESSION_BUS_ADDRESS"/> </oaf_attribute> diff --git a/libindicate/server.c b/libindicate/server.c index 8a35906..39753d2 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -318,7 +318,7 @@ indicate_server_hide (IndicateServer * server) g_return_if_fail(INDICATE_IS_SERVER(server)); IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - if (priv->visible) + if (!priv->visible) return; priv->visible = FALSE; diff --git a/src/applet-main.c b/src/applet-main.c index cd07548..f6d5199 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 <http://www.gnu.org/licenses/>. */ +#include <config.h> #include <panel-applet.h> +#include <libgnomeui/gnome-ui-init.h> #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 * ***********/ @@ -117,21 +126,20 @@ 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 <http://www.gnu.org/licenses/>."), NULL }; 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", @@ -173,16 +181,32 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) gint i; gint indicators_loaded = 0; - /* check if we are running stracciatella session */ - if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) { - g_debug("Running stracciatella GNOME session, disabling myself"); - return TRUE; - } + /* check if we are running stracciatella session */ + if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) { + g_debug("Running stracciatella GNOME session, disabling myself"); + return TRUE; + } + 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); 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(), @@ -207,10 +231,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); @@ -223,10 +243,14 @@ 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); + /* 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); + } else { + gtk_container_add(GTK_CONTAINER(applet), menubar); + panel_applet_set_background_widget(applet, menubar); + gtk_widget_show(menubar); } /* Background of applet */ |