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.cpp22
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,14 +1,21 @@
1
2#include "ircsettings.h"
3#include "irctab.h"
4
5/* OPIE */
1#include <opie/ocolorbutton.h> 6#include <opie/ocolorbutton.h>
2#include <opie/otabwidget.h> 7#include <opie/otabwidget.h>
8#include <qpe/qpeapplication.h>
9
10/* QT */
3#include <qvalidator.h> 11#include <qvalidator.h>
4#include <qwhatsthis.h> 12#include <qwhatsthis.h>
5#include "ircsettings.h"
6#include "irctab.h"
7 13
8IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { 14IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
15{
9 setCaption(tr("Settings") ); 16 setCaption(tr("Settings") );
10 m_config = new Config("OpieIRC"); 17 m_config = new Config("OpieIRC");
11 m_config->setGroup("OpieIRC"); 18 m_config->setGroup("OpieIRC");
12 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 19 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
13 OTabWidget *tw = new OTabWidget(this); 20 OTabWidget *tw = new OTabWidget(this);
14 l->addWidget(tw); 21 l->addWidget(tw);
@@ -67,16 +74,18 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
67 layout->addWidget(label, 6, 0); 74 layout->addWidget(label, 6, 0);
68 m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300")); 75 m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300"));
69 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); 76 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications"));
70 layout->addWidget(m_notification, 6, 1); 77 layout->addWidget(m_notification, 6, 1);
71 tw->addTab(view, "opieirc/colors", tr("Colors")); 78 tw->addTab(view, "opieirc/colors", tr("Colors"));
72 tw->setCurrentTab( genwidget ); 79 tw->setCurrentTab( genwidget );
73 showMaximized(); 80
81 QPEApplication::showDialog( this );
74} 82}
75 83
76void IRCSettings::accept() { 84void IRCSettings::accept()
85{
77 IRCTab::m_backgroundColor = m_background->color().name(); 86 IRCTab::m_backgroundColor = m_background->color().name();
78 IRCTab::m_textColor = m_text->color().name(); 87 IRCTab::m_textColor = m_text->color().name();
79 IRCTab::m_errorColor = m_error->color().name(); 88 IRCTab::m_errorColor = m_error->color().name();
80 IRCTab::m_selfColor = m_self->color().name(); 89 IRCTab::m_selfColor = m_self->color().name();
81 IRCTab::m_otherColor = m_other->color().name(); 90 IRCTab::m_otherColor = m_other->color().name();
82 IRCTab::m_serverColor = m_server->color().name(); 91 IRCTab::m_serverColor = m_server->color().name();
@@ -90,9 +99,10 @@ void IRCSettings::accept() {
90 m_config->writeEntry("ServerColor", IRCTab::m_serverColor); 99 m_config->writeEntry("ServerColor", IRCTab::m_serverColor);
91 m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor); 100 m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor);
92 m_config->writeEntry("Lines", m_lines->text()); 101 m_config->writeEntry("Lines", m_lines->text());
93 QDialog::accept(); 102 QDialog::accept();
94} 103}
95 104
96IRCSettings::~IRCSettings() { 105IRCSettings::~IRCSettings()
106{
97 delete m_config; 107 delete m_config;
98} 108}