From d9021524decaa3968e886215c3c7f6544a3b23be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= Date: Sat, 8 Jun 2024 21:57:00 +0200 Subject: [PATCH] Minor improvements --- projectorganizer/src/prjorg-sidebar.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/projectorganizer/src/prjorg-sidebar.c b/projectorganizer/src/prjorg-sidebar.c index 6e89c74e7..7587a6bb0 100644 --- a/projectorganizer/src/prjorg-sidebar.c +++ b/projectorganizer/src/prjorg-sidebar.c @@ -427,19 +427,19 @@ void on_open_terminal(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpoint static gint file_chooser_run(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) + if (GTK_IS_NATIVE_DIALOG(dialog)) + return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); + else return gtk_dialog_run(GTK_DIALOG(dialog)); - - return gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); } static void file_chooser_destroy(GtkFileChooser *dialog) { - if (GTK_IS_WIDGET(dialog)) - gtk_widget_destroy(GTK_WIDGET(dialog)); - else + if (GTK_IS_NATIVE_DIALOG(dialog)) g_object_unref(dialog); + else + gtk_widget_destroy(GTK_WIDGET(dialog)); } @@ -452,12 +452,12 @@ static void on_add_external(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED if (geany_data->interface_prefs->use_native_windows_dialogs) dialog = GTK_FILE_CHOOSER(gtk_file_chooser_native_new(_("Add External Directory"), GTK_WINDOW(geany_data->main_widgets->window), - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Add"), _("_Cancel"))); + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Add"), NULL)); else dialog = GTK_FILE_CHOOSER(gtk_file_chooser_dialog_new(_("Add External Directory"), GTK_WINDOW(geany->main_widgets->window), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Cancel"), GTK_RESPONSE_CANCEL, - _("Add"), GTK_RESPONSE_ACCEPT, NULL)); + _("_Add"), GTK_RESPONSE_ACCEPT, NULL)); gtk_file_chooser_set_current_folder(dialog, locale_path);