3
// Copyright (C) 2001 Neil Stevens <multivac@fcmail.com>
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
12
// The above copyright notice and this permission notice shall be included in
13
// all copies or substantial portions of the Software.
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
// Except as contained in this notice, the name(s) of the author(s) shall not be
23
// used in advertising or otherwise to promote the sale, use or other dealings
24
// in this Software without prior written authorization from the author(s).
30
#include <qbuttongroup.h>
31
#include <qcheckbox.h>
33
#include <qradiobutton.h>
35
#include <noatunapp.h>
36
#include <pluginloader.h>
41
YHModule::YHModule(QObject *_parent)
42
: CModule(i18n("Young Hickory"), i18n("Configure The System Tray Icon"), _parent)
44
QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
46
tip = new QCheckBox(i18n("Show a tooltip for the current track"), this);
48
icon = new QButtonGroup(1, Horizontal, this);
49
icon->setExclusive(true);
50
new QRadioButton(i18n("Blink the icon for the current state"), icon);
51
new QRadioButton(i18n("Show the icon for the current state"), icon);
52
new QRadioButton(i18n("Do neither"), icon);
54
layout->addWidget(tip);
55
layout->addWidget(icon);
62
void YHModule::save(void)
64
KConfig &config = *(KGlobal::config());
65
config.setGroup("Young Hickory");
66
int iconPressed = icon->id(icon->selected());
67
config.writeEntry("icon", iconPressed);
68
config.writeEntry("tip", tip->isChecked());
71
NoatunSystray *yh = NoatunSystray::jasonkb;
74
yh->setBlink((NoatunSystray::Blink)iconPressed);
75
yh->setTip(tip->isChecked());
79
void YHModule::reopen(void)
81
KConfig &config = *(KGlobal::config());
82
config.setGroup("Young Hickory");
83
static_cast<QRadioButton *>(icon->find(config.readLongNumEntry("icon", 0)))->setChecked(true);
84
tip->setChecked(config.readBoolEntry("tip", true));
87
#include "cmodule.moc"