Diffstat (limited to 'noncore/net/opieirc/ircchanneltab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchanneltab.cpp | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircchanneltab.cpp b/noncore/net/opieirc/ircchanneltab.cpp index 4675265..c1695db 100644 --- a/noncore/net/opieirc/ircchanneltab.cpp +++ b/noncore/net/opieirc/ircchanneltab.cpp | |||
@@ -1 +1,4 @@ | |||
1 | #include <qpe/qpeapplication.h> | ||
2 | #include <qpe/resource.h> | ||
3 | #include <qcursor.h> | ||
1 | #include <qhbox.h> | 4 | #include <qhbox.h> |
@@ -22,2 +25,14 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW | |||
22 | m_field = new QLineEdit(this); | 25 | m_field = new QLineEdit(this); |
26 | m_popup = new QPopupMenu(m_list); | ||
27 | /* Required so that embedded-style "right" clicks work */ | ||
28 | QPEApplication::setStylusOperation(m_list->viewport(), QPEApplication::RightOnHold); | ||
29 | connect(m_list, SIGNAL(mouseButtonPressed(int, QListBoxItem *, const QPoint&)), this, SLOT(mouseButtonPressed(int, QListBoxItem *, const QPoint &))); | ||
30 | /* Construct the popup menu */ | ||
31 | QPopupMenu *ctcpMenu = new QPopupMenu(m_list); | ||
32 | m_popup->insertItem(Resource::loadPixmap("opieirc/ctcp"), tr("CTCP"), ctcpMenu); | ||
33 | m_popup->insertItem(Resource::loadPixmap("opieirc/query"), tr("Query"), this, SLOT(popupQuery())); | ||
34 | ctcpMenu->insertItem(Resource::loadPixmap("opieirc/ping"), tr("Ping"), this, SLOT(popupPing())); | ||
35 | ctcpMenu->insertItem(Resource::loadPixmap("opieirc/version"), tr("Version"), this, SLOT(popupVersion())); | ||
36 | ctcpMenu->insertItem(Resource::loadPixmap("opieirc/whois"), tr("Whois"), this, SLOT(popupWhois())); | ||
37 | |||
23 | m_layout->add(hbox); | 38 | m_layout->add(hbox); |
@@ -27,3 +42,3 @@ IRCChannelTab::IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainW | |||
27 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 42 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
28 | 43 | settingsChanged(); | |
29 | } | 44 | } |
@@ -51,6 +66,6 @@ void IRCChannelTab::processCommand() { | |||
51 | session()->sendMessage(m_channel, m_field->text()); | 66 | session()->sendMessage(m_channel, m_field->text()); |
52 | appendText("<<font color=\"#dd0000\">"+m_parentTab->server()->nick()+"</font>> "+IRCOutput::toHTML(m_field->text())+"<br>"); | 67 | appendText("<font color=\"" + m_textColor + "\"><</font><font color=\"" + m_selfColor + "\">"+m_parentTab->server()->nick()+"</font><font color=\"" + m_textColor + "\">> "+IRCOutput::toHTML(m_field->text())+"</font><br>"); |
53 | } | 68 | } |
54 | } else { | 69 | } else { |
55 | appendText("<font color=\"#ff0000\">"+tr("Disconnected")+"</font><br>"); | 70 | appendText("<font color=\"" + m_errorColor + "\">"+tr("Disconnected")+"</font><br>"); |
56 | } | 71 | } |
@@ -60,2 +75,6 @@ void IRCChannelTab::processCommand() { | |||
60 | 75 | ||
76 | void IRCChannelTab::settingsChanged() { | ||
77 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); | ||
78 | } | ||
79 | |||
61 | void IRCChannelTab::toggleList() { | 80 | void IRCChannelTab::toggleList() { |
@@ -71,2 +90,35 @@ void IRCChannelTab::toggleList() { | |||
71 | 90 | ||
91 | void IRCChannelTab::mouseButtonPressed(int mouse, QListBoxItem *, const QPoint &point) { | ||
92 | switch (mouse) { | ||
93 | case 1: | ||
94 | break; | ||
95 | case 2: | ||
96 | m_popup->popup(point); | ||
97 | break; | ||
98 | }; | ||
99 | } | ||
100 | |||
101 | void IRCChannelTab::popupQuery() { | ||
102 | if (m_list->currentItem() != -1) { | ||
103 | IRCPerson *person = session()->getPerson(m_list->item(m_list->currentItem())->text()); | ||
104 | if (person) { | ||
105 | IRCQueryTab *tab = m_parentTab->getTabForQuery(person); | ||
106 | if (!tab) { | ||
107 | tab = new IRCQueryTab(person, m_parentTab, m_mainWindow, (QWidget *)parent()); | ||
108 | m_parentTab->addQueryTab(tab); | ||
109 | m_mainWindow->addTab(tab); | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | |||
115 | void IRCChannelTab::popupPing() { | ||
116 | } | ||
117 | |||
118 | void IRCChannelTab::popupVersion() { | ||
119 | } | ||
120 | |||
121 | void IRCChannelTab::popupWhois() { | ||
122 | } | ||
123 | |||
72 | QString IRCChannelTab::title() { | 124 | QString IRCChannelTab::title() { |