summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsettings.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircsettings.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index 1fba030..7a1dd6c 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -9,12 +9,13 @@
9#include <opie2/okeyconfigwidget.h> 9#include <opie2/okeyconfigwidget.h>
10#include <qpe/qpeapplication.h> 10#include <qpe/qpeapplication.h>
11 11
12/* QT */ 12/* QT */
13#include <qvalidator.h> 13#include <qvalidator.h>
14#include <qwhatsthis.h> 14#include <qwhatsthis.h>
15#include <qcheckbox.h>
15 16
16using namespace Opie; 17using namespace Opie;
17using namespace Opie::Ui; 18using namespace Opie::Ui;
18IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) 19IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
19{ 20{
20 setCaption(tr("Settings") ); 21 setCaption(tr("Settings") );
@@ -22,22 +23,35 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
22 m_config->setGroup("OpieIRC"); 23 m_config->setGroup("OpieIRC");
23 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 24 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
24 OTabWidget *tw = new OTabWidget(this); 25 OTabWidget *tw = new OTabWidget(this);
25 l->addWidget(tw); 26 l->addWidget(tw);
26 /* General Configuration */ 27 /* General Configuration */
27 QWidget *genwidget = new QWidget(tw); 28 QWidget *genwidget = new QWidget(tw);
28 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0); 29 QGridLayout *layout = new QGridLayout(genwidget, 1, 4, 5, 0);
29 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); 30 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
30 layout->addWidget(label, 0, 0); 31 layout->addWidget(label, 0, 0);
31 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); 32 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
32 QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this")); 33 QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this"));
33 QIntValidator *validator = new QIntValidator(this); 34 QIntValidator *validator = new QIntValidator(this);
34 validator->setTop(10000); 35 validator->setTop(10000);
35 validator->setBottom(0); 36 validator->setBottom(0);
36 m_lines->setValidator(validator); 37 m_lines->setValidator(validator);
37 layout->addWidget(m_lines, 0, 1); 38 layout->addWidget(m_lines, 0, 1);
39
40 /*
41 * include timestamp
42 */
43 m_displayTime = new QCheckBox( tr("Display time in chat log"), genwidget );
44 m_displayTime->setChecked( m_config->readBoolEntry("DisplayTime", false) );
45 layout->addMultiCellWidget(m_displayTime, 1, 1, 0, 4 );
46
47 // add a spacer
48 layout->addItem( new QSpacerItem(1,1, QSizePolicy::Minimum,
49 QSizePolicy::MinimumExpanding),
50 2, 0 );
51
38 tw->addTab(genwidget, "opieirc/settings", tr("General")); 52 tw->addTab(genwidget, "opieirc/settings", tr("General"));
39 53
40 /* Color configuration */ 54 /* Color configuration */
41 QScrollView *view = new QScrollView(this); 55 QScrollView *view = new QScrollView(this);
42 view->setResizePolicy(QScrollView::AutoOneFit); 56 view->setResizePolicy(QScrollView::AutoOneFit);
43 view->setFrameStyle( QFrame::NoFrame ); 57 view->setFrameStyle( QFrame::NoFrame );
@@ -114,12 +128,14 @@ void IRCSettings::accept()
114 m_config->writeEntry("ErrorColor", IRCTab::m_errorColor); 128 m_config->writeEntry("ErrorColor", IRCTab::m_errorColor);
115 m_config->writeEntry("SelfColor", IRCTab::m_selfColor); 129 m_config->writeEntry("SelfColor", IRCTab::m_selfColor);
116 m_config->writeEntry("OtherColor", IRCTab::m_otherColor); 130 m_config->writeEntry("OtherColor", IRCTab::m_otherColor);
117 m_config->writeEntry("ServerColor", IRCTab::m_serverColor); 131 m_config->writeEntry("ServerColor", IRCTab::m_serverColor);
118 m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor); 132 m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor);
119 m_config->writeEntry("Lines", m_lines->text()); 133 m_config->writeEntry("Lines", m_lines->text());
134 m_config->writeEntry("DisplayTime", m_displayTime->isChecked() );
135 IRCTab::setUseTimeStamps(m_displayTime->isChecked());
120 IRCHistoryLineEdit::keyConfigInstance()->save(); 136 IRCHistoryLineEdit::keyConfigInstance()->save();
121 137
122 QDialog::accept(); 138 QDialog::accept();
123} 139}
124 140
125IRCSettings::~IRCSettings() 141IRCSettings::~IRCSettings()