From: Manuel Nickschas Date: Thu, 22 Nov 2007 18:00:02 +0000 (+0000) Subject: Finishing the switch to types.h and the resulting cleanup. X-Git-Tag: 0.1.0~69 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=99c92e21b3b9eb5ed661632cdfb69aabfc6b2deb Finishing the switch to types.h and the resulting cleanup. There are also some new files related to the nicklist, which don't do much yet though. --- diff --git a/Quassel.kdevelop.filelist b/Quassel.kdevelop.filelist index 1b7ed653..114c8f29 100644 --- a/Quassel.kdevelop.filelist +++ b/Quassel.kdevelop.filelist @@ -65,12 +65,15 @@ src/common/message.cpp src/common/message.h src/common/networkinfo.cpp src/common/networkinfo.h +src/common/nickmodel.cpp +src/common/nickmodel.h src/common/settings.cpp src/common/settings.h src/common/signalproxy.cpp src/common/signalproxy.h src/common/synchronizer.cpp src/common/synchronizer.h +src/common/types.h src/common/util.cpp src/common/util.h src/core @@ -109,6 +112,8 @@ src/qtopia/coreconnectdlg.h src/qtopia/main.cpp src/qtopia/mainwidget.cpp src/qtopia/mainwidget.h +src/qtopia/nicklistwidget.cpp +src/qtopia/nicklistwidget.h src/qtopia/qtopia.pri src/qtopia/qtopiamainwin.cpp src/qtopia/qtopiamainwin.h @@ -118,6 +123,7 @@ src/qtopia/qtopiauistyle.cpp src/qtopia/qtopiauistyle.h src/qtopia/topicbar.cpp src/qtopia/topicbar.h +src/qtopia/types.h src/qtopia/ui src/qtopia/ui/bufferview.ui src/qtopia/ui/bufferviewwidget.ui diff --git a/src/client/client.cpp b/src/client/client.cpp index ec01b283..899991f7 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -20,14 +20,13 @@ #include "client.h" -#include "networkinfo.h" -#include "ircuser.h" -#include "ircchannel.h" - -#include "message.h" - #include "bufferinfo.h" #include "buffertreemodel.h" +#include "global.h" +#include "ircchannel.h" +#include "ircuser.h" +#include "message.h" +#include "networkinfo.h" #include "quasselui.h" #include "signalproxy.h" #include "util.h" diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index bee4cfaf..d22b602a 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -18,7 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "global.h" #include "treemodel.h" /***************************************** diff --git a/src/common/common.pri b/src/common/common.pri index dec566a4..e311a44c 100644 --- a/src/common/common.pri +++ b/src/common/common.pri @@ -1,4 +1,4 @@ DEPMOD = QT_MOD = network -SRCS += global.cpp logger.cpp message.cpp settings.cpp signalproxy.cpp util.cpp networkinfo.cpp ircuser.cpp ircchannel.cpp bufferinfo.cpp -HDRS += global.h logger.h message.h settings.h signalproxy.h util.h networkinfo.h ircuser.h ircchannel.h bufferinfo.h +SRCS += bufferinfo.cpp global.cpp logger.cpp message.cpp nickmodel.cpp settings.cpp signalproxy.cpp util.cpp networkinfo.cpp ircuser.cpp ircchannel.cpp +HDRS += bufferinfo.h global.h logger.h message.h nickmodel.h settings.h signalproxy.h util.h networkinfo.h ircuser.h ircchannel.h types.h diff --git a/src/common/global.cpp b/src/common/global.cpp index 954e52b2..60819536 100644 --- a/src/common/global.cpp +++ b/src/common/global.cpp @@ -18,12 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include #include "global.h" #include "logger.h" -#include "message.h" -#include "util.h" extern void messageHandler(QtMsgType type, const char *msg); diff --git a/src/common/global.h b/src/common/global.h index 33d52f4c..73ddd0be 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -18,42 +18,21 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +// This file needs probably to go away at some point. Not much left anymore. + #ifndef _GLOBAL_H_ #define _GLOBAL_H_ /** The protocol version we use fo the communication between core and GUI */ #define GUI_PROTOCOL 3 -#define BACKLOG_FORMAT 2 -#define BACKLOG_STRING "QuasselIRC Backlog File" - #define DEFAULT_PORT 4242 -#include -#include -#include -#include - /* Some global stuff */ -typedef uint UserId; -typedef uint MsgId; -typedef uint BufferId; -typedef uint NetworkId; - namespace Global { enum RunMode { Monolithic, ClientOnly, CoreOnly }; extern RunMode runMode; } -struct Exception { - Exception(QString msg = "Unknown Exception") : _msg(msg) {}; - virtual ~Exception() {}; // make gcc happy - virtual inline QString msg() { return _msg; } - - protected: - QString _msg; - -}; - #endif diff --git a/src/common/main.cpp b/src/common/main.cpp index 3ca8e34d..f562dd47 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "global.h" #include "settings.h" #include #include diff --git a/src/common/message.h b/src/common/message.h index 43742839..c30c176e 100644 --- a/src/common/message.h +++ b/src/common/message.h @@ -21,12 +21,11 @@ #ifndef _MESSAGE_H_ #define _MESSAGE_H_ -#include #include #include #include "bufferinfo.h" -#include "global.h" +#include "types.h" class Message { Q_DECLARE_TR_FUNCTIONS(Message); diff --git a/src/common/nickmodel.cpp b/src/common/nickmodel.cpp new file mode 100644 index 00000000..b27d9ad8 --- /dev/null +++ b/src/common/nickmodel.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2005-07 by the Quassel IRC 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 "nickmodel.h" + + +NickModel::NickModel(QObject *parent) : QAbstractListModel(parent) { + //QStringList list; list << "test1" << "test2"; + //setStringList(list); + +} + +NickModel::~NickModel() { + + +} diff --git a/src/common/nickmodel.h b/src/common/nickmodel.h new file mode 100644 index 00000000..7620c48a --- /dev/null +++ b/src/common/nickmodel.h @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (C) 2005-07 by the Quassel IRC 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 _NICKMODEL_H_ +#define _NICKMODEL_H_ + +#include + +class NickModel : public QAbstractListModel { + Q_OBJECT + + public: + NickModel(QObject *parent = 0); + ~NickModel(); + + private: + +}; + +#endif diff --git a/src/qtopia/types.h b/src/common/types.h similarity index 100% rename from src/qtopia/types.h rename to src/common/types.h diff --git a/src/core/core.h b/src/core/core.h index 602f7bf4..ae1c05c2 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -27,6 +27,7 @@ #include #include "global.h" +#include "types.h" class CoreSession; class Storage; diff --git a/src/core/coresettings.h b/src/core/coresettings.h index 8c19d732..e11b4666 100644 --- a/src/core/coresettings.h +++ b/src/core/coresettings.h @@ -21,8 +21,8 @@ #ifndef CORESETTINGS_H_ #define CORESETTINGS_H_ -#include "settings.h" #include "global.h" +#include "settings.h" class CoreSettings : public Settings { Q_OBJECT diff --git a/src/core/sqlitestorage.cpp b/src/core/sqlitestorage.cpp index b439aefc..75119bb8 100644 --- a/src/core/sqlitestorage.cpp +++ b/src/core/sqlitestorage.cpp @@ -521,7 +521,7 @@ QList SqliteStorage::requestMsgRange(BufferInfo buffer, int first, int QString SqliteStorage::backlogFile(bool createPath) { // kinda ugly, but I currently see no other way to do that -#ifdef _WINDOWS +#ifdef Q_OS_WIN32 QString quasselDir = QDir::homePath() + qgetenv("APPDATA") + "\\quassel\\"; #else QString quasselDir = QDir::homePath() + "/.quassel/"; diff --git a/src/qtopia/chatwidget.cpp b/src/qtopia/chatwidget.cpp index 6a5ba027..4475962b 100644 --- a/src/qtopia/chatwidget.cpp +++ b/src/qtopia/chatwidget.cpp @@ -24,6 +24,7 @@ ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent) { setStyleSheet("background-color: rgba(255, 255, 255, 60%)"); + setTextInteractionFlags(Qt::TextBrowserInteraction); } void ChatWidget::setContents(QList lines) { diff --git a/src/qtopia/coreconnectdlg.cpp b/src/qtopia/coreconnectdlg.cpp index 09fa196c..10610345 100644 --- a/src/qtopia/coreconnectdlg.cpp +++ b/src/qtopia/coreconnectdlg.cpp @@ -22,9 +22,9 @@ #include #include "coreconnectdlg.h" -#include "global.h" #include "client.h" #include "clientsettings.h" +#include "global.h" CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) { ui.setupUi(this); diff --git a/src/qtopia/coreconnectdlg.h b/src/qtopia/coreconnectdlg.h index 8f03ee0a..a21734b6 100644 --- a/src/qtopia/coreconnectdlg.h +++ b/src/qtopia/coreconnectdlg.h @@ -24,7 +24,6 @@ #include "ui_coreconnectdlg.h" #include "ui_coreconnectprogressdlg.h" #include "ui_editcoreacctdlg.h" -#include "global.h" class CoreConnectProgressDlg; diff --git a/src/qtopia/nicklistwidget.cpp b/src/qtopia/nicklistwidget.cpp new file mode 100644 index 00000000..2a148b3a --- /dev/null +++ b/src/qtopia/nicklistwidget.cpp @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2005-07 by the Quassel IRC 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 "nicklistwidget.h" +#include "nickmodel.h" + +NickListWidget::NickListWidget(QWidget *parent) : QDialog(parent) { + ui.setupUi(this); + + + +} + +NickListWidget::~NickListWidget() { + + + +} + +void NickListWidget::setNickModel(NickModel *model) { + ui.nickView->setModel(model); + +} diff --git a/src/qtopia/nicklistwidget.h b/src/qtopia/nicklistwidget.h new file mode 100644 index 00000000..d15743d5 --- /dev/null +++ b/src/qtopia/nicklistwidget.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2005-07 by the Quassel IRC 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 _NICKLISTWIDGET_H_ +#define _NICKLISTWIDGET_H_ + +#include + +#include "ui_nicklistwidget.h" + +class NickModel; + +class NickListWidget : public QDialog { + Q_OBJECT + + public: + NickListWidget(QWidget *parent = 0); + ~NickListWidget(); + + public slots: + void setNickModel(NickModel *model); + + private: + Ui::NickListWidget ui; + +}; + +#endif diff --git a/src/qtopia/qtopia.pri b/src/qtopia/qtopia.pri index 38ca7022..d0a90aab 100644 --- a/src/qtopia/qtopia.pri +++ b/src/qtopia/qtopia.pri @@ -1,6 +1,8 @@ DEPMOD = uisupport common client QT_MOD = core gui network -HDRS += bufferviewwidget.h chatline.h chatwidget.h coreconnectdlg.h mainwidget.h qtopiaui.h qtopiamainwin.h qtopiauistyle.h topicbar.h -SRCS += bufferviewwidget.cpp chatline.cpp chatwidget.cpp coreconnectdlg.cpp main.cpp mainwidget.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 +HDRS += bufferviewwidget.h chatline.h chatwidget.h coreconnectdlg.h mainwidget.h nicklistwidget.h \ + 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 diff --git a/src/qtopia/qtopiamainwin.cpp b/src/qtopia/qtopiamainwin.cpp index 5d615940..618b2e63 100644 --- a/src/qtopia/qtopiamainwin.cpp +++ b/src/qtopia/qtopiamainwin.cpp @@ -22,6 +22,7 @@ #include "buffertreemodel.h" #include "bufferviewwidget.h" +#include "nicklistwidget.h" #include "chatline.h" #include "coreconnectdlg.h" #include "global.h" @@ -68,6 +69,7 @@ QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(pa addToolBar(toolBar); bufferViewWidget = new BufferViewWidget(this); + nickListWidget = new NickListWidget(this); setupActions(); @@ -94,7 +96,7 @@ QtopiaMainWin::~QtopiaMainWin() { 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())); } @@ -121,6 +123,7 @@ AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) { void QtopiaMainWin::showBuffer(Buffer *b) { mainWidget->setBuffer(b); + //nickListWidget-> } @@ -129,4 +132,8 @@ void QtopiaMainWin::showBufferView() { } +void QtopiaMainWin::showNickList() { + nickListWidget->showMaximized(); +} + diff --git a/src/qtopia/qtopiamainwin.h b/src/qtopia/qtopiamainwin.h index c1a26baf..6f93f62b 100644 --- a/src/qtopia/qtopiamainwin.h +++ b/src/qtopia/qtopiamainwin.h @@ -24,10 +24,10 @@ #include #include "client.h" -#include "global.h" class BufferViewWidget; class MainWidget; +class NickListWidget; class QtopiaMainWin : public QMainWindow { Q_OBJECT @@ -50,6 +50,7 @@ class QtopiaMainWin : public QMainWindow { private slots: void showBuffer(Buffer *); void showBufferView(); + void showNickList(); private: void init(); @@ -57,8 +58,9 @@ class QtopiaMainWin : public QMainWindow { MainWidget *mainWidget; QToolBar *toolBar; - QAction *showBuffersAction; + QAction *showBuffersAction, *showNicksAction; BufferViewWidget *bufferViewWidget; + NickListWidget *nickListWidget; friend class QtopiaUi; }; diff --git a/src/qtopia/ui/nicklistwidget.ui b/src/qtopia/ui/nicklistwidget.ui new file mode 100644 index 00000000..05e18a68 --- /dev/null +++ b/src/qtopia/ui/nicklistwidget.ui @@ -0,0 +1,35 @@ + + NickListWidget + + + + 0 + 0 + 240 + 286 + + + + Nicks in Channel + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + + + + diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index 79786dbc..beb0916f 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -24,7 +24,7 @@ #include "ui_bufferwidget.h" #include "chatview.h" -#include "global.h" +#include "types.h" class Buffer; class ChatView; diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index 2f51fddf..16d4552c 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -20,10 +20,10 @@ #include #include "coreconnectdlg.h" -#include "global.h" #include "client.h" #include "clientsettings.h" #include "configwizard.h" +#include "global.h" CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) { ui.setupUi(this); //qDebug() << "new dlg"; diff --git a/src/qtui/coreconnectdlg.h b/src/qtui/coreconnectdlg.h index 3d8574f1..55041b92 100644 --- a/src/qtui/coreconnectdlg.h +++ b/src/qtui/coreconnectdlg.h @@ -22,7 +22,6 @@ #define _CORECONNECTDLG_H #include "ui_coreconnectdlg.h" -#include "global.h" class CoreConnectDlg: public QDialog { Q_OBJECT diff --git a/src/qtui/identities.h b/src/qtui/identities.h index 91cf06e5..36f74e3c 100644 --- a/src/qtui/identities.h +++ b/src/qtui/identities.h @@ -24,7 +24,6 @@ #include #include -#include "global.h" #include "ui_identitiesdlg.h" #include "ui_identitieseditdlg.h" #include "ui_nickeditdlg.h" diff --git a/src/qtui/serverlist.h b/src/qtui/serverlist.h index f3058b81..fa9c910c 100644 --- a/src/qtui/serverlist.h +++ b/src/qtui/serverlist.h @@ -25,7 +25,6 @@ #include #include #include -#include "global.h" #include "ui_serverlistdlg.h" #include "ui_networkeditdlg.h"