#ifndef _GLOBAL_H_
#define _GLOBAL_H_
+// Enable some shortcuts and stuff
+//#define DEVELMODE
+
+
/** The protocol version we use fo the communication between core and GUI */
#define GUI_PROTOCOL 3
if(!_userModes.contains(ircuser) && ircuser) {
_userModes[ircuser] = QString();
ircuser->joinChannel(name());
- qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count();
+ //qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count();
connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
// if you wonder why there is no counterpart to ircUserJoined:
if(isKnownUser(ircuser)) {
_userModes.remove(ircuser);
ircuser->partChannel(name());
- qDebug() << "PART" << name() << ircuser->nick() << ircUsers().count();
+ //qDebug() << "PART" << name() << ircuser->nick() << ircUsers().count();
// if you wonder why there is no counterpart to ircUserParted:
// the joines are propagted by the ircuser. the signal ircUserParted is only for convenience
emit ircUserParted(ircuser);
Q_ASSERT(ircUser);
_userModes.remove(ircUser);
emit ircUserParted(ircUser);
- qDebug() << "DEST" << name() << ircUsers().count();
+ //qDebug() << "DEST" << name() << ircUsers().count();
}
void IrcChannel::ircUserNickSet(QString nick) {
}
IrcUser::~IrcUser() {
- qDebug() << nick() << "destroyed.";
+ //qDebug() << nick() << "destroyed.";
}
// ====================
QString channel = params[0];
IrcUser *ircuser = networkInfo()->updateNickFromMask(prefix);
emit displayMsg(Message::Join, channel, channel, prefix);
- qDebug() << "IrcServerHandler::handleJoin()" << prefix << params;
+ //qDebug() << "IrcServerHandler::handleJoin()" << prefix << params;
ircuser->joinChannel(channel);
}
void IrcServerHandler::handleQuit(QString prefix, QStringList params) {
IrcUser *ircuser = networkInfo()->updateNickFromMask(prefix);
Q_ASSERT(ircuser);
- qDebug() << "IrcServerHandler:handleQuit" << prefix << params;
+ //qDebug() << "IrcServerHandler:handleQuit" << prefix << params;
QString msg;
if(params.count())
ui.tabWidget->removeTab(0);
delete w;
- addPage(tr("Bufs"), BufferViewFilter::AllNets, QList<uint>());
+ addPage(tr("All"), BufferViewFilter::AllNets, QList<uint>());
addPage(tr("Chans"), BufferViewFilter::AllNets|BufferViewFilter::NoQueries|BufferViewFilter::NoServers, QList<uint>());
addPage(tr("Queries"), BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QList<uint>());
addPage(tr("Nets"), BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QList<uint>());
+ // this sometimes deadlocks, so we have to hide the dialog from the outside:
//connect(Client::bufferModel(), SIGNAL(bufferSelected(Buffer *)), this, SLOT(accept()));
}
}
void BufferViewWidget::accept() {
- qDebug() << "accepting";
QDialog::accept();
- //hide();
- qDebug() << "...done.";
}
AccountSettings s;
ui.accountList->addItems(s.knownAccounts());
+ // if empty, create a test account
+ if(!ui.accountList->count()) {
+ QVariantMap accData;
+ accData["User"] = "testuser";
+ accData["Host"] = "apollo.mindpool.net";
+ accData["Port"] = 4242;
+ accData["Password"] = "testuser";
+ s.setValue("Test Account", "AccountData", accData);
+ ui.accountList->addItems(s.knownAccounts());
+ }
+ // end test account
if(ui.accountList->count()) ui.accountList->item(0)->setSelected(true);
setWidgetStates();
+#ifdef DEVELMODE
doConnect(); // shortcut for development
+#endif
}
CoreConnectDlg::~CoreConnectDlg() {
}
void MainWidget::setBuffer(Buffer *buf) {
+ if(!buf) {
+ ui.stack->setCurrentIndex(0);
+ currentBuffer = 0;
+ return;
+ }
// TODO update topic if changed; handle status buffer display
QString title = QString("%1 (%2): \"%3\"").arg(buf->name()).arg(buf->networkName()).arg(buf->topic());
ui.topicBar->setContents(title);
qtopiaui.h qtopiamainwin.h qtopiauistyle.h topicbar.h
SRCS += bufferviewwidget.cpp chatline.cpp chatwidget.cpp coreconnectdlg.cpp main.cpp mainwidget.cpp nicklistwidget.cpp \
qtopiaui.cpp qtopiamainwin.cpp qtopiauistyle.cpp topicbar.cpp
-FRMS += ui/bufferviewwidget.ui ui/coreconnectdlg.ui ui/coreconnectprogressdlg.ui ui/editcoreacctdlg.ui ui/mainwidget.ui ui/nicklistwidget.ui
+FORMNAMES += aboutdlg.ui bufferviewwidget.ui coreconnectdlg.ui coreconnectprogressdlg.ui editcoreacctdlg.ui mainwidget.ui nicklistwidget.ui
+
+for(ui, FORMNAMES) {
+ FRMS += ui/$${ui}
+}
#include "qtopiaui.h"
#include "signalproxy.h"
+#include "ui_aboutdlg.h"
+
#include <Qtopia>
#include <QSoftMenuBar>
-#define DEBUGMODE
-
// This constructor is the first thing to be called for a Qtopia app, so we do the init stuff
// here (rather than in a main.cpp).
QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) {
toolBar = new QToolBar(this);
toolBar->setIconSize(QSize(16, 16));
+ toolBar->setWindowTitle(tr("Show Toolbar"));
addToolBar(toolBar);
bufferViewWidget = new BufferViewWidget(this);
}
void QtopiaMainWin::closeEvent(QCloseEvent *event) {
-#ifndef DEBUGMODE
+#ifndef DEVELMODE
QMessageBox *box = new QMessageBox(QMessageBox::Question, tr("Quit Quassel IRC?"), tr("Do you really want to quit Quassel IRC?"),
QMessageBox::Cancel, this);
QAbstractButton *quit = box->addButton(tr("Quit"), QMessageBox::AcceptRole);
}
void QtopiaMainWin::setupActions() {
- showBuffersAction = toolBar->addAction(QIcon(":icon/options-hide"), "Show Buffers", this, SLOT(showBufferView())); // FIXME provide real icon
- showNicksAction = toolBar->addAction(QIcon(":icon/list"), "Show Nicks", this, SLOT(showNickList()));
+ showBuffersAction = toolBar->addAction(QIcon(":icon/options-hide"), tr("Show Buffers"), this, SLOT(showBufferView())); // FIXME provide real icon
+ showNicksAction = toolBar->addAction(QIcon(":icon/list"), tr("Show Nicks"), this, SLOT(showNickList()));
QMenu *menu = new QMenu(this);
menu->addAction(showBuffersAction);
menu->addAction(showNicksAction);
+ menu->addSeparator();
+ menu->addAction(toolBar->toggleViewAction());
+ menu->addSeparator();
+ menu->addAction(tr("About..."), this, SLOT(showAboutDlg()));
+
QSoftMenuBar::addMenuTo(this, menu);
}
emit requestBacklog(id, 100, -1);
}
-#ifdef DEBUGMODE
+#ifdef DEVELMODE
// FIXME just for testing: select first available buffer
if(Client::allBufferInfos().count() > 1) {
Buffer *b = Client::buffer(Client::allBufferInfos()[1]);
}
void QtopiaMainWin::showBuffer(Buffer *b) {
- mainWidget->setBuffer(b);
bufferViewWidget->hide();
+ mainWidget->setBuffer(b);
nickListWidget->setBuffer(b);
}
void QtopiaMainWin::showBufferView() {
bufferViewWidget->showMaximized();
-
}
void QtopiaMainWin::showNickList() {
nickListWidget->showMaximized();
}
+void QtopiaMainWin::showAboutDlg() {
+ QDialog *dlg = new QDialog(this);
+ dlg->setAttribute(Qt::WA_DeleteOnClose);
+ Ui::AboutDlg ui;
+ ui.setupUi(dlg);
+ dlg->showMaximized();
+}
void showBuffer(Buffer *);
void showBufferView();
void showNickList();
+ void showAboutDlg();
protected:
void closeEvent(QCloseEvent *);
--- /dev/null
+<ui version="4.0" >
+ <class>AboutDlg</class>
+ <widget class="QDialog" name="AboutDlg" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>271</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Trebuchet MS'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Quassel IRC</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:14pt; font-weight:600;"><span style=" font-size:8pt; font-weight:400;">mobile edition</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:5pt;"> </span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">(C) 2005-2007 by</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt; font-weight:600;">The Quassel IRC Team</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">Manuel Nickschas</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">Marcus Eggenberger</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">Marco Genise</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;"><span style=" font-size:4pt;"> </span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">&lt;http://quassel-irc.org&gt;</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:5pt;">&lt;devel@quassel-irc.org&gt;</p></body></html></string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
<enum>QTabWidget::South</enum>
</property>
<property name="tabShape" >
- <enum>QTabWidget::Triangular</enum>
+ <enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex" >
<number>0</number>
<string>Connection Progress</string>
</property>
<layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string><b>Connection to core in progress.</b></string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QLabel" name="connectionStatus" >
<property name="text" >
</property>
<property name="sizeHint" >
<size>
- <width>20</width>
- <height>31</height>
+ <width>138</width>
+ <height>51</height>
</size>
</property>
</spacer>
void MainWin::connectedToCore() {
foreach(BufferInfo id, Client::allBufferInfos()) {
- emit requestBacklog(id, 100, -1);
+ emit requestBacklog(id, 1000, -1);
}
ui.menuViews->setEnabled(true);