summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRebecca Schulman <rebecka@eazel.com>2001-02-14 03:41:16 +0000
committerRebecca Schulman <rebecka@src.gnome.org>2001-02-14 03:41:16 +0000
commit6f1dc5d64dd75308e61c4fa979e4f8a4810bf14f (patch)
treed8186564f7378a95c8a89cda34b784d3965aa688 /src
parentbd2f0788ee160017331fb3d71f4e35957d3b8f7d (diff)
downloadnautilus-6f1dc5d64dd75308e61c4fa979e4f8a4810bf14f.tar.gz
Fix bugzilla.eazel.com bug 6416, that the indexing information dialog
2001-02-13 Rebecca Schulman <rebecka@eazel.com> Fix bugzilla.eazel.com bug 6416, that the indexing information dialog should not be shown if indexing is disabled or blocked. reviewed by: Seth Nickell <seth@eazel.com> * src/file-manager/nautilus-indexing-info.c: (dialog_close_cover), (show_index_progress_dialog), (show_reindex_request_dialog), (show_indexing_info_dialog): Add new dialogs for the case when indexing is off, and close each dialog in the case where the status of indexing changes.
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/nautilus-indexing-info.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/file-manager/nautilus-indexing-info.c b/src/file-manager/nautilus-indexing-info.c
index b6162184c..f6bab68b6 100644
--- a/src/file-manager/nautilus-indexing-info.c
+++ b/src/file-manager/nautilus-indexing-info.c
@@ -37,6 +37,7 @@
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-label.h>
+#include <libnautilus-extensions/nautilus-preferences.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
#ifdef HAVE_MEDUSA
@@ -44,6 +45,7 @@
#include <libmedusa/medusa-index-service.h>
#include <libmedusa/medusa-index-progress.h>
#include <libmedusa/medusa-indexed-search.h>
+#include <libmedusa/medusa-system-state.h>
#define PROGRESS_UPDATE_INTERVAL 5000
@@ -104,10 +106,24 @@ update_progress_display (gpointer callback_data)
}
static void
+dialog_close_cover (gpointer dialog_data)
+{
+ g_assert (GNOME_IS_DIALOG (dialog_data));
+
+ gnome_dialog_close (dialog_data);
+}
+
+
+static void
show_index_progress_dialog (void)
{
+ int callback_id;
+
gnome_dialog_close (dialogs->last_index_time_dialog);
gtk_widget_show_all (GTK_WIDGET (dialogs->index_in_progress_dialog));
+ callback_id = medusa_execute_once_when_system_state_changes (MEDUSA_SYSTEM_STATE_DISABLED | MEDUSA_SYSTEM_STATE_BLOCKED,
+ dialog_close_cover,
+ dialogs->index_in_progress_dialog);
}
@@ -115,8 +131,13 @@ show_index_progress_dialog (void)
static void
show_reindex_request_dialog (void)
{
+ int callback_id;
+
gnome_dialog_close (dialogs->index_in_progress_dialog);
gtk_widget_show_all (GTK_WIDGET (dialogs->last_index_time_dialog));
+ callback_id = medusa_execute_once_when_system_state_changes (MEDUSA_SYSTEM_STATE_DISABLED | MEDUSA_SYSTEM_STATE_BLOCKED,
+ dialog_close_cover,
+ dialogs->last_index_time_dialog);
}
static void
@@ -300,12 +321,40 @@ destroy_indexing_info_dialogs_on_exit (void)
g_free (dialogs);
}
+
static void
show_indexing_info_dialog (void)
{
+ GnomeDialog *dialog_shown;
+ int callback_id;
- if (dialogs == NULL) {
+ if (medusa_system_services_are_blocked ()) {
+ dialog_shown = nautilus_show_info_dialog (_("An index of your files is not available because "
+ "creating a nightly index of files has been disabled "
+ "by your system administrator."),
+ _("No index of your system is available"),
+ NULL);
+ callback_id = medusa_execute_once_when_system_state_changes (MEDUSA_SYSTEM_STATE_ENABLED | MEDUSA_SYSTEM_STATE_DISABLED,
+ dialog_close_cover,
+ dialog_shown);
+ return;
+
+ }
+
+ if (!medusa_system_services_are_enabled ()) {
+ dialog_shown = nautilus_show_info_dialog (_("An index of your files is not available, because you "
+ "have elected to turn the indexing feature off. You can "
+ "set your computer up to index your files nightly by changing "
+ "your search preferences."),
+ _("No index of your system is available"),
+ NULL);
+ callback_id = medusa_execute_once_when_system_state_changes (MEDUSA_SYSTEM_STATE_ENABLED | MEDUSA_SYSTEM_STATE_BLOCKED,
+ dialog_close_cover,
+ dialog_shown);
+ return;
+ }
+ if (dialogs == NULL) {
dialogs = g_new0 (IndexingInfoDialogs, 1);
g_atexit (destroy_indexing_info_dialogs_on_exit);