summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmisc.cpp29
-rw-r--r--noncore/net/opieirc/ircmisc.h21
-rw-r--r--noncore/net/opieirc/ircsettings.cpp71
-rw-r--r--noncore/net/opieirc/ircsettings.h21
-rw-r--r--noncore/net/opieirc/mainwindow.cpp2
-rw-r--r--noncore/net/opieirc/opie-irc.control2
6 files changed, 47 insertions, 99 deletions
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index f94cf1b..a15a790 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -1,2 +1 @@
1#include <opie/colordialog.h>
2#include <qlayout.h> #include <qlayout.h>
@@ -5,30 +4,2 @@
5 4
6IRCColorLabel::IRCColorLabel(QColor color, QWidget *parent, const char *name, WFlags f) : QLabel(parent, name, f) {
7 m_color = color;
8 setAlignment(AlignVCenter | AlignCenter);
9 setFrameStyle(QFrame::StyledPanel);
10 setFrameShadow(QFrame::Sunken);
11 setBackgroundColor(m_color);
12}
13
14void IRCColorLabel::mousePressEvent(QMouseEvent *) {
15 m_color = OColorDialog::getColor(m_color);
16 setBackgroundColor(m_color);
17}
18
19QColor IRCColorLabel::color() {
20 return m_color;
21}
22
23IRCFramedColorLabel::IRCFramedColorLabel(QColor color, QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) {
24 QVBoxLayout *layout = new QVBoxLayout(this, 10, 0);
25 m_label = new IRCColorLabel(color, this);
26 layout->addWidget(m_label);
27}
28
29QColor IRCFramedColorLabel::color() {
30 return m_label->color();
31}
32
33
34IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) { 5IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) {
diff --git a/noncore/net/opieirc/ircmisc.h b/noncore/net/opieirc/ircmisc.h
index 6a8db50..b4a5b06 100644
--- a/noncore/net/opieirc/ircmisc.h
+++ b/noncore/net/opieirc/ircmisc.h
@@ -30,23 +30,2 @@
30 30
31/* IRCFramedColorLabel is used to display a color */
32
33class IRCColorLabel : public QLabel {
34 Q_OBJECT
35public:
36 IRCColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
37 QColor color();
38 void mousePressEvent(QMouseEvent *event);
39protected:
40 QColor m_color;
41};
42
43class IRCFramedColorLabel : public QWidget {
44 Q_OBJECT
45public:
46 IRCFramedColorLabel(QColor color, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
47 QColor color();
48protected:
49 IRCColorLabel *m_label;
50};
51
52/* Custom colored QTabWidget */ 31/* Custom colored QTabWidget */
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index 78eaed3..b110a5b 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -1 +1,3 @@
1#include <opie/ocolorbutton.h>
2#include <opie/otabwidget.h>
1#include <qlayout.h> 3#include <qlayout.h>
@@ -13,10 +15,10 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
13 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 15 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
14 QTabWidget *tw = new QTabWidget(this); 16 OTabWidget *tw = new OTabWidget(this);
15 l->addWidget(tw); 17 l->addWidget(tw);
16 /* General Configuration */ 18 /* General Configuration */
17 QWidget *widget = new QWidget(tw); 19 QWidget *genwidget = new QWidget(tw);
18 QGridLayout *layout = new QGridLayout(widget, 1, 2, 5, 0); 20 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0);
19 QLabel *label = new QLabel(tr("Lines displayed :"), widget); 21 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
20 layout->addWidget(label, 0, 0); 22 layout->addWidget(label, 0, 0);
21 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), widget); 23 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
22 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")); 24 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"));
@@ -27,8 +29,9 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
27 layout->addWidget(m_lines, 0, 1); 29 layout->addWidget(m_lines, 0, 1);
28 tw->addTab(widget, tr("General")); 30 tw->addTab(genwidget, "opieirc/settings", tr("General"));
29 31
30 /* Color configuration */ 32 /* Color configuration */
31 QScrollView *view = new QScrollView(tw); 33 QScrollView *view = new QScrollView(this);
32 view->setResizePolicy(QScrollView::AutoOneFit); 34 view->setResizePolicy(QScrollView::AutoOneFit);
33 widget = new QWidget(view->viewport()); 35 view->setFrameStyle( QFrame::NoFrame );
36 QWidget *widget = new QWidget(view->viewport());
34 view->addChild(widget); 37 view->addChild(widget);
@@ -37,3 +40,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
37 layout->addWidget(label, 0, 0); 40 layout->addWidget(label, 0, 0);
38 m_background = new IRCFramedColorLabel(QColor(m_config->readEntry("BackgroundColor", "#FFFFFF")), widget); 41 m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF"));
39 QWhatsThis::add(m_background, tr("Background color to be used in chats")); 42 QWhatsThis::add(m_background, tr("Background color to be used in chats"));
@@ -42,3 +45,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
42 layout->addWidget(label, 1, 0); 45 layout->addWidget(label, 1, 0);
43 m_text = new IRCFramedColorLabel(m_config->readEntry("TextColor", "#000000"), widget); 46 m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000"));
44 QWhatsThis::add(m_text, tr("Text color to be used in chats")); 47 QWhatsThis::add(m_text, tr("Text color to be used in chats"));
@@ -47,3 +50,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
47 layout->addWidget(label, 2, 0); 50 layout->addWidget(label, 2, 0);
48 m_error = new IRCFramedColorLabel(m_config->readEntry("ErrorColor", "#FF0000"), widget); 51 m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000"));
49 QWhatsThis::add(m_error, tr("Text color to be used to display errors")); 52 QWhatsThis::add(m_error, tr("Text color to be used to display errors"));
@@ -52,3 +55,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
52 layout->addWidget(label, 3, 0); 55 layout->addWidget(label, 3, 0);
53 m_self = new IRCFramedColorLabel(m_config->readEntry("SelfColor", "#CC0000"), widget); 56 m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000"));
54 QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself")); 57 QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself"));
@@ -57,3 +60,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
57 layout->addWidget(label, 4, 0); 60 layout->addWidget(label, 4, 0);
58 m_other = new IRCFramedColorLabel(m_config->readEntry("OtherColor", "#0000BB"), widget); 61 m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB"));
59 QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others")); 62 QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others"));
@@ -62,3 +65,3 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
62 layout->addWidget(label, 5, 0); 65 layout->addWidget(label, 5, 0);
63 m_server = new IRCFramedColorLabel(m_config->readEntry("ServerColor", "#0000FF"), widget); 66 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")); 67 QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server"));
@@ -67,6 +70,7 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
67 layout->addWidget(label, 6, 0); 70 layout->addWidget(label, 6, 0);
68 m_notification = new IRCFramedColorLabel(m_config->readEntry("NotificationColor", "#AAE300"), widget); 71 m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300"));
69 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); 72 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications"));
70 layout->addWidget(m_notification, 6, 1); 73 layout->addWidget(m_notification, 6, 1);
71 tw->addTab(view, tr("Colors")); 74 tw->addTab(view, "opieirc/colors", tr("Colors"));
75 tw->setCurrentTab( genwidget );
72 showMaximized(); 76 showMaximized();
@@ -74,25 +78,18 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags)
74 78
75QString IRCSettings::getColorString(QWidget *widget) {
76 QColor color = ((IRCFramedColorLabel *)widget)->color();
77 QString temp;
78 temp.sprintf("#%02x%02x%02x", color.red(), color.green(), color.blue());
79 return temp;
80}
81
82void IRCSettings::accept() { 79void IRCSettings::accept() {
83 IRCTab::m_backgroundColor = getColorString(m_background); 80 IRCTab::m_backgroundColor = m_background->color().name();
84 IRCTab::m_textColor = getColorString(m_text); 81 IRCTab::m_textColor = m_text->color().name();
85 IRCTab::m_errorColor = getColorString(m_error); 82 IRCTab::m_errorColor = m_error->color().name();
86 IRCTab::m_selfColor = getColorString(m_self); 83 IRCTab::m_selfColor = m_self->color().name();
87 IRCTab::m_otherColor = getColorString(m_other); 84 IRCTab::m_otherColor = m_other->color().name();
88 IRCTab::m_serverColor = getColorString(m_server); 85 IRCTab::m_serverColor = m_server->color().name();
89 IRCTab::m_notificationColor = getColorString(m_notification); 86 IRCTab::m_notificationColor = m_notification->color().name();
90 IRCTab::m_maxLines = m_lines->text().toInt(); 87 IRCTab::m_maxLines = m_lines->text().toInt();
91 m_config->writeEntry("BackgroundColor", getColorString(m_background)); 88 m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor);
92 m_config->writeEntry("TextColor", getColorString(m_text)); 89 m_config->writeEntry("TextColor", IRCTab::m_textColor);
93 m_config->writeEntry("ErrorColor", getColorString(m_error)); 90 m_config->writeEntry("ErrorColor", IRCTab::m_errorColor);
94 m_config->writeEntry("SelfColor", getColorString(m_self)); 91 m_config->writeEntry("SelfColor", IRCTab::m_selfColor);
95 m_config->writeEntry("OtherColor", getColorString(m_other)); 92 m_config->writeEntry("OtherColor", IRCTab::m_otherColor);
96 m_config->writeEntry("ServerColor", getColorString(m_server)); 93 m_config->writeEntry("ServerColor", IRCTab::m_serverColor);
97 m_config->writeEntry("NotificationColor", getColorString(m_notification)); 94 m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor);
98 m_config->writeEntry("Lines", m_lines->text()); 95 m_config->writeEntry("Lines", m_lines->text());
diff --git a/noncore/net/opieirc/ircsettings.h b/noncore/net/opieirc/ircsettings.h
index 190abaf..cb8d896 100644
--- a/noncore/net/opieirc/ircsettings.h
+++ b/noncore/net/opieirc/ircsettings.h
@@ -27,2 +27,4 @@
27 27
28class OColorButton;
29
28class IRCSettings : public QDialog { 30class IRCSettings : public QDialog {
@@ -31,3 +33,2 @@ public:
31 IRCSettings(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0); 33 IRCSettings(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0);
32 QString getColorString(QWidget *widget);
33 ~IRCSettings(); 34 ~IRCSettings();
@@ -36,11 +37,11 @@ protected slots:
36protected: 37protected:
37 Config *m_config; 38 Config *m_config;
38 QWidget *m_background; 39 OColorButton *m_background;
39 QWidget *m_text; 40 OColorButton *m_text;
40 QWidget *m_error; 41 OColorButton *m_error;
41 QWidget *m_self; 42 OColorButton *m_self;
42 QWidget *m_server; 43 OColorButton *m_server;
43 QWidget *m_other; 44 OColorButton *m_other;
44 QWidget *m_notification; 45 OColorButton *m_notification;
45 QLineEdit *m_lines; 46 QLineEdit *m_lines;
46}; 47};
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index 7928310..c0e2ff1 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -25,3 +25,3 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
25 a->addTo(irc); 25 a->addTo(irc);
26 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); 26 a = new QAction(tr("Settings"), Resource::loadPixmap("opieirc/settings"), QString::null, 0, this, 0);
27 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); 27 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
diff --git a/noncore/net/opieirc/opie-irc.control b/noncore/net/opieirc/opie-irc.control
index 0bcdecd..b0cdfde 100644
--- a/noncore/net/opieirc/opie-irc.control
+++ b/noncore/net/opieirc/opie-irc.control
@@ -6,3 +6,3 @@ Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION)
8Description: The Opie IRC client lets you chat on your favorite IRC server using your handheld computer 8Description: The Opie IRC client lets you chat on your favorite IRC server using your handheld computer