aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/options/OptionsWidget_channel.cpp
diff options
context:
space:
mode:
authorGravatar un1versal2016-04-24 17:02:12 +0100
committerGravatar un1versal2016-04-24 19:41:09 +0100
commitb973de650ef3e615009e5bcdfb174955ae3fc785 (patch)
tree5d97fcb2e43fc5c44cc41fff999f6b546f8635a1 /src/modules/options/OptionsWidget_channel.cpp
parentOptionsWidget: rename option labels to reflect current function (diff)
downloadKVIrc-b973de650ef3e615009e5bcdfb174955ae3fc785.tar.gz
KVIrc-b973de650ef3e615009e5bcdfb174955ae3fc785.tar.bz2
KVIrc-b973de650ef3e615009e5bcdfb174955ae3fc785.zip
OptionsWidget: formatting + indenting + obsolete code cleanup
its not quite clang-format quality spacing after comma etc. maybe clang one day can visit these things and do a better job.
Diffstat (limited to 'src/modules/options/OptionsWidget_channel.cpp')
-rw-r--r--src/modules/options/OptionsWidget_channel.cpp60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/modules/options/OptionsWidget_channel.cpp b/src/modules/options/OptionsWidget_channel.cpp
index e5c7c5d4a..7ad4fa481 100644
--- a/src/modules/options/OptionsWidget_channel.cpp
+++ b/src/modules/options/OptionsWidget_channel.cpp
@@ -36,6 +36,7 @@
#include <QComboBox>
+
OptionsWidget_channel::OptionsWidget_channel(QWidget * pParent)
: KviOptionsWidget(pParent)
{
@@ -52,35 +53,32 @@ OptionsWidget_channelGeneral::OptionsWidget_channelGeneral(QWidget * pParent)
KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Channel Kick","options"));
- KviBoolSelector *b = addBoolSelector(g,__tr2qs_ctx("Rejoin channel","options"),KviOption_boolRejoinChannelOnKick);
- mergeTip(b,
- __tr2qs_ctx("This option will cause KVIrc to attempt " \
- "to rejoin a channel after being kicked.","options"));
+ KviBoolSelector *b = addBoolSelector(g,__tr2qs_ctx("Rejoin channel","options"),KviOption_boolRejoinChannelOnKick);
+ mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to attempt " \
+ "to rejoin a channel after being kicked.","options"));
+
b = addBoolSelector(g,__tr2qs_ctx("Keep channel open","options"),KviOption_boolKeepChannelOpenOnKick);
- mergeTip(b,
- __tr2qs_ctx("This option will cause KVIrc to keep " \
- "the channel window open after being kicked.<br>" \
- "It might be a good idea to also enable the " \
- "\"Rejoin channel\" option.","options"));
+ mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to keep " \
+ "the channel window open after being kicked.<br>" \
+ "It might be a good idea to also enable the " \
+ "\"Rejoin channel\" option.","options"));
g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Channel Part","options"));
b = addBoolSelector(g,__tr2qs_ctx("Keep channel open","options"),KviOption_boolKeepChannelOpenOnPart);
- mergeTip(b,
- __tr2qs_ctx("This option will cause KVIrc to keep " \
- "the channel window open after leaving it.","options"));
+ mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to keep " \
+ "the channel window open after leaving it.","options"));
b = addBoolSelector(0,2,0,2,__tr2qs_ctx("Automatically join channel on invite","options"),KviOption_boolAutoJoinOnInvite);
- mergeTip(b,
- __tr2qs_ctx("This option will cause KVIrc to automatically " \
- "join a channel when an INVITE message for that channel is received.<br>" \
- "<b>Warning:</b> this may help spammers harass you.","options"));
+ mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to automatically " \
+ "join a channel when an INVITE message for that channel is received.<br>" \
+ "<b>Warning:</b> this may help spammers harass you.","options"));
b = addBoolSelector(0,3,0,3, __tr2qs_ctx("Open channel windows without focus","options"),KviOption_boolCreateMinimizedChannels);
- mergeTip(b, __tr2qs_ctx("This option prevents newly created " \
- "channel windows from diverting application focus.<br>" \
- "Enable this if you don't like channels " \
- "popping up while you're typing something in a channel.","options"));
+ mergeTip(b,__tr2qs_ctx("This option prevents newly created " \
+ "channel windows from diverting application focus.<br>" \
+ "Enable this if you don't like channels " \
+ "popping up while you're typing something in a channel.","options"));
addRowSpacer(0,4,0,4);
}
@@ -106,19 +104,22 @@ OptionsWidget_channelAdvanced::OptionsWidget_channelAdvanced(QWidget * pParent)
KviIrcMask ipmask("nick!user@192.168.1.2");
QString tmp1;
QString tmp2;
+
for(int i=0;i<=26;i++)
{
-
hostmask.mask(tmp1,(KviIrcMask::MaskType)i);
ipmask.mask(tmp2,(KviIrcMask::MaskType)i);
- m_pBanTypeCombo->insertItem(m_pBanTypeCombo->count(),QString("%1 (%2)").arg(tmp1, tmp2));
+ m_pBanTypeCombo->insertItem(m_pBanTypeCombo->count(),QString("%1 (%2)").arg(tmp1, tmp2));
}
+
m_pBanTypeCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintDefaultBanType));
KviTalGroupBox * g = addGroupBox(0,2,4,2,Qt::Horizontal,__tr2qs_ctx("On Channel Join","options"));
KviUIntSelector *u = addUIntSelector(g,__tr2qs_ctx("Minimum delay between two channel requests:","options"),KviOption_uintOnJoinRequestsDelay,0,10,1);
u->setSuffix(__tr2qs_ctx(" sec","options"));
- mergeTip(u,__tr2qs_ctx("This is an artificial delay for the channel requests made on join.<br>You may increase it if your server complains about flooding when joining many channels at once.<br>Minimum value: <b>0 secs</b><br>Maximum value: <b>10 secs</b>","options"));
+ mergeTip(u,__tr2qs_ctx("This is an artificial delay for the channel requests made on join.<br>" \
+ "You may increase it if your server complains about flooding when joining " \
+ "many channels at once.<br>Minimum value: <b>0 secs</b><br>Maximum value: <b>10 secs</b>","options"));
addBoolSelector(g,__tr2qs_ctx("Do not send /WHO request","options"),KviOption_boolDisableWhoRequestOnJoin);
addBoolSelector(g,__tr2qs_ctx("Do not request ban list","options"),KviOption_boolDisableBanListRequestOnJoin);
@@ -129,22 +130,23 @@ OptionsWidget_channelAdvanced::OptionsWidget_channelAdvanced(QWidget * pParent)
addBoolSelector(g,__tr2qs_ctx("Show channel sync time","options"),KviOption_boolShowChannelSyncTime);
b = addBoolSelector(g,__tr2qs_ctx("Paste last channel log","options"),KviOption_boolPasteLastLogOnChannelJoin);
-
KviTalHBox * box = new KviTalHBox(g);
u = addUIntSelector(box,__tr2qs_ctx("Paste up to:","options"),KviOption_uintLinesToPasteOnChannelJoin,0,50,10,KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin));
u->setSuffix(__tr2qs_ctx(" lines","options"));
mergeTip(u,__tr2qs_ctx("Minimum value: <b>0 lines</b><br>Maximum value: <b>50 lines</b>","options"));
+
connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
+
u = addUIntSelector(box,__tr2qs_ctx("Interval:","options"),KviOption_uintDaysIntervalToPasteOnChannelJoin,1,10,10,KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin));
u->setSuffix(__tr2qs_ctx(" days","options"));
mergeTip(u,__tr2qs_ctx("Minimum value: <b>0 days</b><br>Maximum value: <b>10 days</b>","options"));
+
connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
- b = addBoolSelector(0,3,4,3,__tr2qs_ctx("Keep away list updated","options"),KviOption_boolEnableAwayListUpdates);
- mergeTip(b,
- __tr2qs_ctx("KVIrc sends out a channel /WHO message every now and then to keep " \
- "the channel away list in sync. Use this option to disable this feature (and to save " \
- "your IRC bandwidth). If the server supports IRCv3.1's away-notify extension, it will be used instead of WHO requests.","options"));
+ b = addBoolSelector(0,3,4,3,__tr2qs_ctx("Keep away list updated","options"),KviOption_boolEnableAwayListUpdates);
+ mergeTip(b,__tr2qs_ctx("KVIrc sends out a channel /WHO message every now and then to keep the channel away list in sync. " \
+ "Use this option to disable this feature (and to save your IRC bandwidth).<br>" \
+ "If the server supports IRCv3.1's away-notify extension, it will be used instead of WHO requests.","options"));
addRowSpacer(0,5,4,5);
}