if(WANT_MONO)
setup_qt4_variables(${LINK_DBUS} GUI NETWORK SCRIPT SQL ${LINK_WEBKIT})
- add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS})
+ qt4_wrap_cpp(MOC qtui/monoapplication.h)
+ add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${MOC} ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS})
add_dependencies(quassel icons genversion_run)
set_target_properties(quassel PROPERTIES
COMPILE_FLAGS "-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_MONO"
class BufferSyncer;
class ClientBacklogManager;
class ClientIrcListHelper;
+class ClientSyncer;
class BufferViewManager;
class IrcUser;
class IrcChannel;
void requestCreateNetwork(const NetworkInfo &info);
void requestRemoveNetwork(NetworkId);
+ void newClientSyncer(ClientSyncer *);
+
public slots:
//void selectBuffer(Buffer *);
}
void ClientSyncer::useInternalCore() {
+ emit startInternalCore();
emit connectToInternalCore(Client::instance()->signalProxy());
}
void encrypted(bool);
+ void startInternalCore();
void connectToInternalCore(SignalProxy *proxy);
public slots:
#include "coreconnectdlg.h"
+#include "client.h"
#include "clientsettings.h"
#include "clientsyncer.h"
#include "coreconfigwizard.h"
#include "iconloader.h"
-#include "monoapplication.h"
CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
: QDialog(parent)
setWindowFlags(Qt::Sheet);
clientSyncer = new ClientSyncer(this);
+ connect(this, SIGNAL(newClientSyncer(ClientSyncer *)), Client::instance(), SIGNAL(newClientSyncer(ClientSyncer *)));
+ emit newClientSyncer(clientSyncer); // announce the new client syncer via the client.
wizard = 0;
}
void CoreConnectDlg::on_useInternalCore_clicked() {
- // FIXME: this needs to be a qobject_cast - therefore MonolithicApplication needs to be a proper QObject... :/
- MonolithicApplication *monoApp = static_cast<MonolithicApplication *>(QApplication::instance());
- if(monoApp) {
- qDebug() << "starting core...";
- monoApp->startInternalCore();
- monoApp->connectClientSyncer(clientSyncer);
- }
+// // FIXME: this needs to be a qobject_cast - therefore MonolithicApplication needs to be a proper QObject... :/
+// MonolithicApplication *monoApp = qobject_cast<MonolithicApplication *>(QApplication::instance());
+// if(monoApp) {
+// qDebug() << "starting core...";
+// monoApp->startInternalCore();
+// monoApp->connectClientSyncer(clientSyncer);
+// }
clientSyncer->useInternalCore();
startSync();
}
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _CORECONNECTDLG_H_
-#define _CORECONNECTDLG_H_
+#ifndef CORECONNECTDLG_H
+#define CORECONNECTDLG_H
#include <QAbstractSocket>
CoreConnectDlg(bool = false, QWidget *parent = 0);
~CoreConnectDlg();
-private slots:
+signals:
+ void newClientSyncer(ClientSyncer *);
+private slots:
/*** Phase Null: Accounts ***/
void restartPhaseNull();
}
bool MonolithicApplication::init() {
- if(Quassel::init()) {
- return QtUiApplication::init();
+ connect(Client::instance(), SIGNAL(newClientSyncer(ClientSyncer *)), this, SLOT(newClientSyncer(ClientSyncer *)));
+ if(QtUiApplication::init()) {
+ return true;
}
return false;
}
delete _internal;
}
-bool MonolithicApplication::startInternalCore() {
- return _internal->init();
+void MonolithicApplication::newClientSyncer(ClientSyncer *syncer) {
+ connect(syncer, SIGNAL(startInternalCore()), this, SLOT(startInternalCore()));
}
-void MonolithicApplication::connectClientSyncer(ClientSyncer *syncer) {
+void MonolithicApplication::startInternalCore() {
+ _internal->init();
Core *core = Core::instance();
+ ClientSyncer *syncer = static_cast<ClientSyncer *>(sender());
connect(syncer, SIGNAL(connectToInternalCore(SignalProxy *)), core, SLOT(setupInternalClientSession(SignalProxy *)));
connect(core, SIGNAL(sessionState(const QVariant &)), syncer, SLOT(internalSessionStateReceived(const QVariant &)));
}
class CoreApplicationInternal;
class MonolithicApplication : public QtUiApplication {
+ Q_OBJECT
public:
MonolithicApplication(int &, char **);
~MonolithicApplication();
bool init();
- bool startInternalCore();
- void connectClientSyncer(ClientSyncer *syncer);
+
+private slots:
+ void newClientSyncer(ClientSyncer *syncer);
+ void startInternalCore();
private:
CoreApplicationInternal *_internal;
// QTimer::singleShot(0, gui, SLOT(init()));
gui->init();
resumeSessionIfPossible();
-
return true;
}
return false;