diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c index d8c5f99248c6bd5db0364d0f0a19916d2aa0b30c..bb0ae5e8c3fa1fcee305ccc2b23ce030ce5e4e88 100644 --- a/thunar/thunar-column-editor.c +++ b/thunar/thunar-column-editor.c @@ -561,14 +561,14 @@ thunar_column_editor_use_defaults (GtkWidget *button, * @parent is %NULL the default screen is used), the dialog won't * be modal and it will simply popup on the specified screen. **/ -void +gboolean thunar_show_column_editor (gpointer parent) { GtkWidget *window = NULL; GtkWidget *dialog; GdkScreen *screen = NULL; - _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent)); + _thunar_return_val_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent), FALSE); /* determine the screen for the dialog */ if (G_UNLIKELY (parent == NULL)) @@ -609,5 +609,8 @@ thunar_show_column_editor (gpointer parent) /* destroy the dialog */ gtk_widget_destroy (dialog); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-column-editor.h b/thunar/thunar-column-editor.h index e376d30da6e9210c3e7cc4b7c99184b70102065a..607ed0f9c96732853d1a521daa8a5be76aaa0a4c 100644 --- a/thunar/thunar-column-editor.h +++ b/thunar/thunar-column-editor.h @@ -36,7 +36,7 @@ typedef struct _ThunarColumnEditor ThunarColumnEditor; GType thunar_column_editor_get_type (void) G_GNUC_CONST; -void thunar_show_column_editor (gpointer parent); +gboolean thunar_show_column_editor (gpointer parent); G_END_DECLS; diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c index 88a6651912b8384c6c041d4d562bef637e359c0b..1b1c9470b5c5a3ae96cdba1bf44b3a03bd9b347e 100644 --- a/thunar/thunar-launcher.c +++ b/thunar/thunar-launcher.c @@ -166,38 +166,38 @@ static ThunarLauncherPokeData *thunar_launcher_poke_data_new (GList static void thunar_launcher_poke_data_free (ThunarLauncherPokeData *data); static void thunar_launcher_widget_destroyed (ThunarLauncher *launcher, GtkWidget *widget); -static void thunar_launcher_action_open (ThunarLauncher *launcher); -static void thunar_launcher_action_open_in_new_tabs (ThunarLauncher *launcher); -static void thunar_launcher_action_open_in_new_windows (ThunarLauncher *launcher); -static void thunar_launcher_action_open_location (ThunarLauncher *launcher); -static void thunar_launcher_action_open_with_other (ThunarLauncher *launcher); -static void thunar_launcher_action_set_default_app (ThunarLauncher *launcher); -static void thunar_launcher_action_sendto_desktop (ThunarLauncher *launcher); -static void thunar_launcher_action_properties (ThunarLauncher *launcher); -static void thunar_launcher_action_sendto_device (ThunarLauncher *launcher, +static gboolean thunar_launcher_action_open (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_open_in_new_tabs (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_open_in_new_windows (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_open_location (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_open_with_other (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_set_default_app (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_sendto_desktop (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_properties (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_sendto_device (ThunarLauncher *launcher, GObject *object); -static void thunar_launcher_action_add_shortcuts (ThunarLauncher *launcher); -static void thunar_launcher_action_make_link (ThunarLauncher *launcher); -static void thunar_launcher_action_duplicate (ThunarLauncher *launcher); -static void thunar_launcher_action_rename (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_add_shortcuts (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_make_link (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_duplicate (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_rename (ThunarLauncher *launcher); static void thunar_launcher_action_move_to_trash (ThunarLauncher *launcher); -static void thunar_launcher_action_delete (ThunarLauncher *launcher); -static void thunar_launcher_action_trash_delete (ThunarLauncher *launcher); -static void thunar_launcher_action_remove_from_recent (ThunarLauncher *launcher); -static void thunar_launcher_action_cut (ThunarLauncher *launcher); -static void thunar_launcher_action_copy (ThunarLauncher *launcher); -static void thunar_launcher_action_paste (ThunarLauncher *launcher); -static void thunar_launcher_action_paste_into_folder (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_delete (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_trash_delete (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_remove_from_recent (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_cut (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_copy (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_paste (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_paste_into_folder (ThunarLauncher *launcher); static void thunar_launcher_sendto_device (ThunarLauncher *launcher, ThunarDevice *device); static void thunar_launcher_sendto_mount_finish (ThunarDevice *device, const GError *error, gpointer user_data); static GtkWidget *thunar_launcher_build_sendto_submenu (ThunarLauncher *launcher); -static void thunar_launcher_menu_item_activated (ThunarLauncher *launcher, +static gboolean thunar_launcher_menu_item_activated (ThunarLauncher *launcher, GtkWidget *menu_item); -static void thunar_launcher_action_create_folder (ThunarLauncher *launcher); -static void thunar_launcher_action_create_document (ThunarLauncher *launcher, +static gboolean thunar_launcher_action_create_folder (ThunarLauncher *launcher); +static gboolean thunar_launcher_action_create_document (ThunarLauncher *launcher, GtkWidget *menu_item); static GtkWidget *thunar_launcher_create_document_submenu_new(ThunarLauncher *launcher); static void thunar_launcher_new_files_created (ThunarLauncher *launcher, @@ -729,20 +729,23 @@ thunar_launcher_set_widget (ThunarLauncher *launcher, -static void +static gboolean thunar_launcher_menu_item_activated (ThunarLauncher *launcher, GtkWidget *menu_item) { GAppInfo *app_info; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->files_to_process == NULL)) - return; + return TRUE; /* if we have a mime handler associated with the menu_item, we pass it to the launcher (g_object_get_qdata will return NULL otherwise)*/ app_info = g_object_get_qdata (G_OBJECT (menu_item), thunar_launcher_appinfo_quark); thunar_launcher_activate_selected_files (launcher, THUNAR_LAUNCHER_CHANGE_DIRECTORY, app_info); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1339,15 +1342,18 @@ void thunar_launcher_open_selected_folders (ThunarLauncher *launcher, -static void +static gboolean thunar_launcher_action_open (ThunarLauncher *launcher) { - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->files_to_process == NULL)) - return; + return TRUE; thunar_launcher_activate_selected_files (launcher, THUNAR_LAUNCHER_CHANGE_DIRECTORY, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1358,28 +1364,34 @@ thunar_launcher_action_open (ThunarLauncher *launcher) * * Will open each selected folder in a new tab **/ -static void +static gboolean thunar_launcher_action_open_in_new_tabs (ThunarLauncher *launcher) { - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->files_to_process == NULL)) - return; + return TRUE; thunar_launcher_open_selected_folders (launcher, TRUE); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_open_in_new_windows (ThunarLauncher *launcher) { - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->files_to_process == NULL)) - return; + return TRUE; thunar_launcher_open_selected_folders (launcher, FALSE); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1393,16 +1405,16 @@ thunar_launcher_set_searching (ThunarLauncher *launcher, -static void +static gboolean thunar_launcher_action_open_location (ThunarLauncher *launcher) { GList *lp; GList *gfiles = NULL; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->files_to_process == NULL)) - return; + return TRUE; for (lp = launcher->files_to_process; lp != NULL; lp = lp->next) gfiles = g_list_prepend (gfiles, thunar_file_get_file (THUNAR_FILE (lp->data))); @@ -1410,17 +1422,23 @@ thunar_launcher_action_open_location (ThunarLauncher *launcher) thunar_window_open_files_in_location (THUNAR_WINDOW (launcher->widget), gfiles); g_list_free (gfiles); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_open_with_other (ThunarLauncher *launcher) { - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->n_files_to_process == 1) thunar_show_chooser_dialog (launcher->widget, launcher->files_to_process->data, TRUE, FALSE); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1431,13 +1449,16 @@ thunar_launcher_action_open_with_other (ThunarLauncher *launcher) * * Choose an application which should be used by default to open the selected file **/ -static void +static gboolean thunar_launcher_action_set_default_app (ThunarLauncher *launcher) { - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->n_files_to_process == 1) thunar_show_chooser_dialog (launcher->widget, launcher->files_to_process->data, TRUE, TRUE); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1815,19 +1836,19 @@ thunar_launcher_append_menu_item (ThunarLauncher *launcher, -static void +static gboolean thunar_launcher_action_sendto_desktop (ThunarLauncher *launcher) { ThunarApplication *application; GFile *desktop_file; GList *files; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); /* determine the source paths */ files = thunar_file_list_to_thunar_g_file_list (launcher->files_to_process); if (G_UNLIKELY (files == NULL)) - return; + return TRUE; /* determine the file to the ~/Desktop folder */ desktop_file = thunar_g_file_new_for_desktop (); @@ -1840,6 +1861,9 @@ thunar_launcher_action_sendto_desktop (ThunarLauncher *launcher) /* cleanup */ g_object_unref (desktop_file); thunar_g_list_free_full (files); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1907,19 +1931,19 @@ thunar_launcher_sendto_mount_finish (ThunarDevice *device, -static void +static gboolean thunar_launcher_action_sendto_device (ThunarLauncher *launcher, GObject *object) { GMountOperation *mount_operation; ThunarDevice *device; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); /* determine the device to which to send */ device = g_object_get_qdata (G_OBJECT (object), thunar_launcher_device_quark); if (G_UNLIKELY (device == NULL)) - return; + return TRUE; /* make sure to mount the device first, if it's not already mounted */ if (!thunar_device_is_mounted (device)) @@ -1940,24 +1964,27 @@ thunar_launcher_action_sendto_device (ThunarLauncher *launcher, { thunar_launcher_sendto_device (launcher, device); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_add_shortcuts (ThunarLauncher *launcher) { GList *lp; GtkWidget *window; const GtkWidget *sidepane; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); /* determine the toplevel window we belong to */ window = gtk_widget_get_toplevel (launcher->widget); if (THUNAR_IS_WINDOW (window) == FALSE) - return; + return FALSE; if (thunar_window_has_shortcut_sidepane (THUNAR_WINDOW (window)) == FALSE) - return; + return TRUE; sidepane = thunar_window_get_sidepane (THUNAR_WINDOW (window)); if (sidepane != NULL && THUNAR_IS_SHORTCUTS_PANE (sidepane)) @@ -1966,6 +1993,8 @@ thunar_launcher_action_add_shortcuts (ThunarLauncher *launcher) thunar_shortcuts_pane_add_shortcut (THUNAR_SHORTCUTS_PANE (sidepane), lp->data); } + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -2109,13 +2138,13 @@ thunar_launcher_build_sendto_submenu (ThunarLauncher *launcher) -static void +static gboolean thunar_launcher_action_properties (ThunarLauncher *launcher) { GtkWidget *toplevel; GtkWidget *dialog; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); /* popup the files dialog */ toplevel = gtk_widget_get_toplevel (launcher->widget); @@ -2136,23 +2165,26 @@ thunar_launcher_action_properties (ThunarLauncher *launcher) } gtk_widget_show (dialog); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_make_link (ThunarLauncher *launcher) { ThunarApplication *application; GList *g_files = NULL; GList *lp; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->current_directory == NULL)) - return; + return TRUE; if (launcher->files_are_selected == FALSE || thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; for (lp = launcher->files_to_process; lp != NULL; lp = lp->next) { @@ -2166,22 +2198,25 @@ thunar_launcher_action_make_link (ThunarLauncher *launcher) thunar_file_get_file (launcher->current_directory), launcher->new_files_created_closure); g_object_unref (G_OBJECT (application)); g_list_free (g_files); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_duplicate (ThunarLauncher *launcher) { ThunarApplication *application; GList *files_to_process; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_UNLIKELY (launcher->current_directory == NULL)) - return; + return TRUE; if (launcher->files_are_selected == FALSE || thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; /* determine the selected files for the view */ files_to_process = thunar_file_list_to_thunar_g_file_list (launcher->files_to_process); @@ -2198,6 +2233,9 @@ thunar_launcher_action_duplicate (ThunarLauncher *launcher) /* clean up */ thunar_g_list_free_full (files_to_process); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -2360,18 +2398,18 @@ thunar_launcher_rename_finished (ExoJob *job, -static void +static gboolean thunar_launcher_action_rename (ThunarLauncher *launcher) { ThunarJob *job; GtkWidget *window; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->files_to_process == NULL || g_list_length (launcher->files_to_process) == 0) - return; + return TRUE; if (launcher->files_are_selected == FALSE || thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; /* get the window */ window = gtk_widget_get_toplevel (launcher->widget); @@ -2392,42 +2430,51 @@ thunar_launcher_action_rename (ThunarLauncher *launcher) /* display the bulk rename dialog */ thunar_show_renamer_dialog (GTK_WIDGET (window), launcher->current_directory, launcher->files_to_process, FALSE, NULL); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -void +gboolean thunar_launcher_action_restore (ThunarLauncher *launcher) { ThunarApplication *application; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->files_are_selected == FALSE || !thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; /* restore the selected files */ application = thunar_application_get (); thunar_application_restore_files (application, launcher->widget, launcher->files_to_process, NULL); g_object_unref (G_OBJECT (application)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -void +gboolean thunar_launcher_action_restore_and_show (ThunarLauncher *launcher) { ThunarApplication *application; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->files_are_selected == FALSE || !thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; /* restore the selected files */ application = thunar_application_get (); thunar_application_restore_files (application, launcher->widget, launcher->files_to_process, launcher->new_files_created_closure); g_object_unref (G_OBJECT (application)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -2449,29 +2496,32 @@ thunar_launcher_action_move_to_trash (ThunarLauncher *launcher) -static void +static gboolean thunar_launcher_action_delete (ThunarLauncher *launcher) { ThunarApplication *application; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->parent_folder == NULL || launcher->files_are_selected == FALSE) - return; + return TRUE; application = thunar_application_get (); thunar_application_unlink_files (application, launcher->widget, launcher->files_to_process, TRUE); g_object_unref (G_OBJECT (application)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_trash_delete (ThunarLauncher *launcher) { GdkModifierType event_state; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); /* when shift modifier is pressed, we delete (as well via context menu) */ if (gtk_get_current_event_state (&event_state) && (event_state & GDK_SHIFT_MASK) != 0) @@ -2480,20 +2530,23 @@ thunar_launcher_action_trash_delete (ThunarLauncher *launcher) thunar_launcher_action_move_to_trash (launcher); else thunar_launcher_action_delete (launcher); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_remove_from_recent (ThunarLauncher *launcher) { GtkRecentManager *recent_manager = gtk_recent_manager_get_default(); GList *lp; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->parent_folder == NULL || launcher->files_are_selected == FALSE) - return; + return TRUE; for (lp = launcher->files_to_process; lp != NULL; lp = lp->next) { @@ -2503,25 +2556,31 @@ thunar_launcher_action_remove_from_recent (ThunarLauncher *launcher) gtk_recent_manager_remove_item (recent_manager, uri, NULL); g_free(uri); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -void +gboolean thunar_launcher_action_empty_trash (ThunarLauncher *launcher) { ThunarApplication *application; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); application = thunar_application_get (); thunar_application_empty_trash (application, launcher->widget, NULL); g_object_unref (G_OBJECT (application)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_create_folder (ThunarLauncher *launcher) { ThunarApplication *application; @@ -2529,10 +2588,10 @@ thunar_launcher_action_create_folder (ThunarLauncher *launcher) gchar *name; gchar *generated_name; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; /* ask the user to enter a name for the new folder */ generated_name = thunar_util_next_new_file_name (launcher->current_directory, _("New Folder"), THUNAR_NEXT_FILE_NAME_MODE_NEW); @@ -2562,11 +2621,14 @@ thunar_launcher_action_create_folder (ThunarLauncher *launcher) /* release the file name */ g_free (name); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_create_document (ThunarLauncher *launcher, GtkWidget *menu_item) { @@ -2577,10 +2639,10 @@ thunar_launcher_action_create_document (ThunarLauncher *launcher, gchar *title; ThunarFile *template_file; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (thunar_file_is_trash (launcher->current_directory)) - return; + return TRUE; template_file = g_object_get_qdata (G_OBJECT (menu_item), thunar_launcher_file_quark); @@ -2636,6 +2698,9 @@ thunar_launcher_action_create_document (ThunarLauncher *launcher, /* release the file name */ g_free (name); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -2831,67 +2896,79 @@ thunar_launcher_create_document_submenu_new (ThunarLauncher *launcher) -static void +static gboolean thunar_launcher_action_cut (ThunarLauncher *launcher) { ThunarClipboardManager *clipboard; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->files_are_selected == FALSE || launcher->parent_folder == NULL) - return; + return TRUE; clipboard = thunar_clipboard_manager_get_for_display (gtk_widget_get_display (launcher->widget)); thunar_clipboard_manager_cut_files (clipboard, launcher->files_to_process); g_object_unref (G_OBJECT (clipboard)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_copy (ThunarLauncher *launcher) { ThunarClipboardManager *clipboard; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (launcher->files_are_selected == FALSE) - return; + return TRUE; clipboard = thunar_clipboard_manager_get_for_display (gtk_widget_get_display (launcher->widget)); thunar_clipboard_manager_copy_files (clipboard, launcher->files_to_process); g_object_unref (G_OBJECT (clipboard)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_paste (ThunarLauncher *launcher) { ThunarClipboardManager *clipboard; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); clipboard = thunar_clipboard_manager_get_for_display (gtk_widget_get_display (launcher->widget)); thunar_clipboard_manager_paste_files (clipboard, thunar_file_get_file (launcher->current_directory), launcher->widget, launcher->new_files_created_closure); g_object_unref (G_OBJECT (clipboard)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_launcher_action_paste_into_folder (ThunarLauncher *launcher) { ThunarClipboardManager *clipboard; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (!launcher->single_directory_to_process) - return; + return TRUE; clipboard = thunar_clipboard_manager_get_for_display (gtk_widget_get_display (launcher->widget)); thunar_clipboard_manager_paste_files (clipboard, thunar_file_get_file (launcher->single_folder), launcher->widget, launcher->new_files_created_closure); g_object_unref (G_OBJECT (clipboard)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -2941,12 +3018,12 @@ thunar_launcher_action_eject_finish (ThunarDevice *device, * * Will eject the selected device, if any **/ -void +gboolean thunar_launcher_action_eject (ThunarLauncher *launcher) { GMountOperation *mount_operation; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_LIKELY (launcher->device_to_process != NULL)) { @@ -2964,6 +3041,9 @@ thunar_launcher_action_eject (ThunarLauncher *launcher) g_object_unref (mount_operation); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -3000,12 +3080,12 @@ thunar_launcher_action_unmount_finish (ThunarDevice *device, * * Will unmount the selected device, if any **/ -void +gboolean thunar_launcher_action_unmount (ThunarLauncher *launcher) { GMountOperation *mount_operation; - _thunar_return_if_fail (THUNAR_IS_LAUNCHER (launcher)); + _thunar_return_val_if_fail (THUNAR_IS_LAUNCHER (launcher), FALSE); if (G_LIKELY (launcher->device_to_process != NULL)) { @@ -3024,6 +3104,9 @@ thunar_launcher_action_unmount (ThunarLauncher *launcher) /* release the device */ g_object_unref (mount_operation); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-launcher.h b/thunar/thunar-launcher.h index b76f13ffa5ece0cf8d87af5e644eb5a32206d969..5ec895c10008ed40093d5fbd6e74c951ea86a184 100644 --- a/thunar/thunar-launcher.h +++ b/thunar/thunar-launcher.h @@ -109,15 +109,15 @@ gboolean thunar_launcher_append_custom_actions (Thunar gboolean thunar_launcher_check_uca_key_activation (ThunarLauncher *launcher, GdkEventKey *key_event); void thunar_launcher_action_mount (ThunarLauncher *launcher); -void thunar_launcher_action_unmount (ThunarLauncher *launcher); -void thunar_launcher_action_eject (ThunarLauncher *launcher); +gboolean thunar_launcher_action_unmount (ThunarLauncher *launcher); +gboolean thunar_launcher_action_eject (ThunarLauncher *launcher); void thunar_launcher_set_selection (ThunarLauncher *launcher, GList *selected_thunar_files, ThunarDevice *selected_device, GFile *selected_location); -void thunar_launcher_action_empty_trash (ThunarLauncher *launcher); -void thunar_launcher_action_restore (ThunarLauncher *launcher); -void thunar_launcher_action_restore_and_show (ThunarLauncher *launcher); +gboolean thunar_launcher_action_empty_trash (ThunarLauncher *launcher); +gboolean thunar_launcher_action_restore (ThunarLauncher *launcher); +gboolean thunar_launcher_action_restore_and_show (ThunarLauncher *launcher); void thunar_launcher_set_searching (ThunarLauncher *launcher, gboolean b); XfceGtkActionEntry *thunar_launcher_get_action_entries (void); diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c index 97d7ef91c0e78c93e7813315a077e7bdf7b48a91..518eabc50798134c83fa76e47c8c418c2b6a17b6 100644 --- a/thunar/thunar-renamer-dialog.c +++ b/thunar/thunar-renamer-dialog.c @@ -91,10 +91,10 @@ static void thunar_renamer_dialog_response (GtkDialog static void thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog); static void thunar_renamer_dialog_help (ThunarRenamerDialog *renamer_dialog); static void thunar_renamer_dialog_save (ThunarRenamerDialog *renamer_dialog); -static void thunar_renamer_dialog_action_add_files (ThunarRenamerDialog *renamer_dialog); -static void thunar_renamer_dialog_action_remove_files (ThunarRenamerDialog *renamer_dialog); -static void thunar_renamer_dialog_action_clear (ThunarRenamerDialog *renamer_dialog); -static void thunar_renamer_dialog_action_about (ThunarRenamerDialog *renamer_dialog); +static gboolean thunar_renamer_dialog_action_add_files (ThunarRenamerDialog *renamer_dialog); +static gboolean thunar_renamer_dialog_action_remove_files (ThunarRenamerDialog *renamer_dialog); +static gboolean thunar_renamer_dialog_action_clear (ThunarRenamerDialog *renamer_dialog); +static gboolean thunar_renamer_dialog_action_about (ThunarRenamerDialog *renamer_dialog); static void thunar_renamer_dialog_name_column_clicked (GtkTreeViewColumn *column, ThunarRenamerDialog *renamer_dialog); static gboolean thunar_renamer_dialog_button_press_event (GtkWidget *tree_view, @@ -1055,7 +1055,7 @@ trd_video_filter_func (const GtkFileFilterInfo *info, -static void +static gboolean thunar_renamer_dialog_action_add_files (ThunarRenamerDialog *renamer_dialog) { GtkFileFilter *filter; @@ -1065,7 +1065,7 @@ thunar_renamer_dialog_action_add_files (ThunarRenamerDialog *renamer_dialog) GSList *lp; gchar *uri; - _thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog)); + _thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE); /* allocate the file chooser */ chooser = gtk_file_chooser_dialog_new (_("Select files to rename"), @@ -1155,11 +1155,14 @@ thunar_renamer_dialog_action_add_files (ThunarRenamerDialog *renamer_dialog) /* cleanup */ gtk_widget_destroy (chooser); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_renamer_dialog_action_remove_files (ThunarRenamerDialog *renamer_dialog) { GtkTreeRowReference *row; @@ -1169,7 +1172,7 @@ thunar_renamer_dialog_action_remove_files (ThunarRenamerDialog *renamer_dialog) GList *rows; GList *lp; - _thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog)); + _thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE); /* determine the selected rows in the view */ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (renamer_dialog->tree_view)); @@ -1200,30 +1203,39 @@ thunar_renamer_dialog_action_remove_files (ThunarRenamerDialog *renamer_dialog) /* cleanup */ g_list_free (rows); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_renamer_dialog_action_clear (ThunarRenamerDialog *renamer_dialog) { - _thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog)); + _thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE); /* just clear the list of files in the model */ thunar_renamer_model_clear (renamer_dialog->model); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_renamer_dialog_action_about (ThunarRenamerDialog *renamer_dialog) { - _thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog)); + _thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE); /* just popup the about dialog */ thunar_dialogs_show_about (GTK_WINDOW (renamer_dialog), _("Bulk Rename"), _("Thunar Bulk Rename is a powerful and extensible\n" "tool to rename multiple files at once.")); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index c251f10f29eb76a2b1d790a47d6c9fc7b3760ca9..66953307a8c185c44c007915313dc0d93fc232cf 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -123,11 +123,11 @@ static void thunar_shortcuts_view_context_menu (Thunar GdkEventButton *event, GtkTreeModel *model, GtkTreeIter *iter); -static void thunar_shortcuts_view_remove_activated (ThunarShortcutsView *view, +static gboolean thunar_shortcuts_view_remove_activated (ThunarShortcutsView *view, GtkWidget *item); static void thunar_shortcuts_view_editing_canceled (GtkCellRenderer *renderer, ThunarShortcutsView *view); -static void thunar_shortcuts_view_rename_activated (ThunarShortcutsView *view, +static gboolean thunar_shortcuts_view_rename_activated (ThunarShortcutsView *view, GtkWidget *item); static void thunar_shortcuts_view_renamed (GtkCellRenderer *renderer, const gchar *path_string, @@ -1319,7 +1319,7 @@ thunar_shortcuts_view_context_menu (ThunarShortcutsView *view, -static void +static gboolean thunar_shortcuts_view_remove_activated (ThunarShortcutsView *view, GtkWidget *item) { @@ -1339,6 +1339,9 @@ thunar_shortcuts_view_remove_activated (ThunarShortcutsView *view, thunar_shortcuts_model_remove (THUNAR_SHORTCUTS_MODEL (child_model), child_path); gtk_tree_path_free (child_path); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1356,7 +1359,7 @@ thunar_shortcuts_view_editing_canceled (GtkCellRenderer *renderer, -static void +static gboolean thunar_shortcuts_view_rename_activated (ThunarShortcutsView *view, GtkWidget *item) { @@ -1389,6 +1392,9 @@ thunar_shortcuts_view_rename_activated (ThunarShortcutsView *view, gtk_tree_path_free (path); g_list_free (renderers); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 7d042afcfe9569d589d795061a7a647180fb5910..705af7f2a7318e893720168b9df8afbbf52f62a0 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -167,10 +167,10 @@ static void thunar_standard_view_current_directory_changed (Thu static GList *thunar_standard_view_get_selected_files_view (ThunarView *view); static void thunar_standard_view_set_selected_files_view (ThunarView *view, GList *selected_files); -static void thunar_standard_view_select_all_files (ThunarView *view); -static void thunar_standard_view_select_by_pattern (ThunarView *view); -static void thunar_standard_view_selection_invert (ThunarView *view); -static void thunar_standard_view_unselect_all_files (ThunarView *view); +static gboolean thunar_standard_view_select_all_files (ThunarView *view); +static gboolean thunar_standard_view_select_by_pattern (ThunarView *view); +static gboolean thunar_standard_view_selection_invert (ThunarView *view); +static gboolean thunar_standard_view_unselect_all_files (ThunarView *view); static GClosure *thunar_standard_view_new_files_closure (ThunarStandardView *standard_view, GtkWidget *source_view); static void thunar_standard_view_new_files (ThunarStandardView *standard_view, @@ -267,18 +267,18 @@ static void thunar_standard_view_size_allocate (Thu static void thunar_standard_view_connect_accelerators (ThunarStandardView *standard_view); static void thunar_standard_view_disconnect_accelerators (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_by_name (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_by_type (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_by_date (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_by_date_deleted (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_by_size (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_ascending (ThunarStandardView *standard_view); -static void thunar_standard_view_action_sort_descending (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_by_name (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_by_type (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_by_date (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_by_date_deleted (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_by_size (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_ascending (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_action_sort_descending (ThunarStandardView *standard_view); static void thunar_standard_view_set_sort_column (ThunarStandardView *standard_view, ThunarColumn column); static void thunar_standard_view_set_sort_order (ThunarStandardView *standard_view, GtkSortType order); -static void thunar_standard_view_toggle_sort_order (ThunarStandardView *standard_view); +static gboolean thunar_standard_view_toggle_sort_order (ThunarStandardView *standard_view); static void thunar_standard_view_store_sort_column (ThunarStandardView *standard_view); struct _ThunarStandardViewPrivate @@ -409,21 +409,23 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ThunarStandardView, thunar_standard_view, GTK_ G_ADD_PRIVATE (ThunarStandardView)) -static void +static gboolean thunar_standard_view_action_sort_ascending (ThunarStandardView *standard_view) { if (standard_view->priv->sort_order == GTK_SORT_DESCENDING) thunar_standard_view_set_sort_column (standard_view, standard_view->priv->sort_column); + return TRUE; } -static void +static gboolean thunar_standard_view_action_sort_descending (ThunarStandardView *standard_view) { if (standard_view->priv->sort_order == GTK_SORT_ASCENDING) thunar_standard_view_set_sort_column (standard_view, standard_view->priv->sort_column); + return TRUE; } @@ -455,50 +457,56 @@ thunar_standard_view_set_sort_order (ThunarStandardView *standard_view, -static void +static gboolean thunar_standard_view_action_sort_by_name (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, THUNAR_COLUMN_NAME); + return TRUE; } -static void +static gboolean thunar_standard_view_action_sort_by_size (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, THUNAR_COLUMN_SIZE); + return TRUE; } -static void +static gboolean thunar_standard_view_action_sort_by_type (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, THUNAR_COLUMN_TYPE); + return TRUE; } -static void +static gboolean thunar_standard_view_action_sort_by_date (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, THUNAR_COLUMN_DATE_MODIFIED); + return TRUE; } -static void +static gboolean thunar_standard_view_action_sort_by_date_deleted (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, THUNAR_COLUMN_DATE_DELETED); + return TRUE; } -static void +static gboolean thunar_standard_view_toggle_sort_order (ThunarStandardView *standard_view) { thunar_standard_view_set_sort_column (standard_view, standard_view->priv->sort_column); + return TRUE; } @@ -2261,23 +2269,26 @@ thunar_standard_view_current_directory_changed (ThunarFile *current_dire -static void +static gboolean thunar_standard_view_select_all_files (ThunarView *view) { ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (view); - _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); + _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); /* grab the focus to the view */ gtk_widget_grab_focus (GTK_WIDGET (standard_view)); /* select all files in the real view */ (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->select_all) (standard_view); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_standard_view_select_by_pattern (ThunarView *view) { ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (view); @@ -2297,7 +2308,7 @@ thunar_standard_view_select_by_pattern (ThunarView *view) gboolean case_sensitive; gint row = 0; - _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); + _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); window = gtk_widget_get_toplevel (GTK_WIDGET (standard_view)); dialog = gtk_dialog_new_with_buttons (_("Select by Pattern"), @@ -2374,38 +2385,47 @@ thunar_standard_view_select_by_pattern (ThunarView *view) } gtk_widget_destroy (dialog); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_standard_view_selection_invert (ThunarView *view) { ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (view); - _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); + _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); /* grab the focus to the view */ gtk_widget_grab_focus (GTK_WIDGET (standard_view)); /* invert all files in the real view */ (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->selection_invert) (standard_view); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_standard_view_unselect_all_files (ThunarView *view) { ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (view); - _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); + _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); /* grab the focus to the view */ gtk_widget_grab_focus (GTK_WIDGET (standard_view)); /* unselect all files in the real view */ (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->unselect_all) (standard_view); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-statusbar.c b/thunar/thunar-statusbar.c index 22221b90691bd54db97eb02e44d886b304bb1a98..9eb8aebd6e0ad480def6a298798fcb557c24d636 100644 --- a/thunar/thunar-statusbar.c +++ b/thunar/thunar-statusbar.c @@ -55,10 +55,10 @@ static GtkWidget* thunar_statusbar_context_menu (ThunarStatusbar static gboolean thunar_statusbar_button_press_event (GtkWidget *widget, GdkEventButton *event, ThunarStatusbar *statusbar); -static void thunar_statusbar_action_show_size (ThunarStatusbar *statusbar); -static void thunar_statusbar_action_show_size_bytes (ThunarStatusbar *statusbar); -static void thunar_statusbar_action_show_filetype (ThunarStatusbar *statusbar); -static void thunar_statusbar_action_show_display_name (ThunarStatusbar *statusbar); +static gboolean thunar_statusbar_action_show_size (ThunarStatusbar *statusbar); +static gboolean thunar_statusbar_action_show_size_bytes (ThunarStatusbar *statusbar); +static gboolean thunar_statusbar_action_show_filetype (ThunarStatusbar *statusbar); +static gboolean thunar_statusbar_action_show_display_name (ThunarStatusbar *statusbar); static void thunar_statusbar_update_all (void); @@ -256,7 +256,7 @@ thunar_statusbar_context_menu (ThunarStatusbar *statusbar) -static void +static gboolean thunar_statusbar_action_show_size (ThunarStatusbar *statusbar) { guint active; @@ -264,11 +264,14 @@ thunar_statusbar_action_show_size (ThunarStatusbar *statusbar) g_object_get (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", &active, NULL); g_object_set (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", thunar_status_bar_info_toggle_bit (active, THUNAR_STATUS_BAR_INFO_SIZE), NULL); thunar_statusbar_update_all (); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_statusbar_action_show_size_bytes (ThunarStatusbar *statusbar) { guint active; @@ -276,11 +279,14 @@ thunar_statusbar_action_show_size_bytes (ThunarStatusbar *statusbar) g_object_get (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", &active, NULL); g_object_set (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", thunar_status_bar_info_toggle_bit (active, THUNAR_STATUS_BAR_INFO_SIZE_IN_BYTES), NULL); thunar_statusbar_update_all (); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_statusbar_action_show_filetype (ThunarStatusbar *statusbar) { guint active; @@ -288,11 +294,14 @@ thunar_statusbar_action_show_filetype (ThunarStatusbar *statusbar) g_object_get (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", &active, NULL); g_object_set (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", thunar_status_bar_info_toggle_bit (active, THUNAR_STATUS_BAR_INFO_FILETYPE), NULL); thunar_statusbar_update_all (); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_statusbar_action_show_display_name (ThunarStatusbar *statusbar) { guint active; @@ -300,6 +309,9 @@ thunar_statusbar_action_show_display_name (ThunarStatusbar *statusbar) g_object_get (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", &active, NULL); g_object_set (G_OBJECT (statusbar->preferences), "misc-status-bar-active-info", thunar_status_bar_info_toggle_bit (active, THUNAR_STATUS_BAR_INFO_DISPLAY_NAME), NULL); thunar_statusbar_update_all (); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 0afbf4ad0ec93e281e5a700f5c097afd74ba763a..d9036f420b23d739bbd320f20d2f6e65718f73ce 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -175,60 +175,60 @@ static void thunar_window_start_open_location (ThunarWindow const gchar *initial_text); static void thunar_window_resume_search (ThunarWindow *window, const gchar *initial_text); -static void thunar_window_action_open_new_tab (ThunarWindow *window, +static gboolean thunar_window_action_open_new_tab (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_open_new_window (ThunarWindow *window, +static gboolean thunar_window_action_open_new_window (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_detach_tab (ThunarWindow *window, +static gboolean thunar_window_action_detach_tab (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_close_all_windows (ThunarWindow *window, +static gboolean thunar_window_action_close_all_windows (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_close_tab (ThunarWindow *window, +static gboolean thunar_window_action_close_tab (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_close_window (ThunarWindow *window, +static gboolean thunar_window_action_close_window (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_preferences (ThunarWindow *window, +static gboolean thunar_window_action_preferences (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_reload (ThunarWindow *window, +static gboolean thunar_window_action_reload (ThunarWindow *window, GtkWidget *menu_item); -static void thunar_window_action_toggle_split_view (ThunarWindow *window); -static void thunar_window_action_switch_next_tab (ThunarWindow *window); -static void thunar_window_action_switch_previous_tab (ThunarWindow *window); -static void thunar_window_action_pathbar_changed (ThunarWindow *window); -static void thunar_window_action_toolbar_changed (ThunarWindow *window); -static void thunar_window_action_shortcuts_changed (ThunarWindow *window); -static void thunar_window_action_tree_changed (ThunarWindow *window); -static void thunar_window_action_statusbar_changed (ThunarWindow *window); +static gboolean thunar_window_action_toggle_split_view (ThunarWindow *window); +static gboolean thunar_window_action_switch_next_tab (ThunarWindow *window); +static gboolean thunar_window_action_switch_previous_tab (ThunarWindow *window); +static gboolean thunar_window_action_pathbar_changed (ThunarWindow *window); +static gboolean thunar_window_action_toolbar_changed (ThunarWindow *window); +static gboolean thunar_window_action_shortcuts_changed (ThunarWindow *window); +static gboolean thunar_window_action_tree_changed (ThunarWindow *window); +static gboolean thunar_window_action_statusbar_changed (ThunarWindow *window); static void thunar_window_action_menubar_update (ThunarWindow *window); -static void thunar_window_action_menubar_changed (ThunarWindow *window); -static void thunar_window_action_detailed_view (ThunarWindow *window); -static void thunar_window_action_icon_view (ThunarWindow *window); -static void thunar_window_action_compact_view (ThunarWindow *window); +static gboolean thunar_window_action_menubar_changed (ThunarWindow *window); +static gboolean thunar_window_action_detailed_view (ThunarWindow *window); +static gboolean thunar_window_action_icon_view (ThunarWindow *window); +static gboolean thunar_window_action_compact_view (ThunarWindow *window); static void thunar_window_replace_view (ThunarWindow *window, GtkWidget *view, GType view_type); static void thunar_window_action_view_changed (ThunarWindow *window, GType view_type); -static void thunar_window_action_go_up (ThunarWindow *window); -static void thunar_window_action_back (ThunarWindow *window); -static void thunar_window_action_forward (ThunarWindow *window); -static void thunar_window_action_open_home (ThunarWindow *window); -static void thunar_window_action_open_desktop (ThunarWindow *window); -static void thunar_window_action_open_computer (ThunarWindow *window); -static void thunar_window_action_open_templates (ThunarWindow *window); -static void thunar_window_action_open_file_system (ThunarWindow *window); -static void thunar_window_action_open_recent (ThunarWindow *window); -static void thunar_window_action_open_trash (ThunarWindow *window); -static void thunar_window_action_open_network (ThunarWindow *window); +static gboolean thunar_window_action_go_up (ThunarWindow *window); +static gboolean thunar_window_action_back (ThunarWindow *window); +static gboolean thunar_window_action_forward (ThunarWindow *window); +static gboolean thunar_window_action_open_home (ThunarWindow *window); +static gboolean thunar_window_action_open_desktop (ThunarWindow *window); +static gboolean thunar_window_action_open_computer (ThunarWindow *window); +static gboolean thunar_window_action_open_templates (ThunarWindow *window); +static gboolean thunar_window_action_open_file_system (ThunarWindow *window); +static gboolean thunar_window_action_open_recent (ThunarWindow *window); +static gboolean thunar_window_action_open_trash (ThunarWindow *window); +static gboolean thunar_window_action_open_network (ThunarWindow *window); static void thunar_window_action_open_bookmark (GFile *g_file); -static void thunar_window_action_open_location (ThunarWindow *window); -static void thunar_window_action_contents (ThunarWindow *window); -static void thunar_window_action_about (ThunarWindow *window); -static void thunar_window_action_show_hidden (ThunarWindow *window); +static gboolean thunar_window_action_open_location (ThunarWindow *window); +static gboolean thunar_window_action_contents (ThunarWindow *window); +static gboolean thunar_window_action_about (ThunarWindow *window); +static gboolean thunar_window_action_show_hidden (ThunarWindow *window); static gboolean thunar_window_propagate_key_event (GtkWindow *window, GdkEvent *key_event, gpointer user_data); -static void thunar_window_action_open_file_menu (ThunarWindow *window); +static gboolean thunar_window_action_open_file_menu (ThunarWindow *window); static void thunar_window_current_directory_changed (ThunarFile *current_directory, ThunarWindow *window); static void thunar_window_menu_item_selected (ThunarWindow *window, @@ -299,7 +299,7 @@ static void thunar_window_set_directory_specific_settings (ThunarWindow gboolean directory_specific_settings); static GType thunar_window_view_type_for_directory (ThunarWindow *window, ThunarFile *directory); -static void thunar_window_action_clear_directory_specific_settings (ThunarWindow *window); +static gboolean thunar_window_action_clear_directory_specific_settings (ThunarWindow *window); static void thunar_window_trash_infobar_clicked (GtkInfoBar *info_bar, gint response_id, ThunarWindow *window); @@ -1710,7 +1710,8 @@ thunar_window_zoom_in (ThunarWindow *window) return TRUE; } - return FALSE; + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1727,7 +1728,8 @@ thunar_window_zoom_out (ThunarWindow *window) return TRUE; } - return FALSE; + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -1744,7 +1746,7 @@ thunar_window_zoom_reset (ThunarWindow *window) return TRUE; } - return FALSE; + return TRUE; } @@ -1763,38 +1765,42 @@ thunar_window_tab_change (ThunarWindow *window, -static void +static gboolean thunar_window_action_switch_next_tab (ThunarWindow *window) { gint current_page; gint new_page; gint pages; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook_selected)); pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook_selected)); new_page = (current_page + 1) % pages; thunar_window_notebook_set_current_tab (window, new_page); + + return TRUE; } -static void +static gboolean thunar_window_action_switch_previous_tab (ThunarWindow *window) { gint current_page; gint new_page; gint pages; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook_selected)); pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook_selected)); new_page = (current_page - 1) % pages; thunar_window_notebook_set_current_tab (window, new_page); + + return TRUE; } @@ -2998,13 +3004,13 @@ thunar_window_update_search (ThunarWindow *window) -void +gboolean thunar_window_action_cancel_search (ThunarWindow *window) { - _thunar_return_if_fail (THUNAR_IS_LOCATION_BAR (window->location_bar)); + _thunar_return_val_if_fail (THUNAR_IS_LOCATION_BAR (window->location_bar), FALSE); if (window->is_searching == FALSE) - return; + return TRUE; thunar_location_bar_cancel_search (THUNAR_LOCATION_BAR (window->location_bar)); thunar_standard_view_set_searching (THUNAR_STANDARD_VIEW (window->view), NULL); @@ -3025,21 +3031,27 @@ thunar_window_action_cancel_search (ThunarWindow *window) thunar_standard_view_save_view_type (THUNAR_STANDARD_VIEW (window->view), 0); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_new_tab (ThunarWindow *window, GtkWidget *menu_item) { /* open new tab with current directory as default */ thunar_window_notebook_add_new_tab (window, thunar_window_get_current_directory (window), THUNAR_NEW_TAB_BEHAVIOR_SWITCH); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_new_window (ThunarWindow *window, GtkWidget *menu_item) { @@ -3056,7 +3068,7 @@ thunar_window_action_open_new_window (ThunarWindow *window, /* if we have no origin view we are done */ if (window->view == NULL) - return; + return TRUE; /* let the view of the new window inherit the history of the origin view */ history = thunar_standard_view_copy_history (THUNAR_STANDARD_VIEW (window->view)); @@ -3078,11 +3090,14 @@ thunar_window_action_open_new_window (ThunarWindow *window, /* release the file reference */ g_object_unref (G_OBJECT (start_file)); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_detach_tab (ThunarWindow *window, GtkWidget *menu_item) { @@ -3090,17 +3105,17 @@ thunar_window_action_detach_tab (ThunarWindow *window, GtkWidget *label; GtkWidget *view = window->view; - _thunar_return_if_fail (THUNAR_IS_VIEW (view)); - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_VIEW (view), FALSE); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* create a new window */ notebook = thunar_window_notebook_create_window (window->notebook_selected, view, -1, -1, window); if (notebook == NULL) - return; + return TRUE; /* get the current label */ label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (window->notebook_selected), view); - _thunar_return_if_fail (GTK_IS_WIDGET (label)); + _thunar_return_val_if_fail (GTK_IS_WIDGET (label), FALSE); /* ref object so they don't destroy when removed from the container */ g_object_ref (label); @@ -3120,11 +3135,14 @@ thunar_window_action_detach_tab (ThunarWindow *window, /* release */ g_object_unref (label); g_object_unref (view); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_close_all_windows (ThunarWindow *window, GtkWidget *menu_item) { @@ -3138,11 +3156,14 @@ thunar_window_action_close_all_windows (ThunarWindow *window, /* destroy all open windows */ g_list_free_full (windows, (GDestroyNotify) gtk_widget_destroy); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_close_tab (ThunarWindow *window, GtkWidget *menu_item) { @@ -3158,11 +3179,14 @@ thunar_window_action_close_tab (ThunarWindow *window, else if (window->view != NULL) gtk_widget_destroy (window->view); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_close_window (ThunarWindow *window, GtkWidget *menu_item) { @@ -3171,18 +3195,21 @@ thunar_window_action_close_window (ThunarWindow *window, response = thunar_window_delete (GTK_WIDGET (window), NULL, NULL); if (response == FALSE) gtk_widget_destroy (GTK_WIDGET (window)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_preferences (ThunarWindow *window, GtkWidget *menu_item) { GtkWidget *dialog; ThunarApplication *application; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* allocate and display a preferences dialog */; dialog = thunar_preferences_dialog_new (GTK_WINDOW (window)); @@ -3192,17 +3219,20 @@ thunar_window_action_preferences (ThunarWindow *window, application = thunar_application_get (); thunar_application_take_window (application, GTK_WINDOW (dialog)); g_object_unref (G_OBJECT (application)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_reload (ThunarWindow *window, GtkWidget *menu_item) { gboolean result; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* force the view to reload */ g_signal_emit (G_OBJECT (window), window_signals[RELOAD], 0, TRUE, &result); @@ -3210,11 +3240,14 @@ thunar_window_action_reload (ThunarWindow *window, /* update the location bar to show the current directory */ if (window->location_bar != NULL) g_object_notify (G_OBJECT (window->location_bar), "current-directory"); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_toggle_split_view (ThunarWindow *window) { @@ -3224,8 +3257,8 @@ thunar_window_action_toggle_split_view (ThunarWindow *window) GType view_type; GtkAllocation allocation; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); - _thunar_return_if_fail (window->view_type != G_TYPE_NONE); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); + _thunar_return_val_if_fail (window->view_type != G_TYPE_NONE, FALSE); if (thunar_window_split_view_is_active (window)) { @@ -3275,17 +3308,20 @@ thunar_window_action_toggle_split_view (ThunarWindow *window) g_signal_connect_swapped (window->paned, "accept-position", G_CALLBACK (thunar_window_save_paned_notebooks), window); g_signal_connect_swapped (window->paned, "button-release-event", G_CALLBACK (thunar_window_save_paned_notebooks), window); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_pathbar_changed (ThunarWindow *window) { gchar *last_location_bar; gboolean pathbar_checked; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-location-bar", &last_location_bar, NULL); pathbar_checked = exo_str_is_equal (last_location_bar, g_type_name (THUNAR_TYPE_LOCATION_ENTRY)); @@ -3295,17 +3331,20 @@ thunar_window_action_pathbar_changed (ThunarWindow *window) g_object_set (window->preferences, "last-location-bar", g_type_name (G_TYPE_NONE), NULL); else g_object_set (window->preferences, "last-location-bar", g_type_name (THUNAR_TYPE_LOCATION_ENTRY), NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_toolbar_changed (ThunarWindow *window) { gchar *last_location_bar; gboolean toolbar_checked; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-location-bar", &last_location_bar, NULL); toolbar_checked = exo_str_is_equal (last_location_bar, g_type_name (THUNAR_TYPE_LOCATION_BUTTONS)); @@ -3315,18 +3354,21 @@ thunar_window_action_toolbar_changed (ThunarWindow *window) g_object_set (window->preferences, "last-location-bar", g_type_name (G_TYPE_NONE), NULL); else g_object_set (window->preferences, "last-location-bar", g_type_name (THUNAR_TYPE_LOCATION_BUTTONS), NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_shortcuts_changed (ThunarWindow *window) { gchar *last_side_pane; gboolean shortcuts_checked; GType type = G_TYPE_NONE; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-side-pane", &last_side_pane, NULL); shortcuts_checked = exo_str_is_equal (last_side_pane, g_type_name (THUNAR_TYPE_SHORTCUTS_PANE)); @@ -3338,18 +3380,21 @@ thunar_window_action_shortcuts_changed (ThunarWindow *window) type = THUNAR_TYPE_SHORTCUTS_PANE; thunar_window_install_sidepane (window, type); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_tree_changed (ThunarWindow *window) { gchar *last_side_pane; gboolean tree_view_checked; GType type = G_TYPE_NONE; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-side-pane", &last_side_pane, NULL); tree_view_checked = exo_str_is_equal (last_side_pane, g_type_name (THUNAR_TYPE_TREE_PANE)); @@ -3361,22 +3406,28 @@ thunar_window_action_tree_changed (ThunarWindow *window) type = THUNAR_TYPE_TREE_PANE; thunar_window_install_sidepane (window, type); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_statusbar_changed (ThunarWindow *window) { gboolean last_statusbar_visible; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-statusbar-visible", &last_statusbar_visible, NULL); gtk_widget_set_visible (window->statusbar, !last_statusbar_visible); g_object_set (G_OBJECT (window->preferences), "last-statusbar-visible", !last_statusbar_visible, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -3395,23 +3446,26 @@ thunar_window_action_menubar_update (ThunarWindow *window) -static void +static gboolean thunar_window_action_menubar_changed (ThunarWindow *window) { gboolean last_menubar_visible; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); g_object_get (window->preferences, "last-menubar-visible", &last_menubar_visible, NULL); gtk_widget_set_visible (window->menubar, !last_menubar_visible); g_object_set (G_OBJECT (window->preferences), "last-menubar-visible", !last_menubar_visible, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_clear_directory_specific_settings (ThunarWindow *window) { GType view_type; @@ -3428,11 +3482,14 @@ thunar_window_action_clear_directory_specific_settings (ThunarWindow *window) /* replace the active view with a new one of the correct type */ thunar_window_replace_view (window, window->view, view_type); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_detailed_view (ThunarWindow *window) { thunar_window_action_view_changed (window, THUNAR_TYPE_DETAILS_VIEW); @@ -3440,24 +3497,33 @@ thunar_window_action_detailed_view (ThunarWindow *window) thunar_file_is_trash (window->current_directory)); thunar_details_view_set_recency_column_visible (THUNAR_DETAILS_VIEW (window->view), thunar_file_is_recent (window->current_directory)); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_icon_view (ThunarWindow *window) { if (window->is_searching == FALSE) thunar_window_action_view_changed (window, THUNAR_TYPE_ICON_VIEW); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_compact_view (ThunarWindow *window) { if (window->is_searching == FALSE) thunar_window_action_view_changed (window, THUNAR_TYPE_COMPACT_VIEW); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -3599,7 +3665,7 @@ thunar_window_action_view_changed (ThunarWindow *window, -static void +static gboolean thunar_window_action_go_up (ThunarWindow *window) { ThunarFile *parent; @@ -3620,44 +3686,53 @@ thunar_window_action_go_up (ThunarWindow *window) } g_error_free (error); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_back (ThunarWindow *window) { ThunarHistory *history; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); history = thunar_standard_view_get_history (THUNAR_STANDARD_VIEW (window->view)); thunar_history_action_back (history); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_forward (ThunarWindow *window) { ThunarHistory *history; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); history = thunar_standard_view_get_history (THUNAR_STANDARD_VIEW (window->view)); thunar_history_action_forward (history); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_home (ThunarWindow *window) { GFile *home; ThunarFile *home_file; GError *error = NULL; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the path to the home directory */ home = thunar_g_file_new_for_home (); @@ -3679,6 +3754,9 @@ thunar_window_action_open_home (ThunarWindow *window) /* release our reference on the home path */ g_object_unref (home); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -3775,24 +3853,27 @@ thunar_window_open_user_folder (ThunarWindow *window, -static void +static gboolean thunar_window_action_open_desktop (ThunarWindow *window) { - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); thunar_window_open_user_folder (window, G_USER_DIRECTORY_DESKTOP, "Desktop"); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_computer (ThunarWindow *window) { GFile *computer; ThunarFile *computer_file; GError *error = NULL; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the computer location */ computer = thunar_g_file_new_for_computer(); @@ -3814,11 +3895,14 @@ thunar_window_action_open_computer (ThunarWindow *window) /* release our reference on the location itself */ g_object_unref (computer); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_templates (ThunarWindow *window) { GtkWidget *dialog; @@ -3830,7 +3914,7 @@ thunar_window_action_open_templates (ThunarWindow *window) gboolean show_about_templates; gboolean success; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); success = thunar_window_open_user_folder (window, G_USER_DIRECTORY_TEMPLATES, "Templates"); @@ -3893,18 +3977,21 @@ thunar_window_action_open_templates (ThunarWindow *window) gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_file_system (ThunarWindow *window) { GFile *root; ThunarFile *root_file; GError *error = NULL; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the path to the root directory */ root = thunar_g_file_new_for_root (); @@ -3926,18 +4013,21 @@ thunar_window_action_open_file_system (ThunarWindow *window) /* release our reference on the home path */ g_object_unref (root); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_recent (ThunarWindow *window) { GFile *recent; ThunarFile *recent_file; GError *error = NULL; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the path to `Recent` */ recent = thunar_g_file_new_for_recent (); @@ -3959,18 +4049,21 @@ thunar_window_action_open_recent (ThunarWindow *window) /* release our reference on the `Recent` path */ g_object_unref (recent); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_trash (ThunarWindow *window) { GFile *trash_bin; ThunarFile *trash_bin_file; GError *error = NULL; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the path to the trash bin */ trash_bin = thunar_g_file_new_for_trash (); @@ -3992,18 +4085,21 @@ thunar_window_action_open_trash (ThunarWindow *window) /* release our reference on the trash bin path */ g_object_unref (trash_bin); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_network (ThunarWindow *window) { ThunarFile *network_file; GError *error = NULL; GFile *network; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* determine the network root location */ network = thunar_g_file_new_for_network(); @@ -4025,6 +4121,9 @@ thunar_window_action_open_network (ThunarWindow *window) /* release our reference on the location itself */ g_object_unref (network); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } @@ -4092,39 +4191,48 @@ thunar_window_action_open_bookmark (GFile *g_file) -static void +static gboolean thunar_window_action_open_location (ThunarWindow *window) { /* just use the "start-open-location" callback */ thunar_window_start_open_location (window, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_contents (ThunarWindow *window) { /* display the documentation index */ xfce_dialog_show_help (GTK_WINDOW (window), "thunar", NULL, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_about (ThunarWindow *window) { /* just popup the about dialog */ thunar_dialogs_show_about (GTK_WINDOW (window), PACKAGE_NAME, _("Thunar is a fast and easy to use file manager\n" "for the Xfce Desktop Environment.")); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_show_hidden (ThunarWindow *window) { - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); window->show_hidden = !window->show_hidden; gtk_container_foreach (GTK_CONTAINER (window->notebook_selected), (GtkCallback) (void (*)(void)) thunar_view_set_show_hidden, GINT_TO_POINTER (window->show_hidden)); @@ -4133,25 +4241,31 @@ thunar_window_action_show_hidden (ThunarWindow *window) thunar_side_pane_set_show_hidden (THUNAR_SIDE_PANE (window->sidepane), window->show_hidden); g_object_set (G_OBJECT (window->preferences), "last-show-hidden", window->show_hidden, NULL); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -void +gboolean thunar_window_action_search (ThunarWindow *window) { thunar_window_start_open_location (window, SEARCH_PREFIX); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } -static void +static gboolean thunar_window_action_open_file_menu (ThunarWindow *window) { gboolean ret; GList *children; - _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); /* In case the menubar is hidden, we make it visible (e.g. when F10 is pressed) */ gtk_widget_set_visible (window->menubar, TRUE); @@ -4160,6 +4274,9 @@ thunar_window_action_open_file_menu (ThunarWindow *window) g_signal_emit_by_name (children->data, "button-press-event", NULL, &ret); g_list_free (children); gtk_menu_shell_select_first (GTK_MENU_SHELL (window->menubar), TRUE); + + /* required in case of shortcut activation, in order to signal that the accel key got handled */ + return TRUE; } diff --git a/thunar/thunar-window.h b/thunar/thunar-window.h index defa053091da03563ced35f17c7a56957cc5afca..83a5b2dd383cda827c4803c8e186825c713caf64 100644 --- a/thunar/thunar-window.h +++ b/thunar/thunar-window.h @@ -145,8 +145,8 @@ void thunar_window_open_files_in_location (Thu void thunar_window_show_and_select_files (ThunarWindow *window, GList *files_to_select); void thunar_window_update_search (ThunarWindow *window); -void thunar_window_action_cancel_search (ThunarWindow *window); -void thunar_window_action_search (ThunarWindow *window); +gboolean thunar_window_action_cancel_search (ThunarWindow *window); +gboolean thunar_window_action_search (ThunarWindow *window); void thunar_window_update_statusbar (ThunarWindow *window); XfceGtkActionEntry* thunar_window_get_action_entries (void); diff --git a/thunarx/thunarx-menu-item.c b/thunarx/thunarx-menu-item.c index 4969a6e7d78e4a160c365a989c2c49f54339fab1..e3989546b556dcb70868653db9e97557a8e2abab 100644 --- a/thunarx/thunarx-menu-item.c +++ b/thunarx/thunarx-menu-item.c @@ -341,10 +341,11 @@ thunarx_menu_item_new (const gchar *name, * * Emits the activate signal. */ -void +gboolean thunarx_menu_item_activate (ThunarxMenuItem *item) { g_signal_emit (item, signals[ACTIVATE], 0); + return TRUE; } diff --git a/thunarx/thunarx-menu.h b/thunarx/thunarx-menu.h index 8de23b07d59d6d56da64245d5656bfe51f657ab3..3f1adef56634bbfc7429a8c2d4af0b7028f5e774 100644 --- a/thunarx/thunarx-menu.h +++ b/thunarx/thunarx-menu.h @@ -102,7 +102,7 @@ ThunarxMenuItem *thunarx_menu_item_new (const gchar *name, const gchar *tooltip, const gchar *icon) G_GNUC_MALLOC; -void thunarx_menu_item_activate (ThunarxMenuItem *item); +gboolean thunarx_menu_item_activate (ThunarxMenuItem *item); gboolean thunarx_menu_item_get_sensitive (ThunarxMenuItem *item); void thunarx_menu_item_set_sensitive (ThunarxMenuItem *item,