Commit f828c6c3 authored by John Harper's avatar John Harper Committed by John Harper
Browse files

Make the search feature work again:

2002-01-31  John Harper  <jsh@unfactored.org>

	Make the search feature work again:

	* configure.in: fixed how HAVE_MEDUSA is defined. Add
	MEDUSA_CFLAGS to CORE_CFLAGS

	* src/file-manager/fm-search-list-view.c: moved some of the
	GNOME2_CONVERSION_COMPLETE ifdefs around so that we get a
	functional object, just without some of the features of the
	original

	* src/nautilus-shell-ui.xml: copied search parts from nautilus
	1 version

	* src/nautilus-application.c (create_object): reenable
	search-list-view creation

	* src/file-manager/nautilus-indexing-info.c: random changes to
	make it compile (untested as yet)
parent 432cb5cd
2002-01-31 John Harper <jsh@unfactored.org>
Make the search feature work again:
* configure.in: fixed how HAVE_MEDUSA is defined. Add
MEDUSA_CFLAGS to CORE_CFLAGS
* src/file-manager/fm-search-list-view.c: moved some of the
GNOME2_CONVERSION_COMPLETE ifdefs around so that we get a
functional object, just without some of the features of the
original
* src/nautilus-shell-ui.xml: copied search parts from nautilus
1 version
* src/nautilus-application.c (create_object): reenable
search-list-view creation
* src/file-manager/nautilus-indexing-info.c: random changes to
make it compile (untested as yet)
2002-01-30 Darin Adler <darin@bentspoon.com>
* configure.in: Bump eel version required.
......
......@@ -153,13 +153,15 @@ AC_SUBST(HAVE_JW)
dnl ==========================================================================
dnl medusa checking (this is the Gnome 1 version -- change to pkg-config)
dnl medusa checking
AC_MSG_CHECKING(for Medusa)
PKG_CHECK_MODULES(MEDUSA, medusa-2.0 >= $MEDUSA_REQUIRED, have_medusa=yes, have_medusa=no)
AM_CONDITIONAL(HAVE_MEDUSA, test x$have_medusa = xyes)
AC_SUBST(HAVE_MEDUSA)
if test "x$have_medusa" = "xyes"; then
AC_DEFINE(HAVE_MEDUSA,1)
EXTRA_CORE_MODULES="$EXTRA_CORE_MODULES medusa-2.0"
fi
dnl ==========================================================================
......@@ -271,10 +273,10 @@ LIBNAUTILUS_IDL_INCLUDES="`$PKG_CONFIG --variable=idldir $LIBNAUTILUS_MODULES |
AC_SUBST(LIBNAUTILUS_IDL_INCLUDES)
dnl core nautilus (must list bonobo-activation and libbonobo because idldir does not respect "requires")
CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0 esound"
CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0 esound $EXTRA_CORE_MODULES"
CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES`"
AC_SUBST(CORE_CFLAGS)
CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $CDDA_LIBS $FAM_LIBS $LIBJPEG $MEDUSA_LIBS"
CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $CDDA_LIBS $FAM_LIBS $LIBJPEG"
AC_SUBST(CORE_LIBS)
CORE_IDL_INCLUDES="`$PKG_CONFIG --variable=idldir $CORE_MODULES | $srcdir/add-include-prefix`"
AC_SUBST(CORE_IDL_INCLUDES)
......
......@@ -50,8 +50,6 @@
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#if GNOME2_CONVERSION_COMPLETE
/* FIXME bugzilla.gnome.org 42815: This code uses part of the
* NautilusSearchBarCriterion class, which is really for complex
* search bar user interface. We only need to do some non-UI
......@@ -77,12 +75,13 @@ static void fm_search_list_view_class_init (gpointer klass);
static void real_destroy (GtkObject *object);
static void real_add_file (FMDirectoryView *view,
NautilusFile *file);
static gboolean real_file_still_belongs (FMDirectoryView *view,
NautilusFile *file);
#if GNOME2_CONVERSION_COMPLETE
static void real_adding_file (FMListView *view,
NautilusFile *file);
static void real_removing_file (FMListView *view,
NautilusFile *file);
static gboolean real_file_still_belongs (FMDirectoryView *view,
NautilusFile *file);
static int real_get_number_of_columns (FMListView *list_view);
static int real_get_emblems_column (FMListView *list_view);
static int real_get_link_column (FMListView *list_view);
......@@ -90,6 +89,7 @@ static char * real_get_default_sort_attribute (FMListView *view);
static void real_get_column_specification (FMListView *list_view,
int column_number,
FMListViewColumn *specification);
#endif
static EelStringList * real_get_emblem_names_to_exclude (FMDirectoryView *view);
static void real_file_limit_reached (FMDirectoryView *view);
static void real_merge_menus (FMDirectoryView *view);
......@@ -360,6 +360,7 @@ fm_search_list_view_class_init (gpointer klass)
fm_directory_view_class->update_menus = real_update_menus;
fm_directory_view_class->load_error = real_load_error;
#if GNOME2_CONVERSION_COMPLETE
fm_list_view_class->adding_file = real_adding_file;
fm_list_view_class->removing_file = real_removing_file;
fm_list_view_class->get_number_of_columns = real_get_number_of_columns;
......@@ -367,6 +368,7 @@ fm_search_list_view_class_init (gpointer klass)
fm_list_view_class->get_link_column = real_get_link_column;
fm_list_view_class->get_column_specification = real_get_column_specification;
fm_list_view_class->get_default_sort_attribute = real_get_default_sort_attribute;
#endif
}
static void
......@@ -377,8 +379,6 @@ fm_search_list_view_init (gpointer object,
NautilusView *nautilus_view;
FMDirectoryView *directory_view;
g_assert (GTK_BIN (object)->child == NULL);
search_view = FM_SEARCH_LIST_VIEW (object);
directory_view = FM_DIRECTORY_VIEW (object);
......@@ -408,6 +408,17 @@ real_destroy (GtkObject *object)
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static EelStringList *
real_get_emblem_names_to_exclude (FMDirectoryView *view)
{
g_assert (FM_IS_DIRECTORY_VIEW (view));
/* Overridden to show even the trash emblem here */
return NULL;
}
#if GNOME2_CONVERSION_COMPLETE
static int
real_get_number_of_columns (FMListView *view)
{
......@@ -456,15 +467,6 @@ real_get_default_sort_attribute (FMListView *view)
return sort_attribute;
}
static EelStringList *
real_get_emblem_names_to_exclude (FMDirectoryView *view)
{
g_assert (FM_IS_DIRECTORY_VIEW (view));
/* Overridden to show even the trash emblem here */
return NULL;
}
static int
real_get_link_column (FMListView *view)
{
......@@ -530,6 +532,8 @@ real_get_column_specification (FMListView *view,
}
}
#endif
static void
indexing_info_callback (BonoboUIComponent *component, gpointer data, const char *verb)
{
......@@ -611,6 +615,8 @@ real_add_file (FMDirectoryView *view, NautilusFile *file)
nautilus_file_unref (real_file);
}
#if GNOME2_CONVERSION_COMPLETE
static void
real_adding_file (FMListView *view, NautilusFile *file)
{
......@@ -661,6 +667,8 @@ real_removing_file (FMListView *view, NautilusFile *file)
EEL_CALL_PARENT (FM_LIST_VIEW_CLASS, removing_file, (view, file));
}
#endif
static gboolean
real_file_still_belongs (FMDirectoryView *view, NautilusFile *file)
{
......@@ -807,5 +815,3 @@ reveal_selected_items_callback (BonoboUIComponent *component, gpointer user_data
nautilus_file_list_free (selection);
}
#endif
......@@ -32,6 +32,7 @@
#include <gtk/gtkvbox.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <eel/eel-debug.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
......@@ -75,8 +76,10 @@ get_index_percentage_complete (void)
static void
set_close_hides_for_dialog (GtkDialog *dialog)
{
#if GNOME2_CONVERSION_COMPLETE
gtk_dialog_set_close (dialog, TRUE /*click_closes*/);
gtk_dialog_close_hides (dialog, TRUE /*just_hide*/);
#endif
}
......@@ -111,7 +114,9 @@ dialog_close_cover (gpointer dialog_data)
{
g_assert (GTK_IS_DIALOG (dialog_data));
#if GNOME2_CONVERSION_COMPLETE
gtk_dialog_close (dialog_data);
#endif
}
static void
......@@ -119,14 +124,16 @@ show_index_progress_dialog (void)
{
int callback_id;
#if GNOME2_CONVERSION_COMPLETE
gtk_dialog_close (dialogs->last_index_time_dialog);
#endif
gtk_widget_show_all (GTK_WIDGET (dialogs->index_in_progress_dialog));
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
dialogs->index_in_progress_dialog);
gtk_signal_connect_object (GTK_OBJECT (dialogs->index_in_progress_dialog),
"destroy",
medusa_remove_state_changed_function,
GINT_TO_POINTER (callback_id));
g_signal_connect_object (G_OBJECT (dialogs->index_in_progress_dialog),
"destroy",
G_CALLBACK (medusa_remove_state_changed_function),
GINT_TO_POINTER (callback_id), 0);
}
......@@ -135,14 +142,16 @@ show_last_index_time_dialog (void)
{
int callback_id;
#if GNOME2_CONVERSION_COMPLETE
gtk_dialog_close (dialogs->index_in_progress_dialog);
#endif
gtk_widget_show_all (GTK_WIDGET (dialogs->last_index_time_dialog));
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
dialogs->last_index_time_dialog);
gtk_signal_connect_object (GTK_OBJECT (dialogs->last_index_time_dialog),
"destroy",
medusa_remove_state_changed_function,
GINT_TO_POINTER (callback_id));
g_signal_connect_object (G_OBJECT (dialogs->last_index_time_dialog),
"destroy",
G_CALLBACK (medusa_remove_state_changed_function),
GINT_TO_POINTER (callback_id), 0);
}
static GtkDialog *
......@@ -228,7 +237,7 @@ index_progress_dialog_new (void)
g_free);
g_signal_connect (progress_bar_hbox,
"destroy",
timeout_remove_callback,
G_CALLBACK (timeout_remove_callback),
GUINT_TO_POINTER (timeout_id));
return dialog;
......@@ -263,15 +272,15 @@ show_indexing_info_dialog (void)
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
dialog_shown);
gtk_signal_connect_object (GTK_OBJECT (dialog_shown),
"destroy",
medusa_remove_state_changed_function,
GINT_TO_POINTER (callback_id));
g_signal_connect_object (G_OBJECT (dialog_shown),
"destroy",
G_CALLBACK (medusa_remove_state_changed_function),
GINT_TO_POINTER (callback_id), 0);
return;
}
if (dialogs == NULL) {
dialogs = g_new0 (IndexingInfoDialogs, 1);
eel_debug_call_at_shutdown (destroy_indexing_info_dialogs_on_exit, NULL);
eel_debug_call_at_shutdown (destroy_indexing_info_dialogs_on_exit);
dialogs->last_index_time_dialog = last_index_time_dialog_new ();
dialogs->index_in_progress_dialog = index_progress_dialog_new ();
......
......@@ -113,11 +113,9 @@ create_object (PortableServer_Servant servant,
} else if (strcmp (iid, NAUTILUS_LIST_VIEW_IID) == 0) {
directory_view = FM_DIRECTORY_VIEW (g_object_new (fm_list_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
#if GNOME2_CONVERSION_COMPLETE
} else if (strcmp (iid, SEARCH_LIST_VIEW_IID) == 0) {
directory_view = FM_DIRECTORY_VIEW (g_object_new (fm_search_list_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
#endif
} else if (strcmp (iid, SHELL_IID) == 0) {
application = NAUTILUS_APPLICATION (bonobo_object_from_servant (servant));
object = BONOBO_OBJECT (nautilus_shell_new (application));
......
......@@ -12,6 +12,11 @@
_tip="Go to the previous visited location"/>
<cmd name="Forward" accel="*Control*bracketright"
_tip="Go to the next visited location"/>
<cmd name="Find" accel="*Control*f"
_tip="Search this computer for files"/>
<cmd name="Toggle Find Mode"
_label="Find"
_tip="Search this computer for files"/>
<cmd name="New Window"
_label="New Window"
_tip="Open another Nautilus window for the displayed location"/>
......@@ -60,9 +65,14 @@
accel="*Control**Shift*w"
verb="Close All Windows"/>
<menuitem name="Find"
_label="_Find"
verb="Find"/>
<placeholder name="General Status Placeholder" delimit="top"/>
<placeholder name="File Items Placeholder" delimit="top"/>
<placeholder name="Dangerous File Items Placeholder" delimit="top"/>
<placeholder name="Global File Items Placeholder" delimit="top"/>
</submenu>
......@@ -299,6 +309,11 @@
min_width="48"
pixtype="stock" pixname="gtk-home"
verb="Home"/>
<toolitem name="Toggle Find Mode"
min_width="48"
type="toggle"
pixtype="stock" pixname="Search"
verb="Toggle Find Mode"/>
<separator/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment