mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 10:45:41 +00:00
Because lots of recent bugs were due to "signal handler called after
* Tons of files: Because lots of recent bugs were due to "signal handler called after object gone" problems, switched many calls of g_signal_connect and g_signal_connect_swapped to use g_signal_connect_object instead. Also did other signal-related cleanup and changed some destroys to finalizes. * libnautilus/nautilus-view-standard-main.h: We no longer need to include nautilus-view.h in here. So include it in the files that use this instead. Did merges from stable branch: 2001-10-25 Darin Adler <darin@bentspoon.com> * libnautilus-private/nautilus-directory.c: (call_files_changed_common), (call_files_changed_free_list), (call_files_changed_unref_free_list), (nautilus_directory_notify_files_changed): Move call to nautilus_directory_add_file_to_work_queue into a better bottleneck; now it catches all the notify cases, not just changed. Also tell it to re-get top-left text and link info too when we get a changed notice. * src/file-manager/fm-directory-view.c: (queue_pending_files): Don't use the timeout (and the hysteresis) when queuing files once the initial directory load is complete. Doing this was causing delays processing changes that came in later, which we don't want. * src/nautilus-sidebar-title.c: (item_count_ready), (monitor_add), (update_all), (nautilus_sidebar_title_set_file): Monitor the directory count once we get it the first time. This makes sure that changes in the directory count get reflected in the sidebar without creating a race with the main view to see who calculates it first. 2001-10-25 Alex Larsson <alexl@redhat.com> * libnautilus-private/nautilus-directory.c (nautilus_directory_notify_files_changed): Call nautilus_directory_add_file_to_work_queue() when file_info is invalidated. Otherwise it will not be read again.
This commit is contained in:
parent
6b5798037c
commit
136742e4ef
45
ChangeLog
45
ChangeLog
|
@ -1,3 +1,48 @@
|
|||
2002-03-07 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* Tons of files:
|
||||
Because lots of recent bugs were due to "signal handler called after
|
||||
object gone" problems, switched many calls of g_signal_connect and
|
||||
g_signal_connect_swapped to use g_signal_connect_object instead.
|
||||
Also did other signal-related cleanup and changed some destroys to
|
||||
finalizes.
|
||||
|
||||
* libnautilus/nautilus-view-standard-main.h:
|
||||
We no longer need to include nautilus-view.h in here. So include it
|
||||
in the files that use this instead.
|
||||
|
||||
Did merges from stable branch:
|
||||
|
||||
2001-10-25 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* libnautilus-private/nautilus-directory.c:
|
||||
(call_files_changed_common), (call_files_changed_free_list),
|
||||
(call_files_changed_unref_free_list),
|
||||
(nautilus_directory_notify_files_changed): Move call to
|
||||
nautilus_directory_add_file_to_work_queue into a better
|
||||
bottleneck; now it catches all the notify cases, not just changed.
|
||||
Also tell it to re-get top-left text and link info too when we get
|
||||
a changed notice.
|
||||
|
||||
* src/file-manager/fm-directory-view.c: (queue_pending_files):
|
||||
Don't use the timeout (and the hysteresis) when queuing files once
|
||||
the initial directory load is complete. Doing this was causing
|
||||
delays processing changes that came in later, which we don't want.
|
||||
|
||||
* src/nautilus-sidebar-title.c: (item_count_ready), (monitor_add),
|
||||
(update_all), (nautilus_sidebar_title_set_file): Monitor the
|
||||
directory count once we get it the first time. This makes sure
|
||||
that changes in the directory count get reflected in the sidebar
|
||||
without creating a race with the main view to see who calculates
|
||||
it first.
|
||||
|
||||
2001-10-25 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* libnautilus-private/nautilus-directory.c
|
||||
(nautilus_directory_notify_files_changed): Call
|
||||
nautilus_directory_add_file_to_work_queue() when file_info is
|
||||
invalidated. Otherwise it will not be read again.
|
||||
|
||||
2002-03-07 Michael Meeks <michael@ximian.com>
|
||||
|
||||
* libnautilus-private/nautilus-horizontal-splitter.c
|
||||
|
|
|
@ -164,8 +164,8 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
|||
|
||||
strategy->details->widget = bonobo_control_frame_get_widget (strategy->details->control_frame);
|
||||
|
||||
g_signal_connect (strategy->details->control_frame,
|
||||
"activate_uri", G_CALLBACK (activate_uri_callback), strategy);
|
||||
g_signal_connect_object (strategy->details->control_frame, "activate_uri",
|
||||
G_CALLBACK (activate_uri_callback), strategy, 0);
|
||||
|
||||
CORBA_exception_init (&ev);
|
||||
corba_zoomable = Bonobo_Unknown_queryInterface (control,
|
||||
|
|
|
@ -168,11 +168,10 @@ nautilus_adapter_control_factory_embed_strategy_new (Bonobo_ControlFactory contr
|
|||
if ((ev._major == CORBA_NO_EXCEPTION) &&
|
||||
!CORBA_Object_is_nil (control, &ev)) {
|
||||
Bonobo_Zoomable corba_zoomable;
|
||||
strategy->details->client_widget = bonobo_control_frame_get_widget (
|
||||
strategy->details->control_frame);
|
||||
g_signal_connect (strategy->details->control_frame,
|
||||
"activate_uri",
|
||||
G_CALLBACK (activate_uri_callback), strategy);
|
||||
strategy->details->client_widget = bonobo_control_frame_get_widget
|
||||
(strategy->details->control_frame);
|
||||
g_signal_connect_object (strategy->details->control_frame, "activate_uri",
|
||||
G_CALLBACK (activate_uri_callback), strategy, 0);
|
||||
|
||||
gtk_widget_show (strategy->details->client_widget);
|
||||
|
||||
|
|
|
@ -46,10 +46,6 @@ struct NautilusAdapterDetails {
|
|||
NautilusView *nautilus_view;
|
||||
NautilusAdapterEmbedStrategy *embed_strategy;
|
||||
NautilusAdapterLoadStrategy *load_strategy;
|
||||
guint report_load_underway_id;
|
||||
guint report_load_progress_id;
|
||||
guint report_load_complete_id;
|
||||
guint report_load_failed_id;
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,15 +100,6 @@ nautilus_adapter_destroy (GtkObject *object)
|
|||
|
||||
adapter = NAUTILUS_ADAPTER (object);
|
||||
|
||||
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
|
||||
adapter->details->report_load_underway_id);
|
||||
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
|
||||
adapter->details->report_load_progress_id);
|
||||
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
|
||||
adapter->details->report_load_complete_id);
|
||||
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
|
||||
adapter->details->report_load_failed_id);
|
||||
|
||||
if (adapter->details->embed_strategy != NULL) {
|
||||
nautilus_adapter_embed_strategy_deactivate (adapter->details->embed_strategy);
|
||||
}
|
||||
|
@ -166,14 +153,10 @@ nautilus_adapter_new (Bonobo_Unknown component)
|
|||
if (zoomable != NULL)
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (control), zoomable);
|
||||
|
||||
g_signal_connect (control, "activate",
|
||||
G_CALLBACK (nautilus_adapter_activate_callback),
|
||||
adapter);
|
||||
|
||||
g_signal_connect (adapter->details->embed_strategy, "open_location",
|
||||
G_CALLBACK (nautilus_adapter_open_location_callback),
|
||||
adapter);
|
||||
|
||||
g_signal_connect_object (control, "activate",
|
||||
G_CALLBACK (nautilus_adapter_activate_callback), adapter, 0);
|
||||
g_signal_connect_object (adapter->details->embed_strategy, "open_location",
|
||||
G_CALLBACK (nautilus_adapter_open_location_callback), adapter, 0);
|
||||
|
||||
/* Get the class to handle loading this kind of component. */
|
||||
adapter->details->load_strategy = nautilus_adapter_load_strategy_get (component);
|
||||
|
@ -183,40 +166,28 @@ nautilus_adapter_new (Bonobo_Unknown component)
|
|||
}
|
||||
|
||||
/* hook up load strategy signals */
|
||||
adapter->details->report_load_underway_id =
|
||||
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
|
||||
"report_load_underway",
|
||||
G_CALLBACK (nautilus_adapter_load_underway_callback),
|
||||
GTK_OBJECT (adapter));
|
||||
adapter->details->report_load_progress_id =
|
||||
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
|
||||
"report_load_progress",
|
||||
G_CALLBACK (nautilus_adapter_load_progress_callback),
|
||||
GTK_OBJECT (adapter));
|
||||
adapter->details->report_load_complete_id =
|
||||
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
|
||||
"report_load_complete",
|
||||
G_CALLBACK (nautilus_adapter_load_complete_callback),
|
||||
GTK_OBJECT (adapter));
|
||||
adapter->details->report_load_failed_id =
|
||||
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
|
||||
"report_load_failed",
|
||||
G_CALLBACK (nautilus_adapter_load_failed_callback),
|
||||
GTK_OBJECT (adapter));
|
||||
g_signal_connect_object (adapter->details->load_strategy, "report_load_underway",
|
||||
G_CALLBACK (nautilus_adapter_load_underway_callback),
|
||||
adapter, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (adapter->details->load_strategy, "report_load_progress",
|
||||
G_CALLBACK (nautilus_adapter_load_progress_callback),
|
||||
adapter, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (adapter->details->load_strategy, "report_load_complete",
|
||||
G_CALLBACK (nautilus_adapter_load_complete_callback),
|
||||
adapter, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (adapter->details->load_strategy, "report_load_failed",
|
||||
G_CALLBACK (nautilus_adapter_load_failed_callback),
|
||||
adapter, G_CONNECT_SWAPPED);
|
||||
|
||||
/* complete the embedding */
|
||||
gtk_container_add (GTK_CONTAINER (bin),
|
||||
nautilus_adapter_embed_strategy_get_widget (adapter->details->embed_strategy));
|
||||
|
||||
/* hook up view signals. */
|
||||
g_signal_connect (adapter->details->nautilus_view,
|
||||
"load_location",
|
||||
G_CALLBACK (nautilus_adapter_load_location_callback),
|
||||
adapter);
|
||||
g_signal_connect (adapter->details->nautilus_view,
|
||||
"stop_loading",
|
||||
G_CALLBACK (nautilus_adapter_stop_loading_callback),
|
||||
adapter);
|
||||
g_signal_connect_object (adapter->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (nautilus_adapter_load_location_callback), adapter, 0);
|
||||
g_signal_connect_object (adapter->details->nautilus_view, "stop_loading",
|
||||
G_CALLBACK (nautilus_adapter_stop_loading_callback), adapter, 0);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
|
|
@ -158,10 +158,8 @@ nautilus_hardware_view_init (NautilusHardwareView *hardware_view)
|
|||
|
||||
hardware_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (hardware_view));
|
||||
|
||||
g_signal_connect (hardware_view->details->nautilus_view,
|
||||
"load_location",
|
||||
G_CALLBACK (hardware_view_load_location_callback),
|
||||
hardware_view);
|
||||
g_signal_connect_object (hardware_view->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (hardware_view_load_location_callback), hardware_view, 0);
|
||||
|
||||
background = eel_get_widget_background (GTK_WIDGET (hardware_view));
|
||||
eel_background_set_color (background, HARDWARE_DEFAULT_BACKGROUND_COLOR);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <gtk/gtkscrolledwindow.h>
|
||||
#include <libgnome/gnome-macros.h>
|
||||
#include <libnautilus-private/nautilus-bookmark.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <libnautilus/nautilus-view-standard-main.h>
|
||||
|
||||
#define FACTORY_IID "OAFIID:nautilus_history_view_factory:912d6634-d18f-40b6-bb83-bdfe16f1d15e"
|
||||
|
@ -245,8 +246,8 @@ nautilus_history_view_instance_init (NautilusHistoryView *view)
|
|||
(selection, "changed",
|
||||
G_CALLBACK (on_selection_changed), view, 0);
|
||||
|
||||
g_signal_connect (view, "history_changed",
|
||||
G_CALLBACK (history_changed_callback), view);
|
||||
g_signal_connect_object (view, "history_changed",
|
||||
G_CALLBACK (history_changed_callback), view, 0);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -77,18 +77,15 @@ nautilus_content_loser_init (NautilusContentLoser *view)
|
|||
|
||||
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
|
||||
|
||||
g_signal_connect (view->details->nautilus_view,
|
||||
"load_location",
|
||||
G_CALLBACK (loser_load_location_callback),
|
||||
view);
|
||||
g_signal_connect_object (view->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (loser_load_location_callback), view, 0);
|
||||
|
||||
/* Get notified when our bonobo control is activated so we
|
||||
* can merge menu & toolbar items into Nautilus's UI.
|
||||
*/
|
||||
g_signal_connect (nautilus_view_get_bonobo_control (view->details->nautilus_view),
|
||||
"activate",
|
||||
G_CALLBACK (loser_merge_bonobo_items_callback),
|
||||
view);
|
||||
g_signal_connect_object (nautilus_view_get_bonobo_control (view->details->nautilus_view),
|
||||
"activate",
|
||||
G_CALLBACK (loser_merge_bonobo_items_callback), view, 0);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (view));
|
||||
}
|
||||
|
|
|
@ -79,19 +79,15 @@ nautilus_sidebar_loser_init (NautilusSidebarLoser *view)
|
|||
|
||||
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
|
||||
|
||||
g_signal_connect (view->details->nautilus_view,
|
||||
"load_location",
|
||||
G_CALLBACK (loser_load_location_callback),
|
||||
view);
|
||||
g_signal_connect_object (view->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (loser_load_location_callback), view, 0);
|
||||
|
||||
/*
|
||||
* Get notified when our bonobo control is activated so we
|
||||
/* Get notified when our bonobo control is activated so we
|
||||
* can merge menu & toolbar items into Nautilus's UI.
|
||||
*/
|
||||
g_signal_connect (nautilus_view_get_bonobo_control (view->details->nautilus_view),
|
||||
"activate",
|
||||
G_CALLBACK (loser_merge_bonobo_items_callback),
|
||||
view);
|
||||
g_signal_connect_object (nautilus_view_get_bonobo_control (view->details->nautilus_view),
|
||||
"activate",
|
||||
G_CALLBACK (loser_merge_bonobo_items_callback), view, 0);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (view));
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ static void streaming_save_browse_cb(GtkWidget * w, gpointer data)
|
|||
{
|
||||
streaming_save_dirbrowser = xmms_create_dir_browser(_("Select the directory where you want to store the MPEG streams:"),
|
||||
mpg123_cfg.save_http_path, GTK_SELECTION_SINGLE, streaming_save_dirbrowser_cb);
|
||||
g_signal_connect(G_OBJECT(streaming_save_dirbrowser), "destroy", G_CALLBACK(gtk_widget_destroyed), &streaming_save_dirbrowser);
|
||||
g_signal_connect(streaming_save_dirbrowser, "destroy", G_CALLBACK(gtk_widget_destroyed), &streaming_save_dirbrowser);
|
||||
gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), GTK_WINDOW(mpg123_configurewin));
|
||||
gtk_widget_show(streaming_save_dirbrowser);
|
||||
}
|
||||
|
@ -275,8 +275,8 @@ void mpg123_configure(void)
|
|||
return;
|
||||
}
|
||||
mpg123_configurewin = gtk_window_new(GTK_WINDOW_DIALOG);
|
||||
g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy", G_CALLBACK(gtk_widget_destroyed), &mpg123_configurewin);
|
||||
g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy", G_CALLBACK(configure_destroy), &mpg123_configurewin);
|
||||
g_signal_connect(mpg123_configurewin, "destroy", G_CALLBACK(gtk_widget_destroyed), &mpg123_configurewin);
|
||||
g_signal_connect(mpg123_configurewin, "destroy", G_CALLBACK(configure_destroy), &mpg123_configurewin);
|
||||
gtk_window_set_title(GTK_WINDOW(mpg123_configurewin), _("MPG123 Configuration"));
|
||||
gtk_window_set_wmclass(GTK_WINDOW(mpg123_configurewin), "mpg123_configuration", "Nautilus");
|
||||
gtk_window_set_policy(GTK_WINDOW(mpg123_configurewin), FALSE, FALSE, FALSE);
|
||||
|
@ -430,14 +430,14 @@ void mpg123_configure(void)
|
|||
if (mpg123_cfg.use_3dnow == 0)
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(auto_select), TRUE);
|
||||
gtk_box_pack_start(GTK_BOX(decoder_vbox), auto_select, FALSE, FALSE, 0);
|
||||
g_signal_connect(G_OBJECT(auto_select), "clicked", G_CALLBACK(auto_select_cb), NULL);
|
||||
g_signal_connect(auto_select, "clicked", G_CALLBACK(auto_select_cb), NULL);
|
||||
gtk_widget_show(auto_select);
|
||||
|
||||
decoder_3dnow = gtk_radio_button_new_with_label(NULL, _("use 3DNow! optimized decoder"));
|
||||
if (((support_3dnow() == TRUE) && mpg123_cfg.use_3dnow != 2) || (mpg123_cfg.use_3dnow == 1))
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_3dnow), TRUE);
|
||||
gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_3dnow, FALSE, FALSE, 0);
|
||||
g_signal_connect(G_OBJECT(decoder_3dnow), "clicked", G_CALLBACK(use_3dnow_cb), NULL);
|
||||
g_signal_connect(decoder_3dnow, "clicked", G_CALLBACK(use_3dnow_cb), NULL);
|
||||
gtk_widget_show(decoder_3dnow);
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_select)) == TRUE)
|
||||
gtk_widget_set_sensitive(decoder_3dnow, FALSE);
|
||||
|
@ -446,7 +446,7 @@ void mpg123_configure(void)
|
|||
if (((support_3dnow() == FALSE) && mpg123_cfg.use_3dnow != 1) || (mpg123_cfg.use_3dnow == 2))
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_fpu), TRUE);
|
||||
gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_fpu, FALSE, FALSE, 0);
|
||||
g_signal_connect(G_OBJECT(decoder_fpu), "clicked", G_CALLBACK(use_fpu_cb), NULL);
|
||||
g_signal_connect(decoder_fpu, "clicked", G_CALLBACK(use_fpu_cb), NULL);
|
||||
gtk_widget_show(decoder_fpu);
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_select)) == TRUE)
|
||||
gtk_widget_set_sensitive(decoder_fpu, FALSE);
|
||||
|
@ -527,7 +527,7 @@ void mpg123_configure(void)
|
|||
|
||||
streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use), mpg123_cfg.use_proxy);
|
||||
g_signal_connect(G_OBJECT(streaming_proxy_use), "clicked", G_CALLBACK(proxy_use_cb), NULL);
|
||||
g_signal_connect(streaming_proxy_use, "clicked", G_CALLBACK(proxy_use_cb), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use, FALSE, FALSE, 0);
|
||||
gtk_widget_show(streaming_proxy_use);
|
||||
|
||||
|
@ -561,7 +561,7 @@ void mpg123_configure(void)
|
|||
streaming_proxy_auth_use = gtk_check_button_new_with_label(_("Use authentication"));
|
||||
gtk_widget_set_sensitive(streaming_proxy_auth_use, mpg123_cfg.use_proxy);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), mpg123_cfg.proxy_use_auth);
|
||||
g_signal_connect(G_OBJECT(streaming_proxy_auth_use), "clicked", G_CALLBACK(proxy_auth_use_cb), NULL);
|
||||
g_signal_connect(streaming_proxy_auth_use, "clicked", G_CALLBACK(proxy_auth_use_cb), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_use, FALSE, FALSE, 0);
|
||||
gtk_widget_show(streaming_proxy_auth_use);
|
||||
|
||||
|
@ -608,7 +608,7 @@ void mpg123_configure(void)
|
|||
|
||||
streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), mpg123_cfg.save_http_stream);
|
||||
g_signal_connect(G_OBJECT(streaming_save_use), "clicked", G_CALLBACK(streaming_save_use_cb), NULL);
|
||||
g_signal_connect(streaming_save_use, "clicked", G_CALLBACK(streaming_save_use_cb), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0);
|
||||
gtk_widget_show(streaming_save_use);
|
||||
|
||||
|
@ -626,7 +626,7 @@ void mpg123_configure(void)
|
|||
gtk_widget_show(streaming_save_entry);
|
||||
|
||||
streaming_save_browse = gtk_button_new_with_label(_("Browse"));
|
||||
g_signal_connect(G_OBJECT(streaming_save_browse), "clicked", G_CALLBACK(streaming_save_browse_cb), NULL);
|
||||
g_signal_connect(streaming_save_browse, "clicked", G_CALLBACK(streaming_save_browse_cb), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0);
|
||||
gtk_widget_show(streaming_save_browse);
|
||||
|
||||
|
@ -666,7 +666,7 @@ void mpg123_configure(void)
|
|||
|
||||
title_id3_use = gtk_check_button_new_with_label(_("Use ID3 tags"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3_use), mpg123_cfg.use_id3);
|
||||
g_signal_connect(G_OBJECT(title_id3_use), "clicked", title_id3_use_cb, NULL);
|
||||
g_signal_connect(title_id3_use, "clicked", title_id3_use_cb, NULL);
|
||||
gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_use, FALSE, FALSE, 0);
|
||||
gtk_widget_show(title_id3_use);
|
||||
|
||||
|
@ -718,14 +718,14 @@ void mpg123_configure(void)
|
|||
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
|
||||
|
||||
ok = gtk_button_new_from_stock (GTK_STOCK_OK);
|
||||
g_signal_connect(G_OBJECT(ok), "clicked", G_CALLBACK(mpg123_configurewin_ok), NULL);
|
||||
g_signal_connect(ok, "clicked", G_CALLBACK(mpg123_configurewin_ok), NULL);
|
||||
GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
|
||||
gtk_widget_show(ok);
|
||||
gtk_widget_grab_default(ok);
|
||||
|
||||
cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
|
||||
g_signal_connect_object(G_OBJECT(cancel), "clicked", G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(mpg123_configurewin));
|
||||
g_signal_connect_object(cancel, "clicked", G_CALLBACK(gtk_widget_destroy), mpg123_configurewin, 0);
|
||||
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
|
||||
gtk_widget_show(cancel);
|
||||
|
|
|
@ -217,7 +217,7 @@ void mpg123_file_info_box(char *filename)
|
|||
|
||||
window = gtk_window_new(GTK_WINDOW_DIALOG);
|
||||
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
|
||||
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_widget_destroyed), &window);
|
||||
g_signal_connect(window, "destroy", G_CALLBACK(gtk_widget_destroyed), &window);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 10);
|
||||
|
@ -304,18 +304,18 @@ void mpg123_file_info_box(char *filename)
|
|||
gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0);
|
||||
|
||||
save = gtk_button_new_with_label(_("Save"));
|
||||
g_signal_connect(G_OBJECT(save), "clicked", G_CALLBACK(save_cb), NULL);
|
||||
g_signal_connect(save, "clicked", G_CALLBACK(save_cb), NULL);
|
||||
GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0);
|
||||
gtk_widget_grab_default(save);
|
||||
|
||||
remove_id3 = gtk_button_new_with_label(_("Remove ID3"));
|
||||
g_signal_connect(G_OBJECT(remove_id3), "clicked", G_CALLBACK(remove_id3_cb), NULL);
|
||||
g_signal_connect(remove_id3, "clicked", G_CALLBACK(remove_id3_cb), NULL);
|
||||
GTK_WIDGET_SET_FLAGS(remove_id3, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start(GTK_BOX(bbox), remove_id3, TRUE, TRUE, 0);
|
||||
|
||||
cancel = gtk_button_new_with_label(_("Cancel"));
|
||||
g_signal_connect_swapped(G_OBJECT(cancel), "clicked", G_CALLBACK(gtk_widget_destroy), G_OBJECT(window));
|
||||
g_signal_connect_object(cancel, "clicked", G_CALLBACK(gtk_widget_destroy), window, G_CONNECT_SWAPPED);
|
||||
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
|
||||
|
||||
|
|
|
@ -421,24 +421,18 @@ nautilus_music_view_init (NautilusMusicView *music_view)
|
|||
music_view->details->event_box = gtk_event_box_new ();
|
||||
gtk_widget_show (music_view->details->event_box);
|
||||
|
||||
g_signal_connect (music_view->details->event_box,
|
||||
"drag_data_received",
|
||||
G_CALLBACK (nautilus_music_view_drag_data_received),
|
||||
music_view);
|
||||
g_signal_connect_object (music_view->details->event_box, "drag_data_received",
|
||||
G_CALLBACK (nautilus_music_view_drag_data_received), music_view, 0);
|
||||
|
||||
nautilus_view_construct (NAUTILUS_VIEW (music_view),
|
||||
music_view->details->event_box);
|
||||
|
||||
|
||||
g_signal_connect (music_view,
|
||||
"load_location",
|
||||
G_CALLBACK (music_view_load_location_callback),
|
||||
music_view);
|
||||
g_signal_connect_object (music_view, "load_location",
|
||||
G_CALLBACK (music_view_load_location_callback), music_view, 0);
|
||||
|
||||
g_signal_connect (eel_get_widget_background (GTK_WIDGET (music_view->details->event_box)),
|
||||
"appearance_changed",
|
||||
G_CALLBACK (music_view_background_appearance_changed_callback),
|
||||
music_view);
|
||||
g_signal_connect_object (eel_get_widget_background (GTK_WIDGET (music_view->details->event_box)),
|
||||
"appearance_changed",
|
||||
G_CALLBACK (music_view_background_appearance_changed_callback), music_view, 0);
|
||||
|
||||
/* NOTE: we don't show the widgets until the directory has been loaded,
|
||||
to avoid showing degenerate widgets during the loading process */
|
||||
|
@ -564,7 +558,7 @@ nautilus_music_view_finalize (GObject *object)
|
|||
|
||||
g_free (music_view->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -772,12 +766,10 @@ set_album_cover (GtkWidget *widget, gpointer *data)
|
|||
}
|
||||
|
||||
/* Callback used when the color selection dialog is destroyed */
|
||||
static gboolean
|
||||
dialog_destroy (GtkWidget *widget, gpointer data)
|
||||
static void
|
||||
dialog_destroy (GtkObject *object, gpointer callback_data)
|
||||
{
|
||||
NautilusMusicView *music_view = NAUTILUS_MUSIC_VIEW (data);
|
||||
music_view->details->dialog = NULL;
|
||||
return FALSE;
|
||||
NAUTILUS_MUSIC_VIEW (callback_data)->details->dialog = NULL;
|
||||
}
|
||||
|
||||
/* handle the set image button by displaying a file selection dialog */
|
||||
|
@ -796,22 +788,13 @@ image_button_callback (GtkWidget * widget, NautilusMusicView *music_view)
|
|||
(_("Select an image file for the album cover:"));
|
||||
file_dialog = GTK_FILE_SELECTION (music_view->details->dialog);
|
||||
|
||||
g_signal_connect (music_view->details->dialog,
|
||||
"destroy",
|
||||
(GtkSignalFunc) dialog_destroy,
|
||||
music_view);
|
||||
g_signal_connect (file_dialog->ok_button,
|
||||
"clicked",
|
||||
(GtkSignalFunc) set_album_cover,
|
||||
music_view);
|
||||
g_signal_connect_object (music_view->details->dialog, "destroy",
|
||||
G_CALLBACK (dialog_destroy), music_view, 0);
|
||||
g_signal_connect_object (file_dialog->ok_button, "clicked",
|
||||
G_CALLBACK (set_album_cover), music_view, 0);
|
||||
|
||||
g_signal_connect_closure (file_dialog->cancel_button,
|
||||
"clicked",
|
||||
g_cclosure_new_swap (
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
file_dialog,
|
||||
NULL),
|
||||
0);
|
||||
g_signal_connect_object (file_dialog->cancel_button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), file_dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_window_set_position (GTK_WINDOW (file_dialog), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_wmclass (GTK_WINDOW (file_dialog), "file_selector", "Nautilus");
|
||||
|
@ -1181,7 +1164,7 @@ play_current_file (NautilusMusicView *music_view, gboolean from_start)
|
|||
/* Check gconf sound preference */
|
||||
client = gconf_client_get_default ();
|
||||
enable_esd = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
|
||||
g_object_unref (G_OBJECT (client));
|
||||
g_object_unref (client);
|
||||
|
||||
if (!enable_esd) {
|
||||
eel_show_error_dialog (_("Sorry, but the music view is unable to play back sound right now. "
|
||||
|
@ -1503,12 +1486,12 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
music_view->details->playtime_adjustment = gtk_adjustment_new (0, 0, 101, 1, 5, 1);
|
||||
music_view->details->playtime_bar = gtk_hscale_new (GTK_ADJUSTMENT (music_view->details->playtime_adjustment));
|
||||
|
||||
g_signal_connect (music_view->details->playtime_bar, "button_press_event",
|
||||
G_CALLBACK (slider_press_callback), music_view);
|
||||
g_signal_connect (music_view->details->playtime_bar, "button_release_event",
|
||||
G_CALLBACK (slider_release_callback), music_view);
|
||||
g_signal_connect (music_view->details->playtime_bar, "motion_notify_event",
|
||||
G_CALLBACK (slider_moved_callback), music_view);
|
||||
g_signal_connect_object (music_view->details->playtime_bar, "button_press_event",
|
||||
G_CALLBACK (slider_press_callback), music_view, 0);
|
||||
g_signal_connect_object (music_view->details->playtime_bar, "button_release_event",
|
||||
G_CALLBACK (slider_release_callback), music_view, 0);
|
||||
g_signal_connect_object (music_view->details->playtime_bar, "motion_notify_event",
|
||||
G_CALLBACK (slider_moved_callback), music_view, 0);
|
||||
|
||||
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), music_view->details->playtime_bar,
|
||||
_("Drag to seek within track"), NULL);
|
||||
|
@ -1540,7 +1523,8 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
music_view->details->previous_track_button = gtk_button_new ();
|
||||
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), music_view->details->previous_track_button, _("Previous"), NULL);
|
||||
gtk_container_add (GTK_CONTAINER (music_view->details->previous_track_button), box);
|
||||
g_signal_connect (music_view->details->previous_track_button, "clicked", G_CALLBACK (prev_button_callback), music_view);
|
||||
g_signal_connect_object (music_view->details->previous_track_button, "clicked",
|
||||
G_CALLBACK (prev_button_callback), music_view, 0);
|
||||
gtk_widget_set_sensitive (music_view->details->previous_track_button, TRUE);
|
||||
gtk_button_set_relief (GTK_BUTTON (music_view->details->previous_track_button), GTK_RELIEF_NORMAL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->previous_track_button, FALSE, FALSE, 0);
|
||||
|
@ -1556,7 +1540,7 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
|
||||
gtk_container_add (GTK_CONTAINER (button), box);
|
||||
gtk_widget_set_sensitive (button, TRUE);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (play_button_callback), music_view);
|
||||
g_signal_connect_object (button, "clicked", G_CALLBACK (play_button_callback), music_view, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
|
@ -1571,8 +1555,8 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
gtk_container_add (GTK_CONTAINER (music_view->details->pause_button), box);
|
||||
gtk_widget_set_sensitive (music_view->details->pause_button, TRUE);
|
||||
|
||||
g_signal_connect (music_view->details->pause_button, "clicked",
|
||||
G_CALLBACK(pause_button_callback), music_view);
|
||||
g_signal_connect_object (music_view->details->pause_button, "clicked",
|
||||
G_CALLBACK (pause_button_callback), music_view, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->pause_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (music_view->details->pause_button);
|
||||
|
||||
|
@ -1585,8 +1569,8 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
gtk_container_add (GTK_CONTAINER (music_view->details->stop_button), box);
|
||||
gtk_widget_set_sensitive (music_view->details->stop_button, TRUE);
|
||||
|
||||
g_signal_connect (music_view->details->stop_button, "clicked",
|
||||
G_CALLBACK (stop_button_callback), music_view);
|
||||
g_signal_connect_object (music_view->details->stop_button, "clicked",
|
||||
G_CALLBACK (stop_button_callback), music_view, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->stop_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (music_view->details->stop_button);
|
||||
|
||||
|
@ -1599,8 +1583,8 @@ add_play_controls (NautilusMusicView *music_view)
|
|||
gtk_container_add (GTK_CONTAINER (music_view->details->next_track_button), box);
|
||||
gtk_widget_set_sensitive (music_view->details->next_track_button, TRUE);
|
||||
|
||||
g_signal_connect (music_view->details->next_track_button, "clicked",
|
||||
G_CALLBACK (next_button_callback), music_view);
|
||||
g_signal_connect_object (music_view->details->next_track_button, "clicked",
|
||||
G_CALLBACK (next_button_callback), music_view, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->next_track_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (music_view->details->next_track_button);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ nautilus_cell_renderer_news_finalize (GObject *object)
|
|||
|
||||
g_free (cellnews->priv);
|
||||
|
||||
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#include <libnautilus-private/nautilus-undo-signal-handlers.h>
|
||||
|
||||
#include <libnautilus/nautilus-clipboard.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <libnautilus/nautilus-view-standard-main.h>
|
||||
|
||||
/* property bag getting and setting routines */
|
||||
|
@ -1871,7 +1872,7 @@ add_command_buttons (News *news_data, const char* label, gboolean from_configure
|
|||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
(GtkSignalFunc) add_site_button_clicked, news_data);
|
||||
G_CALLBACK (add_site_button_clicked), news_data);
|
||||
}
|
||||
|
||||
button = gtk_button_new_from_stock (label);
|
||||
|
@ -1879,7 +1880,7 @@ add_command_buttons (News *news_data, const char* label, gboolean from_configure
|
|||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
(GtkSignalFunc) configure_button_clicked, news_data);
|
||||
G_CALLBACK (configure_button_clicked), news_data);
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
@ -2003,8 +2004,8 @@ add_channel_entry (News *news_data, const char *channel_name, int index, gboolea
|
|||
gtk_box_pack_start (GTK_BOX (news_data->checkbox_list), check_button, FALSE, FALSE, 0);
|
||||
|
||||
g_signal_connect (check_button, "toggled",
|
||||
G_CALLBACK (check_button_toggled_callback),
|
||||
news_data);
|
||||
G_CALLBACK (check_button_toggled_callback),
|
||||
news_data);
|
||||
|
||||
/* reorder newly added button so it's sorted by it's name */
|
||||
sort_position = determine_sort_position (news_data->checkbox_list, channel_name);
|
||||
|
@ -2134,7 +2135,7 @@ make_remove_widgets (News *news, GtkWidget *container)
|
|||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (news->remove_site_list));
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
|
||||
g_signal_connect (G_OBJECT (selection), "changed",
|
||||
g_signal_connect (selection, "changed",
|
||||
G_CALLBACK (remove_list_selection_changed), news);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
|
@ -2228,7 +2229,7 @@ make_add_widgets (News *news, GtkWidget *container)
|
|||
|
||||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
g_signal_connect (button, "clicked",
|
||||
(GtkSignalFunc) add_site_from_fields, news);
|
||||
G_CALLBACK (add_site_from_fields), news);
|
||||
}
|
||||
|
||||
/* allocate the add/remove location widgets */
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include <libnautilus-private/nautilus-global-preferences.h>
|
||||
#include <libnautilus-private/nautilus-metadata.h>
|
||||
#include <libnautilus/nautilus-clipboard.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <libnautilus/nautilus-view-standard-main.h>
|
||||
|
||||
/* FIXME bugzilla.gnome.org 44436:
|
||||
|
@ -221,10 +222,8 @@ notes_load_metainfo (Notes *notes)
|
|||
|
||||
g_list_free (attributes);
|
||||
|
||||
g_signal_connect (notes->file,
|
||||
"changed",
|
||||
G_CALLBACK (load_note_text_from_metadata),
|
||||
notes);
|
||||
g_signal_connect (notes->file, "changed",
|
||||
G_CALLBACK (load_note_text_from_metadata), notes);
|
||||
}
|
||||
|
||||
/* utility to notify event listeners if the notes data actually changed */
|
||||
|
@ -380,11 +379,9 @@ make_notes_view (const char *iid, void *callback_data)
|
|||
eel_background_set_color (background, NOTES_DEFAULT_BACKGROUND_COLOR);
|
||||
|
||||
g_signal_connect (notes->note_text_field, "focus_out_event",
|
||||
G_CALLBACK (on_text_field_focus_out_event),
|
||||
notes);
|
||||
G_CALLBACK (on_text_field_focus_out_event), notes);
|
||||
g_signal_connect (notes->text_buffer, "changed",
|
||||
G_CALLBACK (on_changed),
|
||||
notes);
|
||||
G_CALLBACK (on_changed), notes);
|
||||
|
||||
gtk_widget_show_all (vbox);
|
||||
|
||||
|
@ -399,7 +396,7 @@ make_notes_view (const char *iid, void *callback_data)
|
|||
"image indicating that a note is present", 0);
|
||||
/* handle events */
|
||||
g_signal_connect (notes->view, "load_location",
|
||||
G_CALLBACK (notes_load_location), notes);
|
||||
G_CALLBACK (notes_load_location), notes);
|
||||
|
||||
/* handle selections */
|
||||
#ifdef GNOME2_CONVERSION_COMPLETE
|
||||
|
|
|
@ -61,7 +61,7 @@ nautilus_sample_content_view_finalize (GObject *object)
|
|||
g_free (view->details->location);
|
||||
g_free (view->details);
|
||||
|
||||
GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (object)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -199,16 +199,12 @@ nautilus_sample_content_view_instance_init (NautilusSampleContentView *view)
|
|||
|
||||
nautilus_view_construct (NAUTILUS_VIEW (view), view->details->label);
|
||||
|
||||
g_signal_connect (view,
|
||||
"load_location",
|
||||
G_CALLBACK (sample_load_location_callback),
|
||||
NULL);
|
||||
g_signal_connect (view, "load_location",
|
||||
G_CALLBACK (sample_load_location_callback), NULL);
|
||||
|
||||
/* Get notified when our bonobo control is activated so we can
|
||||
* merge menu & toolbar items into the shell's UI.
|
||||
*/
|
||||
g_signal_connect (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (view)),
|
||||
"activate",
|
||||
G_CALLBACK (sample_merge_bonobo_items_callback),
|
||||
view);
|
||||
g_signal_connect_object (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (view)), "activate",
|
||||
G_CALLBACK (sample_merge_bonobo_items_callback), view, 0);
|
||||
}
|
||||
|
|
|
@ -161,14 +161,14 @@ nautilus_text_view_init (NautilusTextView *text_view)
|
|||
text_view->details->zoomable = bonobo_zoomable_new ();
|
||||
text_view->details->zoom_index = 3;
|
||||
|
||||
g_signal_connect (text_view->details->zoomable, "set_zoom_level",
|
||||
G_CALLBACK (zoomable_set_zoom_level_callback), text_view);
|
||||
g_signal_connect (text_view->details->zoomable, "zoom_in",
|
||||
G_CALLBACK (zoomable_zoom_in_callback), text_view);
|
||||
g_signal_connect (text_view->details->zoomable, "zoom_out",
|
||||
G_CALLBACK (zoomable_zoom_out_callback), text_view);
|
||||
g_signal_connect (text_view->details->zoomable, "zoom_to_fit",
|
||||
G_CALLBACK (zoomable_zoom_to_fit_callback), text_view);
|
||||
g_signal_connect_object (text_view->details->zoomable, "set_zoom_level",
|
||||
G_CALLBACK (zoomable_set_zoom_level_callback), text_view, 0);
|
||||
g_signal_connect_object (text_view->details->zoomable, "zoom_in",
|
||||
G_CALLBACK (zoomable_zoom_in_callback), text_view, 0);
|
||||
g_signal_connect_object (text_view->details->zoomable, "zoom_out",
|
||||
G_CALLBACK (zoomable_zoom_out_callback), text_view, 0);
|
||||
g_signal_connect_object (text_view->details->zoomable, "zoom_to_fit",
|
||||
G_CALLBACK (zoomable_zoom_to_fit_callback), text_view, 0);
|
||||
|
||||
bonobo_zoomable_set_parameters_full (text_view->details->zoomable,
|
||||
1.0, .25, 4.0, TRUE, TRUE, FALSE,
|
||||
|
@ -179,10 +179,8 @@ nautilus_text_view_init (NautilusTextView *text_view)
|
|||
BONOBO_OBJECT (text_view->details->zoomable));
|
||||
|
||||
|
||||
g_signal_connect (text_view,
|
||||
"load_location",
|
||||
G_CALLBACK (text_view_load_location_callback),
|
||||
text_view);
|
||||
g_signal_connect_object (text_view, "load_location",
|
||||
G_CALLBACK (text_view_load_location_callback), text_view, 0);
|
||||
|
||||
/* allocate a vbox to contain the text widget */
|
||||
text_view->details->container = gtk_vbox_new (FALSE, 0);
|
||||
|
@ -225,11 +223,10 @@ nautilus_text_view_init (NautilusTextView *text_view)
|
|||
gtk_container_add (GTK_CONTAINER (text_view->details->container), scrolled_window);
|
||||
|
||||
/* get notified when we are activated so we can merge in our menu items */
|
||||
g_signal_connect (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (text_view)),
|
||||
"activate",
|
||||
G_CALLBACK (merge_bonobo_menu_items),
|
||||
text_view);
|
||||
|
||||
g_signal_connect_object (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (text_view)),
|
||||
"activate",
|
||||
G_CALLBACK (merge_bonobo_menu_items), text_view, 0);
|
||||
|
||||
/* finally, we can show everything */
|
||||
gtk_widget_show_all (GTK_WIDGET (text_view->details->event_box));
|
||||
}
|
||||
|
@ -795,8 +792,8 @@ merge_bonobo_menu_items (BonoboControl *control, gboolean state, gpointer user_d
|
|||
|
||||
nautilus_text_view_build_service_menu (text_view, control);
|
||||
|
||||
g_signal_connect (bonobo_control_get_ui_component (control),
|
||||
"ui_event", G_CALLBACK (handle_ui_event), text_view);
|
||||
g_signal_connect_object (bonobo_control_get_ui_component (control), "ui_event",
|
||||
G_CALLBACK (handle_ui_event), text_view, 0);
|
||||
|
||||
nautilus_clipboard_set_up_editable_in_control (GTK_EDITABLE (text_view->details->text_display),
|
||||
control,
|
||||
|
|
|
@ -78,7 +78,6 @@ struct NautilusTreeModelDetails {
|
|||
GHashTable *file_to_node_map;
|
||||
|
||||
TreeNode *root_node;
|
||||
guint root_node_changed_id;
|
||||
gboolean root_node_parented;
|
||||
|
||||
guint monitoring_update_idle_id;
|
||||
|
@ -1305,9 +1304,8 @@ nautilus_tree_model_set_root_uri (NautilusTreeModel *model, const char *root_uri
|
|||
node = create_node_for_file (model, file);
|
||||
model->details->root_node = node;
|
||||
|
||||
model->details->root_node_changed_id = g_signal_connect
|
||||
(file, "changed",
|
||||
G_CALLBACK (root_node_file_changed_callback), model);
|
||||
g_signal_connect_object (file, "changed",
|
||||
G_CALLBACK (root_node_file_changed_callback), model, 0);
|
||||
|
||||
attrs = get_tree_monitor_attributes ();
|
||||
nautilus_file_monitor_add (file, model, attrs);
|
||||
|
@ -1364,7 +1362,6 @@ nautilus_tree_model_finalize (GObject *object)
|
|||
|
||||
root = model->details->root_node;
|
||||
if (root != NULL) {
|
||||
g_signal_handler_disconnect (root->file, model->details->root_node_changed_id);
|
||||
nautilus_file_monitor_remove (root->file, model);
|
||||
destroy_node_without_reporting (model, root);
|
||||
}
|
||||
|
|
|
@ -286,14 +286,13 @@ create_tree (NautilusTreeView *view)
|
|||
gtk_container_add (GTK_CONTAINER (view->details->scrolled_window),
|
||||
GTK_WIDGET (view->details->tree_widget));
|
||||
|
||||
g_signal_connect_swapped (view->details->tree_widget, "row_expanded",
|
||||
G_CALLBACK (schedule_save_expansion_state_callback), view);
|
||||
g_signal_connect_swapped (view->details->tree_widget, "row_collapsed",
|
||||
G_CALLBACK (schedule_save_expansion_state_callback), view);
|
||||
g_signal_connect_object (view->details->tree_widget, "row_expanded",
|
||||
G_CALLBACK (schedule_save_expansion_state_callback), view, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (view->details->tree_widget, "row_collapsed",
|
||||
G_CALLBACK (schedule_save_expansion_state_callback), view, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (view->details->tree_widget)),
|
||||
"changed",
|
||||
G_CALLBACK (selection_changed_callback), view);
|
||||
g_signal_connect_object (gtk_tree_view_get_selection (GTK_TREE_VIEW (view->details->tree_widget)), "changed",
|
||||
G_CALLBACK (selection_changed_callback), view, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -163,20 +163,14 @@ present_authentication_dialog_nonblocking (CallbackInfo *info)
|
|||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), FALSE);
|
||||
|
||||
g_signal_connect (dialog,
|
||||
"response",
|
||||
G_CALLBACK (authentication_dialog_button_clicked),
|
||||
info);
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (authentication_dialog_button_clicked), info);
|
||||
|
||||
g_signal_connect (dialog,
|
||||
"close",
|
||||
G_CALLBACK (authentication_dialog_closed),
|
||||
info);
|
||||
g_signal_connect (dialog, "close",
|
||||
G_CALLBACK (authentication_dialog_closed), info);
|
||||
|
||||
g_signal_connect (dialog,
|
||||
"destroy",
|
||||
G_CALLBACK (authentication_dialog_destroyed),
|
||||
info);
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (authentication_dialog_destroyed), info);
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (dialog));
|
||||
|
||||
|
|
|
@ -621,11 +621,8 @@ nautilus_bonobo_activation_register_for_display (const char *iid,
|
|||
char *real_iid;
|
||||
Bonobo_RegistrationResult result;
|
||||
|
||||
real_iid = bonobo_activation_make_registration_id (
|
||||
iid, gdk_get_display ());
|
||||
|
||||
real_iid = bonobo_activation_make_registration_id (iid, gdk_get_display ());
|
||||
result = bonobo_activation_active_server_register (real_iid, ref);
|
||||
|
||||
g_free (real_iid);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -467,10 +467,9 @@ nautilus_bookmark_disconnect_file (NautilusBookmark *bookmark)
|
|||
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
|
||||
|
||||
if (bookmark->details->file != NULL) {
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
bookmark->details->file,
|
||||
G_CALLBACK (bookmark_file_changed_callback),
|
||||
bookmark);
|
||||
g_signal_handlers_disconnect_by_func (bookmark->details->file,
|
||||
G_CALLBACK (bookmark_file_changed_callback),
|
||||
bookmark);
|
||||
nautilus_file_unref (bookmark->details->file);
|
||||
bookmark->details->file = NULL;
|
||||
}
|
||||
|
@ -494,10 +493,8 @@ nautilus_bookmark_connect_file (NautilusBookmark *bookmark)
|
|||
bookmark->details->file = nautilus_file_get (bookmark->details->uri);
|
||||
g_assert (!nautilus_file_is_gone (bookmark->details->file));
|
||||
|
||||
g_signal_connect (bookmark->details->file,
|
||||
"changed",
|
||||
G_CALLBACK (bookmark_file_changed_callback),
|
||||
bookmark);
|
||||
g_signal_connect_object (bookmark->details->file, "changed",
|
||||
G_CALLBACK (bookmark_file_changed_callback), bookmark, 0);
|
||||
}
|
||||
|
||||
/* Set icon based on available information; don't force network i/o
|
||||
|
|
|
@ -69,11 +69,11 @@ desktop_background_realized (NautilusIconContainer *icon_container, void *discon
|
|||
{
|
||||
EelBackground *background;
|
||||
|
||||
if ((gboolean) GPOINTER_TO_INT (disconnect_signal)) {
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
icon_container,
|
||||
G_CALLBACK (desktop_background_realized),
|
||||
disconnect_signal);
|
||||
if (GPOINTER_TO_INT (disconnect_signal)) {
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(icon_container,
|
||||
G_CALLBACK (desktop_background_realized),
|
||||
disconnect_signal);
|
||||
}
|
||||
|
||||
background = eel_get_widget_background (GTK_WIDGET (icon_container));
|
||||
|
@ -110,7 +110,8 @@ nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *ico
|
|||
if (GTK_WIDGET_REALIZED (icon_container)) {
|
||||
desktop_background_realized (icon_container, GINT_TO_POINTER (FALSE));
|
||||
} else {
|
||||
g_signal_connect (icon_container, "realize", G_CALLBACK (desktop_background_realized), GINT_TO_POINTER (TRUE));
|
||||
g_signal_connect (icon_container, "realize",
|
||||
G_CALLBACK (desktop_background_realized), GINT_TO_POINTER (TRUE));
|
||||
}
|
||||
|
||||
nautilus_file_background_receive_gconf_changes (background);
|
||||
|
@ -328,7 +329,7 @@ nautilus_file_background_read_desktop_settings (char **color,
|
|||
g_free (default_color);
|
||||
g_free (default_image_uri);
|
||||
|
||||
g_object_unref (G_OBJECT (prefs));
|
||||
g_object_unref (prefs);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -412,7 +413,7 @@ nautilus_file_background_write_desktop_settings (char *color, char *image, EelBa
|
|||
gnome_config_sync ();
|
||||
|
||||
bg_preferences_save (prefs);
|
||||
g_object_unref (G_OBJECT (prefs));
|
||||
g_object_unref (prefs);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -461,10 +462,8 @@ nautilus_file_background_receive_gconf_changes (EelBackground *background)
|
|||
|
||||
g_object_set_data (G_OBJECT (background), "desktop_gconf_notification", GUINT_TO_POINTER (notification_id));
|
||||
|
||||
g_signal_connect (background,
|
||||
"destroy",
|
||||
G_CALLBACK (desktop_background_destroyed_callback),
|
||||
NULL);
|
||||
g_signal_connect (background, "destroy",
|
||||
G_CALLBACK (desktop_background_destroyed_callback), NULL);
|
||||
}
|
||||
|
||||
/* Create a persistent pixmap. We create a separate display
|
||||
|
@ -559,7 +558,7 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
|
|||
GdkPixmap *pixmap;
|
||||
GdkWindow *background_window;
|
||||
|
||||
if ((gboolean) GPOINTER_TO_INT (disconnect_signal)) {
|
||||
if (GPOINTER_TO_INT (disconnect_signal)) {
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(background,
|
||||
G_CALLBACK (image_loading_done_callback),
|
||||
|
@ -590,10 +589,9 @@ nautilus_file_update_desktop_pixmaps (EelBackground *background)
|
|||
if (eel_background_is_loaded (background)) {
|
||||
image_loading_done_callback (background, TRUE, GINT_TO_POINTER (FALSE));
|
||||
} else {
|
||||
g_signal_connect (background,
|
||||
"image_loading_done",
|
||||
G_CALLBACK (image_loading_done_callback),
|
||||
GINT_TO_POINTER (TRUE));
|
||||
g_signal_connect (background, "image_loading_done",
|
||||
G_CALLBACK (image_loading_done_callback),
|
||||
GINT_TO_POINTER (TRUE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,12 +820,11 @@ background_reset_callback (EelBackground *background,
|
|||
/* handle the background destroyed signal */
|
||||
static void
|
||||
background_destroyed_callback (EelBackground *background,
|
||||
NautilusFile *file)
|
||||
NautilusFile *file)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
file,
|
||||
G_CALLBACK (saved_settings_changed_callback),
|
||||
background);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(file,
|
||||
G_CALLBACK (saved_settings_changed_callback), background);
|
||||
nautilus_file_monitor_remove (file, background);
|
||||
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
|
||||
nautilus_file_background_theme_changed,
|
||||
|
@ -857,20 +854,16 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
|||
g_assert (NAUTILUS_IS_FILE (old_file));
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(background,
|
||||
G_CALLBACK (background_changed_callback),
|
||||
old_file);
|
||||
G_CALLBACK (background_changed_callback), old_file);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(background,
|
||||
G_CALLBACK (background_destroyed_callback),
|
||||
old_file);
|
||||
G_CALLBACK (background_destroyed_callback), old_file);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(background,
|
||||
G_CALLBACK (background_reset_callback),
|
||||
old_file);
|
||||
G_CALLBACK (background_reset_callback), old_file);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(old_file,
|
||||
G_CALLBACK (saved_settings_changed_callback),
|
||||
background);
|
||||
G_CALLBACK (saved_settings_changed_callback), background);
|
||||
nautilus_file_monitor_remove (old_file, background);
|
||||
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
|
||||
nautilus_file_background_theme_changed,
|
||||
|
@ -880,29 +873,19 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget,
|
|||
|
||||
/* Attach the new directory. */
|
||||
nautilus_file_ref (file);
|
||||
g_object_set_data_full (G_OBJECT (background),
|
||||
"eel_background_file",
|
||||
file,
|
||||
(GtkDestroyNotify) nautilus_file_unref);
|
||||
g_object_set_data_full (G_OBJECT (background), "eel_background_file",
|
||||
file, (GDestroyNotify) nautilus_file_unref);
|
||||
|
||||
/* Connect new signal handlers. */
|
||||
if (file != NULL) {
|
||||
g_signal_connect (background,
|
||||
"settings_changed",
|
||||
G_CALLBACK (background_changed_callback),
|
||||
file);
|
||||
g_signal_connect (background,
|
||||
"destroy",
|
||||
G_CALLBACK (background_destroyed_callback),
|
||||
file);
|
||||
g_signal_connect (background,
|
||||
"reset",
|
||||
G_CALLBACK (background_reset_callback),
|
||||
file);
|
||||
g_signal_connect (file,
|
||||
"changed",
|
||||
G_CALLBACK (saved_settings_changed_callback),
|
||||
background);
|
||||
g_signal_connect_object (background, "settings_changed",
|
||||
G_CALLBACK (background_changed_callback), file, 0);
|
||||
g_signal_connect_object (background, "destroy",
|
||||
G_CALLBACK (background_destroyed_callback), file, 0);
|
||||
g_signal_connect_object (background, "reset",
|
||||
G_CALLBACK (background_reset_callback), file, 0);
|
||||
g_signal_connect_object (file, "changed",
|
||||
G_CALLBACK (saved_settings_changed_callback), background, 0);
|
||||
|
||||
/* arrange to receive file metadata */
|
||||
attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_METADATA);
|
||||
|
|
|
@ -50,9 +50,10 @@ finalize (GObject *object)
|
|||
NautilusMetafileMonitor *monitor;
|
||||
|
||||
monitor = NAUTILUS_METAFILE_MONITOR (object);
|
||||
|
||||
g_free (monitor->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
NautilusMetafileMonitor *
|
||||
|
|
|
@ -821,26 +821,35 @@ call_files_added_free_list (gpointer key, gpointer value, gpointer user_data)
|
|||
g_list_free (value);
|
||||
}
|
||||
|
||||
static void
|
||||
call_files_changed_common (NautilusDirectory *directory, GList *file_list)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
for (node = file_list; node != NULL; node = node->next) {
|
||||
nautilus_directory_add_file_to_work_queue (directory, node->data);
|
||||
}
|
||||
nautilus_directory_async_state_changed (directory);
|
||||
nautilus_directory_emit_change_signals (directory, file_list);
|
||||
}
|
||||
|
||||
static void
|
||||
call_files_changed_free_list (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
g_assert (NAUTILUS_IS_DIRECTORY (key));
|
||||
g_assert (value != NULL);
|
||||
g_assert (user_data == NULL);
|
||||
|
||||
nautilus_directory_emit_change_signals (key, value);
|
||||
call_files_changed_common (NAUTILUS_DIRECTORY (key), value);
|
||||
g_list_free (value);
|
||||
}
|
||||
|
||||
static void
|
||||
call_files_changed_unref_free_list (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
g_assert (NAUTILUS_IS_DIRECTORY (key));
|
||||
g_assert (value != NULL);
|
||||
g_assert (user_data == NULL);
|
||||
|
||||
nautilus_directory_async_state_changed (key);
|
||||
nautilus_directory_emit_change_signals (key, value);
|
||||
call_files_changed_common (NAUTILUS_DIRECTORY (key), value);
|
||||
nautilus_file_list_free (value);
|
||||
}
|
||||
|
||||
|
@ -967,10 +976,13 @@ nautilus_directory_notify_files_changed (GList *uris)
|
|||
/* Find the file. */
|
||||
file = nautilus_file_get_existing (uri);
|
||||
if (file != NULL) {
|
||||
/* Tell it to re-get info and emit a changed
|
||||
* signal.
|
||||
/* Tell it to re-get info now, and later emit
|
||||
* a changed signal.
|
||||
*/
|
||||
file->details->file_info_is_up_to_date = FALSE;
|
||||
file->details->top_left_text_is_up_to_date = FALSE;
|
||||
file->details->link_info_is_up_to_date = FALSE;
|
||||
|
||||
hash_table_list_prepend (changed_lists,
|
||||
file->details->directory,
|
||||
file);
|
||||
|
|
|
@ -317,13 +317,7 @@ wm_protocols_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
|
|||
static void
|
||||
nautilus_drag_window_destroy (GtkObject *object, gpointer data)
|
||||
{
|
||||
NautilusDragWindowDetails *details;
|
||||
|
||||
details = get_details (GTK_WINDOW (object));
|
||||
|
||||
remove_focus_timeout (GTK_WINDOW (object));
|
||||
|
||||
/* The `details' will be freed automatically */
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -388,7 +382,7 @@ nautilus_drag_window_register (GtkWindow *window)
|
|||
details, g_free);
|
||||
|
||||
g_signal_connect (window, "realize",
|
||||
G_CALLBACK (nautilus_drag_window_realize), NULL);
|
||||
G_CALLBACK (nautilus_drag_window_realize), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (nautilus_drag_window_destroy), NULL);
|
||||
G_CALLBACK (nautilus_drag_window_destroy), NULL);
|
||||
}
|
||||
|
|
|
@ -433,19 +433,19 @@ get_pending_icon_to_reveal (NautilusIconContainer *container)
|
|||
static void
|
||||
set_pending_icon_to_reveal (NautilusIconContainer *container, NautilusIcon *icon)
|
||||
{
|
||||
NautilusIcon *cur_pending;
|
||||
NautilusIcon *old_icon;
|
||||
|
||||
cur_pending = container->details->pending_icon_to_reveal;
|
||||
old_icon = container->details->pending_icon_to_reveal;
|
||||
|
||||
if (icon == cur_pending) {
|
||||
if (icon == old_icon) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur_pending != NULL) {
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
cur_pending->item,
|
||||
G_CALLBACK (pending_icon_to_reveal_destroy_callback),
|
||||
container);
|
||||
if (old_icon != NULL) {
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(old_icon->item,
|
||||
G_CALLBACK (pending_icon_to_reveal_destroy_callback),
|
||||
container);
|
||||
}
|
||||
|
||||
if (icon != NULL) {
|
||||
|
@ -3338,7 +3338,7 @@ nautilus_icon_container_instance_init (NautilusIconContainer *container)
|
|||
background = eel_get_widget_background (GTK_WIDGET (container));
|
||||
|
||||
g_signal_connect_object (background, "appearance_changed",
|
||||
G_CALLBACK (update_label_color), G_OBJECT (container), 0);
|
||||
G_CALLBACK (update_label_color), container, 0);
|
||||
|
||||
g_signal_connect (container, "focus-out-event",
|
||||
G_CALLBACK (handle_focus_out_event), NULL);
|
||||
|
@ -3827,8 +3827,8 @@ finish_adding_icon (NautilusIconContainer *container,
|
|||
nautilus_icon_container_update_icon (container, icon);
|
||||
gnome_canvas_item_show (GNOME_CANVAS_ITEM (icon->item));
|
||||
|
||||
g_signal_connect (icon->item, "event",
|
||||
G_CALLBACK (item_event_callback), container);
|
||||
g_signal_connect_object (icon->item, "event",
|
||||
G_CALLBACK (item_event_callback), container, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4671,24 +4671,24 @@ get_pending_icon_to_rename (NautilusIconContainer *container)
|
|||
static void
|
||||
set_pending_icon_to_rename (NautilusIconContainer *container, NautilusIcon *icon)
|
||||
{
|
||||
NautilusIcon *cur_pending;
|
||||
NautilusIcon *old_icon;
|
||||
|
||||
cur_pending = container->details->pending_icon_to_rename;
|
||||
old_icon = container->details->pending_icon_to_rename;
|
||||
|
||||
if (icon == cur_pending) {
|
||||
if (icon == old_icon) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur_pending != NULL) {
|
||||
if (old_icon != NULL) {
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(cur_pending->item,
|
||||
(old_icon->item,
|
||||
G_CALLBACK (pending_icon_to_rename_destroy_callback),
|
||||
container);
|
||||
}
|
||||
|
||||
if (icon != NULL) {
|
||||
g_signal_connect (icon->item, "destroy",
|
||||
G_CALLBACK (pending_icon_to_rename_destroy_callback), container);
|
||||
G_CALLBACK (pending_icon_to_rename_destroy_callback), container);
|
||||
}
|
||||
|
||||
container->details->pending_icon_to_rename = icon;
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#include "nautilus-directory-private.h"
|
||||
#include "nautilus-file.h"
|
||||
#include <eel/eel-glib-extensions.h>
|
||||
#include <eel/eel-gtk-macros.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-macros.h>
|
||||
|
||||
struct NautilusMergedDirectoryDetails {
|
||||
GList *directories;
|
||||
|
@ -40,7 +40,6 @@ struct NautilusMergedDirectoryDetails {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
/* Basic configuration. */
|
||||
NautilusMergedDirectory *merged;
|
||||
NautilusDirectoryCallback callback;
|
||||
gpointer callback_data;
|
||||
|
@ -68,53 +67,8 @@ enum {
|
|||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static void nautilus_merged_directory_init (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_merged_directory_class_init (gpointer klass);
|
||||
static void remove_all_real_directories (NautilusMergedDirectory *merged);
|
||||
static guint merged_callback_hash (gconstpointer merged_callback);
|
||||
static gboolean merged_callback_equal (gconstpointer merged_callback,
|
||||
gconstpointer merged_callback_2);
|
||||
|
||||
EEL_CLASS_BOILERPLATE (NautilusMergedDirectory,
|
||||
nautilus_merged_directory,
|
||||
NAUTILUS_TYPE_DIRECTORY)
|
||||
|
||||
static void
|
||||
nautilus_merged_directory_init (gpointer object, gpointer klass)
|
||||
{
|
||||
NautilusMergedDirectory *merged;
|
||||
|
||||
merged = NAUTILUS_MERGED_DIRECTORY (object);
|
||||
|
||||
merged->details = g_new0 (NautilusMergedDirectoryDetails, 1);
|
||||
merged->details->callbacks = g_hash_table_new
|
||||
(merged_callback_hash, merged_callback_equal);
|
||||
merged->details->monitors = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
merged_destroy (GtkObject *object)
|
||||
{
|
||||
NautilusMergedDirectory *merged;
|
||||
|
||||
merged = NAUTILUS_MERGED_DIRECTORY (object);
|
||||
|
||||
remove_all_real_directories (merged);
|
||||
|
||||
if (g_hash_table_size (merged->details->callbacks) != 0) {
|
||||
g_warning ("call_when_ready still pending when merged virtual directory is destroyed");
|
||||
}
|
||||
if (g_hash_table_size (merged->details->monitors) != 0) {
|
||||
g_warning ("file monitor still active when merged virtual directory is destroyed");
|
||||
}
|
||||
|
||||
g_hash_table_destroy (merged->details->callbacks);
|
||||
g_hash_table_destroy (merged->details->monitors);
|
||||
g_free (merged->details);
|
||||
|
||||
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
GNOME_CLASS_BOILERPLATE (NautilusMergedDirectory, nautilus_merged_directory,
|
||||
NautilusDirectory, NAUTILUS_TYPE_DIRECTORY)
|
||||
|
||||
static guint
|
||||
merged_callback_hash (gconstpointer merged_callback_as_pointer)
|
||||
|
@ -176,8 +130,7 @@ merged_callback_remove_directory (MergedCallback *merged_callback,
|
|||
NautilusDirectory *directory)
|
||||
{
|
||||
merged_callback->non_ready_directories = g_list_remove
|
||||
(merged_callback->non_ready_directories,
|
||||
directory);
|
||||
(merged_callback->non_ready_directories, directory);
|
||||
merged_callback_check_done (merged_callback);
|
||||
}
|
||||
|
||||
|
@ -300,7 +253,7 @@ build_merged_callback_list (NautilusDirectory *directory,
|
|||
|
||||
/* Create a monitor on each of the directories in the list. */
|
||||
static void
|
||||
merged_file_monitor_add (NautilusDirectory *directory,
|
||||
merged_monitor_add (NautilusDirectory *directory,
|
||||
gconstpointer client,
|
||||
gboolean monitor_hidden_files,
|
||||
gboolean monitor_backup_files,
|
||||
|
@ -347,14 +300,27 @@ merged_file_monitor_add (NautilusDirectory *directory,
|
|||
nautilus_file_list_free (merged_callback_list);
|
||||
}
|
||||
|
||||
static void
|
||||
merged_monitor_destroy (NautilusMergedDirectory *merged, MergedMonitor *monitor)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
/* Call through to the real directory remove calls. */
|
||||
for (node = merged->details->directories; node != NULL; node = node->next) {
|
||||
nautilus_directory_file_monitor_remove (node->data, monitor);
|
||||
}
|
||||
|
||||
eel_g_list_free_deep (monitor->monitor_attributes);
|
||||
g_free (monitor);
|
||||
}
|
||||
|
||||
/* Remove the monitor from each of the directories in the list. */
|
||||
static void
|
||||
merged_file_monitor_remove (NautilusDirectory *directory,
|
||||
gconstpointer client)
|
||||
merged_monitor_remove (NautilusDirectory *directory,
|
||||
gconstpointer client)
|
||||
{
|
||||
NautilusMergedDirectory *merged;
|
||||
MergedMonitor *monitor;
|
||||
GList *node;
|
||||
|
||||
merged = NAUTILUS_MERGED_DIRECTORY (directory);
|
||||
|
||||
|
@ -365,14 +331,7 @@ merged_file_monitor_remove (NautilusDirectory *directory,
|
|||
}
|
||||
g_hash_table_remove (merged->details->monitors, client);
|
||||
|
||||
/* Call through to the real directory remove calls. */
|
||||
for (node = merged->details->directories; node != NULL; node = node->next) {
|
||||
nautilus_directory_file_monitor_remove
|
||||
(node->data, monitor);
|
||||
}
|
||||
|
||||
eel_g_list_free_deep (monitor->monitor_attributes);
|
||||
g_free (monitor);
|
||||
merged_monitor_destroy (merged, monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -500,10 +459,8 @@ merged_add_real_directory (NautilusMergedDirectory *merged,
|
|||
merged->details->directories_not_done_loading = g_list_prepend
|
||||
(merged->details->directories_not_done_loading, real_directory);
|
||||
|
||||
g_signal_connect (real_directory,
|
||||
"done_loading",
|
||||
G_CALLBACK (done_loading_callback),
|
||||
merged);
|
||||
g_signal_connect_object (real_directory, "done_loading",
|
||||
G_CALLBACK (done_loading_callback), merged, 0);
|
||||
|
||||
/* FIXME bugzilla.gnome.org 45084: The done_loading part won't work for the case where
|
||||
* we have no directories in our list.
|
||||
|
@ -515,14 +472,10 @@ merged_add_real_directory (NautilusMergedDirectory *merged,
|
|||
real_directory);
|
||||
/* FIXME bugzilla.gnome.org 42541: Do we need to add the directory to callbacks too? */
|
||||
|
||||
g_signal_connect (real_directory,
|
||||
"files_added",
|
||||
G_CALLBACK (forward_files_added_cover),
|
||||
merged);
|
||||
g_signal_connect (real_directory,
|
||||
"files_changed",
|
||||
G_CALLBACK (forward_files_changed_cover),
|
||||
merged);
|
||||
g_signal_connect_object (real_directory, "files_added",
|
||||
G_CALLBACK (forward_files_added_cover), merged, 0);
|
||||
g_signal_connect_object (real_directory, "files_changed",
|
||||
G_CALLBACK (forward_files_changed_cover), merged, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -538,9 +491,7 @@ nautilus_merged_directory_add_real_directory (NautilusMergedDirectory *merged,
|
|||
return;
|
||||
}
|
||||
|
||||
g_signal_emit (merged,
|
||||
signals[ADD_REAL_DIRECTORY], 0,
|
||||
real_directory);
|
||||
g_signal_emit (merged, signals[ADD_REAL_DIRECTORY], 0, real_directory);
|
||||
}
|
||||
|
||||
GList *
|
||||
|
@ -576,19 +527,17 @@ merged_remove_real_directory (NautilusMergedDirectory *merged,
|
|||
g_return_if_fail (g_list_find (merged->details->directories, real_directory) != NULL);
|
||||
|
||||
/* Remove this directory from callbacks and monitors. */
|
||||
eel_g_hash_table_safe_for_each
|
||||
(merged->details->callbacks,
|
||||
merged_callback_remove_directory_cover,
|
||||
real_directory);
|
||||
g_hash_table_foreach
|
||||
(merged->details->monitors,
|
||||
monitor_remove_directory,
|
||||
real_directory);
|
||||
eel_g_hash_table_safe_for_each (merged->details->callbacks,
|
||||
merged_callback_remove_directory_cover,
|
||||
real_directory);
|
||||
g_hash_table_foreach (merged->details->monitors,
|
||||
monitor_remove_directory,
|
||||
real_directory);
|
||||
|
||||
/* Disconnect all the signals. */
|
||||
g_signal_handlers_disconnect_matched (
|
||||
real_directory, G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL, NULL, merged);
|
||||
g_signal_handlers_disconnect_matched
|
||||
(real_directory, G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL, NULL, merged);
|
||||
|
||||
/* Remove from our list of directories. */
|
||||
merged->details->directories = g_list_remove
|
||||
|
@ -609,48 +558,79 @@ nautilus_merged_directory_remove_real_directory (NautilusMergedDirectory *merged
|
|||
return;
|
||||
}
|
||||
|
||||
g_signal_emit (merged,
|
||||
signals[REMOVE_REAL_DIRECTORY], 0,
|
||||
real_directory);
|
||||
g_signal_emit (merged, signals[REMOVE_REAL_DIRECTORY], 0, real_directory);
|
||||
}
|
||||
|
||||
static void
|
||||
remove_all_real_directories (NautilusMergedDirectory *merged)
|
||||
merged_monitor_destroy_cover (gpointer key,
|
||||
gpointer value,
|
||||
gpointer callback_data)
|
||||
{
|
||||
while (merged->details->directories != NULL) {
|
||||
nautilus_merged_directory_remove_real_directory
|
||||
(merged, merged->details->directories->data);
|
||||
}
|
||||
merged_monitor_destroy (callback_data, value);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_merged_directory_class_init (gpointer klass)
|
||||
merged_callback_destroy_cover (gpointer key,
|
||||
gpointer value,
|
||||
gpointer callback_data)
|
||||
{
|
||||
merged_callback_destroy (value);
|
||||
}
|
||||
|
||||
static void
|
||||
merged_finalize (GObject *object)
|
||||
{
|
||||
NautilusMergedDirectory *merged;
|
||||
|
||||
merged = NAUTILUS_MERGED_DIRECTORY (object);
|
||||
|
||||
g_hash_table_foreach (merged->details->monitors,
|
||||
merged_monitor_destroy_cover, merged);
|
||||
g_hash_table_foreach (merged->details->callbacks,
|
||||
merged_callback_destroy_cover, NULL);
|
||||
|
||||
g_hash_table_destroy (merged->details->callbacks);
|
||||
g_hash_table_destroy (merged->details->monitors);
|
||||
nautilus_directory_list_free (merged->details->directories);
|
||||
g_list_free (merged->details->directories_not_done_loading);
|
||||
g_free (merged->details);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_merged_directory_instance_init (NautilusMergedDirectory *merged)
|
||||
{
|
||||
merged->details = g_new0 (NautilusMergedDirectoryDetails, 1);
|
||||
merged->details->callbacks = g_hash_table_new
|
||||
(merged_callback_hash, merged_callback_equal);
|
||||
merged->details->monitors = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_merged_directory_class_init (NautilusMergedDirectoryClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusDirectoryClass *directory_class;
|
||||
NautilusMergedDirectoryClass *merged_directory_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
directory_class = NAUTILUS_DIRECTORY_CLASS (klass);
|
||||
merged_directory_class = NAUTILUS_MERGED_DIRECTORY_CLASS (klass);
|
||||
directory_class = NAUTILUS_DIRECTORY_CLASS (class);
|
||||
|
||||
object_class->destroy = merged_destroy;
|
||||
G_OBJECT_CLASS (class)->finalize = merged_finalize;
|
||||
|
||||
directory_class->contains_file = merged_contains_file;
|
||||
directory_class->call_when_ready = merged_call_when_ready;
|
||||
directory_class->cancel_callback = merged_cancel_callback;
|
||||
directory_class->file_monitor_add = merged_file_monitor_add;
|
||||
directory_class->file_monitor_remove = merged_file_monitor_remove;
|
||||
directory_class->file_monitor_add = merged_monitor_add;
|
||||
directory_class->file_monitor_remove = merged_monitor_remove;
|
||||
directory_class->force_reload = merged_force_reload;
|
||||
directory_class->are_all_files_seen = merged_are_all_files_seen;
|
||||
directory_class->is_not_empty = merged_is_not_empty;
|
||||
|
||||
merged_directory_class->add_real_directory = merged_add_real_directory;
|
||||
merged_directory_class->remove_real_directory = merged_remove_real_directory;
|
||||
class->add_real_directory = merged_add_real_directory;
|
||||
class->remove_real_directory = merged_remove_real_directory;
|
||||
|
||||
signals[ADD_REAL_DIRECTORY]
|
||||
= g_signal_new ("add_real_directory",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NautilusMergedDirectoryClass,
|
||||
add_real_directory),
|
||||
|
@ -659,7 +639,7 @@ nautilus_merged_directory_class_init (gpointer klass)
|
|||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
signals[REMOVE_REAL_DIRECTORY]
|
||||
= g_signal_new ("remove_real_directory",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NautilusMergedDirectoryClass,
|
||||
remove_real_directory),
|
||||
|
|
|
@ -183,7 +183,7 @@ finalize (GObject *object)
|
|||
|
||||
g_free (metafile->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GnomeVFSURI *
|
||||
|
|
|
@ -1213,15 +1213,12 @@ create_and_set_up_tree_view (NautilusProgramChooser *program_chooser)
|
|||
gtk_tree_view_append_column (GTK_TREE_VIEW (program_chooser->details->tree_view), column);
|
||||
|
||||
/* Update selected item info whenever selection changes. */
|
||||
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (program_chooser->details->tree_view)),
|
||||
"changed",
|
||||
G_CALLBACK (program_list_selection_changed_callback),
|
||||
program_chooser);
|
||||
g_signal_connect_object (gtk_tree_view_get_selection (GTK_TREE_VIEW (program_chooser->details->tree_view)),
|
||||
"changed",
|
||||
G_CALLBACK (program_list_selection_changed_callback), program_chooser, 0);
|
||||
|
||||
g_signal_connect (program_chooser->details->tree_view,
|
||||
"row_activated",
|
||||
G_CALLBACK (tree_view_row_activated_callback),
|
||||
program_chooser);
|
||||
g_signal_connect_object (program_chooser->details->tree_view, "row_activated",
|
||||
G_CALLBACK (tree_view_row_activated_callback), program_chooser, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1252,13 +1249,13 @@ nautilus_program_chooser_finalize (GObject *object)
|
|||
/* Free the ProgramFilePairs */
|
||||
gtk_tree_model_foreach (GTK_TREE_MODEL (program_chooser->details->list_store),
|
||||
tree_model_destroy_program_file_pair, NULL);
|
||||
g_object_unref (G_OBJECT (program_chooser->details->list_store));
|
||||
g_object_unref (program_chooser->details->list_store);
|
||||
|
||||
nautilus_file_unref (program_chooser->details->file);
|
||||
|
||||
g_free (program_chooser->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1361,10 +1358,8 @@ nautilus_program_chooser_instance_init (NautilusProgramChooser *program_chooser)
|
|||
|
||||
change_button = gtk_button_new_with_mnemonic (_("_Modify..."));
|
||||
|
||||
g_signal_connect (change_button,
|
||||
"clicked",
|
||||
G_CALLBACK (run_program_configurator_callback),
|
||||
program_chooser);
|
||||
g_signal_connect_object (change_button, "clicked",
|
||||
G_CALLBACK (run_program_configurator_callback), program_chooser, 0);
|
||||
|
||||
gtk_widget_show (change_button);
|
||||
gtk_box_pack_end (GTK_BOX (change_button_holder), change_button, TRUE, FALSE, 0);
|
||||
|
@ -1384,10 +1379,8 @@ nautilus_program_chooser_instance_init (NautilusProgramChooser *program_chooser)
|
|||
gtk_box_pack_end (GTK_BOX (capplet_hbox), capplet_button_vbox, FALSE, FALSE, 0);
|
||||
capplet_button = gtk_button_new_with_mnemonic (_("_Go There"));
|
||||
|
||||
g_signal_connect (capplet_button,
|
||||
"clicked",
|
||||
G_CALLBACK (launch_mime_capplet_and_close_dialog),
|
||||
program_chooser);
|
||||
g_signal_connect_object (capplet_button, "clicked",
|
||||
G_CALLBACK (launch_mime_capplet_and_close_dialog), program_chooser, 0);
|
||||
gtk_widget_show (capplet_button);
|
||||
gtk_box_pack_start (GTK_BOX (capplet_button_vbox), capplet_button, TRUE, FALSE, 0);
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
#include "nautilus-trash-monitor.h"
|
||||
#include "nautilus-volume-monitor.h"
|
||||
#include <eel/eel-glib-extensions.h>
|
||||
#include <eel/eel-gtk-macros.h>
|
||||
#include <eel/eel-stock-dialogs.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-macros.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
|
||||
struct NautilusTrashDirectoryDetails {
|
||||
|
@ -49,15 +49,11 @@ typedef struct {
|
|||
NautilusDirectory *real_directory;
|
||||
} TrashVolume;
|
||||
|
||||
static void nautilus_trash_directory_init (gpointer object,
|
||||
gpointer klass);
|
||||
static void nautilus_trash_directory_class_init (gpointer klass);
|
||||
static void add_volume (NautilusTrashDirectory *trash,
|
||||
NautilusVolume *volume);
|
||||
static void add_volume (NautilusTrashDirectory *trash,
|
||||
NautilusVolume *volume);
|
||||
|
||||
EEL_CLASS_BOILERPLATE (NautilusTrashDirectory,
|
||||
nautilus_trash_directory,
|
||||
NAUTILUS_TYPE_MERGED_DIRECTORY)
|
||||
GNOME_CLASS_BOILERPLATE (NautilusTrashDirectory, nautilus_trash_directory,
|
||||
NautilusMergedDirectory, NAUTILUS_TYPE_MERGED_DIRECTORY)
|
||||
|
||||
#define TRASH_SEARCH_TIMED_WAIT_DELAY 20000
|
||||
|
||||
|
@ -68,11 +64,11 @@ find_directory_start (void)
|
|||
{
|
||||
if (pending_find_directory_count == 0) {
|
||||
eel_timed_wait_start_with_duration (TRASH_SEARCH_TIMED_WAIT_DELAY,
|
||||
NULL,
|
||||
add_volume,
|
||||
_("Searching Disks"),
|
||||
_("Nautilus is searching your disks for trash folders."),
|
||||
NULL);
|
||||
NULL,
|
||||
add_volume,
|
||||
_("Searching Disks"),
|
||||
_("Nautilus is searching your disks for trash folders."),
|
||||
NULL);
|
||||
}
|
||||
|
||||
++pending_find_directory_count;
|
||||
|
@ -237,7 +233,7 @@ check_trash_created (NautilusTrashDirectory *trash,
|
|||
}
|
||||
|
||||
static void
|
||||
remove_trash_volume (TrashVolume *trash_volume)
|
||||
remove_trash_volume (TrashVolume *trash_volume, gboolean finalizing)
|
||||
{
|
||||
g_hash_table_remove (trash_volume->trash->details->volumes,
|
||||
trash_volume->volume);
|
||||
|
@ -247,15 +243,16 @@ remove_trash_volume (TrashVolume *trash_volume)
|
|||
find_directory_end ();
|
||||
}
|
||||
if (trash_volume->real_directory != NULL) {
|
||||
nautilus_merged_directory_remove_real_directory
|
||||
(NAUTILUS_MERGED_DIRECTORY (trash_volume->trash),
|
||||
trash_volume->real_directory);
|
||||
if (! finalizing) {
|
||||
nautilus_merged_directory_remove_real_directory
|
||||
(NAUTILUS_MERGED_DIRECTORY (trash_volume->trash),
|
||||
trash_volume->real_directory);
|
||||
}
|
||||
nautilus_directory_unref (trash_volume->real_directory);
|
||||
}
|
||||
g_free (trash_volume);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
remove_volume (NautilusTrashDirectory *trash,
|
||||
NautilusVolume *volume)
|
||||
|
@ -263,10 +260,9 @@ remove_volume (NautilusTrashDirectory *trash,
|
|||
TrashVolume *trash_volume;
|
||||
|
||||
/* Quick out if don't already know about this volume. */
|
||||
trash_volume = g_hash_table_lookup (trash->details->volumes,
|
||||
volume);
|
||||
trash_volume = g_hash_table_lookup (trash->details->volumes, volume);
|
||||
if (trash_volume != NULL) {
|
||||
remove_trash_volume (trash_volume);
|
||||
remove_trash_volume (trash_volume, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,24 +301,19 @@ volume_mounted_callback (NautilusVolumeMonitor *monitor,
|
|||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_directory_init (gpointer object, gpointer klass)
|
||||
nautilus_trash_directory_instance_init (NautilusTrashDirectory *trash)
|
||||
{
|
||||
NautilusTrashDirectory *trash;
|
||||
NautilusVolumeMonitor *volume_monitor;
|
||||
|
||||
trash = NAUTILUS_TRASH_DIRECTORY (object);
|
||||
|
||||
trash->details = g_new0 (NautilusTrashDirectoryDetails, 1);
|
||||
trash->details->volumes = g_hash_table_new (NULL, NULL);
|
||||
|
||||
volume_monitor = nautilus_volume_monitor_get ();
|
||||
|
||||
g_signal_connect
|
||||
(volume_monitor, "volume_mounted",
|
||||
G_CALLBACK (volume_mounted_callback), trash);
|
||||
g_signal_connect
|
||||
(volume_monitor, "volume_unmount_started",
|
||||
G_CALLBACK (volume_unmount_started_callback), trash);
|
||||
g_signal_connect_object (volume_monitor, "volume_mounted",
|
||||
G_CALLBACK (volume_mounted_callback), trash, 0);
|
||||
g_signal_connect_object (volume_monitor, "volume_unmount_started",
|
||||
G_CALLBACK (volume_unmount_started_callback), trash, 0);
|
||||
}
|
||||
|
||||
/* Finish initializing a new NautilusTrashDirectory. We have to do the
|
||||
|
@ -337,15 +328,14 @@ nautilus_trash_directory_finish_initializing (NautilusTrashDirectory *trash)
|
|||
|
||||
volume_monitor = nautilus_volume_monitor_get ();
|
||||
|
||||
g_signal_connect
|
||||
(nautilus_trash_monitor_get (), "check_trash_directory_added",
|
||||
G_CALLBACK (check_trash_directory_added_callback), trash);
|
||||
g_signal_connect_object (nautilus_trash_monitor_get (), "check_trash_directory_added",
|
||||
G_CALLBACK (check_trash_directory_added_callback), trash, 0);
|
||||
nautilus_volume_monitor_each_mounted_volume
|
||||
(volume_monitor, add_one_volume, trash);
|
||||
}
|
||||
|
||||
static void
|
||||
remove_trash_volume_cover (gpointer key, gpointer value, gpointer callback_data)
|
||||
remove_trash_volume_finalizing_cover (gpointer key, gpointer value, gpointer callback_data)
|
||||
{
|
||||
TrashVolume *trash_volume;
|
||||
|
||||
|
@ -358,29 +348,22 @@ remove_trash_volume_cover (gpointer key, gpointer value, gpointer callback_data)
|
|||
g_assert (NAUTILUS_IS_TRASH_DIRECTORY (trash_volume->trash));
|
||||
g_assert (trash_volume->volume == key);
|
||||
|
||||
remove_trash_volume (trash_volume);
|
||||
remove_trash_volume (trash_volume, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
trash_destroy (GtkObject *object)
|
||||
trash_finalize (GObject *object)
|
||||
{
|
||||
NautilusTrashDirectory *trash;
|
||||
|
||||
trash = NAUTILUS_TRASH_DIRECTORY (object);
|
||||
|
||||
g_signal_handlers_disconnect_matched (
|
||||
nautilus_volume_monitor_get (),
|
||||
G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL, NULL, trash);
|
||||
|
||||
eel_g_hash_table_safe_for_each
|
||||
(trash->details->volumes,
|
||||
remove_trash_volume_cover,
|
||||
NULL);
|
||||
eel_g_hash_table_safe_for_each (trash->details->volumes,
|
||||
remove_trash_volume_finalizing_cover, NULL);
|
||||
g_hash_table_destroy (trash->details->volumes);
|
||||
g_free (trash->details);
|
||||
|
||||
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -391,16 +374,9 @@ trash_get_name_for_self_as_new_file (NautilusDirectory *directory)
|
|||
}
|
||||
|
||||
static void
|
||||
nautilus_trash_directory_class_init (gpointer klass)
|
||||
nautilus_trash_directory_class_init (NautilusTrashDirectoryClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
NautilusDirectoryClass *directory_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
directory_class = NAUTILUS_DIRECTORY_CLASS (klass);
|
||||
|
||||
object_class->destroy = trash_destroy;
|
||||
|
||||
directory_class->get_name_for_self_as_new_file = trash_get_name_for_self_as_new_file;
|
||||
G_OBJECT_CLASS (class)->finalize = trash_finalize;
|
||||
NAUTILUS_DIRECTORY_CLASS (class)->get_name_for_self_as_new_file = trash_get_name_for_self_as_new_file;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
struct NautilusTrashFileDetails {
|
||||
NautilusTrashDirectory *trash_directory;
|
||||
|
||||
guint add_directory_connection_id;
|
||||
guint remove_directory_connection_id;
|
||||
|
||||
GList *files;
|
||||
|
||||
GHashTable *callbacks;
|
||||
|
@ -284,10 +281,8 @@ add_real_file (NautilusTrashFile *trash,
|
|||
trash->details->files = g_list_prepend
|
||||
(trash->details->files, real_file);
|
||||
|
||||
g_signal_connect (real_file,
|
||||
"changed",
|
||||
G_CALLBACK (real_file_changed_callback),
|
||||
trash);
|
||||
g_signal_connect_object (real_file, "changed",
|
||||
G_CALLBACK (real_file_changed_callback), trash, 0);
|
||||
|
||||
/* Add the file to any extant monitors. */
|
||||
g_hash_table_foreach (trash->details->monitors,
|
||||
|
@ -330,8 +325,8 @@ remove_real_file (NautilusTrashFile *trash,
|
|||
monitor_remove_file,
|
||||
real_file);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (
|
||||
real_file, G_CALLBACK (real_file_changed_callback), trash);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(real_file, G_CALLBACK (real_file_changed_callback), trash);
|
||||
|
||||
trash->details->files = g_list_remove
|
||||
(trash->details->files, real_file);
|
||||
|
@ -750,16 +745,10 @@ nautilus_trash_file_init (gpointer object, gpointer klass)
|
|||
(trash_callback_hash, trash_callback_equal);
|
||||
trash_file->details->monitors = g_hash_table_new (NULL, NULL);
|
||||
|
||||
trash_file->details->add_directory_connection_id = g_signal_connect
|
||||
(trash_directory,
|
||||
"add_real_directory",
|
||||
G_CALLBACK (add_directory_callback),
|
||||
trash_file);
|
||||
trash_file->details->remove_directory_connection_id = g_signal_connect
|
||||
(trash_directory,
|
||||
"remove_real_directory",
|
||||
G_CALLBACK (remove_directory_callback),
|
||||
trash_file);
|
||||
g_signal_connect_object (trash_directory, "add_real_directory",
|
||||
G_CALLBACK (add_directory_callback), trash_file, 0);
|
||||
g_signal_connect_object (trash_directory, "remove_real_directory",
|
||||
G_CALLBACK (remove_directory_callback), trash_file, 0);
|
||||
|
||||
real_directories = nautilus_merged_directory_get_real_directories
|
||||
(NAUTILUS_MERGED_DIRECTORY (trash_directory));
|
||||
|
@ -787,11 +776,6 @@ trash_destroy (GtkObject *object)
|
|||
g_warning ("file monitor still active when trash virtual file is destroyed");
|
||||
}
|
||||
|
||||
g_signal_handler_disconnect (trash_directory,
|
||||
trash_file->details->add_directory_connection_id);
|
||||
g_signal_handler_disconnect (trash_directory,
|
||||
trash_file->details->remove_directory_connection_id);
|
||||
|
||||
g_hash_table_destroy (trash_file->details->callbacks);
|
||||
g_hash_table_destroy (trash_file->details->monitors);
|
||||
|
||||
|
|
|
@ -146,14 +146,10 @@ nautilus_trash_monitor_init (gpointer object, gpointer klass)
|
|||
|
||||
g_list_free (attributes);
|
||||
|
||||
g_signal_connect_object
|
||||
(trash_directory, "files_added",
|
||||
G_CALLBACK (nautilus_trash_files_changed_callback),
|
||||
trash_monitor, 0);
|
||||
g_signal_connect_object
|
||||
(trash_directory, "files_changed",
|
||||
G_CALLBACK (nautilus_trash_files_changed_callback),
|
||||
trash_monitor, 0);
|
||||
g_signal_connect_object (trash_directory, "files_added",
|
||||
G_CALLBACK (nautilus_trash_files_changed_callback), trash_monitor, 0);
|
||||
g_signal_connect_object (trash_directory, "files_changed",
|
||||
G_CALLBACK (nautilus_trash_files_changed_callback), trash_monitor, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -219,8 +219,7 @@ nautilus_undo_manager_attach (NautilusUndoManager *manager, GObject *target)
|
|||
g_return_if_fail (NAUTILUS_IS_UNDO_MANAGER (manager));
|
||||
g_return_if_fail (G_IS_OBJECT (target));
|
||||
|
||||
nautilus_undo_attach_undo_manager (
|
||||
G_OBJECT (target), BONOBO_OBJREF (manager));
|
||||
nautilus_undo_attach_undo_manager (G_OBJECT (target), BONOBO_OBJREF (manager));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -80,10 +80,9 @@ nautilus_undo_set_up_nautilus_entry_for_undo (NautilusEntry *entry)
|
|||
data, free_editable_object_data);
|
||||
|
||||
/* Connect to entry signals */
|
||||
g_signal_connect (entry,
|
||||
"user_changed",
|
||||
G_CALLBACK (nautilus_entry_user_changed_callback),
|
||||
NULL);
|
||||
g_signal_connect (entry, "user_changed",
|
||||
G_CALLBACK (nautilus_entry_user_changed_callback),
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -95,9 +94,7 @@ nautilus_undo_tear_down_nautilus_entry_for_undo (NautilusEntry *entry)
|
|||
|
||||
/* Disconnect from entry signals */
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(entry,
|
||||
G_CALLBACK (nautilus_entry_user_changed_callback),
|
||||
NULL);
|
||||
(entry, G_CALLBACK (nautilus_entry_user_changed_callback), NULL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -193,15 +190,10 @@ nautilus_undo_set_up_editable_for_undo (GtkEditable *editable)
|
|||
}
|
||||
|
||||
/* Connect to editable signals */
|
||||
g_signal_connect (editable,
|
||||
"insert_text",
|
||||
G_CALLBACK (editable_insert_text_callback),
|
||||
NULL);
|
||||
|
||||
g_signal_connect (editable,
|
||||
"delete_text",
|
||||
G_CALLBACK (editable_delete_text_callback),
|
||||
NULL);
|
||||
g_signal_connect (editable, "insert_text",
|
||||
G_CALLBACK (editable_insert_text_callback), NULL);
|
||||
g_signal_connect (editable, "delete_text",
|
||||
G_CALLBACK (editable_delete_text_callback), NULL);
|
||||
|
||||
|
||||
data = g_new (EditableUndoObjectData, 1);
|
||||
|
@ -218,13 +210,10 @@ nautilus_undo_tear_down_editable_for_undo (GtkEditable *editable)
|
|||
}
|
||||
|
||||
/* Disconnect from entry signals */
|
||||
g_signal_handlers_disconnect_by_func (editable,
|
||||
G_CALLBACK (editable_insert_text_callback),
|
||||
NULL);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (editable,
|
||||
G_CALLBACK (editable_delete_text_callback),
|
||||
NULL);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(editable, G_CALLBACK (editable_insert_text_callback), NULL);
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(editable, G_CALLBACK (editable_delete_text_callback), NULL);
|
||||
}
|
||||
|
||||
/* restore_editable_from_undo_snapshot_callback
|
||||
|
@ -327,18 +316,15 @@ nautilus_undo_editable_set_undo_key (GtkEditable *editable, gboolean value)
|
|||
#ifdef UNDO_ENABLED
|
||||
if (value) {
|
||||
/* Connect to entry signals */
|
||||
g_signal_connect (editable,
|
||||
"key_press_event",
|
||||
G_CALLBACK (editable_key_press_event),
|
||||
NULL);
|
||||
g_signal_connect (editable, "key_press_event",
|
||||
G_CALLBACK (editable_key_press_event), NULL);
|
||||
} else {
|
||||
/* FIXME bugzilla.gnome.org 45092: Warns if the handler
|
||||
* is not already connected. We could use object data
|
||||
* to prevent that little problem.
|
||||
*/
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (editable),
|
||||
G_CALLBACK (editable_key_press_event),
|
||||
NULL);
|
||||
gtk_signal_disconnect_by_func (editable,
|
||||
G_CALLBACK (editable_key_press_event), NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -123,8 +123,8 @@ select_all_callback (BonoboUIComponent *ui,
|
|||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_callback (source, select_all_idle_callback, editable, NULL);
|
||||
g_signal_connect_swapped (editable, "destroy",
|
||||
G_CALLBACK (g_source_destroy), source);
|
||||
g_signal_connect_object (editable, "destroy",
|
||||
G_CALLBACK (g_source_destroy), source, G_CONNECT_SWAPPED);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
}
|
||||
|
@ -134,11 +134,8 @@ set_menu_item_sensitive (BonoboUIComponent *component,
|
|||
const char *path,
|
||||
gboolean sensitive)
|
||||
{
|
||||
g_assert (BONOBO_IS_UI_COMPONENT (component));
|
||||
bonobo_ui_component_set_prop (component, path,
|
||||
"sensitive",
|
||||
sensitive ? "1" : "0",
|
||||
NULL);
|
||||
"sensitive", sensitive ? "1" : "0", NULL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -420,9 +417,7 @@ first_focus_callback (GtkWidget *widget,
|
|||
/* Don't set up the clipboard again on future focus_in's. This
|
||||
* is one-time work.
|
||||
*/
|
||||
disconnect_set_up_in_control_handlers
|
||||
(GTK_OBJECT (widget),
|
||||
callback_data);
|
||||
disconnect_set_up_in_control_handlers (GTK_OBJECT (widget), callback_data);
|
||||
|
||||
/* Do the rest of the setup. */
|
||||
nautilus_clipboard_set_up_editable
|
||||
|
@ -437,8 +432,7 @@ static void
|
|||
control_destroyed_callback (GtkObject *object,
|
||||
gpointer callback_data)
|
||||
{
|
||||
disconnect_set_up_in_control_handlers
|
||||
(object, callback_data);
|
||||
disconnect_set_up_in_control_handlers (object, callback_data);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -464,17 +458,12 @@ nautilus_clipboard_set_up_editable_in_control (GtkEditable *target,
|
|||
/* We'd like to use gtk_signal_connect_while_alive, but it's
|
||||
* not compatible with gtk_signal_disconnect calls.
|
||||
*/
|
||||
g_object_set_data (G_OBJECT (target),
|
||||
"Nautilus:shares_selection_changes",
|
||||
g_object_set_data (G_OBJECT (target), "Nautilus:shares_selection_changes",
|
||||
GINT_TO_POINTER (shares_selection_changes));
|
||||
g_signal_connect (target,
|
||||
"focus_in_event",
|
||||
G_CALLBACK (first_focus_callback),
|
||||
control);
|
||||
g_signal_connect (target,
|
||||
"destroy",
|
||||
G_CALLBACK (control_destroyed_callback),
|
||||
control);
|
||||
g_signal_connect (target, "focus_in_event",
|
||||
G_CALLBACK (first_focus_callback), control);
|
||||
g_signal_connect (target, "destroy",
|
||||
G_CALLBACK (control_destroyed_callback), control);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -171,7 +171,7 @@ nautilus_undo_transaction_finalize (GObject *object)
|
|||
CORBA_Object_release (transaction->owner, &ev);
|
||||
CORBA_exception_free (&ev);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -280,5 +280,5 @@ nautilus_undo_set_up_bonobo_control (BonoboControl *control)
|
|||
|
||||
set_up_bonobo_control (control);
|
||||
g_signal_connect (control, "set_frame",
|
||||
G_CALLBACK (set_up_bonobo_control), NULL);
|
||||
G_CALLBACK (set_up_bonobo_control), NULL);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef NAUTILUS_VIEW_STANDARD_MAIN_H
|
||||
#define NAUTILUS_VIEW_STANDARD_MAIN_H
|
||||
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <bonobo/bonobo-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -448,9 +448,8 @@ nautilus_view_construct_from_bonobo_control (NautilusView *view,
|
|||
bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (control));
|
||||
nautilus_undo_set_up_bonobo_control (control);
|
||||
|
||||
g_signal_connect_object (G_OBJECT (control), "set_frame",
|
||||
G_CALLBACK (nautilus_view_set_frame_callback),
|
||||
view, 0);
|
||||
g_signal_connect_object (control, "set_frame",
|
||||
G_CALLBACK (nautilus_view_set_frame_callback), view, 0);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
@ -470,7 +469,7 @@ nautilus_view_finalize (GObject *object)
|
|||
|
||||
g_free (view->details);
|
||||
|
||||
GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -84,7 +84,6 @@ struct FMDesktopIconViewDetails
|
|||
/* For the desktop rescanning
|
||||
*/
|
||||
gulong delayed_init_signal;
|
||||
gulong done_loading_signal;
|
||||
guint reload_desktop_timeout;
|
||||
gboolean pending_rescan;
|
||||
};
|
||||
|
@ -235,16 +234,6 @@ fm_desktop_icon_view_finalize (GObject *object)
|
|||
gtk_timeout_remove (icon_view->details->reload_desktop_timeout);
|
||||
}
|
||||
|
||||
if (icon_view->details->done_loading_signal != 0) {
|
||||
g_signal_handler_disconnect (fm_directory_view_get_model (FM_DIRECTORY_VIEW (icon_view)),
|
||||
icon_view->details->done_loading_signal);
|
||||
}
|
||||
|
||||
if (icon_view->details->delayed_init_signal != 0) {
|
||||
g_signal_handler_disconnect (icon_view,
|
||||
icon_view->details->delayed_init_signal);
|
||||
}
|
||||
|
||||
/* Delete all of the link files. */
|
||||
delete_all_mount_links ();
|
||||
|
||||
|
@ -521,10 +510,9 @@ static void
|
|||
delayed_init (FMDesktopIconView *desktop_icon_view)
|
||||
{
|
||||
/* Keep track of the load time. */
|
||||
desktop_icon_view->details->done_loading_signal =
|
||||
g_signal_connect (fm_directory_view_get_model (FM_DIRECTORY_VIEW (desktop_icon_view)),
|
||||
"done_loading",
|
||||
G_CALLBACK (done_loading), desktop_icon_view);
|
||||
g_signal_connect_object (fm_directory_view_get_model (FM_DIRECTORY_VIEW (desktop_icon_view)),
|
||||
"done_loading",
|
||||
G_CALLBACK (done_loading), desktop_icon_view, 0);
|
||||
|
||||
/* Monitor desktop directory. */
|
||||
desktop_icon_view->details->reload_desktop_timeout =
|
||||
|
@ -560,9 +548,9 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
|
|||
* way to keep track of the items on the desktop.
|
||||
*/
|
||||
if (!nautilus_monitor_active ()) {
|
||||
desktop_icon_view->details->delayed_init_signal = g_signal_connect
|
||||
desktop_icon_view->details->delayed_init_signal = g_signal_connect_object
|
||||
(desktop_icon_view, "begin_loading",
|
||||
G_CALLBACK (delayed_init), desktop_icon_view);
|
||||
G_CALLBACK (delayed_init), desktop_icon_view, 0);
|
||||
}
|
||||
|
||||
nautilus_icon_container_set_is_fixed_size (icon_container, TRUE);
|
||||
|
@ -600,21 +588,16 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
|
|||
create_one_mount_link,
|
||||
desktop_icon_view);
|
||||
|
||||
g_signal_connect (icon_container, "middle_click",
|
||||
G_CALLBACK (fm_desktop_icon_view_handle_middle_click), desktop_icon_view);
|
||||
|
||||
g_signal_connect (icon_container, "compare_icons",
|
||||
G_CALLBACK (desktop_icons_compare_callback), desktop_icon_view);
|
||||
|
||||
g_signal_connect (desktop_icon_view, "event",
|
||||
G_CALLBACK (event_callback), desktop_icon_view);
|
||||
|
||||
g_signal_connect_object (icon_container, "middle_click",
|
||||
G_CALLBACK (fm_desktop_icon_view_handle_middle_click), desktop_icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "compare_icons",
|
||||
G_CALLBACK (desktop_icons_compare_callback), desktop_icon_view, 0);
|
||||
g_signal_connect_object (desktop_icon_view, "event",
|
||||
G_CALLBACK (event_callback), desktop_icon_view, 0);
|
||||
g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
|
||||
G_CALLBACK (fm_desktop_icon_view_trash_state_changed_callback), desktop_icon_view, 0);
|
||||
|
||||
G_CALLBACK (fm_desktop_icon_view_trash_state_changed_callback), desktop_icon_view, 0);
|
||||
g_signal_connect_object (nautilus_volume_monitor_get (), "volume_mounted",
|
||||
G_CALLBACK (volume_mounted_callback), desktop_icon_view, 0);
|
||||
|
||||
g_signal_connect_object (nautilus_volume_monitor_get (), "volume_unmounted",
|
||||
G_CALLBACK (volume_unmounted_callback), desktop_icon_view, 0);
|
||||
|
||||
|
|
|
@ -1148,11 +1148,10 @@ add_directory_to_scripts_directory_list (FMDirectoryView *view,
|
|||
|
||||
g_list_free (attributes);
|
||||
|
||||
g_signal_connect (directory, "files_added",
|
||||
G_CALLBACK (scripts_added_or_changed_callback), view);
|
||||
|
||||
g_signal_connect (directory, "files_changed",
|
||||
G_CALLBACK (scripts_added_or_changed_callback), view);
|
||||
g_signal_connect_object (directory, "files_added",
|
||||
G_CALLBACK (scripts_added_or_changed_callback), view, 0);
|
||||
g_signal_connect_object (directory, "files_changed",
|
||||
G_CALLBACK (scripts_added_or_changed_callback), view, 0);
|
||||
|
||||
view->details->scripts_directory_list = g_list_append
|
||||
(view->details->scripts_directory_list, directory);
|
||||
|
@ -1228,30 +1227,29 @@ fm_directory_view_init (FMDirectoryView *view)
|
|||
view->details->sort_directories_first =
|
||||
eel_preferences_get_boolean (NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
|
||||
|
||||
g_signal_connect (view->details->nautilus_view, "stop_loading",
|
||||
G_CALLBACK (stop_loading_callback), view);
|
||||
g_signal_connect (view->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (load_location_callback), view);
|
||||
g_signal_connect_object (view->details->nautilus_view, "stop_loading",
|
||||
G_CALLBACK (stop_loading_callback), view, 0);
|
||||
g_signal_connect_object (view->details->nautilus_view, "load_location",
|
||||
G_CALLBACK (load_location_callback), view, 0);
|
||||
|
||||
nautilus_view_set_listener_mask (
|
||||
NAUTILUS_VIEW (view->details->nautilus_view),
|
||||
NAUTILUS_VIEW_LISTEN_SELECTION);
|
||||
nautilus_view_set_listener_mask
|
||||
(NAUTILUS_VIEW (view->details->nautilus_view),
|
||||
NAUTILUS_VIEW_LISTEN_SELECTION);
|
||||
|
||||
g_signal_connect (view->details->nautilus_view, "selection_changed",
|
||||
G_CALLBACK (selection_changed_callback), view);
|
||||
g_signal_connect (fm_directory_view_get_bonobo_control (view), "activate",
|
||||
G_CALLBACK (bonobo_control_activate_callback), view);
|
||||
g_signal_connect (view->details->zoomable, "zoom_in",
|
||||
G_CALLBACK (zoomable_zoom_in_callback), view);
|
||||
g_signal_connect (view->details->zoomable, "zoom_out",
|
||||
G_CALLBACK (zoomable_zoom_out_callback), view);
|
||||
g_signal_connect (view->details->zoomable, "set_zoom_level",
|
||||
G_CALLBACK (zoomable_set_zoom_level_callback), view);
|
||||
g_signal_connect (view->details->zoomable, "zoom_to_fit",
|
||||
G_CALLBACK (zoomable_zoom_to_fit_callback), view);
|
||||
g_signal_connect_object (view->details->nautilus_view, "selection_changed",
|
||||
G_CALLBACK (selection_changed_callback), view, 0);
|
||||
g_signal_connect_object (fm_directory_view_get_bonobo_control (view), "activate",
|
||||
G_CALLBACK (bonobo_control_activate_callback), view, 0);
|
||||
g_signal_connect_object (view->details->zoomable, "zoom_in",
|
||||
G_CALLBACK (zoomable_zoom_in_callback), view, 0);
|
||||
g_signal_connect_object (view->details->zoomable, "zoom_out",
|
||||
G_CALLBACK (zoomable_zoom_out_callback), view, 0);
|
||||
g_signal_connect_object (view->details->zoomable, "set_zoom_level",
|
||||
G_CALLBACK (zoomable_set_zoom_level_callback), view, 0);
|
||||
g_signal_connect_object (view->details->zoomable, "zoom_to_fit",
|
||||
G_CALLBACK (zoomable_zoom_to_fit_callback), view, 0);
|
||||
g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
|
||||
G_CALLBACK (fm_directory_view_trash_state_changed_callback),
|
||||
view, 0);
|
||||
G_CALLBACK (fm_directory_view_trash_state_changed_callback), view, 0);
|
||||
|
||||
/* React to icon theme changes. */
|
||||
g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
|
||||
|
@ -2296,7 +2294,10 @@ queue_pending_files (FMDirectoryView *view,
|
|||
|
||||
*pending_list = g_list_concat (*pending_list,
|
||||
nautilus_file_list_copy (files));
|
||||
schedule_timeout_display_of_pending_files (view);
|
||||
if (view->details->loading)
|
||||
schedule_timeout_display_of_pending_files (view);
|
||||
else
|
||||
schedule_idle_display_of_pending_files (view);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4150,10 +4151,9 @@ real_merge_menus (FMDirectoryView *view)
|
|||
|
||||
bonobo_ui_component_add_verb_list_with_data (view->details->ui, verbs, view);
|
||||
|
||||
g_signal_connect_swapped (fm_directory_view_get_background (view),
|
||||
"settings_changed",
|
||||
G_CALLBACK (schedule_update_menus),
|
||||
view);
|
||||
g_signal_connect_object (fm_directory_view_get_background (view), "settings_changed",
|
||||
G_CALLBACK (schedule_update_menus), G_OBJECT (view),
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
/* Do one-time state changes here; context-dependent ones go in update_menus */
|
||||
if (!fm_directory_view_supports_zooming (view)) {
|
||||
|
@ -4933,10 +4933,8 @@ load_directory (FMDirectoryView *view,
|
|||
g_list_free (attributes);
|
||||
|
||||
view->details->file_changed_handler_id = g_signal_connect
|
||||
(view->details->directory_as_file,
|
||||
"changed",
|
||||
G_CALLBACK (file_changed_callback),
|
||||
view);
|
||||
(view->details->directory_as_file, "changed",
|
||||
G_CALLBACK (file_changed_callback), view);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4958,12 +4956,10 @@ finish_loading (FMDirectoryView *view)
|
|||
|
||||
/* Connect handlers to learn about loading progress. */
|
||||
view->details->done_loading_handler_id = g_signal_connect
|
||||
(view->details->model,
|
||||
"done_loading",
|
||||
(view->details->model, "done_loading",
|
||||
G_CALLBACK (done_loading_callback), view);
|
||||
view->details->load_error_handler_id = g_signal_connect
|
||||
(view->details->model,
|
||||
"load_error",
|
||||
(view->details->model, "load_error",
|
||||
G_CALLBACK (load_error_callback), view);
|
||||
|
||||
/* Monitor the things needed to get the right icon. Also
|
||||
|
@ -4991,12 +4987,10 @@ finish_loading (FMDirectoryView *view)
|
|||
g_list_free (attributes);
|
||||
|
||||
view->details->files_added_handler_id = g_signal_connect
|
||||
(view->details->model,
|
||||
"files_added",
|
||||
(view->details->model, "files_added",
|
||||
G_CALLBACK (files_added_callback), view);
|
||||
view->details->files_changed_handler_id = g_signal_connect
|
||||
(view->details->model,
|
||||
"files_changed",
|
||||
(view->details->model, "files_changed",
|
||||
G_CALLBACK (files_changed_callback), view);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-config.h>
|
||||
#include <libgnome/gnome-desktop-item.h>
|
||||
#include <libgnome/gnome-macros.h>
|
||||
#include <libgnomevfs/gnome-vfs-ops.h>
|
||||
#include <libgnomevfs/gnome-vfs-async-ops.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
|
@ -118,58 +119,25 @@ typedef enum {
|
|||
MENU_ITEM_TYPE_TREE
|
||||
} MenuItemType;
|
||||
|
||||
/* forward declarations */
|
||||
static void create_icon_container (FMIconView *icon_view);
|
||||
static void fm_icon_view_init (FMIconView *icon_view);
|
||||
static void fm_icon_view_class_init (FMIconViewClass *klass);
|
||||
static void fm_icon_view_set_directory_sort_by (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
const char *sort_by);
|
||||
static void fm_icon_view_set_zoom_level (FMIconView *view,
|
||||
NautilusZoomLevel new_level,
|
||||
gboolean always_set_level);
|
||||
gboolean fm_icon_view_supports_auto_layout (FMIconView *view);
|
||||
static void fm_icon_view_update_icon_container_fonts (FMIconView *icon_view);
|
||||
static void fm_icon_view_update_icon_container_font_size_table (FMIconView *icon_view);
|
||||
static void fm_icon_view_update_click_mode (FMIconView *icon_view);
|
||||
static gboolean fm_icon_view_using_tighter_layout (FMIconView *icon_view);
|
||||
static gboolean fm_icon_view_get_directory_tighter_layout (FMIconView *icon_view,
|
||||
NautilusFile *file);
|
||||
static void fm_icon_view_set_directory_tighter_layout (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
gboolean tighter_layout);
|
||||
static gboolean real_supports_auto_layout (FMIconView *view);
|
||||
static const SortCriterion *get_sort_criterion_by_id (const char *id);
|
||||
static const SortCriterion *get_sort_criterion_by_sort_type (NautilusFileSortType sort_type);
|
||||
static void set_sort_criterion_by_id (FMIconView *icon_view,
|
||||
const char *id);
|
||||
static gboolean set_sort_reversed (FMIconView *icon_view,
|
||||
gboolean new_value);
|
||||
static void switch_to_manual_layout (FMIconView *view);
|
||||
static void preview_audio (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
gboolean start_flag);
|
||||
static void update_layout_menus (FMIconView *view);
|
||||
static void default_sort_in_reverse_order_changed_callback (gpointer callback_data);
|
||||
static void default_sort_order_changed_callback (gpointer callback_data);
|
||||
static void default_use_tighter_layout_changed_callback (gpointer callback_data);
|
||||
static void default_use_manual_layout_changed_callback (gpointer callback_data);
|
||||
static void default_zoom_level_changed_callback (gpointer callback_data);
|
||||
static void default_zoom_level_font_size_changed_callback (gpointer callback_data);
|
||||
static void font_changed_callback (gpointer callback_data);
|
||||
static void icon_view_handle_uri_list (NautilusIconContainer *container,
|
||||
const char *item_uris,
|
||||
GdkDragAction action,
|
||||
int x,
|
||||
int y,
|
||||
FMIconView *view);
|
||||
struct FMIconViewDetails
|
||||
{
|
||||
GList *icons_not_positioned;
|
||||
|
||||
guint react_to_icon_change_idle_id;
|
||||
gboolean menus_ready;
|
||||
|
||||
static int preview_sound_auto_value;
|
||||
gboolean loading;
|
||||
|
||||
const SortCriterion *sort;
|
||||
gboolean sort_reversed;
|
||||
|
||||
BonoboUIComponent *ui;
|
||||
|
||||
NautilusAudioPlayerData *audio_player_data;
|
||||
int audio_preview_timeout;
|
||||
NautilusFile *audio_preview_file;
|
||||
};
|
||||
|
||||
EEL_CLASS_BOILERPLATE (FMIconView,
|
||||
fm_icon_view,
|
||||
FM_TYPE_DIRECTORY_VIEW)
|
||||
|
||||
/* Note that the first item in this list is the default sort,
|
||||
* and that the items show up in the menu in the order they
|
||||
|
@ -213,24 +181,35 @@ static const SortCriterion sort_criteria[] = {
|
|||
}
|
||||
};
|
||||
|
||||
struct FMIconViewDetails
|
||||
{
|
||||
GList *icons_not_positioned;
|
||||
static gboolean default_sort_in_reverse_order = FALSE;
|
||||
static int preview_sound_auto_value;
|
||||
|
||||
guint react_to_icon_change_idle_id;
|
||||
gboolean menus_ready;
|
||||
static void fm_icon_view_set_directory_sort_by (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
const char *sort_by);
|
||||
static void fm_icon_view_set_zoom_level (FMIconView *view,
|
||||
NautilusZoomLevel new_level,
|
||||
gboolean always_set_level);
|
||||
static void fm_icon_view_update_icon_container_fonts (FMIconView *icon_view);
|
||||
static void fm_icon_view_update_icon_container_font_size_table (FMIconView *icon_view);
|
||||
static void fm_icon_view_update_click_mode (FMIconView *icon_view);
|
||||
static void fm_icon_view_set_directory_tighter_layout (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
gboolean tighter_layout);
|
||||
static const SortCriterion *get_sort_criterion_by_id (const char *id);
|
||||
static const SortCriterion *get_sort_criterion_by_sort_type (NautilusFileSortType sort_type);
|
||||
static void set_sort_criterion_by_id (FMIconView *icon_view,
|
||||
const char *id);
|
||||
static gboolean set_sort_reversed (FMIconView *icon_view,
|
||||
gboolean new_value);
|
||||
static void switch_to_manual_layout (FMIconView *view);
|
||||
static void preview_audio (FMIconView *icon_view,
|
||||
NautilusFile *file,
|
||||
gboolean start_flag);
|
||||
static void update_layout_menus (FMIconView *view);
|
||||
|
||||
gboolean loading;
|
||||
|
||||
const SortCriterion *sort;
|
||||
gboolean sort_reversed;
|
||||
|
||||
BonoboUIComponent *ui;
|
||||
|
||||
NautilusAudioPlayerData *audio_player_data;
|
||||
int audio_preview_timeout;
|
||||
NautilusFile *audio_preview_file;
|
||||
};
|
||||
GNOME_CLASS_BOILERPLATE (FMIconView, fm_icon_view,
|
||||
FMDirectoryView, FM_TYPE_DIRECTORY_VIEW)
|
||||
|
||||
static void
|
||||
fm_icon_view_finalize (GObject *object)
|
||||
|
@ -528,6 +507,16 @@ fm_icon_view_file_changed (FMDirectoryView *view, NautilusFile *file)
|
|||
NAUTILUS_ICON_CONTAINER_ICON_DATA (file));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fm_icon_view_supports_auto_layout (FMIconView *view)
|
||||
{
|
||||
g_return_val_if_fail (FM_IS_ICON_VIEW (view), FALSE);
|
||||
|
||||
return EEL_CALL_METHOD_WITH_RETURN_VALUE
|
||||
(FM_ICON_VIEW_CLASS, view,
|
||||
supports_auto_layout, (view));
|
||||
}
|
||||
|
||||
static void
|
||||
update_layout_menus (FMIconView *view)
|
||||
{
|
||||
|
@ -654,8 +643,6 @@ fm_icon_view_get_directory_sort_reversed (FMIconView *icon_view,
|
|||
get_directory_sort_reversed, (icon_view, file));
|
||||
}
|
||||
|
||||
static gboolean default_sort_in_reverse_order = FALSE;
|
||||
|
||||
static gboolean
|
||||
get_default_sort_in_reverse_order (void)
|
||||
{
|
||||
|
@ -664,7 +651,7 @@ get_default_sort_in_reverse_order (void)
|
|||
if (auto_storaged_added == FALSE) {
|
||||
auto_storaged_added = TRUE;
|
||||
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
||||
&default_sort_in_reverse_order);
|
||||
&default_sort_in_reverse_order);
|
||||
}
|
||||
|
||||
return default_sort_in_reverse_order;
|
||||
|
@ -735,7 +722,6 @@ fm_icon_view_get_directory_auto_layout (FMIconView *icon_view,
|
|||
get_directory_auto_layout, (icon_view, file));
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
fm_icon_view_real_get_directory_auto_layout (FMIconView *icon_view,
|
||||
NautilusFile *file)
|
||||
|
@ -824,16 +810,6 @@ fm_icon_view_real_set_directory_tighter_layout (FMIconView *icon_view,
|
|||
tighter_layout);
|
||||
}
|
||||
|
||||
gboolean
|
||||
fm_icon_view_supports_auto_layout (FMIconView *view)
|
||||
{
|
||||
g_return_val_if_fail (FM_IS_ICON_VIEW (view), FALSE);
|
||||
|
||||
return EEL_CALL_METHOD_WITH_RETURN_VALUE
|
||||
(FM_ICON_VIEW_CLASS, view,
|
||||
supports_auto_layout, (view));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
real_supports_auto_layout (FMIconView *view)
|
||||
{
|
||||
|
@ -1328,8 +1304,8 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
|
|||
icon_view = FM_ICON_VIEW (view);
|
||||
|
||||
icon_view->details->ui = bonobo_ui_component_new ("Icon View");
|
||||
g_signal_connect (icon_view->details->ui,
|
||||
"ui_event", G_CALLBACK (handle_ui_event), icon_view);
|
||||
g_signal_connect_object (icon_view->details->ui,
|
||||
"ui_event", G_CALLBACK (handle_ui_event), icon_view, 0);
|
||||
ui_container = fm_directory_view_get_bonobo_ui_container (view);
|
||||
bonobo_ui_component_set_container (icon_view->details->ui,
|
||||
ui_container, NULL);
|
||||
|
@ -1697,7 +1673,7 @@ should_preview_sound (NautilusFile *file) {
|
|||
|
||||
client = gconf_client_get_default ();
|
||||
enable_esd = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
|
||||
g_object_unref (G_OBJECT (client));
|
||||
g_object_unref (client);
|
||||
|
||||
/* Check gnome config sound preference */
|
||||
if (!enable_esd) {
|
||||
|
@ -2437,97 +2413,59 @@ static void
|
|||
create_icon_container (FMIconView *icon_view)
|
||||
{
|
||||
NautilusIconContainer *icon_container;
|
||||
FMDirectoryView *directory_view;
|
||||
|
||||
icon_container = NAUTILUS_ICON_CONTAINER (nautilus_icon_container_new ());
|
||||
directory_view = FM_DIRECTORY_VIEW (icon_view);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (icon_container, GTK_CAN_FOCUS);
|
||||
|
||||
g_signal_connect (icon_container,
|
||||
"activate",
|
||||
G_CALLBACK (icon_container_activate_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"band_select_started",
|
||||
G_CALLBACK (band_select_started_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"band_select_ended",
|
||||
G_CALLBACK (band_select_ended_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"compare_icons",
|
||||
G_CALLBACK (icon_container_compare_icons_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"compare_icons_by_name",
|
||||
G_CALLBACK (icon_container_compare_icons_by_name_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"context_click_selection",
|
||||
G_CALLBACK (icon_container_context_click_selection_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"context_click_background",
|
||||
G_CALLBACK (icon_container_context_click_background_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"icon_position_changed",
|
||||
G_CALLBACK (icon_position_changed_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"icon_text_changed",
|
||||
G_CALLBACK (fm_icon_view_icon_text_changed_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"selection_changed",
|
||||
G_CALLBACK (selection_changed_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_icon_images",
|
||||
G_CALLBACK (get_icon_images_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_icon_uri",
|
||||
G_CALLBACK (get_icon_uri_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_icon_drop_target_uri",
|
||||
G_CALLBACK (get_icon_drop_target_uri_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_icon_text",
|
||||
G_CALLBACK (get_icon_text_callback),
|
||||
icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"move_copy_items",
|
||||
G_CALLBACK (icon_view_move_copy_items),
|
||||
directory_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_container_uri",
|
||||
G_CALLBACK (icon_view_get_container_uri),
|
||||
directory_view);
|
||||
g_signal_connect (icon_container,
|
||||
"can_accept_item",
|
||||
G_CALLBACK (icon_view_can_accept_item),
|
||||
directory_view);
|
||||
g_signal_connect (icon_container,
|
||||
"get_stored_icon_position",
|
||||
G_CALLBACK (get_stored_icon_position_callback),
|
||||
directory_view);
|
||||
g_signal_connect (icon_container,
|
||||
"layout_changed",
|
||||
G_CALLBACK (layout_changed_callback),
|
||||
directory_view);
|
||||
g_signal_connect (icon_container, "preview",
|
||||
G_CALLBACK (icon_container_preview_callback), icon_view);
|
||||
g_signal_connect (icon_container, "renaming_icon",
|
||||
G_CALLBACK (renaming_icon_callback), directory_view);
|
||||
g_signal_connect_swapped (icon_container, "icon_stretch_started",
|
||||
G_CALLBACK (fm_directory_view_update_menus), directory_view);
|
||||
g_signal_connect_swapped (icon_container, "icon_stretch_ended",
|
||||
G_CALLBACK (fm_directory_view_update_menus), directory_view);
|
||||
g_signal_connect_object (icon_container, "activate",
|
||||
G_CALLBACK (icon_container_activate_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "band_select_started",
|
||||
G_CALLBACK (band_select_started_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "band_select_ended",
|
||||
G_CALLBACK (band_select_ended_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "compare_icons",
|
||||
G_CALLBACK (icon_container_compare_icons_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "compare_icons_by_name",
|
||||
G_CALLBACK (icon_container_compare_icons_by_name_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "context_click_selection",
|
||||
G_CALLBACK (icon_container_context_click_selection_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "context_click_background",
|
||||
G_CALLBACK (icon_container_context_click_background_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "icon_position_changed",
|
||||
G_CALLBACK (icon_position_changed_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "icon_text_changed",
|
||||
G_CALLBACK (fm_icon_view_icon_text_changed_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "selection_changed",
|
||||
G_CALLBACK (selection_changed_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_icon_images",
|
||||
G_CALLBACK (get_icon_images_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_icon_uri",
|
||||
G_CALLBACK (get_icon_uri_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_icon_drop_target_uri",
|
||||
G_CALLBACK (get_icon_drop_target_uri_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_icon_text",
|
||||
G_CALLBACK (get_icon_text_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "move_copy_items",
|
||||
G_CALLBACK (icon_view_move_copy_items), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_container_uri",
|
||||
G_CALLBACK (icon_view_get_container_uri), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "can_accept_item",
|
||||
G_CALLBACK (icon_view_can_accept_item), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "get_stored_icon_position",
|
||||
G_CALLBACK (get_stored_icon_position_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "layout_changed",
|
||||
G_CALLBACK (layout_changed_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "preview",
|
||||
G_CALLBACK (icon_container_preview_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "renaming_icon",
|
||||
G_CALLBACK (renaming_icon_callback), icon_view, 0);
|
||||
g_signal_connect_object (icon_container, "icon_stretch_started",
|
||||
G_CALLBACK (fm_directory_view_update_menus), icon_view,
|
||||
G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (icon_container, "icon_stretch_ended",
|
||||
G_CALLBACK (fm_directory_view_update_menus), icon_view,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (icon_view),
|
||||
GTK_WIDGET (icon_container));
|
||||
|
@ -2741,10 +2679,9 @@ fm_icon_view_class_init (FMIconViewClass *klass)
|
|||
}
|
||||
|
||||
static void
|
||||
fm_icon_view_init (FMIconView *icon_view)
|
||||
fm_icon_view_instance_init (FMIconView *icon_view)
|
||||
{
|
||||
static gboolean setup_sound_preview = FALSE;
|
||||
NautilusIconContainer *icon_container;
|
||||
|
||||
g_return_if_fail (GTK_BIN (icon_view)->child == NULL);
|
||||
|
||||
|
@ -2761,37 +2698,27 @@ fm_icon_view_init (FMIconView *icon_view)
|
|||
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_FONT,
|
||||
font_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL_FONT_SIZE,
|
||||
default_zoom_level_font_size_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
|
||||
default_sort_order_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
|
||||
default_sort_in_reverse_order_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
|
||||
default_use_tighter_layout_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
|
||||
default_use_manual_layout_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
|
||||
default_zoom_level_changed_callback,
|
||||
icon_view,
|
||||
G_OBJECT (icon_view));
|
||||
icon_view, G_OBJECT (icon_view));
|
||||
|
||||
icon_container = get_icon_container (icon_view);
|
||||
g_signal_connect (icon_container,
|
||||
"handle_uri_list",
|
||||
G_CALLBACK (icon_view_handle_uri_list),
|
||||
icon_view);
|
||||
g_signal_connect_object (get_icon_container (icon_view), "handle_uri_list",
|
||||
G_CALLBACK (icon_view_handle_uri_list), icon_view, 0);
|
||||
|
||||
}
|
||||
|
|
|
@ -156,15 +156,16 @@ create_and_set_up_tree_view (FMListView *view)
|
|||
GtkTreeViewColumn *column;
|
||||
|
||||
view->details->tree_view = GTK_TREE_VIEW (gtk_tree_view_new ());
|
||||
g_signal_connect (gtk_tree_view_get_selection (view->details->tree_view),
|
||||
"changed", G_CALLBACK (list_selection_changed_callback), view);
|
||||
g_signal_connect_object (gtk_tree_view_get_selection (view->details->tree_view),
|
||||
"changed",
|
||||
G_CALLBACK (list_selection_changed_callback), view, 0);
|
||||
|
||||
g_signal_connect (view->details->tree_view, "row_activated",
|
||||
G_CALLBACK (list_activate_callback), view);
|
||||
g_signal_connect (view->details->tree_view, "event-after",
|
||||
G_CALLBACK (event_after_callback), view);
|
||||
g_signal_connect (view->details->tree_view, "button_press_event",
|
||||
G_CALLBACK (button_press_callback), view);
|
||||
g_signal_connect_object (view->details->tree_view, "row_activated",
|
||||
G_CALLBACK (list_activate_callback), view, 0);
|
||||
g_signal_connect_object (view->details->tree_view, "event-after",
|
||||
G_CALLBACK (event_after_callback), view, 0);
|
||||
g_signal_connect_object (view->details->tree_view, "button_press_event",
|
||||
G_CALLBACK (button_press_callback), view, 0);
|
||||
|
||||
view->details->model = g_object_new (FM_TYPE_LIST_MODEL, NULL);
|
||||
gtk_tree_view_set_model (view->details->tree_view, GTK_TREE_MODEL (view->details->model));
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <eel/eel-glib-extensions.h>
|
||||
#include <eel/eel-gnome-extensions.h>
|
||||
#include <eel/eel-gtk-extensions.h>
|
||||
#include <eel/eel-gtk-macros.h>
|
||||
#include <eel/eel-labeled-image.h>
|
||||
#include <eel/eel-stock-dialogs.h>
|
||||
#include <eel/eel-string.h>
|
||||
|
@ -54,6 +53,7 @@
|
|||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-macros.h>
|
||||
#include <libgnomeui/gnome-dialog.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
|
@ -145,10 +145,6 @@ static GtkTargetEntry target_table[] = {
|
|||
#define STANDARD_EMBLEM_HEIGHT 52
|
||||
#define EMBLEM_LABEL_SPACING 2
|
||||
|
||||
static void real_destroy (GtkObject *object);
|
||||
static void real_finalize (GObject *object);
|
||||
static void fm_properties_window_class_init (FMPropertiesWindowClass *class);
|
||||
static void fm_properties_window_init (FMPropertiesWindow *window);
|
||||
static void create_properties_window_callback (NautilusFile *file,
|
||||
gpointer data);
|
||||
static void cancel_group_change_callback (gpointer callback_data);
|
||||
|
@ -166,23 +162,8 @@ static void remove_pending_file (StartupData *data
|
|||
gboolean cancel_timed_wait,
|
||||
gboolean cancel_destroy_handler);
|
||||
|
||||
EEL_CLASS_BOILERPLATE (FMPropertiesWindow, fm_properties_window, GTK_TYPE_WINDOW)
|
||||
|
||||
static void
|
||||
fm_properties_window_class_init (FMPropertiesWindowClass *class)
|
||||
{
|
||||
G_OBJECT_CLASS (class)->finalize = real_finalize;
|
||||
|
||||
GTK_OBJECT_CLASS (class)->destroy = real_destroy;
|
||||
}
|
||||
|
||||
static void
|
||||
fm_properties_window_init (FMPropertiesWindow *window)
|
||||
{
|
||||
window->details = g_new0 (FMPropertiesWindowDetails, 1);
|
||||
|
||||
eel_gtk_window_set_up_close_accelerator (GTK_WINDOW (window));
|
||||
}
|
||||
GNOME_CLASS_BOILERPLATE (FMPropertiesWindow, fm_properties_window,
|
||||
GtkWindow, GTK_TYPE_WINDOW)
|
||||
|
||||
typedef struct {
|
||||
NautilusFile *file;
|
||||
|
@ -361,10 +342,8 @@ create_image_widget_for_file (NautilusFile *file)
|
|||
g_object_unref (pixbuf);
|
||||
|
||||
nautilus_file_ref (file);
|
||||
g_object_set_data_full (G_OBJECT (image),
|
||||
"nautilus_file",
|
||||
file,
|
||||
(GtkDestroyNotify) nautilus_file_unref);
|
||||
g_object_set_data_full (G_OBJECT (image), "nautilus_file",
|
||||
file, (GDestroyNotify) nautilus_file_unref);
|
||||
|
||||
/* React to icon theme changes. */
|
||||
g_signal_connect_object (nautilus_icon_factory_get (),
|
||||
|
@ -641,8 +620,7 @@ value_field_update_internal (GtkLabel *label,
|
|||
attribute_value = nautilus_file_get_string_attribute_with_default (file, attribute_name);
|
||||
|
||||
if (ellipsize_text) {
|
||||
eel_ellipsizing_label_set_text (EEL_ELLIPSIZING_LABEL (label),
|
||||
attribute_value);
|
||||
eel_ellipsizing_label_set_text (EEL_ELLIPSIZING_LABEL (label), attribute_value);
|
||||
} else {
|
||||
gtk_label_set_text (label, attribute_value);
|
||||
}
|
||||
|
@ -825,7 +803,7 @@ create_group_menu_item (NautilusFile *file, const char *group_name)
|
|||
"activate",
|
||||
G_CALLBACK (activate_group_callback),
|
||||
file_name_pair_new (file, group_name),
|
||||
(GtkDestroyNotify)file_name_pair_free);
|
||||
(GDestroyNotify)file_name_pair_free);
|
||||
|
||||
return menu_item;
|
||||
}
|
||||
|
@ -997,7 +975,7 @@ create_owner_menu_item (NautilusFile *file, const char *user_name)
|
|||
"activate",
|
||||
G_CALLBACK (activate_owner_callback),
|
||||
file_name_pair_new (file, name_array[0]),
|
||||
(GtkDestroyNotify)file_name_pair_free);
|
||||
(GDestroyNotify)file_name_pair_free);
|
||||
g_strfreev (name_array);
|
||||
return menu_item;
|
||||
}
|
||||
|
@ -1562,10 +1540,8 @@ create_basic_page (FMPropertiesWindow *window)
|
|||
|
||||
/* Attach parameters and signal handler. */
|
||||
nautilus_file_ref (original_file);
|
||||
g_object_set_data_full (G_OBJECT (name_field),
|
||||
"nautilus_file",
|
||||
original_file,
|
||||
(GtkDestroyNotify) nautilus_file_unref);
|
||||
g_object_set_data_full (G_OBJECT (name_field),"nautilus_file",
|
||||
original_file, (GDestroyNotify) nautilus_file_unref);
|
||||
|
||||
/* Update name field initially before hooking up changed signal. */
|
||||
name_field_update_to_match_file (NAUTILUS_ENTRY (name_field));
|
||||
|
@ -1584,13 +1560,10 @@ create_basic_page (FMPropertiesWindow *window)
|
|||
nautilus_undo_editable_set_undo_key (GTK_EDITABLE (name_field), TRUE);
|
||||
#endif
|
||||
|
||||
g_signal_connect (name_field, "focus_out_event",
|
||||
G_CALLBACK (name_field_focus_out),
|
||||
window);
|
||||
|
||||
g_signal_connect (name_field, "activate",
|
||||
G_CALLBACK (name_field_activate),
|
||||
window);
|
||||
g_signal_connect_object (name_field, "focus_out_event",
|
||||
G_CALLBACK (name_field_focus_out), window, 0);
|
||||
g_signal_connect_object (name_field, "activate",
|
||||
G_CALLBACK (name_field_activate), window, 0);
|
||||
|
||||
/* Start with name field selected, if it's sensitive. */
|
||||
if (GTK_WIDGET_SENSITIVE (name_field)) {
|
||||
|
@ -1639,13 +1612,13 @@ create_basic_page (FMPropertiesWindow *window)
|
|||
gtk_widget_show (temp_button);
|
||||
gtk_box_pack_start (GTK_BOX (button_box), temp_button, FALSE, FALSE, 4);
|
||||
|
||||
g_signal_connect(temp_button, "clicked", G_CALLBACK (select_image_button_callback), window);
|
||||
g_signal_connect_object (temp_button, "clicked", G_CALLBACK (select_image_button_callback), window, 0);
|
||||
|
||||
temp_button = gtk_button_new_with_mnemonic (_("_Remove Custom Icon"));
|
||||
gtk_widget_show (temp_button);
|
||||
gtk_box_pack_start (GTK_BOX(button_box), temp_button, FALSE, FALSE, 4);
|
||||
|
||||
g_signal_connect (temp_button, "clicked", G_CALLBACK (remove_image_button_callback), window);
|
||||
g_signal_connect_object (temp_button, "clicked", G_CALLBACK (remove_image_button_callback), window, 0);
|
||||
|
||||
window->details->remove_image_button = temp_button;
|
||||
|
||||
|
@ -1739,7 +1712,7 @@ create_emblems_page (FMPropertiesWindow *window)
|
|||
|
||||
nautilus_file_ref (file);
|
||||
g_object_set_data_full (G_OBJECT (button), "nautilus_file",
|
||||
file, (GtkDestroyNotify) nautilus_file_unref);
|
||||
file, (GDestroyNotify) nautilus_file_unref);
|
||||
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (property_button_toggled), NULL);
|
||||
|
@ -1783,7 +1756,7 @@ static void
|
|||
update_permissions_check_button_state (GtkWidget *check_button, NautilusFile *file)
|
||||
{
|
||||
GnomeVFSFilePermissions file_permissions, permission;
|
||||
guint toggled_signal_id;
|
||||
gulong toggled_signal_id;
|
||||
|
||||
g_assert (GTK_IS_CHECK_BUTTON (check_button));
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
@ -1794,11 +1767,11 @@ update_permissions_check_button_state (GtkWidget *check_button, NautilusFile *fi
|
|||
|
||||
g_assert (nautilus_file_can_get_permissions (file));
|
||||
|
||||
toggled_signal_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (check_button),
|
||||
toggled_signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (check_button),
|
||||
"toggled_signal_id"));
|
||||
permission = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (check_button),
|
||||
"permission"));
|
||||
g_assert (toggled_signal_id > 0);
|
||||
g_assert (toggled_signal_id != 0);
|
||||
g_assert (permission != 0);
|
||||
|
||||
file_permissions = nautilus_file_get_permissions (file);
|
||||
|
@ -1806,12 +1779,10 @@ update_permissions_check_button_state (GtkWidget *check_button, NautilusFile *fi
|
|||
nautilus_file_can_set_permissions (file));
|
||||
|
||||
/* Don't react to the "toggled" signal here to avoid recursion. */
|
||||
g_signal_handler_block (check_button,
|
||||
toggled_signal_id);
|
||||
g_signal_handler_block (check_button, toggled_signal_id);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
|
||||
(file_permissions & permission) != 0);
|
||||
g_signal_handler_unblock (check_button,
|
||||
toggled_signal_id);
|
||||
g_signal_handler_unblock (check_button, toggled_signal_id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1859,26 +1830,23 @@ set_up_permissions_checkbox (GtkWidget *check_button,
|
|||
NautilusFile *file,
|
||||
GnomeVFSFilePermissions permission)
|
||||
{
|
||||
guint toggled_signal_id;
|
||||
gulong toggled_signal_id;
|
||||
|
||||
toggled_signal_id = g_signal_connect (check_button, "toggled",
|
||||
G_CALLBACK (permissions_check_button_toggled),
|
||||
file);
|
||||
G_CALLBACK (permissions_check_button_toggled),
|
||||
file);
|
||||
|
||||
/* Load up the check_button with data we'll need when updating its state. */
|
||||
g_object_set_data (G_OBJECT (check_button),
|
||||
"toggled_signal_id",
|
||||
GINT_TO_POINTER (toggled_signal_id));
|
||||
g_object_set_data (G_OBJECT (check_button),
|
||||
"permission",
|
||||
GINT_TO_POINTER (permission));
|
||||
g_object_set_data (G_OBJECT (check_button), "toggled_signal_id",
|
||||
GUINT_TO_POINTER (toggled_signal_id));
|
||||
g_object_set_data (G_OBJECT (check_button), "permission",
|
||||
GINT_TO_POINTER (permission));
|
||||
|
||||
/* Set initial state. */
|
||||
update_permissions_check_button_state (check_button, file);
|
||||
|
||||
/* Update state later if file changes. */
|
||||
g_signal_connect_object (file,
|
||||
"changed",
|
||||
g_signal_connect_object (file, "changed",
|
||||
G_CALLBACK (update_permissions_check_button_state),
|
||||
check_button, G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
@ -2225,10 +2193,9 @@ create_properties_window (StartupData *startup_data)
|
|||
|
||||
/* React to future property changes and file deletions. */
|
||||
window->details->file_changed_handler_id =
|
||||
g_signal_connect_swapped (window->details->target_file,
|
||||
"changed",
|
||||
G_CALLBACK (properties_window_file_changed_callback),
|
||||
window);
|
||||
g_signal_connect_object (window->details->target_file, "changed",
|
||||
G_CALLBACK (properties_window_file_changed_callback),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
|
||||
/* Create the notebook tabs. */
|
||||
window->details->notebook = GTK_NOTEBOOK (gtk_notebook_new ());
|
||||
|
@ -2400,10 +2367,8 @@ fm_properties_window_present (NautilusFile *original_file, FMDirectoryView *dire
|
|||
*/
|
||||
|
||||
g_hash_table_insert (pending_files, target_file, target_file);
|
||||
g_signal_connect (directory_view,
|
||||
"destroy",
|
||||
G_CALLBACK (directory_view_destroyed_callback),
|
||||
startup_data);
|
||||
g_signal_connect (directory_view, "destroy",
|
||||
G_CALLBACK (directory_view_destroyed_callback), startup_data);
|
||||
|
||||
parent_window = gtk_widget_get_ancestor (GTK_WIDGET (directory_view), GTK_TYPE_WINDOW);
|
||||
eel_timed_wait_start
|
||||
|
@ -2456,7 +2421,7 @@ real_destroy (GtkObject *object)
|
|||
window->details->update_directory_contents_timeout_id = 0;
|
||||
}
|
||||
|
||||
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2469,7 +2434,7 @@ real_finalize (GObject *object)
|
|||
g_free (window->details->pending_name);
|
||||
g_free (window->details);
|
||||
|
||||
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/* icon selection callback to set the image of the file object to the selected file */
|
||||
|
@ -2524,3 +2489,18 @@ remove_image_button_callback (GtkWidget *widget, FMPropertiesWindow *properties_
|
|||
|
||||
gtk_widget_set_sensitive (widget, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
fm_properties_window_class_init (FMPropertiesWindowClass *class)
|
||||
{
|
||||
G_OBJECT_CLASS (class)->finalize = real_finalize;
|
||||
GTK_OBJECT_CLASS (class)->destroy = real_destroy;
|
||||
}
|
||||
|
||||
static void
|
||||
fm_properties_window_instance_init (FMPropertiesWindow *window)
|
||||
{
|
||||
window->details = g_new0 (FMPropertiesWindowDetails, 1);
|
||||
|
||||
eel_gtk_window_set_up_close_accelerator (GTK_WINDOW (window));
|
||||
}
|
||||
|
|
|
@ -386,10 +386,8 @@ fm_search_list_view_init (gpointer object,
|
|||
|
||||
nautilus_view = fm_directory_view_get_nautilus_view (directory_view);
|
||||
|
||||
g_signal_connect (nautilus_view,
|
||||
"load_location",
|
||||
G_CALLBACK (load_location_callback),
|
||||
NULL);
|
||||
g_signal_connect (nautilus_view, "load_location",
|
||||
G_CALLBACK (load_location_callback), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -632,10 +630,9 @@ real_adding_file (FMListView *view, NautilusFile *file)
|
|||
* and won't be specific to the search directory. Is that OK?
|
||||
*/
|
||||
|
||||
g_signal_connect_swapped (GTK_OBJECT (file),
|
||||
"changed",
|
||||
G_CALLBACK (fm_directory_view_queue_file_change),
|
||||
view);
|
||||
g_signal_connect_object (GTK_OBJECT (file), "changed",
|
||||
G_CALLBACK (fm_directory_view_queue_file_change),
|
||||
view, G_CONNECT_SWAPPED);
|
||||
|
||||
/* Monitor the things needed to get the right
|
||||
* icon. Also monitor a directory's item count because
|
||||
|
|
|
@ -131,8 +131,7 @@ show_index_progress_dialog (void)
|
|||
gtk_widget_show_all (GTK_WIDGET (dialogs->index_in_progress_dialog));
|
||||
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
|
||||
dialogs->index_in_progress_dialog);
|
||||
g_signal_connect_swapped (dialogs->index_in_progress_dialog,
|
||||
"destroy",
|
||||
g_signal_connect_swapped (dialogs->index_in_progress_dialog, "destroy",
|
||||
G_CALLBACK (medusa_remove_state_changed_function),
|
||||
GINT_TO_POINTER (callback_id));
|
||||
}
|
||||
|
@ -149,8 +148,7 @@ show_last_index_time_dialog (void)
|
|||
gtk_widget_show_all (GTK_WIDGET (dialogs->last_index_time_dialog));
|
||||
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
|
||||
dialogs->last_index_time_dialog);
|
||||
g_signal_connect_swapped (dialogs->last_index_time_dialog,
|
||||
"destroy",
|
||||
g_signal_connect_swapped (dialogs->last_index_time_dialog, "destroy",
|
||||
G_CALLBACK (medusa_remove_state_changed_function),
|
||||
GINT_TO_POINTER (callback_id));
|
||||
}
|
||||
|
@ -236,10 +234,9 @@ index_progress_dialog_new (void)
|
|||
NULL,
|
||||
progress_data,
|
||||
g_free);
|
||||
g_signal_connect (progress_bar_hbox,
|
||||
"destroy",
|
||||
G_CALLBACK (timeout_remove_callback),
|
||||
GUINT_TO_POINTER (timeout_id));
|
||||
g_signal_connect (progress_bar_hbox, "destroy", /* FIXME: will be called twice */
|
||||
G_CALLBACK (timeout_remove_callback),
|
||||
GLONG_TO_POINTER (timeout_id));
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
@ -273,8 +270,7 @@ show_indexing_info_dialog (void)
|
|||
|
||||
callback_id = medusa_execute_once_when_system_state_changes (dialog_close_cover,
|
||||
dialog_shown);
|
||||
g_signal_connect_swapped (G_OBJECT (dialog_shown),
|
||||
"destroy",
|
||||
g_signal_connect_swapped (dialog_shown, "destroy",
|
||||
G_CALLBACK (medusa_remove_state_changed_function),
|
||||
GINT_TO_POINTER (callback_id));
|
||||
return;
|
||||
|
|
|
@ -142,12 +142,12 @@ nautilus_application_instance_init (NautilusApplication *application)
|
|||
application->undo_manager = nautilus_undo_manager_new ();
|
||||
|
||||
/* Watch for volume mounts so we can restore open windows */
|
||||
g_signal_connect (nautilus_volume_monitor_get (), "volume_mounted",
|
||||
G_CALLBACK (volume_mounted_callback), application);
|
||||
g_signal_connect_object (nautilus_volume_monitor_get (), "volume_mounted",
|
||||
G_CALLBACK (volume_mounted_callback), application, 0);
|
||||
|
||||
/* Watch for volume unmounts so we can close open windows */
|
||||
g_signal_connect (nautilus_volume_monitor_get (), "volume_unmounted",
|
||||
G_CALLBACK (volume_unmounted_callback), application);
|
||||
g_signal_connect_object (nautilus_volume_monitor_get (), "volume_unmounted",
|
||||
G_CALLBACK (volume_unmounted_callback), application, 0);
|
||||
}
|
||||
|
||||
NautilusApplication *
|
||||
|
@ -635,16 +635,14 @@ nautilus_application_create_window (NautilusApplication *application)
|
|||
g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
|
||||
|
||||
window = NAUTILUS_WINDOW (gtk_widget_new (nautilus_window_get_type (),
|
||||
"app", G_OBJECT (application),
|
||||
"app", application,
|
||||
"app_id", "nautilus", NULL));
|
||||
|
||||
g_signal_connect (window,
|
||||
"delete_event", G_CALLBACK (nautilus_window_delete_event_callback),
|
||||
NULL);
|
||||
g_signal_connect (window, "delete_event",
|
||||
G_CALLBACK (nautilus_window_delete_event_callback), NULL);
|
||||
|
||||
g_signal_connect (window,
|
||||
"destroy", G_CALLBACK (nautilus_application_destroyed_window),
|
||||
application);
|
||||
g_signal_connect_object (window, "destroy",
|
||||
G_CALLBACK (nautilus_application_destroyed_window), application, 0);
|
||||
|
||||
nautilus_application_window_list = g_list_prepend (nautilus_application_window_list, window);
|
||||
|
||||
|
@ -874,12 +872,10 @@ init_session (void)
|
|||
client = gnome_master_client ();
|
||||
|
||||
g_signal_connect (client, "save_yourself",
|
||||
(GtkSignalFunc) save_session,
|
||||
NULL);
|
||||
G_CALLBACK (save_session), NULL);
|
||||
|
||||
g_signal_connect (client, "die",
|
||||
(GtkSignalFunc) removed_from_session,
|
||||
NULL);
|
||||
G_CALLBACK (removed_from_session), NULL);
|
||||
|
||||
eel_preferences_add_callback
|
||||
(NAUTILUS_PREFERENCES_ADD_TO_SESSION,
|
||||
|
|
|
@ -183,19 +183,12 @@ insert_bookmark_internal (NautilusBookmarkList *bookmarks,
|
|||
NautilusBookmark *bookmark,
|
||||
int index)
|
||||
{
|
||||
bookmarks->list = g_list_insert (bookmarks->list,
|
||||
bookmark,
|
||||
index);
|
||||
bookmarks->list = g_list_insert (bookmarks->list, bookmark, index);
|
||||
|
||||
g_signal_connect (bookmark,
|
||||
"appearance_changed",
|
||||
G_CALLBACK (bookmark_in_list_changed_callback),
|
||||
bookmarks);
|
||||
|
||||
g_signal_connect (bookmark,
|
||||
"contents_changed",
|
||||
G_CALLBACK (bookmark_in_list_changed_callback),
|
||||
bookmarks);
|
||||
g_signal_connect_object (bookmark, "appearance_changed",
|
||||
G_CALLBACK (bookmark_in_list_changed_callback), bookmarks, 0);
|
||||
g_signal_connect_object (bookmark, "contents_changed",
|
||||
G_CALLBACK (bookmark_in_list_changed_callback), bookmarks, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -248,24 +248,19 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
|
|||
|
||||
g_signal_connect (window, "delete_event",
|
||||
G_CALLBACK (on_window_delete_event), NULL);
|
||||
|
||||
g_signal_connect (window, "hide",
|
||||
G_CALLBACK (on_window_hide_event), NULL);
|
||||
|
||||
G_CALLBACK (on_window_hide_event), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (on_window_destroy_event), NULL);
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (nautilus_bookmarks_window_response_callback), NULL);
|
||||
|
||||
name_field_changed_signal_id =
|
||||
g_signal_connect (name_field, "changed",
|
||||
G_CALLBACK (on_name_field_changed),
|
||||
NULL);
|
||||
G_CALLBACK (on_name_field_changed), NULL);
|
||||
|
||||
g_signal_connect (name_field, "focus_out_event",
|
||||
G_CALLBACK (on_text_field_focus_out_event), NULL);
|
||||
|
||||
G_CALLBACK (on_text_field_focus_out_event), NULL);
|
||||
g_signal_connect (name_field, "activate",
|
||||
G_CALLBACK (name_or_uri_field_activate), NULL);
|
||||
|
||||
|
@ -275,10 +270,8 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
|
|||
|
||||
g_signal_connect (uri_field, "focus_out_event",
|
||||
G_CALLBACK (on_text_field_focus_out_event), NULL);
|
||||
|
||||
g_signal_connect (uri_field, "activate",
|
||||
G_CALLBACK (name_or_uri_field_activate), NULL);
|
||||
|
||||
g_signal_connect (remove_button, "clicked",
|
||||
G_CALLBACK (on_remove_button_clicked), NULL);
|
||||
|
||||
|
@ -287,8 +280,7 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
|
|||
G_CALLBACK (repopulate), window,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_tree_selection_set_mode (bookmark_selection,
|
||||
GTK_SELECTION_BROWSE);
|
||||
gtk_tree_selection_set_mode (bookmark_selection, GTK_SELECTION_BROWSE);
|
||||
|
||||
/* Fill in list widget with bookmarks, must be after signals are wired up. */
|
||||
repopulate();
|
||||
|
|
|
@ -104,10 +104,8 @@ search_bar_criterion_type_changed_callback (GObject *old_criterion_object,
|
|||
new_type = GPOINTER_TO_INT (g_object_get_data (old_criterion_object, "type"));
|
||||
new_criterion = nautilus_search_bar_criterion_new_with_type (new_type,
|
||||
bar);
|
||||
g_signal_connect (new_criterion,
|
||||
"criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback),
|
||||
bar);
|
||||
g_signal_connect_object (new_criterion, "criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback), bar, 0);
|
||||
old_criterion_location = g_slist_find (bar->details->search_criteria,
|
||||
criterion);
|
||||
old_criterion_location->data = new_criterion;
|
||||
|
@ -179,10 +177,8 @@ nautilus_complex_search_bar_init (NautilusComplexSearchBar *bar)
|
|||
|
||||
file_name_criterion = nautilus_search_bar_criterion_first_new (bar);
|
||||
|
||||
g_signal_connect (file_name_criterion,
|
||||
"criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback),
|
||||
bar);
|
||||
g_signal_connect_object (file_name_criterion, "criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback), bar, 0);
|
||||
bar->details->search_criteria = g_slist_prepend (NULL,
|
||||
file_name_criterion);
|
||||
|
||||
|
@ -198,24 +194,21 @@ nautilus_complex_search_bar_init (NautilusComplexSearchBar *bar)
|
|||
|
||||
hbox = gtk_hwrap_box_new (FALSE);
|
||||
|
||||
g_signal_connect (hbox,
|
||||
"need_reallocation",
|
||||
G_CALLBACK (queue_search_bar_resize_callback),
|
||||
bar);
|
||||
g_signal_connect_object (hbox, "need_reallocation",
|
||||
G_CALLBACK (queue_search_bar_resize_callback), bar, 0);
|
||||
|
||||
bar->details->more_options = gtk_button_new_with_label (_("More Options"));
|
||||
g_signal_connect (bar->details->more_options, "clicked",
|
||||
G_CALLBACK (more_options_callback), bar);
|
||||
|
||||
|
||||
g_signal_connect_object (bar->details->more_options, "clicked",
|
||||
G_CALLBACK (more_options_callback), bar, 0);
|
||||
|
||||
gtk_wrap_box_pack (GTK_WRAP_BOX (hbox),
|
||||
bar->details->more_options,
|
||||
FALSE, FALSE, FALSE, FALSE);
|
||||
gtk_widget_show (bar->details->more_options);
|
||||
|
||||
bar->details->fewer_options = gtk_button_new_with_label (_("Fewer Options"));
|
||||
g_signal_connect (bar->details->fewer_options, "clicked",
|
||||
G_CALLBACK (fewer_options_callback), bar);
|
||||
g_signal_connect_object (bar->details->fewer_options, "clicked",
|
||||
G_CALLBACK (fewer_options_callback), bar, 0);
|
||||
|
||||
gtk_wrap_box_pack (GTK_WRAP_BOX (hbox),
|
||||
bar->details->fewer_options,
|
||||
|
@ -239,9 +232,9 @@ nautilus_complex_search_bar_init (NautilusComplexSearchBar *bar)
|
|||
1);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (bar->details->find_them), find_them_box);
|
||||
g_signal_connect_swapped (bar->details->find_them, "clicked",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_object (bar->details->find_them, "clicked",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar, G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_wrap_box_pack (GTK_WRAP_BOX (hbox),
|
||||
bar->details->find_them,
|
||||
|
@ -390,17 +383,14 @@ attach_criterion_to_search_bar (NautilusComplexSearchBar *bar,
|
|||
|
||||
if (criterion->details->use_value_entry) {
|
||||
/* We want to track whether the entry text is empty or not. */
|
||||
g_signal_connect_swapped (criterion->details->value_entry,
|
||||
"changed",
|
||||
G_CALLBACK (update_find_button_state),
|
||||
bar);
|
||||
g_signal_connect_object (criterion->details->value_entry, "changed",
|
||||
G_CALLBACK (update_find_button_state), bar, G_CONNECT_SWAPPED);
|
||||
|
||||
/* We want to activate the "Find" button when any entry text is not empty */
|
||||
g_assert (GTK_IS_BUTTON (bar->details->find_them));
|
||||
g_signal_connect_swapped (criterion->details->value_entry,
|
||||
"activate",
|
||||
G_CALLBACK (gtk_widget_activate),
|
||||
bar->details->find_them);
|
||||
g_signal_connect_object (criterion->details->value_entry, "activate",
|
||||
G_CALLBACK (gtk_widget_activate),
|
||||
bar->details->find_them, G_CONNECT_SWAPPED);
|
||||
}
|
||||
nautilus_complex_search_bar_queue_resize (bar);
|
||||
}
|
||||
|
@ -482,10 +472,8 @@ more_options_callback (GtkObject *object,
|
|||
last_criterion = (NautilusSearchBarCriterion *)((g_slist_last (list))->data);
|
||||
criterion = nautilus_search_bar_criterion_next_new (last_criterion->details->type,
|
||||
bar);
|
||||
g_signal_connect (criterion,
|
||||
"criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback),
|
||||
bar);
|
||||
g_signal_connect_object (criterion, "criterion_type_changed",
|
||||
G_CALLBACK (search_bar_criterion_type_changed_callback), bar, 0);
|
||||
bar->details->search_criteria = g_slist_append (list, criterion);
|
||||
|
||||
nautilus_search_bar_criterion_show (criterion);
|
||||
|
|
|
@ -84,7 +84,7 @@ struct NautilusSidebarDetails {
|
|||
gboolean has_buttons;
|
||||
char *uri;
|
||||
NautilusFile *file;
|
||||
gulong file_changed_connection;
|
||||
guint file_changed_connection;
|
||||
char *default_background_color;
|
||||
char *default_background_image;
|
||||
int selected_index;
|
||||
|
@ -342,8 +342,6 @@ nautilus_sidebar_finalize (GObject *object)
|
|||
sidebar = NAUTILUS_SIDEBAR (object);
|
||||
|
||||
if (sidebar->details->file != NULL) {
|
||||
g_signal_handler_disconnect (sidebar->details->file,
|
||||
sidebar->details->file_changed_connection);
|
||||
nautilus_file_monitor_remove (sidebar->details->file, sidebar);
|
||||
nautilus_file_unref (sidebar->details->file);
|
||||
}
|
||||
|
@ -509,17 +507,13 @@ sidebar_for_each_sidebar_panel (const char *name,
|
|||
gtk_widget_show (menu_item);
|
||||
g_object_set_data (G_OBJECT (menu_item), "user_data", data->sidebar);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (data->menu), menu_item);
|
||||
g_signal_connect_data (menu_item,
|
||||
"activate",
|
||||
g_signal_connect_data (menu_item, "activate",
|
||||
G_CALLBACK (toggle_sidebar_panel),
|
||||
g_strdup (iid),
|
||||
(GClosureNotify)g_free,
|
||||
0);
|
||||
g_strdup (iid), (GClosureNotify) g_free, 0);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (menu_item),
|
||||
"nautilus-sidebar/preference-key",
|
||||
g_strdup (preference_key),
|
||||
g_free);
|
||||
g_strdup (preference_key), g_free);
|
||||
}
|
||||
|
||||
/* utility routine to add a menu item for each potential sidebar panel */
|
||||
|
@ -574,8 +568,8 @@ nautilus_sidebar_create_context_menu (NautilusSidebar *sidebar)
|
|||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_set_sensitive (menu_item, has_background);
|
||||
g_signal_connect (menu_item, "activate",
|
||||
G_CALLBACK (reset_background_callback), sidebar);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (reset_background_callback), sidebar, 0);
|
||||
|
||||
/* add a separator */
|
||||
menu_item = gtk_menu_item_new ();
|
||||
|
@ -944,8 +938,8 @@ nautilus_sidebar_add_panel (NautilusSidebar *sidebar, NautilusViewFrame *panel)
|
|||
|
||||
gtk_widget_show (label);
|
||||
|
||||
g_signal_connect (panel, "view_loaded",
|
||||
G_CALLBACK (view_loaded_callback), sidebar);
|
||||
g_signal_connect_object (panel, "view_loaded",
|
||||
G_CALLBACK (view_loaded_callback), sidebar, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (sidebar->details->notebook),
|
||||
GTK_WIDGET (panel), label);
|
||||
|
@ -1398,7 +1392,7 @@ add_command_buttons (NautilusSidebar *sidebar, GList *application_list)
|
|||
/* Catch-all button after all the others. */
|
||||
temp_button = gtk_button_new_with_label (_("Open with..."));
|
||||
g_signal_connect (temp_button, "clicked",
|
||||
G_CALLBACK (open_with_callback), NULL);
|
||||
G_CALLBACK (open_with_callback), NULL);
|
||||
g_object_set_data (G_OBJECT (temp_button), "user_data", sidebar);
|
||||
gtk_widget_show (temp_button);
|
||||
gtk_box_pack_start (GTK_BOX (sidebar->details->button_box),
|
||||
|
@ -1554,14 +1548,10 @@ nautilus_sidebar_update_appearance (NautilusSidebar *sidebar)
|
|||
background = eel_get_widget_background (GTK_WIDGET (sidebar));
|
||||
if (!sidebar->details->background_connected) {
|
||||
sidebar->details->background_connected = TRUE;
|
||||
g_signal_connect (background,
|
||||
"settings_changed",
|
||||
G_CALLBACK (background_settings_changed_callback),
|
||||
sidebar);
|
||||
g_signal_connect (background,
|
||||
"reset",
|
||||
G_CALLBACK (background_reset_callback),
|
||||
sidebar);
|
||||
g_signal_connect_object (background,"settings_changed",
|
||||
G_CALLBACK (background_settings_changed_callback), sidebar, 0);
|
||||
g_signal_connect_object (background, "reset",
|
||||
G_CALLBACK (background_reset_callback), sidebar, 0);
|
||||
}
|
||||
|
||||
/* Set up the background color and image from the metadata. */
|
||||
|
@ -1650,7 +1640,6 @@ nautilus_sidebar_set_uri (NautilusSidebar *sidebar,
|
|||
if (sidebar->details->file != NULL) {
|
||||
g_signal_handler_disconnect (sidebar->details->file,
|
||||
sidebar->details->file_changed_connection);
|
||||
|
||||
nautilus_file_monitor_remove (sidebar->details->file, sidebar);
|
||||
}
|
||||
|
||||
|
@ -1662,10 +1651,9 @@ nautilus_sidebar_set_uri (NautilusSidebar *sidebar,
|
|||
sidebar->details->file = file;
|
||||
|
||||
sidebar->details->file_changed_connection =
|
||||
g_signal_connect_swapped (sidebar->details->file,
|
||||
"changed",
|
||||
G_CALLBACK (background_metadata_changed_callback),
|
||||
sidebar);
|
||||
g_signal_connect_object (sidebar->details->file, "changed",
|
||||
G_CALLBACK (background_metadata_changed_callback),
|
||||
sidebar, G_CONNECT_SWAPPED);
|
||||
|
||||
attributes = nautilus_mime_actions_get_minimum_file_attributes ();
|
||||
nautilus_file_monitor_add (sidebar->details->file, sidebar, attributes);
|
||||
|
|
|
@ -669,12 +669,11 @@ nautilus_location_bar_init (NautilusLocationBar *bar)
|
|||
|
||||
nautilus_entry_set_special_tab_handling (NAUTILUS_ENTRY (entry), TRUE);
|
||||
|
||||
g_signal_connect_swapped (entry, "activate",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect (GTK_OBJECT (entry), "event_after",
|
||||
G_CALLBACK (editable_event_after_callback),
|
||||
bar);
|
||||
g_signal_connect_object (entry, "activate",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (entry, "event_after",
|
||||
G_CALLBACK (editable_event_after_callback), bar, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
|
||||
|
@ -685,9 +684,8 @@ nautilus_location_bar_init (NautilusLocationBar *bar)
|
|||
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
|
||||
drag_types, G_N_ELEMENTS (drag_types),
|
||||
GDK_ACTION_LINK);
|
||||
g_signal_connect (event_box, "drag_data_get",
|
||||
G_CALLBACK (drag_data_get_callback),
|
||||
bar);
|
||||
g_signal_connect_object (event_box, "drag_data_get",
|
||||
G_CALLBACK (drag_data_get_callback), bar, 0);
|
||||
|
||||
/* Drag dest. */
|
||||
gtk_drag_dest_set (GTK_WIDGET (bar),
|
||||
|
@ -695,8 +693,7 @@ nautilus_location_bar_init (NautilusLocationBar *bar)
|
|||
drop_types, G_N_ELEMENTS (drop_types),
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
|
||||
g_signal_connect (bar, "drag_data_received",
|
||||
G_CALLBACK (drag_data_received_callback),
|
||||
NULL);
|
||||
G_CALLBACK (drag_data_received_callback), NULL);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ eel_gtk_main_quit_all (void)
|
|||
static void
|
||||
event_loop_unregister (GtkObject *object)
|
||||
{
|
||||
g_assert (g_slist_find (event_loop_registrants, object) != NULL);
|
||||
event_loop_registrants = g_slist_remove (event_loop_registrants, object);
|
||||
if (!is_event_loop_needed ()) {
|
||||
eel_gtk_main_quit_all ();
|
||||
|
|
|
@ -138,11 +138,11 @@ bookmark_holder_new (NautilusBookmark *bookmark,
|
|||
new_bookmark_holder->prompt_for_removal = is_bookmarks_menu;
|
||||
|
||||
new_bookmark_holder->changed_handler_id =
|
||||
g_signal_connect_swapped (bookmark, "appearance_changed",
|
||||
is_bookmarks_menu
|
||||
? G_CALLBACK (schedule_refresh_bookmarks_menu)
|
||||
: G_CALLBACK (schedule_refresh_go_menu),
|
||||
window);
|
||||
g_signal_connect_object (bookmark, "appearance_changed",
|
||||
is_bookmarks_menu
|
||||
? G_CALLBACK (schedule_refresh_bookmarks_menu)
|
||||
: G_CALLBACK (schedule_refresh_go_menu),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
|
||||
return new_bookmark_holder;
|
||||
}
|
||||
|
@ -353,10 +353,8 @@ forget_history_if_confirmed (NautilusWindow *window)
|
|||
GTK_WINDOW (window));
|
||||
g_free (prompt);
|
||||
|
||||
g_signal_connect (dialog,
|
||||
"response",
|
||||
G_CALLBACK (forget_history_if_yes),
|
||||
NULL);
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (forget_history_if_yes), NULL);
|
||||
|
||||
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_NO);
|
||||
}
|
||||
|
@ -1151,8 +1149,8 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
|||
nautilus_window_update_show_hide_menu_items (window);
|
||||
|
||||
/* Register to catch Bonobo UI events so we can notice View As changes */
|
||||
g_signal_connect (window->details->shell_ui, "ui_event",
|
||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
||||
g_signal_connect_object (window->details->shell_ui, "ui_event",
|
||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window, 0);
|
||||
|
||||
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
|
||||
|
||||
|
|
|
@ -572,11 +572,10 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
window->navigation_bar = nautilus_switchable_navigation_bar_new (window);
|
||||
gtk_widget_show (GTK_WIDGET (window->navigation_bar));
|
||||
|
||||
g_signal_connect (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window);
|
||||
|
||||
g_signal_connect (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window);
|
||||
g_signal_connect_object (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window, 0);
|
||||
g_signal_connect_object (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
|
@ -600,14 +599,18 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
* It gets shown later, if the view-frame contains something zoomable.
|
||||
*/
|
||||
window->zoom_control = nautilus_zoom_control_new ();
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit), window);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
gtk_box_pack_end (GTK_BOX (location_bar_box), window->zoom_control, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show (location_bar_box);
|
||||
|
@ -626,8 +629,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
/* set up the sidebar */
|
||||
window->sidebar = nautilus_sidebar_new ();
|
||||
gtk_widget_show (GTK_WIDGET (window->sidebar));
|
||||
g_signal_connect (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window);
|
||||
g_signal_connect_object (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window, 0);
|
||||
gtk_paned_pack1 (GTK_PANED (window->content_hbox),
|
||||
GTK_WIDGET (window->sidebar),
|
||||
FALSE, TRUE);
|
||||
|
@ -1045,14 +1048,11 @@ create_view_as_menu_item (NautilusWindow *window,
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (menu_item),
|
||||
"viewer index",
|
||||
GINT_TO_POINTER (index));
|
||||
g_object_set_data (G_OBJECT (menu_item), "viewer index", GINT_TO_POINTER (index));
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
|
@ -1382,10 +1382,8 @@ load_view_as_menus_callback (NautilusFile *file,
|
|||
|
||||
/* Add "View as..." extra bonus choice. */
|
||||
menu_item = gtk_menu_item_new_with_label (_("View as..."));
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback), window, 0);
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (new_menu), menu_item);
|
||||
|
||||
|
|
|
@ -572,11 +572,10 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
window->navigation_bar = nautilus_switchable_navigation_bar_new (window);
|
||||
gtk_widget_show (GTK_WIDGET (window->navigation_bar));
|
||||
|
||||
g_signal_connect (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window);
|
||||
|
||||
g_signal_connect (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window);
|
||||
g_signal_connect_object (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window, 0);
|
||||
g_signal_connect_object (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
|
@ -600,14 +599,18 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
* It gets shown later, if the view-frame contains something zoomable.
|
||||
*/
|
||||
window->zoom_control = nautilus_zoom_control_new ();
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit), window);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
gtk_box_pack_end (GTK_BOX (location_bar_box), window->zoom_control, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show (location_bar_box);
|
||||
|
@ -626,8 +629,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
/* set up the sidebar */
|
||||
window->sidebar = nautilus_sidebar_new ();
|
||||
gtk_widget_show (GTK_WIDGET (window->sidebar));
|
||||
g_signal_connect (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window);
|
||||
g_signal_connect_object (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window, 0);
|
||||
gtk_paned_pack1 (GTK_PANED (window->content_hbox),
|
||||
GTK_WIDGET (window->sidebar),
|
||||
FALSE, TRUE);
|
||||
|
@ -1045,14 +1048,11 @@ create_view_as_menu_item (NautilusWindow *window,
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (menu_item),
|
||||
"viewer index",
|
||||
GINT_TO_POINTER (index));
|
||||
g_object_set_data (G_OBJECT (menu_item), "viewer index", GINT_TO_POINTER (index));
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
|
@ -1382,10 +1382,8 @@ load_view_as_menus_callback (NautilusFile *file,
|
|||
|
||||
/* Add "View as..." extra bonus choice. */
|
||||
menu_item = gtk_menu_item_new_with_label (_("View as..."));
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback), window, 0);
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (new_menu), menu_item);
|
||||
|
||||
|
|
|
@ -535,8 +535,8 @@ preferences_dialog_populate_themes_group (EelPreferencesGroup *group)
|
|||
/* Have the custom preferences item tell us when its time to update the displayed
|
||||
* with with the one stored in preferences
|
||||
*/
|
||||
g_signal_connect (item, "custom_update_displayed_value",
|
||||
G_CALLBACK (update_theme_selector_displayed_value_callback), child);
|
||||
g_signal_connect_object (item, "custom_update_displayed_value",
|
||||
G_CALLBACK (update_theme_selector_displayed_value_callback), child, 0);
|
||||
update_theme_selector_displayed_value_callback (EEL_PREFERENCES_ITEM (item), child);
|
||||
}
|
||||
|
||||
|
|
|
@ -197,10 +197,8 @@ dump_dialog_new (const char *title)
|
|||
dump_dialog->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
eel_gtk_window_set_up_close_accelerator
|
||||
(GTK_WINDOW (dump_dialog->window));
|
||||
g_signal_connect (dump_dialog->window,
|
||||
"delete_event",
|
||||
G_CALLBACK (window_delete_event),
|
||||
dump_dialog->window);
|
||||
g_signal_connect (dump_dialog->window, "delete_event",
|
||||
G_CALLBACK (window_delete_event), dump_dialog->window);
|
||||
|
||||
gtk_widget_set_usize (dump_dialog->window, 700, 700);
|
||||
|
||||
|
@ -214,15 +212,10 @@ dump_dialog_new (const char *title)
|
|||
gtk_widget_set_sensitive (print_button, FALSE);
|
||||
gtk_widget_set_sensitive (save_button, FALSE);
|
||||
|
||||
g_signal_connect (print_button,
|
||||
"clicked",
|
||||
G_CALLBACK (window_print_button_callback),
|
||||
dump_dialog);
|
||||
|
||||
g_signal_connect (save_button,
|
||||
"clicked",
|
||||
G_CALLBACK (window_save_button_callback),
|
||||
dump_dialog);
|
||||
g_signal_connect_object (print_button, "clicked",
|
||||
G_CALLBACK (window_print_button_callback), dump_dialog, 0);
|
||||
g_signal_connect_object (save_button, "clicked",
|
||||
G_CALLBACK (window_save_button_callback), dump_dialog, 0);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (dump_dialog->window), main_box);
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ nautilus_property_browser_init (GtkObject *object)
|
|||
|
||||
gtk_widget_show(temp_button);
|
||||
gtk_box_pack_end (GTK_BOX(property_browser->details->bottom_box), temp_button, FALSE, FALSE, GNOME_PAD_SMALL);
|
||||
g_signal_connect(temp_button, "clicked", G_CALLBACK (done_button_callback), property_browser);
|
||||
g_signal_connect_object (temp_button, "clicked", G_CALLBACK (done_button_callback), property_browser, 0);
|
||||
|
||||
/* create the "add new" button */
|
||||
property_browser->details->add_button = gtk_button_new ();
|
||||
|
@ -369,8 +369,8 @@ nautilus_property_browser_init (GtkObject *object)
|
|||
gtk_box_pack_end (GTK_BOX(property_browser->details->bottom_box),
|
||||
property_browser->details->add_button, FALSE, FALSE, GNOME_PAD_SMALL);
|
||||
|
||||
g_signal_connect (property_browser->details->add_button, "clicked",
|
||||
G_CALLBACK (add_new_button_callback), property_browser);
|
||||
g_signal_connect_object (property_browser->details->add_button, "clicked",
|
||||
G_CALLBACK (add_new_button_callback), property_browser, 0);
|
||||
|
||||
/* now create the "remove" button */
|
||||
property_browser->details->remove_button = gtk_button_new();
|
||||
|
@ -388,10 +388,8 @@ nautilus_property_browser_init (GtkObject *object)
|
|||
FALSE,
|
||||
GNOME_PAD_SMALL);
|
||||
|
||||
g_signal_connect (property_browser->details->remove_button,
|
||||
"clicked",
|
||||
G_CALLBACK (remove_button_callback),
|
||||
property_browser);
|
||||
g_signal_connect_object (property_browser->details->remove_button, "clicked",
|
||||
G_CALLBACK (remove_button_callback), property_browser, 0);
|
||||
|
||||
/* now create the actual content, with the category pane and the content frame */
|
||||
|
||||
|
@ -409,12 +407,9 @@ nautilus_property_browser_init (GtkObject *object)
|
|||
property_browser);
|
||||
|
||||
g_signal_connect (property_browser, "delete_event",
|
||||
G_CALLBACK (nautilus_property_browser_delete_event_callback),
|
||||
NULL);
|
||||
|
||||
G_CALLBACK (nautilus_property_browser_delete_event_callback), NULL);
|
||||
g_signal_connect (property_browser, "hide",
|
||||
G_CALLBACK (nautilus_property_browser_hide_callback),
|
||||
NULL);
|
||||
G_CALLBACK (nautilus_property_browser_hide_callback), NULL);
|
||||
|
||||
/* initially, display the top level */
|
||||
nautilus_property_browser_set_path(property_browser, BROWSER_CATEGORIES_FILE_NAME);
|
||||
|
@ -1191,8 +1186,8 @@ show_color_selection_window (GtkWidget *widget, gpointer *data)
|
|||
|
||||
eel_add_weak_pointer (&property_browser->details->dialog);
|
||||
|
||||
g_signal_connect (property_browser->details->dialog, "clicked",
|
||||
G_CALLBACK (add_color_to_browser), property_browser);
|
||||
g_signal_connect_object (property_browser->details->dialog, "clicked",
|
||||
G_CALLBACK (add_color_to_browser), property_browser, 0);
|
||||
gtk_window_set_position (GTK_WINDOW (property_browser->details->dialog), GTK_WIN_POS_MOUSE);
|
||||
gtk_widget_show (GTK_WIDGET(property_browser->details->dialog));
|
||||
|
||||
|
@ -1217,10 +1212,10 @@ add_new_color (NautilusPropertyBrowser *property_browser)
|
|||
|
||||
eel_add_weak_pointer (&property_browser->details->dialog);
|
||||
|
||||
g_signal_connect (color_dialog->ok_button, "clicked",
|
||||
G_CALLBACK (show_color_selection_window), property_browser);
|
||||
g_signal_connect_swapped (color_dialog->cancel_button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), color_dialog);
|
||||
g_signal_connect_object (color_dialog->ok_button, "clicked",
|
||||
G_CALLBACK (show_color_selection_window), property_browser, 0);
|
||||
g_signal_connect_object (color_dialog->cancel_button, "clicked",
|
||||
G_CALLBACK (gtk_widget_destroy), color_dialog, G_CONNECT_SWAPPED);
|
||||
gtk_widget_hide(color_dialog->help_button);
|
||||
|
||||
gtk_window_set_position (GTK_WINDOW (color_dialog), GTK_WIN_POS_MOUSE);
|
||||
|
@ -1382,8 +1377,8 @@ add_new_emblem (NautilusPropertyBrowser *property_browser)
|
|||
|
||||
eel_add_weak_pointer (&property_browser->details->dialog);
|
||||
|
||||
g_signal_connect (property_browser->details->dialog, "clicked",
|
||||
G_CALLBACK (emblem_dialog_clicked), property_browser);
|
||||
g_signal_connect_object (property_browser->details->dialog, "clicked",
|
||||
G_CALLBACK (emblem_dialog_clicked), property_browser, 0);
|
||||
gtk_window_set_position (GTK_WINDOW (property_browser->details->dialog), GTK_WIN_POS_MOUSE);
|
||||
gtk_widget_show (GTK_WIDGET(property_browser->details->dialog));
|
||||
}
|
||||
|
@ -1870,11 +1865,9 @@ make_category_link (NautilusPropertyBrowser *property_browser,
|
|||
/* add a signal to handle clicks */
|
||||
g_object_set_data (G_OBJECT(button), "user_data", property_browser);
|
||||
g_signal_connect_data
|
||||
(button,
|
||||
"clicked",
|
||||
(button, "clicked",
|
||||
G_CALLBACK (category_clicked_callback),
|
||||
g_strdup (name),
|
||||
(GClosureNotify)g_free, 0);
|
||||
g_strdup (name), (GClosureNotify) g_free, 0);
|
||||
}
|
||||
|
||||
/* update_contents populates the property browser with information specified by the path and other state variables */
|
||||
|
@ -1919,10 +1912,8 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
|
|||
eel_wrap_table_set_y_spacing (EEL_WRAP_TABLE (property_browser->details->content_table),
|
||||
IMAGE_TABLE_Y_SPACING);
|
||||
|
||||
g_signal_connect (property_browser->details->content_table,
|
||||
"child_pressed",
|
||||
G_CALLBACK (element_clicked_callback),
|
||||
property_browser);
|
||||
g_signal_connect_object (property_browser->details->content_table, "child_pressed",
|
||||
G_CALLBACK (element_clicked_callback), property_browser, 0);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(viewport), property_browser->details->content_table);
|
||||
gtk_container_add (GTK_CONTAINER (property_browser->details->content_frame), viewport);
|
||||
|
|
|
@ -233,8 +233,6 @@ nautilus_search_bar_criterion_destroy (GtkObject *object)
|
|||
criterion = NAUTILUS_SEARCH_BAR_CRITERION (object);
|
||||
|
||||
/* FIXME bugzilla.gnome.org 42437: need more freeage */
|
||||
g_signal_handlers_disconnect_by_func (nautilus_signaller_get_current (),
|
||||
G_CALLBACK (emblems_changed_callback), criterion);
|
||||
/* nautilus_undo_editable_set_undo_key (GTK_EDITABLE (criterion->details->value_entry), FALSE);
|
||||
nautilus_undo_tear_down_nautilus_entry_for_undo (criterion->details->value_entry);
|
||||
*/
|
||||
|
@ -297,10 +295,10 @@ nautilus_search_bar_criterion_new_from_values (NautilusSearchBarCriterionType ty
|
|||
details->bar = bar;
|
||||
details->box = gtk_hwrap_box_new (FALSE);
|
||||
|
||||
g_signal_connect (details->box, "need_reallocation",
|
||||
G_CALLBACK (queue_bar_resize_callback), bar);
|
||||
g_signal_connect (nautilus_signaller_get_current (), "emblems_changed",
|
||||
G_CALLBACK (emblems_changed_callback), criterion);
|
||||
g_signal_connect_object (details->box, "need_reallocation",
|
||||
G_CALLBACK (queue_bar_resize_callback), bar, 0);
|
||||
g_signal_connect_object (nautilus_signaller_get_current (), "emblems_changed",
|
||||
G_CALLBACK (emblems_changed_callback), criterion, 0);
|
||||
|
||||
|
||||
search_criteria_option_menu = gtk_option_menu_new ();
|
||||
|
@ -313,8 +311,8 @@ nautilus_search_bar_criterion_new_from_values (NautilusSearchBarCriterionType ty
|
|||
g_free (context_stripped_criteria_title);
|
||||
|
||||
g_object_set_data (G_OBJECT(item), "type", GINT_TO_POINTER(i));
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (criterion_type_changed_callback), criterion);
|
||||
g_signal_connect_object (item, "activate",
|
||||
G_CALLBACK (criterion_type_changed_callback), criterion, 0);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (search_criteria_menu),
|
||||
item);
|
||||
gtk_widget_show (item);
|
||||
|
@ -349,14 +347,12 @@ nautilus_search_bar_criterion_new_from_values (NautilusSearchBarCriterionType ty
|
|||
don't need a date, like "yesterday" */
|
||||
if (details->type == NAUTILUS_DATE_MODIFIED_SEARCH_CRITERION) {
|
||||
if (modified_relation_should_show_value (i)) {
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (show_date_widget),
|
||||
criterion);
|
||||
g_signal_connect_object (item, "activate",
|
||||
G_CALLBACK (show_date_widget), criterion, 0);
|
||||
}
|
||||
else {
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (hide_date_widget),
|
||||
criterion);
|
||||
g_signal_connect_object (item, "activate",
|
||||
G_CALLBACK (hide_date_widget), criterion, 0);
|
||||
}
|
||||
}
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (relation_menu),
|
||||
|
@ -712,8 +708,8 @@ nautilus_search_bar_criterion_update_valid_criteria_choices (NautilusSearchBarCr
|
|||
|
||||
g_object_set_data (G_OBJECT(item), "type", GINT_TO_POINTER(i));
|
||||
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (criterion_type_changed_callback), criterion);
|
||||
g_signal_connect_object (item, "activate",
|
||||
G_CALLBACK (criterion_type_changed_callback), criterion, 0);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (new_menu),
|
||||
item);
|
||||
gtk_widget_show (item);
|
||||
|
|
|
@ -84,16 +84,18 @@ static const char *default_font_name;
|
|||
|
||||
struct NautilusSidebarTitleDetails {
|
||||
NautilusFile *file;
|
||||
guint file_changed_connection;
|
||||
guint file_changed_connection;
|
||||
gboolean monitoring_count;
|
||||
|
||||
char *title_text;
|
||||
GtkWidget *icon;
|
||||
GtkWidget *title_label;
|
||||
GtkWidget *more_info_label;
|
||||
GtkWidget *emblem_box;
|
||||
GtkWidget *notes;
|
||||
|
||||
int shadow_offset;
|
||||
gboolean determined_icon;
|
||||
|
||||
int shadow_offset;
|
||||
gboolean determined_icon;
|
||||
};
|
||||
|
||||
EEL_CLASS_BOILERPLATE (NautilusSidebarTitle, nautilus_sidebar_title, gtk_vbox_get_type ())
|
||||
|
@ -129,11 +131,8 @@ realize_callback (NautilusSidebarTitle *sidebar_title)
|
|||
|
||||
g_return_if_fail (background != NULL);
|
||||
|
||||
g_signal_connect_object (background,
|
||||
"appearance_changed",
|
||||
G_CALLBACK (appearance_changed_callback),
|
||||
sidebar_title,
|
||||
0);
|
||||
g_signal_connect_object (background, "appearance_changed",
|
||||
G_CALLBACK (appearance_changed_callback), sidebar_title, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -166,7 +165,7 @@ nautilus_sidebar_title_init (NautilusSidebarTitle *sidebar_title)
|
|||
|
||||
/* Register to find out about icon theme changes */
|
||||
g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
|
||||
G_CALLBACK (update_icon), G_OBJECT (sidebar_title), G_CONNECT_SWAPPED);
|
||||
G_CALLBACK (update_icon), sidebar_title, G_CONNECT_SWAPPED);
|
||||
g_signal_connect (sidebar_title, "realize",
|
||||
G_CALLBACK (realize_callback), NULL);
|
||||
|
||||
|
@ -707,6 +706,44 @@ nautilus_sidebar_title_set_text (NautilusSidebarTitle *sidebar_title,
|
|||
update_title (sidebar_title);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
item_count_ready (NautilusSidebarTitle *sidebar_title)
|
||||
{
|
||||
return sidebar_title->details->file != NULL
|
||||
&& nautilus_file_get_directory_item_count
|
||||
(sidebar_title->details->file, NULL, NULL) != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
monitor_add (NautilusSidebarTitle *sidebar_title)
|
||||
{
|
||||
GList *attributes;
|
||||
|
||||
/* Monitor the things needed to get the right icon. Don't
|
||||
* monitor a directory's item count at first even though the
|
||||
* "size" attribute is based on that, because the main view
|
||||
* will get it for us in most cases, and in other cases it's
|
||||
* OK to not show the size -- if we did monitor it, we'd be in
|
||||
* a race with the main view and could cause it to have to
|
||||
* load twice. Once we have a size, though, we want to monitor
|
||||
* the size to guarantee it stays up to date.
|
||||
*/
|
||||
|
||||
sidebar_title->details->monitoring_count = item_count_ready (sidebar_title);
|
||||
|
||||
attributes = nautilus_icon_factory_get_required_file_attributes ();
|
||||
attributes = g_list_prepend (attributes,
|
||||
NAUTILUS_FILE_ATTRIBUTE_METADATA);
|
||||
if (sidebar_title->details->monitoring_count) {
|
||||
attributes = g_list_prepend (attributes,
|
||||
NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT);
|
||||
}
|
||||
|
||||
nautilus_file_monitor_add (sidebar_title->details->file, sidebar_title, attributes);
|
||||
|
||||
g_list_free (attributes);
|
||||
}
|
||||
|
||||
static void
|
||||
update_all (NautilusSidebarTitle *sidebar_title)
|
||||
{
|
||||
|
@ -718,6 +755,12 @@ update_all (NautilusSidebarTitle *sidebar_title)
|
|||
|
||||
update_emblems (sidebar_title);
|
||||
update_notes (sidebar_title);
|
||||
|
||||
/* Redo monitor once the count is ready. */
|
||||
if (!sidebar_title->details->monitoring_count && item_count_ready (sidebar_title)) {
|
||||
nautilus_file_monitor_remove (sidebar_title->details->file, sidebar_title);
|
||||
monitor_add (sidebar_title);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -725,8 +768,6 @@ nautilus_sidebar_title_set_file (NautilusSidebarTitle *sidebar_title,
|
|||
NautilusFile *file,
|
||||
const char *initial_text)
|
||||
{
|
||||
GList *attributes;
|
||||
|
||||
if (file != sidebar_title->details->file) {
|
||||
release_file (sidebar_title);
|
||||
sidebar_title->details->file = file;
|
||||
|
@ -736,24 +777,10 @@ nautilus_sidebar_title_set_file (NautilusSidebarTitle *sidebar_title,
|
|||
/* attach file */
|
||||
if (file != NULL) {
|
||||
sidebar_title->details->file_changed_connection =
|
||||
g_signal_connect_swapped (sidebar_title->details->file,
|
||||
"changed",
|
||||
G_CALLBACK (update_all),
|
||||
sidebar_title);
|
||||
|
||||
/* Monitor the things needed to get the right
|
||||
* icon. Don't monitor a directory's item
|
||||
* count even though the "size" attribute is
|
||||
* based on that, because the main view will
|
||||
* get it for us in most cases, and in other
|
||||
* cases it's OK to now show the size.
|
||||
*/
|
||||
attributes = nautilus_icon_factory_get_required_file_attributes ();
|
||||
attributes = g_list_prepend (attributes,
|
||||
NAUTILUS_FILE_ATTRIBUTE_METADATA);
|
||||
nautilus_file_monitor_add (sidebar_title->details->file, sidebar_title,
|
||||
attributes);
|
||||
g_list_free (attributes);
|
||||
g_signal_connect_object
|
||||
(sidebar_title->details->file, "changed",
|
||||
G_CALLBACK (update_all), sidebar_title, G_CONNECT_SWAPPED);
|
||||
monitor_add (sidebar_title);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ struct NautilusSidebarDetails {
|
|||
gboolean has_buttons;
|
||||
char *uri;
|
||||
NautilusFile *file;
|
||||
gulong file_changed_connection;
|
||||
guint file_changed_connection;
|
||||
char *default_background_color;
|
||||
char *default_background_image;
|
||||
int selected_index;
|
||||
|
@ -342,8 +342,6 @@ nautilus_sidebar_finalize (GObject *object)
|
|||
sidebar = NAUTILUS_SIDEBAR (object);
|
||||
|
||||
if (sidebar->details->file != NULL) {
|
||||
g_signal_handler_disconnect (sidebar->details->file,
|
||||
sidebar->details->file_changed_connection);
|
||||
nautilus_file_monitor_remove (sidebar->details->file, sidebar);
|
||||
nautilus_file_unref (sidebar->details->file);
|
||||
}
|
||||
|
@ -509,17 +507,13 @@ sidebar_for_each_sidebar_panel (const char *name,
|
|||
gtk_widget_show (menu_item);
|
||||
g_object_set_data (G_OBJECT (menu_item), "user_data", data->sidebar);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (data->menu), menu_item);
|
||||
g_signal_connect_data (menu_item,
|
||||
"activate",
|
||||
g_signal_connect_data (menu_item, "activate",
|
||||
G_CALLBACK (toggle_sidebar_panel),
|
||||
g_strdup (iid),
|
||||
(GClosureNotify)g_free,
|
||||
0);
|
||||
g_strdup (iid), (GClosureNotify) g_free, 0);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (menu_item),
|
||||
"nautilus-sidebar/preference-key",
|
||||
g_strdup (preference_key),
|
||||
g_free);
|
||||
g_strdup (preference_key), g_free);
|
||||
}
|
||||
|
||||
/* utility routine to add a menu item for each potential sidebar panel */
|
||||
|
@ -574,8 +568,8 @@ nautilus_sidebar_create_context_menu (NautilusSidebar *sidebar)
|
|||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_set_sensitive (menu_item, has_background);
|
||||
g_signal_connect (menu_item, "activate",
|
||||
G_CALLBACK (reset_background_callback), sidebar);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (reset_background_callback), sidebar, 0);
|
||||
|
||||
/* add a separator */
|
||||
menu_item = gtk_menu_item_new ();
|
||||
|
@ -944,8 +938,8 @@ nautilus_sidebar_add_panel (NautilusSidebar *sidebar, NautilusViewFrame *panel)
|
|||
|
||||
gtk_widget_show (label);
|
||||
|
||||
g_signal_connect (panel, "view_loaded",
|
||||
G_CALLBACK (view_loaded_callback), sidebar);
|
||||
g_signal_connect_object (panel, "view_loaded",
|
||||
G_CALLBACK (view_loaded_callback), sidebar, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (sidebar->details->notebook),
|
||||
GTK_WIDGET (panel), label);
|
||||
|
@ -1398,7 +1392,7 @@ add_command_buttons (NautilusSidebar *sidebar, GList *application_list)
|
|||
/* Catch-all button after all the others. */
|
||||
temp_button = gtk_button_new_with_label (_("Open with..."));
|
||||
g_signal_connect (temp_button, "clicked",
|
||||
G_CALLBACK (open_with_callback), NULL);
|
||||
G_CALLBACK (open_with_callback), NULL);
|
||||
g_object_set_data (G_OBJECT (temp_button), "user_data", sidebar);
|
||||
gtk_widget_show (temp_button);
|
||||
gtk_box_pack_start (GTK_BOX (sidebar->details->button_box),
|
||||
|
@ -1554,14 +1548,10 @@ nautilus_sidebar_update_appearance (NautilusSidebar *sidebar)
|
|||
background = eel_get_widget_background (GTK_WIDGET (sidebar));
|
||||
if (!sidebar->details->background_connected) {
|
||||
sidebar->details->background_connected = TRUE;
|
||||
g_signal_connect (background,
|
||||
"settings_changed",
|
||||
G_CALLBACK (background_settings_changed_callback),
|
||||
sidebar);
|
||||
g_signal_connect (background,
|
||||
"reset",
|
||||
G_CALLBACK (background_reset_callback),
|
||||
sidebar);
|
||||
g_signal_connect_object (background,"settings_changed",
|
||||
G_CALLBACK (background_settings_changed_callback), sidebar, 0);
|
||||
g_signal_connect_object (background, "reset",
|
||||
G_CALLBACK (background_reset_callback), sidebar, 0);
|
||||
}
|
||||
|
||||
/* Set up the background color and image from the metadata. */
|
||||
|
@ -1650,7 +1640,6 @@ nautilus_sidebar_set_uri (NautilusSidebar *sidebar,
|
|||
if (sidebar->details->file != NULL) {
|
||||
g_signal_handler_disconnect (sidebar->details->file,
|
||||
sidebar->details->file_changed_connection);
|
||||
|
||||
nautilus_file_monitor_remove (sidebar->details->file, sidebar);
|
||||
}
|
||||
|
||||
|
@ -1662,10 +1651,9 @@ nautilus_sidebar_set_uri (NautilusSidebar *sidebar,
|
|||
sidebar->details->file = file;
|
||||
|
||||
sidebar->details->file_changed_connection =
|
||||
g_signal_connect_swapped (sidebar->details->file,
|
||||
"changed",
|
||||
G_CALLBACK (background_metadata_changed_callback),
|
||||
sidebar);
|
||||
g_signal_connect_object (sidebar->details->file, "changed",
|
||||
G_CALLBACK (background_metadata_changed_callback),
|
||||
sidebar, G_CONNECT_SWAPPED);
|
||||
|
||||
attributes = nautilus_mime_actions_get_minimum_file_attributes ();
|
||||
nautilus_file_monitor_add (sidebar->details->file, sidebar, attributes);
|
||||
|
|
|
@ -132,17 +132,15 @@ nautilus_simple_search_bar_new (NautilusWindow *window)
|
|||
nautilus_window_get_ui_container (window),
|
||||
TRUE);
|
||||
|
||||
g_signal_connect_swapped (bar->details->entry, "activate",
|
||||
G_CALLBACK (gtk_widget_activate),
|
||||
bar->details->find_button);
|
||||
g_signal_connect_swapped (bar->details->entry, "changed",
|
||||
G_CALLBACK (update_simple_find_button_state), bar);
|
||||
g_signal_connect_object (bar->details->entry, "activate",
|
||||
G_CALLBACK (gtk_widget_activate), bar->details->find_button, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (bar->details->entry, "changed",
|
||||
G_CALLBACK (update_simple_find_button_state), bar, G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (bar->details->entry), TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect_swapped (bar->details->find_button, "clicked",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_object (bar->details->find_button, "clicked",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed), bar, G_CONNECT_SWAPPED);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bar->details->find_button, FALSE, TRUE, 1);
|
||||
update_simple_find_button_state (bar);
|
||||
|
||||
|
|
|
@ -572,11 +572,10 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
window->navigation_bar = nautilus_switchable_navigation_bar_new (window);
|
||||
gtk_widget_show (GTK_WIDGET (window->navigation_bar));
|
||||
|
||||
g_signal_connect (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window);
|
||||
|
||||
g_signal_connect (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window);
|
||||
g_signal_connect_object (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window, 0);
|
||||
g_signal_connect_object (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
|
@ -600,14 +599,18 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
* It gets shown later, if the view-frame contains something zoomable.
|
||||
*/
|
||||
window->zoom_control = nautilus_zoom_control_new ();
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit), window);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
gtk_box_pack_end (GTK_BOX (location_bar_box), window->zoom_control, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show (location_bar_box);
|
||||
|
@ -626,8 +629,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
/* set up the sidebar */
|
||||
window->sidebar = nautilus_sidebar_new ();
|
||||
gtk_widget_show (GTK_WIDGET (window->sidebar));
|
||||
g_signal_connect (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window);
|
||||
g_signal_connect_object (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window, 0);
|
||||
gtk_paned_pack1 (GTK_PANED (window->content_hbox),
|
||||
GTK_WIDGET (window->sidebar),
|
||||
FALSE, TRUE);
|
||||
|
@ -1045,14 +1048,11 @@ create_view_as_menu_item (NautilusWindow *window,
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (menu_item),
|
||||
"viewer index",
|
||||
GINT_TO_POINTER (index));
|
||||
g_object_set_data (G_OBJECT (menu_item), "viewer index", GINT_TO_POINTER (index));
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
|
@ -1382,10 +1382,8 @@ load_view_as_menus_callback (NautilusFile *file,
|
|||
|
||||
/* Add "View as..." extra bonus choice. */
|
||||
menu_item = gtk_menu_item_new_with_label (_("View as..."));
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback), window, 0);
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (new_menu), menu_item);
|
||||
|
||||
|
|
|
@ -121,10 +121,8 @@ create_search_bar_if_non_existant (NautilusSwitchableNavigationBar *bar)
|
|||
|
||||
bar->details->search_bar = NAUTILUS_SWITCHABLE_SEARCH_BAR (nautilus_switchable_search_bar_new (bar->details->window));
|
||||
|
||||
g_signal_connect_swapped (bar->details->search_bar,
|
||||
"location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_object (bar->details->search_bar, "location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed), bar, G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (bar->details->hbox), GTK_WIDGET (bar->details->search_bar), TRUE, TRUE, 0);
|
||||
}
|
||||
|
@ -144,10 +142,8 @@ nautilus_switchable_navigation_bar_new (NautilusWindow *window)
|
|||
switchable_navigation_bar->details->window = window;
|
||||
switchable_navigation_bar->details->location_bar = NAUTILUS_LOCATION_BAR (nautilus_location_bar_new (window));
|
||||
|
||||
g_signal_connect_swapped (switchable_navigation_bar->details->location_bar,
|
||||
"location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_object (switchable_navigation_bar->details->location_bar, "location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed), bar, G_CONNECT_SWAPPED);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (switchable_navigation_bar->details->hbox),
|
||||
GTK_WIDGET (switchable_navigation_bar->details->location_bar), TRUE, TRUE, 0);
|
||||
|
|
|
@ -133,20 +133,16 @@ nautilus_switchable_search_bar_new (NautilusWindow *window)
|
|||
bar->complex_search_bar = nautilus_complex_search_bar_new (window);
|
||||
bar->simple_search_bar = nautilus_simple_search_bar_new (window);
|
||||
|
||||
g_signal_connect_swapped (bar->complex_search_bar,
|
||||
"location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_swapped (bar->simple_search_bar,
|
||||
"location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar);
|
||||
g_signal_connect_object (bar->complex_search_bar, "location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (bar->simple_search_bar, "location_changed",
|
||||
G_CALLBACK (nautilus_navigation_bar_location_changed),
|
||||
bar, G_CONNECT_SWAPPED);
|
||||
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bar->complex_search_bar, TRUE, TRUE,
|
||||
0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bar->simple_search_bar, TRUE, TRUE,
|
||||
0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bar->complex_search_bar, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bar->simple_search_bar, TRUE, TRUE, 0);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (bar), hbox);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ struct NautilusThemeSelectorDetails
|
|||
EelImageChooser *remove_theme_selector;
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *remove_scrolled_window;
|
||||
guint theme_selector_changed_connection;
|
||||
gulong remove_theme_selector_changed_connection;
|
||||
GtkWindow *parent_window;
|
||||
guint remove_idle_id;
|
||||
};
|
||||
|
@ -191,15 +191,13 @@ install_theme_button_clicked_callback (GtkWidget *button,
|
|||
THEME_SELECTOR_DATA_KEY,
|
||||
callback_data);
|
||||
|
||||
g_signal_connect (GTK_FILE_SELECTION (file_selection_dialog)->ok_button,
|
||||
"clicked",
|
||||
G_CALLBACK (file_selection_ok_clicked_callback),
|
||||
file_selection_dialog);
|
||||
g_signal_connect_object (GTK_FILE_SELECTION (file_selection_dialog)->ok_button, "clicked",
|
||||
G_CALLBACK (file_selection_ok_clicked_callback),
|
||||
file_selection_dialog, 0);
|
||||
|
||||
g_signal_connect (GTK_FILE_SELECTION (file_selection_dialog)->cancel_button,
|
||||
"clicked",
|
||||
G_CALLBACK (file_selection_cancel_clicked_callback),
|
||||
file_selection_dialog);
|
||||
g_signal_connect_object (GTK_FILE_SELECTION (file_selection_dialog)->cancel_button, "clicked",
|
||||
G_CALLBACK (file_selection_cancel_clicked_callback),
|
||||
file_selection_dialog, 0);
|
||||
|
||||
gtk_window_set_position (GTK_WINDOW (file_selection_dialog), GTK_WIN_POS_MOUSE);
|
||||
if (theme_selector->details->parent_window != NULL) {
|
||||
|
@ -288,10 +286,10 @@ remove_theme_selector_idle_callback (gpointer callback_data)
|
|||
theme_to_remove_position));
|
||||
|
||||
g_signal_handler_block (theme_selector->details->remove_theme_selector,
|
||||
theme_selector->details->theme_selector_changed_connection);
|
||||
theme_selector->details->remove_theme_selector_changed_connection);
|
||||
theme_selector_finish_remove (theme_selector);
|
||||
g_signal_handler_unblock (theme_selector->details->remove_theme_selector,
|
||||
theme_selector->details->theme_selector_changed_connection);
|
||||
theme_selector->details->remove_theme_selector_changed_connection);
|
||||
|
||||
selected_theme = nautilus_theme_selector_get_selected_theme (theme_selector);
|
||||
|
||||
|
@ -514,22 +512,19 @@ nautilus_theme_selector_instance_init (NautilusThemeSelector *theme_selector)
|
|||
gtk_box_pack_end (GTK_BOX (alignment_box), button_box, FALSE, FALSE, 2);
|
||||
|
||||
theme_selector->details->install_theme_button = gtk_button_new_with_label (_("Add New Theme..."));
|
||||
g_signal_connect (theme_selector->details->install_theme_button,
|
||||
"clicked",
|
||||
G_CALLBACK (install_theme_button_clicked_callback),
|
||||
theme_selector);
|
||||
g_signal_connect_object (theme_selector->details->install_theme_button, "clicked",
|
||||
G_CALLBACK (install_theme_button_clicked_callback),
|
||||
theme_selector, 0);
|
||||
|
||||
theme_selector->details->remove_theme_button = gtk_button_new_with_label (_("Remove Theme..."));
|
||||
g_signal_connect (theme_selector->details->remove_theme_button,
|
||||
"clicked",
|
||||
G_CALLBACK (remove_theme_button_clicked_callback),
|
||||
theme_selector);
|
||||
g_signal_connect_object (theme_selector->details->remove_theme_button, "clicked",
|
||||
G_CALLBACK (remove_theme_button_clicked_callback),
|
||||
theme_selector, 0);
|
||||
|
||||
theme_selector->details->cancel_remove_button = gtk_button_new_with_label (_("Cancel Remove"));
|
||||
g_signal_connect (theme_selector->details->cancel_remove_button,
|
||||
"clicked",
|
||||
G_CALLBACK (cancel_remove_button_clicked_callback),
|
||||
theme_selector);
|
||||
g_signal_connect_object (theme_selector->details->cancel_remove_button, "clicked",
|
||||
G_CALLBACK (cancel_remove_button_clicked_callback),
|
||||
theme_selector, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (button_box), theme_selector->details->cancel_remove_button, TRUE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (button_box), theme_selector->details->install_theme_button, TRUE, FALSE, 4);
|
||||
|
@ -557,16 +552,14 @@ nautilus_theme_selector_instance_init (NautilusThemeSelector *theme_selector)
|
|||
|
||||
theme_selector_update_remove_theme_button (theme_selector);
|
||||
|
||||
g_signal_connect (theme_selector->details->theme_selector,
|
||||
"selection_changed",
|
||||
G_CALLBACK (theme_selector_changed_callback),
|
||||
theme_selector);
|
||||
g_signal_connect_object (theme_selector->details->theme_selector, "selection_changed",
|
||||
G_CALLBACK (theme_selector_changed_callback),
|
||||
theme_selector, 0);
|
||||
|
||||
theme_selector->details->theme_selector_changed_connection =
|
||||
g_signal_connect (theme_selector->details->remove_theme_selector,
|
||||
"selection_changed",
|
||||
G_CALLBACK (remove_theme_selector_changed_callback),
|
||||
theme_selector);
|
||||
theme_selector->details->remove_theme_selector_changed_connection =
|
||||
g_signal_connect_object (theme_selector->details->remove_theme_selector, "selection_changed",
|
||||
G_CALLBACK (remove_theme_selector_changed_callback),
|
||||
theme_selector, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -599,9 +599,8 @@ update_for_new_location (NautilusWindow *window)
|
|||
nautilus_window_set_viewed_file (window, file);
|
||||
window->details->viewed_file_seen = !nautilus_file_is_not_yet_confirmed (file);
|
||||
nautilus_file_monitor_add (file, &window->details->viewed_file, NULL);
|
||||
g_signal_connect (file, "changed",
|
||||
G_CALLBACK (viewed_file_changed_callback),
|
||||
window);
|
||||
g_signal_connect_object (file, "changed",
|
||||
G_CALLBACK (viewed_file_changed_callback), window, 0);
|
||||
nautilus_file_unref (file);
|
||||
|
||||
/* Check if we can go up. */
|
||||
|
|
|
@ -138,11 +138,11 @@ bookmark_holder_new (NautilusBookmark *bookmark,
|
|||
new_bookmark_holder->prompt_for_removal = is_bookmarks_menu;
|
||||
|
||||
new_bookmark_holder->changed_handler_id =
|
||||
g_signal_connect_swapped (bookmark, "appearance_changed",
|
||||
is_bookmarks_menu
|
||||
? G_CALLBACK (schedule_refresh_bookmarks_menu)
|
||||
: G_CALLBACK (schedule_refresh_go_menu),
|
||||
window);
|
||||
g_signal_connect_object (bookmark, "appearance_changed",
|
||||
is_bookmarks_menu
|
||||
? G_CALLBACK (schedule_refresh_bookmarks_menu)
|
||||
: G_CALLBACK (schedule_refresh_go_menu),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
|
||||
return new_bookmark_holder;
|
||||
}
|
||||
|
@ -353,10 +353,8 @@ forget_history_if_confirmed (NautilusWindow *window)
|
|||
GTK_WINDOW (window));
|
||||
g_free (prompt);
|
||||
|
||||
g_signal_connect (dialog,
|
||||
"response",
|
||||
G_CALLBACK (forget_history_if_yes),
|
||||
NULL);
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (forget_history_if_yes), NULL);
|
||||
|
||||
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_NO);
|
||||
}
|
||||
|
@ -1151,8 +1149,8 @@ nautilus_window_initialize_menus_part_1 (NautilusWindow *window)
|
|||
nautilus_window_update_show_hide_menu_items (window);
|
||||
|
||||
/* Register to catch Bonobo UI events so we can notice View As changes */
|
||||
g_signal_connect (window->details->shell_ui, "ui_event",
|
||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window);
|
||||
g_signal_connect_object (window->details->shell_ui, "ui_event",
|
||||
G_CALLBACK (nautilus_window_handle_ui_event_callback), window, 0);
|
||||
|
||||
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
|
||||
|
||||
|
|
|
@ -107,13 +107,11 @@ create_back_or_forward_menu (NautilusWindow *window, gboolean back)
|
|||
menu_item = nautilus_bookmark_menu_item_new (NAUTILUS_BOOKMARK (list_link->data));
|
||||
g_object_set_data (G_OBJECT (menu_item), "user_data", GINT_TO_POINTER (index));
|
||||
gtk_widget_show (GTK_WIDGET (menu_item));
|
||||
g_signal_connect
|
||||
(menu_item,
|
||||
"activate",
|
||||
back
|
||||
? G_CALLBACK (activate_back_menu_item_callback)
|
||||
: G_CALLBACK (activate_forward_menu_item_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
back
|
||||
? G_CALLBACK (activate_back_menu_item_callback)
|
||||
: G_CALLBACK (activate_forward_menu_item_callback),
|
||||
window, 0);
|
||||
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
list_link = g_list_next (list_link);
|
||||
|
@ -370,14 +368,12 @@ create_back_or_forward_toolbar_item (NautilusWindow *window,
|
|||
gtk_widget_show (GTK_WIDGET (item));
|
||||
|
||||
button = bonobo_ui_toolbar_button_item_get_button_widget (item);
|
||||
g_signal_connect (button,
|
||||
"button_press_event",
|
||||
G_CALLBACK (back_or_forward_button_pressed_callback),
|
||||
window);
|
||||
g_signal_connect (button,
|
||||
"clicked",
|
||||
G_CALLBACK (back_or_forward_button_clicked_callback),
|
||||
window);
|
||||
g_signal_connect_object (button, "button_press_event",
|
||||
G_CALLBACK (back_or_forward_button_pressed_callback),
|
||||
window, 0);
|
||||
g_signal_connect_object (button, "clicked",
|
||||
G_CALLBACK (back_or_forward_button_clicked_callback),
|
||||
window, 0);
|
||||
|
||||
wrapper = bonobo_control_new (GTK_WIDGET (item));
|
||||
pb = bonobo_property_bag_new (
|
||||
|
|
|
@ -572,11 +572,10 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
window->navigation_bar = nautilus_switchable_navigation_bar_new (window);
|
||||
gtk_widget_show (GTK_WIDGET (window->navigation_bar));
|
||||
|
||||
g_signal_connect (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window);
|
||||
|
||||
g_signal_connect (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window);
|
||||
g_signal_connect_object (window->navigation_bar, "location_changed",
|
||||
G_CALLBACK (navigation_bar_location_changed_callback), window, 0);
|
||||
g_signal_connect_object (window->navigation_bar, "mode_changed",
|
||||
G_CALLBACK (navigation_bar_mode_changed_callback), window, 0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
|
@ -600,14 +599,18 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
* It gets shown later, if the view-frame contains something zoomable.
|
||||
*/
|
||||
window->zoom_control = nautilus_zoom_control_new ();
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level), window);
|
||||
g_signal_connect_swapped (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit), window);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_in",
|
||||
G_CALLBACK (nautilus_window_zoom_in),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_out",
|
||||
G_CALLBACK (nautilus_window_zoom_out),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_level",
|
||||
G_CALLBACK (nautilus_window_zoom_to_level),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->zoom_control, "zoom_to_fit",
|
||||
G_CALLBACK (nautilus_window_zoom_to_fit),
|
||||
window, G_CONNECT_SWAPPED);
|
||||
gtk_box_pack_end (GTK_BOX (location_bar_box), window->zoom_control, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show (location_bar_box);
|
||||
|
@ -626,8 +629,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
/* set up the sidebar */
|
||||
window->sidebar = nautilus_sidebar_new ();
|
||||
gtk_widget_show (GTK_WIDGET (window->sidebar));
|
||||
g_signal_connect (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window);
|
||||
g_signal_connect_object (window->sidebar, "location_changed",
|
||||
G_CALLBACK (go_to_callback), window, 0);
|
||||
gtk_paned_pack1 (GTK_PANED (window->content_hbox),
|
||||
GTK_WIDGET (window->sidebar),
|
||||
FALSE, TRUE);
|
||||
|
@ -1045,14 +1048,11 @@ create_view_as_menu_item (NautilusWindow *window,
|
|||
menu_item = gtk_menu_item_new_with_label (menu_label);
|
||||
g_free (menu_label);
|
||||
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_switch_views_callback),
|
||||
window, 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (menu_item),
|
||||
"viewer index",
|
||||
GINT_TO_POINTER (index));
|
||||
g_object_set_data (G_OBJECT (menu_item), "viewer index", GINT_TO_POINTER (index));
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
|
||||
|
@ -1382,10 +1382,8 @@ load_view_as_menus_callback (NautilusFile *file,
|
|||
|
||||
/* Add "View as..." extra bonus choice. */
|
||||
menu_item = gtk_menu_item_new_with_label (_("View as..."));
|
||||
g_signal_connect (menu_item,
|
||||
"activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback),
|
||||
window);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (view_as_menu_choose_view_callback), window, 0);
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (new_menu), menu_item);
|
||||
|
||||
|
|
|
@ -556,9 +556,8 @@ create_zoom_menu_item (GtkMenu *menu, GtkWidget *widget, float zoom_level,
|
|||
zoom_level == zoom_control->details->zoom_level);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (menu_item), "zoom_level", zoom_level_ptr, g_free);
|
||||
g_signal_connect (menu_item, "activate",
|
||||
G_CALLBACK (zoom_menu_callback),
|
||||
zoom_control);
|
||||
g_signal_connect_object (menu_item, "activate",
|
||||
G_CALLBACK (zoom_menu_callback), zoom_control, 0);
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
|
|
|
@ -40,8 +40,8 @@ picker_new (const char *name,
|
|||
|
||||
string_picker = eel_string_picker_new ();
|
||||
eel_caption_set_title_label (EEL_CAPTION (string_picker), name);
|
||||
g_signal_connect (string_picker, "changed", G_CALLBACK (int_picker_changed_callback),
|
||||
(gpointer) name);
|
||||
g_signal_connect (string_picker, "changed",
|
||||
G_CALLBACK (int_picker_changed_callback), (gpointer) name);
|
||||
|
||||
eel_string_picker_set_string_list (EEL_STRING_PICKER (string_picker), entries);
|
||||
eel_string_picker_set_selected_string_index (EEL_STRING_PICKER (string_picker),
|
||||
|
|
|
@ -40,14 +40,16 @@ main (int argc, char* argv[])
|
|||
|
||||
gtk_widget_show (scroller);
|
||||
|
||||
#if 0
|
||||
/* Get rid of default lowered shadow appearance.
|
||||
* This must be done after the widget is realized, due to
|
||||
* an apparent bug in gtk_viewport_set_shadow_type.
|
||||
*/
|
||||
// g_signal_connect (GTK_BIN (scroller->child),
|
||||
// "realize",
|
||||
// remove_default_viewport_shadow,
|
||||
// NULL);
|
||||
g_signal_connect (GTK_BIN (scroller->child),
|
||||
"realize",
|
||||
remove_default_viewport_shadow,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
|
||||
/* Use nautilus_customization to make the emblem widgets */
|
||||
|
|
|
@ -44,10 +44,8 @@ test_window_new (const char *title, guint border_width)
|
|||
gtk_window_set_title (GTK_WINDOW (window), title);
|
||||
}
|
||||
|
||||
g_signal_connect (window,
|
||||
"delete_event",
|
||||
G_CALLBACK (test_delete_event),
|
||||
NULL);
|
||||
g_signal_connect (window, "delete_event",
|
||||
G_CALLBACK (test_delete_event), NULL);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), border_width);
|
||||
|
||||
|
|
Loading…
Reference in a new issue