1
#include "opt_events.h"
3
#include "iconwidget.h"
5
#include <qbuttongroup.h>
6
#include <qwhatsthis.h>
8
#include <qradiobutton.h>
10
#include <qlineedit.h>
12
#include "opt_events-ui.h"
14
//----------------------------------------------------------------------------
16
//----------------------------------------------------------------------------
18
OptionsTabEvents::OptionsTabEvents(QObject *parent)
19
: OptionsTab(parent, "events", "", tr("Events"), tr("The events behaviour"), "psi/system")
24
QWidget *OptionsTabEvents::widget()
29
w = new OptEventsUI();
30
OptEventsUI *d = (OptEventsUI *)w;
31
connect(d->bg_alerts, SIGNAL(clicked(int)), SLOT(selectAlertStyle(int)));
33
QWhatsThis::add(d->ck_popupMsgs,
34
tr("Makes new incoming message windows pop up automatically when received."));
35
QWhatsThis::add(d->ck_popupHeadlines,
36
tr("Makes new incoming headlines pop up automatically when received."));
37
QWhatsThis::add(d->ck_allowAwayPopup,
38
tr("Normally, Psi will not autopopup events when you are away. "
39
"Set this option if you want them to popup anyway."));
40
QWhatsThis::add(d->ck_allowUnlistedPopup,
41
tr("Normally, Psi will not autopopup events from users not in your roster. "
42
"Set this option if you want them to popup anyway."));
43
QWhatsThis::add(d->ck_raise,
44
tr("Makes new incoming events bring the main window to the foreground."));
45
QWhatsThis::add(d->ck_ignoreNonRoster,
46
tr("Makes Psi ignore all incoming events from contacts"
47
" not already in your list of contacts."));
48
QWhatsThis::add(d->rb_aSolid,
49
tr("Does not animate or blink incoming event icons on the main window as they are received."));
50
QWhatsThis::add(d->rb_aBlink,
51
tr("Makes all incoming event icons blink on the main window as events are received."));
52
QWhatsThis::add(d->rb_aAnimate,
53
tr("Animates incoming event icons on the main window as events are recieved."));
54
QWhatsThis::add(d->ck_autoAuth,
55
tr("Makes Psi automatically accept all authorization requests from <b>anyone</b>."));
60
void OptionsTabEvents::applyOptions(Options *opt)
65
OptEventsUI *d = (OptEventsUI *)w;
66
opt->popupMsgs = d->ck_popupMsgs->isChecked();
67
opt->popupChats = d->ck_popupMsgs->isChecked();
68
opt->popupHeadlines = d->ck_popupHeadlines->isChecked();
69
opt->noAwayPopup = !d->ck_allowAwayPopup->isChecked();
70
opt->noUnlistedPopup = !d->ck_allowUnlistedPopup->isChecked();
71
opt->raise = d->ck_raise->isChecked();
72
opt->ignoreNonRoster = d->ck_ignoreNonRoster->isChecked();
73
opt->alertStyle = alertStyle;
74
opt->autoAuth = d->ck_autoAuth->isChecked();
76
opt->ppIsOn = d->ck_popupOn->isChecked();
77
opt->ppMessage = d->ck_popupOnMessage->isChecked();
78
opt->ppChat = d->ck_popupOnMessage->isChecked();
79
opt->ppHeadline = d->ck_popupOnHeadline->isChecked();
80
opt->ppOnline = d->ck_popupOnOnline->isChecked();
81
opt->ppOffline = d->ck_popupOnOffline->isChecked();
82
opt->ppStatus = d->ck_popupOnStatus->isChecked();
85
void OptionsTabEvents::restoreOptions(const Options *opt)
90
OptEventsUI *d = (OptEventsUI *)w;
91
d->ck_popupMsgs->setChecked( opt->popupMsgs || opt->popupChats );
92
d->ck_popupHeadlines->setChecked( opt->popupHeadlines );
93
d->ck_allowAwayPopup->setChecked( !opt->noAwayPopup );
94
d->ck_allowUnlistedPopup->setChecked( !opt->noUnlistedPopup );
95
d->ck_raise->setChecked( opt->raise );
96
d->ck_ignoreNonRoster->setChecked( opt->ignoreNonRoster );
97
alertStyle = opt->alertStyle;
98
d->bg_alerts->setButton( alertStyle );
99
d->ck_autoAuth->setChecked( opt->autoAuth );
101
d->ck_popupOn->setChecked( true );
102
d->ck_popupOn->setChecked( opt->ppIsOn );
103
d->ck_popupOnMessage->setChecked( opt->ppMessage || opt->ppChat );
104
d->ck_popupOnHeadline->setChecked( opt->ppHeadline );
105
d->ck_popupOnOnline->setChecked( opt->ppOnline );
106
d->ck_popupOnOffline->setChecked( opt->ppOffline );
107
d->ck_popupOnStatus->setChecked( opt->ppStatus );
110
void OptionsTabEvents::selectAlertStyle(int a)