changed indentation to use spaces only
[wmaker-crm.git] / WPrefs.app / Expert.c
blob3458513655cc568670ccbd68414d5204e1bdb161
1 /* Expert.c- expert user options
3 * WPrefs - Window Maker Preferences Program
5 * Copyright (c) 1998-2003 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 * USA.
24 #include "WPrefs.h"
26 typedef struct _Panel {
27 WMBox *box;
28 char *sectionName;
30 char *description;
32 CallbackRec callbacks;
34 WMWidget *parent;
36 WMButton *swi[8];
38 } _Panel;
42 #define ICON_FILE "expert"
45 static void
46 showData(_Panel *panel)
48 WMUserDefaults *udb = WMGetStandardUserDefaults();
50 WMSetButtonSelected(panel->swi[0], GetBoolForKey("DisableMiniwindows"));
51 WMSetButtonSelected(panel->swi[1], WMGetUDBoolForKey(udb, "NoXSetStuff"));
52 WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
53 WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
54 WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
55 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
56 WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
57 //if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
58 WMSetButtonSelected(panel->swi[7], GetBoolForKey("AntialiasedText"));
62 static void
63 createPanel(Panel *p)
65 _Panel *panel = (_Panel*)p;
66 int i;
68 panel->box = WMCreateBox(panel->parent);
69 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
71 for (i=0; i<8; i++) {
72 panel->swi[i] = WMCreateSwitchButton(panel->box);
73 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
74 WMMoveWidget(panel->swi[i], 20, 20+i*25);
77 WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for miniaturized windows). For use with KDE/GNOME."));
78 WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)."));
79 WMSetButtonText(panel->swi[2], _("Automatically save session when exiting Window Maker."));
80 WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects."));
81 WMSetButtonText(panel->swi[4], _("Use Windoze style cycling."));
82 WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command."));
83 WMSetButtonText(panel->swi[6], _("Disable selection animation for selected icons."));
84 WMSetButtonText(panel->swi[7], _("Smooth font edges (needs restart)."));
86 //if (!WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
87 WMSetButtonEnabled(panel->swi[7], True);
89 WMRealizeWidget(panel->box);
90 WMMapSubwidgets(panel->box);
92 showData(panel);
96 static void
97 storeDefaults(_Panel *panel)
99 WMUserDefaults *udb = WMGetStandardUserDefaults();
101 SetBoolForKey(WMGetButtonSelected(panel->swi[0]), "DisableMiniwindows");
103 WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[1]), "NoXSetStuff");
105 SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
106 SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
107 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindozeCycling");
108 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
109 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
110 //if (WMHasAntialiasingSupport(WMWidgetScreen(panel->box)))
111 SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "AntialiasedText");
115 Panel*
116 InitExpert(WMScreen *scr, WMWidget *parent)
118 _Panel *panel;
120 panel = wmalloc(sizeof(_Panel));
121 memset(panel, 0, sizeof(_Panel));
123 panel->sectionName = _("Expert User Preferences");
125 panel->description = _("Options for people who know what they're doing...\n"
126 "Also have some other misc. options.");
128 panel->parent = parent;
130 panel->callbacks.createWidgets = createPanel;
131 panel->callbacks.updateDomain = storeDefaults;
133 AddSection(panel, ICON_FILE);
135 return panel;