summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-08 23:25:46 (UTC)
committer harlekin <harlekin>2003-12-08 23:25:46 (UTC)
commite372949ac776a7d986cac91b2ff1a5022040d43b (patch) (unidiff)
tree4c37d554d55501e1be587828651d90722a18f681
parent92d67d6f0e34cdee111c94d2b0304768dfdea2f9 (diff)
downloadopie-e372949ac776a7d986cac91b2ff1a5022040d43b.zip
opie-e372949ac776a7d986cac91b2ff1a5022040d43b.tar.gz
opie-e372949ac776a7d986cac91b2ff1a5022040d43b.tar.bz2
remove not used includes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchannellist.cpp1
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp2
-rw-r--r--noncore/net/opieirc/ircmisc.cpp1
-rw-r--r--noncore/net/opieirc/ircservertab.cpp1
-rw-r--r--noncore/net/opieirc/ircsettings.cpp3
-rw-r--r--noncore/net/opieirc/irctab.cpp1
-rw-r--r--noncore/net/opieirc/main.cpp1
-rw-r--r--noncore/net/opieirc/mainwindow.cpp2
8 files changed, 0 insertions, 12 deletions
diff --git a/noncore/net/opieirc/ircchannellist.cpp b/noncore/net/opieirc/ircchannellist.cpp
index 566b223..4e13dee 100644
--- a/noncore/net/opieirc/ircchannellist.cpp
+++ b/noncore/net/opieirc/ircchannellist.cpp
@@ -1,48 +1,47 @@
1#include <qpe/resource.h> 1#include <qpe/resource.h>
2#include <qpixmap.h>
3#include "ircchannellist.h" 2#include "ircchannellist.h"
4 3
5IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) { 4IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) {
6 m_channel = channel; 5 m_channel = channel;
7} 6}
8 7
9void IRCChannelList::update() { 8void IRCChannelList::update() {
10 QPixmap op = Resource::loadPixmap("opieirc/op"); 9 QPixmap op = Resource::loadPixmap("opieirc/op");
11 QPixmap hop = Resource::loadPixmap("opieirc/hop"); 10 QPixmap hop = Resource::loadPixmap("opieirc/hop");
12 QPixmap voice = Resource::loadPixmap("opieirc/voice"); 11 QPixmap voice = Resource::loadPixmap("opieirc/voice");
13 QListIterator<IRCChannelPerson> it = m_channel->people(); 12 QListIterator<IRCChannelPerson> it = m_channel->people();
14 clear(); 13 clear();
15 for (; it.current(); ++it) { 14 for (; it.current(); ++it) {
16 IRCChannelPerson *person = it.current(); 15 IRCChannelPerson *person = it.current();
17 if (person->flags & PERSON_FLAG_OP) { 16 if (person->flags & PERSON_FLAG_OP) {
18 insertItem(op, person->person->nick()); 17 insertItem(op, person->person->nick());
19 } else if (person->flags & PERSON_FLAG_HALFOP) { 18 } else if (person->flags & PERSON_FLAG_HALFOP) {
20 insertItem(op, person->person->nick()); 19 insertItem(op, person->person->nick());
21 } else if (person->flags & PERSON_FLAG_VOICE) { 20 } else if (person->flags & PERSON_FLAG_VOICE) {
22 insertItem(voice, person->person->nick()); 21 insertItem(voice, person->person->nick());
23 } else { 22 } else {
24 insertItem(person->person->nick()); 23 insertItem(person->person->nick());
25 } 24 }
26 } 25 }
27 sort(); 26 sort();
28} 27}
29 28
30 29
31bool IRCChannelList::hasPerson(QString nick) { 30bool IRCChannelList::hasPerson(QString nick) {
32 for (unsigned int i=0; i<count(); i++) { 31 for (unsigned int i=0; i<count(); i++) {
33 if (text(i) == nick) 32 if (text(i) == nick)
34 return TRUE; 33 return TRUE;
35 } 34 }
36 return FALSE; 35 return FALSE;
37} 36}
38 37
39bool IRCChannelList::removePerson(QString nick) { 38bool IRCChannelList::removePerson(QString nick) {
40 for (unsigned int i=0; i<count(); i++) { 39 for (unsigned int i=0; i<count(); i++) {
41 if (text(i) == nick){ 40 if (text(i) == nick){
42 removeItem(i); 41 removeItem(i);
43 return TRUE; 42 return TRUE;
44 } 43 }
45 } 44 }
46 return FALSE; 45 return FALSE;
47} 46}
48 47
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index 2b8b65e..b0771f6 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -1,67 +1,65 @@
1#include <qpe/qpeapplication.h>
2#include <qpe/resource.h> 1#include <qpe/resource.h>
3#include <qcursor.h>
4#include <qwhatsthis.h> 2#include <qwhatsthis.h>
5#include <qhbox.h> 3#include <qhbox.h>
6#include "ircchanneltab.h" 4#include "ircchanneltab.h"
7#include "ircservertab.h" 5#include "ircservertab.h"
8 6
9IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 7IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
10 m_mainWindow = mainWindow; 8 m_mainWindow = mainWindow;
11 m_parentTab = parentTab; 9 m_parentTab = parentTab;
12 m_channel = channel; 10 m_channel = channel;
13 m_description->setText(tr("Talking on channel") + " <b>" + channel->channelname() + "</b>"); 11 m_description->setText(tr("Talking on channel") + " <b>" + channel->channelname() + "</b>");
14 QHBox *hbox = new QHBox(this); 12 QHBox *hbox = new QHBox(this);
15 m_textview = new QTextView(hbox); 13 m_textview = new QTextView(hbox);
16 m_textview->setHScrollBarMode(QScrollView::AlwaysOff); 14 m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
17 m_textview->setVScrollBarMode(QScrollView::AlwaysOn); 15 m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
18 m_listVisible = TRUE; 16 m_listVisible = TRUE;
19 m_listButton = new QPushButton(">", m_textview); 17 m_listButton = new QPushButton(">", m_textview);
20 m_textview->setCornerWidget(m_listButton); 18 m_textview->setCornerWidget(m_listButton);
21 m_textview->setTextFormat(RichText); 19 m_textview->setTextFormat(RichText);
22 QWhatsThis::add(m_textview, tr("Channel discussion")); 20 QWhatsThis::add(m_textview, tr("Channel discussion"));
23 connect(m_listButton, SIGNAL(clicked()), this, SLOT(toggleList())); 21 connect(m_listButton, SIGNAL(clicked()), this, SLOT(toggleList()));
24 m_list = new IRCChannelList(m_channel, hbox); 22 m_list = new IRCChannelList(m_channel, hbox);
25 m_list->update(); 23 m_list->update();
26 m_list->setMaximumWidth(LISTWIDTH); 24 m_list->setMaximumWidth(LISTWIDTH);
27 m_field = new IRCHistoryLineEdit(this); 25 m_field = new IRCHistoryLineEdit(this);
28 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion")); 26 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion"));
29 m_popup = new QPopupMenu(m_list); 27 m_popup = new QPopupMenu(m_list);
30 m_lines = 0; 28 m_lines = 0;
31 /* Required so that embedded-style "right" clicks work */ 29 /* Required so that embedded-style "right" clicks work */
32 QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold); 30 QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold);
33 connect(m_list, SIGNAL(mouseButtonPressed(int, QListBoxItem *, const QPoint&)), this, SLOT(mouseButtonPressed(int, QListBoxItem *, const QPoint &))); 31 connect(m_list, SIGNAL(mouseButtonPressed(int, QListBoxItem *, const QPoint&)), this, SLOT(mouseButtonPressed(int, QListBoxItem *, const QPoint &)));
34 /* Construct the popup menu */ 32 /* Construct the popup menu */
35 QPopupMenu *ctcpMenu = new QPopupMenu(m_list); 33 QPopupMenu *ctcpMenu = new QPopupMenu(m_list);
36 m_popup->insertItem(Resource::loadPixmap("opieirc/ctcp"), tr("CTCP"), ctcpMenu); 34 m_popup->insertItem(Resource::loadPixmap("opieirc/ctcp"), tr("CTCP"), ctcpMenu);
37 m_popup->insertItem(Resource::loadPixmap("opieirc/query"), tr("Query"), this, SLOT(popupQuery())); 35 m_popup->insertItem(Resource::loadPixmap("opieirc/query"), tr("Query"), this, SLOT(popupQuery()));
38 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/ping"), tr("Ping"), this, SLOT(popupPing())); 36 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/ping"), tr("Ping"), this, SLOT(popupPing()));
39 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/version"), tr("Version"), this, SLOT(popupVersion())); 37 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/version"), tr("Version"), this, SLOT(popupVersion()));
40 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois())); 38 ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois()));
41 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); 39 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
42 m_layout->add(hbox); 40 m_layout->add(hbox);
43 hbox->show(); 41 hbox->show();
44 m_layout->add(m_field); 42 m_layout->add(m_field);
45 m_field->setFocus(); 43 m_field->setFocus();
46 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 44 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
47 settingsChanged(); 45 settingsChanged();
48} 46}
49 47
50void IRCChannelTab::scrolling(){ 48void IRCChannelTab::scrolling(){
51 m_textview->ensureVisible(0, m_textview->contentsHeight()); 49 m_textview->ensureVisible(0, m_textview->contentsHeight());
52} 50}
53 51
54void IRCChannelTab::appendText(QString text) { 52void IRCChannelTab::appendText(QString text) {
55 /* not using append because it creates layout problems */ 53 /* not using append because it creates layout problems */
56 QString txt = m_textview->text() + text + "\n"; 54 QString txt = m_textview->text() + text + "\n";
57 if (m_maxLines > 0 && m_lines >= m_maxLines) { 55 if (m_maxLines > 0 && m_lines >= m_maxLines) {
58 int firstBreak = txt.find('\n'); 56 int firstBreak = txt.find('\n');
59 if (firstBreak != -1) { 57 if (firstBreak != -1) {
60 txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); 58 txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1));
61 } 59 }
62 } else { 60 } else {
63 m_lines++; 61 m_lines++;
64 } 62 }
65 m_textview->ensureVisible(0, m_textview->contentsHeight()); 63 m_textview->ensureVisible(0, m_textview->contentsHeight());
66 m_textview->setText(txt); 64 m_textview->setText(txt);
67 m_textview->ensureVisible(0, m_textview->contentsHeight()); 65 m_textview->ensureVisible(0, m_textview->contentsHeight());
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index a15a790..22387b3 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -1,65 +1,64 @@
1#include <qlayout.h>
2#include <stdio.h> 1#include <stdio.h>
3#include "ircmisc.h" 2#include "ircmisc.h"
4 3
5IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) { 4IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) {
6} 5}
7 6
8int IRCTabBar::insertTab(QTab *tab, int index) { 7int IRCTabBar::insertTab(QTab *tab, int index) {
9 /* FIXME: find some nicer way to do this */ 8 /* FIXME: find some nicer way to do this */
10 QExtTab *ext = new QExtTab(); 9 QExtTab *ext = new QExtTab();
11 ext->color = black; 10 ext->color = black;
12 ext->label = tab->text(); 11 ext->label = tab->text();
13 ext->r = tab->rect(); 12 ext->r = tab->rect();
14 ext->enabled = tab->isEnabled(); 13 ext->enabled = tab->isEnabled();
15 ext->iconset = tab->iconSet(); 14 ext->iconset = tab->iconSet();
16 delete tab; 15 delete tab;
17 return QTabBar::insertTab(ext, index); 16 return QTabBar::insertTab(ext, index);
18} 17}
19 18
20void IRCTabBar::setTabColor(int index, QColor color) { 19void IRCTabBar::setTabColor(int index, QColor color) {
21 ((QExtTab *)tab(index))->color = color; 20 ((QExtTab *)tab(index))->color = color;
22 update(); 21 update();
23} 22}
24 23
25void IRCTabBar::paintLabel(QPainter* p, const QRect& br, QTab* t, bool focus) const { 24void IRCTabBar::paintLabel(QPainter* p, const QRect& br, QTab* t, bool focus) const {
26 QRect r = br; 25 QRect r = br;
27 QTabBar::paintLabel(p, br, t, focus); 26 QTabBar::paintLabel(p, br, t, focus);
28 if (t->id == currentTab()) 27 if (t->id == currentTab())
29 r.setBottom(r.bottom() - style().defaultFrameWidth()); 28 r.setBottom(r.bottom() - style().defaultFrameWidth());
30 p->setPen(((QExtTab *)t)->color); 29 p->setPen(((QExtTab *)t)->color);
31 p->drawText(r, AlignCenter | ShowPrefix, t->label); 30 p->drawText(r, AlignCenter | ShowPrefix, t->label);
32} 31}
33 32
34IRCTabWidget::IRCTabWidget(QWidget *parent, const char *name) : QTabWidget(parent, name) { 33IRCTabWidget::IRCTabWidget(QWidget *parent, const char *name) : QTabWidget(parent, name) {
35 setTabBar(new IRCTabBar(this, "tab control")); 34 setTabBar(new IRCTabBar(this, "tab control"));
36} 35}
37 36
38void IRCTabWidget::setTabColor(int index, QColor color) { 37void IRCTabWidget::setTabColor(int index, QColor color) {
39 ((IRCTabBar *)tabBar())->setTabColor(index, color); 38 ((IRCTabBar *)tabBar())->setTabColor(index, color);
40} 39}
41 40
42 41
43IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) { 42IRCHistoryLineEdit::IRCHistoryLineEdit(QWidget *parent, const char *name) : QLineEdit(parent, name) {
44 m_index = -1; 43 m_index = -1;
45 installEventFilter(this); 44 installEventFilter(this);
46} 45}
47 46
48void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) { 47void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
49 int key = event->key(); 48 int key = event->key();
50 if (key == Key_Up) { 49 if (key == Key_Up) {
51 if (m_history.count() > 0 && m_index < (signed int)m_history.count()-1) { 50 if (m_history.count() > 0 && m_index < (signed int)m_history.count()-1) {
52 m_index++; 51 m_index++;
53 setText(m_history[m_index]); 52 setText(m_history[m_index]);
54 } 53 }
55 } else if (key == Key_Down) { 54 } else if (key == Key_Down) {
56 if (m_history.count() > 0 && m_index > 0) { 55 if (m_history.count() > 0 && m_index > 0) {
57 m_index--; 56 m_index--;
58 setText(m_history[m_index]); 57 setText(m_history[m_index]);
59 } 58 }
60 if (m_index == 0) { 59 if (m_index == 0) {
61 m_index = -1; 60 m_index = -1;
62 setText(""); 61 setText("");
63 } 62 }
64 } else if (key == Key_Return) { 63 } else if (key == Key_Return) {
65 m_history.prepend(text()); 64 m_history.prepend(text());
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 2c28507..d1aab40 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -1,65 +1,64 @@
1#include <qpe/config.h>
2#include <qtextstream.h> 1#include <qtextstream.h>
3#include <qwhatsthis.h> 2#include <qwhatsthis.h>
4#include "ircservertab.h" 3#include "ircservertab.h"
5 4
6IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 5IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
7 m_server = server; 6 m_server = server;
8 m_session = new IRCSession(&m_server); 7 m_session = new IRCSession(&m_server);
9 m_mainWindow = mainWindow; 8 m_mainWindow = mainWindow;
10 m_close = FALSE; 9 m_close = FALSE;
11 m_lines = 0; 10 m_lines = 0;
12 m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); 11 m_description->setText(tr("Connection to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>");
13 m_textview = new QTextView(this); 12 m_textview = new QTextView(this);
14 m_textview->setHScrollBarMode(QScrollView::AlwaysOff); 13 m_textview->setHScrollBarMode(QScrollView::AlwaysOff);
15 m_textview->setVScrollBarMode(QScrollView::AlwaysOn); 14 m_textview->setVScrollBarMode(QScrollView::AlwaysOn);
16 m_textview->setTextFormat(RichText); 15 m_textview->setTextFormat(RichText);
17 QWhatsThis::add(m_textview, tr("Server messages")); 16 QWhatsThis::add(m_textview, tr("Server messages"));
18 m_layout->add(m_textview); 17 m_layout->add(m_textview);
19 m_field = new IRCHistoryLineEdit(this); 18 m_field = new IRCHistoryLineEdit(this);
20 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help")); 19 QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help"));
21 m_layout->add(m_field); 20 m_layout->add(m_field);
22 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 21 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
23 m_field->setFocus(); 22 m_field->setFocus();
24 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); 23 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput)));
25 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); 24 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
26 settingsChanged(); 25 settingsChanged();
27} 26}
28 27
29void IRCServerTab::scrolling(){ 28void IRCServerTab::scrolling(){
30 m_textview->ensureVisible(0, m_textview->contentsHeight()); 29 m_textview->ensureVisible(0, m_textview->contentsHeight());
31} 30}
32 31
33 32
34void IRCServerTab::appendText(QString text) { 33void IRCServerTab::appendText(QString text) {
35 /* not using append because it creates layout problems */ 34 /* not using append because it creates layout problems */
36 QString txt = m_textview->text() + text + "\n"; 35 QString txt = m_textview->text() + text + "\n";
37 if (m_maxLines > 0 && m_lines >= m_maxLines) { 36 if (m_maxLines > 0 && m_lines >= m_maxLines) {
38 int firstBreak = txt.find('\n'); 37 int firstBreak = txt.find('\n');
39 if (firstBreak != -1) { 38 if (firstBreak != -1) {
40 txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); 39 txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1));
41 } 40 }
42 } else { 41 } else {
43 m_lines++; 42 m_lines++;
44 } 43 }
45 m_textview->setText(txt); 44 m_textview->setText(txt);
46 m_textview->ensureVisible(0, m_textview->contentsHeight()); 45 m_textview->ensureVisible(0, m_textview->contentsHeight());
47 emit changed(this); 46 emit changed(this);
48} 47}
49 48
50IRCServerTab::~IRCServerTab() { 49IRCServerTab::~IRCServerTab() {
51 delete m_session; 50 delete m_session;
52} 51}
53 52
54void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { 53void IRCServerTab::removeChannelTab(IRCChannelTab *tab) {
55 m_channelTabs.remove(tab); 54 m_channelTabs.remove(tab);
56} 55}
57 56
58void IRCServerTab::removeQueryTab(IRCQueryTab *tab) { 57void IRCServerTab::removeQueryTab(IRCQueryTab *tab) {
59 m_queryTabs.remove(tab); 58 m_queryTabs.remove(tab);
60} 59}
61 60
62void IRCServerTab::addQueryTab(IRCQueryTab *tab) { 61void IRCServerTab::addQueryTab(IRCQueryTab *tab) {
63 m_queryTabs.append(tab); 62 m_queryTabs.append(tab);
64} 63}
65 64
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index 70d5445..2862296 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -1,73 +1,70 @@
1#include <opie/ocolorbutton.h> 1#include <opie/ocolorbutton.h>
2#include <opie/otabwidget.h> 2#include <opie/otabwidget.h>
3#include <qlayout.h>
4#include <qvalidator.h> 3#include <qvalidator.h>
5#include <qscrollview.h>
6#include <qwhatsthis.h> 4#include <qwhatsthis.h>
7#include "ircsettings.h" 5#include "ircsettings.h"
8#include "irctab.h" 6#include "irctab.h"
9#include "ircmisc.h"
10 7
11IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { 8IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) {
12 setCaption(tr("Settings") ); 9 setCaption(tr("Settings") );
13 m_config = new Config("OpieIRC"); 10 m_config = new Config("OpieIRC");
14 m_config->setGroup("OpieIRC"); 11 m_config->setGroup("OpieIRC");
15 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 12 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
16 OTabWidget *tw = new OTabWidget(this); 13 OTabWidget *tw = new OTabWidget(this);
17 l->addWidget(tw); 14 l->addWidget(tw);
18 /* General Configuration */ 15 /* General Configuration */
19 QWidget *genwidget = new QWidget(tw); 16 QWidget *genwidget = new QWidget(tw);
20 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0); 17 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0);
21 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); 18 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
22 layout->addWidget(label, 0, 0); 19 layout->addWidget(label, 0, 0);
23 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); 20 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
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")); 21 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"));
25 QIntValidator *validator = new QIntValidator(this); 22 QIntValidator *validator = new QIntValidator(this);
26 validator->setTop(10000); 23 validator->setTop(10000);
27 validator->setBottom(0); 24 validator->setBottom(0);
28 m_lines->setValidator(validator); 25 m_lines->setValidator(validator);
29 layout->addWidget(m_lines, 0, 1); 26 layout->addWidget(m_lines, 0, 1);
30 tw->addTab(genwidget, "opieirc/settings", tr("General")); 27 tw->addTab(genwidget, "opieirc/settings", tr("General"));
31 28
32 /* Color configuration */ 29 /* Color configuration */
33 QScrollView *view = new QScrollView(this); 30 QScrollView *view = new QScrollView(this);
34 view->setResizePolicy(QScrollView::AutoOneFit); 31 view->setResizePolicy(QScrollView::AutoOneFit);
35 view->setFrameStyle( QFrame::NoFrame ); 32 view->setFrameStyle( QFrame::NoFrame );
36 QWidget *widget = new QWidget(view->viewport()); 33 QWidget *widget = new QWidget(view->viewport());
37 view->addChild(widget); 34 view->addChild(widget);
38 layout = new QGridLayout(widget, 7, 2, 5, 0); 35 layout = new QGridLayout(widget, 7, 2, 5, 0);
39 label = new QLabel(tr("Background color :"), widget); 36 label = new QLabel(tr("Background color :"), widget);
40 layout->addWidget(label, 0, 0); 37 layout->addWidget(label, 0, 0);
41 m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF")); 38 m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF"));
42 QWhatsThis::add(m_background, tr("Background color to be used in chats")); 39 QWhatsThis::add(m_background, tr("Background color to be used in chats"));
43 layout->addWidget(m_background, 0, 1); 40 layout->addWidget(m_background, 0, 1);
44 label = new QLabel(tr("Normal text color :"), widget); 41 label = new QLabel(tr("Normal text color :"), widget);
45 layout->addWidget(label, 1, 0); 42 layout->addWidget(label, 1, 0);
46 m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000")); 43 m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000"));
47 QWhatsThis::add(m_text, tr("Text color to be used in chats")); 44 QWhatsThis::add(m_text, tr("Text color to be used in chats"));
48 layout->addWidget(m_text, 1, 1); 45 layout->addWidget(m_text, 1, 1);
49 label = new QLabel(tr("Error color :"), widget); 46 label = new QLabel(tr("Error color :"), widget);
50 layout->addWidget(label, 2, 0); 47 layout->addWidget(label, 2, 0);
51 m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000")); 48 m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000"));
52 QWhatsThis::add(m_error, tr("Text color to be used to display errors")); 49 QWhatsThis::add(m_error, tr("Text color to be used to display errors"));
53 layout->addWidget(m_error, 2, 1); 50 layout->addWidget(m_error, 2, 1);
54 label = new QLabel(tr("Text written by yourself :"), widget); 51 label = new QLabel(tr("Text written by yourself :"), widget);
55 layout->addWidget(label, 3, 0); 52 layout->addWidget(label, 3, 0);
56 m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000")); 53 m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000"));
57 QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself")); 54 QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself"));
58 layout->addWidget(m_self, 3, 1); 55 layout->addWidget(m_self, 3, 1);
59 label = new QLabel(tr("Text written by others :"), widget); 56 label = new QLabel(tr("Text written by others :"), widget);
60 layout->addWidget(label, 4, 0); 57 layout->addWidget(label, 4, 0);
61 m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB")); 58 m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB"));
62 QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others")); 59 QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others"));
63 layout->addWidget(m_other, 4, 1); 60 layout->addWidget(m_other, 4, 1);
64 label = new QLabel(tr("Text written by the server :"), widget); 61 label = new QLabel(tr("Text written by the server :"), widget);
65 layout->addWidget(label, 5, 0); 62 layout->addWidget(label, 5, 0);
66 m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); 63 m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF"));
67 QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); 64 QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server"));
68 layout->addWidget(m_server, 5, 1); 65 layout->addWidget(m_server, 5, 1);
69 label = new QLabel(tr("Notifications :"), widget); 66 label = new QLabel(tr("Notifications :"), widget);
70 layout->addWidget(label, 6, 0); 67 layout->addWidget(label, 6, 0);
71 m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300")); 68 m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300"));
72 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); 69 QWhatsThis::add(m_notification, tr("Text color to be used to display notifications"));
73 layout->addWidget(m_notification, 6, 1); 70 layout->addWidget(m_notification, 6, 1);
diff --git a/noncore/net/opieirc/irctab.cpp b/noncore/net/opieirc/irctab.cpp
index 8a869d6..3351c3b 100644
--- a/noncore/net/opieirc/irctab.cpp
+++ b/noncore/net/opieirc/irctab.cpp
@@ -1,39 +1,38 @@
1#include <qpe/resource.h> 1#include <qpe/resource.h>
2#include <qpixmap.h>
3#include <qpushbutton.h> 2#include <qpushbutton.h>
4#include <qwhatsthis.h> 3#include <qwhatsthis.h>
5#include "irctab.h" 4#include "irctab.h"
6 5
7QString IRCTab::m_errorColor; 6QString IRCTab::m_errorColor;
8QString IRCTab::m_serverColor; 7QString IRCTab::m_serverColor;
9QString IRCTab::m_textColor; 8QString IRCTab::m_textColor;
10QString IRCTab::m_backgroundColor; 9QString IRCTab::m_backgroundColor;
11QString IRCTab::m_selfColor; 10QString IRCTab::m_selfColor;
12QString IRCTab::m_otherColor; 11QString IRCTab::m_otherColor;
13QString IRCTab::m_notificationColor; 12QString IRCTab::m_notificationColor;
14int IRCTab::m_maxLines; 13int IRCTab::m_maxLines;
15 14
16IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { 15IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) {
17 m_layout = new QVBoxLayout(this); 16 m_layout = new QVBoxLayout(this);
18 QHBoxLayout *descLayout = new QHBoxLayout(m_layout); 17 QHBoxLayout *descLayout = new QHBoxLayout(m_layout);
19 descLayout->setMargin(5); 18 descLayout->setMargin(5);
20 m_description = new QLabel(tr("Missing description"), this); 19 m_description = new QLabel(tr("Missing description"), this);
21 QWhatsThis::add(m_description, tr("Description of the tab's content")); 20 QWhatsThis::add(m_description, tr("Description of the tab's content"));
22 descLayout->addWidget(m_description); 21 descLayout->addWidget(m_description);
23 descLayout->setStretchFactor(m_description, 5); 22 descLayout->setStretchFactor(m_description, 5);
24 QPushButton *close = new QPushButton(this); 23 QPushButton *close = new QPushButton(this);
25 QWhatsThis::add(close, tr("Close this tab")); 24 QWhatsThis::add(close, tr("Close this tab"));
26 close->setPixmap(Resource::loadPixmap("close")); 25 close->setPixmap(Resource::loadPixmap("close"));
27 connect(close, SIGNAL(clicked()), this, SLOT(remove())); 26 connect(close, SIGNAL(clicked()), this, SLOT(remove()));
28 descLayout->addWidget(close); 27 descLayout->addWidget(close);
29 descLayout->setStretchFactor(m_description, 1); 28 descLayout->setStretchFactor(m_description, 1);
30} 29}
31 30
32 31
33void IRCTab::setID(int id) { 32void IRCTab::setID(int id) {
34 m_id = id; 33 m_id = id;
35} 34}
36 35
37int IRCTab::id() { 36int IRCTab::id() {
38 return m_id; 37 return m_id;
39} 38}
diff --git a/noncore/net/opieirc/main.cpp b/noncore/net/opieirc/main.cpp
index 39acfcc..da38024 100644
--- a/noncore/net/opieirc/main.cpp
+++ b/noncore/net/opieirc/main.cpp
@@ -1,7 +1,6 @@
1#include <qpe/qpeapplication.h>
2#include "mainwindow.h" 1#include "mainwindow.h"
3 2
4#include <opie/oapplicationfactory.h> 3#include <opie/oapplicationfactory.h>
5 4
6 5
7OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 6OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index be6f8ed..7414154 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -1,68 +1,66 @@
1#include <qmenubar.h> 1#include <qmenubar.h>
2#include <qpe/resource.h> 2#include <qpe/resource.h>
3#include <qpe/config.h>
4#include <qpopupmenu.h>
5#include <qwhatsthis.h> 3#include <qwhatsthis.h>
6 4
7#include "mainwindow.h" 5#include "mainwindow.h"
8#include "ircservertab.h" 6#include "ircservertab.h"
9#include "ircserverlist.h" 7#include "ircserverlist.h"
10#include "ircsettings.h" 8#include "ircsettings.h"
11 9
12MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 10MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
13 setCaption(tr("IRC Client")); 11 setCaption(tr("IRC Client"));
14 m_tabWidget = new IRCTabWidget(this); 12 m_tabWidget = new IRCTabWidget(this);
15 QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here")); 13 QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here"));
16 connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *))); 14 connect(m_tabWidget, SIGNAL(currentChanged(QWidget *)), this, SLOT(selected(QWidget *)));
17 setCentralWidget(m_tabWidget); 15 setCentralWidget(m_tabWidget);
18 setToolBarsMovable(FALSE); 16 setToolBarsMovable(FALSE);
19 QMenuBar *menuBar = new QMenuBar(this); 17 QMenuBar *menuBar = new QMenuBar(this);
20 QPopupMenu *irc = new QPopupMenu(this); 18 QPopupMenu *irc = new QPopupMenu(this);
21 menuBar->insertItem(tr("IRC"), irc); 19 menuBar->insertItem(tr("IRC"), irc);
22 QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0); 20 QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0);
23 connect(a, SIGNAL(activated()), this, SLOT(newConnection())); 21 connect(a, SIGNAL(activated()), this, SLOT(newConnection()));
24 a->setWhatsThis(tr("Create a new connection to an IRC server")); 22 a->setWhatsThis(tr("Create a new connection to an IRC server"));
25 a->addTo(irc); 23 a->addTo(irc);
26 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); 24 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0);
27 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); 25 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
28 connect(a, SIGNAL(activated()), this, SLOT(settings())); 26 connect(a, SIGNAL(activated()), this, SLOT(settings()));
29 a->addTo(irc); 27 a->addTo(irc);
30 loadSettings(); 28 loadSettings();
31} 29}
32 30
33/*IRCTabWidget MainWindow::getTabWidget(){ 31/*IRCTabWidget MainWindow::getTabWidget(){
34 return m_tabWidget; 32 return m_tabWidget;
35} */ 33} */
36 34
37void MainWindow::loadSettings() { 35void MainWindow::loadSettings() {
38 Config config("OpieIRC"); 36 Config config("OpieIRC");
39 config.setGroup("OpieIRC"); 37 config.setGroup("OpieIRC");
40 IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF"); 38 IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF");
41 IRCTab::m_textColor = config.readEntry("TextColor", "#000000"); 39 IRCTab::m_textColor = config.readEntry("TextColor", "#000000");
42 IRCTab::m_errorColor = config.readEntry("ErrorColor", "#FF0000"); 40 IRCTab::m_errorColor = config.readEntry("ErrorColor", "#FF0000");
43 IRCTab::m_selfColor = config.readEntry("SelfColor", "#CC0000"); 41 IRCTab::m_selfColor = config.readEntry("SelfColor", "#CC0000");
44 IRCTab::m_otherColor = config.readEntry("OtherColor", "#0000BB"); 42 IRCTab::m_otherColor = config.readEntry("OtherColor", "#0000BB");
45 IRCTab::m_serverColor = config.readEntry("ServerColor", "#0000FF"); 43 IRCTab::m_serverColor = config.readEntry("ServerColor", "#0000FF");
46 IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300"); 44 IRCTab::m_notificationColor = config.readEntry("NotificationColor", "#AA3300");
47 IRCTab::m_maxLines = config.readNumEntry("Lines", 100); 45 IRCTab::m_maxLines = config.readNumEntry("Lines", 100);
48} 46}
49 47
50void MainWindow::selected(QWidget *) { 48void MainWindow::selected(QWidget *) {
51 m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), black); 49 m_tabWidget->setTabColor(m_tabWidget->currentPageIndex(), black);
52 emit updateScroll(); 50 emit updateScroll();
53} 51}
54 52
55void MainWindow::addTab(IRCTab *tab) { 53void MainWindow::addTab(IRCTab *tab) {
56 connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *))); 54 connect(tab, SIGNAL(changed(IRCTab *)), this, SLOT(changeEvent(IRCTab *)));
57 m_tabWidget->addTab(tab, tab->title()); 55 m_tabWidget->addTab(tab, tab->title());
58 m_tabWidget->showPage(tab); 56 m_tabWidget->showPage(tab);
59 tab->setID(m_tabWidget->currentPageIndex()); 57 tab->setID(m_tabWidget->currentPageIndex());
60 m_tabs.append(tab); 58 m_tabs.append(tab);
61} 59}
62 60
63void MainWindow::changeEvent(IRCTab *tab) { 61void MainWindow::changeEvent(IRCTab *tab) {
64 if (tab->id() != m_tabWidget->currentPageIndex()) 62 if (tab->id() != m_tabWidget->currentPageIndex())
65 m_tabWidget->setTabColor(tab->id(), blue); 63 m_tabWidget->setTabColor(tab->id(), blue);
66} 64}
67 65
68void MainWindow::killTab(IRCTab *tab) { 66void MainWindow::killTab(IRCTab *tab) {