summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsettings.cpp
Side-by-side diff
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
@@ -3,47 +3,61 @@
#include "irctab.h"
#include "ircmisc.h"
/* OPIE */
#include <opie2/ocolorbutton.h>
#include <opie2/otabwidget.h>
#include <opie2/okeyconfigwidget.h>
#include <qpe/qpeapplication.h>
/* QT */
#include <qvalidator.h>
#include <qwhatsthis.h>
+#include <qcheckbox.h>
using namespace Opie;
using namespace Opie::Ui;
IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
{
setCaption(tr("Settings") );
m_config = new Config("OpieIRC");
m_config->setGroup("OpieIRC");
QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
OTabWidget *tw = new OTabWidget(this);
l->addWidget(tw);
/* General Configuration */
QWidget *genwidget = new QWidget(tw);
- QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0);
+ QGridLayout *layout = new QGridLayout(genwidget, 1, 4, 5, 0);
QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
layout->addWidget(label, 0, 0);
m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
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"));
QIntValidator *validator = new QIntValidator(this);
validator->setTop(10000);
validator->setBottom(0);
m_lines->setValidator(validator);
layout->addWidget(m_lines, 0, 1);
+
+ /*
+ * include timestamp
+ */
+ m_displayTime = new QCheckBox( tr("Display time in chat log"), genwidget );
+ m_displayTime->setChecked( m_config->readBoolEntry("DisplayTime", false) );
+ layout->addMultiCellWidget(m_displayTime, 1, 1, 0, 4 );
+
+ // add a spacer
+ layout->addItem( new QSpacerItem(1,1, QSizePolicy::Minimum,
+ QSizePolicy::MinimumExpanding),
+ 2, 0 );
+
tw->addTab(genwidget, "opieirc/settings", tr("General"));
/* Color configuration */
QScrollView *view = new QScrollView(this);
view->setResizePolicy(QScrollView::AutoOneFit);
view->setFrameStyle( QFrame::NoFrame );
QWidget *widget = new QWidget(view->viewport());
view->addChild(widget);
layout = new QGridLayout(widget, 7, 2, 5, 0);
label = new QLabel(tr("Background color :"), widget);
layout->addWidget(label, 0, 0);
m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF"));
@@ -108,21 +122,23 @@ void IRCSettings::accept()
IRCTab::m_maxLines = m_lines->text().toInt();
m_keyConf->save();
m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor);
m_config->writeEntry("TextColor", IRCTab::m_textColor);
m_config->writeEntry("ErrorColor", IRCTab::m_errorColor);
m_config->writeEntry("SelfColor", IRCTab::m_selfColor);
m_config->writeEntry("OtherColor", IRCTab::m_otherColor);
m_config->writeEntry("ServerColor", IRCTab::m_serverColor);
m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor);
m_config->writeEntry("Lines", m_lines->text());
+ m_config->writeEntry("DisplayTime", m_displayTime->isChecked() );
+ IRCTab::setUseTimeStamps(m_displayTime->isChecked());
IRCHistoryLineEdit::keyConfigInstance()->save();
QDialog::accept();
}
IRCSettings::~IRCSettings()
{
delete m_config;
}