Commit 29eb6b50 authored by Victor Yacovlev's avatar Victor Yacovlev

PROJECT: Added course manager skeleton

parent cd457bad
......@@ -3,7 +3,7 @@ find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui REQUIRED)
include (${QT_USE_FILE})
set(CONFIGURATION_TEMPLATE
"Editor,Browser,Actor*,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI\(notabs,icon=classic,nostartpage,nosessions\)"
"CourseManager,Editor,Browser,Actor*,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI\(notabs,icon=classic,nostartpage,nosessions\)"
)
set(SPLASHSCREEN
"coregui/splashscreens/classic.png"
......
......@@ -3,7 +3,7 @@ find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui REQUIRED)
include (${QT_USE_FILE})
set(CONFIGURATION_TEMPLATE
"Editor,Browser,Actor*,KumirAnalizer\(preload=Files,preload=Strings\),KumirCodeGenerator,KumirCodeRun,!CoreGUI\(notabs,icon=classic,nostartpage,nosessions\)"
"CourseManager,Editor,Browser,Actor*,KumirAnalizer\(preload=Files,preload=Strings\),KumirCodeGenerator,KumirCodeRun,!CoreGUI\(notabs,icon=classic,nostartpage,nosessions\)"
)
set(SPLASHSCREEN
"coregui/splashscreens/classic.png"
......
......@@ -3,7 +3,7 @@ find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui REQUIRED)
include (${QT_USE_FILE})
set(CONFIGURATION_TEMPLATE
"Editor,Actor*,Browser,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI"
"CourseManager,Editor,Actor*,Browser,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI"
)
set(SPLASHSCREEN
......
......@@ -4,7 +4,7 @@ include (${QT_USE_FILE})
set(CONFIGURATION_TEMPLATE
"Editor,Browser,Actor*,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI"
"CourseManager,Editor,Browser,Actor*,KumirAnalizer,KumirCodeGenerator,KumirCodeRun,!CoreGUI"
)
set(SPLASHSCREEN
......
......@@ -4,7 +4,7 @@ include (${QT_USE_FILE})
set(
CONFIGURATION_TEMPLATE
"Editor\(teacher\),Browser,Actor*,KumirAnalizer\(teacher\),KumirCodeGenerator,KumirCodeRun,!CoreGUI\(icon=teacher\)"
"CourseManager,Editor\(teacher\),Browser,Actor*,KumirAnalizer\(teacher\),KumirCodeGenerator,KumirCodeRun,!CoreGUI\(icon=teacher\)"
)
set(
SPLASHSCREEN
......
......@@ -7,5 +7,6 @@ add_subdirectory(kumirbcompiler)
add_subdirectory(browser)
add_subdirectory(editor)
add_subdirectory(coregui)
add_subdirectory(coursemanager)
# add_subdirectory(pascalanalizer)
# add_subdirectory(python3language)
......@@ -10,6 +10,8 @@
namespace CoreGUI {
using namespace Shared;
Plugin::Plugin() :
KPlugin()
{
......@@ -464,6 +466,23 @@ Plugin::~Plugin()
startPage_.widget->deleteLater();
}
void Plugin::setProgramSource(const ProgramSourceText &source)
{
}
GuiInterface::ProgramSourceText Plugin::programSource() const
{
GuiInterface::ProgramSourceText result;
return result;
}
void Plugin::startTesting()
{
}
} // namespace CoreGUI
Q_EXPORT_PLUGIN2(CoreGui, CoreGUI::Plugin)
......@@ -9,6 +9,7 @@
#include "interfaces/generatorinterface.h"
#include "interfaces/actorinterface.h"
#include "interfaces/runinterface.h"
#include "interfaces/guiinterface.h"
#include "widgets/secondarywindow.h"
#include "docbookviewer/docbookview.h"
#include "terminal.h"
......@@ -23,9 +24,11 @@ using namespace Shared;
class Plugin
: public ExtensionSystem::KPlugin
, public Shared::GuiInterface
{
friend class MainWindow;
Q_OBJECT
Q_INTERFACES(Shared::GuiInterface)
public:
explicit Plugin();
~Plugin();
......@@ -41,6 +44,13 @@ public:
static QString DockFloatingKey;
static QString DockGeometryKey;
static QString DockSideKey;
public slots:
void setProgramSource(const ProgramSourceText &source);
ProgramSourceText programSource() const;
void startTesting();
protected slots:
void prepareKumirProgramToRun();
......
name = CourseManager
gui = true
requires= CoreGUI
#include "coursemanager_plugin.h"
namespace CourseManager {
Plugin::Plugin()
: ExtensionSystem::KPlugin()
, mainWindow_(nullptr)
, actionPerformCheck_(nullptr)
, settingsEditorPage_(nullptr)
{
}
QWidget* Plugin::mainWindow() const
{
return mainWindow_;
}
QAction* Plugin::actionPerformCheck() const
{
return actionPerformCheck_;
}
QWidget* Plugin::settingsEditorPage()
{
if (!settingsEditorPage_) {
typedef ExtensionSystem::DeclarativeSettingsPage::Entry Entry;
typedef QMap<QString,Entry> EntryMap;
EntryMap entries; // TODO implement me
settingsEditorPage_ = new ExtensionSystem::DeclarativeSettingsPage(
pluginSpec().name, // Plugin name
tr("Course Manager"), // Title in setting window
mySettings(), // Settings object
entries // A map of configurable items
);
}
return settingsEditorPage_;
}
void Plugin::setEnabled(bool value)
{
}
void Plugin::setTestingResult(ProgramRunStatus status, int value)
{
}
void Plugin::saveSession() const
{
}
void Plugin::restoreSession()
{
}
void Plugin::changeCurrentDirectory(const QString &path)
{
}
void Plugin::changeGlobalState(ExtensionSystem::GlobalState old,
ExtensionSystem::GlobalState current)
{
}
QString Plugin::initialize(const QStringList &arguments)
{
qRegisterMetaType<Shared::CoursesInterface::ProgramRunStatus>
("CourseManager.ProgramRunStatus");
QString error;
return error;
}
void Plugin::updateSettings()
{
if (settingsEditorPage_) {
settingsEditorPage_->setSettingsObject(mySettings());
}
}
} // namespace CourseManager
Q_EXPORT_PLUGIN2(CourseManager, CourseManager::Plugin)
#ifndef COURSEMANAGER_COURSEMANAGER_PLUGIN_H
#define COURSEMANAGER_COURSEMANAGER_PLUGIN_H
#include <QtGlobal>
#include <QObject>
#include <extensionsystem/kplugin.h>
#include <interfaces/coursesinterface.h>
#include <extensionsystem/declarativesettingspage.h>
namespace CourseManager {
class Plugin
: public ExtensionSystem::KPlugin
, public Shared::CoursesInterface
{
Q_OBJECT
Q_INTERFACES(Shared::CoursesInterface)
public:
explicit Plugin();
QWidget* mainWindow() const;
QAction* actionPerformCheck() const;
QWidget* settingsEditorPage();
public slots:
void setEnabled(bool value);
void setTestingResult(ProgramRunStatus status, int value);
private /*methods*/:
void saveSession() const;
void restoreSession();
void changeCurrentDirectory(const QString & path);
void changeGlobalState(ExtensionSystem::GlobalState old,
ExtensionSystem::GlobalState current);
QString initialize(const QStringList &arguments);
void updateSettings();
private /*fields*/:
QWidget* mainWindow_;
QAction* actionPerformCheck_;
ExtensionSystem::DeclarativeSettingsPage* settingsEditorPage_;
};
} // namespace CourseManager
#endif // COURSEMANAGER_COURSEMANAGER_PLUGIN_H
......@@ -20,7 +20,7 @@ public:
virtual QWidget* mainWindow() const = 0;
virtual QAction* actionPerformCheck() const = 0;
public /*slots*/:
public slots:
virtual void setEnabled(bool value) = 0;
virtual void setTestingResult(ProgramRunStatus status, int value) = 0;
......@@ -28,5 +28,7 @@ public /*slots*/:
}
Q_DECLARE_INTERFACE(Shared::CoursesInterface, "kumir2.CourseManager")
#endif // COURSESINTERFACE_H
......@@ -22,7 +22,7 @@ public:
KumFile::Data content;
QString title;
};
public /*slots*/:
public slots:
virtual void setProgramSource(const ProgramSourceText &source) = 0;
virtual ProgramSourceText programSource() const = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment