Diffstat (limited to 'noncore/net/opieirc/ircsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircsettings.cpp | 18 |
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 @@ #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") ); @@ -22,22 +23,35 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) 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 ); @@ -114,12 +128,14 @@ void IRCSettings::accept() 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() |