Commit 94a87ac8 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Implement native OS open/save dialogs

parent 1b788a68
......@@ -49,9 +49,11 @@ gedit_libosx_la_LIBADD = -lobjc
gedit_libosx_la_CPPFLAGS = $(gedit_common_cppflags)
gedit_libosx_la_CFLAGS = -xobjective-c $(gedit_common_cflags)
gedit_libosx_la_SOURCES = \
gedit/gedit-app-osx.c \
gedit/gedit-app-osx.h
gedit_libosx_la_SOURCES = \
gedit/gedit-app-osx.c \
gedit/gedit-app-osx.h \
gedit/gedit-file-chooser-dialog-osx.c \
gedit/gedit-file-chooser-dialog-osx.h
gedit_libgedit_la_LIBADD += gedit/libosx.la
endif
......@@ -101,8 +103,10 @@ gedit_NOINST_H_FILES = \
gedit/gedit-dirs.h \
gedit/gedit-documents-panel.h \
gedit/gedit-encodings-dialog.h \
gedit/gedit-encoding-items.h \
gedit/gedit-open-document-selector.h \
gedit/gedit-file-chooser-dialog.h \
gedit/gedit-file-chooser-dialog-gtk.h \
gedit/gedit-highlight-mode-dialog.h \
gedit/gedit-highlight-mode-selector.h \
gedit/gedit-history-entry.h \
......@@ -173,8 +177,10 @@ gedit_libgedit_c_files = \
gedit/gedit-documents-panel.c \
gedit/gedit-encodings-combo-box.c \
gedit/gedit-encodings-dialog.c \
gedit/gedit-encoding-items.c \
gedit/gedit-open-document-selector.c \
gedit/gedit-file-chooser-dialog.c \
gedit/gedit-file-chooser-dialog-gtk.c \
gedit/gedit-highlight-mode-dialog.c \
gedit/gedit-highlight-mode-selector.c \
gedit/gedit-history-entry.c \
......
......@@ -379,17 +379,17 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
if (response_id != GTK_RESPONSE_OK)
{
gtk_widget_destroy (GTK_WIDGET (dialog));
gedit_file_chooser_dialog_destroy (dialog);
return;
}
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (dialog));
files = gedit_file_chooser_dialog_get_files (dialog);
g_return_if_fail (files != NULL);
encoding = gedit_file_chooser_dialog_get_encoding (dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
gedit_file_chooser_dialog_destroy (dialog);
if (window == NULL)
{
......@@ -419,7 +419,7 @@ _gedit_cmd_file_open (GSimpleAction *action,
gpointer user_data)
{
GeditWindow *window = NULL;
GtkWidget *open_dialog;
GeditFileChooserDialog *open_dialog;
if (GEDIT_IS_WINDOW (user_data))
{
......@@ -448,13 +448,11 @@ _gedit_cmd_file_open (GSimpleAction *action,
}
/* Translators: "Open" is the title of the file chooser window */
open_dialog = gedit_file_chooser_dialog_new (_("Open"),
window ? GTK_WINDOW (window) : NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
NULL,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_OK,
NULL);
open_dialog = gedit_file_chooser_dialog_create (_("Open"),
window ? GTK_WINDOW (window) : NULL,
GEDIT_FILE_CHOOSER_OPEN |
GEDIT_FILE_CHOOSER_ENABLE_ENCODING,
NULL);
if (window != NULL)
{
......@@ -488,13 +486,7 @@ _gedit_cmd_file_open (GSimpleAction *action,
if (default_path != NULL)
{
gchar *uri;
uri = g_file_get_uri (default_path);
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (open_dialog),
uri);
g_free (uri);
gedit_file_chooser_dialog_set_current_folder (open_dialog, default_path);
g_object_unref (default_path);
}
}
......@@ -504,7 +496,7 @@ _gedit_cmd_file_open (GSimpleAction *action,
G_CALLBACK (open_dialog_response_cb),
window);
gtk_widget_show (open_dialog);
gedit_file_chooser_dialog_show (open_dialog);
}
void
......@@ -715,7 +707,7 @@ save_dialog_response_cb (GeditFileChooserDialog *dialog,
if (response_id != GTK_RESPONSE_OK)
{
gtk_widget_destroy (GTK_WIDGET (dialog));
gedit_file_chooser_dialog_destroy (dialog);
goto save_next_tab;
}
......@@ -734,7 +726,7 @@ save_dialog_response_cb (GeditFileChooserDialog *dialog,
doc = gedit_tab_get_document (tab);
file = gedit_document_get_file (doc);
location = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
location = gedit_file_chooser_dialog_get_file (dialog);
g_return_if_fail (location != NULL);
compression_type = get_compression_type_from_file (location);
......@@ -747,7 +739,7 @@ save_dialog_response_cb (GeditFileChooserDialog *dialog,
location,
compression_type != GTK_SOURCE_COMPRESSION_TYPE_NONE))
{
gtk_widget_destroy (GTK_WIDGET (dialog));
gedit_file_chooser_dialog_destroy (dialog);
g_object_unref (location);
goto save_next_tab;
......@@ -757,7 +749,7 @@ save_dialog_response_cb (GeditFileChooserDialog *dialog,
encoding = gedit_file_chooser_dialog_get_encoding (dialog);
newline_type = gedit_file_chooser_dialog_get_newline_type (dialog);
gtk_widget_destroy (GTK_WIDGET (dialog));
gedit_file_chooser_dialog_destroy (dialog);
doc = gedit_tab_get_document (tab);
g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
......@@ -823,25 +815,30 @@ save_next_tab:
}
static GtkFileChooserConfirmation
confirm_overwrite_callback (GtkFileChooser *dialog,
gpointer data)
confirm_overwrite_callback (GeditFileChooserDialog *dialog,
gpointer data)
{
gchar *uri;
GFile *file;
GtkFileChooserConfirmation res;
gedit_debug (DEBUG_COMMANDS);
uri = gtk_file_chooser_get_uri (dialog);
file = g_file_new_for_uri (uri);
g_free (uri);
file = gedit_file_chooser_dialog_get_file (dialog);
if (is_read_only (file))
{
if (replace_read_only_file (GTK_WINDOW (dialog), file))
GtkWindow *win;
win = gedit_file_chooser_dialog_get_window (dialog);
if (replace_read_only_file (win, file))
{
res = GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
}
else
{
res = GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
}
}
else
{
......@@ -858,29 +855,29 @@ void
_gedit_cmd_file_save_as_tab (GeditTab *tab,
GeditWindow *window)
{
GtkWidget *save_dialog;
GeditFileChooserDialog *save_dialog;
GtkWindowGroup *wg;
GeditDocument *doc;
GtkSourceFile *file;
GFile *location;
const GtkSourceEncoding *encoding;
GtkSourceNewlineType newline_type;
GtkWindow *win;
g_return_if_fail (GEDIT_IS_TAB (tab));
g_return_if_fail (GEDIT_IS_WINDOW (window));
gedit_debug (DEBUG_COMMANDS);
save_dialog = gedit_file_chooser_dialog_new (_("Save As"),
GTK_WINDOW (window),
GTK_FILE_CHOOSER_ACTION_SAVE,
NULL,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Save"), GTK_RESPONSE_OK,
NULL);
save_dialog = gedit_file_chooser_dialog_create (_("Save As"),
GTK_WINDOW (window),
GEDIT_FILE_CHOOSER_SAVE |
GEDIT_FILE_CHOOSER_ENABLE_ENCODING |
GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING,
NULL);
gedit_file_chooser_dialog_set_do_overwrite_confirmation (save_dialog, TRUE);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (save_dialog),
TRUE);
g_signal_connect (save_dialog,
"confirm-overwrite",
G_CALLBACK (confirm_overwrite_callback),
......@@ -888,10 +885,15 @@ _gedit_cmd_file_save_as_tab (GeditTab *tab,
wg = gedit_window_get_group (window);
gtk_window_group_add_window (wg, GTK_WINDOW (save_dialog));
win = gedit_file_chooser_dialog_get_window (save_dialog);
if (win != NULL)
{
gtk_window_group_add_window (wg, win);
}
/* Save As dialog is modal to its main window */
gtk_window_set_modal (GTK_WINDOW (save_dialog), TRUE);
gedit_file_chooser_dialog_set_modal (save_dialog, TRUE);
/* Set the suggested file name */
doc = gedit_tab_get_document (tab);
......@@ -900,9 +902,7 @@ _gedit_cmd_file_save_as_tab (GeditTab *tab,
if (location != NULL)
{
gtk_file_chooser_set_file (GTK_FILE_CHOOSER (save_dialog),
location,
NULL);
gedit_file_chooser_dialog_set_file (save_dialog, location);
}
else
{
......@@ -914,18 +914,14 @@ _gedit_cmd_file_save_as_tab (GeditTab *tab,
if (default_path != NULL)
{
gchar *uri;
uri = g_file_get_uri (default_path);
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (save_dialog),
uri);
gedit_file_chooser_dialog_set_current_folder (save_dialog,
default_path);
g_free (uri);
g_object_unref (default_path);
}
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog),
docname);
gedit_file_chooser_dialog_set_current_name (save_dialog,
docname);
g_free (docname);
}
......@@ -955,7 +951,7 @@ _gedit_cmd_file_save_as_tab (GeditTab *tab,
G_CALLBACK (save_dialog_response_cb),
window);
gtk_widget_show (save_dialog);
gedit_file_chooser_dialog_show (save_dialog);
}
void
......
/*
* gedit-encoding-items.c
* This file is part of gedit
*
* Copyright (C) 2014 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gedit-encoding-items.h"
#include "gedit-settings.h"
#include "gedit-utils.h"
#include <glib/gi18n.h>
struct _GeditEncodingItem
{
const GtkSourceEncoding *encoding;
gchar *name;
};
static GeditEncodingItem *
gedit_encoding_item_new (const GtkSourceEncoding *encoding,
gchar *name)
{
GeditEncodingItem *item = g_slice_new (GeditEncodingItem);
item->encoding = encoding;
item->name = name;
return item;
}
void
gedit_encoding_item_free (GeditEncodingItem *item)
{
if (item == NULL)
{
return;
}
g_free (item->name);
g_slice_free (GeditEncodingItem, item);
}
const GtkSourceEncoding *
gedit_encoding_item_get_encoding (GeditEncodingItem *item)
{
g_return_val_if_fail (item != NULL, NULL);
return item->encoding;
}
const gchar *
gedit_encoding_item_get_name (GeditEncodingItem *item)
{
g_return_val_if_fail (item != NULL, NULL);
return item->name;
}
GSList *
gedit_encoding_items_get (void)
{
GSList *ret = NULL;
const GtkSourceEncoding *utf8_encoding;
const GtkSourceEncoding *current_encoding;
GSettings *enc_settings;
gchar *str;
GSList *encodings;
gchar **enc_strv;
utf8_encoding = gtk_source_encoding_get_utf8 ();
current_encoding = gtk_source_encoding_get_current ();
enc_settings = g_settings_new ("org.gnome.gedit.preferences.encodings");
if (utf8_encoding != current_encoding)
{
str = gtk_source_encoding_to_string (utf8_encoding);
}
else
{
str = g_strdup_printf (_("Current Locale (%s)"),
gtk_source_encoding_get_charset (utf8_encoding));
}
ret = g_slist_prepend (ret, gedit_encoding_item_new (utf8_encoding, str));
if (current_encoding != utf8_encoding &&
current_encoding != NULL)
{
str = g_strdup_printf (_("Current Locale (%s)"),
gtk_source_encoding_get_charset (current_encoding));
ret = g_slist_prepend (ret, gedit_encoding_item_new (current_encoding, str));
}
enc_strv = g_settings_get_strv (enc_settings, GEDIT_SETTINGS_ENCODING_SHOWN_IN_MENU);
encodings = _gedit_utils_encoding_strv_to_list ((const gchar * const *)enc_strv);
g_strfreev (enc_strv);
g_object_unref (enc_settings);
while (encodings)
{
const GtkSourceEncoding *enc = encodings->data;
if (enc != current_encoding &&
enc != utf8_encoding &&
enc != NULL)
{
str = gtk_source_encoding_to_string (enc);
ret = g_slist_prepend (ret, gedit_encoding_item_new (enc, str));
}
encodings = g_slist_delete_link (encodings, encodings);
}
return g_slist_reverse (ret);
}
/* ex:set ts=8 noet: */
/*
* gedit-encoding-items.h
* This file is part of gedit
*
* Copyright (C) 2014 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GEDIT_ENCODING_ITEMS_H__
#define __GEDIT_ENCODING_ITEMS_H__
#include <gtksourceview/gtksource.h>
G_BEGIN_DECLS
typedef struct _GeditEncodingItem GeditEncodingItem;
GSList *gedit_encoding_items_get (void);
void gedit_encoding_item_free (GeditEncodingItem *item);
const GtkSourceEncoding *gedit_encoding_item_get_encoding (GeditEncodingItem *item);
const gchar *gedit_encoding_item_get_name (GeditEncodingItem *item);
G_END_DECLS
#endif /* __GEDIT_ENCODING_ITEMS_H__ */
/* ex:set ts=8 noet: */
......@@ -29,11 +29,10 @@
#include "gedit-encodings-dialog.h"
#include "gedit-settings.h"
#include "gedit-utils.h"
#include "gedit-encoding-items.h"
struct _GeditEncodingsComboBoxPrivate
{
GSettings *enc_settings;
GtkListStore *store;
glong changed_id;
......@@ -108,7 +107,6 @@ gedit_encodings_combo_box_dispose (GObject *object)
GeditEncodingsComboBox *combo = GEDIT_ENCODINGS_COMBO_BOX (object);
g_clear_object (&combo->priv->store);
g_clear_object (&combo->priv->enc_settings);
G_OBJECT_CLASS (gedit_encodings_combo_box_parent_class)->dispose (object);
}
......@@ -288,11 +286,7 @@ update_menu (GeditEncodingsComboBox *menu)
{
GtkListStore *store;
GtkTreeIter iter;
GSList *encodings, *l;
gchar *str;
const GtkSourceEncoding *utf8_encoding;
const GtkSourceEncoding *current_encoding;
gchar **enc_strv;
GSList *encodings;
store = menu->priv->store;
......@@ -313,73 +307,23 @@ update_menu (GeditEncodingsComboBox *menu)
add_separator (store);
}
utf8_encoding = gtk_source_encoding_get_utf8 ();
current_encoding = gtk_source_encoding_get_current ();
encodings = gedit_encoding_items_get ();
if (utf8_encoding != current_encoding)
while (encodings)
{
str = gtk_source_encoding_to_string (utf8_encoding);
}
else
{
str = g_strdup_printf (_("Current Locale (%s)"),
gtk_source_encoding_get_charset (utf8_encoding));
}
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_NAME, str,
COLUMN_ENCODING, utf8_encoding,
COLUMN_CONFIGURE_ROW, FALSE,
-1);
g_free (str);
if (current_encoding != utf8_encoding &&
current_encoding != NULL)
{
str = g_strdup_printf (_("Current Locale (%s)"),
gtk_source_encoding_get_charset (current_encoding));
GeditEncodingItem *item = encodings->data;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_NAME, str,
COLUMN_ENCODING, current_encoding,
COLUMN_NAME, gedit_encoding_item_get_name (item),
COLUMN_ENCODING, gedit_encoding_item_get_encoding (item),
COLUMN_CONFIGURE_ROW, FALSE,
-1);
g_free (str);
gedit_encoding_item_free (item);
encodings = g_slist_delete_link (encodings, encodings);
}
enc_strv = g_settings_get_strv (menu->priv->enc_settings,
GEDIT_SETTINGS_ENCODING_SHOWN_IN_MENU);
encodings = _gedit_utils_encoding_strv_to_list ((const gchar * const *)enc_strv);
g_strfreev (enc_strv);
for (l = encodings; l != NULL; l = g_slist_next (l))
{
const GtkSourceEncoding *enc = l->data;
if (enc != current_encoding &&
enc != utf8_encoding &&
enc != NULL)
{
str = gtk_source_encoding_to_string (enc);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COLUMN_NAME, str,
COLUMN_ENCODING, enc,
COLUMN_CONFIGURE_ROW, FALSE,
-1);
g_free (str);
}
}
g_slist_free (encodings);
add_separator (store);
gtk_list_store_append (store, &iter);
......@@ -402,8 +346,6 @@ gedit_encodings_combo_box_init (GeditEncodingsComboBox *menu)
{
menu->priv = gedit_encodings_combo_box_get_instance_private (menu);
menu->priv->enc_settings = g_settings_new ("org.gnome.gedit.preferences.encodings");
menu->priv->store = gtk_list_store_new (N_COLUMNS,
G_TYPE_STRING,
G_TYPE_POINTER,
......
/*
* gedit-file-chooser-dialog-gtk.c
* This file is part of gedit
*
* Copyright (C) 2005-2007 - Paolo Maggi
* Copyright (C) 2014 - Jesse van den Kieboom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* TODO: Override set_extra_widget */
/* TODO: add encoding property */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <glib/gi18n.h>
#include "gedit-file-chooser-dialog-gtk.h"
#include "gedit-encodings-combo-box.h"
#include "gedit-debug.h"
#include "gedit-enum-types.h"
#include "gedit-settings.h"
#define ALL_FILES _("All Files")
#define ALL_TEXT_FILES _("All Text Files")
struct _GeditFileChooserDialogGtkPrivate
{
GSettings *filter_settings;
GtkWidget *option_menu;
GtkWidget *extra_widget;
GtkWidget *newline_label;
GtkWidget *newline_combo;
GtkListStore *newline_store;
};
static void gedit_file_chooser_dialog_gtk_chooser_init (gpointer g_iface, gpointer iface_data);
G_DEFINE_TYPE_EXTENDED (GeditFileChooserDialogGtk,
gedit_file_chooser_dialog_gtk,
GTK_TYPE_FILE_CHOOSER_DIALOG,
0,
G_IMPLEMENT_INTERFACE (GEDIT_TYPE_FILE_CHOOSER_DIALOG,
gedit_file_chooser_dialog_gtk_chooser_init)
G_ADD_PRIVATE (GeditFileChooserDialogGtk))
static void
chooser_set_encoding (GeditFileChooserDialog *dialog,
const GtkSourceEncoding *encoding)
{
GeditFileChooserDialogGtkPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_GTK (dialog)->priv;
g_return_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (priv->option_menu));
gedit_encodings_combo_box_set_selected_encoding (GEDIT_ENCODINGS_COMBO_BOX (priv->option_menu),
encoding);
}
static const GtkSourceEncoding *
chooser_get_encoding (GeditFileChooserDialog *dialog)
{
GeditFileChooserDialogGtkPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_GTK (dialog)->priv;
g_return_val_if_fail (GEDIT_IS_ENCODINGS_COMBO_BOX (priv->option_menu), NULL);
g_return_val_if_fail ((gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_OPEN ||
gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE), NULL);
return gedit_encodings_combo_box_get_selected_encoding (
GEDIT_ENCODINGS_COMBO_BOX (priv->option_menu));
}
static void
set_enum_combo (GtkComboBox *combo,
gint value)
{
GtkTreeIter iter;
GtkTreeModel *model;
model = gtk_combo_box_get_model (combo);
if (!gtk_tree_model_get_iter_first (model, &iter))
{
return;
}
do
{
gint nt;
gtk_tree_model_get (model, &iter, 1, &nt, -1);
if (value == nt)
{
gtk_combo_box_set_active_iter (combo, &iter);
break;
}
} while (gtk_tree_model_iter_next (model, &iter));
}
static void
chooser_set_newline_type (GeditFileChooserDialog *dialog,
GtkSourceNewlineType newline_type)
{
GeditFileChooserDialogGtkPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_GTK (dialog)->priv;
g_return_if_fail (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE);
set_enum_combo (GTK_COMBO_BOX (priv->newline_combo), newline_type);
}
static GtkSourceNewlineType
chooser_get_newline_type (GeditFileChooserDialog *dialog)
{
GeditFileChooserDialogGtkPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_GTK (dialog)->priv;
GtkTreeIter iter;
GtkSourceNewlineType newline_type;
g_return_val_if_fail (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_SOURCE_NEWLINE_TYPE_DEFAULT);
gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->newline_combo),
&iter);
gtk_tree_model_get (GTK_TREE_MODEL (priv->newline_store),
&iter,
1,
&newline_type,
-1);
return newline_type;
}
static void
chooser_set_current_folder (GeditFileChooserDialog *dialog,
GFile *folder)
{
gchar *uri = NULL;
if (folder != NULL)
{
uri = g_file_get_uri (folder);
}
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri);
g_free (uri);
}
static void
chooser_set_current_name (GeditFileChooserDialog *dialog,
const gchar *name)
{
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), name);
}
</