forked from e16/e16
1
0
Fork 0

Move session settings to separate dialog.

SVN revision: 18421
This commit is contained in:
Kim Woelders 2005-11-10 21:39:29 +00:00
parent b856868821
commit 0529d5c3db
5 changed files with 72 additions and 27 deletions

View File

@ -63,6 +63,7 @@ ADD_MENU_TEXT_ITEM("Special FX Settings ...", __A_CMD, "fx cfg")
ADD_MENU_TEXT_ITEM("Desktop Background Settings ...", __A_CMD, "bg cfg")
ADD_MENU_TEXT_ITEM("Theme Transparency Settings ...", __A_CMD, "trans cfg")
ADD_MENU_TEXT_ITEM("Composite Settings ...", __A_CMD, "cm cfg");
ADD_MENU_TEXT_ITEM("Session Settings ...", __A_CMD, "misc cfg session");
ADD_MENU_TEXT_ITEM("Miscellaneous Settings ...", __A_CMD, "misc cfg misc");
END_MENU

View File

@ -1148,6 +1148,7 @@ void SessionGetInfo(EWin * ewin, Atom atom_change);
void SetSMID(const char *smid);
void MatchEwinToSM(EWin * ewin);
void autosave(void);
void SettingsSession(void);
/* settings.c */
void SettingsMoveResize(void);

View File

@ -203,6 +203,8 @@ MiscIpcConfig(const char *params, Client * c __UNUSED__)
SettingsPlacement();
else if (!strncmp(prm, "remember", 2))
SettingsRemember();
else if (!strncmp(prm, "session", 2))
SettingsSession();
}
else if (!strncmp(cmd, "arrange", 3))
{

View File

@ -1063,3 +1063,71 @@ SessionHelper(int when)
break;
}
}
/*
* Session dialog
*/
static char tmp_session_script;
static char tmp_logout_dialog;
static char tmp_reboot_halt;
static void
CB_ConfigureSession(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
{
if (val < 2)
{
Conf.session.enable_script = tmp_session_script;
Conf.session.enable_logout_dialog = tmp_logout_dialog;
Conf.session.enable_reboot_halt = tmp_reboot_halt;
}
autosave();
}
void
SettingsSession(void)
{
Dialog *d;
DItem *table, *di;
d = FindItem("CONFIGURE_SESSION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
return;
}
SoundPlay("SOUND_SETTINGS_SESSION");
tmp_session_script = Conf.session.enable_script;
tmp_logout_dialog = Conf.session.enable_logout_dialog;
tmp_reboot_halt = Conf.session.enable_reboot_halt;
d = DialogCreate("CONFIGURE_SESSION");
DialogSetTitle(d, _("Session Settings"));
table = DialogInitItem(d);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
if (Conf.dialogs.headers)
DialogAddHeader(d, "pix/miscellaneous.png",
_("Enlightenment Session\n" "Settings Dialog\n"));
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Session Script"));
DialogItemCheckButtonSetPtr(di, &tmp_session_script);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Logout Dialog"));
DialogItemCheckButtonSetPtr(di, &tmp_logout_dialog);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Reboot/Halt on Logout"));
DialogItemCheckButtonSetPtr(di, &tmp_reboot_halt);
DialogAddFooter(d, DLG_OAC, CB_ConfigureSession);
ShowDialog(d);
}

View File

@ -479,9 +479,6 @@ SettingsAutoRaise(void)
static char tmp_dialog_headers;
static char tmp_button_image;
static char tmp_session_script;
static char tmp_logout_dialog;
static char tmp_reboot_halt;
static char tmp_animate_startup;
static char tmp_saveunders;
@ -492,9 +489,6 @@ CB_ConfigureMiscellaneous(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
{
Conf.dialogs.headers = tmp_dialog_headers;
Conf.dialogs.button_image = tmp_button_image;
Conf.session.enable_script = tmp_session_script;
Conf.session.enable_logout_dialog = tmp_logout_dialog;
Conf.session.enable_reboot_halt = tmp_reboot_halt;
Conf.startup.animate = tmp_animate_startup;
Conf.save_under = tmp_saveunders;
}
@ -519,9 +513,6 @@ SettingsMiscellaneous(void)
tmp_dialog_headers = Conf.dialogs.headers;
tmp_button_image = Conf.dialogs.button_image;
tmp_session_script = Conf.session.enable_script;
tmp_logout_dialog = Conf.session.enable_logout_dialog;
tmp_reboot_halt = Conf.session.enable_reboot_halt;
tmp_animate_startup = Conf.startup.animate;
tmp_saveunders = Conf.save_under;
@ -548,24 +539,6 @@ SettingsMiscellaneous(void)
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Session Script"));
DialogItemCheckButtonSetPtr(di, &tmp_session_script);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Logout Dialog"));
DialogItemCheckButtonSetPtr(di, &tmp_logout_dialog);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable Reboot/Halt on Logout"));
DialogItemCheckButtonSetPtr(di, &tmp_reboot_halt);
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Enable sliding startup windows"));