From 60bcde41ae44d90615930e7ce2e88e8b8c724274 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Wed, 23 Nov 2011 13:13:58 +0100 Subject: [PATCH] add menu item for saving preferences to disk --- src/fe-gtk/menu.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 816c93ec..8ba73a61 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -1121,6 +1121,21 @@ usermenu_update (void) } } +static void +menu_saveconf (void) +{ + session *sess = current_sess; + + if (save_config ()) + { + PrintText (sess, "Preferences have been saved successfully.\n"); + } + else + { + PrintText (sess, "Error saving preferences.\n"); + } +} + static void menu_newserver_window (GtkWidget * wid, gpointer none) { @@ -1638,6 +1653,8 @@ static struct mymenu mymenu[] = { {N_("Userlist Popup..."), menu_ulpopup, 0, M_MENUITEM, 0, 0, 1}, {0, 0, 0, M_END, 0, 0, 0}, /* 53 */ + {N_("Save Settings to Disk"), menu_saveconf, GTK_STOCK_SAVE, M_MENUSTOCK, 0, 0, 1}, + {N_("_Window"), 0, 0, M_NEWMENU, 0, 0, 1}, {N_("Ban List..."), menu_banlist, 0, M_MENUITEM, 0, 0, 1}, {N_("Character Chart..."), ascii_open, 0, M_MENUITEM, 0, 0, 1}, @@ -1652,11 +1669,11 @@ static struct mymenu mymenu[] = { {N_("Reset Marker Line"), menu_resetmarker, 0, M_MENUITEM, 0, 0, 1, GDK_m}, {N_("_Copy Selection"), menu_copy_selection, 0, M_MENUITEM, 0, 0, 1, GDK_C}, {N_("C_lear Text"), menu_flushbuffer, GTK_STOCK_CLEAR, M_MENUSTOCK, 0, 0, 1, GDK_l}, -#define SEARCH_OFFSET 68 +#define SEARCH_OFFSET 69 {N_("Search Text..."), menu_search, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_f}, {N_("Save Text..."), menu_savebuffer, GTK_STOCK_SAVE, M_MENUSTOCK, 0, 0, 1}, - {N_("_Help"), 0, 0, M_NEWMENU, 0, 0, 1}, /* 70 */ + {N_("_Help"), 0, 0, M_NEWMENU, 0, 0, 1}, /* 71 */ {N_("_Contents"), menu_docs, GTK_STOCK_HELP, M_MENUSTOCK, 0, 0, 1, GDK_F1}, #if 0 {N_("Check for updates"), menu_update, 0, M_MENUITEM, 0, 1},