2 * This file is part of DrNokSnes
4 * Copyright (C) 2005 INdT - Instituto Nokia de Tecnologia
5 * http://www.indt.org/maemo
6 * Copyright (C) 2009 Javier S. Pedro <maemo@javispedro.com>
8 * This software is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This software is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this software; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 #include <hildon/hildon-file-chooser-dialog.h>
31 static gchar * cur_save_filename = NULL;
35 if (cur_save_filename) {
36 g_free(cur_save_filename);
37 cur_save_filename = NULL;
41 static gchar * show_dialog(GtkWindow* parent, GtkFileChooserAction action)
44 GtkFileFilter * filter;
45 gchar * filename = NULL;
47 filter = gtk_file_filter_new();
48 gtk_file_filter_add_pattern(filter, "*.snsg");
50 dialog = hildon_file_chooser_dialog_new_with_properties(GTK_WINDOW(parent),
51 "action", action, "filter", filter, NULL);
55 gtk_widget_show_all(GTK_WIDGET(dialog));
56 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) {
57 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
60 gtk_widget_destroy(dialog);
65 void save_load(GtkWindow* parent)
67 gchar * filename = show_dialog(parent, GTK_FILE_CHOOSER_ACTION_OPEN);
72 void save_save(GtkWindow* parent)
74 if (!cur_save_filename) {
78 // TODO: Something again
81 void save_save_as(GtkWindow* parent)
83 gchar * filename = show_dialog(parent, GTK_FILE_CHOOSER_ACTION_SAVE);
85 // TODO: Something again