mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
More work on whittling the state machine down to size.
* README: libunicode, libglade, and eog are no longer required. * components/history/nautilus-history-view.c: (history_title_changed): * libnautilus/nautilus-view-component.idl: * libnautilus/nautilus-view.c: (impl_Nautilus_View_title_changed), (nautilus_view_initialize_class): * libnautilus/nautilus-view.h: * src/nautilus-view-frame.c: (nautilus_view_frame_title_changed): * src/nautilus-view-frame.h: Added title parameter for the title_changed function. * src/nautilus-view-frame.c: (nautilus_view_frame_report_load_complete): Got rid of extra emission of report_load_complete, which is handled by view_frame_loaded now. * libnautilus-extensions/nautilus-background.c: (nautilus_background_initialize_class): * libnautilus-extensions/nautilus-entry.c: (nautilus_entry_initialize_class): * libnautilus-extensions/nautilus-icon-text-item.c: (iti_class_init): * libnautilus-extensions/nautilus-list.c: (nautilus_list_initialize_class): * src/nautilus-bookmark-list.c: (nautilus_bookmark_list_initialize_class): * src/nautilus-navigation-bar.c: (nautilus_navigation_bar_initialize_class): * src/nautilus-search-bar-criterion.c: (nautilus_search_bar_criterion_initialize_class): * src/nautilus-sidebar.c: (nautilus_sidebar_initialize_class): * src/nautilus-switchable-navigation-bar.c: (nautilus_switchable_navigation_bar_initialize_class): Use GTK_RUN_LAST instead of GTK_RUN_FIRST. * libnautilus-extensions/nautilus-directory-background.c: * libnautilus-extensions/nautilus-link-set.c: * libnautilus-extensions/nautilus-link.c: * src/file-manager/fm-icon-text-window.c: * src/file-manager/fm-icon-view.c: * src/file-manager/fm-properties-window.c: * src/nautilus-complex-search-bar.c: * src/nautilus-link-set-window.c: * src/nautilus-simple-search-bar.c: * src/nautilus-switchable-search-bar.c: Add includes needed now that the #include <gnome.h> was removed from nautilus-global-preferences.h. * libnautilus-extensions/nautilus-string.h: * libnautilus-extensions/nautilus-string.c: (nautilus_strcmp_case_breaks_ties): Added function, like g_strcasecmp, but falls back on strcmp for strings that match case-insensitive-wise. (nautilus_istr_compare): Use nautilus_strcmp_case_breaks_ties instead of nautilus_strcasecmp. * libnautilus-extensions/nautilus-file.c: (nautilus_file_compare_by_name): Use nautilus_strcmp_case_breaks_ties instead of g_strcasecmp. (nautilus_file_compare_by_directory_name): Use nautilus_strcmp_case_breaks_ties instead of g_strcasecmp. (get_automatic_emblems_as_integer): Convert automatic emblems to integer form for simple sorting. (prepend_automatic_emblem_names): Separate out the code that puts on automatic emblem names, and make it put them first, before any keyword-based emblems. (nautilus_file_compare_by_emblems): Compare the automatic emblems first, using the integer form. (nautilus_file_compare_by_type): Use nautilus_strcmp_case_breaks_ties instead of nautilus_strcmp. (nautilus_file_compare_for_sort): Use nautilus_strcmp_case_breaks_ties instead of g_strcasecmp. (nautilus_file_compare_name): Use nautilus_strcmp_case_breaks_ties instead of g_strcasecmp. (nautilus_file_is_mime_type): Use nautilus_strcasecmp instead of nautilus_strcmp. (nautilus_file_get_emblem_names): Use prepend_automatic_emblem_names. (sort_keyword_list_and_remove_duplicates): Sort with nautilus_strcmp_case_breaks_ties instead of compare_emblem_names. Automatic emblem names are now dealt with elsewhere. * libnautilus-extensions/nautilus-icon-container.c: (compare_icons_by_name): Use nautilus_strcmp_case_breaks_ties instead of nautilus_strcasecmp. * libnautilus-extensions/nautilus-glib-extensions.c: (nautilus_g_str_list_sort): Use nautilus_str_compare. (nautilus_g_str_list_sort_case_insensitive): Use nautilus_istr_compare. * components/services/vault/command-line/main.c: (main): * test/test-nautilus-mime-actions-set.c: (str_to_action_type): Use g_strcasecmp, not strcasecmp, for portability. * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: Removed _get_disabled_sidebar_panel_view_identifiers since the logic now removes any not in the enabled list instead. * libnautilus-extensions/nautilus-view-identifier.h: * libnautilus-extensions/nautilus-view-identifier.c: (nautilus_view_identifier_list_copy): New function. (nautilus_view_identifier_compare): Now sorts properly instead of returning 1 for any two identifiers that are !=. * nautilus-clean.sh: Removed unadorned gconfd now that it's ancient history and because it makes the script seem to fail all the time. * src/nautilus-window-manage-views.h: * src/nautilus-window-manage-views.c: (compute_title): Renamed to a shorter name since it's a local function. (update_title): Renamed to a shorter name since it's a local function and made it do nothing if the title is already correct. (nautilus_window_update_internals): Simplified code by using the new cached title. (nautilus_window_has_really_changed): Removed sidebar panel logic that is no longer needed. (nautilus_window_free_load_info): Remove some unused fields. (nautilus_window_open_location): Removed unused parameter. (nautilus_window_open_location_in_new_window): Removed unused parameter. (load_content_view): Renamed to shorter name since it's a local function. (handle_view_failure), (cancel_location_change), (load_view_for_new_location), (set_view_location_and_selection): Broke out big pieces of code used by the state machine. Soon we won't have a state machine at all, but we'll still need functions like these. (nautilus_window_update_state): Removed a lot of the code and broke the remaining bits into the above functions. (nautilus_window_set_state_info): Removed sidebar management code and some now-unused state variables. (nautilus_window_stop_loading): Moved this function in here and renamed it so the whole state machine is in one place. (nautilus_window_set_content_view): Moved this function in here and renamed it so the whole state machine is in one place. (compare_view_identifier_with_iid), (nautilus_window_set_sidebar_panels): Wrote new code to set up the sidebar panels based on a list of view identifiers, based on the code that was used before when preferences change. Moved here so the whole state machine is in one place. * src/nautilus-window-toolbars.c: (toolbar_stop_callback): Call the new function nautilus_window_stop_loading. * src/nautilus-window-private.h: * src/nautilus-window.h: * src/nautilus-window.c: (nautilus_window_initialize_class): Removed the "content_view" argument. (nautilus_window_goto_uri): Removed the view frame parameter from the open_location call. (nautilus_window_constructed): Set up sidebars based on preferences when the window is created. (nautilus_window_set_arg): Removed the "content_view" argument. (nautilus_window_get_arg): Removed the "content_view" argument. (view_menu_switch_views_callback): Call the new function nautilus_window_set_content_view. (chose_component_callback), Call the new function nautilus_window_set_content_view. (nautilus_window_open_location_callback): Removed the view frame parameter from the open_location call. (nautilus_window_open_location_in_new_window_callback): Removed the view frame parameter from the open_location_in_new_window call. (nautilus_window_connect_view): Don't connect to report_load_progress any more. The view frame now handles this for us. (nautilus_window_set_content_view_widget): Renamed this to avoid confusion with the new nautilus_window_set_content_view which is used to change content views, given a new view identifier. (update_sidebar_panels_from_preferences): Renamed and changed to use the new nautilus_window_set_sidebar_panels call.
This commit is contained in:
parent
d226b053a6
commit
99785dd779
181
ChangeLog
181
ChangeLog
|
@ -1,3 +1,184 @@
|
|||
2000-10-02 Darin Adler <darin@eazel.com>
|
||||
|
||||
More work on whittling the state machine down to size.
|
||||
|
||||
* README: libunicode, libglade, and eog are no longer required.
|
||||
|
||||
* components/history/nautilus-history-view.c:
|
||||
(history_title_changed):
|
||||
* libnautilus/nautilus-view-component.idl:
|
||||
* libnautilus/nautilus-view.c: (impl_Nautilus_View_title_changed),
|
||||
(nautilus_view_initialize_class):
|
||||
* libnautilus/nautilus-view.h:
|
||||
* src/nautilus-view-frame.c: (nautilus_view_frame_title_changed):
|
||||
* src/nautilus-view-frame.h:
|
||||
Added title parameter for the title_changed function.
|
||||
|
||||
* src/nautilus-view-frame.c:
|
||||
(nautilus_view_frame_report_load_complete): Got rid of extra
|
||||
emission of report_load_complete, which is handled by
|
||||
view_frame_loaded now.
|
||||
|
||||
* libnautilus-extensions/nautilus-background.c:
|
||||
(nautilus_background_initialize_class):
|
||||
* libnautilus-extensions/nautilus-entry.c:
|
||||
(nautilus_entry_initialize_class):
|
||||
* libnautilus-extensions/nautilus-icon-text-item.c:
|
||||
(iti_class_init):
|
||||
* libnautilus-extensions/nautilus-list.c:
|
||||
(nautilus_list_initialize_class):
|
||||
* src/nautilus-bookmark-list.c:
|
||||
(nautilus_bookmark_list_initialize_class):
|
||||
* src/nautilus-navigation-bar.c:
|
||||
(nautilus_navigation_bar_initialize_class):
|
||||
* src/nautilus-search-bar-criterion.c:
|
||||
(nautilus_search_bar_criterion_initialize_class):
|
||||
* src/nautilus-sidebar.c: (nautilus_sidebar_initialize_class):
|
||||
* src/nautilus-switchable-navigation-bar.c:
|
||||
(nautilus_switchable_navigation_bar_initialize_class):
|
||||
Use GTK_RUN_LAST instead of GTK_RUN_FIRST.
|
||||
|
||||
* libnautilus-extensions/nautilus-directory-background.c:
|
||||
* libnautilus-extensions/nautilus-link-set.c:
|
||||
* libnautilus-extensions/nautilus-link.c:
|
||||
* src/file-manager/fm-icon-text-window.c:
|
||||
* src/file-manager/fm-icon-view.c:
|
||||
* src/file-manager/fm-properties-window.c:
|
||||
* src/nautilus-complex-search-bar.c:
|
||||
* src/nautilus-link-set-window.c:
|
||||
* src/nautilus-simple-search-bar.c:
|
||||
* src/nautilus-switchable-search-bar.c:
|
||||
Add includes needed now that the #include <gnome.h> was removed
|
||||
from nautilus-global-preferences.h.
|
||||
|
||||
* libnautilus-extensions/nautilus-string.h:
|
||||
* libnautilus-extensions/nautilus-string.c:
|
||||
(nautilus_strcmp_case_breaks_ties): Added function, like
|
||||
g_strcasecmp, but falls back on strcmp for strings that match
|
||||
case-insensitive-wise.
|
||||
(nautilus_istr_compare): Use nautilus_strcmp_case_breaks_ties
|
||||
instead of nautilus_strcasecmp.
|
||||
|
||||
* libnautilus-extensions/nautilus-file.c:
|
||||
(nautilus_file_compare_by_name): Use
|
||||
nautilus_strcmp_case_breaks_ties instead of g_strcasecmp.
|
||||
(nautilus_file_compare_by_directory_name): Use
|
||||
nautilus_strcmp_case_breaks_ties instead of g_strcasecmp.
|
||||
(get_automatic_emblems_as_integer): Convert automatic emblems to
|
||||
integer form for simple sorting.
|
||||
(prepend_automatic_emblem_names): Separate out the code that puts
|
||||
on automatic emblem names, and make it put them first, before any
|
||||
keyword-based emblems.
|
||||
(nautilus_file_compare_by_emblems): Compare the automatic emblems
|
||||
first, using the integer form.
|
||||
(nautilus_file_compare_by_type): Use
|
||||
nautilus_strcmp_case_breaks_ties instead of nautilus_strcmp.
|
||||
(nautilus_file_compare_for_sort): Use
|
||||
nautilus_strcmp_case_breaks_ties instead of g_strcasecmp.
|
||||
(nautilus_file_compare_name): Use nautilus_strcmp_case_breaks_ties
|
||||
instead of g_strcasecmp.
|
||||
(nautilus_file_is_mime_type): Use nautilus_strcasecmp instead of
|
||||
nautilus_strcmp.
|
||||
(nautilus_file_get_emblem_names): Use
|
||||
prepend_automatic_emblem_names.
|
||||
(sort_keyword_list_and_remove_duplicates): Sort with
|
||||
nautilus_strcmp_case_breaks_ties instead of
|
||||
compare_emblem_names. Automatic emblem names are now dealt with
|
||||
elsewhere.
|
||||
|
||||
* libnautilus-extensions/nautilus-icon-container.c:
|
||||
(compare_icons_by_name): Use nautilus_strcmp_case_breaks_ties
|
||||
instead of nautilus_strcasecmp.
|
||||
|
||||
* libnautilus-extensions/nautilus-glib-extensions.c:
|
||||
(nautilus_g_str_list_sort): Use nautilus_str_compare.
|
||||
(nautilus_g_str_list_sort_case_insensitive): Use
|
||||
nautilus_istr_compare.
|
||||
|
||||
* components/services/vault/command-line/main.c: (main):
|
||||
* test/test-nautilus-mime-actions-set.c: (str_to_action_type):
|
||||
Use g_strcasecmp, not strcasecmp, for portability.
|
||||
|
||||
* libnautilus-extensions/nautilus-global-preferences.h:
|
||||
* libnautilus-extensions/nautilus-global-preferences.c:
|
||||
Removed _get_disabled_sidebar_panel_view_identifiers since the
|
||||
logic now removes any not in the enabled list instead.
|
||||
|
||||
* libnautilus-extensions/nautilus-view-identifier.h:
|
||||
* libnautilus-extensions/nautilus-view-identifier.c:
|
||||
(nautilus_view_identifier_list_copy): New function.
|
||||
(nautilus_view_identifier_compare): Now sorts properly instead of
|
||||
returning 1 for any two identifiers that are !=.
|
||||
|
||||
* nautilus-clean.sh: Removed unadorned gconfd now that it's
|
||||
ancient history and because it makes the script seem to fail all
|
||||
the time.
|
||||
|
||||
* src/nautilus-window-manage-views.h:
|
||||
* src/nautilus-window-manage-views.c:
|
||||
(compute_title): Renamed to a shorter name since it's a local function.
|
||||
(update_title): Renamed to a shorter name since it's a local
|
||||
function and made it do nothing if the title is already correct.
|
||||
(nautilus_window_update_internals): Simplified code by using the
|
||||
new cached title.
|
||||
(nautilus_window_has_really_changed): Removed sidebar panel logic
|
||||
that is no longer needed.
|
||||
(nautilus_window_free_load_info): Remove some unused fields.
|
||||
(nautilus_window_open_location): Removed unused parameter.
|
||||
(nautilus_window_open_location_in_new_window): Removed unused
|
||||
parameter.
|
||||
(load_content_view): Renamed to shorter name since it's a local
|
||||
function.
|
||||
(handle_view_failure), (cancel_location_change),
|
||||
(load_view_for_new_location), (set_view_location_and_selection):
|
||||
Broke out big pieces of code used by the state machine. Soon we
|
||||
won't have a state machine at all, but we'll still need functions
|
||||
like these.
|
||||
(nautilus_window_update_state): Removed a lot of the code and
|
||||
broke the remaining bits into the above functions.
|
||||
(nautilus_window_set_state_info): Removed sidebar management code
|
||||
and some now-unused state variables.
|
||||
(nautilus_window_stop_loading): Moved this function in here and
|
||||
renamed it so the whole state machine is in one place.
|
||||
(nautilus_window_set_content_view): Moved this function in here
|
||||
and renamed it so the whole state machine is in one place.
|
||||
(compare_view_identifier_with_iid),
|
||||
(nautilus_window_set_sidebar_panels): Wrote new code to set up the
|
||||
sidebar panels based on a list of view identifiers, based on the
|
||||
code that was used before when preferences change. Moved here so
|
||||
the whole state machine is in one place.
|
||||
|
||||
* src/nautilus-window-toolbars.c: (toolbar_stop_callback): Call
|
||||
the new function nautilus_window_stop_loading.
|
||||
|
||||
* src/nautilus-window-private.h:
|
||||
* src/nautilus-window.h:
|
||||
* src/nautilus-window.c: (nautilus_window_initialize_class):
|
||||
Removed the "content_view" argument.
|
||||
(nautilus_window_goto_uri): Removed the view frame parameter from
|
||||
the open_location call.
|
||||
(nautilus_window_constructed): Set up sidebars based on
|
||||
preferences when the window is created.
|
||||
(nautilus_window_set_arg): Removed the "content_view" argument.
|
||||
(nautilus_window_get_arg): Removed the "content_view" argument.
|
||||
(view_menu_switch_views_callback): Call the new function
|
||||
nautilus_window_set_content_view.
|
||||
(chose_component_callback), Call the new function
|
||||
nautilus_window_set_content_view.
|
||||
(nautilus_window_open_location_callback): Removed the view frame
|
||||
parameter from the open_location call.
|
||||
(nautilus_window_open_location_in_new_window_callback): Removed
|
||||
the view frame parameter from the open_location_in_new_window
|
||||
call.
|
||||
(nautilus_window_connect_view): Don't connect to
|
||||
report_load_progress any more. The view frame now handles this for
|
||||
us.
|
||||
(nautilus_window_set_content_view_widget): Renamed this to avoid
|
||||
confusion with the new nautilus_window_set_content_view which is
|
||||
used to change content views, given a new view identifier.
|
||||
(update_sidebar_panels_from_preferences): Renamed and changed to
|
||||
use the new nautilus_window_set_sidebar_panels call.
|
||||
|
||||
2000-10-02 Andy Hertzfeld <andy@eazel.com>
|
||||
|
||||
made some throbber changes for Arlo
|
||||
|
|
14
README
14
README
|
@ -133,11 +133,11 @@ We assume you want to install these packages in another prefix than
|
|||
/usr since you want to keep a working system. For the following, we
|
||||
assume you are installing in /usr/local. ie: ${prefix}=/usr/local
|
||||
|
||||
Redefine your PATH env variable:
|
||||
Redefine your PATH environment variable:
|
||||
export PATH=$PATH:${prefix}/bin
|
||||
Redefine your LD_LIBRARY_PATH env variable:
|
||||
Redefine your LD_LIBRARY_PATH environment variable:
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${prefix}/lib
|
||||
Redefine your GNOME_PATH env variable:
|
||||
Redefine your GNOME_PATH environment variable:
|
||||
export GNOME_PATH=$GNOME_PATH:${prefix}
|
||||
|
||||
In the order defined above and with the specific options detailed
|
||||
|
@ -171,9 +171,6 @@ The following lists the packages and the versions that are required.
|
|||
control-center control-center-1-0
|
||||
gnome-vfs: HEAD
|
||||
bonobo: BEFORE_NEW_UI_HANDLER_1
|
||||
libunicode: HEAD
|
||||
libglade: HEAD
|
||||
eog: BEFORE_NEW_UI_HANDLER_1 --with-bonobo
|
||||
xpdf: BEFORE_NEW_UI_HANDLER_1
|
||||
medusa: HEAD
|
||||
nautilus: HEAD
|
||||
|
@ -198,9 +195,10 @@ Earlier versions might work but no one has tested them.
|
|||
|
||||
Once you have these tools, you need to follow the compilation
|
||||
instructions detailed above for tarballs but instead of running
|
||||
"./configure --stuff", you will run "./autogen.sh --stuff" Using this
|
||||
"./configure --stuff", you will run "./autogen.sh --stuff". Using this
|
||||
also requires you to create the ${prefix}/share/aclocal directory
|
||||
before compiling any package and setup the following env variable:
|
||||
before compiling any package and setup the following environment
|
||||
variable:
|
||||
|
||||
export ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ${prefix}/share/aclocal"
|
||||
|
||||
|
|
|
@ -192,6 +192,7 @@ history_load_location (NautilusView *view,
|
|||
|
||||
static void
|
||||
history_title_changed (NautilusView *view,
|
||||
const char *title,
|
||||
HistoryView *hview)
|
||||
{
|
||||
history_load_location (view, NULL, hview);
|
||||
|
|
|
@ -95,7 +95,7 @@ int main (int argc, char *argv[]) {
|
|||
valid_ops();
|
||||
exit(1);
|
||||
}
|
||||
if(!strcasecmp(vop->name, operation)) {
|
||||
if(!g_strcasecmp(vop->name, operation)) {
|
||||
/* we've found a matching operation */
|
||||
GList *args = NULL;
|
||||
gint argcount = 0;
|
||||
|
|
|
@ -118,7 +118,7 @@ nautilus_background_initialize_class (gpointer klass)
|
|||
|
||||
signals[APPEARANCE_CHANGED] =
|
||||
gtk_signal_new ("appearance_changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
GTK_RUN_LAST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusBackgroundClass,
|
||||
appearance_changed),
|
||||
|
@ -127,7 +127,7 @@ nautilus_background_initialize_class (gpointer klass)
|
|||
0);
|
||||
signals[SETTINGS_CHANGED] =
|
||||
gtk_signal_new ("settings_changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
GTK_RUN_LAST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusBackgroundClass,
|
||||
settings_changed),
|
||||
|
|
|
@ -35,7 +35,10 @@
|
|||
#include "nautilus-theme.h"
|
||||
#include <X11/Xatom.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-config.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
|
||||
static void background_changed_callback (NautilusBackground *background, NautilusDirectory *directory);
|
||||
|
@ -174,7 +177,7 @@ nautilus_directory_background_read_desktop_settings (char **color,
|
|||
image_local_path = gnome_config_get_string ("/Background/Default/wallpaper=none");
|
||||
image_alignment = gnome_config_get_int_with_default ("/Background/Default/wallpaperAlign", &no_alignment);
|
||||
|
||||
if (nautilus_strcasecmp (image_local_path, "none")) {
|
||||
if (nautilus_strcasecmp (image_local_path, "none") != 0) {
|
||||
*image = gnome_vfs_get_uri_from_local_path (image_local_path);
|
||||
} else {
|
||||
*image = NULL;
|
||||
|
|
|
@ -82,13 +82,14 @@ nautilus_entry_initialize_class (NautilusEntryClass *class)
|
|||
editable_class->delete_text = nautilus_entry_delete_text;
|
||||
|
||||
/* Set up signals */
|
||||
signals[USER_CHANGED] = gtk_signal_new ("user_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusEntryClass,
|
||||
user_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
signals[USER_CHANGED] = gtk_signal_new
|
||||
("user_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusEntryClass,
|
||||
user_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nautilus-wait-until-ready.h"
|
||||
#include <ctype.h>
|
||||
#include <grp.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
@ -70,20 +71,8 @@ static GHashTable *symbolic_links;
|
|||
static void nautilus_file_initialize_class (NautilusFileClass *klass);
|
||||
static void nautilus_file_initialize (NautilusFile *file);
|
||||
static void destroy (GtkObject *object);
|
||||
static int nautilus_file_compare_by_name (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_directory_name (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_emblems (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_type (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static char *nautilus_file_get_date_as_string (NautilusFile *file,
|
||||
NautilusDateType date_type);
|
||||
static char *nautilus_file_get_owner_as_string (NautilusFile *file,
|
||||
gboolean include_real_name);
|
||||
static char *nautilus_file_get_permissions_as_string (NautilusFile *file);
|
||||
static char *nautilus_file_get_size_as_string (NautilusFile *file);
|
||||
static char *nautilus_file_get_type_as_string (NautilusFile *file);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusFile, nautilus_file, GTK_TYPE_OBJECT)
|
||||
|
@ -1200,51 +1189,16 @@ nautilus_file_compare_directories_by_size (NautilusFile *file_1, NautilusFile *f
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* compare_emblem_names
|
||||
*
|
||||
* Compare two emblem names by canonical order. Canonical order
|
||||
* is alphabetical, except the symbolic link name goes first. NULL
|
||||
* is allowed, and goes last.
|
||||
* @name_1: The first emblem name.
|
||||
* @name_2: The second emblem name.
|
||||
*
|
||||
* Return value: 0 if names are equal, -1 if @name_1 should be
|
||||
* first, +1 if @name_2 should be first.
|
||||
*/
|
||||
static int
|
||||
compare_emblem_names (const char *name_1, const char *name_2)
|
||||
{
|
||||
int strcmp_result;
|
||||
|
||||
strcmp_result = nautilus_strcmp (name_1, name_2);
|
||||
|
||||
if (strcmp_result == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nautilus_strcmp (name_1, NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK) == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nautilus_strcmp (name_2, NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK) == 0) {
|
||||
return +1;
|
||||
}
|
||||
|
||||
return strcmp_result;
|
||||
}
|
||||
|
||||
static int
|
||||
nautilus_file_compare_by_name (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
char *name_1;
|
||||
char *name_2;
|
||||
char *name_1, *name_2;
|
||||
int compare;
|
||||
|
||||
name_1 = nautilus_file_get_name (file_1);
|
||||
name_2 = nautilus_file_get_name (file_2);
|
||||
|
||||
compare = nautilus_strcasecmp (name_1, name_2);
|
||||
compare = nautilus_strcmp_case_breaks_ties (name_1, name_2);
|
||||
|
||||
g_free (name_1);
|
||||
g_free (name_2);
|
||||
|
@ -1255,14 +1209,13 @@ nautilus_file_compare_by_name (NautilusFile *file_1, NautilusFile *file_2)
|
|||
static int
|
||||
nautilus_file_compare_by_directory_name (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
char *directory_1;
|
||||
char *directory_2;
|
||||
char *directory_1, *directory_2;
|
||||
int compare;
|
||||
|
||||
directory_1 = nautilus_file_get_parent_uri_for_display (file_1);
|
||||
directory_2 = nautilus_file_get_parent_uri_for_display (file_2);
|
||||
|
||||
compare = nautilus_strcasecmp (directory_1, directory_2);
|
||||
compare = nautilus_strcmp_case_breaks_ties (directory_1, directory_2);
|
||||
|
||||
g_free (directory_1);
|
||||
g_free (directory_2);
|
||||
|
@ -1270,41 +1223,92 @@ nautilus_file_compare_by_directory_name (NautilusFile *file_1, NautilusFile *fil
|
|||
return compare;
|
||||
}
|
||||
|
||||
static int
|
||||
get_automatic_emblems_as_integer (NautilusFile *file)
|
||||
{
|
||||
int integer;
|
||||
|
||||
/* Keep in proper order for sorting. */
|
||||
|
||||
integer = nautilus_file_is_symbolic_link (file);
|
||||
integer <<= 1;
|
||||
integer |= !nautilus_file_can_read (file);
|
||||
integer <<= 1;
|
||||
integer |= !nautilus_file_can_write (file);
|
||||
integer <<= 1;
|
||||
integer |= nautilus_file_is_in_trash (file);
|
||||
|
||||
return integer;
|
||||
}
|
||||
|
||||
static GList *
|
||||
prepend_automatic_emblem_names (NautilusFile *file,
|
||||
GList *names)
|
||||
{
|
||||
/* Prepend in reverse order. */
|
||||
|
||||
if (nautilus_file_is_in_trash (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_TRASH));
|
||||
}
|
||||
if (!nautilus_file_can_write (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE));
|
||||
}
|
||||
if (!nautilus_file_can_read (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_READ));
|
||||
}
|
||||
if (nautilus_file_is_symbolic_link (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK));
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
static int
|
||||
nautilus_file_compare_by_emblems (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
GList *emblem_names_1;
|
||||
GList *emblem_names_2;
|
||||
GList *p1;
|
||||
GList *p2;
|
||||
int auto_1, auto_2;
|
||||
GList *keywords_1, *keywords_2;
|
||||
GList *node_1, *node_2;
|
||||
int compare_result;
|
||||
|
||||
auto_1 = get_automatic_emblems_as_integer (file_1);
|
||||
auto_2 = get_automatic_emblems_as_integer (file_2);
|
||||
if (auto_1 < auto_2) {
|
||||
return +1;
|
||||
} else if (auto_1 > auto_2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
keywords_1 = nautilus_file_get_keywords (file_1);
|
||||
keywords_2 = nautilus_file_get_keywords (file_2);
|
||||
|
||||
/* Compare each keyword. */
|
||||
compare_result = 0;
|
||||
|
||||
emblem_names_1 = nautilus_file_get_emblem_names (file_1);
|
||||
emblem_names_2 = nautilus_file_get_emblem_names (file_2);
|
||||
|
||||
p1 = emblem_names_1;
|
||||
p2 = emblem_names_2;
|
||||
while (p1 != NULL && p2 != NULL) {
|
||||
compare_result = compare_emblem_names (p1->data, p2->data);
|
||||
for (node_1 = keywords_1, node_2 = keywords_2;
|
||||
node_1 != NULL && node_2 != NULL;
|
||||
node_1 = node_1->next, node_2 = node_2->next) {
|
||||
|
||||
compare_result = nautilus_strcmp_case_breaks_ties (node_1->data, node_2->data);
|
||||
if (compare_result != 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
p1 = p1->next;
|
||||
p2 = p2->next;
|
||||
}
|
||||
|
||||
if (compare_result == 0) {
|
||||
/* One or both is now NULL. */
|
||||
if (p1 != NULL || p2 != NULL) {
|
||||
compare_result = p2 == NULL ? -1 : +1;
|
||||
if (node_1 != NULL) {
|
||||
compare_result = -1;
|
||||
} else if (node_2 != NULL) {
|
||||
compare_result = +1;
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_g_list_free_deep (emblem_names_1);
|
||||
nautilus_g_list_free_deep (emblem_names_2);
|
||||
nautilus_g_list_free_deep (keywords_1);
|
||||
nautilus_g_list_free_deep (keywords_2);
|
||||
|
||||
return compare_result;
|
||||
}
|
||||
|
@ -1348,7 +1352,7 @@ nautilus_file_compare_by_type (NautilusFile *file_1, NautilusFile *file_2)
|
|||
type_string_1 = nautilus_file_get_type_as_string (file_1);
|
||||
type_string_2 = nautilus_file_get_type_as_string (file_2);
|
||||
|
||||
result = nautilus_strcmp (type_string_1, type_string_2);
|
||||
result = nautilus_strcmp_case_breaks_ties (type_string_1, type_string_2);
|
||||
|
||||
g_free (type_string_1);
|
||||
g_free (type_string_2);
|
||||
|
@ -1443,8 +1447,8 @@ nautilus_file_compare_for_sort (NautilusFile *file_1,
|
|||
|
||||
if (file_1->details->info == NULL) {
|
||||
if (file_2->details->info == NULL) {
|
||||
compare = g_strcasecmp (file_1->details->name,
|
||||
file_2->details->name);
|
||||
compare = nautilus_strcmp_case_breaks_ties
|
||||
(file_1->details->name, file_2->details->name);
|
||||
} else {
|
||||
/* FIXME bugzilla.eazel.com 2426:
|
||||
* We do have a name for file 2 to
|
||||
|
@ -1494,14 +1498,16 @@ nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
|||
* @file: A file object
|
||||
* @pattern: A string we are comparing it with
|
||||
*
|
||||
* Return value: result of a case-insensitive comparison of the file
|
||||
* name and the given pattern.
|
||||
* Return value: result of a comparison of the file name and the given pattern,
|
||||
* using the same sorting order as sort by name.
|
||||
**/
|
||||
int
|
||||
nautilus_file_compare_name (NautilusFile *file,
|
||||
const char *pattern)
|
||||
{
|
||||
return g_strcasecmp (file->details->name, pattern);
|
||||
g_return_val_if_fail (pattern != NULL, -1);
|
||||
|
||||
return nautilus_strcmp_case_breaks_ties (file->details->name, pattern);
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -2994,75 +3000,58 @@ nautilus_file_get_string_attribute (NautilusFile *file, const char *attribute_na
|
|||
if (strcmp (attribute_name, "name") == 0) {
|
||||
return nautilus_file_get_name (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "type") == 0) {
|
||||
return nautilus_file_get_type_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "mime_type") == 0) {
|
||||
return nautilus_file_get_mime_type (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "size") == 0) {
|
||||
return nautilus_file_get_size_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_size") == 0) {
|
||||
return nautilus_file_get_deep_size_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_file_count") == 0) {
|
||||
return nautilus_file_get_deep_file_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_directory_count") == 0) {
|
||||
return nautilus_file_get_deep_directory_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_total_count") == 0) {
|
||||
return nautilus_file_get_deep_total_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_modified") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_MODIFIED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_changed") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_CHANGED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_accessed") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_ACCESSED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_permissions") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_PERMISSIONS_CHANGED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "permissions") == 0) {
|
||||
return nautilus_file_get_permissions_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "octal_permissions") == 0) {
|
||||
return nautilus_file_get_octal_permissions_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "owner") == 0) {
|
||||
return nautilus_file_get_owner_as_string (file, TRUE);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "group") == 0) {
|
||||
return nautilus_file_get_group_name (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "uri") == 0) {
|
||||
return nautilus_file_get_uri (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "parent_uri") == 0) {
|
||||
return nautilus_file_get_parent_uri_for_display (file);
|
||||
}
|
||||
|
@ -3189,11 +3178,10 @@ nautilus_file_get_type_as_string (NautilusFile *file)
|
|||
/* We want to update gnome-vfs/data/mime/gnome-vfs.keys to include
|
||||
* English (& localizable) versions of every mime type anyone ever sees.
|
||||
*/
|
||||
if (strcasecmp (mime_type, "x-directory/normal") == 0) {
|
||||
if (g_strcasecmp (mime_type, "x-directory/normal") == 0) {
|
||||
g_warning ("Can't find description even for \"x-directory/normal\". This "
|
||||
"probably means that your gnome-vfs.keys file is in the wrong place "
|
||||
"or isn't being found for some other reason.");
|
||||
|
||||
} else {
|
||||
g_warning ("No description found for mime type \"%s\" (file is \"%s\"), tell sullivan@eazel.com",
|
||||
mime_type,
|
||||
|
@ -3254,7 +3242,7 @@ nautilus_file_is_mime_type (NautilusFile *file, const char *mime_type)
|
|||
if (info_missing (file, GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE)) {
|
||||
return FALSE;
|
||||
}
|
||||
return nautilus_strcmp (file->details->info->mime_type, mime_type) == 0;
|
||||
return nautilus_strcasecmp (file->details->info->mime_type, mime_type) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3270,39 +3258,14 @@ nautilus_file_is_mime_type (NautilusFile *file, const char *mime_type)
|
|||
GList *
|
||||
nautilus_file_get_emblem_names (NautilusFile *file)
|
||||
{
|
||||
GList *names;
|
||||
|
||||
if (file == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
|
||||
names = nautilus_file_get_keywords (file);
|
||||
|
||||
if (nautilus_file_is_in_trash (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_TRASH));
|
||||
}
|
||||
|
||||
if (nautilus_file_is_symbolic_link (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK));
|
||||
}
|
||||
|
||||
if (!nautilus_file_can_write (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE));
|
||||
|
||||
}
|
||||
|
||||
if (!nautilus_file_can_read (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_READ));
|
||||
|
||||
}
|
||||
|
||||
return names;
|
||||
return prepend_automatic_emblem_names
|
||||
(file, nautilus_file_get_keywords (file));
|
||||
}
|
||||
|
||||
static GList *
|
||||
|
@ -3311,12 +3274,12 @@ sort_keyword_list_and_remove_duplicates (GList *keywords)
|
|||
GList *p;
|
||||
GList *duplicate_link;
|
||||
|
||||
keywords = g_list_sort (keywords, (GCompareFunc) compare_emblem_names);
|
||||
keywords = g_list_sort (keywords, (GCompareFunc) nautilus_strcmp_case_breaks_ties);
|
||||
|
||||
if (keywords != NULL) {
|
||||
p = keywords;
|
||||
p = keywords;
|
||||
while (p->next != NULL) {
|
||||
if (nautilus_strcmp (p->data, p->next->data) == 0) {
|
||||
if (strcmp (p->data, p->next->data) == 0) {
|
||||
duplicate_link = p->next;
|
||||
keywords = g_list_remove_link (keywords, duplicate_link);
|
||||
nautilus_g_list_free_deep (duplicate_link);
|
||||
|
@ -4101,6 +4064,3 @@ nautilus_self_check_file (void)
|
|||
}
|
||||
|
||||
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -382,12 +382,6 @@ nautilus_g_str_list_copy (GList *list)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
compare_strings (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
return nautilus_strcmp (string_a, string_b);
|
||||
}
|
||||
|
||||
/**
|
||||
* nautilus_g_str_list_sort
|
||||
*
|
||||
|
@ -400,20 +394,7 @@ compare_strings (gconstpointer string_a, gconstpointer string_b)
|
|||
GList *
|
||||
nautilus_g_str_list_sort (GList *list)
|
||||
{
|
||||
return g_list_sort (list, compare_strings);
|
||||
}
|
||||
|
||||
static int
|
||||
compare_strings_case_insensitive (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
int insensitive_result;
|
||||
|
||||
insensitive_result = g_strcasecmp (string_a, string_b);
|
||||
if (insensitive_result != 0) {
|
||||
return insensitive_result;
|
||||
} else {
|
||||
return compare_strings (string_a, string_b);
|
||||
}
|
||||
return g_list_sort (list, nautilus_str_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -428,7 +409,7 @@ compare_strings_case_insensitive (gconstpointer string_a, gconstpointer string_b
|
|||
GList *
|
||||
nautilus_g_str_list_sort_case_insensitive (GList *list)
|
||||
{
|
||||
return g_list_sort (list, compare_strings_case_insensitive);
|
||||
return g_list_sort (list, nautilus_istr_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -392,26 +392,6 @@ nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void)
|
|||
return enabled_view_identifiers;
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void)
|
||||
{
|
||||
GList *enabled_view_identifiers;
|
||||
GList *disabled_view_identifiers;
|
||||
|
||||
enabled_view_identifiers = global_preferences_get_sidebar_panel_view_identifiers ();
|
||||
|
||||
enabled_view_identifiers = nautilus_g_list_partition
|
||||
(enabled_view_identifiers,
|
||||
global_preferences_is_sidebar_panel_enabled_cover,
|
||||
NULL,
|
||||
&disabled_view_identifiers);
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifiers);
|
||||
|
||||
return disabled_view_identifiers;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
destroy_global_prefs_dialog (void)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef NAUTILUS_PREFS_GLOBAL_H
|
||||
#define NAUTILUS_PREFS_GLOBAL_H
|
||||
|
||||
#include <gnome.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
@ -127,20 +126,15 @@ typedef enum
|
|||
NAUTILUS_SIMPLE_SEARCH_BAR
|
||||
} NautilusSearchBarMode;
|
||||
|
||||
|
||||
void nautilus_global_preferences_initialize (void);
|
||||
void nautilus_global_preferences_show_dialog (void);
|
||||
void nautilus_global_preferences_hide_dialog (void);
|
||||
void nautilus_global_preferences_set_dialog_title (const char *title);
|
||||
void nautilus_global_preferences_dialog_update (void);
|
||||
void nautilus_global_preferences_initialize (void);
|
||||
void nautilus_global_preferences_show_dialog (void);
|
||||
void nautilus_global_preferences_hide_dialog (void);
|
||||
void nautilus_global_preferences_set_dialog_title (const char *title);
|
||||
void nautilus_global_preferences_dialog_update (void);
|
||||
|
||||
/* Sidebar */
|
||||
GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
|
||||
GList *nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void);
|
||||
|
||||
GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
|
||||
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_PREFS_GLOBAL_H */
|
||||
|
||||
|
||||
|
|
|
@ -1972,7 +1972,7 @@ compare_icons_by_name (gconstpointer a, gconstpointer b)
|
|||
/* _get_editable_text might return NULL here if called while the
|
||||
* icon container is loading, before each icon has been updated once.
|
||||
*/
|
||||
return nautilus_strcasecmp
|
||||
return nautilus_strcmp_case_breaks_ties
|
||||
(nautilus_icon_canvas_item_get_editable_text (icon_a->item),
|
||||
nautilus_icon_canvas_item_get_editable_text (icon_b->item));
|
||||
}
|
||||
|
|
|
@ -1084,77 +1084,69 @@ iti_class_init (NautilusIconTextItemClass *text_item_class)
|
|||
|
||||
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
|
||||
|
||||
iti_signals [TEXT_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"text_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_changed),
|
||||
gtk_marshal_BOOL__NONE,
|
||||
GTK_TYPE_BOOL, 0);
|
||||
iti_signals [TEXT_CHANGED] = gtk_signal_new
|
||||
("text_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_changed),
|
||||
gtk_marshal_BOOL__NONE,
|
||||
GTK_TYPE_BOOL, 0);
|
||||
|
||||
iti_signals [TEXT_EDITED] =
|
||||
gtk_signal_new (
|
||||
"text_edited",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_edited),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [TEXT_EDITED] = gtk_signal_new
|
||||
("text_edited",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_edited),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals [HEIGHT_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"height_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, height_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [HEIGHT_CHANGED] = gtk_signal_new
|
||||
("height_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, height_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals [WIDTH_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"width_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, width_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [WIDTH_CHANGED] = gtk_signal_new
|
||||
("width_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, width_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[EDITING_STARTED] =
|
||||
gtk_signal_new (
|
||||
"editing_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[EDITING_STARTED] = gtk_signal_new
|
||||
("editing_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[EDITING_STOPPED] =
|
||||
gtk_signal_new (
|
||||
"editing_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[EDITING_STOPPED] = gtk_signal_new
|
||||
("editing_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[SELECTION_STARTED] =
|
||||
gtk_signal_new (
|
||||
"selection_started",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[SELECTION_STARTED] = gtk_signal_new
|
||||
("selection_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[SELECTION_STOPPED] =
|
||||
gtk_signal_new (
|
||||
"selection_stopped",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[SELECTION_STOPPED] = gtk_signal_new
|
||||
("selection_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, iti_signals, LAST_SIGNAL);
|
||||
|
||||
|
|
|
@ -25,24 +25,23 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-link-set.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <parser.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-file.h"
|
||||
#include "nautilus-link.h"
|
||||
#include "nautilus-metadata.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include "nautilus-glib-extensions.h"
|
||||
#include "nautilus-global-preferences.h"
|
||||
#include "nautilus-link.h"
|
||||
#include "nautilus-metadata.h"
|
||||
#include "nautilus-preferences.h"
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <parser.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
/* routine to create a new link file in the specified directory */
|
||||
static gboolean
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-link.h"
|
||||
|
||||
#include "nautilus-directory.h"
|
||||
#include "nautilus-directory-notify.h"
|
||||
#include "nautilus-directory.h"
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-file.h"
|
||||
#include "nautilus-global-preferences.h"
|
||||
|
@ -34,6 +34,7 @@
|
|||
#include "nautilus-preferences.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <parser.h>
|
||||
|
|
|
@ -321,21 +321,21 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
|
||||
list_signals[CONTEXT_CLICK_SELECTION] =
|
||||
gtk_signal_new ("context_click_selection",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, context_click_selection),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[CONTEXT_CLICK_BACKGROUND] =
|
||||
gtk_signal_new ("context_click_background",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, context_click_background),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[ACTIVATE] =
|
||||
gtk_signal_new ("activate",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, activate),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
|
@ -343,14 +343,14 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_POINTER);
|
||||
list_signals[SELECTION_CHANGED] =
|
||||
gtk_signal_new ("selection_changed",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, selection_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[SELECT_MATCHING_NAME] =
|
||||
gtk_signal_new ("select_matching_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_matching_name),
|
||||
gtk_marshal_NONE__STRING,
|
||||
|
@ -358,21 +358,21 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_STRING, 0);
|
||||
list_signals[SELECT_PREVIOUS_NAME] =
|
||||
gtk_signal_new ("select_previous_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_previous_name),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[SELECT_NEXT_NAME] =
|
||||
gtk_signal_new ("select_next_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_next_name),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[HANDLE_DROPPED_ITEMS] =
|
||||
gtk_signal_new ("handle_dropped_items",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, handle_dropped_items),
|
||||
nautilus_gtk_marshal_NONE__INT_POINTER_INT_INT_UINT,
|
||||
|
@ -384,7 +384,7 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_UINT);
|
||||
list_signals[GET_DRAG_PIXMAP] =
|
||||
gtk_signal_new ("get_drag_pixmap",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, get_drag_pixmap),
|
||||
nautilus_gtk_marshal_NONE__POINTER_INT_POINTER_POINTER,
|
||||
|
@ -400,7 +400,6 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_SIGNAL_OFFSET (NautilusListClass, get_sort_column_index),
|
||||
nautilus_gtk_marshal_INT__NONE,
|
||||
GTK_TYPE_INT, 0);
|
||||
|
||||
|
||||
gtk_object_class_add_signals (object_class, list_signals, LAST_SIGNAL);
|
||||
|
||||
|
@ -1124,12 +1123,13 @@ keyboard_row_reveal_timeout_callback (gpointer data)
|
|||
row_index = list->details->keyboard_row_to_reveal;
|
||||
|
||||
if (row_index >= 0 && row_index < GTK_CLIST (list)->rows) {
|
||||
/* Only reveal the icon if it's still the keyboard focus or if
|
||||
* it's still selected. Someone originally thought we should
|
||||
* cancel this reveal if the user manages to sneak a direct
|
||||
* scroll in before the timeout fires, but we later realized
|
||||
* this wouldn't actually be an improvement
|
||||
* (see bugzilla.eazel.com 612).
|
||||
/* Only reveal the icon if it's still the keyboard
|
||||
* focus or if it's still selected. Someone originally
|
||||
* thought we should cancel this reveal if the user
|
||||
* manages to sneak a direct scroll in before the
|
||||
* timeout fires, but we later realized this wouldn't
|
||||
* actually be an improvement (see bugzilla.eazel.com
|
||||
* 612).
|
||||
*/
|
||||
if (row_index == GTK_CLIST (list)->focus_row
|
||||
|| nautilus_list_is_row_selected (list, row_index)) {
|
||||
|
|
|
@ -57,6 +57,18 @@ nautilus_strcasecmp (const char *string_a, const char *string_b)
|
|||
string_b == NULL ? "" : string_b);
|
||||
}
|
||||
|
||||
int
|
||||
nautilus_strcmp_case_breaks_ties (const char *string_a, const char *string_b)
|
||||
{
|
||||
int casecmp_result;
|
||||
|
||||
casecmp_result = nautilus_strcasecmp (string_a, string_b);
|
||||
if (casecmp_result != 0) {
|
||||
return casecmp_result;
|
||||
}
|
||||
return nautilus_strcmp (string_a, string_b);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_str_is_empty (const char *string_or_null)
|
||||
{
|
||||
|
@ -66,13 +78,13 @@ nautilus_str_is_empty (const char *string_or_null)
|
|||
gboolean
|
||||
nautilus_str_is_equal (const char *string_a, const char *string_b)
|
||||
{
|
||||
return (nautilus_strcmp (string_a, string_b) == 0);
|
||||
return nautilus_strcmp (string_a, string_b) == 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_istr_is_equal (const char *string_a, const char *string_b)
|
||||
{
|
||||
return (nautilus_strcasecmp (string_a, string_b) == 0);
|
||||
return nautilus_strcasecmp (string_a, string_b) == 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -85,8 +97,8 @@ nautilus_str_compare (gconstpointer string_a, gconstpointer string_b)
|
|||
int
|
||||
nautilus_istr_compare (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
return nautilus_strcasecmp ((const char *) string_a,
|
||||
(const char *) string_b);
|
||||
return nautilus_strcmp_case_breaks_ties ((const char *) string_a,
|
||||
(const char *) string_b);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -36,68 +36,66 @@
|
|||
/* NULL is allowed for all the str parameters to these functions. */
|
||||
|
||||
/* Versions of basic string functions that allow NULL. */
|
||||
size_t nautilus_strlen (const char *string);
|
||||
char * nautilus_strchr (const char *haystack,
|
||||
char needle);
|
||||
int nautilus_strcmp (const char *string_a,
|
||||
const char *string_b);
|
||||
int nautilus_strcasecmp (const char *string_a,
|
||||
const char *string_b);
|
||||
|
||||
|
||||
size_t nautilus_strlen (const char *str);
|
||||
char * nautilus_strchr (const char *haystack,
|
||||
char needle);
|
||||
int nautilus_strcmp (const char *str_a,
|
||||
const char *str_b);
|
||||
int nautilus_strcasecmp (const char *str_a,
|
||||
const char *str_b);
|
||||
int nautilus_strcmp_case_breaks_ties (const char *str_a,
|
||||
const char *str_b);
|
||||
|
||||
/* GCompareFunc version. */
|
||||
int nautilus_str_compare (gconstpointer string_a,
|
||||
gconstpointer string_b);
|
||||
int nautilus_istr_compare (gconstpointer string_a,
|
||||
gconstpointer string_b);
|
||||
|
||||
|
||||
int nautilus_str_compare (gconstpointer str_a,
|
||||
gconstpointer str_b);
|
||||
int nautilus_istr_compare (gconstpointer str_a,
|
||||
gconstpointer str_b);
|
||||
|
||||
/* Other basic string operations. */
|
||||
gboolean nautilus_str_is_empty (const char *string_or_null);
|
||||
gboolean nautilus_str_is_equal (const char *string_a,
|
||||
const char *string_b);
|
||||
gboolean nautilus_istr_is_equal (const char *string_a,
|
||||
const char *string_b);
|
||||
gboolean nautilus_str_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_get_after_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
gboolean nautilus_istr_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
gboolean nautilus_str_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
gboolean nautilus_istr_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_strip_chr (const char *string,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_chr (const char *string,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_str (const char *string,
|
||||
const char *remove_this);
|
||||
gboolean nautilus_str_is_empty (const char *str_or_null);
|
||||
gboolean nautilus_str_is_equal (const char *str_a,
|
||||
const char *str_b);
|
||||
gboolean nautilus_istr_is_equal (const char *str_a,
|
||||
const char *str_b);
|
||||
gboolean nautilus_str_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_get_after_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
gboolean nautilus_istr_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
gboolean nautilus_str_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
gboolean nautilus_istr_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_strip_chr (const char *str,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_chr (const char *str,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_str (const char *str,
|
||||
const char *remove_this);
|
||||
|
||||
|
||||
|
||||
/* Conversions to and from strings. */
|
||||
gboolean nautilus_str_to_int (const char *string,
|
||||
int *integer);
|
||||
gboolean nautilus_eat_str_to_int (char *string_gets_freed,
|
||||
int *integer);
|
||||
gboolean nautilus_str_to_int (const char *str,
|
||||
int *integer);
|
||||
gboolean nautilus_eat_str_to_int (char *str_gets_freed,
|
||||
int *integer);
|
||||
|
||||
|
||||
|
||||
/* Escape function for '_' character. */
|
||||
char * nautilus_str_double_underscores (const char *string);
|
||||
char * nautilus_str_double_underscores (const char *str);
|
||||
|
||||
|
||||
|
||||
/* Capitalize a string */
|
||||
char * nautilus_str_capitalize (const char *string);
|
||||
char * nautilus_str_capitalize (const char *str);
|
||||
|
||||
|
||||
|
||||
|
@ -105,13 +103,12 @@ char * nautilus_str_capitalize (const char *string);
|
|||
* The resulting string will be truncated in the middle with a "..."
|
||||
* delimeter.
|
||||
*/
|
||||
char * nautilus_str_middle_truncate (const char *string,
|
||||
guint truncate_length);
|
||||
char * nautilus_str_middle_truncate (const char *str,
|
||||
guint truncate_length);
|
||||
|
||||
|
||||
/* Count the number of 'c' characters that occur in 'string'. */
|
||||
guint nautilus_str_count_characters (const char *string,
|
||||
guint nautilus_str_count_characters (const char *str,
|
||||
char c);
|
||||
|
||||
|
||||
#endif /* NAUTILUS_STRING_H */
|
||||
|
|
|
@ -91,12 +91,11 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
|
|||
GSList *langs;
|
||||
|
||||
langs = get_lang_list ();
|
||||
|
||||
view_as_name = oaf_server_info_prop_lookup (server, name_attribute, langs);
|
||||
|
||||
if (view_as_name == NULL) {
|
||||
view_as_name = oaf_server_info_prop_lookup (server, "name", langs);
|
||||
}
|
||||
|
||||
if (view_as_name == NULL) {
|
||||
view_as_name = server->iid;
|
||||
}
|
||||
|
@ -125,15 +124,15 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
|
|||
NautilusViewIdentifier *
|
||||
nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server)
|
||||
{
|
||||
return nautilus_view_identifier_new_from_oaf_server_info (server,
|
||||
"nautilus:view_as_name");
|
||||
return nautilus_view_identifier_new_from_oaf_server_info
|
||||
(server, "nautilus:view_as_name");
|
||||
}
|
||||
|
||||
NautilusViewIdentifier *
|
||||
nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server)
|
||||
{
|
||||
return nautilus_view_identifier_new_from_oaf_server_info (server,
|
||||
"nautilus:sidebar_panel_name");
|
||||
return nautilus_view_identifier_new_from_oaf_server_info
|
||||
(server, "nautilus:sidebar_panel_name");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -146,6 +145,19 @@ nautilus_view_identifier_free (NautilusViewIdentifier *identifier)
|
|||
}
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_view_identifier_list_copy (GList *list)
|
||||
{
|
||||
GList *copy, *node;
|
||||
|
||||
copy = NULL;
|
||||
for (node = list; node != NULL; node = node->next) {
|
||||
copy = g_list_prepend
|
||||
(copy, nautilus_view_identifier_copy (node->data));
|
||||
}
|
||||
return g_list_reverse (copy);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_view_identifier_free_callback (gpointer identifier, gpointer ignore)
|
||||
{
|
||||
|
@ -154,16 +166,20 @@ nautilus_view_identifier_free_callback (gpointer identifier, gpointer ignore)
|
|||
}
|
||||
|
||||
void
|
||||
nautilus_view_identifier_list_free (GList *identifiers)
|
||||
nautilus_view_identifier_list_free (GList *list)
|
||||
{
|
||||
nautilus_g_list_free_deep_custom
|
||||
(identifiers,
|
||||
nautilus_view_identifier_free_callback,
|
||||
NULL);
|
||||
(list, nautilus_view_identifier_free_callback, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
nautilus_view_identifier_compare (NautilusViewIdentifier *a, NautilusViewIdentifier *b)
|
||||
{
|
||||
return (strcmp (a->iid, b->iid) || strcmp (a->name, b->name));
|
||||
int result;
|
||||
|
||||
result = strcmp (a->iid, b->iid);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
return strcmp (a->name, b->name);
|
||||
}
|
||||
|
|
|
@ -37,17 +37,18 @@ typedef struct {
|
|||
char *name; /* human-readable name */
|
||||
} NautilusViewIdentifier;
|
||||
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new (const char *iid,
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new (const char *iid,
|
||||
const char *name);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server,
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server,
|
||||
char *name_attribute);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifier *identifier);
|
||||
|
||||
NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifier *identifier);
|
||||
void nautilus_view_identifier_free (NautilusViewIdentifier *identifier);
|
||||
void nautilus_view_identifier_list_free (GList *identifiers);
|
||||
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
|
||||
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
|
||||
NautilusViewIdentifier *b);
|
||||
/* lists of NautilusViewIdentifier */
|
||||
GList * nautilus_view_identifier_list_copy (GList *list);
|
||||
void nautilus_view_identifier_list_free (GList *list);
|
||||
|
||||
#endif
|
||||
#endif /* NAUTILUS_VIEW_IDENTIFIER */
|
||||
|
|
|
@ -118,7 +118,7 @@ nautilus_background_initialize_class (gpointer klass)
|
|||
|
||||
signals[APPEARANCE_CHANGED] =
|
||||
gtk_signal_new ("appearance_changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
GTK_RUN_LAST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusBackgroundClass,
|
||||
appearance_changed),
|
||||
|
@ -127,7 +127,7 @@ nautilus_background_initialize_class (gpointer klass)
|
|||
0);
|
||||
signals[SETTINGS_CHANGED] =
|
||||
gtk_signal_new ("settings_changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
GTK_RUN_LAST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusBackgroundClass,
|
||||
settings_changed),
|
||||
|
|
|
@ -35,7 +35,10 @@
|
|||
#include "nautilus-theme.h"
|
||||
#include <X11/Xatom.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-config.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
|
||||
static void background_changed_callback (NautilusBackground *background, NautilusDirectory *directory);
|
||||
|
@ -174,7 +177,7 @@ nautilus_directory_background_read_desktop_settings (char **color,
|
|||
image_local_path = gnome_config_get_string ("/Background/Default/wallpaper=none");
|
||||
image_alignment = gnome_config_get_int_with_default ("/Background/Default/wallpaperAlign", &no_alignment);
|
||||
|
||||
if (nautilus_strcasecmp (image_local_path, "none")) {
|
||||
if (nautilus_strcasecmp (image_local_path, "none") != 0) {
|
||||
*image = gnome_vfs_get_uri_from_local_path (image_local_path);
|
||||
} else {
|
||||
*image = NULL;
|
||||
|
|
|
@ -82,13 +82,14 @@ nautilus_entry_initialize_class (NautilusEntryClass *class)
|
|||
editable_class->delete_text = nautilus_entry_delete_text;
|
||||
|
||||
/* Set up signals */
|
||||
signals[USER_CHANGED] = gtk_signal_new ("user_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusEntryClass,
|
||||
user_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
signals[USER_CHANGED] = gtk_signal_new
|
||||
("user_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusEntryClass,
|
||||
user_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nautilus-wait-until-ready.h"
|
||||
#include <ctype.h>
|
||||
#include <grp.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
@ -70,20 +71,8 @@ static GHashTable *symbolic_links;
|
|||
static void nautilus_file_initialize_class (NautilusFileClass *klass);
|
||||
static void nautilus_file_initialize (NautilusFile *file);
|
||||
static void destroy (GtkObject *object);
|
||||
static int nautilus_file_compare_by_name (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_directory_name (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_emblems (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static int nautilus_file_compare_by_type (NautilusFile *file_1,
|
||||
NautilusFile *file_2);
|
||||
static char *nautilus_file_get_date_as_string (NautilusFile *file,
|
||||
NautilusDateType date_type);
|
||||
static char *nautilus_file_get_owner_as_string (NautilusFile *file,
|
||||
gboolean include_real_name);
|
||||
static char *nautilus_file_get_permissions_as_string (NautilusFile *file);
|
||||
static char *nautilus_file_get_size_as_string (NautilusFile *file);
|
||||
static char *nautilus_file_get_type_as_string (NautilusFile *file);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusFile, nautilus_file, GTK_TYPE_OBJECT)
|
||||
|
@ -1200,51 +1189,16 @@ nautilus_file_compare_directories_by_size (NautilusFile *file_1, NautilusFile *f
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* compare_emblem_names
|
||||
*
|
||||
* Compare two emblem names by canonical order. Canonical order
|
||||
* is alphabetical, except the symbolic link name goes first. NULL
|
||||
* is allowed, and goes last.
|
||||
* @name_1: The first emblem name.
|
||||
* @name_2: The second emblem name.
|
||||
*
|
||||
* Return value: 0 if names are equal, -1 if @name_1 should be
|
||||
* first, +1 if @name_2 should be first.
|
||||
*/
|
||||
static int
|
||||
compare_emblem_names (const char *name_1, const char *name_2)
|
||||
{
|
||||
int strcmp_result;
|
||||
|
||||
strcmp_result = nautilus_strcmp (name_1, name_2);
|
||||
|
||||
if (strcmp_result == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nautilus_strcmp (name_1, NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK) == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nautilus_strcmp (name_2, NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK) == 0) {
|
||||
return +1;
|
||||
}
|
||||
|
||||
return strcmp_result;
|
||||
}
|
||||
|
||||
static int
|
||||
nautilus_file_compare_by_name (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
char *name_1;
|
||||
char *name_2;
|
||||
char *name_1, *name_2;
|
||||
int compare;
|
||||
|
||||
name_1 = nautilus_file_get_name (file_1);
|
||||
name_2 = nautilus_file_get_name (file_2);
|
||||
|
||||
compare = nautilus_strcasecmp (name_1, name_2);
|
||||
compare = nautilus_strcmp_case_breaks_ties (name_1, name_2);
|
||||
|
||||
g_free (name_1);
|
||||
g_free (name_2);
|
||||
|
@ -1255,14 +1209,13 @@ nautilus_file_compare_by_name (NautilusFile *file_1, NautilusFile *file_2)
|
|||
static int
|
||||
nautilus_file_compare_by_directory_name (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
char *directory_1;
|
||||
char *directory_2;
|
||||
char *directory_1, *directory_2;
|
||||
int compare;
|
||||
|
||||
directory_1 = nautilus_file_get_parent_uri_for_display (file_1);
|
||||
directory_2 = nautilus_file_get_parent_uri_for_display (file_2);
|
||||
|
||||
compare = nautilus_strcasecmp (directory_1, directory_2);
|
||||
compare = nautilus_strcmp_case_breaks_ties (directory_1, directory_2);
|
||||
|
||||
g_free (directory_1);
|
||||
g_free (directory_2);
|
||||
|
@ -1270,41 +1223,92 @@ nautilus_file_compare_by_directory_name (NautilusFile *file_1, NautilusFile *fil
|
|||
return compare;
|
||||
}
|
||||
|
||||
static int
|
||||
get_automatic_emblems_as_integer (NautilusFile *file)
|
||||
{
|
||||
int integer;
|
||||
|
||||
/* Keep in proper order for sorting. */
|
||||
|
||||
integer = nautilus_file_is_symbolic_link (file);
|
||||
integer <<= 1;
|
||||
integer |= !nautilus_file_can_read (file);
|
||||
integer <<= 1;
|
||||
integer |= !nautilus_file_can_write (file);
|
||||
integer <<= 1;
|
||||
integer |= nautilus_file_is_in_trash (file);
|
||||
|
||||
return integer;
|
||||
}
|
||||
|
||||
static GList *
|
||||
prepend_automatic_emblem_names (NautilusFile *file,
|
||||
GList *names)
|
||||
{
|
||||
/* Prepend in reverse order. */
|
||||
|
||||
if (nautilus_file_is_in_trash (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_TRASH));
|
||||
}
|
||||
if (!nautilus_file_can_write (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE));
|
||||
}
|
||||
if (!nautilus_file_can_read (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_READ));
|
||||
}
|
||||
if (nautilus_file_is_symbolic_link (file)) {
|
||||
names = g_list_prepend
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK));
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
static int
|
||||
nautilus_file_compare_by_emblems (NautilusFile *file_1, NautilusFile *file_2)
|
||||
{
|
||||
GList *emblem_names_1;
|
||||
GList *emblem_names_2;
|
||||
GList *p1;
|
||||
GList *p2;
|
||||
int auto_1, auto_2;
|
||||
GList *keywords_1, *keywords_2;
|
||||
GList *node_1, *node_2;
|
||||
int compare_result;
|
||||
|
||||
auto_1 = get_automatic_emblems_as_integer (file_1);
|
||||
auto_2 = get_automatic_emblems_as_integer (file_2);
|
||||
if (auto_1 < auto_2) {
|
||||
return +1;
|
||||
} else if (auto_1 > auto_2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
keywords_1 = nautilus_file_get_keywords (file_1);
|
||||
keywords_2 = nautilus_file_get_keywords (file_2);
|
||||
|
||||
/* Compare each keyword. */
|
||||
compare_result = 0;
|
||||
|
||||
emblem_names_1 = nautilus_file_get_emblem_names (file_1);
|
||||
emblem_names_2 = nautilus_file_get_emblem_names (file_2);
|
||||
|
||||
p1 = emblem_names_1;
|
||||
p2 = emblem_names_2;
|
||||
while (p1 != NULL && p2 != NULL) {
|
||||
compare_result = compare_emblem_names (p1->data, p2->data);
|
||||
for (node_1 = keywords_1, node_2 = keywords_2;
|
||||
node_1 != NULL && node_2 != NULL;
|
||||
node_1 = node_1->next, node_2 = node_2->next) {
|
||||
|
||||
compare_result = nautilus_strcmp_case_breaks_ties (node_1->data, node_2->data);
|
||||
if (compare_result != 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
p1 = p1->next;
|
||||
p2 = p2->next;
|
||||
}
|
||||
|
||||
if (compare_result == 0) {
|
||||
/* One or both is now NULL. */
|
||||
if (p1 != NULL || p2 != NULL) {
|
||||
compare_result = p2 == NULL ? -1 : +1;
|
||||
if (node_1 != NULL) {
|
||||
compare_result = -1;
|
||||
} else if (node_2 != NULL) {
|
||||
compare_result = +1;
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_g_list_free_deep (emblem_names_1);
|
||||
nautilus_g_list_free_deep (emblem_names_2);
|
||||
nautilus_g_list_free_deep (keywords_1);
|
||||
nautilus_g_list_free_deep (keywords_2);
|
||||
|
||||
return compare_result;
|
||||
}
|
||||
|
@ -1348,7 +1352,7 @@ nautilus_file_compare_by_type (NautilusFile *file_1, NautilusFile *file_2)
|
|||
type_string_1 = nautilus_file_get_type_as_string (file_1);
|
||||
type_string_2 = nautilus_file_get_type_as_string (file_2);
|
||||
|
||||
result = nautilus_strcmp (type_string_1, type_string_2);
|
||||
result = nautilus_strcmp_case_breaks_ties (type_string_1, type_string_2);
|
||||
|
||||
g_free (type_string_1);
|
||||
g_free (type_string_2);
|
||||
|
@ -1443,8 +1447,8 @@ nautilus_file_compare_for_sort (NautilusFile *file_1,
|
|||
|
||||
if (file_1->details->info == NULL) {
|
||||
if (file_2->details->info == NULL) {
|
||||
compare = g_strcasecmp (file_1->details->name,
|
||||
file_2->details->name);
|
||||
compare = nautilus_strcmp_case_breaks_ties
|
||||
(file_1->details->name, file_2->details->name);
|
||||
} else {
|
||||
/* FIXME bugzilla.eazel.com 2426:
|
||||
* We do have a name for file 2 to
|
||||
|
@ -1494,14 +1498,16 @@ nautilus_file_compare_for_sort_reversed (NautilusFile *file_1,
|
|||
* @file: A file object
|
||||
* @pattern: A string we are comparing it with
|
||||
*
|
||||
* Return value: result of a case-insensitive comparison of the file
|
||||
* name and the given pattern.
|
||||
* Return value: result of a comparison of the file name and the given pattern,
|
||||
* using the same sorting order as sort by name.
|
||||
**/
|
||||
int
|
||||
nautilus_file_compare_name (NautilusFile *file,
|
||||
const char *pattern)
|
||||
{
|
||||
return g_strcasecmp (file->details->name, pattern);
|
||||
g_return_val_if_fail (pattern != NULL, -1);
|
||||
|
||||
return nautilus_strcmp_case_breaks_ties (file->details->name, pattern);
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -2994,75 +3000,58 @@ nautilus_file_get_string_attribute (NautilusFile *file, const char *attribute_na
|
|||
if (strcmp (attribute_name, "name") == 0) {
|
||||
return nautilus_file_get_name (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "type") == 0) {
|
||||
return nautilus_file_get_type_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "mime_type") == 0) {
|
||||
return nautilus_file_get_mime_type (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "size") == 0) {
|
||||
return nautilus_file_get_size_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_size") == 0) {
|
||||
return nautilus_file_get_deep_size_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_file_count") == 0) {
|
||||
return nautilus_file_get_deep_file_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_directory_count") == 0) {
|
||||
return nautilus_file_get_deep_directory_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "deep_total_count") == 0) {
|
||||
return nautilus_file_get_deep_total_count_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_modified") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_MODIFIED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_changed") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_CHANGED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_accessed") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_ACCESSED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "date_permissions") == 0) {
|
||||
return nautilus_file_get_date_as_string (file,
|
||||
NAUTILUS_DATE_TYPE_PERMISSIONS_CHANGED);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "permissions") == 0) {
|
||||
return nautilus_file_get_permissions_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "octal_permissions") == 0) {
|
||||
return nautilus_file_get_octal_permissions_as_string (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "owner") == 0) {
|
||||
return nautilus_file_get_owner_as_string (file, TRUE);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "group") == 0) {
|
||||
return nautilus_file_get_group_name (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "uri") == 0) {
|
||||
return nautilus_file_get_uri (file);
|
||||
}
|
||||
|
||||
if (strcmp (attribute_name, "parent_uri") == 0) {
|
||||
return nautilus_file_get_parent_uri_for_display (file);
|
||||
}
|
||||
|
@ -3189,11 +3178,10 @@ nautilus_file_get_type_as_string (NautilusFile *file)
|
|||
/* We want to update gnome-vfs/data/mime/gnome-vfs.keys to include
|
||||
* English (& localizable) versions of every mime type anyone ever sees.
|
||||
*/
|
||||
if (strcasecmp (mime_type, "x-directory/normal") == 0) {
|
||||
if (g_strcasecmp (mime_type, "x-directory/normal") == 0) {
|
||||
g_warning ("Can't find description even for \"x-directory/normal\". This "
|
||||
"probably means that your gnome-vfs.keys file is in the wrong place "
|
||||
"or isn't being found for some other reason.");
|
||||
|
||||
} else {
|
||||
g_warning ("No description found for mime type \"%s\" (file is \"%s\"), tell sullivan@eazel.com",
|
||||
mime_type,
|
||||
|
@ -3254,7 +3242,7 @@ nautilus_file_is_mime_type (NautilusFile *file, const char *mime_type)
|
|||
if (info_missing (file, GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE)) {
|
||||
return FALSE;
|
||||
}
|
||||
return nautilus_strcmp (file->details->info->mime_type, mime_type) == 0;
|
||||
return nautilus_strcasecmp (file->details->info->mime_type, mime_type) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3270,39 +3258,14 @@ nautilus_file_is_mime_type (NautilusFile *file, const char *mime_type)
|
|||
GList *
|
||||
nautilus_file_get_emblem_names (NautilusFile *file)
|
||||
{
|
||||
GList *names;
|
||||
|
||||
if (file == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
|
||||
names = nautilus_file_get_keywords (file);
|
||||
|
||||
if (nautilus_file_is_in_trash (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_TRASH));
|
||||
}
|
||||
|
||||
if (nautilus_file_is_symbolic_link (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK));
|
||||
}
|
||||
|
||||
if (!nautilus_file_can_write (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE));
|
||||
|
||||
}
|
||||
|
||||
if (!nautilus_file_can_read (file)) {
|
||||
names = g_list_append
|
||||
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_READ));
|
||||
|
||||
}
|
||||
|
||||
return names;
|
||||
return prepend_automatic_emblem_names
|
||||
(file, nautilus_file_get_keywords (file));
|
||||
}
|
||||
|
||||
static GList *
|
||||
|
@ -3311,12 +3274,12 @@ sort_keyword_list_and_remove_duplicates (GList *keywords)
|
|||
GList *p;
|
||||
GList *duplicate_link;
|
||||
|
||||
keywords = g_list_sort (keywords, (GCompareFunc) compare_emblem_names);
|
||||
keywords = g_list_sort (keywords, (GCompareFunc) nautilus_strcmp_case_breaks_ties);
|
||||
|
||||
if (keywords != NULL) {
|
||||
p = keywords;
|
||||
p = keywords;
|
||||
while (p->next != NULL) {
|
||||
if (nautilus_strcmp (p->data, p->next->data) == 0) {
|
||||
if (strcmp (p->data, p->next->data) == 0) {
|
||||
duplicate_link = p->next;
|
||||
keywords = g_list_remove_link (keywords, duplicate_link);
|
||||
nautilus_g_list_free_deep (duplicate_link);
|
||||
|
@ -4101,6 +4064,3 @@ nautilus_self_check_file (void)
|
|||
}
|
||||
|
||||
#endif /* !NAUTILUS_OMIT_SELF_CHECK */
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -382,12 +382,6 @@ nautilus_g_str_list_copy (GList *list)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
compare_strings (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
return nautilus_strcmp (string_a, string_b);
|
||||
}
|
||||
|
||||
/**
|
||||
* nautilus_g_str_list_sort
|
||||
*
|
||||
|
@ -400,20 +394,7 @@ compare_strings (gconstpointer string_a, gconstpointer string_b)
|
|||
GList *
|
||||
nautilus_g_str_list_sort (GList *list)
|
||||
{
|
||||
return g_list_sort (list, compare_strings);
|
||||
}
|
||||
|
||||
static int
|
||||
compare_strings_case_insensitive (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
int insensitive_result;
|
||||
|
||||
insensitive_result = g_strcasecmp (string_a, string_b);
|
||||
if (insensitive_result != 0) {
|
||||
return insensitive_result;
|
||||
} else {
|
||||
return compare_strings (string_a, string_b);
|
||||
}
|
||||
return g_list_sort (list, nautilus_str_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -428,7 +409,7 @@ compare_strings_case_insensitive (gconstpointer string_a, gconstpointer string_b
|
|||
GList *
|
||||
nautilus_g_str_list_sort_case_insensitive (GList *list)
|
||||
{
|
||||
return g_list_sort (list, compare_strings_case_insensitive);
|
||||
return g_list_sort (list, nautilus_istr_compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -392,26 +392,6 @@ nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void)
|
|||
return enabled_view_identifiers;
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void)
|
||||
{
|
||||
GList *enabled_view_identifiers;
|
||||
GList *disabled_view_identifiers;
|
||||
|
||||
enabled_view_identifiers = global_preferences_get_sidebar_panel_view_identifiers ();
|
||||
|
||||
enabled_view_identifiers = nautilus_g_list_partition
|
||||
(enabled_view_identifiers,
|
||||
global_preferences_is_sidebar_panel_enabled_cover,
|
||||
NULL,
|
||||
&disabled_view_identifiers);
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifiers);
|
||||
|
||||
return disabled_view_identifiers;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
destroy_global_prefs_dialog (void)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef NAUTILUS_PREFS_GLOBAL_H
|
||||
#define NAUTILUS_PREFS_GLOBAL_H
|
||||
|
||||
#include <gnome.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
@ -127,20 +126,15 @@ typedef enum
|
|||
NAUTILUS_SIMPLE_SEARCH_BAR
|
||||
} NautilusSearchBarMode;
|
||||
|
||||
|
||||
void nautilus_global_preferences_initialize (void);
|
||||
void nautilus_global_preferences_show_dialog (void);
|
||||
void nautilus_global_preferences_hide_dialog (void);
|
||||
void nautilus_global_preferences_set_dialog_title (const char *title);
|
||||
void nautilus_global_preferences_dialog_update (void);
|
||||
void nautilus_global_preferences_initialize (void);
|
||||
void nautilus_global_preferences_show_dialog (void);
|
||||
void nautilus_global_preferences_hide_dialog (void);
|
||||
void nautilus_global_preferences_set_dialog_title (const char *title);
|
||||
void nautilus_global_preferences_dialog_update (void);
|
||||
|
||||
/* Sidebar */
|
||||
GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
|
||||
GList *nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers (void);
|
||||
|
||||
GList *nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers (void);
|
||||
|
||||
END_GNOME_DECLS
|
||||
|
||||
#endif /* NAUTILUS_PREFS_GLOBAL_H */
|
||||
|
||||
|
||||
|
|
|
@ -1972,7 +1972,7 @@ compare_icons_by_name (gconstpointer a, gconstpointer b)
|
|||
/* _get_editable_text might return NULL here if called while the
|
||||
* icon container is loading, before each icon has been updated once.
|
||||
*/
|
||||
return nautilus_strcasecmp
|
||||
return nautilus_strcmp_case_breaks_ties
|
||||
(nautilus_icon_canvas_item_get_editable_text (icon_a->item),
|
||||
nautilus_icon_canvas_item_get_editable_text (icon_b->item));
|
||||
}
|
||||
|
|
|
@ -1084,77 +1084,69 @@ iti_class_init (NautilusIconTextItemClass *text_item_class)
|
|||
|
||||
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
|
||||
|
||||
iti_signals [TEXT_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"text_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_changed),
|
||||
gtk_marshal_BOOL__NONE,
|
||||
GTK_TYPE_BOOL, 0);
|
||||
iti_signals [TEXT_CHANGED] = gtk_signal_new
|
||||
("text_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_changed),
|
||||
gtk_marshal_BOOL__NONE,
|
||||
GTK_TYPE_BOOL, 0);
|
||||
|
||||
iti_signals [TEXT_EDITED] =
|
||||
gtk_signal_new (
|
||||
"text_edited",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_edited),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [TEXT_EDITED] = gtk_signal_new
|
||||
("text_edited",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_edited),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals [HEIGHT_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"height_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, height_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [HEIGHT_CHANGED] = gtk_signal_new
|
||||
("height_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, height_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals [WIDTH_CHANGED] =
|
||||
gtk_signal_new (
|
||||
"width_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, width_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals [WIDTH_CHANGED] = gtk_signal_new
|
||||
("width_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, width_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[EDITING_STARTED] =
|
||||
gtk_signal_new (
|
||||
"editing_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[EDITING_STARTED] = gtk_signal_new
|
||||
("editing_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[EDITING_STOPPED] =
|
||||
gtk_signal_new (
|
||||
"editing_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[EDITING_STOPPED] = gtk_signal_new
|
||||
("editing_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[SELECTION_STARTED] =
|
||||
gtk_signal_new (
|
||||
"selection_started",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[SELECTION_STARTED] = gtk_signal_new
|
||||
("selection_started",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_started),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
iti_signals[SELECTION_STOPPED] =
|
||||
gtk_signal_new (
|
||||
"selection_stopped",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
iti_signals[SELECTION_STOPPED] = gtk_signal_new
|
||||
("selection_stopped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_stopped),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, iti_signals, LAST_SIGNAL);
|
||||
|
||||
|
|
|
@ -25,24 +25,23 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-link-set.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <parser.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-file.h"
|
||||
#include "nautilus-link.h"
|
||||
#include "nautilus-metadata.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include "nautilus-glib-extensions.h"
|
||||
#include "nautilus-global-preferences.h"
|
||||
#include "nautilus-link.h"
|
||||
#include "nautilus-metadata.h"
|
||||
#include "nautilus-preferences.h"
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <parser.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
/* routine to create a new link file in the specified directory */
|
||||
static gboolean
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-link.h"
|
||||
|
||||
#include "nautilus-directory.h"
|
||||
#include "nautilus-directory-notify.h"
|
||||
#include "nautilus-directory.h"
|
||||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-file.h"
|
||||
#include "nautilus-global-preferences.h"
|
||||
|
@ -34,6 +34,7 @@
|
|||
#include "nautilus-preferences.h"
|
||||
#include "nautilus-string.h"
|
||||
#include "nautilus-xml-extensions.h"
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <parser.h>
|
||||
|
|
|
@ -321,21 +321,21 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
|
||||
list_signals[CONTEXT_CLICK_SELECTION] =
|
||||
gtk_signal_new ("context_click_selection",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, context_click_selection),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[CONTEXT_CLICK_BACKGROUND] =
|
||||
gtk_signal_new ("context_click_background",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, context_click_background),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[ACTIVATE] =
|
||||
gtk_signal_new ("activate",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, activate),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
|
@ -343,14 +343,14 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_POINTER);
|
||||
list_signals[SELECTION_CHANGED] =
|
||||
gtk_signal_new ("selection_changed",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, selection_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[SELECT_MATCHING_NAME] =
|
||||
gtk_signal_new ("select_matching_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_matching_name),
|
||||
gtk_marshal_NONE__STRING,
|
||||
|
@ -358,21 +358,21 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_STRING, 0);
|
||||
list_signals[SELECT_PREVIOUS_NAME] =
|
||||
gtk_signal_new ("select_previous_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_previous_name),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[SELECT_NEXT_NAME] =
|
||||
gtk_signal_new ("select_next_name",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, select_next_name),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[HANDLE_DROPPED_ITEMS] =
|
||||
gtk_signal_new ("handle_dropped_items",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, handle_dropped_items),
|
||||
nautilus_gtk_marshal_NONE__INT_POINTER_INT_INT_UINT,
|
||||
|
@ -384,7 +384,7 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_TYPE_UINT);
|
||||
list_signals[GET_DRAG_PIXMAP] =
|
||||
gtk_signal_new ("get_drag_pixmap",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusListClass, get_drag_pixmap),
|
||||
nautilus_gtk_marshal_NONE__POINTER_INT_POINTER_POINTER,
|
||||
|
@ -400,7 +400,6 @@ nautilus_list_initialize_class (NautilusListClass *klass)
|
|||
GTK_SIGNAL_OFFSET (NautilusListClass, get_sort_column_index),
|
||||
nautilus_gtk_marshal_INT__NONE,
|
||||
GTK_TYPE_INT, 0);
|
||||
|
||||
|
||||
gtk_object_class_add_signals (object_class, list_signals, LAST_SIGNAL);
|
||||
|
||||
|
@ -1124,12 +1123,13 @@ keyboard_row_reveal_timeout_callback (gpointer data)
|
|||
row_index = list->details->keyboard_row_to_reveal;
|
||||
|
||||
if (row_index >= 0 && row_index < GTK_CLIST (list)->rows) {
|
||||
/* Only reveal the icon if it's still the keyboard focus or if
|
||||
* it's still selected. Someone originally thought we should
|
||||
* cancel this reveal if the user manages to sneak a direct
|
||||
* scroll in before the timeout fires, but we later realized
|
||||
* this wouldn't actually be an improvement
|
||||
* (see bugzilla.eazel.com 612).
|
||||
/* Only reveal the icon if it's still the keyboard
|
||||
* focus or if it's still selected. Someone originally
|
||||
* thought we should cancel this reveal if the user
|
||||
* manages to sneak a direct scroll in before the
|
||||
* timeout fires, but we later realized this wouldn't
|
||||
* actually be an improvement (see bugzilla.eazel.com
|
||||
* 612).
|
||||
*/
|
||||
if (row_index == GTK_CLIST (list)->focus_row
|
||||
|| nautilus_list_is_row_selected (list, row_index)) {
|
||||
|
|
|
@ -57,6 +57,18 @@ nautilus_strcasecmp (const char *string_a, const char *string_b)
|
|||
string_b == NULL ? "" : string_b);
|
||||
}
|
||||
|
||||
int
|
||||
nautilus_strcmp_case_breaks_ties (const char *string_a, const char *string_b)
|
||||
{
|
||||
int casecmp_result;
|
||||
|
||||
casecmp_result = nautilus_strcasecmp (string_a, string_b);
|
||||
if (casecmp_result != 0) {
|
||||
return casecmp_result;
|
||||
}
|
||||
return nautilus_strcmp (string_a, string_b);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_str_is_empty (const char *string_or_null)
|
||||
{
|
||||
|
@ -66,13 +78,13 @@ nautilus_str_is_empty (const char *string_or_null)
|
|||
gboolean
|
||||
nautilus_str_is_equal (const char *string_a, const char *string_b)
|
||||
{
|
||||
return (nautilus_strcmp (string_a, string_b) == 0);
|
||||
return nautilus_strcmp (string_a, string_b) == 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_istr_is_equal (const char *string_a, const char *string_b)
|
||||
{
|
||||
return (nautilus_strcasecmp (string_a, string_b) == 0);
|
||||
return nautilus_strcasecmp (string_a, string_b) == 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -85,8 +97,8 @@ nautilus_str_compare (gconstpointer string_a, gconstpointer string_b)
|
|||
int
|
||||
nautilus_istr_compare (gconstpointer string_a, gconstpointer string_b)
|
||||
{
|
||||
return nautilus_strcasecmp ((const char *) string_a,
|
||||
(const char *) string_b);
|
||||
return nautilus_strcmp_case_breaks_ties ((const char *) string_a,
|
||||
(const char *) string_b);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -36,68 +36,66 @@
|
|||
/* NULL is allowed for all the str parameters to these functions. */
|
||||
|
||||
/* Versions of basic string functions that allow NULL. */
|
||||
size_t nautilus_strlen (const char *string);
|
||||
char * nautilus_strchr (const char *haystack,
|
||||
char needle);
|
||||
int nautilus_strcmp (const char *string_a,
|
||||
const char *string_b);
|
||||
int nautilus_strcasecmp (const char *string_a,
|
||||
const char *string_b);
|
||||
|
||||
|
||||
size_t nautilus_strlen (const char *str);
|
||||
char * nautilus_strchr (const char *haystack,
|
||||
char needle);
|
||||
int nautilus_strcmp (const char *str_a,
|
||||
const char *str_b);
|
||||
int nautilus_strcasecmp (const char *str_a,
|
||||
const char *str_b);
|
||||
int nautilus_strcmp_case_breaks_ties (const char *str_a,
|
||||
const char *str_b);
|
||||
|
||||
/* GCompareFunc version. */
|
||||
int nautilus_str_compare (gconstpointer string_a,
|
||||
gconstpointer string_b);
|
||||
int nautilus_istr_compare (gconstpointer string_a,
|
||||
gconstpointer string_b);
|
||||
|
||||
|
||||
int nautilus_str_compare (gconstpointer str_a,
|
||||
gconstpointer str_b);
|
||||
int nautilus_istr_compare (gconstpointer str_a,
|
||||
gconstpointer str_b);
|
||||
|
||||
/* Other basic string operations. */
|
||||
gboolean nautilus_str_is_empty (const char *string_or_null);
|
||||
gboolean nautilus_str_is_equal (const char *string_a,
|
||||
const char *string_b);
|
||||
gboolean nautilus_istr_is_equal (const char *string_a,
|
||||
const char *string_b);
|
||||
gboolean nautilus_str_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_get_after_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
gboolean nautilus_istr_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
gboolean nautilus_str_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
gboolean nautilus_istr_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_strip_chr (const char *string,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_chr (const char *string,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_str (const char *string,
|
||||
const char *remove_this);
|
||||
gboolean nautilus_str_is_empty (const char *str_or_null);
|
||||
gboolean nautilus_str_is_equal (const char *str_a,
|
||||
const char *str_b);
|
||||
gboolean nautilus_istr_is_equal (const char *str_a,
|
||||
const char *str_b);
|
||||
gboolean nautilus_str_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_get_after_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
gboolean nautilus_istr_has_prefix (const char *target,
|
||||
const char *prefix);
|
||||
gboolean nautilus_str_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
gboolean nautilus_istr_has_suffix (const char *target,
|
||||
const char *suffix);
|
||||
char * nautilus_str_get_prefix (const char *source,
|
||||
const char *delimiter);
|
||||
char * nautilus_str_strip_chr (const char *str,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_chr (const char *str,
|
||||
char remove_this);
|
||||
char * nautilus_str_strip_trailing_str (const char *str,
|
||||
const char *remove_this);
|
||||
|
||||
|
||||
|
||||
/* Conversions to and from strings. */
|
||||
gboolean nautilus_str_to_int (const char *string,
|
||||
int *integer);
|
||||
gboolean nautilus_eat_str_to_int (char *string_gets_freed,
|
||||
int *integer);
|
||||
gboolean nautilus_str_to_int (const char *str,
|
||||
int *integer);
|
||||
gboolean nautilus_eat_str_to_int (char *str_gets_freed,
|
||||
int *integer);
|
||||
|
||||
|
||||
|
||||
/* Escape function for '_' character. */
|
||||
char * nautilus_str_double_underscores (const char *string);
|
||||
char * nautilus_str_double_underscores (const char *str);
|
||||
|
||||
|
||||
|
||||
/* Capitalize a string */
|
||||
char * nautilus_str_capitalize (const char *string);
|
||||
char * nautilus_str_capitalize (const char *str);
|
||||
|
||||
|
||||
|
||||
|
@ -105,13 +103,12 @@ char * nautilus_str_capitalize (const char *string);
|
|||
* The resulting string will be truncated in the middle with a "..."
|
||||
* delimeter.
|
||||
*/
|
||||
char * nautilus_str_middle_truncate (const char *string,
|
||||
guint truncate_length);
|
||||
char * nautilus_str_middle_truncate (const char *str,
|
||||
guint truncate_length);
|
||||
|
||||
|
||||
/* Count the number of 'c' characters that occur in 'string'. */
|
||||
guint nautilus_str_count_characters (const char *string,
|
||||
guint nautilus_str_count_characters (const char *str,
|
||||
char c);
|
||||
|
||||
|
||||
#endif /* NAUTILUS_STRING_H */
|
||||
|
|
|
@ -91,12 +91,11 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
|
|||
GSList *langs;
|
||||
|
||||
langs = get_lang_list ();
|
||||
|
||||
view_as_name = oaf_server_info_prop_lookup (server, name_attribute, langs);
|
||||
|
||||
if (view_as_name == NULL) {
|
||||
view_as_name = oaf_server_info_prop_lookup (server, "name", langs);
|
||||
}
|
||||
|
||||
if (view_as_name == NULL) {
|
||||
view_as_name = server->iid;
|
||||
}
|
||||
|
@ -125,15 +124,15 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char
|
|||
NautilusViewIdentifier *
|
||||
nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server)
|
||||
{
|
||||
return nautilus_view_identifier_new_from_oaf_server_info (server,
|
||||
"nautilus:view_as_name");
|
||||
return nautilus_view_identifier_new_from_oaf_server_info
|
||||
(server, "nautilus:view_as_name");
|
||||
}
|
||||
|
||||
NautilusViewIdentifier *
|
||||
nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server)
|
||||
{
|
||||
return nautilus_view_identifier_new_from_oaf_server_info (server,
|
||||
"nautilus:sidebar_panel_name");
|
||||
return nautilus_view_identifier_new_from_oaf_server_info
|
||||
(server, "nautilus:sidebar_panel_name");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -146,6 +145,19 @@ nautilus_view_identifier_free (NautilusViewIdentifier *identifier)
|
|||
}
|
||||
}
|
||||
|
||||
GList *
|
||||
nautilus_view_identifier_list_copy (GList *list)
|
||||
{
|
||||
GList *copy, *node;
|
||||
|
||||
copy = NULL;
|
||||
for (node = list; node != NULL; node = node->next) {
|
||||
copy = g_list_prepend
|
||||
(copy, nautilus_view_identifier_copy (node->data));
|
||||
}
|
||||
return g_list_reverse (copy);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_view_identifier_free_callback (gpointer identifier, gpointer ignore)
|
||||
{
|
||||
|
@ -154,16 +166,20 @@ nautilus_view_identifier_free_callback (gpointer identifier, gpointer ignore)
|
|||
}
|
||||
|
||||
void
|
||||
nautilus_view_identifier_list_free (GList *identifiers)
|
||||
nautilus_view_identifier_list_free (GList *list)
|
||||
{
|
||||
nautilus_g_list_free_deep_custom
|
||||
(identifiers,
|
||||
nautilus_view_identifier_free_callback,
|
||||
NULL);
|
||||
(list, nautilus_view_identifier_free_callback, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
nautilus_view_identifier_compare (NautilusViewIdentifier *a, NautilusViewIdentifier *b)
|
||||
{
|
||||
return (strcmp (a->iid, b->iid) || strcmp (a->name, b->name));
|
||||
int result;
|
||||
|
||||
result = strcmp (a->iid, b->iid);
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
return strcmp (a->name, b->name);
|
||||
}
|
||||
|
|
|
@ -37,17 +37,18 @@ typedef struct {
|
|||
char *name; /* human-readable name */
|
||||
} NautilusViewIdentifier;
|
||||
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new (const char *iid,
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new (const char *iid,
|
||||
const char *name);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server,
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server,
|
||||
char *name_attribute);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server);
|
||||
NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifier *identifier);
|
||||
|
||||
NautilusViewIdentifier *nautilus_view_identifier_copy (NautilusViewIdentifier *identifier);
|
||||
void nautilus_view_identifier_free (NautilusViewIdentifier *identifier);
|
||||
void nautilus_view_identifier_list_free (GList *identifiers);
|
||||
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
|
||||
int nautilus_view_identifier_compare (NautilusViewIdentifier *a,
|
||||
NautilusViewIdentifier *b);
|
||||
/* lists of NautilusViewIdentifier */
|
||||
GList * nautilus_view_identifier_list_copy (GList *list);
|
||||
void nautilus_view_identifier_list_free (GList *list);
|
||||
|
||||
#endif
|
||||
#endif /* NAUTILUS_VIEW_IDENTIFIER */
|
||||
|
|
|
@ -33,23 +33,17 @@ module Nautilus {
|
|||
*/
|
||||
interface View : ::Bonobo::Unknown {
|
||||
/* Called to tell the view about location changes.
|
||||
* Called again with the same parameter to request a
|
||||
* reload. Not called on the view that reported a
|
||||
* location change with report_location_change, but is
|
||||
* called on all other views, and on all views if
|
||||
* open_location or open_location_in_new_window is
|
||||
* used.
|
||||
* Called again with the same location again to request a
|
||||
* reload.
|
||||
*/
|
||||
oneway void load_location (in URI location);
|
||||
oneway void stop_loading ();
|
||||
|
||||
/* Called to tell the view about selection changes.
|
||||
* It's called on all views except the one that calls
|
||||
* report_selection_change.
|
||||
*/
|
||||
/* Called to tell the view about selection changes. */
|
||||
oneway void selection_changed (in URIList selection);
|
||||
|
||||
oneway void title_changed ();
|
||||
/* Called to tell the view about title changes. */
|
||||
oneway void title_changed (in string title);
|
||||
};
|
||||
|
||||
/* The ViewFrame interface is used by the view to communicate
|
||||
|
|
|
@ -65,6 +65,7 @@ static void impl_Nautilus_View_selection_changed (PortableServer_Servant servan
|
|||
const Nautilus_URIList *selection,
|
||||
CORBA_Environment *ev);
|
||||
static void impl_Nautilus_View_title_changed (PortableServer_Servant servant,
|
||||
const CORBA_char *title,
|
||||
CORBA_Environment *ev);
|
||||
static void nautilus_view_initialize (NautilusView *view);
|
||||
static void nautilus_view_destroy (GtkObject *object);
|
||||
|
@ -167,11 +168,13 @@ impl_Nautilus_View_selection_changed (PortableServer_Servant servant,
|
|||
}
|
||||
|
||||
static void
|
||||
impl_Nautilus_View_title_changed (PortableServer_Servant servant,
|
||||
CORBA_Environment *ev)
|
||||
impl_Nautilus_View_title_changed (PortableServer_Servant servant,
|
||||
const CORBA_char *title,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->bonobo_object),
|
||||
signals[TITLE_CHANGED]);
|
||||
signals[TITLE_CHANGED],
|
||||
title);
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,8 +252,8 @@ nautilus_view_initialize_class (NautilusViewClass *klass)
|
|||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusViewClass, title_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,8 @@ typedef struct {
|
|||
void (*stop_loading) (NautilusView *view);
|
||||
void (*selection_changed) (NautilusView *view,
|
||||
GList *selection); /* list of URI char *s */
|
||||
void (*title_changed) (NautilusView *view);
|
||||
void (*title_changed) (NautilusView *view,
|
||||
const char *title);
|
||||
} NautilusViewClass;
|
||||
|
||||
GtkType nautilus_view_get_type (void);
|
||||
|
|
|
@ -93,7 +93,7 @@ ntl-web-browser \
|
|||
|
||||
if [ "$extreme" = "yes" ]
|
||||
then
|
||||
AUX_PROGS="oafd gconfd gconfd-0.6 gconfd-1 eazel-proxy $AUX_PROGS"
|
||||
AUX_PROGS="oafd gconfd-0.6 gconfd-1 eazel-proxy $AUX_PROGS"
|
||||
fi
|
||||
|
||||
unset FOUND_ANY
|
||||
|
|
|
@ -27,37 +27,31 @@
|
|||
|
||||
#include <config.h>
|
||||
#include "fm-directory-view.h"
|
||||
|
||||
#include "fm-desktop-icon-view.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <gtk/gtksignal.h>
|
||||
#include "fm-properties-window.h"
|
||||
#include "nautilus-trash-monitor.h"
|
||||
#include <bonobo/bonobo-control.h>
|
||||
#include <gtk/gtkcheckmenuitem.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
#include <gtk/gtkcheckmenuitem.h>
|
||||
|
||||
#include <bonobo/bonobo-control.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-async-ops.h>
|
||||
#include <libgnomevfs/gnome-vfs-directory-list.h>
|
||||
#include <libgnomevfs/gnome-vfs-file-info.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
||||
#include <libgnomevfs/gnome-vfs-result.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libgnomevfs/gnome-vfs-result.h>
|
||||
|
||||
#include <libnautilus/nautilus-bonobo-ui.h>
|
||||
#include <libnautilus/nautilus-zoomable.h>
|
||||
|
||||
#include <src/nautilus-application.h>
|
||||
|
||||
#include <libnautilus-extensions/nautilus-background.h>
|
||||
#include <libnautilus-extensions/nautilus-directory.h>
|
||||
#include <libnautilus-extensions/nautilus-directory-background.h>
|
||||
#include <libnautilus-extensions/nautilus-directory.h>
|
||||
#include <libnautilus-extensions/nautilus-drag.h>
|
||||
#include <libnautilus-extensions/nautilus-file-attributes.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-file-operations.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-gnome-extensions.h>
|
||||
|
@ -66,14 +60,15 @@
|
|||
#include <libnautilus-extensions/nautilus-icon-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-link.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-mime-actions.h>
|
||||
#include <libnautilus-extensions/nautilus-program-choosing.h>
|
||||
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-view-identifier.h>
|
||||
#include <libnautilus-extensions/nautilus-mime-actions.h>
|
||||
|
||||
#include "fm-properties-window.h"
|
||||
#include "nautilus-trash-monitor.h"
|
||||
#include <libnautilus/nautilus-bonobo-ui.h>
|
||||
#include <libnautilus/nautilus-zoomable.h>
|
||||
#include <math.h>
|
||||
#include <src/nautilus-application.h>
|
||||
|
||||
#define DISPLAY_TIMEOUT_INTERVAL_MSECS 500
|
||||
#define SILENT_WINDOW_OPEN_LIMIT 10
|
||||
|
@ -271,14 +266,14 @@ fm_directory_view_initialize_class (FMDirectoryViewClass *klass)
|
|||
GTK_TYPE_NONE, 0);
|
||||
signals[CREATE_SELECTION_CONTEXT_MENU_ITEMS] =
|
||||
gtk_signal_new ("create_selection_context_menu_items",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (FMDirectoryViewClass, create_selection_context_menu_items),
|
||||
nautilus_gtk_marshal_NONE__BOXED_BOXED,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_BOXED);
|
||||
signals[CREATE_BACKGROUND_CONTEXT_MENU_ITEMS] =
|
||||
gtk_signal_new ("create_background_context_menu_items",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (FMDirectoryViewClass, create_background_context_menu_items),
|
||||
gtk_marshal_NONE__BOXED,
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtkhseparator.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkradiomenuitem.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
|
|
@ -26,26 +26,22 @@
|
|||
#include "fm-properties-window.h"
|
||||
|
||||
#include "fm-error-reporting.h"
|
||||
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtkentry.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtkhseparator.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#include <gtk/gtkpixmap.h>
|
||||
#include <gtk/gtkscrolledwindow.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
|
||||
#include <libnautilus/nautilus-undo.h>
|
||||
|
||||
#include <libnautilus-extensions/nautilus-entry.h>
|
||||
#include <libnautilus-extensions/nautilus-file-attributes.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
|
@ -54,12 +50,12 @@
|
|||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-icon-factory.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
#include <libnautilus-extensions/nautilus-link.h>
|
||||
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
|
||||
#include <libnautilus-extensions/nautilus-image.h>
|
||||
|
||||
#include <libnautilus/nautilus-undo.h>
|
||||
#include <string.h>
|
||||
|
||||
static GHashTable *windows;
|
||||
|
|
|
@ -77,7 +77,7 @@ nautilus_bookmark_list_initialize_class (NautilusBookmarkListClass *class)
|
|||
|
||||
signals[CONTENTS_CHANGED] =
|
||||
gtk_signal_new ("contents_changed",
|
||||
GTK_RUN_FIRST,
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusBookmarkListClass,
|
||||
contents_changed),
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnomeui/gnome-dock.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
|
@ -50,7 +54,6 @@ struct NautilusComplexSearchBarDetails {
|
|||
GtkWidget *find_them;
|
||||
|
||||
GSList *search_criteria;
|
||||
|
||||
};
|
||||
|
||||
static void real_activate (NautilusNavigationBar *bar);
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#include "nautilus-sidebar-tabs.h"
|
||||
#include "nautilus-sidebar-title.h"
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtkdnd.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-application-registry.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
||||
|
@ -170,14 +173,14 @@ nautilus_sidebar_initialize_class (GtkObjectClass *object_klass)
|
|||
widget_class->size_allocate = nautilus_sidebar_size_allocate;
|
||||
|
||||
/* add the "location changed" signal */
|
||||
signals[LOCATION_CHANGED]
|
||||
= gtk_signal_new ("location_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_klass->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSidebarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
signals[LOCATION_CHANGED] = gtk_signal_new
|
||||
("location_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_klass->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSidebarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
|
||||
gtk_object_class_add_signals (object_klass, signals, LAST_SIGNAL);
|
||||
}
|
||||
|
@ -307,35 +310,35 @@ static gboolean
|
|||
nautilus_sidebar_sidebar_panel_enabled (const char *panel_iid)
|
||||
{
|
||||
gboolean enabled;
|
||||
gchar *key;
|
||||
char *key;
|
||||
|
||||
key = nautilus_sidebar_get_sidebar_panel_key (panel_iid);
|
||||
enabled = nautilus_preferences_get_boolean (key, FALSE);
|
||||
|
||||
g_free (key);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/* callback to handle resetting the background */
|
||||
static void
|
||||
reset_background_callback(GtkWidget *menu_item, GtkWidget *sidebar)
|
||||
reset_background_callback (GtkWidget *menu_item, GtkWidget *sidebar)
|
||||
{
|
||||
NautilusBackground *background;
|
||||
|
||||
background = nautilus_get_widget_background(sidebar);
|
||||
if (background) {
|
||||
nautilus_background_reset(background);
|
||||
if (background != NULL) {
|
||||
nautilus_background_reset (background);
|
||||
}
|
||||
}
|
||||
|
||||
/* callback for sidebar panel menu items to toggle their visibility */
|
||||
static void
|
||||
toggle_sidebar_panel(GtkWidget *widget, char *sidebar_id)
|
||||
toggle_sidebar_panel (GtkWidget *widget, char *sidebar_id)
|
||||
{
|
||||
gchar *key;
|
||||
char *key;
|
||||
|
||||
key = nautilus_sidebar_get_sidebar_panel_key (sidebar_id);
|
||||
nautilus_preferences_set_boolean(key, !nautilus_preferences_get_boolean(key, FALSE));
|
||||
g_free(key);
|
||||
nautilus_preferences_set_boolean (key, !nautilus_preferences_get_boolean (key, FALSE));
|
||||
g_free (key);
|
||||
}
|
||||
|
||||
/* utility routine to add a menu item for each potential sidebar panel */
|
||||
|
@ -367,7 +370,7 @@ nautilus_sidebar_add_panel_items(NautilusSidebar *sidebar, GtkWidget *menu)
|
|||
/* check to see if we've seen this one */
|
||||
if (g_list_find_custom (name_list, id->name, (GCompareFunc) strcmp) == NULL) {
|
||||
name_list = g_list_append (name_list, g_strdup (id->name));
|
||||
|
||||
|
||||
/* add a check menu item */
|
||||
menu_item = gtk_check_menu_item_new_with_label (id->name);
|
||||
enabled = nautilus_sidebar_sidebar_panel_enabled (id->iid);
|
||||
|
|
|
@ -26,28 +26,31 @@
|
|||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <parser.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
|
||||
#include <libnautilus-extensions/nautilus-file.h>
|
||||
#include <libnautilus-extensions/nautilus-link.h>
|
||||
#include <libnautilus-extensions/nautilus-link-set.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-xml-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
#include "nautilus-link-set-window.h"
|
||||
|
||||
#include "nautilus-window.h"
|
||||
#include "nautilus-link-set-window.h"
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkscrolledwindow.h>
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libnautilus-extensions/nautilus-file.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-link-set.h>
|
||||
#include <libnautilus-extensions/nautilus-link.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-xml-extensions.h>
|
||||
#include <parser.h>
|
||||
#include <stdlib.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
/* global to hold the currently allocated link set window, if any */
|
||||
|
||||
|
|
|
@ -58,23 +58,23 @@ nautilus_navigation_bar_initialize_class (NautilusNavigationBarClass *klass)
|
|||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
|
||||
signals[ACTIVATE]
|
||||
= gtk_signal_new ("activate",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusNavigationBarClass,
|
||||
activate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
signals[ACTIVATE] = gtk_signal_new
|
||||
("activate",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusNavigationBarClass,
|
||||
activate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
signals[LOCATION_CHANGED]
|
||||
= gtk_signal_new ("location_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusNavigationBarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
signals[LOCATION_CHANGED] = gtk_signal_new
|
||||
("location_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusNavigationBarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
|
||||
|
|
|
@ -82,8 +82,7 @@
|
|||
enum {
|
||||
ARG_0,
|
||||
ARG_APP_ID,
|
||||
ARG_APP,
|
||||
ARG_CONTENT_VIEW
|
||||
ARG_APP
|
||||
};
|
||||
|
||||
/* Other static variables */
|
||||
|
@ -101,8 +100,7 @@ static void nautilus_window_get_arg (GtkObject *object
|
|||
static void nautilus_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void nautilus_window_realize (GtkWidget *widget);
|
||||
static void nautilus_window_real_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view);
|
||||
static void update_sidebar_panels_from_preferences (NautilusWindow *window);
|
||||
static void sidebar_panels_changed_callback (gpointer user_data);
|
||||
static void nautilus_window_show (GtkWidget *widget);
|
||||
|
||||
|
@ -116,28 +114,23 @@ nautilus_window_initialize_class (NautilusWindowClass *klass)
|
|||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
parent_class = gtk_type_class(gnome_app_get_type());
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
object_class = (GtkObjectClass *) klass;
|
||||
widget_class = (GtkWidgetClass *) klass;
|
||||
|
||||
object_class->destroy = nautilus_window_destroy;
|
||||
object_class->get_arg = nautilus_window_get_arg;
|
||||
object_class->set_arg = nautilus_window_set_arg;
|
||||
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
widget_class->show = nautilus_window_show;
|
||||
|
||||
gtk_object_add_arg_type ("NautilusWindow::app_id",
|
||||
GTK_TYPE_STRING,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP_ID);
|
||||
gtk_object_add_arg_type ("NautilusWindow::app",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP);
|
||||
gtk_object_add_arg_type ("NautilusWindow::content_view",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_CONTENT_VIEW);
|
||||
|
||||
widget_class->realize = nautilus_window_realize;
|
||||
widget_class->size_request = nautilus_window_size_request;
|
||||
|
@ -160,31 +153,33 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_window_clear_status(NautilusWindow *window)
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_status(NautilusWindow *window, const char *txt)
|
||||
nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
||||
{
|
||||
if(window->status_bar_clear_id)
|
||||
g_source_remove(window->status_bar_clear_id);
|
||||
if (window->status_bar_clear_id != 0) {
|
||||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
if(txt && *txt) {
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
} else
|
||||
window->status_bar_clear_id = 0;
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
|
||||
{
|
||||
nautilus_window_open_location (window, uri, NULL);
|
||||
nautilus_window_open_location (window, uri);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -214,7 +209,6 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_zoom_in (NautilusWindow *window)
|
||||
{
|
||||
|
@ -451,6 +445,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* Set up undo manager */
|
||||
nautilus_undo_manager_attach (window->application->undo_manager, GTK_OBJECT (window));
|
||||
|
||||
/* Set up the sidebar panels. */
|
||||
update_sidebar_panels_from_preferences (window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -480,9 +477,6 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,9 +494,6 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -681,34 +672,6 @@ nautilus_window_size_request (GtkWidget *widget,
|
|||
* Main API
|
||||
*/
|
||||
|
||||
static void
|
||||
nautilus_window_switch_views (NautilusWindow *window, NautilusViewIdentifier *id)
|
||||
{
|
||||
NautilusDirectory *directory;
|
||||
NautilusFile *file;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (window->location != NULL);
|
||||
g_return_if_fail (id != NULL);
|
||||
|
||||
directory = nautilus_directory_get (window->location);
|
||||
file = nautilus_file_get (window->location);
|
||||
g_assert (directory != NULL);
|
||||
nautilus_mime_set_default_component_for_uri
|
||||
(directory, file, id->iid);
|
||||
nautilus_directory_unref (directory);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
nautilus_window_allow_stop (window, TRUE);
|
||||
|
||||
view = nautilus_window_load_content_view (window, id);
|
||||
nautilus_window_set_state_info
|
||||
(window,
|
||||
(NautilusWindowStateItem) NEW_CONTENT_VIEW_ACTIVATED, view,
|
||||
(NautilusWindowStateItem) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
|
@ -721,7 +684,7 @@ view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
|||
window = NAUTILUS_WINDOW (gtk_object_get_data (GTK_OBJECT (widget), "window"));
|
||||
identifier = (NautilusViewIdentifier *) gtk_object_get_data (GTK_OBJECT (widget), "identifier");
|
||||
|
||||
nautilus_window_switch_views (window, identifier);
|
||||
nautilus_window_set_content_view (window, identifier);
|
||||
}
|
||||
|
||||
/* Note: The identifier parameter ownership is handed off to the menu item. */
|
||||
|
@ -735,11 +698,10 @@ create_content_view_menu_item (NautilusWindow *window, NautilusViewIdentifier *i
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC (view_menu_switch_views_callback),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
view_menu_switch_views_callback,
|
||||
NULL);
|
||||
|
||||
/* Store copy of iid in item; free when item destroyed. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
||||
|
@ -858,7 +820,7 @@ chose_component_callback (NautilusViewIdentifier *identifier, gpointer callback_
|
|||
|
||||
if (identifier != NULL) {
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
||||
nautilus_window_switch_views (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
nautilus_window_set_content_view (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com 1334:
|
||||
|
@ -1008,13 +970,6 @@ nautilus_window_load_content_view_menu (NautilusWindow *window)
|
|||
nautilus_window_synch_content_view_menu (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view)
|
||||
{
|
||||
nautilus_window_real_set_content_view (window, content_view);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel)
|
||||
|
@ -1319,7 +1274,7 @@ nautilus_window_open_location_callback (NautilusViewFrame *view,
|
|||
const char *location,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location (window, location, view);
|
||||
nautilus_window_open_location (window, location);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1328,7 +1283,7 @@ nautilus_window_open_location_in_new_window_callback (NautilusViewFrame *view,
|
|||
GList *selection,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location_in_new_window (window, location, selection, view);
|
||||
nautilus_window_open_location_in_new_window (window, location, selection);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1354,14 +1309,6 @@ nautilus_window_report_load_underway_callback (NautilusViewFrame *view,
|
|||
nautilus_window_report_load_underway (window, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_progress_callback (NautilusViewFrame *view,
|
||||
double fraction_done,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_report_load_progress (window, fraction_done, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_complete_callback (NautilusViewFrame *view,
|
||||
NautilusWindow *window)
|
||||
|
@ -1470,7 +1417,6 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
|
|||
CONNECT (report_selection_change);
|
||||
CONNECT (report_status);
|
||||
CONNECT (report_load_underway);
|
||||
CONNECT (report_load_progress);
|
||||
CONNECT (report_load_complete);
|
||||
CONNECT (report_load_failed);
|
||||
CONNECT (title_changed);
|
||||
|
@ -1526,8 +1472,9 @@ nautilus_window_display_error(NautilusWindow *window, const char *error_msg)
|
|||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame *new_view)
|
||||
void
|
||||
nautilus_window_set_content_view_widget (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (new_view == NULL || NAUTILUS_IS_VIEW_FRAME (new_view));
|
||||
|
@ -1579,44 +1526,7 @@ nautilus_window_reload (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/**
|
||||
* window_find_sidebar_panel_by_identifier:
|
||||
* @window: A NautilusWindow
|
||||
* @identifier: The NautilusViewIdentifier to look for
|
||||
*
|
||||
* Search the list of sidebar panels in the given window for one that
|
||||
* matches the given view identifier.
|
||||
*
|
||||
* Returns a referenced object, not a floating one. bonobo_object_unref
|
||||
* it when done playing with it.
|
||||
*/
|
||||
static NautilusViewFrame *
|
||||
window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIdentifier *identifier)
|
||||
{
|
||||
GList *iterator;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (identifier != NULL);
|
||||
|
||||
for (iterator = window->sidebar_panels; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
g_assert (NAUTILUS_IS_VIEW_FRAME (iterator->data));
|
||||
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (iterator->data);
|
||||
|
||||
if (strcmp (sidebar_panel->iid, identifier->iid) == 0) {
|
||||
gtk_widget_ref (GTK_WIDGET (sidebar_panel));
|
||||
return sidebar_panel;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* window_update_sidebar_panels_from_preferences:
|
||||
* update_sidebar_panels_from_preferences:
|
||||
* @window: A NautilusWindow
|
||||
*
|
||||
* Update the current list of sidebar panels from preferences.
|
||||
|
@ -1627,82 +1537,16 @@ window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIde
|
|||
*
|
||||
*/
|
||||
static void
|
||||
window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
{
|
||||
GList *enabled_view_identifier_list = NULL;
|
||||
GList *disabled_view_identifier_list = NULL;
|
||||
GList *iterator = NULL;
|
||||
GList *identifier_list;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
/* Obtain list of disabled view identifiers */
|
||||
disabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Remove disabled panels from the window as needed */
|
||||
for (iterator = disabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel != NULL) {
|
||||
nautilus_window_disconnect_view (window, sidebar_panel);
|
||||
nautilus_window_remove_sidebar_panel (window, sidebar_panel);
|
||||
}
|
||||
}
|
||||
|
||||
if (disabled_view_identifier_list) {
|
||||
nautilus_view_identifier_list_free (disabled_view_identifier_list);
|
||||
}
|
||||
|
||||
/* Obtain list of enabled view identifiers */
|
||||
enabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Add enabled panels from the window as needed */
|
||||
for (iterator = enabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel == NULL) {
|
||||
gboolean load_result;
|
||||
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
|
||||
load_result = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
||||
/* Make sure the load_client succeeded */
|
||||
if (load_result) {
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_add_sidebar_panel (window, sidebar_panel);
|
||||
} else {
|
||||
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
|
||||
identifier->iid);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
|
||||
sidebar_panel = NULL;
|
||||
}
|
||||
} else {
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifier_list);
|
||||
identifier_list = nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
nautilus_window_set_sidebar_panels (window, identifier_list);
|
||||
nautilus_view_identifier_list_free (identifier_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1715,7 +1559,7 @@ window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
|||
static void
|
||||
sidebar_panels_changed_callback (gpointer user_data)
|
||||
{
|
||||
window_update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1768,7 +1612,6 @@ nautilus_window_hide_location_bar (NautilusWindow *window)
|
|||
hide_dock_item (window, URI_ENTRY_DOCK_ITEM);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_show_location_bar (NautilusWindow *window)
|
||||
{
|
||||
|
@ -1861,7 +1704,8 @@ nautilus_window_status_bar_showing (NautilusWindow *window)
|
|||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return (app->statusbar != NULL && GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent));
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
/*
|
||||
* Nautilus
|
||||
|
@ -50,106 +50,97 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
GnomeAppClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
||||
typedef enum {
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
} NautilusLocationChangeType;
|
||||
|
||||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *new_sidebar_panels;
|
||||
GList *error_views;
|
||||
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
nautilus_boolean_bit changes_pending : 1;
|
||||
nautilus_boolean_bit views_shown : 1;
|
||||
nautilus_boolean_bit view_bombed_out : 1;
|
||||
nautilus_boolean_bit view_activation_complete : 1;
|
||||
nautilus_boolean_bit sent_update_view : 1;
|
||||
nautilus_boolean_bit cv_progress_initial : 1;
|
||||
nautilus_boolean_bit cv_progress_done : 1;
|
||||
nautilus_boolean_bit cv_progress_error : 1;
|
||||
nautilus_boolean_bit reset_to_idle : 1;
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *error_views;
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
gboolean views_shown;
|
||||
gboolean view_bombed_out;
|
||||
gboolean view_activation_complete;
|
||||
gboolean sent_update_view;
|
||||
gboolean cv_progress_initial;
|
||||
gboolean cv_progress_done;
|
||||
gboolean cv_progress_error;
|
||||
gboolean reset_to_idle;
|
||||
};
|
||||
|
||||
GtkType nautilus_window_get_type (void);
|
||||
void nautilus_window_close (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view);
|
||||
void nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_remove_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_goto_uri (NautilusWindow *window,
|
||||
const char *uri);
|
||||
gboolean nautilus_window_get_search_mode (NautilusWindow *window);
|
||||
|
|
|
@ -82,8 +82,7 @@
|
|||
enum {
|
||||
ARG_0,
|
||||
ARG_APP_ID,
|
||||
ARG_APP,
|
||||
ARG_CONTENT_VIEW
|
||||
ARG_APP
|
||||
};
|
||||
|
||||
/* Other static variables */
|
||||
|
@ -101,8 +100,7 @@ static void nautilus_window_get_arg (GtkObject *object
|
|||
static void nautilus_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void nautilus_window_realize (GtkWidget *widget);
|
||||
static void nautilus_window_real_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view);
|
||||
static void update_sidebar_panels_from_preferences (NautilusWindow *window);
|
||||
static void sidebar_panels_changed_callback (gpointer user_data);
|
||||
static void nautilus_window_show (GtkWidget *widget);
|
||||
|
||||
|
@ -116,28 +114,23 @@ nautilus_window_initialize_class (NautilusWindowClass *klass)
|
|||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
parent_class = gtk_type_class(gnome_app_get_type());
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
object_class = (GtkObjectClass *) klass;
|
||||
widget_class = (GtkWidgetClass *) klass;
|
||||
|
||||
object_class->destroy = nautilus_window_destroy;
|
||||
object_class->get_arg = nautilus_window_get_arg;
|
||||
object_class->set_arg = nautilus_window_set_arg;
|
||||
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
widget_class->show = nautilus_window_show;
|
||||
|
||||
gtk_object_add_arg_type ("NautilusWindow::app_id",
|
||||
GTK_TYPE_STRING,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP_ID);
|
||||
gtk_object_add_arg_type ("NautilusWindow::app",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP);
|
||||
gtk_object_add_arg_type ("NautilusWindow::content_view",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_CONTENT_VIEW);
|
||||
|
||||
widget_class->realize = nautilus_window_realize;
|
||||
widget_class->size_request = nautilus_window_size_request;
|
||||
|
@ -160,31 +153,33 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_window_clear_status(NautilusWindow *window)
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_status(NautilusWindow *window, const char *txt)
|
||||
nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
||||
{
|
||||
if(window->status_bar_clear_id)
|
||||
g_source_remove(window->status_bar_clear_id);
|
||||
if (window->status_bar_clear_id != 0) {
|
||||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
if(txt && *txt) {
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
} else
|
||||
window->status_bar_clear_id = 0;
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
|
||||
{
|
||||
nautilus_window_open_location (window, uri, NULL);
|
||||
nautilus_window_open_location (window, uri);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -214,7 +209,6 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_zoom_in (NautilusWindow *window)
|
||||
{
|
||||
|
@ -451,6 +445,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* Set up undo manager */
|
||||
nautilus_undo_manager_attach (window->application->undo_manager, GTK_OBJECT (window));
|
||||
|
||||
/* Set up the sidebar panels. */
|
||||
update_sidebar_panels_from_preferences (window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -480,9 +477,6 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,9 +494,6 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -681,34 +672,6 @@ nautilus_window_size_request (GtkWidget *widget,
|
|||
* Main API
|
||||
*/
|
||||
|
||||
static void
|
||||
nautilus_window_switch_views (NautilusWindow *window, NautilusViewIdentifier *id)
|
||||
{
|
||||
NautilusDirectory *directory;
|
||||
NautilusFile *file;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (window->location != NULL);
|
||||
g_return_if_fail (id != NULL);
|
||||
|
||||
directory = nautilus_directory_get (window->location);
|
||||
file = nautilus_file_get (window->location);
|
||||
g_assert (directory != NULL);
|
||||
nautilus_mime_set_default_component_for_uri
|
||||
(directory, file, id->iid);
|
||||
nautilus_directory_unref (directory);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
nautilus_window_allow_stop (window, TRUE);
|
||||
|
||||
view = nautilus_window_load_content_view (window, id);
|
||||
nautilus_window_set_state_info
|
||||
(window,
|
||||
(NautilusWindowStateItem) NEW_CONTENT_VIEW_ACTIVATED, view,
|
||||
(NautilusWindowStateItem) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
|
@ -721,7 +684,7 @@ view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
|||
window = NAUTILUS_WINDOW (gtk_object_get_data (GTK_OBJECT (widget), "window"));
|
||||
identifier = (NautilusViewIdentifier *) gtk_object_get_data (GTK_OBJECT (widget), "identifier");
|
||||
|
||||
nautilus_window_switch_views (window, identifier);
|
||||
nautilus_window_set_content_view (window, identifier);
|
||||
}
|
||||
|
||||
/* Note: The identifier parameter ownership is handed off to the menu item. */
|
||||
|
@ -735,11 +698,10 @@ create_content_view_menu_item (NautilusWindow *window, NautilusViewIdentifier *i
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC (view_menu_switch_views_callback),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
view_menu_switch_views_callback,
|
||||
NULL);
|
||||
|
||||
/* Store copy of iid in item; free when item destroyed. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
||||
|
@ -858,7 +820,7 @@ chose_component_callback (NautilusViewIdentifier *identifier, gpointer callback_
|
|||
|
||||
if (identifier != NULL) {
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
||||
nautilus_window_switch_views (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
nautilus_window_set_content_view (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com 1334:
|
||||
|
@ -1008,13 +970,6 @@ nautilus_window_load_content_view_menu (NautilusWindow *window)
|
|||
nautilus_window_synch_content_view_menu (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view)
|
||||
{
|
||||
nautilus_window_real_set_content_view (window, content_view);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel)
|
||||
|
@ -1319,7 +1274,7 @@ nautilus_window_open_location_callback (NautilusViewFrame *view,
|
|||
const char *location,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location (window, location, view);
|
||||
nautilus_window_open_location (window, location);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1328,7 +1283,7 @@ nautilus_window_open_location_in_new_window_callback (NautilusViewFrame *view,
|
|||
GList *selection,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location_in_new_window (window, location, selection, view);
|
||||
nautilus_window_open_location_in_new_window (window, location, selection);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1354,14 +1309,6 @@ nautilus_window_report_load_underway_callback (NautilusViewFrame *view,
|
|||
nautilus_window_report_load_underway (window, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_progress_callback (NautilusViewFrame *view,
|
||||
double fraction_done,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_report_load_progress (window, fraction_done, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_complete_callback (NautilusViewFrame *view,
|
||||
NautilusWindow *window)
|
||||
|
@ -1470,7 +1417,6 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
|
|||
CONNECT (report_selection_change);
|
||||
CONNECT (report_status);
|
||||
CONNECT (report_load_underway);
|
||||
CONNECT (report_load_progress);
|
||||
CONNECT (report_load_complete);
|
||||
CONNECT (report_load_failed);
|
||||
CONNECT (title_changed);
|
||||
|
@ -1526,8 +1472,9 @@ nautilus_window_display_error(NautilusWindow *window, const char *error_msg)
|
|||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame *new_view)
|
||||
void
|
||||
nautilus_window_set_content_view_widget (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (new_view == NULL || NAUTILUS_IS_VIEW_FRAME (new_view));
|
||||
|
@ -1579,44 +1526,7 @@ nautilus_window_reload (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/**
|
||||
* window_find_sidebar_panel_by_identifier:
|
||||
* @window: A NautilusWindow
|
||||
* @identifier: The NautilusViewIdentifier to look for
|
||||
*
|
||||
* Search the list of sidebar panels in the given window for one that
|
||||
* matches the given view identifier.
|
||||
*
|
||||
* Returns a referenced object, not a floating one. bonobo_object_unref
|
||||
* it when done playing with it.
|
||||
*/
|
||||
static NautilusViewFrame *
|
||||
window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIdentifier *identifier)
|
||||
{
|
||||
GList *iterator;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (identifier != NULL);
|
||||
|
||||
for (iterator = window->sidebar_panels; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
g_assert (NAUTILUS_IS_VIEW_FRAME (iterator->data));
|
||||
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (iterator->data);
|
||||
|
||||
if (strcmp (sidebar_panel->iid, identifier->iid) == 0) {
|
||||
gtk_widget_ref (GTK_WIDGET (sidebar_panel));
|
||||
return sidebar_panel;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* window_update_sidebar_panels_from_preferences:
|
||||
* update_sidebar_panels_from_preferences:
|
||||
* @window: A NautilusWindow
|
||||
*
|
||||
* Update the current list of sidebar panels from preferences.
|
||||
|
@ -1627,82 +1537,16 @@ window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIde
|
|||
*
|
||||
*/
|
||||
static void
|
||||
window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
{
|
||||
GList *enabled_view_identifier_list = NULL;
|
||||
GList *disabled_view_identifier_list = NULL;
|
||||
GList *iterator = NULL;
|
||||
GList *identifier_list;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
/* Obtain list of disabled view identifiers */
|
||||
disabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Remove disabled panels from the window as needed */
|
||||
for (iterator = disabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel != NULL) {
|
||||
nautilus_window_disconnect_view (window, sidebar_panel);
|
||||
nautilus_window_remove_sidebar_panel (window, sidebar_panel);
|
||||
}
|
||||
}
|
||||
|
||||
if (disabled_view_identifier_list) {
|
||||
nautilus_view_identifier_list_free (disabled_view_identifier_list);
|
||||
}
|
||||
|
||||
/* Obtain list of enabled view identifiers */
|
||||
enabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Add enabled panels from the window as needed */
|
||||
for (iterator = enabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel == NULL) {
|
||||
gboolean load_result;
|
||||
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
|
||||
load_result = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
||||
/* Make sure the load_client succeeded */
|
||||
if (load_result) {
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_add_sidebar_panel (window, sidebar_panel);
|
||||
} else {
|
||||
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
|
||||
identifier->iid);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
|
||||
sidebar_panel = NULL;
|
||||
}
|
||||
} else {
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifier_list);
|
||||
identifier_list = nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
nautilus_window_set_sidebar_panels (window, identifier_list);
|
||||
nautilus_view_identifier_list_free (identifier_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1715,7 +1559,7 @@ window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
|||
static void
|
||||
sidebar_panels_changed_callback (gpointer user_data)
|
||||
{
|
||||
window_update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1768,7 +1612,6 @@ nautilus_window_hide_location_bar (NautilusWindow *window)
|
|||
hide_dock_item (window, URI_ENTRY_DOCK_ITEM);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_show_location_bar (NautilusWindow *window)
|
||||
{
|
||||
|
@ -1861,7 +1704,8 @@ nautilus_window_status_bar_showing (NautilusWindow *window)
|
|||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return (app->statusbar != NULL && GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent));
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
/*
|
||||
* Nautilus
|
||||
|
@ -50,106 +50,97 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
GnomeAppClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
||||
typedef enum {
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
} NautilusLocationChangeType;
|
||||
|
||||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *new_sidebar_panels;
|
||||
GList *error_views;
|
||||
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
nautilus_boolean_bit changes_pending : 1;
|
||||
nautilus_boolean_bit views_shown : 1;
|
||||
nautilus_boolean_bit view_bombed_out : 1;
|
||||
nautilus_boolean_bit view_activation_complete : 1;
|
||||
nautilus_boolean_bit sent_update_view : 1;
|
||||
nautilus_boolean_bit cv_progress_initial : 1;
|
||||
nautilus_boolean_bit cv_progress_done : 1;
|
||||
nautilus_boolean_bit cv_progress_error : 1;
|
||||
nautilus_boolean_bit reset_to_idle : 1;
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *error_views;
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
gboolean views_shown;
|
||||
gboolean view_bombed_out;
|
||||
gboolean view_activation_complete;
|
||||
gboolean sent_update_view;
|
||||
gboolean cv_progress_initial;
|
||||
gboolean cv_progress_done;
|
||||
gboolean cv_progress_error;
|
||||
gboolean reset_to_idle;
|
||||
};
|
||||
|
||||
GtkType nautilus_window_get_type (void);
|
||||
void nautilus_window_close (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view);
|
||||
void nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_remove_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_goto_uri (NautilusWindow *window,
|
||||
const char *uri);
|
||||
gboolean nautilus_window_get_search_mode (NautilusWindow *window);
|
||||
|
|
|
@ -60,7 +60,7 @@ enum {
|
|||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint nautilus_search_bar_criterion_signals[LAST_SIGNAL];
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static char * criteria_titles [] = {
|
||||
N_("Name"),
|
||||
|
@ -191,15 +191,15 @@ nautilus_search_bar_criterion_initialize_class (NautilusSearchBarCriterionClass
|
|||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
object_class->destroy = nautilus_search_bar_criterion_destroy;
|
||||
|
||||
nautilus_search_bar_criterion_signals[CRITERION_TYPE_CHANGED] =
|
||||
gtk_signal_new ("criterion_type_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
0,
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
signals[CRITERION_TYPE_CHANGED] = gtk_signal_new
|
||||
("criterion_type_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
0,
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, nautilus_search_bar_criterion_signals, LAST_SIGNAL);
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -894,7 +894,7 @@ criterion_type_changed_callback (GtkObject *object,
|
|||
gtk_object_set_data (GTK_OBJECT (criterion), "type",
|
||||
gtk_object_get_data (GTK_OBJECT (menu_item), "type"));
|
||||
gtk_signal_emit (GTK_OBJECT (criterion),
|
||||
nautilus_search_bar_criterion_signals[CRITERION_TYPE_CHANGED]);
|
||||
signals[CRITERION_TYPE_CHANGED]);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#include "nautilus-sidebar-tabs.h"
|
||||
#include "nautilus-sidebar-title.h"
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtkdnd.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-application-registry.h>
|
||||
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
||||
|
@ -170,14 +173,14 @@ nautilus_sidebar_initialize_class (GtkObjectClass *object_klass)
|
|||
widget_class->size_allocate = nautilus_sidebar_size_allocate;
|
||||
|
||||
/* add the "location changed" signal */
|
||||
signals[LOCATION_CHANGED]
|
||||
= gtk_signal_new ("location_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_klass->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSidebarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
signals[LOCATION_CHANGED] = gtk_signal_new
|
||||
("location_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_klass->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSidebarClass,
|
||||
location_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
|
||||
|
||||
gtk_object_class_add_signals (object_klass, signals, LAST_SIGNAL);
|
||||
}
|
||||
|
@ -307,35 +310,35 @@ static gboolean
|
|||
nautilus_sidebar_sidebar_panel_enabled (const char *panel_iid)
|
||||
{
|
||||
gboolean enabled;
|
||||
gchar *key;
|
||||
char *key;
|
||||
|
||||
key = nautilus_sidebar_get_sidebar_panel_key (panel_iid);
|
||||
enabled = nautilus_preferences_get_boolean (key, FALSE);
|
||||
|
||||
g_free (key);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/* callback to handle resetting the background */
|
||||
static void
|
||||
reset_background_callback(GtkWidget *menu_item, GtkWidget *sidebar)
|
||||
reset_background_callback (GtkWidget *menu_item, GtkWidget *sidebar)
|
||||
{
|
||||
NautilusBackground *background;
|
||||
|
||||
background = nautilus_get_widget_background(sidebar);
|
||||
if (background) {
|
||||
nautilus_background_reset(background);
|
||||
if (background != NULL) {
|
||||
nautilus_background_reset (background);
|
||||
}
|
||||
}
|
||||
|
||||
/* callback for sidebar panel menu items to toggle their visibility */
|
||||
static void
|
||||
toggle_sidebar_panel(GtkWidget *widget, char *sidebar_id)
|
||||
toggle_sidebar_panel (GtkWidget *widget, char *sidebar_id)
|
||||
{
|
||||
gchar *key;
|
||||
char *key;
|
||||
|
||||
key = nautilus_sidebar_get_sidebar_panel_key (sidebar_id);
|
||||
nautilus_preferences_set_boolean(key, !nautilus_preferences_get_boolean(key, FALSE));
|
||||
g_free(key);
|
||||
nautilus_preferences_set_boolean (key, !nautilus_preferences_get_boolean (key, FALSE));
|
||||
g_free (key);
|
||||
}
|
||||
|
||||
/* utility routine to add a menu item for each potential sidebar panel */
|
||||
|
@ -367,7 +370,7 @@ nautilus_sidebar_add_panel_items(NautilusSidebar *sidebar, GtkWidget *menu)
|
|||
/* check to see if we've seen this one */
|
||||
if (g_list_find_custom (name_list, id->name, (GCompareFunc) strcmp) == NULL) {
|
||||
name_list = g_list_append (name_list, g_strdup (id->name));
|
||||
|
||||
|
||||
/* add a check menu item */
|
||||
menu_item = gtk_check_menu_item_new_with_label (id->name);
|
||||
enabled = nautilus_sidebar_sidebar_panel_enabled (id->iid);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "nautilus-simple-search-bar.h"
|
||||
|
||||
#include "nautilus-search-bar-criterion.h"
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-entry.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
|
@ -36,6 +37,7 @@
|
|||
#include <libnautilus-extensions/nautilus-search-uri.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct NautilusSimpleSearchBarDetails {
|
||||
NautilusEntry *entry;
|
||||
|
|
|
@ -82,8 +82,7 @@
|
|||
enum {
|
||||
ARG_0,
|
||||
ARG_APP_ID,
|
||||
ARG_APP,
|
||||
ARG_CONTENT_VIEW
|
||||
ARG_APP
|
||||
};
|
||||
|
||||
/* Other static variables */
|
||||
|
@ -101,8 +100,7 @@ static void nautilus_window_get_arg (GtkObject *object
|
|||
static void nautilus_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void nautilus_window_realize (GtkWidget *widget);
|
||||
static void nautilus_window_real_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view);
|
||||
static void update_sidebar_panels_from_preferences (NautilusWindow *window);
|
||||
static void sidebar_panels_changed_callback (gpointer user_data);
|
||||
static void nautilus_window_show (GtkWidget *widget);
|
||||
|
||||
|
@ -116,28 +114,23 @@ nautilus_window_initialize_class (NautilusWindowClass *klass)
|
|||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
parent_class = gtk_type_class(gnome_app_get_type());
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
object_class = (GtkObjectClass *) klass;
|
||||
widget_class = (GtkWidgetClass *) klass;
|
||||
|
||||
object_class->destroy = nautilus_window_destroy;
|
||||
object_class->get_arg = nautilus_window_get_arg;
|
||||
object_class->set_arg = nautilus_window_set_arg;
|
||||
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
widget_class->show = nautilus_window_show;
|
||||
|
||||
gtk_object_add_arg_type ("NautilusWindow::app_id",
|
||||
GTK_TYPE_STRING,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP_ID);
|
||||
gtk_object_add_arg_type ("NautilusWindow::app",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP);
|
||||
gtk_object_add_arg_type ("NautilusWindow::content_view",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_CONTENT_VIEW);
|
||||
|
||||
widget_class->realize = nautilus_window_realize;
|
||||
widget_class->size_request = nautilus_window_size_request;
|
||||
|
@ -160,31 +153,33 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_window_clear_status(NautilusWindow *window)
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_status(NautilusWindow *window, const char *txt)
|
||||
nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
||||
{
|
||||
if(window->status_bar_clear_id)
|
||||
g_source_remove(window->status_bar_clear_id);
|
||||
if (window->status_bar_clear_id != 0) {
|
||||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
if(txt && *txt) {
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
} else
|
||||
window->status_bar_clear_id = 0;
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
|
||||
{
|
||||
nautilus_window_open_location (window, uri, NULL);
|
||||
nautilus_window_open_location (window, uri);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -214,7 +209,6 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_zoom_in (NautilusWindow *window)
|
||||
{
|
||||
|
@ -451,6 +445,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* Set up undo manager */
|
||||
nautilus_undo_manager_attach (window->application->undo_manager, GTK_OBJECT (window));
|
||||
|
||||
/* Set up the sidebar panels. */
|
||||
update_sidebar_panels_from_preferences (window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -480,9 +477,6 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,9 +494,6 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -681,34 +672,6 @@ nautilus_window_size_request (GtkWidget *widget,
|
|||
* Main API
|
||||
*/
|
||||
|
||||
static void
|
||||
nautilus_window_switch_views (NautilusWindow *window, NautilusViewIdentifier *id)
|
||||
{
|
||||
NautilusDirectory *directory;
|
||||
NautilusFile *file;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (window->location != NULL);
|
||||
g_return_if_fail (id != NULL);
|
||||
|
||||
directory = nautilus_directory_get (window->location);
|
||||
file = nautilus_file_get (window->location);
|
||||
g_assert (directory != NULL);
|
||||
nautilus_mime_set_default_component_for_uri
|
||||
(directory, file, id->iid);
|
||||
nautilus_directory_unref (directory);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
nautilus_window_allow_stop (window, TRUE);
|
||||
|
||||
view = nautilus_window_load_content_view (window, id);
|
||||
nautilus_window_set_state_info
|
||||
(window,
|
||||
(NautilusWindowStateItem) NEW_CONTENT_VIEW_ACTIVATED, view,
|
||||
(NautilusWindowStateItem) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
|
@ -721,7 +684,7 @@ view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
|||
window = NAUTILUS_WINDOW (gtk_object_get_data (GTK_OBJECT (widget), "window"));
|
||||
identifier = (NautilusViewIdentifier *) gtk_object_get_data (GTK_OBJECT (widget), "identifier");
|
||||
|
||||
nautilus_window_switch_views (window, identifier);
|
||||
nautilus_window_set_content_view (window, identifier);
|
||||
}
|
||||
|
||||
/* Note: The identifier parameter ownership is handed off to the menu item. */
|
||||
|
@ -735,11 +698,10 @@ create_content_view_menu_item (NautilusWindow *window, NautilusViewIdentifier *i
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC (view_menu_switch_views_callback),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
view_menu_switch_views_callback,
|
||||
NULL);
|
||||
|
||||
/* Store copy of iid in item; free when item destroyed. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
||||
|
@ -858,7 +820,7 @@ chose_component_callback (NautilusViewIdentifier *identifier, gpointer callback_
|
|||
|
||||
if (identifier != NULL) {
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
||||
nautilus_window_switch_views (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
nautilus_window_set_content_view (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com 1334:
|
||||
|
@ -1008,13 +970,6 @@ nautilus_window_load_content_view_menu (NautilusWindow *window)
|
|||
nautilus_window_synch_content_view_menu (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view)
|
||||
{
|
||||
nautilus_window_real_set_content_view (window, content_view);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel)
|
||||
|
@ -1319,7 +1274,7 @@ nautilus_window_open_location_callback (NautilusViewFrame *view,
|
|||
const char *location,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location (window, location, view);
|
||||
nautilus_window_open_location (window, location);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1328,7 +1283,7 @@ nautilus_window_open_location_in_new_window_callback (NautilusViewFrame *view,
|
|||
GList *selection,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location_in_new_window (window, location, selection, view);
|
||||
nautilus_window_open_location_in_new_window (window, location, selection);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1354,14 +1309,6 @@ nautilus_window_report_load_underway_callback (NautilusViewFrame *view,
|
|||
nautilus_window_report_load_underway (window, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_progress_callback (NautilusViewFrame *view,
|
||||
double fraction_done,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_report_load_progress (window, fraction_done, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_complete_callback (NautilusViewFrame *view,
|
||||
NautilusWindow *window)
|
||||
|
@ -1470,7 +1417,6 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
|
|||
CONNECT (report_selection_change);
|
||||
CONNECT (report_status);
|
||||
CONNECT (report_load_underway);
|
||||
CONNECT (report_load_progress);
|
||||
CONNECT (report_load_complete);
|
||||
CONNECT (report_load_failed);
|
||||
CONNECT (title_changed);
|
||||
|
@ -1526,8 +1472,9 @@ nautilus_window_display_error(NautilusWindow *window, const char *error_msg)
|
|||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame *new_view)
|
||||
void
|
||||
nautilus_window_set_content_view_widget (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (new_view == NULL || NAUTILUS_IS_VIEW_FRAME (new_view));
|
||||
|
@ -1579,44 +1526,7 @@ nautilus_window_reload (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/**
|
||||
* window_find_sidebar_panel_by_identifier:
|
||||
* @window: A NautilusWindow
|
||||
* @identifier: The NautilusViewIdentifier to look for
|
||||
*
|
||||
* Search the list of sidebar panels in the given window for one that
|
||||
* matches the given view identifier.
|
||||
*
|
||||
* Returns a referenced object, not a floating one. bonobo_object_unref
|
||||
* it when done playing with it.
|
||||
*/
|
||||
static NautilusViewFrame *
|
||||
window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIdentifier *identifier)
|
||||
{
|
||||
GList *iterator;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (identifier != NULL);
|
||||
|
||||
for (iterator = window->sidebar_panels; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
g_assert (NAUTILUS_IS_VIEW_FRAME (iterator->data));
|
||||
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (iterator->data);
|
||||
|
||||
if (strcmp (sidebar_panel->iid, identifier->iid) == 0) {
|
||||
gtk_widget_ref (GTK_WIDGET (sidebar_panel));
|
||||
return sidebar_panel;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* window_update_sidebar_panels_from_preferences:
|
||||
* update_sidebar_panels_from_preferences:
|
||||
* @window: A NautilusWindow
|
||||
*
|
||||
* Update the current list of sidebar panels from preferences.
|
||||
|
@ -1627,82 +1537,16 @@ window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIde
|
|||
*
|
||||
*/
|
||||
static void
|
||||
window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
{
|
||||
GList *enabled_view_identifier_list = NULL;
|
||||
GList *disabled_view_identifier_list = NULL;
|
||||
GList *iterator = NULL;
|
||||
GList *identifier_list;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
/* Obtain list of disabled view identifiers */
|
||||
disabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Remove disabled panels from the window as needed */
|
||||
for (iterator = disabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel != NULL) {
|
||||
nautilus_window_disconnect_view (window, sidebar_panel);
|
||||
nautilus_window_remove_sidebar_panel (window, sidebar_panel);
|
||||
}
|
||||
}
|
||||
|
||||
if (disabled_view_identifier_list) {
|
||||
nautilus_view_identifier_list_free (disabled_view_identifier_list);
|
||||
}
|
||||
|
||||
/* Obtain list of enabled view identifiers */
|
||||
enabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Add enabled panels from the window as needed */
|
||||
for (iterator = enabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel == NULL) {
|
||||
gboolean load_result;
|
||||
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
|
||||
load_result = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
||||
/* Make sure the load_client succeeded */
|
||||
if (load_result) {
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_add_sidebar_panel (window, sidebar_panel);
|
||||
} else {
|
||||
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
|
||||
identifier->iid);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
|
||||
sidebar_panel = NULL;
|
||||
}
|
||||
} else {
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifier_list);
|
||||
identifier_list = nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
nautilus_window_set_sidebar_panels (window, identifier_list);
|
||||
nautilus_view_identifier_list_free (identifier_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1715,7 +1559,7 @@ window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
|||
static void
|
||||
sidebar_panels_changed_callback (gpointer user_data)
|
||||
{
|
||||
window_update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1768,7 +1612,6 @@ nautilus_window_hide_location_bar (NautilusWindow *window)
|
|||
hide_dock_item (window, URI_ENTRY_DOCK_ITEM);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_show_location_bar (NautilusWindow *window)
|
||||
{
|
||||
|
@ -1861,7 +1704,8 @@ nautilus_window_status_bar_showing (NautilusWindow *window)
|
|||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return (app->statusbar != NULL && GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent));
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
/*
|
||||
* Nautilus
|
||||
|
@ -50,106 +50,97 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
GnomeAppClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
||||
typedef enum {
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
} NautilusLocationChangeType;
|
||||
|
||||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *new_sidebar_panels;
|
||||
GList *error_views;
|
||||
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
nautilus_boolean_bit changes_pending : 1;
|
||||
nautilus_boolean_bit views_shown : 1;
|
||||
nautilus_boolean_bit view_bombed_out : 1;
|
||||
nautilus_boolean_bit view_activation_complete : 1;
|
||||
nautilus_boolean_bit sent_update_view : 1;
|
||||
nautilus_boolean_bit cv_progress_initial : 1;
|
||||
nautilus_boolean_bit cv_progress_done : 1;
|
||||
nautilus_boolean_bit cv_progress_error : 1;
|
||||
nautilus_boolean_bit reset_to_idle : 1;
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *error_views;
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
gboolean views_shown;
|
||||
gboolean view_bombed_out;
|
||||
gboolean view_activation_complete;
|
||||
gboolean sent_update_view;
|
||||
gboolean cv_progress_initial;
|
||||
gboolean cv_progress_done;
|
||||
gboolean cv_progress_error;
|
||||
gboolean reset_to_idle;
|
||||
};
|
||||
|
||||
GtkType nautilus_window_get_type (void);
|
||||
void nautilus_window_close (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view);
|
||||
void nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_remove_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_goto_uri (NautilusWindow *window,
|
||||
const char *uri);
|
||||
gboolean nautilus_window_get_search_mode (NautilusWindow *window);
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
#include "nautilus-switchable-search-bar.h"
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-dock.h>
|
||||
#include <libnautilus-extensions/nautilus-directory.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
#include <libnautilus-extensions/nautilus-search-uri.h>
|
||||
|
@ -76,14 +78,14 @@ nautilus_switchable_navigation_bar_initialize_class (NautilusSwitchableNavigatio
|
|||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
navigation_bar_class = NAUTILUS_NAVIGATION_BAR_CLASS (klass);
|
||||
|
||||
signals[MODE_CHANGED]
|
||||
= gtk_signal_new ("mode_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSwitchableNavigationBarClass,
|
||||
mode_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
||||
signals[MODE_CHANGED] = gtk_signal_new
|
||||
("mode_changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (NautilusSwitchableNavigationBarClass,
|
||||
mode_changed),
|
||||
gtk_marshal_NONE__STRING,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
||||
|
||||
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
|
||||
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
#include "nautilus-simple-search-bar.h"
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-dock.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libnautilus-extensions/nautilus-directory.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
|
|
|
@ -625,7 +625,8 @@ nautilus_view_frame_selection_changed (NautilusViewFrame *view,
|
|||
}
|
||||
|
||||
void
|
||||
nautilus_view_frame_title_changed (NautilusViewFrame *view)
|
||||
nautilus_view_frame_title_changed (NautilusViewFrame *view,
|
||||
const char *title)
|
||||
{
|
||||
CORBA_Environment ev;
|
||||
|
||||
|
@ -633,14 +634,14 @@ nautilus_view_frame_title_changed (NautilusViewFrame *view)
|
|||
|
||||
CORBA_exception_init (&ev);
|
||||
Nautilus_View_title_changed (bonobo_object_corba_objref (BONOBO_OBJECT (view->client_object)),
|
||||
title,
|
||||
&ev);
|
||||
if (ev._major != CORBA_NO_EXCEPTION) {
|
||||
/* FIXME: Self-destruct may not be the best way to indicate an error here. */
|
||||
gtk_object_destroy (GTK_OBJECT (view));
|
||||
}
|
||||
CORBA_exception_free (&ev);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_view_frame_is_zoomable (NautilusViewFrame *view)
|
||||
|
@ -891,7 +892,6 @@ nautilus_view_frame_report_load_complete (NautilusViewFrame *view)
|
|||
g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
|
||||
|
||||
view_frame_loaded (view);
|
||||
gtk_signal_emit (GTK_OBJECT (view), signals[REPORT_LOAD_COMPLETE]);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -69,35 +69,26 @@ typedef struct {
|
|||
typedef struct {
|
||||
NautilusGenerousBinClass parent_spot;
|
||||
|
||||
/* These signals correspond to the Nautilus::ViewFrame CORBA interface. They
|
||||
* are requests that the underlying view may make of the shell via the frame.
|
||||
/* Some of these calls correspond to CORBA calls, others are
|
||||
* higher level operations.
|
||||
*/
|
||||
void (* open_location) (NautilusViewFrame *view,
|
||||
const char *location);
|
||||
const char *location);
|
||||
void (* open_location_in_new_window) (NautilusViewFrame *view,
|
||||
const char *location,
|
||||
GList *selection); /* list of char * */
|
||||
void (* report_location_change) (NautilusViewFrame *view,
|
||||
const char *location);
|
||||
const char *location,
|
||||
GList *selection); /* list of char * */
|
||||
void (* report_selection_change) (NautilusViewFrame *view,
|
||||
GList *selection); /* list of char * */
|
||||
GList *selection); /* list of char * */
|
||||
void (* report_status) (NautilusViewFrame *view,
|
||||
const char *status);
|
||||
const char *status);
|
||||
void (* report_load_underway) (NautilusViewFrame *view);
|
||||
void (* report_load_progress) (NautilusViewFrame *view,
|
||||
double fraction_done);
|
||||
double fraction_done);
|
||||
void (* report_load_complete) (NautilusViewFrame *view);
|
||||
void (* report_load_failed) (NautilusViewFrame *view);
|
||||
|
||||
/* These are higher-level signals. We are moving more work into
|
||||
* this class, so we no longer have one signal for each CORBA
|
||||
* signal.
|
||||
*/
|
||||
void (* title_changed) (NautilusViewFrame *view);
|
||||
|
||||
/* Part of Nautilus::ZoomableFrame CORBA interface. */
|
||||
void (* zoom_level_changed) (NautilusViewFrame *view,
|
||||
double zoom_level);
|
||||
double zoom_level);
|
||||
|
||||
/* Error handling for when client goes away. */
|
||||
void (* client_gone) (NautilusViewFrame *view);
|
||||
|
@ -113,7 +104,6 @@ NautilusViewFrame * nautilus_view_frame_new (BonoboUIHan
|
|||
gboolean nautilus_view_frame_load_client (NautilusViewFrame *view,
|
||||
const char *iid);
|
||||
const char * nautilus_view_frame_get_iid (NautilusViewFrame *view);
|
||||
char * nautilus_view_frame_get_title (NautilusViewFrame *view);
|
||||
|
||||
/* Nautilus:View */
|
||||
void nautilus_view_frame_load_location (NautilusViewFrame *view,
|
||||
|
@ -141,6 +131,10 @@ void nautilus_view_frame_set_label (NautilusVie
|
|||
const char *label);
|
||||
void nautilus_view_frame_activate (NautilusViewFrame *view);
|
||||
Nautilus_HistoryList *nautilus_view_frame_get_history_list (NautilusViewFrame *view);
|
||||
void nautilus_view_frame_title_changed (NautilusViewFrame *view);
|
||||
void nautilus_view_frame_title_changed (NautilusViewFrame *view,
|
||||
const char *title);
|
||||
/* view state */
|
||||
char * nautilus_view_frame_get_title (NautilusViewFrame *view);
|
||||
gboolean nautilus_view_frame_get_is_underway (NautilusViewFrame *view);
|
||||
|
||||
#endif /* NAUTILUS_VIEW_FRAME_H */
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-mime-actions.h>
|
||||
#include <libnautilus-extensions/nautilus-search-uri.h>
|
||||
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
|
@ -86,12 +87,14 @@
|
|||
*/
|
||||
#define MAX_URI_IN_DIALOG_LENGTH 60
|
||||
|
||||
static void nautilus_window_set_state_info (NautilusWindow *window, ...);
|
||||
|
||||
void
|
||||
nautilus_window_report_selection_change (NautilusWindow *window,
|
||||
GList *selection,
|
||||
NautilusViewFrame *view)
|
||||
{
|
||||
GList *sorted, *p;
|
||||
GList *sorted, *node;
|
||||
|
||||
/* Sort list into canonical order and check if it's the same as
|
||||
* the selection we already have.
|
||||
|
@ -107,9 +110,10 @@ nautilus_window_report_selection_change (NautilusWindow *window,
|
|||
window->selection = sorted;
|
||||
|
||||
/* Tell all the view frames about it. */
|
||||
nautilus_view_frame_selection_changed (window->content_view, selection);
|
||||
for (p = window->sidebar_panels; p != NULL; p = p->next) {
|
||||
nautilus_view_frame_selection_changed (p->data, selection);
|
||||
nautilus_view_frame_selection_changed (window->content_view, sorted);
|
||||
for (node = window->sidebar_panels; node != NULL; node = node->next) {
|
||||
nautilus_view_frame_selection_changed
|
||||
(NAUTILUS_VIEW_FRAME (node->data), sorted);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,15 +143,6 @@ nautilus_window_report_load_underway (NautilusWindow *window,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_report_load_progress (NautilusWindow *window,
|
||||
double fraction_done,
|
||||
NautilusViewFrame *view)
|
||||
{
|
||||
/* For now, we ignore the fraction_done parameter. */
|
||||
nautilus_window_report_load_underway (window, view);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_report_load_complete (NautilusWindow *window,
|
||||
NautilusViewFrame *view)
|
||||
|
@ -195,7 +190,7 @@ compute_default_title (const char *text_uri)
|
|||
return title;
|
||||
}
|
||||
|
||||
/* nautilus_window_get_current_location_title:
|
||||
/* compute_title:
|
||||
*
|
||||
* Get a newly allocated copy of the user-displayable title for the current
|
||||
* location. Note that the window title is related to this but might not
|
||||
|
@ -205,7 +200,7 @@ compute_default_title (const char *text_uri)
|
|||
* Return value: A newly allocated string. Use g_free when done with it.
|
||||
*/
|
||||
static char *
|
||||
nautilus_window_get_current_location_title (NautilusWindow *window)
|
||||
compute_title (NautilusWindow *window)
|
||||
{
|
||||
char *title;
|
||||
|
||||
|
@ -221,7 +216,7 @@ nautilus_window_get_current_location_title (NautilusWindow *window)
|
|||
return title;
|
||||
}
|
||||
|
||||
/* nautilus_window_update_title:
|
||||
/* update_title:
|
||||
*
|
||||
* Update the non-NautilusViewFrame objects that use the location's user-displayable
|
||||
* title in some way. Called when the location or title has changed.
|
||||
|
@ -230,13 +225,22 @@ nautilus_window_get_current_location_title (NautilusWindow *window)
|
|||
*
|
||||
*/
|
||||
static void
|
||||
nautilus_window_update_title (NautilusWindow *window)
|
||||
update_title (NautilusWindow *window)
|
||||
{
|
||||
char *title;
|
||||
char *window_title;
|
||||
GList *temp;
|
||||
GList *node;
|
||||
|
||||
title = nautilus_window_get_current_location_title (window);
|
||||
title = compute_title (window);
|
||||
|
||||
/* Remember the title and check if it's the same as last time. */
|
||||
if (window->details->title != NULL
|
||||
&& strcmp (title, window->details->title) == 0) {
|
||||
g_free (title);
|
||||
return;
|
||||
}
|
||||
g_free (window->details->title);
|
||||
window->details->title = g_strdup (title);
|
||||
|
||||
if (title[0] == '\0') {
|
||||
gtk_window_set_title (GTK_WINDOW (window), _("Nautilus"));
|
||||
|
@ -256,16 +260,13 @@ nautilus_window_update_title (NautilusWindow *window)
|
|||
|
||||
/* warn all views and sidebar panels of the potential title change */
|
||||
if (window->content_view != NULL) {
|
||||
nautilus_view_frame_title_changed (window->content_view);
|
||||
nautilus_view_frame_title_changed (window->content_view, title);
|
||||
}
|
||||
if (window->new_content_view != NULL) {
|
||||
nautilus_view_frame_title_changed (window->new_content_view);
|
||||
nautilus_view_frame_title_changed (window->new_content_view, title);
|
||||
}
|
||||
|
||||
for (temp = window->sidebar_panels; temp != NULL; temp = temp->next) {
|
||||
if (temp->data != NULL) {
|
||||
nautilus_view_frame_title_changed (NAUTILUS_VIEW_FRAME (temp->data));
|
||||
}
|
||||
for (node = window->sidebar_panels; node != NULL; node = node->next) {
|
||||
nautilus_view_frame_title_changed (NAUTILUS_VIEW_FRAME (node->data), title);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,7 +300,7 @@ nautilus_window_set_displayed_location (NautilusWindow *window, const char *uri)
|
|||
window->current_location_bookmark = nautilus_bookmark_new (uri, uri);
|
||||
}
|
||||
|
||||
nautilus_window_update_title (window);
|
||||
update_title (window);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -311,7 +312,7 @@ nautilus_window_title_changed (NautilusWindow *window,
|
|||
|
||||
/* Only the content view can change the window title. */
|
||||
if (view == window->content_view || view == window->new_content_view) {
|
||||
nautilus_window_update_title (window);
|
||||
update_title (window);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -465,7 +466,6 @@ static void
|
|||
nautilus_window_update_internals (NautilusWindow *window)
|
||||
{
|
||||
const char *new_location;
|
||||
char *current_title;
|
||||
|
||||
if (window->pending_ni != NULL) {
|
||||
new_location = window->pending_ni->location;
|
||||
|
@ -524,9 +524,9 @@ nautilus_window_update_internals (NautilusWindow *window)
|
|||
* Eventually, this will not be necessary when we restructure the
|
||||
* sidebar itself to be a NautilusViewFrame.
|
||||
*/
|
||||
current_title = nautilus_window_get_current_location_title (window);
|
||||
nautilus_sidebar_set_uri (window->sidebar, window->location, current_title);
|
||||
g_free (current_title);
|
||||
nautilus_sidebar_set_uri (window->sidebar,
|
||||
window->location,
|
||||
window->details->title);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -551,20 +551,11 @@ nautilus_window_view_failed (NautilusWindow *window, NautilusViewFrame *view)
|
|||
static void
|
||||
nautilus_window_has_really_changed (NautilusWindow *window)
|
||||
{
|
||||
GList *discard_views;
|
||||
GList *p;
|
||||
GList *new_sidebar_panels;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
new_sidebar_panels = window->new_sidebar_panels;
|
||||
window->new_sidebar_panels = NULL;
|
||||
|
||||
|
||||
/* Switch to the new content view. */
|
||||
if (window->new_content_view != NULL) {
|
||||
if (GTK_WIDGET (window->new_content_view)->parent == NULL) {
|
||||
nautilus_window_disconnect_view (window, window->content_view);
|
||||
nautilus_window_set_content_view (window, window->new_content_view);
|
||||
nautilus_window_set_content_view_widget (window, window->new_content_view);
|
||||
}
|
||||
gtk_object_unref (GTK_OBJECT (window->new_content_view));
|
||||
window->new_content_view = NULL;
|
||||
|
@ -577,41 +568,9 @@ nautilus_window_has_really_changed (NautilusWindow *window)
|
|||
if (window->pending_ni == NULL) {
|
||||
nautilus_window_synch_content_view_menu (window);
|
||||
}
|
||||
|
||||
/* Remove sidebar views that aren't going to be kept. */
|
||||
|
||||
discard_views = NULL;
|
||||
for (p = window->sidebar_panels; p != NULL; p = p->next) {
|
||||
view = NAUTILUS_VIEW_FRAME (p->data);
|
||||
|
||||
if (g_list_find (new_sidebar_panels, view) == NULL) {
|
||||
discard_views = g_list_prepend (discard_views, view);
|
||||
}
|
||||
}
|
||||
for (p = discard_views; p != NULL; p = p->next) {
|
||||
view = NAUTILUS_VIEW_FRAME (p->data);
|
||||
|
||||
nautilus_window_disconnect_view (window, view);
|
||||
nautilus_window_remove_sidebar_panel (window, view);
|
||||
}
|
||||
g_list_free (discard_views);
|
||||
|
||||
/* Add any new views */
|
||||
|
||||
for (p = new_sidebar_panels; p != NULL; p = p->next) {
|
||||
view = NAUTILUS_VIEW_FRAME (p->data);
|
||||
|
||||
if (!GTK_OBJECT_DESTROYED (GTK_OBJECT (view))
|
||||
&& GTK_WIDGET (view)->parent == NULL) {
|
||||
nautilus_window_add_sidebar_panel (window, view);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nautilus_gtk_object_list_free (new_sidebar_panels);
|
||||
|
||||
/* Tell the window we are finished. */
|
||||
if (window->pending_ni != NULL) {
|
||||
nautilus_window_update_internals (window);
|
||||
|
@ -622,7 +581,7 @@ nautilus_window_has_really_changed (NautilusWindow *window)
|
|||
window->pending_ni = NULL;
|
||||
}
|
||||
|
||||
nautilus_window_update_title (window);
|
||||
update_title (window);
|
||||
}
|
||||
|
||||
/* This is called when we are done loading to get rid of the load_info structure. */
|
||||
|
@ -637,10 +596,8 @@ nautilus_window_free_load_info (NautilusWindow *window)
|
|||
}
|
||||
|
||||
window->error_views = NULL;
|
||||
window->new_sidebar_panels = NULL;
|
||||
window->new_content_view = NULL;
|
||||
window->cancel_tag = NULL;
|
||||
window->changes_pending = FALSE;
|
||||
window->views_shown = FALSE;
|
||||
window->view_bombed_out = FALSE;
|
||||
window->view_activation_complete = FALSE;
|
||||
|
@ -651,39 +608,6 @@ nautilus_window_free_load_info (NautilusWindow *window)
|
|||
window->reset_to_idle = FALSE;
|
||||
}
|
||||
|
||||
/* Meta view handling */
|
||||
static NautilusViewFrame *
|
||||
nautilus_window_load_sidebar_panel (NautilusWindow *window,
|
||||
const char *iid)
|
||||
{
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
GList *p;
|
||||
|
||||
/* Find an existing sidebar panel. */
|
||||
sidebar_panel = NULL;
|
||||
for (p = window->sidebar_panels; p != NULL; p = p->next) {
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (p->data);
|
||||
if (strcmp (nautilus_view_frame_get_iid (sidebar_panel), iid) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a new sidebar panel. */
|
||||
if (p != NULL) {
|
||||
gtk_object_ref (GTK_OBJECT (sidebar_panel));
|
||||
} else {
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
if (!nautilus_view_frame_load_client (sidebar_panel, iid)) {
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
sidebar_panel = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return sidebar_panel;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_unreadable_location (NautilusWindow *window, const char *uri)
|
||||
{
|
||||
|
@ -726,9 +650,9 @@ open_location (NautilusWindow *window,
|
|||
gboolean force_new_window,
|
||||
GList *new_selection)
|
||||
{
|
||||
NautilusWindow *traverse_window;
|
||||
NautilusWindow *existing_window;
|
||||
gboolean create_new_window;
|
||||
GSList *element;
|
||||
GSList *node;
|
||||
|
||||
/* empty location doesn't jive with our logic, if there are any characters,
|
||||
* it will work ok, even if there is space */
|
||||
|
@ -755,11 +679,12 @@ open_location (NautilusWindow *window,
|
|||
* This may be the desired bahavior, but the prefs UI still says open
|
||||
* new window. How can we resolve this inconsistancy?
|
||||
*/
|
||||
for (element = nautilus_application_windows (); element != NULL; element = element->next) {
|
||||
traverse_window = element->data;
|
||||
if (traverse_window->location != NULL && nautilus_uris_match (traverse_window->location, location)) {
|
||||
gtk_widget_show_now (GTK_WIDGET (traverse_window));
|
||||
nautilus_gdk_window_bring_to_front (GTK_WIDGET (traverse_window)->window);
|
||||
for (node = nautilus_application_windows (); node != NULL; node = node->next) {
|
||||
existing_window = NAUTILUS_WINDOW (node->data);
|
||||
if (existing_window->location != NULL
|
||||
&& nautilus_uris_match (existing_window->location, location)) {
|
||||
gtk_widget_show_now (GTK_WIDGET (existing_window));
|
||||
nautilus_gdk_window_bring_to_front (GTK_WIDGET (existing_window)->window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -780,8 +705,7 @@ open_location (NautilusWindow *window,
|
|||
|
||||
void
|
||||
nautilus_window_open_location (NautilusWindow *window,
|
||||
const char *location,
|
||||
NautilusViewFrame *view)
|
||||
const char *location)
|
||||
{
|
||||
open_location (window, location, FALSE, NULL);
|
||||
}
|
||||
|
@ -789,15 +713,14 @@ nautilus_window_open_location (NautilusWindow *window,
|
|||
void
|
||||
nautilus_window_open_location_in_new_window (NautilusWindow *window,
|
||||
const char *location,
|
||||
GList *selection,
|
||||
NautilusViewFrame *view)
|
||||
GList *selection)
|
||||
{
|
||||
open_location (window, location, TRUE, selection);
|
||||
}
|
||||
|
||||
NautilusViewFrame *
|
||||
nautilus_window_load_content_view (NautilusWindow *window,
|
||||
NautilusViewIdentifier *id)
|
||||
static NautilusViewFrame *
|
||||
load_content_view (NautilusWindow *window,
|
||||
NautilusViewIdentifier *id)
|
||||
{
|
||||
const char *iid;
|
||||
NautilusViewFrame *content_view;
|
||||
|
@ -898,13 +821,109 @@ report_sidebar_panel_failure_to_user (NautilusWindow *window)
|
|||
g_free (message);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_view_failure (NautilusWindow *window,
|
||||
NautilusViewFrame *view)
|
||||
{
|
||||
if (view == window->new_content_view) {
|
||||
window->reset_to_idle = TRUE;
|
||||
window->cv_progress_error = TRUE;
|
||||
} else if (view == window->content_view) {
|
||||
if (GTK_WIDGET (window->content_view)->parent) {
|
||||
gtk_container_remove (GTK_CONTAINER (GTK_WIDGET (window->content_view)->parent),
|
||||
GTK_WIDGET (window->content_view));
|
||||
}
|
||||
report_content_view_failure_to_user (window);
|
||||
window->content_view = NULL;
|
||||
window->cv_progress_error = TRUE;
|
||||
} else {
|
||||
report_sidebar_panel_failure_to_user (window);
|
||||
}
|
||||
|
||||
nautilus_window_remove_sidebar_panel (window, view);
|
||||
}
|
||||
|
||||
static void
|
||||
cancel_location_change (NautilusWindow *window)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
if (window->cancel_tag != NULL) {
|
||||
nautilus_navigation_info_cancel (window->cancel_tag);
|
||||
window->cancel_tag = NULL;
|
||||
}
|
||||
|
||||
if (window->pending_ni != NULL) {
|
||||
nautilus_window_set_displayed_location
|
||||
(window, window->location == NULL ? "" : window->location);
|
||||
|
||||
/* Tell previously-notified views to go back to the old page */
|
||||
for (node = window->sidebar_panels; node != NULL; node = node->next) {
|
||||
update_view (node->data, window->location, window->selection);
|
||||
}
|
||||
|
||||
if (window->new_content_view != NULL
|
||||
&& window->new_content_view == window->content_view) {
|
||||
update_view (window->content_view, window->location, window->selection);
|
||||
}
|
||||
}
|
||||
|
||||
if (window->new_content_view != NULL) {
|
||||
gtk_widget_unref (GTK_WIDGET (window->new_content_view));
|
||||
}
|
||||
|
||||
nautilus_window_free_load_info (window);
|
||||
|
||||
nautilus_window_allow_stop (window, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
load_view_for_new_location (NautilusWindow *window)
|
||||
{
|
||||
window->new_content_view = load_content_view
|
||||
(window, window->pending_ni->initial_content_id);
|
||||
}
|
||||
|
||||
static void
|
||||
set_view_location_and_selection (NautilusWindow *window)
|
||||
{
|
||||
const char *location;
|
||||
GList *selection, *node;
|
||||
|
||||
if (window->pending_ni != NULL) {
|
||||
location = window->pending_ni->location;
|
||||
selection = window->pending_selection;
|
||||
} else {
|
||||
g_assert (window->pending_selection == NULL);
|
||||
location = window->location;
|
||||
selection = window->selection;
|
||||
}
|
||||
|
||||
nautilus_window_set_displayed_location (window, location);
|
||||
|
||||
x_message (("!!! Sending update_view"));
|
||||
|
||||
if (window->new_content_view != NULL) {
|
||||
update_view (window->new_content_view, location, selection);
|
||||
} else {
|
||||
/* FIXME bugzilla.eazel.com 2457: Silent error here! */
|
||||
window->cv_progress_error = TRUE;
|
||||
}
|
||||
|
||||
for (node = window->sidebar_panels; node != NULL; node = node->next) {
|
||||
update_view (node->data, location, selection);
|
||||
}
|
||||
|
||||
nautilus_g_list_free_deep (window->pending_selection);
|
||||
window->pending_selection = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_window_update_state (gpointer data)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
GList *p;
|
||||
gboolean made_changes;
|
||||
GList *sidebar_panel_identifiers;
|
||||
|
||||
window = data;
|
||||
|
||||
|
@ -920,8 +939,8 @@ nautilus_window_update_state (gpointer data)
|
|||
#ifdef EXTREME_DEBUGGING
|
||||
g_message (">>> nautilus_window_update_state:");
|
||||
g_print ("making_changes %d\n", window->making_changes);
|
||||
g_print ("changes_pending %d, location_change_type %d, views_shown %d, view_bombed_out %d, view_activation_complete %d\n",
|
||||
window->changes_pending, window->location_change_type, window->views_shown,
|
||||
g_print ("location_change_type %d, views_shown %d, view_bombed_out %d, view_activation_complete %d\n",
|
||||
window->location_change_type, window->views_shown,
|
||||
window->view_bombed_out, window->view_activation_complete);
|
||||
g_print ("sent_update_view %d, cv_progress_initial %d, cv_progress_done %d, cv_progress_error %d, reset_to_idle %d\n",
|
||||
window->sent_update_view, window->cv_progress_initial, window->cv_progress_done, window->cv_progress_error,
|
||||
|
@ -929,36 +948,13 @@ nautilus_window_update_state (gpointer data)
|
|||
#endif
|
||||
|
||||
/* Now make any needed state changes based on available information */
|
||||
|
||||
if (window->view_bombed_out) {
|
||||
window->view_bombed_out = FALSE;
|
||||
|
||||
for (p = window->error_views; p != NULL; p = p->next) {
|
||||
NautilusViewFrame *error_view = p->data;
|
||||
|
||||
if (error_view == window->new_content_view) {
|
||||
made_changes = TRUE;
|
||||
window->reset_to_idle = TRUE;
|
||||
window->cv_progress_error = TRUE;
|
||||
} else if (error_view == window->content_view) {
|
||||
if (GTK_WIDGET (window->content_view)->parent) {
|
||||
gtk_container_remove (GTK_CONTAINER (GTK_WIDGET (window->content_view)->parent),
|
||||
GTK_WIDGET (window->content_view));
|
||||
}
|
||||
report_content_view_failure_to_user (window);
|
||||
window->content_view = NULL;
|
||||
made_changes = TRUE;
|
||||
window->cv_progress_error = TRUE;
|
||||
} else {
|
||||
report_sidebar_panel_failure_to_user (window);
|
||||
}
|
||||
|
||||
if (g_list_find (window->new_sidebar_panels, error_view) != NULL) {
|
||||
window->new_sidebar_panels = g_list_remove (window->new_sidebar_panels, error_view);
|
||||
gtk_widget_unref (GTK_WIDGET (error_view));
|
||||
}
|
||||
|
||||
nautilus_window_remove_sidebar_panel (window, error_view);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (error_view));
|
||||
|
||||
handle_view_failure (window, NAUTILUS_VIEW_FRAME (p->data));
|
||||
|
||||
/* The dead_view_name refers only to the first error_view, so
|
||||
* clear it out here after handling the first one. Subsequent
|
||||
* times through this loop, if that ever actually happens, nothing
|
||||
|
@ -966,140 +962,63 @@ nautilus_window_update_state (gpointer data)
|
|||
*/
|
||||
g_free (window->details->dead_view_name);
|
||||
window->details->dead_view_name = NULL;
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (p->data));
|
||||
}
|
||||
|
||||
g_list_free (window->error_views);
|
||||
window->error_views = NULL;
|
||||
|
||||
window->view_bombed_out = FALSE;
|
||||
|
||||
made_changes = TRUE;
|
||||
}
|
||||
|
||||
if (window->reset_to_idle) {
|
||||
x_message (("Reset to idle!"));
|
||||
|
||||
window->changes_pending = FALSE;
|
||||
made_changes = TRUE;
|
||||
|
||||
window->reset_to_idle = FALSE;
|
||||
|
||||
if (window->cancel_tag != NULL) {
|
||||
nautilus_navigation_info_cancel (window->cancel_tag);
|
||||
window->cancel_tag = NULL;
|
||||
}
|
||||
|
||||
if (window->pending_ni != NULL) {
|
||||
nautilus_window_set_displayed_location
|
||||
(window, window->location == NULL ? "" : window->location);
|
||||
|
||||
/* Tell previously-notified views to go back to the old page */
|
||||
for (p = window->sidebar_panels; p != NULL; p = p->next) {
|
||||
if (g_list_find (window->new_sidebar_panels, p->data) != NULL) {
|
||||
update_view (p->data, window->location, window->selection);
|
||||
}
|
||||
}
|
||||
|
||||
if (window->new_content_view != NULL
|
||||
&& window->new_content_view == window->content_view) {
|
||||
update_view (window->content_view, window->location, window->selection);
|
||||
}
|
||||
}
|
||||
|
||||
if (window->new_content_view != NULL) {
|
||||
gtk_widget_unref (GTK_WIDGET (window->new_content_view));
|
||||
}
|
||||
nautilus_gtk_object_list_free (window->new_sidebar_panels);
|
||||
|
||||
nautilus_window_free_load_info (window);
|
||||
|
||||
nautilus_window_allow_stop (window, FALSE);
|
||||
cancel_location_change (window);
|
||||
|
||||
made_changes = TRUE;
|
||||
}
|
||||
|
||||
if (window->changes_pending) {
|
||||
x_message (("Changes pending"));
|
||||
x_message (("Changes pending"));
|
||||
|
||||
if (window->pending_ni != NULL
|
||||
&& window->new_content_view == NULL
|
||||
&& !window->cv_progress_error
|
||||
&& !window->view_activation_complete) {
|
||||
|
||||
if (window->pending_ni
|
||||
&& !window->new_content_view
|
||||
&& !window->cv_progress_error
|
||||
&& !window->view_activation_complete) {
|
||||
|
||||
window->new_content_view = nautilus_window_load_content_view
|
||||
(window, window->pending_ni->initial_content_id);
|
||||
|
||||
sidebar_panel_identifiers =
|
||||
nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
for (p = sidebar_panel_identifiers; p != NULL; p = p->next) {
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
NautilusViewIdentifier *identifier;
|
||||
|
||||
identifier = (NautilusViewIdentifier *) p->data;
|
||||
|
||||
sidebar_panel = nautilus_window_load_sidebar_panel
|
||||
(window, identifier->iid);
|
||||
if (sidebar_panel != NULL) {
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
window->new_sidebar_panels = g_list_prepend (window->new_sidebar_panels, sidebar_panel);
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_view_identifier_list_free (sidebar_panel_identifiers);
|
||||
|
||||
window->view_activation_complete = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
load_view_for_new_location (window);
|
||||
|
||||
if (window->view_activation_complete
|
||||
&& !window->sent_update_view) {
|
||||
const char *location;
|
||||
GList *selection;
|
||||
|
||||
if (window->pending_ni != NULL) {
|
||||
location = window->pending_ni->location;
|
||||
selection = window->pending_selection;
|
||||
} else {
|
||||
g_assert (window->pending_selection == NULL);
|
||||
location = window->location;
|
||||
selection = window->selection;
|
||||
}
|
||||
|
||||
nautilus_window_set_displayed_location (window, location);
|
||||
|
||||
x_message (("!!! Sending update_view"));
|
||||
|
||||
if (window->new_content_view != NULL) {
|
||||
update_view (window->new_content_view, location, selection);
|
||||
} else {
|
||||
/* FIXME bugzilla.eazel.com 2457: Silent error here! */
|
||||
window->cv_progress_error = TRUE;
|
||||
}
|
||||
|
||||
for (p = window->new_sidebar_panels; p != NULL; p = p->next) {
|
||||
update_view (p->data, location, selection);
|
||||
}
|
||||
|
||||
nautilus_g_list_free_deep (window->pending_selection);
|
||||
window->pending_selection = NULL;
|
||||
|
||||
window->sent_update_view = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
window->view_activation_complete = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
|
||||
if (window->view_activation_complete
|
||||
&& !window->sent_update_view) {
|
||||
|
||||
if (!window->cv_progress_error
|
||||
&& window->view_activation_complete
|
||||
&& window->cv_progress_initial
|
||||
&& !window->views_shown) {
|
||||
|
||||
nautilus_window_has_really_changed (window);
|
||||
window->views_shown = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
set_view_location_and_selection (window);
|
||||
|
||||
if (window->cv_progress_error
|
||||
|| window->cv_progress_done) {
|
||||
|
||||
x_message (("cv_progress_(error|done) kicking in"));
|
||||
|
||||
made_changes = TRUE;
|
||||
window->reset_to_idle = TRUE;
|
||||
}
|
||||
window->sent_update_view = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
|
||||
if (!window->cv_progress_error
|
||||
&& window->view_activation_complete
|
||||
&& window->cv_progress_initial
|
||||
&& !window->views_shown) {
|
||||
|
||||
nautilus_window_has_really_changed (window);
|
||||
|
||||
window->views_shown = TRUE;
|
||||
made_changes = TRUE;
|
||||
}
|
||||
|
||||
if (window->cv_progress_error
|
||||
|| window->cv_progress_done) {
|
||||
made_changes = TRUE;
|
||||
window->reset_to_idle = TRUE;
|
||||
}
|
||||
|
||||
window->making_changes--;
|
||||
|
@ -1110,7 +1029,7 @@ nautilus_window_update_state (gpointer data)
|
|||
return made_changes;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nautilus_window_set_state_info (NautilusWindow *window, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -1130,7 +1049,6 @@ nautilus_window_set_state_info (NautilusWindow *window, ...)
|
|||
x_message (("NAVINFO_RECEIVED"));
|
||||
window->pending_ni = va_arg(args, NautilusNavigationInfo*);
|
||||
window->cancel_tag = NULL;
|
||||
window->changes_pending = TRUE;
|
||||
break;
|
||||
|
||||
case VIEW_ERROR:
|
||||
|
@ -1139,8 +1057,7 @@ nautilus_window_set_state_info (NautilusWindow *window, ...)
|
|||
g_warning ("A view failed. The UI will handle this with a dialog but this should be debugged.");
|
||||
window->view_bombed_out = TRUE;
|
||||
/* Get label now, since view frame may be destroyed later. */
|
||||
|
||||
/* FIXME: We're only saving the name of the first error_view
|
||||
/* FIXME: We're only saving the name of the first error_view
|
||||
* here. The rest of this code is structured to handle multiple
|
||||
* error_views. I didn't go to the extra effort of saving a
|
||||
* name with teach error_view since (A) we only see one at a
|
||||
|
@ -1157,25 +1074,21 @@ nautilus_window_set_state_info (NautilusWindow *window, ...)
|
|||
case NEW_CONTENT_VIEW_ACTIVATED:
|
||||
x_message (("NEW_CONTENT_VIEW_ACTIVATED"));
|
||||
g_return_if_fail (window->new_content_view == NULL);
|
||||
g_return_if_fail (window->new_sidebar_panels == NULL);
|
||||
new_view = va_arg (args, NautilusViewFrame*);
|
||||
/* Don't ref here, reference is held by widget hierarchy. */
|
||||
window->new_content_view = new_view;
|
||||
/* We only come here in cases where the location does not change,
|
||||
* so the sidebar panels don't change either.
|
||||
*/
|
||||
window->new_sidebar_panels = nautilus_gtk_object_list_copy (window->sidebar_panels);
|
||||
if (window->pending_ni == NULL) {
|
||||
window->view_activation_complete = TRUE;
|
||||
}
|
||||
window->changes_pending = TRUE;
|
||||
window->views_shown = FALSE;
|
||||
break;
|
||||
|
||||
case CV_PROGRESS_INITIAL: /* We have received an "I am loading" indication from the content view */
|
||||
x_message (("CV_PROGRESS_INITIAL"));
|
||||
window->cv_progress_initial = TRUE;
|
||||
window->changes_pending = TRUE;
|
||||
break;
|
||||
|
||||
case CV_PROGRESS_ERROR: /* We have received a load error from the content view */
|
||||
|
@ -1187,7 +1100,6 @@ nautilus_window_set_state_info (NautilusWindow *window, ...)
|
|||
x_message (("CV_PROGRESS_DONE"));
|
||||
if (!window->cv_progress_initial) {
|
||||
window->cv_progress_initial = TRUE;
|
||||
window->changes_pending = TRUE;
|
||||
}
|
||||
window->cv_progress_done = TRUE;
|
||||
break;
|
||||
|
@ -1357,13 +1269,21 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co
|
|||
|
||||
case NAUTILUS_NAVIGATION_RESULT_SERVICE_NOT_AVAILABLE:
|
||||
if (nautilus_is_search_uri (requested_uri)) {
|
||||
/* FIXME bugzilla.eazel.com 2458: Need to give the user some advice about what to do here. */
|
||||
error_message = g_strdup_printf (_("Searching is unavailable right now, because you either have no index, or the search service isn't running. Be sure that you have started the Medusa search service, and if you don't have an index, that the Medusa indexer is running."));
|
||||
/* FIXME bugzilla.eazel.com 2458: Need to give
|
||||
* the user better advice about what to do
|
||||
* here.
|
||||
*/
|
||||
error_message = g_strdup_printf
|
||||
(_("Searching is unavailable right now, because you either have no index, "
|
||||
"or the search service isn't running. "
|
||||
"Be sure that you have started the Medusa search service, and if you "
|
||||
"don't have an index, that the Medusa indexer is running."));
|
||||
dialog_title = g_strdup (_("Searching Unavailable"));
|
||||
break;
|
||||
} /* else fall through */
|
||||
default:
|
||||
error_message = g_strdup_printf (_("Nautilus cannot display \"%s\"."), uri_for_display);
|
||||
error_message = g_strdup_printf (_("Nautilus cannot display \"%s\"."),
|
||||
uri_for_display);
|
||||
}
|
||||
|
||||
if (navi != NULL) {
|
||||
|
@ -1473,3 +1393,116 @@ nautilus_window_begin_location_change (NautilusWindow *window,
|
|||
window->cancel_tag = navigation_info;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_stop_loading (NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_set_state_info (window, RESET_TO_IDLE, 0);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_content_view (NautilusWindow *window, NautilusViewIdentifier *id)
|
||||
{
|
||||
NautilusDirectory *directory;
|
||||
NautilusFile *file;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (window->location != NULL);
|
||||
g_return_if_fail (id != NULL);
|
||||
|
||||
if (window->content_view != NULL) {
|
||||
}
|
||||
|
||||
directory = nautilus_directory_get (window->location);
|
||||
file = nautilus_file_get (window->location);
|
||||
g_assert (directory != NULL);
|
||||
nautilus_mime_set_default_component_for_uri
|
||||
(directory, file, id->iid);
|
||||
nautilus_directory_unref (directory);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
nautilus_window_allow_stop (window, TRUE);
|
||||
|
||||
view = load_content_view (window, id);
|
||||
nautilus_window_set_state_info
|
||||
(window,
|
||||
(NautilusWindowStateItem) NEW_CONTENT_VIEW_ACTIVATED, view,
|
||||
(NautilusWindowStateItem) 0);
|
||||
}
|
||||
|
||||
static int
|
||||
compare_view_identifier_with_iid (gconstpointer passed_view_identifier,
|
||||
gconstpointer passed_iid)
|
||||
{
|
||||
return strcmp (((NautilusViewIdentifier *) passed_view_identifier)->iid,
|
||||
(char *) passed_iid);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_sidebar_panels (NautilusWindow *window,
|
||||
GList *passed_identifier_list)
|
||||
{
|
||||
GList *identifier_list;
|
||||
GList *node, *next, *found_node;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
NautilusViewIdentifier *identifier;
|
||||
gboolean load_succeeded;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
/* Make a copy of the list so we can remove items from it. */
|
||||
identifier_list = g_list_copy (passed_identifier_list);
|
||||
|
||||
/* Remove panels from the window that don't appear in the list. */
|
||||
for (node = window->sidebar_panels; node != NULL; node = next) {
|
||||
next = node->next;
|
||||
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (node->data);
|
||||
|
||||
found_node = g_list_find_custom (identifier_list,
|
||||
(char *) nautilus_view_frame_get_iid (sidebar_panel),
|
||||
compare_view_identifier_with_iid);
|
||||
if (found_node == NULL) {
|
||||
nautilus_window_disconnect_view (window, sidebar_panel);
|
||||
nautilus_window_remove_sidebar_panel (window, sidebar_panel);
|
||||
} else {
|
||||
identifier = (NautilusViewIdentifier *) found_node->data;
|
||||
|
||||
/* Right panel, make sure it has the right name. */
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
|
||||
/* Since this was found, there's no need to add it in the loop below. */
|
||||
identifier_list = g_list_remove_link (identifier_list, found_node);
|
||||
g_list_free_1 (found_node);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add panels to the window that were in the list, but not the window. */
|
||||
for (node = identifier_list; node != NULL; node = node->next) {
|
||||
g_assert (node->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) node->data;
|
||||
|
||||
/* Create and load the panel. */
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
load_succeeded = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
||||
/* If the load failed, tell the user. */
|
||||
if (!load_succeeded) {
|
||||
/* FIXME: This needs to report the error to the user. */
|
||||
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
|
||||
identifier->iid);
|
||||
gtk_object_sink (GTK_OBJECT (sidebar_panel));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If the load succeeded, add the panel. */
|
||||
nautilus_window_add_sidebar_panel (window, sidebar_panel);
|
||||
}
|
||||
|
||||
g_list_free (identifier_list);
|
||||
}
|
||||
|
|
|
@ -29,31 +29,31 @@
|
|||
|
||||
#include "nautilus-window.h"
|
||||
|
||||
void nautilus_window_open_location (NautilusWindow *window,
|
||||
const char *location,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_open_location_in_new_window (NautilusWindow *window,
|
||||
const char *location,
|
||||
GList *selection,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_selection_change (NautilusWindow *window,
|
||||
GList *selection,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_status (NautilusWindow *window,
|
||||
const char *status,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_underway (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_progress (NautilusWindow *window,
|
||||
double fraction_done,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_complete (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_failed (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_title_changed (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
NautilusViewFrame *nautilus_window_load_content_view (NautilusWindow *window,
|
||||
NautilusViewIdentifier *id);
|
||||
void nautilus_window_stop_loading (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewIdentifier *id);
|
||||
void nautilus_window_set_sidebar_panels (NautilusWindow *window,
|
||||
GList *view_identifier_list);
|
||||
|
||||
void nautilus_window_open_location (NautilusWindow *window,
|
||||
const char *location);
|
||||
void nautilus_window_open_location_in_new_window (NautilusWindow *window,
|
||||
const char *location,
|
||||
GList *selection);
|
||||
|
||||
void nautilus_window_report_selection_change (NautilusWindow *window,
|
||||
GList *selection,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_status (NautilusWindow *window,
|
||||
const char *status,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_underway (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_complete (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_report_load_failed (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_title_changed (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
|
||||
#endif /* NAUTILUS_WINDOW_MANAGE_VIEWS_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
/*
|
||||
* Nautilus
|
||||
|
@ -33,13 +33,13 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
typedef enum {
|
||||
CV_PROGRESS_INITIAL = 1,
|
||||
CV_PROGRESS_DONE,
|
||||
CV_PROGRESS_ERROR,
|
||||
VIEW_ERROR,
|
||||
RESET_TO_IDLE, /* Not a real item - a command */
|
||||
NAVINFO_RECEIVED,
|
||||
NEW_CONTENT_VIEW_ACTIVATED,
|
||||
CV_PROGRESS_INITIAL = 1,
|
||||
CV_PROGRESS_DONE,
|
||||
CV_PROGRESS_ERROR,
|
||||
VIEW_ERROR,
|
||||
RESET_TO_IDLE, /* Not a real item - a command */
|
||||
NAVINFO_RECEIVED,
|
||||
NEW_CONTENT_VIEW_ACTIVATED,
|
||||
} NautilusWindowStateItem;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 2575: Need to migrate window fields into here. */
|
||||
|
@ -48,8 +48,11 @@ struct NautilusWindowDetails
|
|||
guint refresh_bookmarks_menu_idle_id;
|
||||
guint refresh_go_menu_idle_id;
|
||||
|
||||
/* Current location. */
|
||||
char *title;
|
||||
NautilusFile *viewed_file;
|
||||
|
||||
/* Error handling. */
|
||||
char *dead_view_name;
|
||||
};
|
||||
|
||||
|
@ -82,22 +85,19 @@ struct NautilusWindowDetails
|
|||
#define NAUTILUS_WINDOW_DEFAULT_WIDTH 700
|
||||
#define NAUTILUS_WINDOW_DEFAULT_HEIGHT 550
|
||||
|
||||
|
||||
void nautilus_window_set_state_info (NautilusWindow *window,
|
||||
... /* things to set, plus optional parameters */);
|
||||
void nautilus_window_set_status (NautilusWindow *window,
|
||||
const char *status);
|
||||
const char *status);
|
||||
void nautilus_window_back_or_forward (NautilusWindow *window,
|
||||
gboolean back,
|
||||
guint distance);
|
||||
gboolean back,
|
||||
guint distance);
|
||||
void nautilus_window_load_content_view_menu (NautilusWindow *window);
|
||||
void nautilus_window_synch_content_view_menu (NautilusWindow *window);
|
||||
void nautilus_window_connect_view (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_disconnect_view (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_disconnect_view (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_window_view_failed (NautilusWindow *window,
|
||||
NautilusViewFrame *view);
|
||||
NautilusViewFrame *view);
|
||||
void nautilus_send_history_list_changed (void);
|
||||
void nautilus_add_to_history_list (NautilusBookmark *bookmark);
|
||||
GList * nautilus_get_history_list (void);
|
||||
|
@ -107,22 +107,28 @@ void nautilus_window_initialize_toolbars (Nautilus
|
|||
void nautilus_window_go_back (NautilusWindow *window);
|
||||
void nautilus_window_go_forward (NautilusWindow *window);
|
||||
void nautilus_window_go_up (NautilusWindow *window);
|
||||
void nautilus_window_update_find_menu_item (NautilusWindow *window);
|
||||
void nautilus_window_update_find_menu_item (NautilusWindow *window);
|
||||
void nautilus_window_toolbar_remove_theme_callback (NautilusWindow *window);
|
||||
NautilusUndoManager *nautilus_window_get_undo_manager (NautilusWindow *window);
|
||||
void nautilus_window_begin_location_change (NautilusWindow *window,
|
||||
const char *location,
|
||||
NautilusLocationChangeType type,
|
||||
guint distance);
|
||||
void nautilus_window_remove_bookmarks_menu_callback (NautilusWindow *window);
|
||||
void nautilus_window_remove_go_menu_callback (NautilusWindow *window);
|
||||
void nautilus_window_remove_bookmarks_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_remove_go_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_update_show_hide_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_zoom_in (NautilusWindow *window);
|
||||
void nautilus_window_zoom_out (NautilusWindow *window);
|
||||
void nautilus_window_zoom_to_level (NautilusWindow *window,
|
||||
double level);
|
||||
void nautilus_window_zoom_to_fit (NautilusWindow *window);
|
||||
const char *location,
|
||||
NautilusLocationChangeType type,
|
||||
guint distance);
|
||||
void nautilus_window_remove_bookmarks_menu_callback (NautilusWindow *window);
|
||||
void nautilus_window_remove_go_menu_callback (NautilusWindow *window);
|
||||
void nautilus_window_remove_bookmarks_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_remove_go_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_update_show_hide_menu_items (NautilusWindow *window);
|
||||
void nautilus_window_zoom_in (NautilusWindow *window);
|
||||
void nautilus_window_zoom_out (NautilusWindow *window);
|
||||
void nautilus_window_zoom_to_level (NautilusWindow *window,
|
||||
double level);
|
||||
void nautilus_window_zoom_to_fit (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view_widget (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view);
|
||||
void nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_remove_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
|
||||
#endif /* NAUTILUS_WINDOW_PRIVATE_H */
|
||||
|
|
|
@ -31,14 +31,15 @@
|
|||
#include "nautilus-application.h"
|
||||
#include "nautilus-throbber.h"
|
||||
#include "nautilus-toolbar.h"
|
||||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-window-private.h"
|
||||
#include "nautilus-window.h"
|
||||
#include <gnome.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-gnome-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-theme.h>
|
||||
|
||||
/* forward declarations */
|
||||
|
@ -424,7 +425,7 @@ toolbar_reload_callback (GtkWidget *widget, NautilusWindow *window)
|
|||
static void
|
||||
toolbar_stop_callback (GtkWidget *widget, NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_set_state_info (window, RESET_TO_IDLE, 0);
|
||||
nautilus_window_stop_loading (window);
|
||||
}
|
||||
|
||||
#ifdef EAZEL_SERVICES
|
||||
|
|
|
@ -82,8 +82,7 @@
|
|||
enum {
|
||||
ARG_0,
|
||||
ARG_APP_ID,
|
||||
ARG_APP,
|
||||
ARG_CONTENT_VIEW
|
||||
ARG_APP
|
||||
};
|
||||
|
||||
/* Other static variables */
|
||||
|
@ -101,8 +100,7 @@ static void nautilus_window_get_arg (GtkObject *object
|
|||
static void nautilus_window_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void nautilus_window_realize (GtkWidget *widget);
|
||||
static void nautilus_window_real_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view);
|
||||
static void update_sidebar_panels_from_preferences (NautilusWindow *window);
|
||||
static void sidebar_panels_changed_callback (gpointer user_data);
|
||||
static void nautilus_window_show (GtkWidget *widget);
|
||||
|
||||
|
@ -116,28 +114,23 @@ nautilus_window_initialize_class (NautilusWindowClass *klass)
|
|||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
parent_class = gtk_type_class(gnome_app_get_type());
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
object_class = (GtkObjectClass *) klass;
|
||||
widget_class = (GtkWidgetClass *) klass;
|
||||
|
||||
object_class->destroy = nautilus_window_destroy;
|
||||
object_class->get_arg = nautilus_window_get_arg;
|
||||
object_class->set_arg = nautilus_window_set_arg;
|
||||
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
widget_class->show = nautilus_window_show;
|
||||
|
||||
gtk_object_add_arg_type ("NautilusWindow::app_id",
|
||||
GTK_TYPE_STRING,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP_ID);
|
||||
gtk_object_add_arg_type ("NautilusWindow::app",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE|GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_APP);
|
||||
gtk_object_add_arg_type ("NautilusWindow::content_view",
|
||||
GTK_TYPE_OBJECT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_CONTENT_VIEW);
|
||||
|
||||
widget_class->realize = nautilus_window_realize;
|
||||
widget_class->size_request = nautilus_window_size_request;
|
||||
|
@ -160,31 +153,33 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_window_clear_status(NautilusWindow *window)
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_status(NautilusWindow *window, const char *txt)
|
||||
nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
||||
{
|
||||
if(window->status_bar_clear_id)
|
||||
g_source_remove(window->status_bar_clear_id);
|
||||
if (window->status_bar_clear_id != 0) {
|
||||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id);
|
||||
if(txt && *txt) {
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
} else
|
||||
window->status_bar_clear_id = 0;
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
|
||||
{
|
||||
nautilus_window_open_location (window, uri, NULL);
|
||||
nautilus_window_open_location (window, uri);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -214,7 +209,6 @@ navigation_bar_mode_changed_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_zoom_in (NautilusWindow *window)
|
||||
{
|
||||
|
@ -451,6 +445,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* Set up undo manager */
|
||||
nautilus_undo_manager_attach (window->application->undo_manager, GTK_OBJECT (window));
|
||||
|
||||
/* Set up the sidebar panels. */
|
||||
update_sidebar_panels_from_preferences (window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -480,9 +477,6 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
nautilus_window_real_set_content_view (window, (NautilusViewFrame *) GTK_VALUE_OBJECT(*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,9 +494,6 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
break;
|
||||
case ARG_CONTENT_VIEW:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->content_view);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -681,34 +672,6 @@ nautilus_window_size_request (GtkWidget *widget,
|
|||
* Main API
|
||||
*/
|
||||
|
||||
static void
|
||||
nautilus_window_switch_views (NautilusWindow *window, NautilusViewIdentifier *id)
|
||||
{
|
||||
NautilusDirectory *directory;
|
||||
NautilusFile *file;
|
||||
NautilusViewFrame *view;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (window->location != NULL);
|
||||
g_return_if_fail (id != NULL);
|
||||
|
||||
directory = nautilus_directory_get (window->location);
|
||||
file = nautilus_file_get (window->location);
|
||||
g_assert (directory != NULL);
|
||||
nautilus_mime_set_default_component_for_uri
|
||||
(directory, file, id->iid);
|
||||
nautilus_directory_unref (directory);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
nautilus_window_allow_stop (window, TRUE);
|
||||
|
||||
view = nautilus_window_load_content_view (window, id);
|
||||
nautilus_window_set_state_info
|
||||
(window,
|
||||
(NautilusWindowStateItem) NEW_CONTENT_VIEW_ACTIVATED, view,
|
||||
(NautilusWindowStateItem) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
|
@ -721,7 +684,7 @@ view_menu_switch_views_callback (GtkWidget *widget, gpointer data)
|
|||
window = NAUTILUS_WINDOW (gtk_object_get_data (GTK_OBJECT (widget), "window"));
|
||||
identifier = (NautilusViewIdentifier *) gtk_object_get_data (GTK_OBJECT (widget), "identifier");
|
||||
|
||||
nautilus_window_switch_views (window, identifier);
|
||||
nautilus_window_set_content_view (window, identifier);
|
||||
}
|
||||
|
||||
/* Note: The identifier parameter ownership is handed off to the menu item. */
|
||||
|
@ -735,11 +698,10 @@ create_content_view_menu_item (NautilusWindow *window, NautilusViewIdentifier *i
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
GTK_SIGNAL_FUNC (view_menu_switch_views_callback),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item),
|
||||
"activate",
|
||||
view_menu_switch_views_callback,
|
||||
NULL);
|
||||
|
||||
/* Store copy of iid in item; free when item destroyed. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
||||
|
@ -858,7 +820,7 @@ chose_component_callback (NautilusViewIdentifier *identifier, gpointer callback_
|
|||
|
||||
if (identifier != NULL) {
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (callback_data));
|
||||
nautilus_window_switch_views (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
nautilus_window_set_content_view (NAUTILUS_WINDOW (callback_data), identifier);
|
||||
}
|
||||
|
||||
/* FIXME bugzilla.eazel.com 1334:
|
||||
|
@ -1008,13 +970,6 @@ nautilus_window_load_content_view_menu (NautilusWindow *window)
|
|||
nautilus_window_synch_content_view_menu (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view)
|
||||
{
|
||||
nautilus_window_real_set_content_view (window, content_view);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel)
|
||||
|
@ -1319,7 +1274,7 @@ nautilus_window_open_location_callback (NautilusViewFrame *view,
|
|||
const char *location,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location (window, location, view);
|
||||
nautilus_window_open_location (window, location);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1328,7 +1283,7 @@ nautilus_window_open_location_in_new_window_callback (NautilusViewFrame *view,
|
|||
GList *selection,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_open_location_in_new_window (window, location, selection, view);
|
||||
nautilus_window_open_location_in_new_window (window, location, selection);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1354,14 +1309,6 @@ nautilus_window_report_load_underway_callback (NautilusViewFrame *view,
|
|||
nautilus_window_report_load_underway (window, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_progress_callback (NautilusViewFrame *view,
|
||||
double fraction_done,
|
||||
NautilusWindow *window)
|
||||
{
|
||||
nautilus_window_report_load_progress (window, fraction_done, view);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_report_load_complete_callback (NautilusViewFrame *view,
|
||||
NautilusWindow *window)
|
||||
|
@ -1470,7 +1417,6 @@ nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view)
|
|||
CONNECT (report_selection_change);
|
||||
CONNECT (report_status);
|
||||
CONNECT (report_load_underway);
|
||||
CONNECT (report_load_progress);
|
||||
CONNECT (report_load_complete);
|
||||
CONNECT (report_load_failed);
|
||||
CONNECT (title_changed);
|
||||
|
@ -1526,8 +1472,9 @@ nautilus_window_display_error(NautilusWindow *window, const char *error_msg)
|
|||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame *new_view)
|
||||
void
|
||||
nautilus_window_set_content_view_widget (NautilusWindow *window,
|
||||
NautilusViewFrame *new_view)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (new_view == NULL || NAUTILUS_IS_VIEW_FRAME (new_view));
|
||||
|
@ -1579,44 +1526,7 @@ nautilus_window_reload (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/**
|
||||
* window_find_sidebar_panel_by_identifier:
|
||||
* @window: A NautilusWindow
|
||||
* @identifier: The NautilusViewIdentifier to look for
|
||||
*
|
||||
* Search the list of sidebar panels in the given window for one that
|
||||
* matches the given view identifier.
|
||||
*
|
||||
* Returns a referenced object, not a floating one. bonobo_object_unref
|
||||
* it when done playing with it.
|
||||
*/
|
||||
static NautilusViewFrame *
|
||||
window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIdentifier *identifier)
|
||||
{
|
||||
GList *iterator;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (identifier != NULL);
|
||||
|
||||
for (iterator = window->sidebar_panels; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
g_assert (NAUTILUS_IS_VIEW_FRAME (iterator->data));
|
||||
|
||||
sidebar_panel = NAUTILUS_VIEW_FRAME (iterator->data);
|
||||
|
||||
if (strcmp (sidebar_panel->iid, identifier->iid) == 0) {
|
||||
gtk_widget_ref (GTK_WIDGET (sidebar_panel));
|
||||
return sidebar_panel;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* window_update_sidebar_panels_from_preferences:
|
||||
* update_sidebar_panels_from_preferences:
|
||||
* @window: A NautilusWindow
|
||||
*
|
||||
* Update the current list of sidebar panels from preferences.
|
||||
|
@ -1627,82 +1537,16 @@ window_find_sidebar_panel_by_identifier (NautilusWindow *window, NautilusViewIde
|
|||
*
|
||||
*/
|
||||
static void
|
||||
window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
update_sidebar_panels_from_preferences (NautilusWindow *window)
|
||||
{
|
||||
GList *enabled_view_identifier_list = NULL;
|
||||
GList *disabled_view_identifier_list = NULL;
|
||||
GList *iterator = NULL;
|
||||
GList *identifier_list;
|
||||
|
||||
g_assert (window != NULL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
/* Obtain list of disabled view identifiers */
|
||||
disabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Remove disabled panels from the window as needed */
|
||||
for (iterator = disabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel != NULL) {
|
||||
nautilus_window_disconnect_view (window, sidebar_panel);
|
||||
nautilus_window_remove_sidebar_panel (window, sidebar_panel);
|
||||
}
|
||||
}
|
||||
|
||||
if (disabled_view_identifier_list) {
|
||||
nautilus_view_identifier_list_free (disabled_view_identifier_list);
|
||||
}
|
||||
|
||||
/* Obtain list of enabled view identifiers */
|
||||
enabled_view_identifier_list =
|
||||
nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
|
||||
/* Add enabled panels from the window as needed */
|
||||
for (iterator = enabled_view_identifier_list; iterator != NULL; iterator = iterator->next) {
|
||||
NautilusViewIdentifier *identifier;
|
||||
NautilusViewFrame *sidebar_panel;
|
||||
|
||||
g_assert (iterator->data != NULL);
|
||||
|
||||
identifier = (NautilusViewIdentifier *) iterator->data;
|
||||
|
||||
sidebar_panel = window_find_sidebar_panel_by_identifier (window, identifier);
|
||||
|
||||
if (sidebar_panel == NULL) {
|
||||
gboolean load_result;
|
||||
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
|
||||
load_result = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
||||
/* Make sure the load_client succeeded */
|
||||
if (load_result) {
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_add_sidebar_panel (window, sidebar_panel);
|
||||
} else {
|
||||
g_warning ("sidebar_panels_changed_callback: Failed to load_client for '%s' meta view.",
|
||||
identifier->iid);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
|
||||
sidebar_panel = NULL;
|
||||
}
|
||||
} else {
|
||||
gtk_widget_unref (GTK_WIDGET (sidebar_panel));
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_view_identifier_list_free (enabled_view_identifier_list);
|
||||
identifier_list = nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers ();
|
||||
nautilus_window_set_sidebar_panels (window, identifier_list);
|
||||
nautilus_view_identifier_list_free (identifier_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1715,7 +1559,7 @@ window_update_sidebar_panels_from_preferences (NautilusWindow *window)
|
|||
static void
|
||||
sidebar_panels_changed_callback (gpointer user_data)
|
||||
{
|
||||
window_update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
update_sidebar_panels_from_preferences (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1768,7 +1612,6 @@ nautilus_window_hide_location_bar (NautilusWindow *window)
|
|||
hide_dock_item (window, URI_ENTRY_DOCK_ITEM);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_window_show_location_bar (NautilusWindow *window)
|
||||
{
|
||||
|
@ -1861,7 +1704,8 @@ nautilus_window_status_bar_showing (NautilusWindow *window)
|
|||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return (app->statusbar != NULL && GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent));
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
/*
|
||||
* Nautilus
|
||||
|
@ -50,106 +50,97 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
GnomeAppClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
||||
typedef enum {
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
NAUTILUS_LOCATION_CHANGE_STANDARD,
|
||||
NAUTILUS_LOCATION_CHANGE_BACK,
|
||||
NAUTILUS_LOCATION_CHANGE_FORWARD,
|
||||
NAUTILUS_LOCATION_CHANGE_RELOAD
|
||||
} NautilusLocationChangeType;
|
||||
|
||||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *new_sidebar_panels;
|
||||
GList *error_views;
|
||||
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
nautilus_boolean_bit changes_pending : 1;
|
||||
nautilus_boolean_bit views_shown : 1;
|
||||
nautilus_boolean_bit view_bombed_out : 1;
|
||||
nautilus_boolean_bit view_activation_complete : 1;
|
||||
nautilus_boolean_bit sent_update_view : 1;
|
||||
nautilus_boolean_bit cv_progress_initial : 1;
|
||||
nautilus_boolean_bit cv_progress_done : 1;
|
||||
nautilus_boolean_bit cv_progress_error : 1;
|
||||
nautilus_boolean_bit reset_to_idle : 1;
|
||||
GnomeApp parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
/** UI stuff **/
|
||||
NautilusSidebar *sidebar;
|
||||
GtkWidget *content_hbox;
|
||||
GtkWidget *view_as_option_menu;
|
||||
GtkWidget *navigation_bar;
|
||||
|
||||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
gboolean updating_bonobo_radio_menu_item;
|
||||
|
||||
/** State information **/
|
||||
|
||||
/* Information about current location/selection */
|
||||
char *location;
|
||||
GList *selection;
|
||||
|
||||
/* Back/Forward chain, and history list.
|
||||
* The data in these lists are NautilusBookmark pointers.
|
||||
*/
|
||||
GList *back_list, *forward_list;
|
||||
|
||||
NautilusBookmark *current_location_bookmark;
|
||||
NautilusBookmark *last_location_bookmark;
|
||||
|
||||
/* Current views stuff */
|
||||
NautilusViewFrame *content_view;
|
||||
NautilusViewIdentifier *content_view_id;
|
||||
GList *sidebar_panels;
|
||||
|
||||
/* Widgets to keep track of (for state changes, etc) */
|
||||
GtkWidget *back_button;
|
||||
GtkWidget *forward_button;
|
||||
GtkWidget *up_button;
|
||||
GtkWidget *reload_button;
|
||||
GtkWidget *search_local_button;
|
||||
GtkWidget *search_web_button;
|
||||
GtkWidget *stop_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
GtkWidget *zoom_control;
|
||||
GtkWidget *throbber;
|
||||
|
||||
/* Pending changes */
|
||||
NautilusNavigationInfo *pending_ni;
|
||||
NautilusViewFrame *new_content_view;
|
||||
GList *pending_selection;
|
||||
GList *error_views;
|
||||
NautilusNavigationInfo *cancel_tag;
|
||||
gboolean location_change_end_reached;
|
||||
|
||||
guint16 making_changes;
|
||||
|
||||
NautilusLocationChangeType location_change_type;
|
||||
guint location_change_distance;
|
||||
|
||||
gboolean views_shown;
|
||||
gboolean view_bombed_out;
|
||||
gboolean view_activation_complete;
|
||||
gboolean sent_update_view;
|
||||
gboolean cv_progress_initial;
|
||||
gboolean cv_progress_done;
|
||||
gboolean cv_progress_error;
|
||||
gboolean reset_to_idle;
|
||||
};
|
||||
|
||||
GtkType nautilus_window_get_type (void);
|
||||
void nautilus_window_close (NautilusWindow *window);
|
||||
void nautilus_window_set_content_view (NautilusWindow *window,
|
||||
NautilusViewFrame *content_view);
|
||||
void nautilus_window_add_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_remove_sidebar_panel (NautilusWindow *window,
|
||||
NautilusViewFrame *sidebar_panel);
|
||||
void nautilus_window_goto_uri (NautilusWindow *window,
|
||||
const char *uri);
|
||||
gboolean nautilus_window_get_search_mode (NautilusWindow *window);
|
||||
|
|
|
@ -52,9 +52,9 @@ usage (const char *name)
|
|||
static GnomeVFSMimeActionType
|
||||
str_to_action_type (const char *str)
|
||||
{
|
||||
if (strcasecmp (str, "component") == 0) {
|
||||
if (g_strcasecmp (str, "component") == 0) {
|
||||
return GNOME_VFS_MIME_ACTION_TYPE_COMPONENT;
|
||||
} else if (strcasecmp (str, "application") == 0) {
|
||||
} else if (g_strcasecmp (str, "application") == 0) {
|
||||
return GNOME_VFS_MIME_ACTION_TYPE_APPLICATION;
|
||||
} else {
|
||||
return GNOME_VFS_MIME_ACTION_TYPE_NONE;
|
||||
|
|
Loading…
Reference in a new issue