Files
wmaker/WPrefs.app/Expert.c
T

132 lines
4.0 KiB
C
Raw Normal View History

1998-09-29 22:36:29 +00:00
/* Expert.c- expert user options
2004-10-12 21:28:27 +00:00
*
1998-10-21 14:43:47 +00:00
* WPrefs - Window Maker Preferences Program
2004-10-12 21:28:27 +00:00
*
2003-01-16 23:30:45 +00:00
* Copyright (c) 1998-2003 Alfredo K. Kojima
2004-10-12 21:28:27 +00:00
*
1998-09-29 22:36:29 +00:00
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
2004-10-12 21:28:27 +00:00
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1998-09-29 22:36:29 +00:00
* USA.
*/
#include "WPrefs.h"
typedef struct _Panel {
WMBox *box;
1999-04-25 01:49:46 +00:00
char *sectionName;
char *description;
1998-09-29 22:36:29 +00:00
CallbackRec callbacks;
2004-10-12 21:28:27 +00:00
WMWidget *parent;
1998-09-29 22:36:29 +00:00
1999-09-17 21:03:54 +00:00
WMButton *swi[8];
1998-09-29 22:36:29 +00:00
} _Panel;
#define ICON_FILE "expert"
static void
showData(_Panel *panel)
{
WMUserDefaults *udb = WMGetStandardUserDefaults();
WMSetButtonSelected(panel->swi[0], GetBoolForKey("DisableMiniwindows"));
WMSetButtonSelected(panel->swi[1], WMGetUDBoolForKey(udb, "NoXSetStuff"));
WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
2004-10-19 02:37:58 +00:00
WMSetButtonSelected(panel->swi[4], GetBoolForKey("DontConfirmKill"));
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
1998-09-29 22:36:29 +00:00
}
static void
createPanel(Panel *p)
{
_Panel *panel = (_Panel*)p;
int i;
panel->box = WMCreateBox(panel->parent);
2001-04-25 02:03:08 +00:00
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
1998-09-29 22:36:29 +00:00
2004-10-19 02:37:58 +00:00
for (i=0; i<7; i++) {
2004-10-12 21:28:27 +00:00
panel->swi[i] = WMCreateSwitchButton(panel->box);
WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
WMMoveWidget(panel->swi[i], 20, 20+i*25);
1998-09-29 22:36:29 +00:00
}
2004-10-12 21:28:27 +00:00
WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
2001-05-04 02:04:13 +00:00
WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)."));
WMSetButtonText(panel->swi[2], _("Automatically save session when exiting Window Maker."));
WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects."));
2004-10-19 02:37:58 +00:00
WMSetButtonText(panel->swi[4], _("Disable confirmation panel for the Kill command."));
WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
2004-10-19 02:37:58 +00:00
WMSetButtonEnabled(panel->swi[6], True);
1998-09-29 22:36:29 +00:00
WMRealizeWidget(panel->box);
WMMapSubwidgets(panel->box);
2004-10-12 21:28:27 +00:00
1998-09-29 22:36:29 +00:00
showData(panel);
}
static void
storeDefaults(_Panel *panel)
{
WMUserDefaults *udb = WMGetStandardUserDefaults();
SetBoolForKey(WMGetButtonSelected(panel->swi[0]), "DisableMiniwindows");
WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[1]), "NoXSetStuff");
1998-09-29 22:36:29 +00:00
SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
2004-10-19 02:37:58 +00:00
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DontConfirmKill");
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
1998-09-29 22:36:29 +00:00
}
Panel*
InitExpert(WMScreen *scr, WMWidget *parent)
1998-09-29 22:36:29 +00:00
{
_Panel *panel;
panel = wmalloc(sizeof(_Panel));
memset(panel, 0, sizeof(_Panel));
panel->sectionName = _("Expert User Preferences");
1999-04-25 01:49:46 +00:00
panel->description = _("Options for people who know what they're doing...\n"
2004-10-12 21:28:27 +00:00
"Also have some other misc. options.");
1999-04-25 01:49:46 +00:00
panel->parent = parent;
1998-09-29 22:36:29 +00:00
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeDefaults;
2004-10-12 21:28:27 +00:00
1998-09-29 22:36:29 +00:00
AddSection(panel, ICON_FILE);
return panel;
}
2004-10-12 21:28:27 +00:00