diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-08-06 19:57:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-08-06 19:57:49 (GMT) |
commit | facec716100f598a8694889274a4589c75c14722 (patch) | |
tree | 7f9d68ec673b8a11c700f4784cc8e65d127a4382 /src/gui | |
parent | 9be2705b3214cc7bd6daaf7b498a4df155f2dc46 (diff) |
Improved projects managment.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@257 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/menus/project.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c index 52a2fbb..7e9fc3f 100644 --- a/src/gui/menus/project.c +++ b/src/gui/menus/project.c @@ -26,6 +26,9 @@ #include <i18n.h> +#include <libgen.h> +#include <malloc.h> +#include <string.h> #include "../editem-int.h" @@ -170,6 +173,7 @@ void update_menu_project_for_project(GtkWidget *widget, GStudyProject *project, static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) { GtkWidget *dialog; /* Boîte à afficher */ + char *dir; /* Répertoire courant */ gchar *filename; /* Nom du fichier à intégrer */ GOpenidaBinary *binary; /* Représentation chargée */ @@ -180,6 +184,14 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar) GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + if (g_study_project_get_filename(get_current_project()) != NULL) + { + dir = strdup(g_study_project_get_filename(get_current_project())); + dir = dirname(dir); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), dir); + free(dir); + } + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); |