Files
wmaker/WPrefs.app/Expert.c
T

153 lines
5.6 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 {
2009-08-20 00:59:40 +02:00
WMBox *box;
char *sectionName;
1999-04-25 01:49:46 +00:00
2009-08-20 00:59:40 +02:00
char *description;
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
CallbackRec callbacks;
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
WMWidget *parent;
1998-09-29 22:36:29 +00:00
2010-09-17 15:33:13 -04:00
WMButton *swi[12];
1998-09-29 22:36:29 +00:00
} _Panel;
#define ICON_FILE "expert"
2009-08-20 00:59:40 +02:00
static void showData(_Panel * panel)
1998-09-29 22:36:29 +00:00
{
2009-08-20 00:59:40 +02:00
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"));
WMSetButtonSelected(panel->swi[4], GetBoolForKey("DontConfirmKill"));
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
2010-04-02 08:38:08 +02:00
WMSetButtonSelected(panel->swi[8], GetBoolForKey("CycleActiveHeadOnly"));
2010-09-12 22:59:55 +02:00
WMSetButtonSelected(panel->swi[9], GetBoolForKey("ShowClipTitle"));
2010-09-17 14:55:45 -04:00
WMSetButtonSelected(panel->swi[10], GetBoolForKey("BounceAppIconsWhenUrgent"));
2010-09-17 15:33:13 -04:00
WMSetButtonSelected(panel->swi[11], GetBoolForKey("RaiseAppIconsWhenBouncing"));
1998-09-29 22:36:29 +00:00
}
2009-08-20 00:59:40 +02:00
static void createPanel(Panel * p)
1998-09-29 22:36:29 +00:00
{
2009-08-20 00:59:40 +02:00
_Panel *panel = (_Panel *) p;
2010-04-02 12:05:53 +02:00
WMScrollView *sv;
WMFrame *f;
2009-08-20 00:59:40 +02:00
int i;
2009-08-20 00:59:40 +02:00
panel->box = WMCreateBox(panel->parent);
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
1998-09-29 22:36:29 +00:00
2010-04-02 12:05:53 +02:00
sv = WMCreateScrollView(panel->box);
WMResizeWidget(sv, 500, 215);
WMMoveWidget(sv, 12, 10);
WMSetScrollViewRelief(sv, WRSunken);
WMSetScrollViewHasVerticalScroller(sv, True);
WMSetScrollViewHasHorizontalScroller(sv, False);
f = WMCreateFrame(panel->box);
WMResizeWidget(f, 495, sizeof(panel->swi) / sizeof(char *) * 25 + 8);
WMSetFrameRelief(f, WRFlat);
for (i = 0; i < sizeof(panel->swi) / sizeof(char *); i++) {
panel->swi[i] = WMCreateSwitchButton(f);
2009-08-20 00:59:40 +02:00
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
2010-04-02 12:05:53 +02:00
WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
2009-08-20 00:59:40 +02:00
}
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
WMSetButtonText(panel->swi[0],
_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
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."));
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)."));
WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
2010-04-02 08:38:08 +02:00
WMSetButtonText(panel->swi[8], _("Cycle windows only on the active head."));
2010-09-12 22:59:55 +02:00
WMSetButtonText(panel->swi[9], _("Show workspace title on Clip."));
2010-09-17 14:55:45 -04:00
WMSetButtonText(panel->swi[10], _("Bounce AppIcons when the application wants attention."));
2010-09-17 15:33:13 -04:00
WMSetButtonText(panel->swi[11], _("Raise AppIcons when bouncing."));
2010-09-17 15:33:13 -04:00
/* If the item is default true, enable the button here */
2009-08-20 00:59:40 +02:00
WMSetButtonEnabled(panel->swi[6], True);
2010-09-17 14:55:45 -04:00
WMSetButtonEnabled(panel->swi[9], True);
WMSetButtonEnabled(panel->swi[10], True);
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
WMMapSubwidgets(panel->box);
2010-04-02 12:05:53 +02:00
WMSetScrollViewContentView(sv, WMWidgetView(f));
WMRealizeWidget(panel->box);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
showData(panel);
1998-09-29 22:36:29 +00:00
}
2009-08-20 00:59:40 +02:00
static void storeDefaults(_Panel * panel)
1998-09-29 22:36:29 +00:00
{
2009-08-20 00:59:40 +02:00
WMUserDefaults *udb = WMGetStandardUserDefaults();
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
SetBoolForKey(WMGetButtonSelected(panel->swi[0]), "DisableMiniwindows");
2009-08-20 00:59:40 +02:00
WMSetUDBoolForKey(udb, WMGetButtonSelected(panel->swi[1]), "NoXSetStuff");
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DontConfirmKill");
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
2010-04-02 08:38:08 +02:00
SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "CycleActiveHeadOnly");
2010-09-12 22:59:55 +02:00
SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "ShowClipTitle");
2010-09-17 14:55:45 -04:00
SetBoolForKey(WMGetButtonSelected(panel->swi[10]), "BounceAppIconsWhenUrgent");
2010-09-17 15:33:13 -04:00
SetBoolForKey(WMGetButtonSelected(panel->swi[11]), "RaiseAppIconsWhenBouncing");
1998-09-29 22:36:29 +00:00
}
2009-08-20 00:59:40 +02:00
Panel *InitExpert(WMScreen * scr, WMWidget * parent)
1998-09-29 22:36:29 +00:00
{
2009-08-20 00:59:40 +02:00
_Panel *panel;
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
panel = wmalloc(sizeof(_Panel));
memset(panel, 0, sizeof(_Panel));
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
panel->sectionName = _("Expert User Preferences");
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
panel->description = _("Options for people who know what they're doing...\n"
"Also have some other misc. options.");
1999-04-25 01:49:46 +00:00
2009-08-20 00:59:40 +02:00
panel->parent = parent;
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeDefaults;
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
AddSection(panel, ICON_FILE);
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
return panel;
1998-09-29 22:36:29 +00:00
}