summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchannellist.cpp8
-rw-r--r--noncore/net/opieirc/ircchanneltab.cpp14
-rw-r--r--noncore/net/opieirc/irctab.cpp10
-rw-r--r--noncore/net/opieirc/mainwindow.cpp12
4 files changed, 25 insertions, 19 deletions
diff --git a/noncore/net/opieirc/ircchannellist.cpp b/noncore/net/opieirc/ircchannellist.cpp
index 8cf144e..3982f30 100644
--- a/noncore/net/opieirc/ircchannellist.cpp
+++ b/noncore/net/opieirc/ircchannellist.cpp
@@ -1,29 +1,29 @@
1#include <qpe/resource.h> 1#include <opie2/oresource.h>
2 2
3#include "ircchannellist.h" 3#include "ircchannellist.h"
4#include "ircchannelperson.h" 4#include "ircchannelperson.h"
5 5
6IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) { 6IRCChannelList::IRCChannelList(IRCChannel *channel, QWidget *parent, const char *name, WFlags f) : QListBox(parent, name, f) {
7 m_channel = channel; 7 m_channel = channel;
8} 8}
9 9
10void IRCChannelList::update() { 10void IRCChannelList::update() {
11 QPixmap op = Resource::loadPixmap("opieirc/op"); 11 QPixmap op = Opie::Core::OResource::loadPixmap( "opieirc/op" );
12 QPixmap hop = Resource::loadPixmap("opieirc/hop"); 12 QPixmap hop = Opie::Core::OResource::loadPixmap( "opieirc/hop" );
13 QPixmap voice = Resource::loadPixmap("opieirc/voice"); 13 QPixmap voice = Opie::Core::OResource::loadPixmap( "opieirc/voice" );
14 QListIterator<IRCChannelPerson> it = m_channel->people(); 14 QListIterator<IRCChannelPerson> it = m_channel->people();
15 clear(); 15 clear();
16 for (; it.current(); ++it) { 16 for (; it.current(); ++it) {
17 IRCChannelPerson *person = it.current(); 17 IRCChannelPerson *person = it.current();
18 if (person->flags() & IRCChannelPerson::PERSON_FLAG_OP) { 18 if (person->flags() & IRCChannelPerson::PERSON_FLAG_OP) {
19 insertItem(op, "1" + person->nick()); 19 insertItem(op, "1" + person->nick());
20 } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_HALFOP) { 20 } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_HALFOP) {
21 insertItem(op, "2" + person->nick()); 21 insertItem(op, "2" + person->nick());
22 } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_VOICE) { 22 } else if (person->flags() & IRCChannelPerson::PERSON_FLAG_VOICE) {
23 insertItem(voice, "3" + person->nick()); 23 insertItem(voice, "3" + person->nick());
24 } else { 24 } else {
25 insertItem("4" + person->nick()); 25 insertItem("4" + person->nick());
26 } 26 }
27 } 27 }
28 sort(); 28 sort();
29 adjustNicks(); 29 adjustNicks();
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp
index 3272a8a..707e17f 100644
--- a/noncore/net/opieirc/ircchanneltab.cpp
+++ b/noncore/net/opieirc/ircchanneltab.cpp
@@ -1,17 +1,17 @@
1#include <qpe/resource.h> 1#include <opie2/oresource.h>
2#include <qwhatsthis.h> 2#include <qwhatsthis.h>
3#include <qhbox.h> 3#include <qhbox.h>
4#include <qdict.h> 4#include <qdict.h>
5 5
6#include "ircchanneltab.h" 6#include "ircchanneltab.h"
7#include "ircservertab.h" 7#include "ircservertab.h"
8#include "ircmessageparser.h" 8#include "ircmessageparser.h"
9 9
10#include <opie2/odebug.h> 10#include <opie2/odebug.h>
11QDict<QString> IRCChannelTab::m_queuedMessages (17); 11QDict<QString> IRCChannelTab::m_queuedMessages (17);
12 12
13IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { 13IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) {
14 m_mainWindow = mainWindow; 14 m_mainWindow = mainWindow;
15 m_parentTab = parentTab; 15 m_parentTab = parentTab;
16 m_channel = channel; 16 m_channel = channel;
17 m_description->setText(tr("Talking on channel") + " <b>" + channel->channelname() + "</b>"); 17 m_description->setText(tr("Talking on channel") + " <b>" + channel->channelname() + "</b>");
@@ -30,37 +30,41 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW
30 m_list->update(); 30 m_list->update();
31 m_list->setMaximumWidth(LISTWIDTH); 31 m_list->setMaximumWidth(LISTWIDTH);
32 m_field = new IRCHistoryLineEdit(this); 32 m_field = new IRCHistoryLineEdit(this);
33 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); 33 connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab()));
34 connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); 34 connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab()));
35 connect(m_field, SIGNAL(closeTab()), this, SLOT(remove())); 35 connect(m_field, SIGNAL(closeTab()), this, SLOT(remove()));
36 connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus())); 36 connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus()));
37 37
38 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion")); 38 QWhatsThis::add(m_field, tr("Type your message here to participate in the channel discussion"));
39 m_popup = new QPopupMenu(m_list); 39 m_popup = new QPopupMenu(m_list);
40 m_lines = 0; 40 m_lines = 0;
41 /* Required so that embedded-style "right" clicks work */ 41 /* Required so that embedded-style "right" clicks work */
42 QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold); 42 QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold);
43 connect(m_list, SIGNAL(mouseButtonPressed(int,QListBoxItem*,const QPoint&)), this, SLOT(mouseButtonPressed(int,QListBoxItem*,const QPoint&))); 43 connect(m_list, SIGNAL(mouseButtonPressed(int,QListBoxItem*,const QPoint&)), this, SLOT(mouseButtonPressed(int,QListBoxItem*,const QPoint&)));
44 /* Construct the popup menu */ 44 /* Construct the popup menu */
45 //QPopupMenu *ctcpMenu = new QPopupMenu(m_list); 45 //QPopupMenu *ctcpMenu = new QPopupMenu(m_list);
46 m_popup->insertItem(Resource::loadPixmap("opieirc/query"), tr("Query"), this, SLOT(popupQuery())); 46 m_popup->insertItem(Opie::Core::OResource::loadPixmap("opieirc/query",Opie::Core::OResource::SmallIcon),
47 tr("Query"), this, SLOT(popupQuery()));
47 m_popup->insertSeparator(); 48 m_popup->insertSeparator();
48 m_popup->insertItem(Resource::loadPixmap("opieirc/ping"), tr("Ping"), this, SLOT(popupPing())); 49 m_popup->insertItem(Opie::Core::OResource::loadPixmap("opieirc/ping",Opie::Core::OResource::SmallIcon),
49 m_popup->insertItem(Resource::loadPixmap("opieirc/version"), tr("Version"), this, SLOT(popupVersion())); 50 tr("Ping"), this, SLOT(popupPing()));
50 m_popup->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois())); 51 m_popup->insertItem(Opie::Core::OResource::loadPixmap("opieirc/version",Opie::Core::OResource::SmallIcon),
52 tr("Version"), this, SLOT(popupVersion()));
53 m_popup->insertItem(Opie::Core::OResource::loadPixmap("opieirc/whois",Opie::Core::OResource::SmallIcon),
54 tr("Whois"), this, SLOT(popupWhois()));
51 //m_popup->insertItem(ctcpMenu, "CTCP"); 55 //m_popup->insertItem(ctcpMenu, "CTCP");
52 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); 56 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
53 m_layout->add(hbox); 57 m_layout->add(hbox);
54 hbox->show(); 58 hbox->show();
55 m_layout->add(m_field); 59 m_layout->add(m_field);
56 m_field->setFocus(); 60 m_field->setFocus();
57 m_field->setActiveWindow(); 61 m_field->setActiveWindow();
58 62
59 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); 63 connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand()));
60 connect(m_list, SIGNAL(doubleClicked ( QListBoxItem * ) ), this, SLOT(popupQuery( QListBoxItem * ) )); 64 connect(m_list, SIGNAL(doubleClicked ( QListBoxItem * ) ), this, SLOT(popupQuery( QListBoxItem * ) ));
61 settingsChanged(); 65 settingsChanged();
62 66
63 if(m_queuedMessages[m_channel->channelname()]) { 67 if(m_queuedMessages[m_channel->channelname()]) {
64 appendText(*m_queuedMessages[m_channel->channelname()]); 68 appendText(*m_queuedMessages[m_channel->channelname()]);
65 delete m_queuedMessages[m_channel->channelname()]; 69 delete m_queuedMessages[m_channel->channelname()];
66 m_queuedMessages.remove(m_channel->channelname()); 70 m_queuedMessages.remove(m_channel->channelname());
diff --git a/noncore/net/opieirc/irctab.cpp b/noncore/net/opieirc/irctab.cpp
index aee33c4..2f459a9 100644
--- a/noncore/net/opieirc/irctab.cpp
+++ b/noncore/net/opieirc/irctab.cpp
@@ -1,24 +1,23 @@
1#include "irctab.h" 1#include "irctab.h"
2#include "mainwindow.h" 2#include "mainwindow.h"
3 3
4#include <opie2/okeyconfigmanager.h> 4#include <opie2/okeyconfigmanager.h>
5#include <opie2/oresource.h>
5 6
6#include <qpe/applnk.h> 7#include <qpe/applnk.h>
7#include <qpe/resource.h>
8
9 8
10#include <qpushbutton.h> 9#include <qpushbutton.h>
11#include <qwhatsthis.h> 10#include <qwhatsthis.h>
12 11
13 12
14QString IRCTab::m_errorColor; 13QString IRCTab::m_errorColor;
15QString IRCTab::m_serverColor; 14QString IRCTab::m_serverColor;
16QString IRCTab::m_textColor; 15QString IRCTab::m_textColor;
17QString IRCTab::m_backgroundColor; 16QString IRCTab::m_backgroundColor;
18QString IRCTab::m_selfColor; 17QString IRCTab::m_selfColor;
19QString IRCTab::m_otherColor; 18QString IRCTab::m_otherColor;
20QString IRCTab::m_notificationColor; 19QString IRCTab::m_notificationColor;
21int IRCTab::m_maxLines; 20int IRCTab::m_maxLines;
22 21
23 22
24static bool g_useTime = false; 23static bool g_useTime = false;
@@ -31,36 +30,35 @@ void IRCTab::setUseTimeStamps( bool b ) {
31QString IRCTab::appendTimestamp( const QString& text ) { 30QString IRCTab::appendTimestamp( const QString& text ) {
32 return g_useTime ? 31 return g_useTime ?
33 "[" +QTime::currentTime().toString()+"]" + text + "\n" : 32 "[" +QTime::currentTime().toString()+"]" + text + "\n" :
34 text + "\n"; 33 text + "\n";
35 34
36} 35}
37 36
38 37
39IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { 38IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) {
40 m_layout = new QVBoxLayout(this); 39 m_layout = new QVBoxLayout(this);
41 QHBoxLayout *descLayout = new QHBoxLayout(m_layout); 40 QHBoxLayout *descLayout = new QHBoxLayout(m_layout);
42 descLayout->setMargin(5); 41 descLayout->setMargin(5);
43 m_description = new QLabel(tr("Missing description"), this); 42 m_description = new QLabel(tr("Missing description"), this);
44 QWhatsThis::add(m_description, tr("Description of the tab's content")); 43 QWhatsThis::add(m_description, tr("Description of the tab's content"));
45 descLayout->addWidget(m_description); 44 descLayout->addWidget(m_description);
46 descLayout->setStretchFactor(m_description, 5); 45 descLayout->setStretchFactor(m_description, 5);
47 QPixmap pic; 46 QPushButton *close = new QPushButton( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ),
48 pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 47 QString::null, this);
49 QPushButton *close = new QPushButton(pic, QString::null, this); 48 close->setFixedSize( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
50 close->setMaximumWidth( close->height() );
51 QWhatsThis::add(close, tr("Close this tab")); 49 QWhatsThis::add(close, tr("Close this tab"));
52 connect(close, SIGNAL(clicked()), this, SLOT(remove())); 50 connect(close, SIGNAL(clicked()), this, SLOT(remove()));
53 descLayout->addWidget(close); 51 descLayout->addWidget(close);
54 descLayout->setStretchFactor(m_description, 1); 52 descLayout->setStretchFactor(m_description, 1);
55} 53}
56 54
57 55
58void IRCTab::setID(int id) { 56void IRCTab::setID(int id) {
59 m_id = id; 57 m_id = id;
60} 58}
61 59
62int IRCTab::id() { 60int IRCTab::id() {
63 return m_id; 61 return m_id;
64} 62}
65 63
66void IRCTab::showEvent( QShowEvent *ev ) { 64void IRCTab::showEvent( QShowEvent *ev ) {
diff --git a/noncore/net/opieirc/mainwindow.cpp b/noncore/net/opieirc/mainwindow.cpp
index 3d60107..5edcf66 100644
--- a/noncore/net/opieirc/mainwindow.cpp
+++ b/noncore/net/opieirc/mainwindow.cpp
@@ -1,52 +1,56 @@
1#include <qmenubar.h>
2#include <qpe/resource.h>
3 1
4#include <opie2/odebug.h> 2#include <opie2/odebug.h>
3#include <opie2/oresource.h>
5 4
5#include <qmenubar.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7 7
8#include "mainwindow.h" 8#include "mainwindow.h"
9#include "ircservertab.h" 9#include "ircservertab.h"
10#include "dcctransfertab.h" 10#include "dcctransfertab.h"
11#include "ircserverlist.h" 11#include "ircserverlist.h"
12#include "ircsettings.h" 12#include "ircsettings.h"
13 13
14#include <stdio.h> 14#include <stdio.h>
15 15
16 16
17QString MainWindow::appCaption() { 17QString MainWindow::appCaption() {
18 return QObject::tr("Opie IRC"); 18 return QObject::tr("Opie IRC");
19} 19}
20 20
21 21
22MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 22MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
23 setCaption(tr("IRC Client")); 23 setCaption(tr("IRC Client"));
24 m_tabWidget = new IRCTabWidget(this); 24 m_tabWidget = new IRCTabWidget(this);
25 QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here")); 25 QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here"));
26 connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(selected(QWidget*))); 26 connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(selected(QWidget*)));
27 setCentralWidget(m_tabWidget); 27 setCentralWidget(m_tabWidget);
28 setToolBarsMovable(FALSE); 28 setToolBarsMovable(FALSE);
29 QMenuBar *menuBar = new QMenuBar(this); 29 QMenuBar *menuBar = new QMenuBar(this);
30 QPopupMenu *irc = new QPopupMenu(this); 30 QPopupMenu *irc = new QPopupMenu(this);
31 menuBar->insertItem(tr("IRC"), irc); 31 menuBar->insertItem(tr("IRC"), irc);
32 QAction *a = new QAction(tr("New connection"), Resource::loadPixmap("pass"), QString::null, 0, this, 0); 32 QAction *a = new QAction( tr("New connection"),
33 Opie::Core::OResource::loadPixmap( "pass", Opie::Core::OResource::SmallIcon ),
34 QString::null, 0, this, 0 );
33 connect(a, SIGNAL(activated()), this, SLOT(newConnection())); 35 connect(a, SIGNAL(activated()), this, SLOT(newConnection()));
34 a->setWhatsThis(tr("Create a new connection to an IRC server")); 36 a->setWhatsThis(tr("Create a new connection to an IRC server"));
35 a->addTo(irc); 37 a->addTo(irc);
36 a = new QAction(tr("Settings"), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0); 38 a = new QAction( tr("Settings"),
39 Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
40 QString::null, 0, this, 0 );
37 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance")); 41 a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
38 connect(a, SIGNAL(activated()), this, SLOT(settings())); 42 connect(a, SIGNAL(activated()), this, SLOT(settings()));
39 a->addTo(irc); 43 a->addTo(irc);
40 m_dccTab = 0; 44 m_dccTab = 0;
41 loadSettings(); 45 loadSettings();
42} 46}
43 47
44/*IRCTabWidget MainWindow::getTabWidget(){ 48/*IRCTabWidget MainWindow::getTabWidget(){
45 return m_tabWidget; 49 return m_tabWidget;
46} */ 50} */
47 51
48void MainWindow::loadSettings() { 52void MainWindow::loadSettings() {
49 Config config("OpieIRC"); 53 Config config("OpieIRC");
50 config.setGroup("OpieIRC"); 54 config.setGroup("OpieIRC");
51 IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF"); 55 IRCTab::m_backgroundColor = config.readEntry("BackgroundColor", "#FFFFFF");
52 IRCTab::m_textColor = config.readEntry("TextColor", "#000000"); 56 IRCTab::m_textColor = config.readEntry("TextColor", "#000000");