diff options
author | Darin Adler <darin@src.gnome.org> | 2001-01-04 02:15:56 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-01-04 02:15:56 +0000 |
commit | f683ed7935cfb180946c4fb0b39edc6311ee25a1 (patch) | |
tree | f8867c5d687389a9b5db11295897b0fa76913bba /libnautilus | |
parent | ec540c3e648e4a0b71eebff5e767c3c233de6841 (diff) | |
download | nautilus-f683ed7935cfb180946c4fb0b39edc6311ee25a1.tar.gz |
reviewed by: Pavel Cisler <pavel@eazel.com>
Fix bug 5235 ("Forget History" eliminates history from Go menu,
not History sidebar panel).
* components/history/nautilus-history-view.c:
(install_icons): Fix leak of pixmap and bitmap.
(update_history): Replaced dual lock system with a single one.
(button_press_callback): Only respect button 1, ignore others.
(button_release_callback): Only respect button 1, ignore others,
(history_changed_callback): A new single callback for when the
history list changes to replace the multiple callbacks before.
(nautilus_history_view_initialize_class),
(nautilus_history_view_initialize),
(nautilus_history_view_destroy), (main): Change the history view
to use nautilus_view_standard_main which requires a subclass. This
gets rid of a lot of boilerplate code.
* libnautilus/nautilus-view-component.idl: Make every NautilusView
get an explicit history_changed call instead of requiring them to
guess when to get history. Removed the old get_history_list call
and also renamed the HistoryList sequence to History.
* libnautilus/nautilus-view.h:
* libnautilus/nautilus-view.c:
(impl_Nautilus_View_history_changed),
(nautilus_view_initialize_class): Added the necessary stuff to
cover the new history_changed call.
* src/nautilus-view-frame.h:
* src/nautilus-view-frame.c: (nautilus_view_frame_initialize):
Connect handlers so we can send history_changed calls to the
NautilusView when either the history or the icons change.
(nautilus_view_frame_destroy): Change state to EMPTY so the
history signal won't be sent once the frame is destroyed.
(view_frame_activated): Send a history_changed to every
newly-activated view.
(get_CORBA_object): Helper function to make code that makes CORBA
calls simpler.
(check_if_view_is_gone): Use get_CORBA_object.
(attach_client): Gave a nicer name, removed the code that makes
the Nautilus_HistoryFrame interface.
(nautilus_view_frame_load_client): Do the attach_client (formerly
nautilus_view_frame_set_to_component) before calling
view_frame_activated. This is needed since view_frame_activated
now sends a history_changed to the view.
(nautilus_view_frame_load_location),
(nautilus_view_frame_stop_loading),
(nautilus_view_frame_selection_changed),
(nautilus_view_frame_title_changed): Use get_CORBA_object.
(get_history_list): Made this private.
(send_history): Helper function that sends history to the view if
it's in the appropriate state.
* src/Makefile.am:
* src/nautilus-history-frame.c:
* src/nautilus-history-frame.h:
Removed the old NautilusHistoryFrame, which is no longer needed
since we put the history call right in the NautilusView class.
* src/nautilus-window-manage-views.c: (get_history_list_callback):
Updated for Nautilus_HistoryList -> Nautilus_History change.
Fix bug 5391 ("Esc" Canceling of an icon stretch doesn't restore
icon position.).
* libnautilus-extensions/nautilus-icon-private.h:
* libnautilus-extensions/nautilus-icon-container.c:
(clear_drag_state): Add a single bottleneck function to make sure
the context menu timeout always gets canceled.
(continue_stretching): Remove the unused "update_position" parameter.
(undo_stretching): Consolidate the cancel_stretching function and
restore the icon's position as well as its size. Also use the new
bottleneck to clear the drag state.
(button_release_event): Use the new bottleneck to clear the drag
state.
(show_context_menu_callback): Use the new bottleneck to clear the
drag state.
(nautilus_icon_container_set_selection),
(nautilus_icon_container_select_list_unselect_others): Take
advantage of the defaults in g_hash_table_new and use NULL, NULL
instead of g_direct_hash, g_direct_equal.
(nautilus_icon_container_show_stretch_handles): Save the position
as well as the size.
(compute_stretch): Add a FIXME with a bug number.
Fix bug 5407 (Make "Hardware Overview" title translatable).
* components/hardware/nautilus-hardware-view.c:
(nautilus_hardware_view_destroy): Remove unused uri field.
(extract_info): Fix storage leak.
(get_RAM_description): Get rid of code that non-portably relies on
long long. Mark strings for translation.
(get_IDE_description): Get rid of code that non-portably relies on
long long. Mark strings for translation.
(setup_overview_form): Marked string for translation.
(setup_CPU_form), (setup_RAM_form), (setup_IDE_form),
(is_location), (nautilus_hardware_view_load_uri): Disable the
views other than the overview for now since they are not ready to
be seen.
(nautilus_hardware_view_drag_data_received): Get rid of the code
that makes the hardware view accept a URI list drag.
Fix bug 5405 (nautilus --check fails when using LC_ALL=sv_SE due
to missing entry in POTFILES.in).
* po/POTFILES.in: Added nautilus-glib-extensions.c.
Other changes.
* src/nautilus-signaller.h:
* src/nautilus-signaller.c: (nautilus_signaller_initialize_class),
(nautilus_signaller_get_current):
Change the NautilusSignaller class so that the interface calls the
object a GtkObject * and the details of the class are hidden.
* src/nautilus-property-browser.c: (emit_emblems_changed_signal):
* src/nautilus-search-bar-criterion.c:
(nautilus_search_bar_criterion_destroy),
(nautilus_search_bar_criterion_new_from_values):
* src/nautilus-window-menus.c:
(nautilus_window_initialize_go_menu):
* src/nautilus-window.c: (nautilus_send_history_list_changed):
Now that nautilus_signaller_get_current returns a GtkObject,
remove some unnecessary casts.
* components/html/glibwww-callbacks.c: (get_sock_info),
(glibwww_timer_register):
* components/tree/nautilus-tree-model.c:
(nautilus_tree_model_initialize):
* components/tree/nautilus-tree-view.c:
(nautilus_tree_view_initialize):
* libnautilus-extensions/nautilus-directory-async.c:
(async_job_start):
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_notify_files_added),
(nautilus_directory_notify_files_removed),
(nautilus_directory_notify_files_moved):
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_initialize):
* libnautilus-extensions/nautilus-list.c:
(nautilus_list_set_selection):
* libnautilus-extensions/nautilus-merged-directory.c:
(nautilus_merged_directory_initialize):
* libnautilus-extensions/nautilus-trash-directory.c:
(nautilus_trash_directory_initialize):
* src/file-manager/fm-properties-window.c:
(fm_properties_window_present):
Take advantage of the defaults in g_hash_table_new and use NULL,
NULL instead of g_direct_hash, g_direct_equal.
Diffstat (limited to 'libnautilus')
-rw-r--r-- | libnautilus/nautilus-view-component.idl | 30 | ||||
-rw-r--r-- | libnautilus/nautilus-view.c | 31 | ||||
-rw-r--r-- | libnautilus/nautilus-view.h | 31 |
3 files changed, 48 insertions, 44 deletions
diff --git a/libnautilus/nautilus-view-component.idl b/libnautilus/nautilus-view-component.idl index 6ed271ae5..46680cd86 100644 --- a/libnautilus/nautilus-view-component.idl +++ b/libnautilus/nautilus-view-component.idl @@ -52,6 +52,13 @@ module Nautilus { typedef string URI; typedef sequence<URI> URIList; + struct HistoryItem { + string title; + URI location; + string icon; + }; + typedef sequence<HistoryItem> History; + /* The View interface is used by the Nautilus shell to control * the view. A view that is a Bonobo::Control can choose to * implement the View interface for additional finer control @@ -70,6 +77,9 @@ module Nautilus { /* Called to tell the view about title changes. */ oneway void title_changed (in string title); + + /* Called to tell the view about history changes. */ + oneway void history_changed (in History history); }; /* The ViewFrame interface is used by the view to communicate @@ -121,26 +131,6 @@ module Nautilus { /* Called by a view component to change the title. */ oneway void set_title (in string new_title); - }; - - /* The specifications for a history list item. The structure - * contains the title of the item, and the location it's for. - */ - struct HistoryItem { - string title; - URI location; - string icon; - }; - typedef sequence<HistoryItem> HistoryList; - - /* An interface that a component can use to get at the history - * list stored in Nautilus. - */ - interface HistoryFrame : ::Bonobo::Unknown { - /* Called by a view component to get the Nautilus - * history list. - */ - HistoryList get_history_list (); }; }; diff --git a/libnautilus/nautilus-view.c b/libnautilus/nautilus-view.c index 5be86a4f3..7174badd2 100644 --- a/libnautilus/nautilus-view.c +++ b/libnautilus/nautilus-view.c @@ -40,9 +40,10 @@ #include <libnautilus-extensions/nautilus-gtk-macros.h> enum { + HISTORY_CHANGED, LOAD_LOCATION, - STOP_LOADING, SELECTION_CHANGED, + STOP_LOADING, TITLE_CHANGED, LAST_SIGNAL }; @@ -69,6 +70,9 @@ static void impl_Nautilus_View_selection_changed (PortableServer_Servant servan static void impl_Nautilus_View_title_changed (PortableServer_Servant servant, const CORBA_char *title, CORBA_Environment *ev); +static void impl_Nautilus_View_history_changed (PortableServer_Servant servant, + const Nautilus_History *history, + CORBA_Environment *ev); static void nautilus_view_initialize (NautilusView *view); static void nautilus_view_destroy (GtkObject *object); static void nautilus_view_initialize_class (NautilusViewClass *klass); @@ -78,10 +82,11 @@ NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusView, nautilus_view, BONOBO_OBJECT_TY static POA_Nautilus_View__epv libnautilus_Nautilus_View_epv = { NULL, - &impl_Nautilus_View_load_location, - &impl_Nautilus_View_stop_loading, - &impl_Nautilus_View_selection_changed, - &impl_Nautilus_View_title_changed + impl_Nautilus_View_load_location, + impl_Nautilus_View_stop_loading, + impl_Nautilus_View_selection_changed, + impl_Nautilus_View_title_changed, + impl_Nautilus_View_history_changed }; static PortableServer_ServantBase__epv base_epv; @@ -179,6 +184,15 @@ impl_Nautilus_View_title_changed (PortableServer_Servant servant, title); } +static void +impl_Nautilus_View_history_changed (PortableServer_Servant servant, + const Nautilus_History *history, + CORBA_Environment *ev) +{ + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->bonobo_object), + signals[HISTORY_CHANGED], + history); +} static void impl_Nautilus_View__destroy (BonoboObject *object, PortableServer_Servant servant) @@ -256,6 +270,13 @@ nautilus_view_initialize_class (NautilusViewClass *klass) GTK_SIGNAL_OFFSET (NautilusViewClass, title_changed), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[HISTORY_CHANGED] = + gtk_signal_new ("history_changed", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, history_changed), + gtk_marshal_NONE__POINTER, + GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } diff --git a/libnautilus/nautilus-view.h b/libnautilus/nautilus-view.h index 436ceebb7..7bd49bfec 100644 --- a/libnautilus/nautilus-view.h +++ b/libnautilus/nautilus-view.h @@ -22,6 +22,7 @@ * * Authors: Elliot Lee <sopwith@redhat.com> * Maciej Stachowiak <mjs@eazel.com> + * Darin Adler <darin@eazel.com> * */ @@ -30,11 +31,8 @@ #include <libnautilus/nautilus-view-component.h> #include <bonobo/bonobo-control.h> -#include <gtk/gtkwidget.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +BEGIN_GNOME_DECLS #define NAUTILUS_TYPE_VIEW (nautilus_view_get_type ()) #define NAUTILUS_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VIEW, NautilusView)) @@ -46,27 +44,26 @@ typedef struct NautilusViewDetails NautilusViewDetails; typedef struct { BonoboObject parent_spot; - NautilusViewDetails *details; } NautilusView; typedef struct { BonoboObjectClass parent_spot; - void (*load_location) (NautilusView *view, - const char *location_uri); - void (*stop_loading) (NautilusView *view); - void (*selection_changed) (NautilusView *view, - GList *selection); /* list of URI char *s */ - void (*title_changed) (NautilusView *view, - const char *title); + void (* load_location) (NautilusView *view, + const char *location_uri); + void (* stop_loading) (NautilusView *view); + void (* selection_changed) (NautilusView *view, + GList *selection); /* list of URI char *s */ + void (* title_changed) (NautilusView *view, + const char *title); + void (* history_changed) (NautilusView *view, + const Nautilus_History *history); } NautilusViewClass; GtkType nautilus_view_get_type (void); NautilusView * nautilus_view_new (GtkWidget *widget); NautilusView * nautilus_view_new_from_bonobo_control (BonoboControl *bonobo_control); - - BonoboControl * nautilus_view_get_bonobo_control (NautilusView *view); /* Calls to the Nautilus shell via the view frame. See the IDL for detailed comments. */ @@ -102,16 +99,12 @@ BonoboUIComponent *nautilus_view_set_up_ui (NautilusV const char *ui_xml_file_name, const char *application_name); - /* `protected' functions for use by subclasses only. */ NautilusView * nautilus_view_construct (NautilusView *view, GtkWidget *widget); NautilusView * nautilus_view_construct_from_bonobo_control (NautilusView *view, BonoboControl *bonobo_control); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ +END_GNOME_DECLS #endif /* NAUTILUS_VIEW_H */ |