mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
settings_save() now sends "setup saved" signal - patch by peder@ifi.uio.no
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2003 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
8f461f72e6
commit
a9a380fd54
@ -584,7 +584,7 @@ int settings_reread(const char *fname)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int settings_save(const char *fname)
|
||||
int settings_save(const char *fname, int autosave)
|
||||
{
|
||||
char *str;
|
||||
int error;
|
||||
@ -601,6 +601,7 @@ int settings_save(const char *fname)
|
||||
signal_emit("gui dialog", 2, "error", str);
|
||||
g_free(str);
|
||||
}
|
||||
signal_emit("setup saved", 2, fname, GINT_TO_POINTER(autosave);
|
||||
return !error;
|
||||
}
|
||||
|
||||
@ -613,7 +614,7 @@ static void sig_autosave(void)
|
||||
return;
|
||||
|
||||
if (!irssi_config_is_changed(NULL))
|
||||
settings_save(NULL);
|
||||
settings_save(NULL, TRUE);
|
||||
else {
|
||||
fname = g_strconcat(mainconfig->fname, ".autosave", NULL);
|
||||
str = g_strdup_printf("Configuration file was modified "
|
||||
@ -624,7 +625,7 @@ static void sig_autosave(void)
|
||||
signal_emit("gui dialog", 2, "warning", str);
|
||||
g_free(str);
|
||||
|
||||
settings_save(fname);
|
||||
settings_save(fname, TRUE);
|
||||
g_free(fname);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ void settings_clean_invalid(void);
|
||||
|
||||
/* if `fname' is NULL, the default is used */
|
||||
int settings_reread(const char *fname);
|
||||
int settings_save(const char *fname);
|
||||
int settings_save(const char *fname, int autosave);
|
||||
int irssi_config_is_changed(const char *fname);
|
||||
|
||||
void settings_init(void);
|
||||
|
@ -258,7 +258,7 @@ static void cmd_reload(const char *data)
|
||||
|
||||
static void settings_save_fe(const char *fname)
|
||||
{
|
||||
if (settings_save(fname)) {
|
||||
if (settings_save(fname, FALSE /* not autosaved */)) {
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
|
||||
TXT_CONFIG_SAVED, fname);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user