# CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2)
# Select if Quassel should be built in client, server or monolithic mode
-SET(BUILD "mono" CACHE STRING "Defines which Quassel parts are to be built. Can contain 'server', 'client' and/or 'monolithic' (which is the default).")
-SET(BUILD_SERVER )
-SET(BUILD_CLIENT )
+SET(BUILD "mono" CACHE STRING "Defines which Quassel parts are to be built. Can contain 'core', 'gui' and/or 'monolithic' (which is the default).")
+SET(BUILD_CORE )
+SET(BUILD_GUI )
SET(BUILD_MONO )
-IF(BUILD MATCHES "server")
- SET(BUILD_SERVER true)
- MESSAGE(STATUS "Building Quassel server.")
-ENDIF(BUILD MATCHES "server")
-IF(BUILD MATCHES "client")
- SET(BUILD_CLIENT true)
- MESSAGE(STATUS "Building Quassel client.")
-ENDIF(BUILD MATCHES "client")
+IF(BUILD MATCHES "core")
+ SET(BUILD_CORE true)
+ MESSAGE(STATUS "Building Quassel core.")
+ENDIF(BUILD MATCHES "core")
+IF(BUILD MATCHES "gui")
+ SET(BUILD_GUI true)
+ MESSAGE(STATUS "Building Quassel GUI.")
+ENDIF(BUILD MATCHES "gui")
IF(BUILD MATCHES "mono")
SET(BUILD_MONO true)
MESSAGE(STATUS "Building monolithic Quassel.")
ENDIF(BUILD MATCHES "mono")
-IF(NOT BUILD_MONO AND NOT BUILD_SERVER AND NOT BUILD_CLIENT)
- MESSAGE(FATAL_ERROR "You have not selected which parts of Quassel I should build. Aborting.\nRun 'cmake -DBUILD=<part>', where <part> contains one or more of 'server', 'client' or 'monolithic'.")
-ENDIF(NOT BUILD_MONO AND NOT BUILD_SERVER AND NOT BUILD_CLIENT)
-
-# We need Qt4 support.
-FIND_PACKAGE(Qt4 REQUIRED)
-
-# Set needed libraries
-SET(QT_USE_QTXML true)
-IF(NOT BUILD_CLIENT AND NOT BUILD_MONO)
- SET(QT_DONT_USE_QTGUI true)
- MESSAGE(STATUS "Disabling GUI support.")
-ENDIF(NOT BUILD_CLIENT AND NOT BUILD_MONO)
-INCLUDE(${QT_USE_FILE})
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+IF(NOT BUILD_MONO AND NOT BUILD_CORE AND NOT BUILD_GUI)
+ MESSAGE(FATAL_ERROR "You have not selected which parts of Quassel I should build. Aborting.\nRun 'cmake -DBUILD=<part>', where <part> contains one or more of 'core', 'gui' or 'monolithic'.")
+ENDIF(NOT BUILD_MONO AND NOT BUILD_CORE AND NOT BUILD_GUI)
# Define files
SET(quassel_mono_SRCS main/main_mono.cpp)
+SET(quassel_core_SRCS main/main_core.cpp)
SET(quassel_RCCS images/icons.qrc)
SET(quassel_DIRS gui core)
FOREACH(dir ${quassel_DIRS})
SET(SDIRS ${SDIRS} "${CMAKE_CURRENT_SOURCE_DIR}/${dir}")
ENDFOREACH(dir)
-INCLUDE_DIRECTORIES(${SDIRS} ${QT_INCLUDES})
+INCLUDE_DIRECTORIES(${SDIRS})
-ADD_SUBDIRECTORY(gui)
-ADD_SUBDIRECTORY(core)
+# We need Qt4 support.
+FIND_PACKAGE(Qt4 REQUIRED)
+
+# Set needed libraries
+SET(QT_USE_QTXML true)
+SET(QT_DONT_USE_QTGUI true) # This is added later if GUI is requested
+INCLUDE(${QT_USE_FILE})
+ADD_SUBDIRECTORY(core)
QT4_ADD_RESOURCES(_RCCS ${quassel_RCCS})
-IF(BUILD_MONO)
- ADD_EXECUTABLE(quassel ${quassel_mono_SRCS} ${_RCCS})
- TARGET_LINK_LIBRARIES(quassel gui core ${QT_LIBRARIES})
-ENDIF(BUILD_MONO)
+IF(BUILD_CORE)
+ ADD_EXECUTABLE(quasselcore ${quassel_core_SRCS} ${_RCCS})
+ TARGET_LINK_LIBRARIES(quasselcore core ${QT_LIBRARIES})
+ENDIF(BUILD_CORE)
+
+IF(BUILD_GUI OR BUILD_MONO) # OK, now we need QtGui!
+ REMOVE_DEFINITIONS(-DQT_CORE_LIB -DQT_GUI_LIB ${QT_DEFINITIONS})
+ SET(QT_DONT_USE_QTGUI "")
+ SET(QT_INCLUDE_DIR "")
+ SET(QT_LIBRARIES "")
+ INCLUDE(${QT_USE_FILE})
+
+ IF(BUILD_MONO)
+ ADD_SUBDIRECTORY(gui)
+ ADD_EXECUTABLE(quassel ${quassel_mono_SRCS} ${_RCCS})
+ TARGET_LINK_LIBRARIES(quassel gui core ${QT_LIBRARIES})
+ ENDIF(BUILD_MONO)
-IF(BUILD_SERVER)
-# MESSAGE(FATAL_ERROR "Server mode not yet supported.")
- ADD_EXECUTABLE(quasselserver ${quassel_mono_SRCS} ${_RCCS})
- TARGET_LINK_LIBRARIES(quasselserver gui core ${QT_LIBRARIES})
-ENDIF(BUILD_SERVER)
+ IF(BUILD_GUI)
+ ADD_SUBDIRECTORY(gui)
+ MESSAGE(FATAL_ERROR "Client mode not yet supported.")
+ ENDIF(BUILD_GUI)
-IF(BUILD_CLIENT)
- MESSAGE(FATAL_ERROR "Client mode not yet supported.")
-ENDIF(BUILD_CLIENT)
+ENDIF(BUILD_GUI OR BUILD_MONO)
-SET(core_SRCS logger.cpp quassel.cpp)
-SET(core_HDRS quassel.h)
+SET(core_SRCS logger.cpp quassel.cpp proxy.cpp core.cpp)
+SET(core_HDRS quassel.h proxy.h core.h)
SET(core_MOCS logger.h)
QT4_WRAP_CPP(_MOC ${core_MOCS})
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005/06 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 *
+ * (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 "core.h"
+
+#include <QSettings>
+
+void Core::init() {
+
+
+}
+
+VarMap Core::loadIdentities() {
+ QSettings s;
+ return s.value("Network/Identities").toMap();
+}
+
+void Core::storeIdentities(VarMap identities) {
+ QSettings s;
+ s.setValue("Network/Identities", identities);
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005/06 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 *
+ * (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 _CORE_H_
+#define _CORE_H_
+
+#include <QMap>
+#include <QString>
+#include <QVariant>
+
+typedef QMap<QString, QVariant> VarMap;
+
+class Core {
+
+ public:
+ static void init();
+ static VarMap loadNetworks();
+ static void storeNetworks(VarMap);
+ static VarMap loadIdentities();
+ static void storeIdentities(VarMap);
+
+};
+
+#endif
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005/06 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 *
+ * (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 "proxy.h"
+
+#include <iostream>
+
+using namespace Proxy;
+
+VarMap CoreProxy::loadIdentities() {
+ return Core::loadIdentities();
+}
+
+void CoreProxy::storeIdentities(VarMap id) {
+ Core::storeIdentities(id);
+}
+
+
+
+VarMap GuiProxy::loadIdentities() {
+ return proxyConnect(LOAD_IDENTITIES).toMap();
+}
+
+void GuiProxy::storeIdentities(VarMap arg) {
+ proxyConnect(STORE_IDENTITIES, arg);
+}
+
+/*
+QVariant proxyConnect(uint func, QVariant arg) {
+ switch(func) {
+ case LOAD_IDENTITIES: return (QVariant) CoreProxy::loadIdentities();
+ case STORE_IDENTITIES: CoreProxy::storeIdentities(arg.toMap()); return 0;
+
+ }
+ return 0;
+}
+*/
\ No newline at end of file
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005/06 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 *
+ * (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 _PROXY_H_
+#define _PROXY_H_
+
+#include "core.h"
+
+namespace Proxy {
+ enum { LOAD_IDENTITIES, STORE_IDENTITIES };
+};
+
+class CoreProxy {
+ Q_OBJECT
+
+ public:
+ static VarMap loadIdentities();
+ static void storeIdentities(VarMap);
+
+};
+
+
+class GuiProxy {
+ Q_OBJECT
+
+ public:
+ static VarMap loadIdentities();
+ static void storeIdentities(VarMap);
+
+};
+
+extern QVariant proxyConnect(uint func, QVariant arg = QVariant());
+
+#endif
#include "quassel.h"
#include "logger.h"
+#include "proxy.h"
-#include <QIcon>
#include <QString>
#include <QDomDocument>
/* not done yet */
void Quassel::initIconMap() {
+// Do not depend on GUI in core!
+/*
QDomDocument doc("IconMap");
QFile file("images/iconmap.xml");
if(!file.open(QIODevice::ReadOnly)) {
file.close();
}
+*/
}
* @param symbol Symbol of requested icon
* @return Pointer to a newly created QIcon
*/
-QIcon *Quassel::getIcon(QString /*symbol*/) {
+//
+//QIcon *Quassel::getIcon(QString /*symbol*/) {
//if(symbol == "connect"
- return 0;
-}
+// return 0;
+//}
#define _QUASSEL_H_
class Logger;
-class QIcon;
class QString;
#include <QHash>
static Logger *getLogger();
static void setLogger(Logger *);
- static QIcon *getIcon(QString symbol);
+// static QIcon *getIcon(QString symbol);
private:
static void initIconMap();
static Logger *logger;
- static QString iconPath;
+// static QString iconPath;
static QHash<QString, QString> iconMap;
};
QT4_WRAP_CPP(_MOC ${gui_MOCS})
# We need to workaround a dependency bug with out-of-source builds...
-SET_SOURCE_FILES_PROPERTIES(${gui_SRCS} PROPERTIES
-OBJECT_DEPENDS "${_UIC}")
+SET_SOURCE_FILES_PROPERTIES(${gui_SRCS} PROPERTIES OBJECT_DEPENDS "${_UIC}")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ADD_LIBRARY(gui ${gui_HDRS} ${gui_SRCS} ${_MOC} ${_UIC})
***************************************************************************/
#include "serverlist.h"
+#include "proxy.h"
/* NOTE: This dialog holds not only the server list, but also the identities.
* This makes perfect sense given the fact that connections are initiated from
}
void ServerListDlg::loadIdentities() {
- QSettings s;
+ //QSettings s;
//s.beginGroup("Identities");
- identities = s.value("Network/Identities").toMap();
+ //identities = s.value("Network/Identities").toMap();
+ identities = GuiProxy::loadIdentities();
while(!identities.contains("Default")) {
identities = VarMap();
editIdentities();
}
void ServerListDlg::storeIdentities() {
- QSettings s;
- s.setValue("Network/Identities", identities);
+ //QSettings s;
+ //s.setValue("Network/Identities", identities);
+ GuiProxy::storeIdentities(identities);
}
void ServerListDlg::editIdentities() {
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005/06 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 *
+ * (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 <iostream>
+
+#include <QCoreApplication>
+
+#include "quassel.h"
+#include "logger.h"
+#include "proxy.h"
+
+int main(int argc, char **argv) {
+
+ Core::init();
+ Quassel::init();
+ Logger *logger = new Logger();
+ Quassel::setLogger(logger);
+
+ QCoreApplication app(argc, argv);
+
+ QCoreApplication::setOrganizationDomain("quassel-irc.org");
+ QCoreApplication::setApplicationName("Quassel IRC");
+ QCoreApplication::setOrganizationName("The Quassel Team");
+
+ return app.exec();
+}
+
+QVariant proxyConnect(uint func, QVariant arg) {
+ switch(func) {
+ case LOAD_IDENTITIES: return (QVariant) CoreProxy::loadIdentities();
+ case STORE_IDENTITIES: CoreProxy::storeIdentities(arg.toMap()); return 0;
+
+ }
+ return 0;
+}
#include <QApplication>
+#include "core.h"
#include "quassel.h"
#include "logger.h"
+#include "proxy.h"
#include "mainwin.h"
QApplication::setApplicationName("Quassel IRC");
QApplication::setOrganizationName("The Quassel Team");
+ Core::init();
+
MainWin mainWin;
mainWin.show();
return app.exec();
}
+
+QVariant proxyConnect(uint func, QVariant arg) {
+ using namespace Proxy;
+
+ switch(func) {
+ case LOAD_IDENTITIES: return (QVariant) CoreProxy::loadIdentities();
+ case STORE_IDENTITIES: CoreProxy::storeIdentities(arg.toMap()); return 0;
+
+ }
+ return 0;
+}