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,
25 typedef struct _Panel
{
31 CallbackRec callbacks
;
39 #define ICON_FILE "expert"
41 static void showData(_Panel
* panel
)
43 WMUserDefaults
*udb
= WMGetStandardUserDefaults();
45 WMSetButtonSelected(panel
->swi
[0], GetBoolForKey("DisableMiniwindows"));
46 WMSetButtonSelected(panel
->swi
[1], WMGetUDBoolForKey(udb
, "NoXSetStuff"));
47 WMSetButtonSelected(panel
->swi
[2], GetBoolForKey("SaveSessionOnExit"));
48 WMSetButtonSelected(panel
->swi
[3], GetBoolForKey("UseSaveUnders"));
49 WMSetButtonSelected(panel
->swi
[4], GetBoolForKey("DontConfirmKill"));
50 WMSetButtonSelected(panel
->swi
[5], GetBoolForKey("DisableBlinking"));
51 WMSetButtonSelected(panel
->swi
[6], GetBoolForKey("AntialiasedText"));
52 WMSetButtonSelected(panel
->swi
[7], GetBoolForKey("SingleClickLaunch"));
53 WMSetButtonSelected(panel
->swi
[8], GetBoolForKey("CycleActiveHeadOnly"));
54 WMSetButtonSelected(panel
->swi
[9], GetBoolForKey("ShowClipTitle"));
57 static void createPanel(Panel
* p
)
59 _Panel
*panel
= (_Panel
*) p
;
64 panel
->box
= WMCreateBox(panel
->parent
);
65 WMSetViewExpandsToParent(WMWidgetView(panel
->box
), 2, 2, 2, 2);
67 sv
= WMCreateScrollView(panel
->box
);
68 WMResizeWidget(sv
, 500, 215);
69 WMMoveWidget(sv
, 12, 10);
70 WMSetScrollViewRelief(sv
, WRSunken
);
71 WMSetScrollViewHasVerticalScroller(sv
, True
);
72 WMSetScrollViewHasHorizontalScroller(sv
, False
);
74 f
= WMCreateFrame(panel
->box
);
75 WMResizeWidget(f
, 495, sizeof(panel
->swi
) / sizeof(char *) * 25 + 8);
76 WMSetFrameRelief(f
, WRFlat
);
78 for (i
= 0; i
< sizeof(panel
->swi
) / sizeof(char *); i
++) {
79 panel
->swi
[i
] = WMCreateSwitchButton(f
);
80 WMResizeWidget(panel
->swi
[i
], FRAME_WIDTH
- 40, 25);
81 WMMoveWidget(panel
->swi
[i
], 5, 5 + i
* 25);
84 WMSetButtonText(panel
->swi
[0],
85 _("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
86 WMSetButtonText(panel
->swi
[1], _("Do not set non-WindowMaker specific parameters (do not use xset)."));
87 WMSetButtonText(panel
->swi
[2], _("Automatically save session when exiting Window Maker."));
88 WMSetButtonText(panel
->swi
[3], _("Use SaveUnder in window frames, icons, menus and other objects."));
89 WMSetButtonText(panel
->swi
[4], _("Disable confirmation panel for the Kill command."));
90 WMSetButtonText(panel
->swi
[5], _("Disable selection animation for selected icons."));
91 WMSetButtonText(panel
->swi
[6], _("Smooth font edges (needs restart)."));
92 WMSetButtonText(panel
->swi
[7], _("Launch applications and restore windows with a single click."));
93 WMSetButtonText(panel
->swi
[8], _("Cycle windows only on the active head."));
94 WMSetButtonText(panel
->swi
[9], _("Show workspace title on Clip."));
96 WMSetButtonEnabled(panel
->swi
[6], True
);
98 WMMapSubwidgets(panel
->box
);
99 WMSetScrollViewContentView(sv
, WMWidgetView(f
));
100 WMRealizeWidget(panel
->box
);
105 static void storeDefaults(_Panel
* panel
)
107 WMUserDefaults
*udb
= WMGetStandardUserDefaults();
109 SetBoolForKey(WMGetButtonSelected(panel
->swi
[0]), "DisableMiniwindows");
111 WMSetUDBoolForKey(udb
, WMGetButtonSelected(panel
->swi
[1]), "NoXSetStuff");
113 SetBoolForKey(WMGetButtonSelected(panel
->swi
[2]), "SaveSessionOnExit");
114 SetBoolForKey(WMGetButtonSelected(panel
->swi
[3]), "UseSaveUnders");
115 SetBoolForKey(WMGetButtonSelected(panel
->swi
[4]), "DontConfirmKill");
116 SetBoolForKey(WMGetButtonSelected(panel
->swi
[5]), "DisableBlinking");
117 SetBoolForKey(WMGetButtonSelected(panel
->swi
[6]), "AntialiasedText");
118 SetBoolForKey(WMGetButtonSelected(panel
->swi
[7]), "SingleClickLaunch");
119 SetBoolForKey(WMGetButtonSelected(panel
->swi
[8]), "CycleActiveHeadOnly");
120 SetBoolForKey(WMGetButtonSelected(panel
->swi
[9]), "ShowClipTitle");
123 Panel
*InitExpert(WMScreen
* scr
, WMWidget
* parent
)
127 panel
= wmalloc(sizeof(_Panel
));
128 memset(panel
, 0, sizeof(_Panel
));
130 panel
->sectionName
= _("Expert User Preferences");
132 panel
->description
= _("Options for people who know what they're doing...\n"
133 "Also have some other misc. options.");
135 panel
->parent
= parent
;
137 panel
->callbacks
.createWidgets
= createPanel
;
138 panel
->callbacks
.updateDomain
= storeDefaults
;
140 AddSection(panel
, ICON_FILE
);