summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <alan@eth0.org.uk>2012-06-26 19:32:40 +0100
committerGravatar Alan Fitton <alan@eth0.org.uk>2012-06-26 19:32:40 +0100
commit8e3cfb730b316a4be84c1d25072fd0d04796dd60 (patch)
tree93b09250db2f0d17dc80b9e1faf9bc95c853a8b2
parent1ca63e2ab9bdfc1252c1fdd5a864c8db8852d162 (diff)
hide config options for status icon when on unity with no libappindicator support
-rw-r--r--src/trg-main-window.c2
-rw-r--r--src/trg-preferences-dialog.c26
2 files changed, 18 insertions, 10 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index bdfc3ee..661c3e9 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -2454,7 +2454,7 @@ void trg_main_window_add_status_icon(TrgMainWindow * win)
trg_status_icon_view_menu(win, NULL));
} else {
#else
- if (1) {
+ if (!is_unity()) {
#endif
priv->statusIcon = gtk_status_icon_new_from_icon_name(PACKAGE_NAME);
gtk_status_icon_set_screen(priv->statusIcon,
diff --git a/src/trg-preferences-dialog.c b/src/trg-preferences-dialog.c
index 57391f1..935b917 100644
--- a/src/trg-preferences-dialog.c
+++ b/src/trg-preferences-dialog.c
@@ -665,6 +665,7 @@ static GtkWidget *trg_prefs_viewPage(TrgPreferencesDialog * dlg)
GtkWidget *w, *dep, *t, *tray;
gint row = 0;
+ gboolean _is_unity = is_unity();
t = hig_workarea_create();
@@ -708,6 +709,9 @@ static GtkWidget *trg_prefs_viewPage(TrgPreferencesDialog * dlg)
hig_workarea_add_section_title(t, &row, _("System Tray"));
+#ifndef HAVE_LIBAPPINDICATOR
+ if (!_is_unity) {
+#endif
tray = trgp_check_new(dlg, _("Show in system tray"),
TRG_PREFS_KEY_SYSTEM_TRAY, TRG_PREFS_GLOBAL,
NULL);
@@ -715,16 +719,20 @@ static GtkWidget *trg_prefs_viewPage(TrgPreferencesDialog * dlg)
G_CALLBACK(toggle_tray_icon), priv->win);
hig_workarea_add_wide_control(t, &row, tray);
+ if (!_is_unity) {
+ w = trgp_check_new(dlg, _("Minimise to system tray"),
+ TRG_PREFS_KEY_SYSTEM_TRAY_MINIMISE,
+ TRG_PREFS_GLOBAL, NULL);
+ gtk_widget_set_sensitive(w,
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
+ (tray)));
+ g_signal_connect(G_OBJECT(tray), "toggled",
+ G_CALLBACK(toggle_active_arg_is_sensitive), w);
+ hig_workarea_add_wide_control(t, &row, w);
+ }
+
#ifndef HAVE_LIBAPPINDICATOR
- w = trgp_check_new(dlg, _("Minimise to system tray"),
- TRG_PREFS_KEY_SYSTEM_TRAY_MINIMISE,
- TRG_PREFS_GLOBAL, NULL);
- gtk_widget_set_sensitive(w,
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
- (tray)));
- g_signal_connect(G_OBJECT(tray), "toggled",
- G_CALLBACK(toggle_active_arg_is_sensitive), w);
- hig_workarea_add_wide_control(t, &row, w);
+ }
#endif
#ifdef HAVE_LIBNOTIFY