summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmisc.cpp16
-rw-r--r--noncore/net/opieirc/ircmisc.h3
-rw-r--r--noncore/net/opieirc/ircservereditor.cpp10
-rw-r--r--noncore/net/opieirc/ircserverlist.cpp7
-rw-r--r--noncore/net/opieirc/ircsettings.cpp11
-rw-r--r--noncore/net/opieirc/mainwindow.cpp6
6 files changed, 48 insertions, 5 deletions
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index 2e7f316..c8e6190 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -70,8 +70,9 @@ void IRCTabWidget::setTabColor(int index, QColor color) {
70 70
71 71
72IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) { 72IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) {
73 m_index = -1; 73 m_index = -1;
74 installEventFilter(this);
74} 75}
75 76
76void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { 77void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
77 int key = event->key(); 78 int key = event->key();
@@ -91,7 +92,22 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
91 } 92 }
92 } else if (key == Key_Return) { 93 } else if (key == Key_Return) {
93 m_history.prepend(text()); 94 m_history.prepend(text());
94 m_index = -1; 95 m_index = -1;
96 } else if (key == Key_Tab) {
97 printf("got tab\n");
98 return;
95 } 99 }
96 QLineEdit::keyPressEvent(event); 100 QLineEdit::keyPressEvent(event);
97} 101}
102
103bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
104 if (event->type() == QEvent::KeyPress) {
105 QKeyEvent *k = (QKeyEvent *) event;
106 /* Catch tab characters */
107 if (k->key() == Key_Tab) {
108 qDebug("tab!");
109 return TRUE;
110 }
111 }
112 return QLineEdit::eventFilter(object, event);
113}
diff --git a/noncore/net/opieirc/ircmisc.h b/noncore/net/opieirc/ircmisc.h
index 7151e6b..6a8db50 100644
--- a/noncore/net/opieirc/ircmisc.h
+++ b/noncore/net/opieirc/ircmisc.h
@@ -74,14 +74,15 @@ protected:
74protected: 74protected:
75 QArray<QColor> m_colors; 75 QArray<QColor> m_colors;
76}; 76};
77 77
78/* A QLineEdit with history functionality */ 78/* A QLineEdit with history functionality and tab completion */
79 79
80class IRCHistoryLineEdit : public QLineEdit { 80class IRCHistoryLineEdit : public QLineEdit {
81 Q_OBJECT 81 Q_OBJECT
82public: 82public:
83 IRCHistoryLineEdit(QWidget *parent = 0, const char *name = 0); 83 IRCHistoryLineEdit(QWidget *parent = 0, const char *name = 0);
84 virtual bool eventFilter(QObject *object, QEvent *event);
84protected: 85protected:
85 void keyPressEvent(QKeyEvent *); 86 void keyPressEvent(QKeyEvent *);
86protected: 87protected:
87 QStringList m_history; 88 QStringList m_history;
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp
index f976c84..8604835 100644
--- a/noncore/net/opieirc/ircservereditor.cpp
+++ b/noncore/net/opieirc/ircservereditor.cpp
@@ -1,37 +1,45 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include <qlayout.h> 2#include <qlayout.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qwhatsthis.h>
4#include "ircservereditor.h" 5#include "ircservereditor.h"
5 6
6IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal = FALSE, WFlags f) : QDialog(parent, name, modal, f) { 7IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal = FALSE, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
7 QGridLayout *layout = new QGridLayout(this, 7, 2, 5, 5); 8 QGridLayout *layout = new QGridLayout(this, 7, 2, 5, 5);
8 QLabel *label = new QLabel(tr("Profile name :"), this); 9 QLabel *label = new QLabel(tr("Profile name :"), this);
9 m_name = new QLineEdit(server.name(), this); 10 m_name = new QLineEdit(server.name(), this);
11 QWhatsThis::add(m_name, tr("The name of this server profile in the overview"));
10 layout->addWidget(label, 0, 0); 12 layout->addWidget(label, 0, 0);
11 layout->addWidget(m_name, 0, 1); 13 layout->addWidget(m_name, 0, 1);
12 label = new QLabel(tr("Hostname :"), this); 14 label = new QLabel(tr("Hostname :"), this);
13 m_hostname = new QLineEdit(server.hostname(), this); 15 m_hostname = new QLineEdit(server.hostname(), this);
16 QWhatsThis::add(m_hostname, tr("The server to connect to - can be any valid host name or IP address"));
14 layout->addWidget(label, 1, 0); 17 layout->addWidget(label, 1, 0);
15 layout->addWidget(m_hostname, 1, 1); 18 layout->addWidget(m_hostname, 1, 1);
16 label = new QLabel(tr("Port :"), this); 19 label = new QLabel(tr("Port :"), this);
17 m_port = new QLineEdit(QString::number(server.port()), this); 20 m_port = new QLineEdit(QString::number(server.port()), this);
21 QWhatsThis::add(m_port, tr("The server port to connect to. Usually 6667"));
18 layout->addWidget(label, 2, 0); 22 layout->addWidget(label, 2, 0);
19 layout->addWidget(m_port, 2, 1); 23 layout->addWidget(m_port, 2, 1);
20 label = new QLabel(tr("Nickname :"), this); 24 label = new QLabel(tr("Nickname :"), this);
21 m_nickname = new QLineEdit(server.nick(), this); 25 m_nickname = new QLineEdit(server.nick(), this);
26 QWhatsThis::add(m_nickname, tr("Your nick name on the IRC network"));
22 layout->addWidget(label, 3, 0); 27 layout->addWidget(label, 3, 0);
23 layout->addWidget(m_nickname, 3, 1); 28 layout->addWidget(m_nickname, 3, 1);
24 label = new QLabel(tr("Realname :"), this); 29 label = new QLabel(tr("Realname :"), this);
25 m_realname = new QLineEdit(server.realname(), this); 30 m_realname = new QLineEdit(server.realname(), this);
31 QWhatsThis::add(m_realname, tr("Your real name"));
26 layout->addWidget(label, 4, 0); 32 layout->addWidget(label, 4, 0);
27 layout->addWidget(m_realname, 4, 1); 33 layout->addWidget(m_realname, 4, 1);
28 label = new QLabel(tr("Password :"), this); 34 label = new QLabel(tr("Password :"), this);
29 m_password = new QLineEdit(server.password(), this); 35 m_password = new QLineEdit(server.password(), this);
36 QWhatsThis::add(m_password, tr("Password to connect to the server (if required)"));
30 layout->addWidget(label, 5, 0); 37 layout->addWidget(label, 5, 0);
31 layout->addWidget(m_password, 5, 1); 38 layout->addWidget(m_password, 5, 1);
32 label = new QLabel(tr("Channels :"), this); 39 label = new QLabel(tr("Channels :"), this);
33 m_channels = new QLineEdit(server.channels(), this); 40 m_channels = new QLineEdit(server.channels(), this);
41 QWhatsThis::add(m_channels, tr("Comma-Separated list of all channels you would like to join automatically"));
34 layout->addWidget(label, 6, 0); 42 layout->addWidget(label, 6, 0);
35 layout->addWidget(m_channels, 6, 1); 43 layout->addWidget(m_channels, 6, 1);
36 setCaption(tr("Edit server information")); 44 setCaption(tr("Edit server information"));
37 showMaximized(); 45 showMaximized();
diff --git a/noncore/net/opieirc/ircserverlist.cpp b/noncore/net/opieirc/ircserverlist.cpp
index 3293591..595ae3e 100644
--- a/noncore/net/opieirc/ircserverlist.cpp
+++ b/noncore/net/opieirc/ircserverlist.cpp
@@ -1,8 +1,9 @@
1#include <qlayout.h> 1#include <qlayout.h>
2#include <qlabel.h> 2#include <qlabel.h>
3#include <qhbox.h> 3#include <qhbox.h>
4#include <qpushbutton.h> 4#include <qpushbutton.h>
5#include <qwhatsthis.h>
5#include "ircserverlist.h" 6#include "ircserverlist.h"
6#include "ircservereditor.h" 7#include "ircservereditor.h"
7 8
8class IRCListBoxServer : public QListBoxText { 9class IRCListBoxServer : public QListBoxText {
@@ -22,20 +23,24 @@ public:
22protected: 23protected:
23 IRCServer m_server; 24 IRCServer m_server;
24}; 25};
25 26
26IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags f) : QDialog(parent, name, modal, f) { 27IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
27 QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); 28 QVBoxLayout *layout = new QVBoxLayout(this, 5, 5);
28 setCaption(tr("Serverlist Browser")); 29 setCaption(tr("Serverlist Browser"));
29 QLabel *label = new QLabel(tr("Please choose a server profile"), this); 30 QLabel *label = new QLabel(tr("Please choose a server profile"), this);
30 label->setAlignment(AlignHCenter); 31 label->setAlignment(AlignHCenter);
31 layout->addWidget(label); 32 layout->addWidget(label);
32 m_list = new QListBox(this); 33 m_list = new QListBox(this);
34 QWhatsThis::add(m_list, tr("Select a server profile from this list and then tap on OK in the upper-right corner"));
33 layout->addWidget(m_list); 35 layout->addWidget(m_list);
34 QHBox *buttons = new QHBox(this); 36 QHBox *buttons = new QHBox(this);
35 QPushButton *del = new QPushButton(tr("Delete"), buttons); 37 QPushButton *del = new QPushButton(tr("Delete"), buttons);
36 QPushButton *edit = new QPushButton(tr("Edit"), buttons); 38 QPushButton *edit = new QPushButton(tr("Edit"), buttons);
37 QPushButton *add = new QPushButton(tr("Add"), buttons); 39 QPushButton *add = new QPushButton(tr("Add"), buttons);
40 QWhatsThis::add(del, tr("Delete the currently selected server profile"));
41 QWhatsThis::add(edit, tr("Edit the currently selected server profile"));
42 QWhatsThis::add(add, tr("Add a new server profile"));
38 connect(del, SIGNAL(clicked()), this, SLOT(delServer())); 43 connect(del, SIGNAL(clicked()), this, SLOT(delServer()));
39 connect(edit, SIGNAL(clicked()), this, SLOT(editServer())); 44 connect(edit, SIGNAL(clicked()), this, SLOT(editServer()));
40 connect(add, SIGNAL(clicked()), this, SLOT(addServer())); 45 connect(add, SIGNAL(clicked()), this, SLOT(addServer()));
41 layout->addWidget(buttons); 46 layout->addWidget(buttons);
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index 1903e87..78eaed3 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -1,12 +1,13 @@
1#include <qlayout.h> 1#include <qlayout.h>
2#include <qvalidator.h> 2#include <qvalidator.h>
3#include <qscrollview.h> 3#include <qscrollview.h>
4#include <qwhatsthis.h>
4#include "ircsettings.h" 5#include "ircsettings.h"
5#include "irctab.h" 6#include "irctab.h"
6#include "ircmisc.h" 7#include "ircmisc.h"
7 8
8IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags f) : QDialog(parent, name, modal, f) { 9IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
9 setCaption("Settings"); 10 setCaption("Settings");
10 m_config = new Config("OpieIRC"); 11 m_config = new Config("OpieIRC");
11 m_config->setGroup("OpieIRC"); 12 m_config->setGroup("OpieIRC");
12 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 13 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
@@ -17,8 +18,9 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags f
17 QGridLayout *layout = new QGridLayout(widget, 1, 2, 5, 0); 18 QGridLayout *layout = new QGridLayout(widget, 1, 2, 5, 0);
18 QLabel *label = new QLabel(tr("Lines displayed :"), widget); 19 QLabel *label = new QLabel(tr("Lines displayed :"), widget);
19 layout->addWidget(label, 0, 0); 20 layout->addWidget(label, 0, 0);
20 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), widget); 21 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), widget);
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"));
21 QIntValidator *validator = new QIntValidator(this); 23 QIntValidator *validator = new QIntValidator(this);
22 validator->setTop(10000); 24 validator->setTop(10000);
23 validator->setBottom(0); 25 validator->setBottom(0);
24 m_lines->setValidator(validator); 26 m_lines->setValidator(validator);
@@ -33,32 +35,39 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags f
33 layout = new QGridLayout(widget, 7, 2, 5, 0); 35 layout = new QGridLayout(widget, 7, 2, 5, 0);
34 label = new QLabel(tr("Background color :"), widget); 36 label = new QLabel(tr("Background color :"), widget);
35 layout->addWidget(label, 0, 0); 37 layout->addWidget(label, 0, 0);
36 m_background = new IRCFramedColorLabel(QColor(m_config->readEntry("BackgroundColor", "#FFFFFF")), widget); 38 m_background = new IRCFramedColorLabel(QColor(m_config->readEntry("BackgroundColor", "#FFFFFF")), widget);
39 QWhatsThis::add(m_background, tr("Background color to be used in chats"));
37 layout->addWidget(m_background, 0, 1); 40 layout->addWidget(m_background, 0, 1);
38 label = new QLabel(tr("Normal text color :"), widget); 41 label = new QLabel(tr("Normal text color :"), widget);
39 layout->addWidget(label, 1, 0); 42 layout->addWidget(label, 1, 0);
40 m_text = new IRCFramedColorLabel(m_config->readEntry("TextColor", "#000000"), widget); 43 m_text = new IRCFramedColorLabel(m_config->readEntry("TextColor", "#000000"), widget);
44 QWhatsThis::add(m_text, tr("Text color to be used in chats"));
41 layout->addWidget(m_text, 1, 1); 45 layout->addWidget(m_text, 1, 1);
42 label = new QLabel(tr("Error color :"), widget); 46 label = new QLabel(tr("Error color :"), widget);
43 layout->addWidget(label, 2, 0); 47 layout->addWidget(label, 2, 0);
44 m_error = new IRCFramedColorLabel(m_config->readEntry("ErrorColor", "#FF0000"), widget); 48 m_error = new IRCFramedColorLabel(m_config->readEntry("ErrorColor", "#FF0000"), widget);
49 QWhatsThis::add(m_error, tr("Text color to be used to display errors"));
45 layout->addWidget(m_error, 2, 1); 50 layout->addWidget(m_error, 2, 1);
46 label = new QLabel(tr("Text written by yourself :"), widget); 51 label = new QLabel(tr("Text written by yourself :"), widget);
47 layout->addWidget(label, 3, 0); 52 layout->addWidget(label, 3, 0);
48 m_self = new IRCFramedColorLabel(m_config->readEntry("SelfColor", "#CC0000"), widget); 53 m_self = new IRCFramedColorLabel(m_config->readEntry("SelfColor", "#CC0000"), widget);
54 QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself"));
49 layout->addWidget(m_self, 3, 1); 55 layout->addWidget(m_self, 3, 1);
50 label = new QLabel(tr("Text written by others :"), widget); 56 label = new QLabel(tr("Text written by others :"), widget);
51 layout->addWidget(label, 4, 0); 57 layout->addWidget(label, 4, 0);
52 m_other = new IRCFramedColorLabel(m_config->readEntry("OtherColor", "#0000BB"), widget); 58 m_other = new IRCFramedColorLabel(m_config->readEntry("OtherColor", "#0000BB"), widget);
59 QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others"));
53 layout->addWidget(m_other, 4, 1); 60 layout->addWidget(m_other, 4, 1);
54 label = new QLabel(tr("Text written by the server :"), widget); 61 label = new QLabel(tr("Text written by the server :"), widget);
55 layout->addWidget(label, 5, 0); 62 layout->addWidget(label, 5, 0);
56 m_server = new IRCFramedColorLabel(m_config->readEntry("ServerColor", "#0000FF"), widget); 63 m_server = new IRCFramedColorLabel(m_config->readEntry("ServerColor", "#0000FF"), widget);
64 QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server"));
57 layout->addWidget(m_server, 5, 1); 65 layout->addWidget(m_server, 5, 1);
58 label = new QLabel(tr("Notifications :"), widget); 66 label = new QLabel(tr("Notifications :"), widget);
59 layout->addWidget(label, 6, 0); 67 layout->addWidget(label, 6, 0);
60 m_notification = new IRCFramedColorLabel(m_config->readEntry("NotificationColor", "#AAE300"), widget); 68 m_notification = new IRCFramedColorLabel(m_config->readEntry("NotificationColor", "#AAE300"), widget);
69 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications"));
61 layout->addWidget(m_notification, 6, 1); 70 layout->addWidget(m_notification, 6, 1);
62 tw->addTab(view, tr("Colors")); 71 tw->addTab(view, tr("Colors"));
63 showMaximized(); 72 showMaximized();
64} 73}
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index bb03a1c..7928310 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -1,27 +1,31 @@
1#include <qpe/qpemenubar.h> 1#include <qpe/qpemenubar.h>
2#include <qpe/resource.h> 2#include <qpe/resource.h>
3#include <qpe/config.h> 3#include <qpe/config.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qwhatsthis.h>
5 6
6#include "mainwindow.h" 7#include "mainwindow.h"
7#include "ircservertab.h" 8#include "ircservertab.h"
8#include "ircserverlist.h" 9#include "ircserverlist.h"
9#include "ircsettings.h" 10#include "ircsettings.h"
10 11
11MainWindow::MainWindow(QWidget *parent, const char *name, WFlags f) : QMainWindow(parent, name, f) { 12MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
12 setCaption(tr("IRC Client")); 13 setCaption(tr("IRC Client"));
13 m_tabWidget = new IRCTabWidget(this); 14 m_tabWidget = new IRCTabWidget(this);
15 QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here"));
14 connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *))); 16 connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *)));
15 setCentralWidget(m_tabWidget); 17 setCentralWidget(m_tabWidget);
16 setToolBarsMovable(FALSE); 18 setToolBarsMovable(FALSE);
17 QPEMenuBar *menuBar = new QPEMenuBar(this); 19 QPEMenuBar *menuBar = new QPEMenuBar(this);
18 QPopupMenu *irc = new QPopupMenu(this); 20 QPopupMenu *irc = new QPopupMenu(this);
19 menuBar->insertItem(tr("IRC"), irc); 21 menuBar->insertItem(tr("IRC"), irc);
20 QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0); 22 QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0);
21 connect(a, SIGNAL(activated()), this, SLOT(newConnection())); 23 connect(a, SIGNAL(activated()), this, SLOT(newConnection()));
24 a->setWhatsThis(tr("Create a new connection to an IRC server"));
22 a->addTo(irc); 25 a->addTo(irc);
23 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); 26 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0);
27 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
24 connect(a, SIGNAL(activated()), this, SLOT(settings())); 28 connect(a, SIGNAL(activated()), this, SLOT(settings()));
25 a->addTo(irc); 29 a->addTo(irc);
26 loadSettings(); 30 loadSettings();
27} 31}