Use Reload button for reload dialog; Share on_reload_as_activate code for reloading
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@738 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
ff5d2fd841
commit
90047be4d7
@ -3,6 +3,12 @@
|
||||
* src/keyfile.c: Fix a small memory leak in configuration_load.
|
||||
* src/dialogs.c: Change Don't save button icon and add mnemonic.
|
||||
* src/main.c: Fix building on win32 - thanks to Củ Văn Chuối.
|
||||
* src/dialogs.c, src/dialogs.h:
|
||||
Add dialogs_show_question_full for custom buttons and extra text.
|
||||
Don't show message dialogs in the window manager taskbar.
|
||||
* src/utils.c: Use Reload button for utils_check_disk_status dialog.
|
||||
* src/callbacks.c: Use Reload button for reload dialog.
|
||||
Share on_reload_as_activate code for reloading.
|
||||
|
||||
|
||||
2006-08-17 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
@ -196,8 +196,9 @@ on_exit_clicked (GtkWidget *widget, gpointer gdata)
|
||||
{
|
||||
if (app->pref_main_confirm_exit)
|
||||
{
|
||||
if (dialogs_show_question(_("Do you really want to quit?")) &&
|
||||
on_close_all1_activate(NULL, NULL)) destroyapp(NULL, gdata);
|
||||
if (dialogs_show_question_full(GTK_STOCK_QUIT, GTK_STOCK_CANCEL, NULL,
|
||||
_("Do you really want to quit?")) && on_close_all1_activate(NULL, NULL))
|
||||
destroyapp(NULL, gdata);
|
||||
else app->quitting = FALSE;
|
||||
}
|
||||
else
|
||||
@ -211,7 +212,9 @@ on_exit_clicked (GtkWidget *widget, gpointer gdata)
|
||||
{
|
||||
if (app->pref_main_confirm_exit)
|
||||
{
|
||||
if (dialogs_show_question(_("Do you really want to quit?"))) destroyapp(NULL, gdata);
|
||||
if (dialogs_show_question(GTK_STOCK_QUIT, GTK_STOCK_CANCEL, NULL,
|
||||
_("Do you really want to quit?")))
|
||||
destroyapp(NULL, gdata);
|
||||
else app->quitting = FALSE;
|
||||
}
|
||||
else
|
||||
@ -488,20 +491,38 @@ on_toolbutton19_clicked (GtkToolButton *toolbutton,
|
||||
void
|
||||
on_toolbutton23_clicked (GtkToolButton *toolbutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
on_reload_as_activate(NULL, GINT_TO_POINTER(-1));
|
||||
}
|
||||
|
||||
|
||||
// also used for reloading when user_data is -1
|
||||
void
|
||||
on_reload_as_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
gchar *basename;
|
||||
gint i = GPOINTER_TO_INT(user_data);
|
||||
gchar *charset = NULL;
|
||||
|
||||
if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_name == NULL) return;
|
||||
|
||||
basename = g_path_get_basename(doc_list[idx].file_name);
|
||||
if (dialogs_show_question(_
|
||||
("Are you sure you want to reload '%s'?\nAny unsaved changes will be lost."),
|
||||
basename))
|
||||
if (idx < 0 || ! doc_list[idx].is_valid || doc_list[idx].file_name == NULL)
|
||||
return;
|
||||
if (i >= 0)
|
||||
{
|
||||
document_reload_file(idx, NULL);
|
||||
if (i >= GEANY_ENCODINGS_MAX || encodings[i].charset == NULL) return;
|
||||
charset = encodings[i].charset;
|
||||
}
|
||||
|
||||
basename = g_path_get_basename(doc_list[idx].file_name);
|
||||
if (dialogs_show_question_full(_("_Reload"), GTK_STOCK_CANCEL,
|
||||
_("Any unsaved changes will be lost."),
|
||||
_("Are you sure you want to reload '%s'?"), basename))
|
||||
{
|
||||
document_reload_file(idx, charset);
|
||||
if (charset != NULL)
|
||||
utils_update_statusbar(idx, -1);
|
||||
}
|
||||
g_free(basename);
|
||||
}
|
||||
|
||||
@ -2346,29 +2367,6 @@ on_encoding_change (GtkMenuItem *menuitem,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_reload_as_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
gchar *basename;
|
||||
gint i = GPOINTER_TO_INT(user_data);
|
||||
|
||||
if (idx < 0 || ! doc_list[idx].is_valid || doc_list[idx].file_name == NULL ||
|
||||
i < 0 || i >= GEANY_ENCODINGS_MAX || encodings[i].charset == NULL)
|
||||
return;
|
||||
|
||||
basename = g_path_get_basename(doc_list[idx].file_name);
|
||||
if (dialogs_show_question(_
|
||||
("Are you sure you want to reload '%s'?\nAny unsaved changes will be lost."),
|
||||
basename))
|
||||
{
|
||||
document_reload_file(idx, encodings[i].charset);
|
||||
utils_update_statusbar(idx, -1);
|
||||
}
|
||||
g_free(basename);
|
||||
}
|
||||
|
||||
void
|
||||
on_print1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user