diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/ident/libkviident.cpp | 22 | ||||
| -rw-r--r-- | src/modules/options/optw_connection.cpp | 45 | ||||
| -rw-r--r-- | src/modules/options/optw_connection.h | 7 | ||||
| -rw-r--r-- | src/modules/reguser/edituser.cpp | 33 | ||||
| -rw-r--r-- | src/modules/setup/libkvisetup.cpp | 3 |
5 files changed, 82 insertions, 28 deletions
diff --git a/src/modules/ident/libkviident.cpp b/src/modules/ident/libkviident.cpp index 3e8acef5a..4c3690297 100644 --- a/src/modules/ident/libkviident.cpp +++ b/src/modules/ident/libkviident.cpp @@ -81,41 +81,47 @@ KviIdentSentinel::~KviIdentSentinel() bool KviIdentSentinel::event(QEvent *e) { + if(KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)==KviIdentdOutputMode::Quiet || !g_pActiveWindow) + return QObject::event(e); + + KviWindow * pTarget = KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)==KviIdentdOutputMode::ToActiveWindow ? + (KviWindow *)g_pActiveWindow : (KviWindow *)g_pApp->activeConsole(); + if(e->type() == KVI_THREAD_EVENT) { if(((KviThreadEvent *)e)->id() == KVI_THREAD_EVENT_DATA) { KviIdentMessageData * d = ((KviThreadDataEvent<KviIdentMessageData> *)e)->getData(); - if(g_pActiveWindow) + if(pTarget) { if(d->szHost.hasData()) { if(d->szAux.hasData()) { if(_OUTPUT_PARANOIC) - g_pActiveWindow->output(KVI_OUT_IDENT,__tr("%s (%s) (%s:%u)"),d->szMessage.ptr(),d->szAux.ptr(),d->szHost.ptr(),d->uPort); + pTarget->output(KVI_OUT_IDENT,__tr("%s (%s) (%s:%u)"),d->szMessage.ptr(),d->szAux.ptr(),d->szHost.ptr(),d->uPort); else - g_pActiveWindow->output(KVI_OUT_IDENT,__tr("%s (%s)"),d->szMessage.ptr(),d->szAux.ptr()); + pTarget->output(KVI_OUT_IDENT,__tr("%s (%s)"),d->szMessage.ptr(),d->szAux.ptr()); } else { if(_OUTPUT_PARANOIC) - g_pActiveWindow->output(KVI_OUT_IDENT,__tr("%s (%s:%u)"),d->szMessage.ptr(),d->szHost.ptr(),d->uPort); + pTarget->output(KVI_OUT_IDENT,__tr("%s (%s:%u)"),d->szMessage.ptr(),d->szHost.ptr(),d->uPort); else - g_pActiveWindow->output(KVI_OUT_IDENT,__tr("%s"),d->szMessage.ptr()); + pTarget->output(KVI_OUT_IDENT,__tr("%s"),d->szMessage.ptr()); } } else { - g_pActiveWindow->output(KVI_OUT_IDENT,__tr("[IDENT]: %s"),d->szMessage.ptr()); + pTarget->output(KVI_OUT_IDENT,__tr("[IDENT]: %s"),d->szMessage.ptr()); } } delete d; } else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING) { if(_OUTPUT_VERBOSE) - if(g_pActiveWindow)g_pActiveWindow->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down identd service (spontaneous action)")); + if(pTarget)pTarget->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down identd service (spontaneous action)")); stopIdentService(); } else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST) { if(_OUTPUT_VERBOSE) - if(g_pActiveWindow)g_pActiveWindow->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down identd service (requesetd action)")); + if(pTarget)pTarget->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down identd service (requesetd action)")); } return true; diff --git a/src/modules/options/optw_connection.cpp b/src/modules/options/optw_connection.cpp index f2840bc98..44da4e72c 100644 --- a/src/modules/options/optw_connection.cpp +++ b/src/modules/options/optw_connection.cpp @@ -28,6 +28,7 @@ #include "kvi_locale.h" #include "kvi_options.h" #include "kvi_iconmanager.h" +#include <qradiobutton.h> KviConnectionOptionsWidget::KviConnectionOptionsWidget(QWidget * parent) @@ -204,26 +205,47 @@ KviTransportOptionsWidget::~KviTransportOptionsWidget() KviIdentOptionsWidget::KviIdentOptionsWidget(QWidget * parent) : KviOptionsWidget(parent,"ident_options_widget") { - createLayout(5,1); + createLayout(6,1); m_pEnableIdent = addBoolSelector(0,0,0,0,__tr2qs_ctx("Enable ident service (bad practice on UNIX!)","options"),KviOption_boolUseIdentService); connect(m_pEnableIdent,SIGNAL(toggled(bool)),this,SLOT(enableIpv4InIpv6(bool))); - KviTalGroupBox * gbox = addGroupBox(0,1,0,1,1,Qt::Horizontal,__tr2qs_ctx("Configuration","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + KviTalGroupBox * gbox = addGroupBox(0,1,0,1,1,Qt::Horizontal,__tr2qs_ctx("Output verosity","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); + + addLabel(gbox,__tr2qs_ctx("Output identd messages to:","options")); + + m_pActiveRadio = new QRadioButton(__tr2qs_ctx("Active window","options"),gbox); + m_pConsoleRadio = new QRadioButton(__tr2qs_ctx("Console","options"),gbox); + m_pQuietRadio = new QRadioButton(__tr2qs_ctx("Do not show any identd messages","options"),gbox); + + switch(KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)) + { + case KviIdentdOutputMode::Quiet : + m_pQuietRadio->setChecked(true); + break; + case KviIdentdOutputMode::ToConsole : + m_pConsoleRadio->setChecked(true); + break; + case KviIdentdOutputMode::ToActiveWindow : + m_pActiveRadio->setChecked(true); + break; + } + + gbox = addGroupBox(0,2,0,2,1,Qt::Horizontal,__tr2qs_ctx("Configuration","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); KviBoolSelector *b = addBoolSelector(gbox,__tr2qs_ctx("Enable ident service only while connecting to server","options"),KviOption_boolUseIdentServiceOnlyOnConnect); connect(m_pEnableIdent,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); KviStringSelector * s = addStringSelector(gbox,__tr2qs_ctx("Ident username:","options"), KviOption_stringIdentdUser,KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); KviUIntSelector * u = addUIntSelector(gbox,__tr2qs_ctx("Service port:","options"), KviOption_uintIdentdPort,0,65535,113,KVI_OPTION_BOOL(KviOption_boolUseIdentService)); connect(m_pEnableIdent,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); - gbox = addGroupBox(0,2,0,2,1,Qt::Horizontal,__tr2qs_ctx("IPv6 Settings","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + gbox = addGroupBox(0,3,0,3,1,Qt::Horizontal,__tr2qs_ctx("IPv6 Settings","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); m_pEnableIpv6 = addBoolSelector(gbox,__tr2qs_ctx("Enable service for IPv6","options"), KviOption_boolIdentdEnableIpV6, KVI_OPTION_BOOL(KviOption_boolUseIdentService)); @@ -238,7 +260,7 @@ KviIdentOptionsWidget::KviIdentOptionsWidget(QWidget * parent) KVI_OPTION_BOOL(KviOption_boolUseIdentService) && KVI_OPTION_BOOL(KviOption_boolIdentdEnableIpV6)); connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); - addLabel(0,3,0,3, + addLabel(0,4,0,4, #ifdef COMPILE_ON_WINDOWS __tr2qs_ctx("<p><b>Warning:</b><br>" \ "This is a <b>non RFC 1413 compliant</b> ident daemon that implements " \ @@ -254,13 +276,24 @@ KviIdentOptionsWidget::KviIdentOptionsWidget(QWidget * parent) #endif ); - addRowSpacer(0,4,0,4); + addRowSpacer(0,5,0,5); } KviIdentOptionsWidget::~KviIdentOptionsWidget() { } +void KviIdentOptionsWidget::commit() +{ + KviOptionsWidget::commit(); + if(m_pConsoleRadio->isOn()) + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::ToConsole; + if(m_pActiveRadio->isOn()) + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::ToActiveWindow; + if(m_pQuietRadio->isOn()) + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::Quiet; +} + void KviIdentOptionsWidget::enableIpv4InIpv6(bool) { #ifdef COMPILE_IPV6_SUPPORT diff --git a/src/modules/options/optw_connection.h b/src/modules/options/optw_connection.h index 917b7e576..b4d29e69b 100644 --- a/src/modules/options/optw_connection.h +++ b/src/modules/options/optw_connection.h @@ -88,6 +88,7 @@ public: #define KVI_OPTIONS_WIDGET_PARENT_KviIdentOptionsWidget KviConnectionAdvancedOptionsWidget #define KVI_OPTIONS_WIDGET_PRIORITY_KviIdentOptionsWidget 10 +class QRadioButton; class KviIdentOptionsWidget : public KviOptionsWidget { @@ -95,10 +96,16 @@ class KviIdentOptionsWidget : public KviOptionsWidget public: KviIdentOptionsWidget(QWidget * parent); ~KviIdentOptionsWidget(); + + virtual void commit(); protected: KviBoolSelector * m_pEnableIdent; KviBoolSelector * m_pEnableIpv6; KviBoolSelector * m_pIpv4InIpv6; + + QRadioButton *m_pConsoleRadio; + QRadioButton *m_pActiveRadio; + QRadioButton *m_pQuietRadio; public slots: void enableIpv4InIpv6(bool); }; diff --git a/src/modules/reguser/edituser.cpp b/src/modules/reguser/edituser.cpp index 8b07a482f..83facc92f 100644 --- a/src/modules/reguser/edituser.cpp +++ b/src/modules/reguser/edituser.cpp @@ -43,6 +43,7 @@ #include <qlayout.h>
#include <qlabel.h>
+#include <qgroupbox.h>
#ifdef COMPILE_USE_QT4
#include <qevent.h>
#include <q3header.h>
@@ -456,23 +457,31 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste m_pIgnoreEnabled = new KviStyledCheckBox(__tr2qs("Enable ignore for this user"),vb);
- m_pIgnoreQuery = new KviStyledCheckBox(__tr2qs("Ignore query-messages"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreQuery,SLOT(setEnabled(bool)));
+ QGroupBox * gb = new QGroupBox(__tr2qs("Ignore features"),vb);
+ connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),gb,SLOT(setEnabled(bool)));
+
+ QVBoxLayout * layout = new QVBoxLayout(gb,20,3);
+
+ m_pIgnoreQuery = new KviStyledCheckBox(__tr2qs("Ignore query-messages"),gb);
+ layout->addWidget(m_pIgnoreQuery);
+
+ m_pIgnoreChannel = new KviStyledCheckBox(__tr2qs("Ignore channel-messages"),gb);
+ layout->addWidget(m_pIgnoreChannel);
- m_pIgnoreChannel = new KviStyledCheckBox(__tr2qs("Ignore channel-messages"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreChannel,SLOT(setEnabled(bool)));
+ m_pIgnoreNotice = new KviStyledCheckBox(__tr2qs("Ignore notice-messages"),gb);
+ layout->addWidget(m_pIgnoreNotice);
- m_pIgnoreNotice = new KviStyledCheckBox(__tr2qs("Ignore notice-messages"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreNotice,SLOT(setEnabled(bool)));
+ m_pIgnoreCtcp = new KviStyledCheckBox(__tr2qs("Ignore ctcp-messages"),gb);
+ layout->addWidget(m_pIgnoreCtcp);
- m_pIgnoreCtcp = new KviStyledCheckBox(__tr2qs("Ignore ctcp-messages"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreCtcp,SLOT(setEnabled(bool)));
+ m_pIgnoreInvite = new KviStyledCheckBox(__tr2qs("Ignore invites"),gb);
+ layout->addWidget(m_pIgnoreInvite);
- m_pIgnoreInvite = new KviStyledCheckBox(__tr2qs("Ignore invites"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreInvite,SLOT(setEnabled(bool)));
+ m_pIgnoreDcc = new KviStyledCheckBox(__tr2qs("Ignore DCCs"),gb);
+ layout->addWidget(m_pIgnoreDcc);
- m_pIgnoreDcc = new KviStyledCheckBox(__tr2qs("Ignore DCCs"),vb);
- connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),m_pIgnoreDcc,SLOT(setEnabled(bool)));
+ QWidget *w = new QWidget(vb);
+ w->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
addTab(vb,__tr2qs("Ignore"));
diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp index 459a1c276..60ee16d31 100644 --- a/src/modules/setup/libkvisetup.cpp +++ b/src/modules/setup/libkvisetup.cpp @@ -107,8 +107,7 @@ KVIMODULEEXPORTFUNC void setup_finish() if(!szMircServers.isEmpty()) { g_pIrcServerDataBase->loadFromMircIni(szMircServers,szMircIni, - KVI_OPTION_STRINGLIST(KviOption_stringlistRecentIrcUrls)); - g_pApp->emitRecentUrlsChanged(); + KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers)); g_pApp->saveIrcServerDataBase(); } |
