1 | #include "opt_events.h"
|
---|
2 | #include "common.h"
|
---|
3 | #include "iconwidget.h"
|
---|
4 |
|
---|
5 | #include <qbuttongroup.h>
|
---|
6 | #include <qwhatsthis.h>
|
---|
7 | #include <qcheckbox.h>
|
---|
8 | #include <qradiobutton.h>
|
---|
9 | #include <qlabel.h>
|
---|
10 | #include <qcombobox.h>
|
---|
11 | #include <qlineedit.h>
|
---|
12 |
|
---|
13 | #include "opt_events-ui.h"
|
---|
14 |
|
---|
15 | //----------------------------------------------------------------------------
|
---|
16 | // OptionsTabEvents
|
---|
17 | //----------------------------------------------------------------------------
|
---|
18 |
|
---|
19 | OptionsTabEvents::OptionsTabEvents(QObject *parent)
|
---|
20 | : OptionsTab(parent, "events", "", tr("Events"), tr("The events behaviour"), "psi/events")
|
---|
21 | {
|
---|
22 | w = 0;
|
---|
23 | }
|
---|
24 |
|
---|
25 | QWidget *OptionsTabEvents::widget()
|
---|
26 | {
|
---|
27 | if ( w )
|
---|
28 | return 0;
|
---|
29 |
|
---|
30 | w = new OptEventsUI();
|
---|
31 | OptEventsUI *d = (OptEventsUI *)w;
|
---|
32 | connect(d->bg_alerts, SIGNAL(clicked(int)), SLOT(selectAlertStyle(int)));
|
---|
33 |
|
---|
34 | QWhatsThis::add(d->ck_popupMsgs,
|
---|
35 | tr("Makes new incoming message windows pop up automatically when received."));
|
---|
36 | QWhatsThis::add(d->ck_popupHeadlines,
|
---|
37 | tr("Makes new incoming headlines pop up automatically when received."));
|
---|
38 | QWhatsThis::add(d->ck_popupFiles,
|
---|
39 | tr("Makes new incoming file requests pop up automatically when received."));
|
---|
40 | QWhatsThis::add(d->ck_allowAwayPopup,
|
---|
41 | tr("Normally, Psi will not autopopup events when you are away. "
|
---|
42 | "Set this option if you want them to popup anyway."));
|
---|
43 | QWhatsThis::add(d->ck_allowUnlistedPopup,
|
---|
44 | tr("Normally, Psi will not autopopup events from users not in your roster. "
|
---|
45 | "Set this option if you want them to popup anyway."));
|
---|
46 | QWhatsThis::add(d->ck_raise,
|
---|
47 | tr("Makes new incoming events bring the main window to the foreground."
|
---|
48 | " It does not take the keyboard focus, so it will not interfere with your work."));
|
---|
49 | QWhatsThis::add(d->ck_ignoreNonRoster,
|
---|
50 | tr("Makes Psi ignore all incoming events from contacts"
|
---|
51 | " not already in your list of contacts."));
|
---|
52 | QWhatsThis::add(d->rb_aSolid,
|
---|
53 | tr("Does not animate or blink incoming event icons on the main window as they are received."));
|
---|
54 | QWhatsThis::add(d->rb_aBlink,
|
---|
55 | tr("Makes all incoming event icons blink on the main window as events are received."));
|
---|
56 | QWhatsThis::add(d->rb_aAnimate,
|
---|
57 | tr("Animates incoming event icons on the main window as events are recieved."));
|
---|
58 | QWhatsThis::add(d->ck_autoAuth,
|
---|
59 | tr("Makes Psi automatically accept all authorization requests from <b>anyone</b>."));
|
---|
60 | QWhatsThis::add(d->ck_notifyAuth,
|
---|
61 | tr("Makes Psi notify you when your authorization request was approved."));
|
---|
62 |
|
---|
63 | #ifndef Q_WS_MAC
|
---|
64 | d->cb_bounce->hide();
|
---|
65 | d->lb_bounce->hide();
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | return w;
|
---|
69 | }
|
---|
70 |
|
---|
71 | void OptionsTabEvents::applyOptions(Options *opt)
|
---|
72 | {
|
---|
73 | if ( !w )
|
---|
74 | return;
|
---|
75 |
|
---|
76 | OptEventsUI *d = (OptEventsUI *)w;
|
---|
77 | opt->popupMsgs = d->ck_popupMsgs->isChecked();
|
---|
78 | opt->popupChats = d->ck_popupMsgs->isChecked();
|
---|
79 | opt->popupHeadlines = d->ck_popupHeadlines->isChecked();
|
---|
80 | opt->popupFiles = d->ck_popupFiles->isChecked();
|
---|
81 | opt->noAwayPopup = !d->ck_allowAwayPopup->isChecked();
|
---|
82 | opt->noUnlistedPopup = !d->ck_allowUnlistedPopup->isChecked();
|
---|
83 | opt->raise = d->ck_raise->isChecked();
|
---|
84 | opt->ignoreNonRoster = d->ck_ignoreNonRoster->isChecked();
|
---|
85 | opt->alertStyle = alertStyle;
|
---|
86 | opt->autoAuth = d->ck_autoAuth->isChecked();
|
---|
87 | opt->notifyAuth = d->ck_notifyAuth->isChecked();
|
---|
88 | opt->bounceDock = (Options::BounceDockSetting) d->cb_bounce->currentItem();
|
---|
89 |
|
---|
90 | opt->ppIsOn = d->ck_popupOn->isChecked();
|
---|
91 | opt->ppMessage = d->ck_popupOnMessage->isChecked();
|
---|
92 | opt->ppChat = d->ck_popupOnMessage->isChecked();
|
---|
93 | opt->ppHeadline = d->ck_popupOnHeadline->isChecked();
|
---|
94 | opt->ppFile = d->ck_popupOnFile->isChecked();
|
---|
95 | opt->ppOnline = d->ck_popupOnOnline->isChecked();
|
---|
96 | opt->ppOffline = d->ck_popupOnOffline->isChecked();
|
---|
97 | opt->ppStatus = d->ck_popupOnStatus->isChecked();
|
---|
98 | }
|
---|
99 |
|
---|
100 | void OptionsTabEvents::restoreOptions(const Options *opt)
|
---|
101 | {
|
---|
102 | if ( !w )
|
---|
103 | return;
|
---|
104 |
|
---|
105 | OptEventsUI *d = (OptEventsUI *)w;
|
---|
106 | d->ck_popupMsgs->setChecked( opt->popupMsgs || opt->popupChats );
|
---|
107 | d->ck_popupHeadlines->setChecked( opt->popupHeadlines );
|
---|
108 | d->ck_popupFiles->setChecked( opt->popupFiles );
|
---|
109 | d->ck_allowAwayPopup->setChecked( !opt->noAwayPopup );
|
---|
110 | d->ck_allowUnlistedPopup->setChecked( !opt->noUnlistedPopup );
|
---|
111 | d->ck_raise->setChecked( opt->raise );
|
---|
112 | d->ck_ignoreNonRoster->setChecked( opt->ignoreNonRoster );
|
---|
113 | alertStyle = opt->alertStyle;
|
---|
114 | d->bg_alerts->setButton( alertStyle );
|
---|
115 | d->ck_autoAuth->setChecked( opt->autoAuth );
|
---|
116 | d->ck_notifyAuth->setChecked( opt->notifyAuth );
|
---|
117 | d->cb_bounce->setCurrentItem( opt->bounceDock );
|
---|
118 |
|
---|
119 | d->ck_popupOn->setChecked( true );
|
---|
120 | d->ck_popupOn->setChecked( opt->ppIsOn );
|
---|
121 | d->ck_popupOnMessage->setChecked( opt->ppMessage || opt->ppChat );
|
---|
122 | d->ck_popupOnHeadline->setChecked( opt->ppHeadline );
|
---|
123 | d->ck_popupOnFile->setChecked( opt->ppFile );
|
---|
124 | d->ck_popupOnOnline->setChecked( opt->ppOnline );
|
---|
125 | d->ck_popupOnOffline->setChecked( opt->ppOffline );
|
---|
126 | d->ck_popupOnStatus->setChecked( opt->ppStatus );
|
---|
127 | }
|
---|
128 |
|
---|
129 | void OptionsTabEvents::selectAlertStyle(int a)
|
---|
130 | {
|
---|
131 | alertStyle = a;
|
---|
132 | }
|
---|