diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2007-05-02 22:51:43 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@src.gnome.org> | 2007-05-02 22:51:43 +0000 |
commit | d3aeccf774fd13c4efdbdb873bb2258e1b94f853 (patch) | |
tree | 4ce2f324a2518663451f7e82cb0d9da97b7ee5b2 /gtk/gtkfilechooserprivate.h | |
parent | e82e337ee915d0cb1f07640be53a76854684b181 (diff) | |
download | gtk+-d3aeccf774fd13c4efdbdb873bb2258e1b94f853.tar.gz |
Add search file support in the GtkFileChooser. Original patch by Federico
2007-05-02 Emmanuele Bassi <ebassi@gnome.org>
Add search file support in the GtkFileChooser. Original patch
by Federico Mena Quintero; patch updated by Matthias Clasen.
See bug #344785.
* gtk/gtksearchengine.[ch]: Private search engine abstraction
object.
* gtk/gtksearchenginebeagle.[ch]: Private search engine
implementation using libbeagle (via g_module_open()).
* gtk/gtksearchenginesimple.[ch]: Private search engine
implementation using file tree walking.
* gtk/gtksearchenginetracker.[ch]: Private earch engine
implementation using libtracker (via g_module_open()).
* gtk/gtkquery.[ch]: Private query object for the search
engines.
* gtk/gtkfilechooserprivate.h:
* gtk/gtkfilechooserdefault.c: Use the GtkSearchEngine to
query a search engine backend using GtkQuery; create a new
operating mode, OPERATION_MODE_SEARCH, and call the common
operating mode OPERATION_MODE_BROWSE; add support for virtual
shortcuts inside the shortcuts model and create a new "Search"
virtual shortcut.
* gtk/Makefile.am: Update the build with the new files
svn path=/trunk/; revision=17783
Diffstat (limited to 'gtk/gtkfilechooserprivate.h')
-rw-r--r-- | gtk/gtkfilechooserprivate.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h index 24f57e0591..3a7416ccdd 100644 --- a/gtk/gtkfilechooserprivate.h +++ b/gtk/gtkfilechooserprivate.h @@ -25,6 +25,8 @@ #include "gtkfilesystem.h" #include "gtkfilesystemmodel.h" #include "gtkliststore.h" +#include "gtksearchengine.h" +#include "gtkquery.h" #include "gtktooltips.h" #include "gtktreemodelsort.h" #include "gtktreestore.h" @@ -147,6 +149,11 @@ typedef enum { LOCATION_MODE_FILENAME_ENTRY } LocationMode; +typedef enum { + OPERATION_MODE_BROWSE, + OPERATION_MODE_SEARCH +} OperationMode; + struct _GtkFileChooserDefault { GtkVBox parent_instance; @@ -175,11 +182,19 @@ struct _GtkFileChooserDefault GtkWidget *browse_files_popup_menu_add_shortcut_item; GtkWidget *browse_files_popup_menu_hidden_files_item; GtkWidget *browse_new_folder_button; + GtkWidget *browse_path_bar_hbox; GtkWidget *browse_path_bar; GtkFileSystemModel *browse_files_model; char *browse_files_last_selected_name; + /* Widgets for searching */ + GtkWidget *search_hbox; + GtkWidget *search_entry; + GtkSearchEngine *search_engine; + GtkQuery *search_query; + GtkListStore *search_model; + GtkWidget *filter_combo_hbox; GtkWidget *filter_combo; GtkWidget *preview_box; @@ -195,7 +210,16 @@ struct _GtkFileChooserDefault LocationMode location_mode; GtkListStore *shortcuts_model; - GtkTreeModel *shortcuts_filter_model; + + /* Filter for the shortcuts pane. We filter out the "current folder" row and + * the separator that we use for the "Save in folder" combo. + */ + GtkTreeModel *shortcuts_pane_filter_model; + + /* Filter for the "Save in folder" combo. We filter out the Search row and + * its separator. + */ + GtkTreeModel *shortcuts_combo_filter_model; GtkTreeModelSort *sort_model; @@ -215,6 +239,8 @@ struct _GtkFileChooserDefault ReloadState reload_state; guint load_timeout_id; + OperationMode operation_mode; + GSList *pending_select_paths; GtkFileFilter *current_filter; @@ -222,9 +248,6 @@ struct _GtkFileChooserDefault GtkTooltips *tooltips; - gboolean has_home; - gboolean has_desktop; - int num_volumes; int num_shortcuts; int num_bookmarks; @@ -239,6 +262,7 @@ struct _GtkFileChooserDefault GtkTreeViewColumn *list_name_column; GtkCellRenderer *list_name_renderer; + GtkTreeViewColumn *list_mtime_column; GSource *edited_idle; char *edited_new_text; @@ -266,6 +290,9 @@ struct _GtkFileChooserDefault guint changing_folder : 1; guint shortcuts_current_folder_active : 1; guint expand_folders : 1; + guint has_home : 1; + guint has_desktop : 1; + guint has_search : 1; #if 0 guint shortcuts_drag_outside : 1; |