But you can connect to the core and the client (which is already fully functional on Qtopia!)
initializes correctly. Now all that's missing is a GUI for actually displaying the
client data... ;-)
Also, obsolete--
src/contrib/qxt/qxtnullable.h
src/contrib/qxt/qxtnull.cpp
src/contrib/qxt/qxtnull.h
+src/qtopia
+src/qtopia/main.cpp
+src/qtopia/qtopiamainwin.h
+src/qtopia/qtopiamainwin.cpp
+src/qtopia/qtopiagui.h
+src/qtopia/qtopiagui.cpp
+src/qtopia/coreconnectdlg.cpp
+src/qtopia/coreconnectdlg.h
+src/qtopia/ui
+src/qtopia/ui/coreconnectdlg.ui
+src/qtopia/ui/coreconnectprogressdlg.ui
+src/qtopia/ui/editcoreacctdlg.ui
qtopia_project(qtopia app)
TARGET=quasseltopia
-CONFIG+=qtopia_main no_quicklaunch
+CONFIG+=debug qtopia_main no_quicklaunch
# Find files
INCLUDEPATH+=../src/qtopia ../src/client ../src/common ../src/contrib/qxt
include(../src/client/client.pro)
# SXE permissions required
-pkg.domain=none
+#pkg.domain=none
+#pkg.name=Quassel IRC
+desktop.files=../src/qtopia/quasseltopia.desktop
+desktop.path=/apps/Applications
+desktop.trtarget=example-nct
+desktop.hint=nct desktop
+
+#pics.files=pics/*
+#pics.path=/pics/example
+#pics.hint=pics
+
+#help.source=help
+#help.files=example.html
+#help.hint=help
+
+INSTALLS+=desktop
+
+pkg.name=QuasselTopia
+pkg.desc=Quassel IRC, a next-gen IRC client
+pkg.version=0.0.1-1
+pkg.maintainer=www.quassel-irc.org
+pkg.license=GPL
+pkg.domain=window
void Client::connectToCore(const QVariantMap &conn) {
// TODO implement SSL
coreConnectionInfo = conn;
- if(isConnected() || socket != 0) {
+ if(isConnected()) {
emit coreConnectionError(tr("Already connected to Core!"));
return;
}
+ if(socket != 0) socket->deleteLater();
if(conn["Host"].toString().isEmpty()) {
clientMode = LocalCore;
socket = new QBuffer(this);
connectedToCore = false;
emit disconnected();
socket->deleteLater();
+ blockSize = 0;
/* Clear internal data. Hopefully nothing relies on it at this point. */
_bufferModel->clear();
syncToCore(state);
}
+// TODO: auth errors
void Client::syncToCore(const QVariant &coreState) {
if(!coreState.toMap().contains("SessionState")) {
emit coreConnectionError(tr("Invalid data received from core!"));
void Client::coreSocketError(QAbstractSocket::SocketError) {
emit coreConnectionError(socket->errorString());
+ socket->deleteLater();
}
void Client::coreHasData() {
try {
processClientInit(socket, item);
} catch(Storage::AuthError) {
- qWarning() << "Authentification error!"; // FIXME
+ qWarning() << "Authentification error!"; // FIXME: send auth error to client
socket->close();
return;
} catch(Exception e) {
QVariant reply = initSession(uid);
disconnect(socket, 0, this, 0);
sessions[uid]->addClient(socket);
+ qDebug() << "Client initialized successfully.";
writeDataToDevice(socket, reply);
}
v["SessionData"] = sessionData;
mutex.unlock();
v["Networks"] = QVariant(servers.keys());
- // v["Payload"] = QByteArray(100000000, 'a');
+ // v["Payload"] = QByteArray(100000000, 'a'); // for testing purposes
return v;
}
<file>default/view_split.png</file>
<file>default/view_top_bottom.png</file>
<file>default/wizard.png</file>
- <file>qirc-icon.png</file>
+ <file>qirc-icon.png</file>
</qresource>
</RCC>
setWindowIconText("Quassel IRC");
statusBar()->showMessage(tr("Waiting for core..."));
-
+
}
void MainWin::init() {
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <QtGui>
+#include <QSoftMenuBar>
+
+#include "coreconnectdlg.h"
+#include "global.h"
+#include "client.h"
+#include "clientsettings.h"
+
+CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) {
+ ui.setupUi(this);
+
+ setAttribute(Qt::WA_DeleteOnClose);
+ setModal(true);
+
+ coreState = 0;
+
+ QMenu *menu = new QMenu(this);
+ newAccAction = new QAction(QIcon(":icon/new"), tr("New"), this);
+ delAccAction = new QAction(QIcon(":icon/trash"), tr("Delete"), this);
+ editAccAction = new QAction(QIcon(":icon/settings"), tr("Properties..."), this);
+ menu->addAction(newAccAction);
+ menu->addAction(delAccAction);
+ menu->addAction(editAccAction);
+ QSoftMenuBar::addMenuTo(this, menu);
+ QSoftMenuBar::setCancelEnabled(this, true);
+ ui.newAccount->setDefaultAction(newAccAction);
+ ui.delAccount->setDefaultAction(delAccAction);
+ ui.editAccount->setDefaultAction(editAccAction);
+ connect(newAccAction, SIGNAL(triggered()), this, SLOT(createAccount()));
+ connect(delAccAction, SIGNAL(triggered()), this, SLOT(removeAccount()));
+ connect(editAccAction, SIGNAL(triggered()), this, SLOT(editAccount()));
+ connect(ui.accountList, SIGNAL(itemSelectionChanged()), this, SLOT(setWidgetStates()));
+ connect(ui.doConnect, SIGNAL(clicked()), this, SLOT(doConnect()));
+
+ ui.accountList->setSelectionMode(QAbstractItemView::SingleSelection);
+ ui.accountList->setSortingEnabled(true);
+
+ AccountSettings s;
+ ui.accountList->addItems(s.knownAccounts());
+ if(ui.accountList->count()) ui.accountList->item(0)->setSelected(true);
+ setWidgetStates();
+}
+
+CoreConnectDlg::~CoreConnectDlg() {
+ //qDebug() << "destroy";
+}
+
+void CoreConnectDlg::setWidgetStates() {
+ editAccAction->setEnabled(ui.accountList->selectedItems().count());
+ delAccAction->setEnabled(ui.accountList->selectedItems().count());
+ ui.doConnect->setEnabled(ui.accountList->selectedItems().count());
+}
+
+void CoreConnectDlg::createAccount() {
+ editAccount("");
+}
+
+void CoreConnectDlg::editAccount() {
+ if(!ui.accountList->selectedItems().count()) return;
+ QString acc = ui.accountList->selectedItems()[0]->text();
+ editAccount(acc);
+}
+
+void CoreConnectDlg::editAccount(QString acc) {
+ EditCoreAcctDlg *dlg = new EditCoreAcctDlg(acc, this);
+ dlg->showMaximized();
+ int res = dlg->exec();
+ if(res == QDialog::Accepted) {
+ AccountSettings s;
+ ui.accountList->clear();
+ ui.accountList->addItems(s.knownAccounts());
+ QList<QListWidgetItem *> list = ui.accountList->findItems(dlg->accountName(), Qt::MatchExactly);
+ Q_ASSERT(list.count() == 1);
+ list[0]->setSelected(true);
+ setWidgetStates();
+ }
+ dlg->deleteLater();
+}
+
+void CoreConnectDlg::removeAccount() {
+ if(ui.accountList->selectedItems().count()) {
+ QListWidgetItem *item = ui.accountList->selectedItems()[0];
+ int res = QMessageBox::warning(this, tr("Delete account?"), tr("Do you really want to delete the data for the account '%1'?<br>"
+ "Note that this only affects your local account settings and will not remove "
+ "any data from the core.").arg(item->text()), QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
+ if(res == QMessageBox::Yes) {
+ AccountSettings s;
+ s.removeAccount(item->text());
+ item = ui.accountList->takeItem(ui.accountList->row(item));
+ delete item;
+ setWidgetStates();
+ }
+ }
+}
+
+void CoreConnectDlg::doConnect() {
+ if(!ui.accountList->selectedItems().count()) return;
+ QString acc = ui.accountList->selectedItems()[0]->text();
+ AccountSettings s;
+ QVariantMap connInfo = s.value(acc, "AccountData").toMap();
+ connInfo["AccountName"] = acc;
+
+ progressDlg = new CoreConnectProgressDlg(this);
+ connect(progressDlg, SIGNAL(accepted()), this, SLOT(connectionSuccess()));
+ connect(progressDlg, SIGNAL(rejected()), this, SLOT(connectionFailure()));
+ progressDlg->showMaximized();
+ progressDlg->connectToCore(connInfo);
+}
+
+void CoreConnectDlg::connectionSuccess() {
+ if(progressDlg->isConnected()) {
+ progressDlg->deleteLater();
+ accept();
+ } else {
+ connectionFailure();
+ }
+}
+
+void CoreConnectDlg::connectionFailure() {
+ progressDlg->deleteLater();
+ Client::instance()->disconnectFromCore();
+}
+
+QVariant CoreConnectDlg::getCoreState() {
+ return coreState;
+}
+
+/****************************************************************************************************/
+
+EditCoreAcctDlg::EditCoreAcctDlg(QString accname, QDialog *parent) : QDialog(parent), accName(accname) {
+ ui.setupUi(this);
+ setModal(true);
+
+ ui.accountEdit->setText(accountName());
+ if(accName.isEmpty()) {
+ ui.port->setValue(DEFAULT_PORT);
+ ui.accountEdit->setFocus();
+ } else {
+ ui.hostEdit->setFocus();
+ AccountSettings s;
+ QVariantMap data = s.value(accName, "AccountData").toMap();
+ ui.hostEdit->setText(data["Host"].toString());
+ ui.port->setValue(data["Port"].toUInt());
+ ui.userEdit->setText(data["User"].toString());
+ //if(data.contains("Password")) {
+ ui.passwdEdit->setText(data["Password"].toString());
+ // ui.rememberPasswd->setChecked(true);
+ //} else ui.rememberPasswd->setChecked(false);
+ }
+}
+
+QString EditCoreAcctDlg::accountName() const {
+ return accName;
+}
+
+void EditCoreAcctDlg::accept() {
+ AccountSettings s;
+ if(ui.userEdit->text().isEmpty() || ui.hostEdit->text().isEmpty() || ui.accountEdit->text().isEmpty()) {
+ int res = QMessageBox::warning(this, tr("Missing information"),
+ tr("Please enter all required information or discard changes to return to account selection."),
+ QMessageBox::Discard|QMessageBox::Retry);
+ if(res != QMessageBox::Retry) reject();
+ return;
+ }
+ if(ui.accountEdit->text() != accountName() && s.knownAccounts().contains(ui.accountEdit->text())) {
+ int res = QMessageBox::warning(this, tr("Non-unique account name"),
+ tr("Account names need to be unique. Please enter a different name or discard all changes to "
+ "return to account selection."),
+ QMessageBox::Discard|QMessageBox::Retry);
+ if(res != QMessageBox::Retry) reject();
+ ui.accountEdit->setSelection(0, ui.accountEdit->text().length());
+ ui.accountEdit->setFocus();
+ return;
+ }
+ if(accountName() != ui.accountEdit->text()) {
+ s.removeAccount(accountName());
+ accName = ui.accountEdit->text();
+ }
+ QVariantMap accData;
+ accData["User"] = ui.userEdit->text();
+ accData["Host"] = ui.hostEdit->text();
+ accData["Port"] = ui.port->value();
+ accData["Password"] = ui.passwdEdit->text();
+ s.setValue(accountName(), "AccountData", accData);
+ QDialog::accept();
+}
+
+/********************************************************************************************/
+
+CoreConnectProgressDlg::CoreConnectProgressDlg(QDialog *parent) : QDialog(parent) {
+ ui.setupUi(this);
+
+ setModal(true);
+
+ connectsuccess = false;
+
+ connect(Client::instance(), SIGNAL(coreConnectionMsg(const QString &)), ui.connectionStatus, SLOT(setText(const QString &)));
+ connect(Client::instance(), SIGNAL(coreConnectionProgress(uint, uint)), this, SLOT(updateProgressBar(uint, uint)));
+ connect(Client::instance(), SIGNAL(coreConnectionError(QString)), this, SLOT(coreConnectionError(QString)));
+ connect(Client::instance(), SIGNAL(connected()), this, SLOT(coreConnected()));
+
+}
+
+bool CoreConnectProgressDlg::isConnected() const {
+ return connectsuccess;
+}
+
+void CoreConnectProgressDlg::connectToCore(QVariantMap connInfo) {
+ Client::instance()->connectToCore(connInfo);
+
+}
+
+void CoreConnectProgressDlg::coreConnected() {
+ connectsuccess = true;
+ accept();
+}
+
+void CoreConnectProgressDlg::coreConnectionError(QString err) {
+ QMessageBox::warning(this, tr("Connection Error"), tr("<b>Could not connect to Quassel Core!</b><br>\n") + err, QMessageBox::Retry);
+ reject();
+}
+
+void CoreConnectProgressDlg::updateProgressBar(uint partial, uint total) {
+ ui.connectionProgress->setMaximum(total);
+ ui.connectionProgress->setValue(partial);
+}
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _CORECONNECTDLG_H
+#define _CORECONNECTDLG_H
+
+#include "ui_coreconnectdlg.h"
+#include "ui_coreconnectprogressdlg.h"
+#include "ui_editcoreacctdlg.h"
+#include "global.h"
+
+class CoreConnectProgressDlg;
+
+class CoreConnectDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ CoreConnectDlg(QWidget *parent = 0, bool doAutoConnect = false);
+ ~CoreConnectDlg();
+ QVariant getCoreState();
+
+ private slots:
+ void createAccount();
+ void removeAccount();
+ void editAccount();
+ void setWidgetStates();
+ void doConnect();
+ void connectionSuccess();
+ void connectionFailure();
+
+ private:
+ Ui::CoreConnectDlg ui;
+ QVariant coreState;
+
+ void editAccount(QString);
+
+ QAction *newAccAction, *editAccAction, *delAccAction;
+
+ CoreConnectProgressDlg *progressDlg;
+};
+
+class EditCoreAcctDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ EditCoreAcctDlg(QString accname = 0, QDialog *parent = 0);
+ QString accountName() const;
+
+ public slots:
+ void accept();
+
+ private slots:
+
+
+ private:
+ Ui::EditCoreAcctDlg ui;
+ QString accName;
+
+};
+
+class CoreConnectProgressDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ CoreConnectProgressDlg(QDialog *parent = 0);
+ bool isConnected() const;
+
+ public slots:
+ void connectToCore(QVariantMap connInfo);
+
+ private slots:
+ void coreConnected();
+ void coreConnectionError(QString);
+ void updateProgressBar(uint partial, uint total);
+
+ private:
+ Ui::CoreConnectProgressDlg ui;
+ bool connectsuccess;
+
+};
+
+#endif
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved.
-**
-** This file is part of the $MODULE$ of the Qtopia Toolkit.
-**
-** $TROLLTECH_DUAL_LICENSE$
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-****************************************************************************/
-
-#include "example.h"
-#include <qpushbutton.h>
-
-ExampleBase::ExampleBase( QWidget *parent, Qt::WFlags f )
- : QWidget( parent, f )
-{
- setupUi( this );
-}
-
-ExampleBase::~ExampleBase()
-{
-}
-
-/*
- * Constructs a Example which is a child of 'parent', with the
- * name 'name' and widget flags set to 'f'
- */
-Example::Example( QWidget *parent, Qt::WFlags f )
- : ExampleBase( parent, f )
-{
- connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-Example::~Example()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- * A simple slot... not very interesting.
- */
-void Example::goodBye()
-{
- close();
-}
-
+++ /dev/null
-[Translation]
-File=example-nct
-Context=Example
-
-[Desktop Entry]
-Comment[]=An Example Program
-Exec=quasseltest
-Icon=example/Example
-Type=Application
-Name[]=QuasselTest
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved.
-**
-** This file is part of the $MODULE$ of the Qtopia Toolkit.
-**
-** $TROLLTECH_DUAL_LICENSE$
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-****************************************************************************/
-
-#ifndef EXAMPLE_H
-#define EXAMPLE_H
-#include "ui_examplebase.h"
-
-class ExampleBase : public QWidget, public Ui_ExampleBase
-{
-public:
- ExampleBase( QWidget *parent = 0, Qt::WFlags f = 0 );
- virtual ~ExampleBase();
-};
-
-class Example : public ExampleBase
-{
- Q_OBJECT
-public:
- Example( QWidget *parent = 0, Qt::WFlags f = 0 );
- virtual ~Example();
-
-private slots:
- void goodBye();
-};
-
-#endif // EXAMPLE_H
+++ /dev/null
-<ui version="4.0" stdsetdef="1" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
- <class>ExampleBase</class>
- <widget class="QWidget" name="ExampleBase" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>196</width>
- <height>245</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Example</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="TextLabel1" >
- <property name="text" >
- <string>This is just an example! It doesn't do anything interesting at all.</string>
- </property>
- <property name="wordWrap" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="quit" >
- <property name="text" >
- <string>Quit</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
-</ui>
-/****************************************************************************
-**
-** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved.
-**
-** This file is part of the $MODULE$ of the Qtopia Toolkit.
-**
-** $TROLLTECH_DUAL_LICENSE$
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-****************************************************************************/
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
-#include "example.h"
+#include "qtopiamainwin.h"
#include <qtopia/qtopiaapplication.h>
-QTOPIA_ADD_APPLICATION("example", Example)
+QTOPIA_ADD_APPLICATION("Quassel IRC", QtopiaMainWin)
QTOPIA_MAIN
# Input
-HEADERS += example.h
-FORMS += examplebase.ui
-SOURCES += example.cpp main.cpp
+HEADERS += coreconnectdlg.h qtopiagui.h qtopiamainwin.h
+SOURCES += coreconnectdlg.cpp qtopiagui.cpp qtopiamainwin.cpp main.cpp
+FORMS += ui/coreconnectdlg.ui ui/coreconnectprogressdlg.ui ui/editcoreacctdlg.ui
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "qtopiagui.h"
+#include "qtopiamainwin.h"
+
+QtopiaGui::QtopiaGui(QtopiaMainWin *mw) : AbstractUi(), mainWin(mw) {
+ connect(mainWin, SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &)));
+ connect(mainWin, SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore()));
+
+
+}
+
+QtopiaGui::~QtopiaGui() {
+ delete mainWin;
+
+}
+
+void QtopiaGui::init() {
+
+}
+
+AbstractUiMsg *QtopiaGui::layoutMsg(const Message &msg) {
+ return mainWin->layoutMsg(msg);
+}
+
+void QtopiaGui::connectedToCore() {
+ mainWin->connectedToCore();
+}
+
+void QtopiaGui::disconnectedFromCore() {
+ mainWin->disconnectedFromCore();
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _QTOPIAGUI_H_
+#define _QTOPIAGUI_H_
+
+#include "quasselui.h"
+
+class QtopiaMainWin;
+
+//! This class encapsulates Quassel's GUI for Qtopia.
+class QtopiaGui : public AbstractUi {
+ Q_OBJECT
+
+ public:
+ QtopiaGui(QtopiaMainWin *mainWin);
+ ~QtopiaGui();
+ void init();
+ AbstractUiMsg *layoutMsg(const Message &);
+
+ protected slots:
+ void connectedToCore();
+ void disconnectedFromCore();
+
+ private:
+ QtopiaMainWin *mainWin;
+};
+
+
+#endif
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "qtopiamainwin.h"
+
+#include "global.h"
+#include "message.h"
+#include "qtopiagui.h"
+#include "coreconnectdlg.h"
+
+// 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) {
+ qRegisterMetaType<QVariant>("QVariant");
+ qRegisterMetaType<Message>("Message");
+ qRegisterMetaType<BufferId>("BufferId");
+ qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
+ qRegisterMetaTypeStreamOperators<Message>("Message");
+ qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
+
+ Global::runMode = Global::ClientOnly;
+
+ QCoreApplication::setOrganizationDomain("quassel-irc.org");
+ QCoreApplication::setApplicationName("Quassel IRC");
+ QCoreApplication::setOrganizationName("Quassel IRC Development Team");
+
+ //Style::init();
+ QtopiaGui *gui = new QtopiaGui(this);
+ Client::init(gui);
+ //gui->init();
+
+ setWindowTitle("Quassel IRC");
+ //setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη"));
+ setWindowIcon(QIcon(":/qirc-icon.png"));
+ setWindowIconText("Quassel IRC");
+
+ CoreConnectDlg *dlg = new CoreConnectDlg(this);
+ //setCentralWidget(dlg);
+ dlg->showMaximized();
+ dlg->exec();
+}
+
+QtopiaMainWin::~QtopiaMainWin() {
+
+
+}
+
+void QtopiaMainWin::connectedToCore() {
+ foreach(BufferId id, Client::allBufferIds()) {
+ emit requestBacklog(id, 100, -1);
+ }
+}
+
+void QtopiaMainWin::disconnectedFromCore() {
+
+
+}
+
+AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
+ //return new ChatLine(msg);
+ return 0;
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _QTOPIAMAINWIN_H_
+#define _QTOPIAMAINWIN_H_
+
+#include <QtGui>
+
+#include "client.h"
+#include "global.h"
+
+class QtopiaMainWin : public QMainWindow {
+ Q_OBJECT
+
+ public:
+ QtopiaMainWin(QWidget *parent = 0, Qt::WFlags f = 0);
+ ~QtopiaMainWin();
+
+ AbstractUiMsg *layoutMsg(const Message &);
+
+ protected slots:
+ void connectedToCore();
+ void disconnectedFromCore();
+
+ signals:
+ void connectToCore(const QVariantMap &connInfo);
+ void disconnectFromCore();
+ void requestBacklog(BufferId, QVariant, QVariant);
+
+ private:
+
+ friend class QtopiaGui;
+};
+
+#endif
--- /dev/null
+[Translation]
+File=example-nct
+Context=QuasselIRC
+
+[Desktop Entry]
+Comment[]=A Next-Gen IRC Client
+Exec=quasseltopia
+Icon=example/Example
+Type=Application
+Name[]=QuasselIRC
--- /dev/null
+<ui version="4.0" >
+ <class>CoreConnectDlg</class>
+ <widget class="QDialog" name="CoreConnectDlg" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>188</width>
+ <height>283</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Select Core Account</string>
+ </property>
+ <property name="windowIcon" >
+ <iconset/>
+ </property>
+ <property name="modal" >
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_6" >
+ <property name="text" >
+ <string>Available Quassel Core accounts:</string>
+ </property>
+ <property name="textFormat" >
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QListWidget" name="accountList" />
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="newAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="delAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../images/icons.qrc" >:/default/edit_remove.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="editAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../images/icons.qrc" >:/default/edit.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="doConnect" >
+ <property name="text" >
+ <string>Connect</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>accountList</tabstop>
+ <tabstop>doConnect</tabstop>
+ <tabstop>newAccount</tabstop>
+ <tabstop>delAccount</tabstop>
+ <tabstop>editAccount</tabstop>
+ <tabstop>delAccount</tabstop>
+ <tabstop>editAccount</tabstop>
+ <tabstop>accountList</tabstop>
+ <tabstop>newAccount</tabstop>
+ </tabstops>
+ <resources>
+ <include location="../../images/icons.qrc" />
+ </resources>
+ <connections/>
+</ui>
--- /dev/null
+<ui version="4.0" >
+ <class>CoreConnectProgressDlg</class>
+ <widget class="QDialog" name="CoreConnectProgressDlg" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>156</width>
+ <height>183</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <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="connectionStatus" >
+ <property name="text" >
+ <string>Connecting...</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="connectionProgress" >
+ <property name="value" >
+ <number>0</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<ui version="4.0" >
+ <class>EditCoreAcctDlg</class>
+ <widget class="QDialog" name="EditCoreAcctDlg" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>193</width>
+ <height>241</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Edit Core Account</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="portLabel" >
+ <property name="text" >
+ <string>Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="hostLabel" >
+ <property name="text" >
+ <string>Host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="passwdLabel" >
+ <property name="text" >
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="hostEdit" />
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="accountEdit" />
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="userEdit" />
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="accountLabel" >
+ <property name="text" >
+ <string>Account:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLineEdit" name="passwdEdit" >
+ <property name="echoMode" >
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="port" >
+ <property name="maximum" >
+ <number>65535</number>
+ </property>
+ <property name="minimum" >
+ <number>1024</number>
+ </property>
+ <property name="value" >
+ <number>4242</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="userLabel" >
+ <property name="text" >
+ <string>User:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>accountEdit</tabstop>
+ <tabstop>hostEdit</tabstop>
+ <tabstop>port</tabstop>
+ <tabstop>userEdit</tabstop>
+ <tabstop>passwdEdit</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>