1 //=============================================================================
2 //
3 //   File : OptionsWidget_notify.cpp
4 //   Creation date : Sun Oct 28 15:11:29 2001 GMT by Szymon Stefanek
5 //
6 //   This file is part of the KVIrc IRC client distribution
7 //   Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
8 //
9 //   This program is FREE software. You can redistribute it and/or
10 //   modify it under the terms of the GNU General Public License
11 //   as published by the Free Software Foundation; either version 2
12 //   of the License, or (at your option) any later version.
13 //
14 //   This program is distributed in the HOPE that it will be USEFUL,
15 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 //   See the GNU General Public License for more details.
18 //
19 //   You should have received a copy of the GNU General Public License
20 //   along with this program. If not, write to the Free Software Foundation,
21 //   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 //=============================================================================
24 
25 #include "OptionsWidget_notify.h"
26 
27 #include "kvi_settings.h"
28 #include "KviOptions.h"
29 #include "KviLocale.h"
30 
31 #include <QLayout>
32 
OptionsWidget_notify(QWidget * parent)33 OptionsWidget_notify::OptionsWidget_notify(QWidget * parent)
34     : KviOptionsWidget(parent)
35 {
36 	setObjectName("notify_options_widget");
37 	createLayout();
38 
39 	KviBoolSelector * b;
40 	KviTalGroupBox * g;
41 	KviUIntSelector * u;
42 
43 	KviBoolSelector * notifyEnableBox = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Use online notify list", "options"), KviOption_boolUseNotifyList);
44 	b = notifyEnableBox;
45 
46 	g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Configuration", "options"));
47 	connect(b, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool)));
48 
49 	b = addBoolSelector(g, __tr2qs_ctx("Show notifications in active window", "options"), KviOption_boolNotifyListChangesToActiveWindow, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
50 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
51 
52 	b = addBoolSelector(g, __tr2qs_ctx("Flash window when users are going online", "options"), KviOption_boolFlashWindowOnNotifyOnLine, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
53 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
54 
55 	b = addBoolSelector(g, __tr2qs_ctx("Popup notifier when users are going online", "options"), KviOption_boolPopupNotifierOnNotifyOnLine, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
56 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
57 
58 	g = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Advanced Configuration", "options"));
59 	connect(notifyEnableBox, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool)));
60 
61 	b = addBoolSelector(g, __tr2qs_ctx("Check USERHOST for online users", "options"), KviOption_boolNotifyListSendUserhostForOnlineUsers, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
62 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
63 
64 	b = addBoolSelector(g, __tr2qs_ctx("Use smart notify list manager", "options"), KviOption_boolUseIntelligentNotifyListManager, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
65 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
66 
67 	b = addBoolSelector(g, __tr2qs_ctx("Use the WATCH method if available", "options"), KviOption_boolUseWatchListIfAvailable, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
68 	connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool)));
69 
70 	u = addUIntSelector(g, __tr2qs_ctx("Check interval:", "options"), KviOption_uintNotifyListCheckTimeInSecs, 5, 3600, 180, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
71 	u->setSuffix(__tr2qs_ctx(" sec", "options"));
72 	connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool)));
73 
74 	u = addUIntSelector(g, __tr2qs_ctx("ISON delay:", "options"), KviOption_uintNotifyListIsOnDelayTimeInSecs, 5, 180, 6, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
75 	u->setSuffix(__tr2qs_ctx(" sec", "options"));
76 	connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool)));
77 
78 	u = addUIntSelector(g, __tr2qs_ctx("USERHOST delay:", "options"), KviOption_uintNotifyListUserhostDelayTimeInSecs, 5, 180, 6, KVI_OPTION_BOOL(KviOption_boolUseNotifyList));
79 	u->setSuffix(__tr2qs_ctx(" sec", "options"));
80 	connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool)));
81 
82 	addLabel(0, 3, 0, 3, __tr2qs_ctx("<p><b>Note:</b><br>The notify list is managed using the \"Registered Users\" settings.</p>", "options"));
83 
84 	addRowSpacer(0, 4, 0, 4);
85 }
86 
87 OptionsWidget_notify::~OptionsWidget_notify()
88     = default;
89