From 14cbf4d5b64658de74d810315087bcd29ab4c49e Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 19 Mar 2005 11:10:12 +0000 Subject: [PATCH] Prepare for theme version bump. SVN revision: 13788 --- src/backgrounds.c | 3 ++- src/buttons.c | 3 ++- src/config.c | 34 ++++++++++++++-------------------- src/main.c | 2 +- src/session.c | 2 +- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/backgrounds.c b/src/backgrounds.c index 5e80c4e9..e6128bcf 100644 --- a/src/backgrounds.c +++ b/src/backgrounds.c @@ -1304,7 +1304,8 @@ BackgroundsSighan(int sig, void *prm __UNUSED__) break; case ESIGNAL_EXIT: - BackgroundsConfigSave(); + if (Mode.wm.save_ok) + BackgroundsConfigSave(); break; } } diff --git a/src/buttons.c b/src/buttons.c index ea53cc3a..d7e239b1 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -1129,7 +1129,8 @@ ButtonsSighan(int sig, void *prm __UNUSED__) break; case ESIGNAL_EXIT: - ButtonsConfigSave(); + if (Mode.wm.save_ok) + ButtonsConfigSave(); break; } } diff --git a/src/config.c b/src/config.c index 37e449ba..7b40294c 100644 --- a/src/config.c +++ b/src/config.c @@ -241,7 +241,7 @@ ConfigFileRead(FILE * fs) int i1, i2, fields; char s[FILEPATH_LEN_MAX]; int e_cfg_ver = 0; - int min_e_cfg_ver = 0; + int max_e_cfg_ver = 1; while (GetLine(s, sizeof(s), fs)) { @@ -276,32 +276,26 @@ ConfigFileRead(FILE * fs) } if (i2 == CONFIG_OPEN) { - if (e_cfg_ver != min_e_cfg_ver) + if (e_cfg_ver > max_e_cfg_ver) { AlertX(_("Theme versioning ERROR"), _("Restart with Defaults"), " ", _("Abort and Exit"), _("ERROR:\n" "\n" - "The configuration for the theme you are " - "running is\n" - "incompatible. It's config revision is %i. " - "It needs to\n" - "be marked as being revision %i\n" "\n" - "Please contact the theme author or " - "maintainer and\n" - "inform them that in order for their theme " - "to function\n" - "with this version of Enlightenment, they " - "have to\n" - "update it to the current settings, and " - "then match\n" "the revision number.\n" "\n" - "If the theme revision is higher than " - "Enlightenment's\n" - "it may be that you haven't upgraded " - "Enlightenment for\n" + "The configuration for the theme you are running is\n" + "incompatible. It's config revision is %i.\n" + "It needs to be marked as being revision <= %i\n" + "\n" + "Please contact the theme author or maintainer and\n" + "inform them that in order for their theme to function\n" + "with this version of Enlightenment, they have to\n" + "update it to the current settings, and then match\n" + "the revision number.\n" "\n" + "If the theme revision is higher than Enlightenment's\n" + "it may be that you haven't upgraded Enlightenment for\n" "a while and this theme takes advantages of new\n" "features in Enlightenment in new versions.\n"), - e_cfg_ver, min_e_cfg_ver); + e_cfg_ver, max_e_cfg_ver); SessionExit(EEXIT_THEME, "DEFAULT"); } else diff --git a/src/main.c b/src/main.c index 1aca96b5..477142cd 100644 --- a/src/main.c +++ b/src/main.c @@ -284,7 +284,7 @@ main(int argc, char **argv) StartupWindowsOpen(); Conf.startup.firsttime = 0; - Mode.wm.save_ok = 1; + Mode.wm.save_ok = Conf.autosave; Mode.wm.startup = 0; autosave(); diff --git a/src/session.c b/src/session.c index c57e4108..035d8bfd 100644 --- a/src/session.c +++ b/src/session.c @@ -296,7 +296,7 @@ MatchEwinToSM(EWin * ewin) void autosave(void) { - if (!Mode.wm.save_ok || !Conf.autosave) + if (!Mode.wm.save_ok) return; if (EventDebug(EDBUG_TYPE_SESSION))