X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=main%2Fmain_mono.cpp;h=87360c6335167dce226f3ff4eb2245fa4a6eca11;hp=9d3e5789415349ab4f2d7dfe12d9bad01be78d8e;hb=8fc3a498f754f34b21d2a163e2a28323dae384cb;hpb=bab358d776c74a37a54297125d50ba4c5117205d diff --git a/main/main_mono.cpp b/main/main_mono.cpp index 9d3e5789..87360c63 100644 --- a/main/main_mono.cpp +++ b/main/main_mono.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 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 * @@ -22,24 +22,70 @@ #include -#include "quassel.h" -#include "logger.h" +#include "core.h" +#include "style.h" +#include "global.h" +#include "guiproxy.h" +#include "coreproxy.h" +#include "settings.h" +#include "chatwidget.h" #include "mainwin.h" int main(int argc, char **argv) { - - Quassel::init(); - Logger *logger = new Logger(); - Quassel::setLogger(logger); - QApplication app(argc, argv); - QApplication::setOrganizationDomain("quassel-irc.org"); QApplication::setApplicationName("Quassel IRC"); QApplication::setOrganizationName("The Quassel Team"); - MainWin mainWin; - mainWin.show(); - return app.exec(); + Global::runMode = Global::Monolithic; + Global::quasselDir = QDir::homePath() + "/.quassel"; + + //settings = new Settings(); + global = new Global(); + guiProxy = new GUIProxy(); + coreProxy = new CoreProxy(); + + Settings::init(); + Style::init(); + + MainWin *mainWin = new MainWin(); + mainWin->show(); + mainWin->init(); + int exitCode = app.exec(); + delete core; + delete guiProxy; + delete coreProxy; + delete global; + delete mainWin; + //delete settings; + return exitCode; +} + +void MainWin::syncToCore() { + Q_ASSERT(global->getData("CoreReady").toBool()); + coreBuffers = core->getBuffers(); + // NOTE: We don't need to request server states, because in the monolithic version there can't be + // any servers connected at this stage... } + +void CoreProxy::sendToGUI(CoreSignal sig, QVariant arg1, QVariant arg2, QVariant arg3) { + guiProxy->recv(sig, arg1, arg2, arg3); +} + +GUIProxy::GUIProxy() { + if(guiProxy) qFatal("Trying to instantiate more than one CoreProxy object!"); +} + +void GUIProxy::send(GUISignal sig, QVariant arg1, QVariant arg2, QVariant arg3) { + coreProxy->recv(sig, arg1, arg2, arg3); +} + +// Dummy function definitions +// These are not needed, since we don't have a network connection to the core. +void GUIProxy::serverHasData() {} +void GUIProxy::connectToCore(QString, quint16) {} +void GUIProxy::disconnectFromCore() {} +void GUIProxy::updateCoreData(QString) {} +void GUIProxy::serverError(QAbstractSocket::SocketError) {} +