Quassel IRC for Qtopia - Release Notes
======================================
-NOTE: QuasselTopia does currently NOT build!
+NOTE: QuasselTopia is currently mostly broken even if it happens to build!
We provide a Quassel IRC client that can be run on mobile devices running
Trolltech's Qtopia. The name of this client version has not yet been
qtopia_project(qtopia app)
-error(QuasselTopia cannot be build at the moment. Its codebase is out of sync with the rest of Quassel. Please bear with us until we have fixed that!)
+# error(QuasselTopia cannot be build at the moment. Its codebase is out of sync with the rest of Quassel. Please bear with us until we have fixed that!)
TARGET = quasseltopia
CONFIG += release qtopia_main no_quicklaunch no_singleexec
#include "bufferviewwidget.h"
#include "client.h"
+#include "buffermodel.h"
BufferViewWidget::BufferViewWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
setModal(true);
- setStyleSheet("background-color: rgba(220, 220, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
+ //setStyleSheet("background-color: rgb(220, 220, 255, 70%); color: rgb(0, 0, 0); font-size: 5pt;");
//ui.tabWidget->tabBar()->setStyleSheet("font-size: 5pt;");
// get rid of the default tab page designer forces upon us :(
ui.tabWidget->removeTab(0);
delete w;
- 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>());
+ addPage(tr("All"), BufferViewFilter::AllNets, QList<NetworkId>());
+ addPage(tr("Chans"), BufferViewFilter::AllNets|BufferViewFilter::NoQueries|BufferViewFilter::NoServers, QList<NetworkId>());
+ addPage(tr("Queries"), BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QList<NetworkId>());
+ addPage(tr("Nets"), BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QList<NetworkId>());
// this sometimes deadlocks, so we have to hide the dialog from the outside:
- //connect(Client::bufferModel(), SIGNAL(bufferSelected(Buffer *)), this, SLOT(accept()));
-
+ //connect(Client::bufferModel()->standardSelectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(accept()));
}
BufferViewWidget::~BufferViewWidget() {
}
-void BufferViewWidget::addPage(const QString &title, const BufferViewFilter::Modes &mode, const QList<uint> &nets) {
+void BufferViewWidget::addPage(const QString &title, const BufferViewFilter::Modes &mode, const QList<NetworkId> &nets) {
BufferView *view = new BufferView(ui.tabWidget);
+ view->setStyleSheet("background-color: rgb(220, 220, 255, 70%); color: rgb(0, 0, 0); font-size: 5pt;");
view->setFilteredModel(Client::bufferModel(), mode, nets);
Client::bufferModel()->synchronizeView(view);
ui.tabWidget->addTab(view, title);
virtual void accept();
private:
- void addPage(const QString &title, const BufferViewFilter::Modes &mode, const QList<uint> &nets);
+ void addPage(const QString &title, const BufferViewFilter::Modes &mode, const QList<NetworkId> &nets);
Ui::BufferViewWidget ui;
};
_styledText = QtopiaUi::style()->styleString(msg.formattedText());
_timestamp = msg.timestamp();
_msgId = msg.msgId();
- _bufferInfo = msg.buffer();
+ _bufferInfo = msg.bufferInfo();
}
#include <QtGui>
#include "chatwidget.h"
-ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent) {
+ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent), AbstractChatView() {
setStyleSheet("background-color: rgba(255, 255, 255, 60%)");
setTextInteractionFlags(Qt::TextBrowserInteraction);
}
-void ChatWidget::setContents(QList<ChatLineOld *> lines) {
+void ChatWidget::setContents(const QList<AbstractUiMsg *> &lines) {
clear();
- appendChatLines(lines);
+ QList<ChatLine *> list;
+ foreach(AbstractUiMsg *msg, lines) list << static_cast<ChatLine*>(msg);
+ appendChatLines(list);
}
void ChatWidget::prependMsg(AbstractUiMsg *msg) {
- ChatLineOld *line = static_cast<ChatLineOld*>(msg);
+ ChatLine *line = static_cast<ChatLine*>(msg);
Q_ASSERT(line);
prependChatLine(line);
}
void ChatWidget::appendMsg(AbstractUiMsg *msg) {
- ChatLineOld *line = static_cast<ChatLineOld*>(msg);
+ ChatLine *line = static_cast<ChatLine*>(msg);
Q_ASSERT(line);
appendChatLine(line);
}
-void ChatWidget::appendChatLine(ChatLineOld *line) {
+void ChatWidget::appendChatLine(ChatLine *line) {
QTextCursor cursor = textCursor();
moveCursor(QTextCursor::End);
if(!document()->isEmpty()) insertPlainText("\n");
setTextCursor(cursor);
}
-void ChatWidget::appendChatLines(QList<ChatLineOld *> list) {
- foreach(ChatLineOld *line, list) {
+void ChatWidget::appendChatLines(QList<ChatLine *> list) {
+ foreach(ChatLine *line, list) {
appendChatLine(line);
}
}
-void ChatWidget::prependChatLine(ChatLineOld *line) {
+void ChatWidget::prependChatLine(ChatLine *line) {
QTextCursor cursor = textCursor();
moveCursor(QTextCursor::Start);
bool flg = document()->isEmpty();
setTextCursor(cursor);
}
-void ChatWidget::prependChatLines(QList<ChatLineOld *> list) {
- foreach(ChatLineOld *line, list) {
+void ChatWidget::prependChatLines(QList<ChatLine *> list) {
+ foreach(ChatLine *line, list) {
prependChatLine(line);
}
}
-void ChatWidget::insertChatLine(ChatLineOld *line) {
+void ChatWidget::insertChatLine(ChatLine *line) {
if(!document()->isEmpty()) insertPlainText("\n");
insertStyledText(line->styledSender());
insertPlainText(" ");
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _CHATWIDGET_H_
-#define _CHATWIDGET_H_
+#ifndef CHATWIDGET_H_
+#define CHATWIDGET_H_
#include <QTextEdit>
+
+#include "abstractbuffercontainer.h"
#include "chatline.h"
#include "qtopiauistyle.h"
#include "quasselui.h"
-class ChatWidget : public QTextEdit {
+class ChatWidget : public QTextEdit, public AbstractChatView {
Q_OBJECT
public:
ChatWidget(QWidget *parent = 0);
public slots:
- void setContents(QList<ChatLineOld *>);
+ void setContents(const QList<AbstractUiMsg *> &);
void appendMsg(AbstractUiMsg *);
void prependMsg(AbstractUiMsg *);
- void prependChatLine(ChatLineOld *);
- void appendChatLine(ChatLineOld *);
- void prependChatLines(QList<ChatLineOld *>);
- void appendChatLines(QList<ChatLineOld *>);
+
+ void prependChatLine(ChatLine *);
+ void appendChatLine(ChatLine *);
+ void prependChatLines(QList<ChatLine *>);
+ void appendChatLines(QList<ChatLine *>);
private:
- void insertChatLine(ChatLineOld *);
+ void insertChatLine(ChatLine *);
void insertStyledText(const QtopiaUiStyle::StyledText &);
-
-
};
#endif
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-
+#define DEVELMODE
#include <QtGui>
#include <QSoftMenuBar>
#include "coreconnectdlg.h"
#include "client.h"
#include "clientsettings.h"
+#include "clientsyncer.h"
#include "global.h"
CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) {
setAttribute(Qt::WA_DeleteOnClose);
setModal(true);
- coreState = 0;
+ clientSyncer = new ClientSyncer(this);
+ connect(clientSyncer, SIGNAL(socketStateChanged(QAbstractSocket::SocketState)),this, SLOT(initPhaseSocketState(QAbstractSocket::SocketState)));
+ connect(clientSyncer, SIGNAL(connectionError(const QString &)), this, SLOT(initPhaseError(const QString &)));
+ connect(clientSyncer, SIGNAL(connectionMsg(const QString &)), this, SLOT(initPhaseMsg(const QString &)));
+ connect(clientSyncer, SIGNAL(startLogin()), this, SLOT(startLogin()));
+ connect(clientSyncer, SIGNAL(loginFailed(const QString &)), this, SLOT(loginFailed(const QString &)));
+ connect(clientSyncer, SIGNAL(loginSuccess()), this, SLOT(startSync()));
+ //connect(clientSyncer, SIGNAL(startCoreSetup(const QVariantList &)), this, SLOT(startCoreConfig(const QVariantList &)));
QMenu *menu = new QMenu(this);
newAccAction = new QAction(QIcon(":icon/new"), tr("New"), this);
ui.accountList->setSelectionMode(QAbstractItemView::SingleSelection);
ui.accountList->setSortingEnabled(true);
- AccountSettings s;
- ui.accountList->addItems(s.knownAccounts());
- // if empty, create a test account
- /* disabled for the moment
- if(!ui.accountList->count()) {
- QVariantMap accData;
- accData["User"] = "testuser";
- accData["Host"] = "";
- accData["Port"] = 4242;
- accData["Password"] = "";
- s.setValue("Test Account", "AccountData", accData);
- ui.accountList->addItems(s.knownAccounts());
+ CoreAccountSettings s;
+ AccountId lastacc = s.lastAccount();
+ autoConnectAccount = s.autoConnectAccount();
+ QListWidgetItem *currentItem = 0;
+ foreach(AccountId id, s.knownAccounts()) {
+ if(!id.isValid()) continue;
+ QVariantMap data = s.retrieveAccountData(id);
+ accounts[id] = data;
+ QListWidgetItem *item = new QListWidgetItem(data["AccountName"].toString(), ui.accountList);
+ item->setData(Qt::UserRole, QVariant::fromValue<AccountId>(id));
+ if(id == lastacc) currentItem = item;
}
- */
- // end test account
- if(ui.accountList->count()) ui.accountList->item(0)->setSelected(true);
+ if(currentItem) ui.accountList->setCurrentItem(currentItem);
+ else ui.accountList->setCurrentRow(0);
setWidgetStates();
#ifdef DEVELMODE
doConnect(); // shortcut for development
}
void CoreConnectDlg::createAccount() {
- editAccount("");
+ QStringList existing;
+ for(int i = 0; i < ui.accountList->count(); i++) existing << ui.accountList->item(i)->text();
+ CoreAccountEditDlg dlg(0, QVariantMap(), existing, this);
+ if(dlg.exec() == QDialog::Accepted) {
+ // find free ID
+ AccountId id = accounts.count() + 1;
+ for(AccountId i = 1; i <= accounts.count(); i++) {
+ if(!accounts.keys().contains(i)) {
+ id = i;
+ break;
+ }
+ }
+ QVariantMap data = dlg.accountData();
+ data["AccountId"] = QVariant::fromValue<AccountId>(id);
+ accounts[id] = data;
+ CoreAccountSettings s;
+ s.storeAccountData(id, data);
+ QListWidgetItem *item = new QListWidgetItem(data["AccountName"].toString(), ui.accountList);
+ item->setData(Qt::UserRole, QVariant::fromValue<AccountId>(id));
+ ui.accountList->setCurrentItem(item);
+ }
}
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();
+ QStringList existing;
+ for(int i = 0; i < ui.accountList->count(); i++) existing << ui.accountList->item(i)->text();
+ AccountId id = ui.accountList->currentItem()->data(Qt::UserRole).value<AccountId>();
+ QVariantMap acct = accounts[id];
+ CoreAccountEditDlg dlg(id, acct, existing, this);
+ if(dlg.exec() == QDialog::Accepted) {
+ QVariantMap data = dlg.accountData();
+ ui.accountList->currentItem()->setText(data["AccountName"].toString());
+ accounts[id] = data;
+ CoreAccountSettings s;
+ s.storeAccountData(id, data);
}
- 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();
- }
+ AccountId id = ui.accountList->currentItem()->data(Qt::UserRole).value<AccountId>();
+ int ret = QMessageBox::question(this, tr("Remove Account Settings"),
+ tr("Do you really want to remove your local settings for this Quassel Core account?<br>"
+ "Note: This will <em>not</em> remove or change any data on the Core itself!"),
+ QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
+ if(ret == QMessageBox::Yes) {
+ int idx = ui.accountList->currentRow();
+ delete ui.accountList->takeItem(idx);
+ ui.accountList->setCurrentRow(qMin(idx, ui.accountList->count()-1));
+ CoreAccountSettings s;
+ s.removeAccount(id);
+ 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);
+ // save accounts
+ CoreAccountSettings s;
+ foreach(QVariantMap acct, accounts.values()) {
+ AccountId id = acct["AccountId"].value<AccountId>();
+ if(acct.contains("Delete")) {
+ s.removeAccount(id);
+ } else {
+ s.storeAccountData(id, acct);
+ }
+ }
+ s.setAutoConnectAccount(autoConnectAccount);
+
+ //ui.stackedWidget->setCurrentWidget(ui.loginPage);
+ account = ui.accountList->currentItem()->data(Qt::UserRole).value<AccountId>();
+ accountData = accounts[account];
+ s.setLastAccount(account);
+
+ clientSyncer->connectToCore(accountData);
+// qDebug() << "logging in " << accountData["User"].toString() << accountData["Password"].toString();
+// clientSyncer->loginToCore(accountData["User"].toString(), accountData["Password"].toString());
+// qDebug() << "logged in";
+ //connectToCore();
+ //if(!ui.accountList->selectedItems().count()) return;
+// AccountSettings s;
+// QVariantMap connInfo; // = s.value(acc, "AccountData").toMap();
+ //connInfo["AccountName"] = acc;
+
+ progressDlg = new CoreConnectProgressDlg(clientSyncer, this);
connect(progressDlg, SIGNAL(accepted()), this, SLOT(connectionSuccess()));
connect(progressDlg, SIGNAL(rejected()), this, SLOT(connectionFailure()));
progressDlg->showMaximized();
- progressDlg->connectToCore(connInfo);
+ // progressDlg->connectToCore(connInfo);
+}
+
+void CoreConnectDlg::initPhaseError(const QString &error) {
+ qDebug() << "connection error:" << error;
+}
+
+void CoreConnectDlg::initPhaseMsg(const QString &msg) {
+
+}
+
+void CoreConnectDlg::initPhaseSocketState(QAbstractSocket::SocketState state) {
+ /*
+ QString s;
+ QString host = accountData["Host"].toString();
+ switch(state) {
+ case QAbstractSocket::UnconnectedState: s = tr("Not connected to %1.").arg(host); break;
+ case QAbstractSocket::HostLookupState: s = tr("Looking up %1...").arg(host); break;
+ case QAbstractSocket::ConnectingState: s = tr("Connecting to %1...").arg(host); break;
+ case QAbstractSocket::ConnectedState: s = tr("Connected to %1").arg(host); break;
+ default: s = tr("Unknown connection state to %1"); break;
+ }
+ ui.connectLabel->setText(s);
+ */
+}
+
+void CoreConnectDlg::restartPhaseNull() {
+ clientSyncer->disconnectFromCore();
+}
+
+/*********************************************************
+ * Phase Two: Login
+ *********************************************************/
+
+void CoreConnectDlg::startLogin() {
+ clientSyncer->loginToCore(accountData["User"].toString(), accountData["Password"].toString());
+}
+
+
+void CoreConnectDlg::loginFailed(const QString &error) {
+
}
+void CoreConnectDlg::startSync() {
+
+
+}
+
+
void CoreConnectDlg::connectionSuccess() {
+ /*
if(progressDlg->isConnected()) {
progressDlg->deleteLater();
accept();
} else {
connectionFailure();
}
+ */
+ accept();
}
void CoreConnectDlg::connectionFailure() {
}
QVariant CoreConnectDlg::getCoreState() {
- return coreState;
+// return coreState;
}
+
/****************************************************************************************************/
-EditCoreAcctDlg::EditCoreAcctDlg(QString accname, QDialog *parent) : QDialog(parent), accName(accname) {
+CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, const QStringList &_existing, QWidget *parent) : QDialog(parent), account(acct) {
ui.setupUi(this);
setModal(true);
-
- ui.accountEdit->setText(accountName());
- if(accName.isEmpty()) {
+ showMaximized();
+
+ existing = _existing;
+ account = acct;
+ if(id.isValid()) {
+ existing.removeAll(acct["AccountName"].toString());
+ ui.hostEdit->setText(acct["Host"].toString());
+ ui.port->setValue(acct["Port"].toUInt());
+ ui.accountEdit->setText(acct["AccountName"].toString());
+ ui.userEdit->setText(acct["User"].toString());
+ ui.passwdEdit->setText(acct["Password"].toString());
+ ui.hostEdit->setFocus();
+ } else {
ui.port->setValue(Global::defaultPort);
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);
+ setWindowTitle(tr("Add Core Account"));
}
}
-QString EditCoreAcctDlg::accountName() const {
- return accName;
+QVariantMap CoreAccountEditDlg::accountData() {
+ account["AccountName"] = ui.accountEdit->text().trimmed();
+ account["Host"] = ui.hostEdit->text().trimmed();
+ account["Port"] = ui.port->value();
+ account["User"] = ui.userEdit->text();
+ account["Password"] = ui.passwdEdit->text();
+ return account;
}
-void EditCoreAcctDlg::accept() {
- AccountSettings s;
+void CoreAccountEditDlg::accept() {
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."),
if(res != QMessageBox::Retry) reject();
return;
}
- if(ui.accountEdit->text() != accountName() && s.knownAccounts().contains(ui.accountEdit->text())) {
+
+ if(existing.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."),
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) {
+CoreConnectProgressDlg::CoreConnectProgressDlg(ClientSyncer *clientSyncer, 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()));
-
+ connect(clientSyncer, SIGNAL(sessionProgress(quint32, quint32)), this, SLOT(coreSessionProgress(quint32, quint32)));
+ connect(clientSyncer, SIGNAL(networksProgress(quint32, quint32)), this, SLOT(coreNetworksProgress(quint32, quint32)));
+ connect(clientSyncer, SIGNAL(channelsProgress(quint32, quint32)), this, SLOT(coreChannelsProgress(quint32, quint32)));
+ connect(clientSyncer, SIGNAL(ircUsersProgress(quint32, quint32)), this, SLOT(coreIrcUsersProgress(quint32, quint32)));
+ connect(clientSyncer, SIGNAL(syncFinished()), this, SLOT(syncFinished()));
+
+ ui.sessionProgress->setRange(0, 1);
+ ui.sessionProgress->setValue(0);
+ ui.networksProgress->setRange(0, 1);
+ ui.networksProgress->setValue(0);
+ ui.channelsProgress->setRange(0, 1);
+ ui.channelsProgress->setValue(0);
+ ui.ircUsersProgress->setRange(0, 1);
+ ui.ircUsersProgress->setValue(0);
}
-bool CoreConnectProgressDlg::isConnected() const {
- return connectsuccess;
-}
+void CoreConnectProgressDlg::coreSessionProgress(quint32 val, quint32 max) {
+ ui.sessionProgress->setRange(0, max);
+ ui.sessionProgress->setValue(val);
-void CoreConnectProgressDlg::connectToCore(QVariantMap connInfo) {
- Client::instance()->connectToCore(connInfo);
+}
+void CoreConnectProgressDlg::coreNetworksProgress(quint32 val, quint32 max) {
+ if(max == 0) {
+ ui.networksProgress->setFormat("0/0");
+ ui.networksProgress->setRange(0, 1);
+ ui.networksProgress->setValue(1);
+ } else {
+ ui.networksProgress->setFormat("%v/%m");
+ ui.networksProgress->setRange(0, max);
+ ui.networksProgress->setValue(val);
+ }
}
-void CoreConnectProgressDlg::coreConnected() {
- connectsuccess = true;
- accept();
+void CoreConnectProgressDlg::coreChannelsProgress(quint32 val, quint32 max) {
+ if(max == 0) {
+ ui.channelsProgress->setFormat("0/0");
+ ui.channelsProgress->setRange(0, 1);
+ ui.channelsProgress->setValue(1);
+ } else {
+ ui.channelsProgress->setFormat("%v/%m");
+ ui.channelsProgress->setRange(0, max);
+ ui.channelsProgress->setValue(val);
+ }
}
-void CoreConnectProgressDlg::coreConnectionError(QString err) {
- QMessageBox::warning(this, tr("Connection Error"), tr("<b>Could not connect to Quassel Core!</b><br>\n") + err, QMessageBox::Ok);
- reject();
+void CoreConnectProgressDlg::coreIrcUsersProgress(quint32 val, quint32 max) {
+ if(max == 0) {
+ ui.ircUsersProgress->setFormat("0/0");
+ ui.ircUsersProgress->setRange(0, 1);
+ ui.ircUsersProgress->setValue(1);
+ } else {
+ if(val % 100) return;
+ ui.ircUsersProgress->setFormat("%v/%m");
+ ui.ircUsersProgress->setRange(0, max);
+ ui.ircUsersProgress->setValue(val);
+ }
}
-void CoreConnectProgressDlg::updateProgressBar(uint partial, uint total) {
- ui.connectionProgress->setMaximum(total);
- ui.connectionProgress->setValue(partial);
+void CoreConnectProgressDlg::syncFinished() {
+ accept();
}
#ifndef _CORECONNECTDLG_H
#define _CORECONNECTDLG_H
+#include <QAbstractSocket>
+
+#include "types.h"
+
#include "ui_coreconnectdlg.h"
#include "ui_coreconnectprogressdlg.h"
-#include "ui_editcoreacctdlg.h"
+#include "ui_coreaccounteditdlg.h"
+class ClientSyncer;
class CoreConnectProgressDlg;
class CoreConnectDlg : public QDialog {
void connectionSuccess();
void connectionFailure();
+ /*** Phase One: Connection ***/
+
+ void restartPhaseNull();
+ void initPhaseError(const QString &error);
+ void initPhaseMsg(const QString &msg);
+ void initPhaseSocketState(QAbstractSocket::SocketState);
+
+ /*** Phase Two: Login ***/
+ void startLogin();
+ void loginFailed(const QString &);
+
+ /*** Phase Three: Sync ***/
+ void startSync();
+
private:
Ui::CoreConnectDlg ui;
- QVariant coreState;
+ ClientSyncer *clientSyncer;
+
+ AccountId autoConnectAccount;
+ QHash<AccountId, QVariantMap> accounts;
+ QVariantMap accountData;
+ AccountId account;
void editAccount(QString);
CoreConnectProgressDlg *progressDlg;
};
-class EditCoreAcctDlg : public QDialog {
+class CoreAccountEditDlg : public QDialog {
Q_OBJECT
public:
- EditCoreAcctDlg(QString accname = 0, QDialog *parent = 0);
- QString accountName() const;
+ CoreAccountEditDlg(AccountId id, const QVariantMap &data, const QStringList &existing = QStringList(), QWidget *parent = 0);
+ QVariantMap accountData();
public slots:
void accept();
private:
- Ui::EditCoreAcctDlg ui;
- QString accName;
+ Ui::CoreAccountEditDlg ui;
+ QVariantMap account;
+ QStringList existing;
};
Q_OBJECT
public:
- CoreConnectProgressDlg(QDialog *parent = 0);
- bool isConnected() const;
-
- public slots:
- void connectToCore(QVariantMap connInfo);
+ CoreConnectProgressDlg(ClientSyncer *, QDialog *parent = 0);
private slots:
- void coreConnected();
- void coreConnectionError(QString);
- void updateProgressBar(uint partial, uint total);
+
+ void syncFinished();
+
+ void coreSessionProgress(quint32, quint32);
+ void coreNetworksProgress(quint32, quint32);
+ void coreChannelsProgress(quint32, quint32);
+ void coreIrcUsersProgress(quint32, quint32);
private:
Ui::CoreConnectProgressDlg ui;
- bool connectsuccess;
};
#include "buffer.h"
#include "chatwidget.h"
+#include "client.h"
-MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
+MainWidget::MainWidget(QWidget *parent) : AbstractBufferContainer(parent) {
ui.setupUi(this);
ui.inputLine->hide(); ui.topicBar->hide();
- connect(ui.inputLine, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
- currentBuffer = 0;
+ connect(ui.inputLine, SIGNAL(sendText(const QString &)), this, SLOT(userInput(const QString &)));
+ connect(this, SIGNAL(userInput(BufferInfo, QString)), Client::instance(), SIGNAL(sendInput(BufferInfo, QString)));
}
MainWidget::~MainWidget() {
}
+AbstractChatView *MainWidget::createChatView(BufferId id) {
+ Q_UNUSED(id)
+ ChatWidget *widget = new ChatWidget(this);
+ AbstractChatView *chatView = static_cast<AbstractChatView *>(widget); // can't use dynamic_cast on some Qtopia devices
+ Q_ASSERT(chatView);
+ _chatViews[id] = widget;
+ ui.stack->addWidget(widget);
+ widget->setFocusProxy(this);
+ return chatView;
+}
+
+void MainWidget::removeChatView(BufferId id) {
+ ChatWidget *view = _chatViews.value(id, 0);
+ if(!view) return;
+ ui.stack->removeWidget(view);
+ view->deleteLater();
+}
+
+void MainWidget::showChatView(BufferId id) {
+ if(id.isValid()) currentBufferInfo = Client::buffer(id)->bufferInfo();
+ else currentBufferInfo = BufferInfo();
+ ChatWidget *widget = _chatViews.value(id, 0);
+ if(!widget) ui.stack->setCurrentIndex(0);
+ else {
+ ui.stack->setCurrentWidget(widget);
+ ui.inputLine->show(); ui.topicBar->show();
+ ui.inputLine->setFocus();
+ }
+}
+
+
+/*
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());
+// QString title = QString("%1 (%2): \"%3\"").arg(buf->bufferInfo().bufferName()).arg(buf->bufferInfo().networkName()).arg(buf->topic());
+ QString title = "foobar";
ui.topicBar->setContents(title);
//ui.chatWidget->setStyleSheet("div { color: #777777; }");
ChatWidget *chatWidget;
if(!chatWidgets.contains(buf)) {
chatWidget = new ChatWidget(this);
- QList<ChatLineOld *> lines;
+ QList<ChatLine *> lines;
QList<AbstractUiMsg *> msgs = buf->contents();
foreach(AbstractUiMsg *msg, msgs) {
- lines.append((ChatLineOld*)(msg));
+ lines.append((ChatLine *)(msg));
}
chatWidget->setContents(lines);
connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
ui.stack->setCurrentWidget(chatWidget);
ui.inputLine->setFocus();
currentBuffer = buf;
+
}
+*/
-void MainWidget::enterPressed() {
- QStringList lines = ui.inputLine->text().split('\n', QString::SkipEmptyParts);
+void MainWidget::userInput(const QString &input) {
+ if(!currentBufferInfo.isValid()) return;
+ QStringList lines = input.split('\n', QString::SkipEmptyParts);
foreach(QString msg, lines) {
if(msg.isEmpty()) continue;
- if(currentBuffer) currentBuffer->processUserInput(msg);
+ emit userInput(currentBufferInfo, msg);
}
ui.inputLine->clear();
}
-
-// FIXME make this more elegant, we don't need to send a string around...
-void MainWidget::setTopic(QString topic) {
- Q_UNUSED(topic);
- if(currentBuffer) {
- QString title = QString("%1 (%2): \"%3\"").arg(currentBuffer->name()).arg(currentBuffer->networkName()).arg(currentBuffer->topic());
- ui.topicBar->setContents(title);
- }
-}
#include "ui_mainwidget.h"
+#include "abstractbuffercontainer.h"
+#include "bufferinfo.h"
+
class Buffer;
class ChatWidget;
-class MainWidget : public QWidget {
+class MainWidget : public AbstractBufferContainer {
Q_OBJECT
public:
- MainWidget(QWidget *parent = 0);
+ MainWidget(QWidget *parent);
~MainWidget();
- public slots:
- void setTopic(QString topic);
- void setBuffer(Buffer *);
+ signals:
+ void userInput(const BufferInfo &, const QString &);
+
+ protected:
+ virtual AbstractChatView *createChatView(BufferId);
+ virtual void removeChatView(BufferId);
+
+ protected slots:
+ virtual void showChatView(BufferId);
private slots:
- void enterPressed();
+ void userInput(const QString &);
private:
Ui::MainWidget ui;
- QHash<Buffer *, ChatWidget *> chatWidgets;
-
- Buffer *currentBuffer;
+ QHash<BufferId, ChatWidget *> _chatViews;
+ BufferInfo currentBufferInfo;
};
#include "buffer.h"
#include "nickview.h"
+// FIXME bring back nicks!
+
NickListWidget::NickListWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
setModal(true);
- setStyleSheet("background-color: rgba(220, 220, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
+ //setStyleSheet("background-color: rgba(220, 220, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
}
}
-void NickListWidget::setBuffer(Buffer *buf) {
- if(!buf) {
+void NickListWidget::setBuffer(BufferId id) {
+ if(!id.isValid()) {
ui.stackedWidget->setCurrentWidget(ui.emptyPage);
return;
}
+ /*
if(buf->bufferType() != Buffer::ChannelType) {
ui.stackedWidget->setCurrentWidget(ui.emptyPage);
} else {
connect(buf, SIGNAL(destroyed(QObject *)), this, SLOT(bufferDestroyed(QObject *)));
}
}
+ */
}
void NickListWidget::reset() {
+ /*
foreach(NickView *view, nickViews.values()) {
ui.stackedWidget->removeWidget(view);
view->deleteLater();
}
nickViews.clear();
+ */
}
void NickListWidget::bufferDestroyed(QObject *buf) {
+ /*
if(nickViews.contains((Buffer *)buf)) {
NickView *view = nickViews.take((Buffer *)buf);
ui.stackedWidget->removeWidget(view);
view->deleteLater();
}
+ */
}
#include "ui_nicklistwidget.h"
class Buffer;
+class BufferId;
class NickView;
class NickListWidget : public QDialog {
~NickListWidget();
public slots:
- void setBuffer(Buffer *);
+ void setBuffer(BufferId);
void reset();
private slots:
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
-FORMNAMES += aboutdlg.ui bufferviewwidget.ui coreconnectdlg.ui coreconnectprogressdlg.ui editcoreacctdlg.ui mainwidget.ui nicklistwidget.ui
+FORMNAMES += aboutdlg.ui bufferviewwidget.ui coreconnectdlg.ui coreconnectprogressdlg.ui coreaccounteditdlg.ui mainwidget.ui nicklistwidget.ui
for(ui, FORMNAMES) {
FRMS += ui/$${ui}
#include "bufferviewwidget.h"
#include "nicklistwidget.h"
#include "chatline.h"
+#include "clientbacklogmanager.h"
#include "coreconnectdlg.h"
#include "global.h"
#include "mainwidget.h"
#include "message.h"
+#include "network.h"
#include "qtopiaui.h"
#include "signalproxy.h"
QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) {
Global::registerMetaTypes();
+#include "../../version.inc"
+
Global::runMode = Global::ClientOnly;
Global::defaultPort = 4242;
+ Global::SPUTDEV = true;
+
+ Network::setDefaultCodecForServer("ISO-8859-1");
+ Network::setDefaultCodecForEncoding("UTF-8");
+ Network::setDefaultCodecForDecoding("ISO-8859-15");
QCoreApplication::setOrganizationDomain("quassel-irc.org");
QCoreApplication::setApplicationName("Quassel IRC");
- QCoreApplication::setOrganizationName("Quassel IRC Team");
+ QCoreApplication::setOrganizationName("Quassel Project");
QtopiaUi *gui = new QtopiaUi(this);
Client::init(gui);
setWindowTitle("Quassel IRC");
- setWindowIcon(QIcon(":/qirc-icon.png"));
+ setWindowIcon(QIcon(":icons/quassel-icon.png"));
setWindowIconText("Quassel IRC");
mainWidget = new MainWidget(this);
+ mainWidget->setModel(Client::bufferModel());
+ mainWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
setCentralWidget(mainWidget);
- NetworkModel *model = Client::networkModel();
- connect(model, SIGNAL(bufferSelected(Buffer *)), this, SLOT(showBuffer(Buffer *)));
-
toolBar = new QToolBar(this);
toolBar->setIconSize(QSize(16, 16));
toolBar->setWindowTitle(tr("Show Toolbar"));
addToolBar(toolBar);
- bufferViewWidget = new BufferViewWidget(this);
+ //bufferViewWidget = new BufferViewWidget(this);
+ bufferViewWidget = 0; // delayed creation to avoid QPainter warnings
nickListWidget = new NickListWidget(this);
+ connect(mainWidget, SIGNAL(currentChanged(BufferId)), this, SLOT(showBuffer(BufferId)));
+
setupActions();
init();
// at this point, client is fully initialized
void QtopiaMainWin::init() {
- Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant)));
-
showMaximized();
CoreConnectDlg *dlg = new CoreConnectDlg(this);
//setCentralWidget(dlg);
void QtopiaMainWin::connectedToCore() {
foreach(BufferInfo id, Client::allBufferInfos()) {
- emit requestBacklog(id, 100, -1);
+ Client::backlogManager()->requestBacklog(id.bufferId(), 500, -1);
}
-
-#ifdef DEVELMODE
- // FIXME just for testing: select first available buffer
- if(Client::allBufferInfos().count() > 1) {
- Buffer *b = Client::buffer(Client::allBufferInfos()[1]);
- Client::networkModel()->selectBuffer(b);
- }
-#endif
}
void QtopiaMainWin::disconnectedFromCore() {
}
AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
- return new ChatLineOld(msg);
+ return new ChatLine(msg);
//return 0;
}
-void QtopiaMainWin::showBuffer(Buffer *b) {
- bufferViewWidget->hide();
- mainWidget->setBuffer(b);
- nickListWidget->setBuffer(b);
- showNicksAction->setEnabled(b && b->bufferType() == Buffer::ChannelType);
+void QtopiaMainWin::showBuffer(BufferId id) {
+ nickListWidget->setBuffer(id);
+ Buffer *b = Client::buffer(id);
+ //showNicksAction->setEnabled(b && b->bufferInfo().type() == BufferInfo::ChannelBuffer); FIXME enable again when we have a nicklist!
}
void QtopiaMainWin::showBufferView() {
+ if(!bufferViewWidget) {
+ bufferViewWidget = new BufferViewWidget(this);
+ connect(mainWidget, SIGNAL(currentChanged(BufferId)), bufferViewWidget, SLOT(accept()));
+ }
bufferViewWidget->showMaximized();
}
void requestBacklog(BufferInfo, QVariant, QVariant);
private slots:
- void showBuffer(Buffer *);
+ void showBuffer(BufferId);
void showBufferView();
void showNickList();
void showAboutDlg();
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include "topicbar.h"
-
#include <QtGui>
+#include "topicbar.h"
+#include "client.h"
+
TopicBar::TopicBar(QWidget *parent) : QPushButton(parent) {
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
timer->setInterval(25);
connect(timer, SIGNAL(timeout()), this, SLOT(updateOffset()));
connect(this, SIGNAL(clicked()), this, SLOT(startScrolling()));
+
+ _model = Client::bufferModel();
+ connect(_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+ this, SLOT(dataChanged(QModelIndex, QModelIndex)));
+
+ _selectionModel = Client::bufferModel()->standardSelectionModel();
+ connect(_selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
+ this, SLOT(currentChanged(QModelIndex, QModelIndex)));
}
TopicBar::~TopicBar() {
}
+void TopicBar::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) {
+ Q_UNUSED(previous);
+ setContents(current.sibling(current.row(), 1).data().toString());
+}
+
+void TopicBar::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) {
+ QItemSelectionRange changedArea(topLeft, bottomRight);
+ QModelIndex currentTopicIndex = _selectionModel->currentIndex().sibling(_selectionModel->currentIndex().row(), 1);
+ if(changedArea.contains(currentTopicIndex))
+ setContents(currentTopicIndex.data().toString());
+};
+
void TopicBar::resizeEvent(QResizeEvent *event) {
QPushButton::resizeEvent(event);
calcTextMetrics();
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _TOPICBAR_H_
-#define _TOPICBAR_H_
+#ifndef TOPICBAR_H_
+#define TOPICBAR_H_
#include <QPushButton>
#include <QTimeLine>
-#include <QtGui>
+#include "buffermodel.h"
class QPixmap;
class QTimer;
protected:
virtual void paintEvent(QPaintEvent *event);
virtual void resizeEvent (QResizeEvent *event);
+
private slots:
void updateOffset();
+ void dataChanged(const QModelIndex &, const QModelIndex &);
+ void currentChanged(const QModelIndex &, const QModelIndex &);
private:
void calcTextMetrics();
+ BufferModel *_model;
+ QItemSelectionModel *_selectionModel;
+
QTimer *timer;
int offset;
int fillTextStart, secondTextStart;
--- /dev/null
+<ui version="4.0" >
+ <class>CoreAccountEditDlg</class>
+ <widget class="QDialog" name="CoreAccountEditDlg" >
+ <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="spacing" >
+ <number>6</number>
+ </property>
+ <property name="margin" >
+ <number>9</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="minimum" >
+ <number>1024</number>
+ </property>
+ <property name="maximum" >
+ <number>65535</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" stdset="0" >
+ <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>
<rect>
<x>0</x>
<y>0</y>
- <width>156</width>
- <height>183</height>
+ <width>168</width>
+ <height>212</height>
</rect>
</property>
<property name="windowTitle" >
<string>Connection Progress</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
- <string><b>Connection to core in progress.</b></string>
+ <string>Connecting to core...</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</widget>
</item>
<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>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Session</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QProgressBar" name="sessionProgress" >
+ <property name="value" >
+ <number>0</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="format" >
+ <string>%p%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Networks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QProgressBar" name="networksProgress" >
+ <property name="value" >
+ <number>24</number>
+ </property>
+ <property name="format" >
+ <string>%p%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Channels</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QProgressBar" name="channelsProgress" >
+ <property name="value" >
+ <number>24</number>
+ </property>
+ <property name="format" >
+ <string>%p%</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Users</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QProgressBar" name="ircUsersProgress" >
+ <property name="value" >
+ <number>24</number>
+ </property>
+ <property name="format" >
+ <string>%p%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>138</width>
<height>51</height>
setSortingEnabled(true);
sortByColumn(0, Qt::AscendingOrder);
+#ifndef Q_WS_QWS
+ // this is a workaround to not join channels automatically... we need a saner way to navigate for qtopia anyway though,
+ // such as mark first, activate at second click...
connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
+#else
+ connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(joinChannel(QModelIndex))); // Qtopia uses single click for activation
+#endif
}
void BufferView::setFilteredModel(QAbstractItemModel *model, BufferViewFilter::Modes mode, QList<NetworkId> nets) {
protected:
// virtual bool event(QEvent *);
virtual void keyPressEvent(QKeyEvent * event);
-
+
private slots:
void on_returnPressed();
void on_textChanged(QString newText);
signals:
void sendText(QString text);
-
+
private:
QStringList history;
qint32 idx;
// Default format
QTextCharFormat def;
def.setForeground(QBrush("#000000"));
- //def.setFont(QFont("Courier", 10));
+ //def.setFont(QFont("Mono", 10));
def.font().setFixedPitch(true);
def.font().setStyleHint(QFont::TypeWriter);
_defaultFormats = QVector<QTextCharFormat>(NumFormatTypes, def);
{ using namespace Global;
quasselVersion = "0.2.0-alpha5-pre";
- quasselDate = "2008-04-08";
- quasselBuild = 712;
+ quasselDate = "2008-04-09";
+ quasselBuild = 715;
//! Minimum client build number the core needs
clientBuildNeeded = 642;