1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel IRC Development Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
23 #include <QApplication>
29 #include "coreproxy.h"
31 #include "chatwidget.h"
35 int main(int argc, char **argv) {
36 QApplication app(argc, argv);
37 QCoreApplication::setOrganizationDomain("quassel-irc.org");
38 QCoreApplication::setApplicationName("Quassel IRC");
39 QCoreApplication::setOrganizationName("Quassel IRC Development Team");
41 Global::runMode = Global::Monolithic;
42 Global::quasselDir = QDir::homePath() + "/.quassel";
44 //settings = new Settings();
45 //global = new Global();
46 guiProxy = new GUIProxy();
47 //coreProxy = new CoreProxy();
48 QObject::connect(Core::guiSession(), SIGNAL(proxySignal(CoreSignal, QVariant, QVariant, QVariant)), guiProxy, SLOT(recv(CoreSignal, QVariant, QVariant, QVariant)));
49 QObject::connect(guiProxy, SIGNAL(send(GUISignal, QVariant, QVariant, QVariant)), Core::guiSession(), SLOT(processSignal(GUISignal, QVariant, QVariant, QVariant)));
54 MainWin *mainWin = new MainWin();
57 int exitCode = app.exec();
68 void MainWin::syncToCore() {
69 //Q_ASSERT(Global::data("CoreReady").toBool());
70 coreBuffers = Core::guiSession()->buffers();
71 // NOTE: We don't need to request server states, because in the monolithic version there can't be
72 // any servers connected at this stage...
76 void CoreProxy::sendToGUI(CoreSignal sig, QVariant arg1, QVariant arg2, QVariant arg3) {
77 guiProxy->recv(sig, arg1, arg2, arg3);
81 GUIProxy::GUIProxy() {
82 if(guiProxy) qFatal("Trying to instantiate more than one GUIProxy object!");
86 void GUIProxy::send(GUISignal sig, QVariant arg1, QVariant arg2, QVariant arg3) {
87 coreProxy->recv(sig, arg1, arg2, arg3);
91 // Dummy function definitions
92 // These are not needed, since we don't have a network connection to the core.
93 void GUIProxy::serverHasData() {}
94 void GUIProxy::connectToCore(QString, quint16) {}
95 void GUIProxy::disconnectFromCore() {}
96 void GUIProxy::updateCoreData(QString) {}
97 void GUIProxy::serverError(QAbstractSocket::SocketError) {}