Revision: 2254 http://geany.svn.sourceforge.net/geany/?rev=2254&view=rev Author: eht16 Date: 2008-02-12 07:50:22 -0800 (Tue, 12 Feb 2008)
Log Message: ----------- Fix compiler warnings. Improve Save As dialog usability problems.
Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-02-12 15:49:54 UTC (rev 2253) +++ trunk/ChangeLog 2008-02-12 15:50:22 UTC (rev 2254) @@ -10,6 +10,12 @@ Improve filename of created symlink to the socket file. * src/document.c: Don't force unique line ending characters when saving files to avoid unexpected saving behaviour. + * src/keybindings.c, src/keybindings.h, src/prefs.c: + Use a modifiers mask to ignore unwanted modifiers(caps lock, + num lock) when handling key presses (maybe fixes #1891276). + * src/dialogs.c: + Fix compiler warnings. + Improve Save As dialog usability problems.
2008-02-11 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2008-02-12 15:49:54 UTC (rev 2253) +++ trunk/src/dialogs.c 2008-02-12 15:50:22 UTC (rev 2254) @@ -525,24 +525,34 @@ static gboolean gtk_show_save_as(const gchar *initdir) { gint idx = document_get_cur_idx(), resp; + gboolean folder_set = FALSE;
if (ui_widgets.save_filesel == NULL) create_save_file_dialog();
- if (initdir && g_path_is_absolute(initdir)) - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ui_widgets.save_filesel), - initdir); + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(ui_widgets.save_filesel));
- // If the current document has a filename we use that as the default. if (doc_list[idx].file_name != NULL) { - gchar *locale_filename = utils_get_locale_from_utf8(doc_list[idx].file_name); - if (g_path_is_absolute(locale_filename)) - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(ui_widgets.save_filesel), locale_filename); + if (g_path_is_absolute(doc_list[idx].file_name)) + { + gchar *locale_filename = utils_get_locale_from_utf8(doc_list[idx].file_name); + gchar *locale_basename = g_path_get_basename(locale_filename); + gchar *locale_dirname = g_path_get_dirname(locale_filename); + + folder_set = TRUE; + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ui_widgets.save_filesel), + locale_dirname); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(ui_widgets.save_filesel), + locale_basename); + + g_free(locale_filename); + g_free(locale_basename); + g_free(locale_dirname); + } else gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(ui_widgets.save_filesel), doc_list[idx].file_name); - g_free(locale_filename); } else { @@ -555,12 +565,15 @@ else fname = g_strdup(GEANY_STRING_UNTITLED);
- gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(ui_widgets.save_filesel)); gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(ui_widgets.save_filesel), fname);
g_free(fname); }
+ // if the folder wasn't set so far, we set it to the given directory + if (! folder_set && initdir != NULL && g_path_is_absolute(initdir)) + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ui_widgets.save_filesel), initdir); + // Run the dialog synchronously, pausing this function call resp = gtk_dialog_run(GTK_DIALOG(ui_widgets.save_filesel)); return (resp == GTK_RESPONSE_ACCEPT); @@ -797,7 +810,7 @@ gint response, GtkWidget *entry) { - gboolean persistent = (gboolean) g_object_get_data(G_OBJECT(dialog), "has_combo"); + gboolean persistent = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "has_combo"));
if (response == GTK_RESPONSE_ACCEPT) { @@ -878,7 +891,7 @@ gtk_widget_set_name(dialog, "GeanyDialog"); gtk_box_set_spacing(GTK_BOX(vbox), 6);
- g_object_set_data(G_OBJECT(dialog), "has_combo", (gpointer) persistent); + g_object_set_data(G_OBJECT(dialog), "has_combo", GINT_TO_POINTER(persistent)); g_object_set_data(G_OBJECT(dialog), "input_cb", (gpointer) input_cb);
add_input_widgets(dialog, vbox, label_text, default_text, persistent);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.