list(APPEND qt_components Gui Widgets)
endif()
if (BUILD_CORE)
- list(APPEND qt_components Script Sql)
+ list(APPEND qt_components Sql)
endif()
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS ${qt_components})
PUBLIC
Qt5::Core
Qt5::Network
- Qt5::Script
Qt5::Sql
Quassel::Common
)
#include <utility>
-#include <QtScript>
-
#include "core.h"
#include "corebacklogmanager.h"
#include "corebuffersyncer.h"
, _sessionEventProcessor(new CoreSessionEventProcessor(this))
, _ctcpParser(new CtcpParser(this))
, _ircParser(new IrcParser(this))
- , scriptEngine(new QScriptEngine(this))
, _processMessages(false)
, _ignoreListManager(this)
, _highlightRuleManager(this)
_coreInfo->setCoreData(data);
loadSettings();
- initScriptEngine();
eventManager()->registerObject(ircParser(), EventManager::NormalPriority);
eventManager()->registerObject(sessionEventProcessor(), EventManager::HighPriority); // needs to process events *before* the stringifier!
return Protocol::SessionState(identities, bufferInfos, networkIds);
}
-void CoreSession::initScriptEngine()
-{
- signalProxy()->attachSlot(SIGNAL(scriptRequest(QString)), this, &CoreSession::scriptRequest);
- signalProxy()->attachSignal(this, &CoreSession::scriptResult);
-
- // FIXME
- // QScriptValue storage_ = scriptEngine->newQObject(storage);
- // scriptEngine->globalObject().setProperty("storage", storage_);
-}
-
-void CoreSession::scriptRequest(QString script)
-{
- emit scriptResult(scriptEngine->evaluate(script).toString());
-}
-
/*** Identity Handling ***/
void CoreSession::createIdentity(const Identity& identity, const QVariantMap& additional)
{
struct NetworkInfo;
-class QScriptEngine;
-
class CoreSession : public QObject
{
Q_OBJECT
void displayMsg(Message message);
void displayStatusMsg(QString, QString);
- void scriptResult(QString result);
-
//! Identity has been created.
/** This signal is propagated to the clients to tell them that the given identity has been created.
* \param identity The new identity.
void destroyNetwork(NetworkId);
- void scriptRequest(QString script);
-
void clientsConnected();
void clientsDisconnected();
void processMessages();
void loadSettings();
- void initScriptEngine();
/// Hook for converting events to the old displayMsg() handlers
Q_INVOKABLE void processMessageEvent(MessageEvent* event);
CtcpParser* _ctcpParser;
IrcParser* _ircParser;
- QScriptEngine* scriptEngine;
-
/**
* This method obtains the prefixes of the message's sender within a channel, by looking up their channelmodes, and
* processing them to prefixes based on the network's settings.
coreinfodlg.cpp
coresessionwidget.cpp
debugbufferviewoverlay.cpp
- debugconsole.cpp
debuglogdlg.cpp
debugmessagemodelfilter.cpp
inputwidget.cpp
coreinfodlg.ui
coresessionwidget.ui
debugbufferviewoverlay.ui
- debugconsole.ui
debuglogdlg.ui
inputwidget.ui
msgprocessorstatuswidget.ui
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2005-2019 by the Quassel Project *
- * 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) version 3. *
- * *
- * 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., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include "debugconsole.h"
-
-#include "client.h"
-#include "signalproxy.h"
-
-DebugConsole::DebugConsole(QWidget* parent)
- : QDialog(parent)
-{
- ui.setupUi(this);
-
- Client::signalProxy()->attachSignal(this, &DebugConsole::scriptRequest);
- Client::signalProxy()->attachSlot(SIGNAL(scriptResult(QString)), this, &DebugConsole::scriptResult);
-}
-
-void DebugConsole::on_evalButton_clicked()
-{
- if (ui.selectCore->isChecked()) {
- emit scriptRequest(ui.scriptEdit->toPlainText());
- }
-}
-
-void DebugConsole::scriptResult(QString result)
-{
- ui.resultLabel->setText(result);
-}
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2005-2019 by the Quassel Project *
- * 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) version 3. *
- * *
- * 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., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#ifndef DEBUGCONSOLE_H
-#define DEBUGCONSOLE_H
-
-#include "ui_debugconsole.h"
-
-class DebugConsole : public QDialog
-{
- Q_OBJECT
-
-public:
- DebugConsole(QWidget* parent = nullptr);
-
-public slots:
- void scriptResult(QString result);
-
-signals:
- void scriptRequest(QString script);
-
-private slots:
- void on_evalButton_clicked();
-
-private:
- Ui::DebugConsole ui;
-};
-
-#endif
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DebugConsole</class>
- <widget class="QDialog" name="DebugConsole">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>490</width>
- <height>435</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Debug Console</string>
- </property>
- <layout class="QVBoxLayout">
- <property name="spacing">
- <number>2</number>
- </property>
- <property name="margin">
- <number>3</number>
- </property>
- <item>
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>10</number>
- </property>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QRadioButton" name="selectLocal">
- <property name="text">
- <string>local</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="selectCore">
- <property name="text">
- <string>core</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTextEdit" name="scriptEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="evalButton">
- <property name="text">
- <string>Evaluate!</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="resultLabel">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <tabstops>
- <tabstop>selectLocal</tabstop>
- <tabstop>selectCore</tabstop>
- <tabstop>scriptEdit</tabstop>
- <tabstop>evalButton</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>