Diffstat (limited to 'noncore/net/opieirc/ircsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircsettings.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp index 2862296..f69d2c4 100644 --- a/noncore/net/opieirc/ircsettings.cpp +++ b/noncore/net/opieirc/ircsettings.cpp @@ -1,20 +1,27 @@ + +#include "ircsettings.h" +#include "irctab.h" + +/* OPIE */ #include <opie/ocolorbutton.h> #include <opie/otabwidget.h> +#include <qpe/qpeapplication.h> + +/* QT */ #include <qvalidator.h> #include <qwhatsthis.h> -#include "ircsettings.h" -#include "irctab.h" -IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { +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); QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); layout->addWidget(label, 0, 0); m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); @@ -61,38 +68,41 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) label = new QLabel(tr("Text written by the server :"), widget); layout->addWidget(label, 5, 0); m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); layout->addWidget(m_server, 5, 1); label = new QLabel(tr("Notifications :"), widget); layout->addWidget(label, 6, 0); m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300")); QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); layout->addWidget(m_notification, 6, 1); tw->addTab(view, "opieirc/colors", tr("Colors")); tw->setCurrentTab( genwidget ); - showMaximized(); + + QPEApplication::showDialog( this ); } -void IRCSettings::accept() { +void IRCSettings::accept() +{ IRCTab::m_backgroundColor = m_background->color().name(); IRCTab::m_textColor = m_text->color().name(); IRCTab::m_errorColor = m_error->color().name(); IRCTab::m_selfColor = m_self->color().name(); IRCTab::m_otherColor = m_other->color().name(); IRCTab::m_serverColor = m_server->color().name(); IRCTab::m_notificationColor = m_notification->color().name(); IRCTab::m_maxLines = m_lines->text().toInt(); 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()); QDialog::accept(); } -IRCSettings::~IRCSettings() { +IRCSettings::~IRCSettings() +{ delete m_config; } |