diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2010-05-17 17:27:40 +0200 |
---|---|---|
committer | Martyn Russell <martyn@lanedo.com> | 2010-05-20 16:03:24 +0100 |
commit | dfc789ab7ba80108c13463748dd3a23656af1448 (patch) | |
tree | 06896658812f9603a04d5d4e9a2e606471f1e310 | |
parent | 53318deea62709c9f44a316f13220b2986b15070 (diff) | |
download | tracker-dfc789ab7ba80108c13463748dd3a23656af1448.tar.gz |
Fixes GB#618707: tracker preferences shows notification area options even when status icon isn't built
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | src/tracker-preferences/Makefile.am | 1 | ||||
-rw-r--r-- | src/tracker-preferences/config.vapi | 1 | ||||
-rw-r--r-- | src/tracker-preferences/tracker-preferences.vala | 11 | ||||
-rw-r--r-- | src/tracker-status-icon/tracker-status-icon.c | 8 |
5 files changed, 32 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 824ae78be..09a2bc913 100644 --- a/configure.ac +++ b/configure.ac @@ -977,6 +977,9 @@ if test "x$enable_tracker_status_icon" = "xyes"; then if test "x$have_tracker_status_icon" != "xyes"; then AC_MSG_ERROR([Couldn't find tracker-status-icon dependencies ($APP_REQUIREMENTS).]) fi + AC_DEFINE(HAVE_TRACKER_STATUS_ICON, [1], [Define to 1 if status icon is compiled]) +else + AC_DEFINE(HAVE_TRACKER_STATUS_ICON, [0], [Define to 0 if status icon is not compiled]) fi AM_CONDITIONAL(HAVE_TRACKER_STATUS_ICON, test "$have_tracker_status_icon" = "yes") @@ -1005,6 +1008,9 @@ if test "x$enable_tracker_explorer" = "xyes"; then if test "x$have_tracker_explorer" != "xyes"; then AC_MSG_ERROR([Couldn't find tracker-explorer dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).]) fi + AC_DEFINE(HAVE_TRACKER_EXPLORER, [1], [Define to 1 if tracker explorer is compiled]) +else + AC_DEFINE(HAVE_TRACKER_EXPLORER, [0], [Define to 0 if tracker explorer is not compiled]) fi AM_CONDITIONAL(HAVE_TRACKER_EXPLORER, test "$have_tracker_explorer" = "yes") @@ -1033,6 +1039,9 @@ if test "x$enable_tracker_search_bar" = "xyes"; then if test "x$have_tracker_search_bar" != "xyes"; then AC_MSG_ERROR([Couldn't find tracker-search-bar dependencies ($APP_REQUIREMENTS $APPLET_REQUIREMENTS).]) fi + AC_DEFINE(HAVE_TRACKER_SEARCH_BAR, [1], [Define to 1 if t-s-b is compiled]) +else + AC_DEFINE(HAVE_TRACKER_SEARCH_BAR, [0], [Define to 0 if t-s-b is not compiled]) fi AM_CONDITIONAL(HAVE_TRACKER_SEARCH_BAR, test "$have_tracker_search_bar" = "yes") @@ -1052,7 +1061,6 @@ if test "x$enable_tracker_search_tool" != "xno"; then have_tracker_search_tool="no" else have_tracker_search_tool="yes" - AC_DEFINE(HAVE_TRACKER_SEARCH_TOOL, [], [Define if t-s-t is compiled]) fi else have_tracker_search_tool="no (disabled)" @@ -1062,6 +1070,9 @@ if test "x$enable_tracker_search_tool" = "xyes"; then if test "x$have_tracker_search_tool" != "xyes"; then AC_MSG_ERROR([Couldn't find tracker-search-tool dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).]) fi + AC_DEFINE(HAVE_TRACKER_SEARCH_TOOL, [1], [Define to 1 if t-s-t is compiled]) +else + AC_DEFINE(HAVE_TRACKER_SEARCH_TOOL, [0], [Define to 0 if t-s-t is not compiled]) fi AM_CONDITIONAL(HAVE_TRACKER_SEARCH_TOOL, test "$have_tracker_search_tool" = "yes") @@ -1080,7 +1091,6 @@ if test "x$enable_tracker_preferences" != "xno" ; then have_tracker_preferences="no" else have_tracker_preferences="yes" - AC_DEFINE(HAVE_TRACKER_PREFERENCES, [], [Define if tracker-preferences is compiled]) fi else have_tracker_preferences="no (disabled)" @@ -1090,6 +1100,9 @@ if test "x$enable_tracker_preferences" = "xyes"; then if test "x$have_tracker_preferences" != "xyes"; then AC_MSG_ERROR([Couldn't find tracker-preferences dependencies ($APP_REQUIREMENTS).]) fi + AC_DEFINE(HAVE_TRACKER_PREFERENCES, [1], [Define to 1 if tracker preferences is compiled]) +else + AC_DEFINE(HAVE_TRACKER_PREFERENCES, [0], [Define to 0 if tracker preferences is not compiled]) fi AM_CONDITIONAL(HAVE_TRACKER_PREFERENCES, test "$have_tracker_preferences" = "yes") diff --git a/src/tracker-preferences/Makefile.am b/src/tracker-preferences/Makefile.am index 71d74685c..585b4a802 100644 --- a/src/tracker-preferences/Makefile.am +++ b/src/tracker-preferences/Makefile.am @@ -17,6 +17,7 @@ INCLUDES = \ -DTRACKER_COMPILATION \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ -I$(top_srcdir)/src \ + -I$(top_builddir) \ $(TRACKER_APPS_CFLAGS) \ $(WARN_CFLAGS) \ $(GCOV_CFLAGS) diff --git a/src/tracker-preferences/config.vapi b/src/tracker-preferences/config.vapi index f46e08488..e0ebb0d34 100644 --- a/src/tracker-preferences/config.vapi +++ b/src/tracker-preferences/config.vapi @@ -1,2 +1,3 @@ [CCode (cheader_filename = "config.h")] public const string TRACKER_DATADIR; +public const bool HAVE_TRACKER_STATUS_ICON; diff --git a/src/tracker-preferences/tracker-preferences.vala b/src/tracker-preferences/tracker-preferences.vala index bbc9ba2ad..3921f2776 100644 --- a/src/tracker-preferences/tracker-preferences.vala +++ b/src/tracker-preferences/tracker-preferences.vala @@ -50,6 +50,7 @@ public static TreeView treeview_ignored_directories; public static TreeView treeview_ignored_directories_with_content; public static TreeView treeview_ignored_files; public static ToggleButton togglebutton_home; +public static Notebook notebook; public static RadioButton radiobutton_display_never; public static RadioButton radiobutton_display_active; public static RadioButton radiobutton_display_always; @@ -368,11 +369,21 @@ static int main (string[] args) { hscale_throttle.set_value ((double) config.throttle); togglebutton_home = builder.get_object ("togglebutton_home") as ToggleButton; + notebook = builder.get_object ("notebook") as Notebook; + radiobutton_display_never = builder.get_object ("radiobutton_display_never") as RadioButton; radiobutton_display_active = builder.get_object ("radiobutton_display_active") as RadioButton; radiobutton_display_always = builder.get_object ("radiobutton_display_always") as RadioButton; initialize_visibility_radiobutton (); + /* Note: if the General tab ever has more config parameters than those + * of the status icon, then don't remove the page, just the status-icon + * related parameters */ + if (!HAVE_TRACKER_STATUS_ICON) { + /* Page #0 is the Contents page */ + notebook.remove_page (0); + } + treeview_index_recursively = builder.get_object ("treeview_index_recursively") as TreeView; treeview_index_single = builder.get_object ("treeview_index_single") as TreeView; treeview_ignored_directories = builder.get_object ("treeview_ignored_directories") as TreeView; diff --git a/src/tracker-status-icon/tracker-status-icon.c b/src/tracker-status-icon/tracker-status-icon.c index 0191aa7e5..69694af18 100644 --- a/src/tracker-status-icon/tracker-status-icon.c +++ b/src/tracker-status-icon/tracker-status-icon.c @@ -709,7 +709,7 @@ context_menu_pause_cb (GtkMenuItem *item, update_icon_status (icon); } -#ifdef HAVE_TRACKER_SEARCH_TOOL +#if HAVE_TRACKER_SEARCH_TOOL static void context_menu_search_cb (GtkMenuItem *item, gpointer user_data) @@ -719,7 +719,7 @@ context_menu_search_cb (GtkMenuItem *item, } #endif -#ifdef HAVE_TRACKER_PREFERENCES +#if HAVE_TRACKER_PREFERENCES static void context_menu_preferences_cb (GtkMenuItem *item, gpointer user_data) @@ -839,7 +839,7 @@ status_icon_create_context_menu (TrackerStatusIcon *icon) item = gtk_separator_menu_item_new (); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); -#ifdef HAVE_TRACKER_SEARCH_TOOL +#if HAVE_TRACKER_SEARCH_TOOL item = gtk_image_menu_item_new_with_mnemonic (_("_Search")); image = gtk_image_new_from_icon_name (GTK_STOCK_FIND, GTK_ICON_SIZE_MENU); @@ -849,7 +849,7 @@ status_icon_create_context_menu (TrackerStatusIcon *icon) G_CALLBACK (context_menu_search_cb), icon); #endif -#ifdef HAVE_TRACKER_PREFERENCES +#if HAVE_TRACKER_PREFERENCES item = gtk_image_menu_item_new_with_mnemonic (_("_Preferences")); image = gtk_image_new_from_icon_name (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU); |