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 @@ | |||
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 | ||
8 | IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { | 14 | IRCSettings::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); |
15 | /* General Configuration */ | 22 | /* General Configuration */ |
16 | QWidget *genwidget = new QWidget(tw); | 23 | QWidget *genwidget = new QWidget(tw); |
17 | QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0); | 24 | QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0); |
18 | QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); | 25 | QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); |
19 | layout->addWidget(label, 0, 0); | 26 | layout->addWidget(label, 0, 0); |
20 | m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); | 27 | m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); |
@@ -61,38 +68,41 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) | |||
61 | label = new QLabel(tr("Text written by the server :"), widget); | 68 | label = new QLabel(tr("Text written by the server :"), widget); |
62 | layout->addWidget(label, 5, 0); | 69 | layout->addWidget(label, 5, 0); |
63 | m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); | 70 | m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); |
64 | QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); | 71 | QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); |
65 | layout->addWidget(m_server, 5, 1); | 72 | layout->addWidget(m_server, 5, 1); |
66 | label = new QLabel(tr("Notifications :"), widget); | 73 | label = new QLabel(tr("Notifications :"), widget); |
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 | ||
76 | void IRCSettings::accept() { | 84 | void 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(); |
83 | IRCTab::m_notificationColor = m_notification->color().name(); | 92 | IRCTab::m_notificationColor = m_notification->color().name(); |
84 | IRCTab::m_maxLines = m_lines->text().toInt(); | 93 | IRCTab::m_maxLines = m_lines->text().toInt(); |
85 | m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor); | 94 | m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor); |
86 | m_config->writeEntry("TextColor", IRCTab::m_textColor); | 95 | m_config->writeEntry("TextColor", IRCTab::m_textColor); |
87 | m_config->writeEntry("ErrorColor", IRCTab::m_errorColor); | 96 | m_config->writeEntry("ErrorColor", IRCTab::m_errorColor); |
88 | m_config->writeEntry("SelfColor", IRCTab::m_selfColor); | 97 | m_config->writeEntry("SelfColor", IRCTab::m_selfColor); |
89 | m_config->writeEntry("OtherColor", IRCTab::m_otherColor); | 98 | m_config->writeEntry("OtherColor", IRCTab::m_otherColor); |
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 | ||
96 | IRCSettings::~IRCSettings() { | 105 | IRCSettings::~IRCSettings() |
106 | { | ||
97 | delete m_config; | 107 | delete m_config; |
98 | } | 108 | } |