Commit 6c225be7 authored by Victor Yacovlev's avatar Victor Yacovlev

CoreGUI: Course Manager added to main window

parent f4147da2
......@@ -175,7 +175,24 @@ QString Plugin::initialize(const QStringList & parameters)
connect(helpWindow->toggleViewAction(), SIGNAL(toggled(bool)),
mainWindow_->ui->actionUsage, SLOT(setChecked(bool)));
courseManager_ = ExtensionSystem::PluginManager::instance()
->findPlugin<Shared::CoursesInterface>();
foreach (QMenu* menu, courseManager_->menus()) {
mainWindow_->ui->menubar->insertMenu(mainWindow_->ui->menuHelp->menuAction(), menu);
}
Widgets::SecondaryWindow * coursesWindow = new Widgets::SecondaryWindow(
courseManager_->mainWindow(),
nullptr,
mainWindow_,
mySettings(),
"CoursesWindow"
);
secondaryWindows_ << coursesWindow;
mainWindow_->ui->menuWindow->addAction(coursesWindow->toggleViewAction());
mainWindow_->gr_otherActions->addAction(coursesWindow->toggleViewAction());
KPlugin * kumirRunner = myDependency("KumirCodeRun");
plugin_kumirCodeRun = qobject_cast<RunInterface*>(kumirRunner);
......@@ -352,12 +369,6 @@ QString Plugin::initialize(const QStringList & parameters)
kumirProgram_->setDebuggerWindow(debugger_);
courseManager_ = ExtensionSystem::PluginManager::instance()
->findPlugin<Shared::CoursesInterface>();
return "";
}
......
......@@ -16,7 +16,7 @@ Plugin::Plugin()
MW=new MainWindowTask();
mainWindow_=MW;
}
QList<QMenu*> Plugin::Menus()const
QList<QMenu*> Plugin::menus()const
{
return MenuList;
......
......@@ -25,7 +25,7 @@ public:
QWidget* mainWindow() const;
QAction* actionPerformCheck() const;
QWidget* settingsEditorPage();
QList<QMenu*> Menus() const;
QList<QMenu*> menus() const;
QString getText();
void setParam(QString paramname,QString param){};
int startNewTask(QStringList isps){return 0;};
......
......@@ -3,6 +3,7 @@
#include <QtCore>
#include <QWidget>
#include <QMenu>
namespace Shared
{
......@@ -19,6 +20,7 @@ public:
virtual QWidget* mainWindow() const = 0;
virtual QAction* actionPerformCheck() const = 0;
virtual QList<QMenu*> menus() const = 0;
public slots:
virtual void setEnabled(bool value) = 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