Skip to content
Snippets Groups Projects
Commit f65154f6 authored by Alice Russell's avatar Alice Russell
Browse files

Wrap Script repo to work on workbench

parent 75d9ca4a
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ from qtpy.QtWidgets import (QApplication, QDesktopWidget, QFileDialog,
from mantidqt.algorithminputhistory import AlgorithmInputHistory # noqa
from mantidqt.interfacemanager import InterfaceManager # noqa
from mantidqt.widgets import manageuserdirectories # noqa
from mantidqt.widgets.scriptrepository import ScriptRepositoryView # noqa
from mantidqt.widgets.codeeditor.execution import PythonCodeExecution # noqa
from mantidqt.utils.qt import (add_actions, create_action, plugins,
widget_updates_disabled) # noqa
......@@ -300,6 +301,9 @@ class MainWindow(QMainWindow):
action_manage_directories = create_action(
self, "Manage User Directories",
on_triggered=self.open_manage_directories)
action_script_repository = create_action(
self, "Script Repository",
on_triggered=self.open_script_repository)
action_settings = create_action(
self, "Settings", on_triggered=self.open_settings_window)
action_quit = create_action(
......@@ -309,7 +313,8 @@ class MainWindow(QMainWindow):
action_save_script, action_save_script_as,
action_generate_ws_script, None, action_save_project,
action_save_project_as, None, action_settings, None,
action_manage_directories, None, action_quit]
action_manage_directories, None, action_script_repository,
None, action_quit]
# view menu
action_restore_default = create_action(
......@@ -607,6 +612,9 @@ class MainWindow(QMainWindow):
def open_manage_directories(self):
manageuserdirectories.ManageUserDirectories.openManageUserDirectories()
def open_script_repository(self):
ScriptRepositoryView(self).exec_()
def open_settings_window(self):
settings = SettingsPresenter(self)
settings.show()
......
......@@ -401,6 +401,18 @@ public:
static void openManageUserDirectories();
};
// ---------------------------------
// Script Repository
// ---------------------------------
class ScriptRepositoryView : QDialog {
%TypeHeaderCode
#include "MantidQtWidgets/Common/ScriptRepositoryView.h"
%End
public:
ScriptRepositoryView(QWidget *parent = nullptr);
};
// ---------------------------------
// Fit Property Browser
// ---------------------------------
......@@ -436,7 +448,7 @@ public:
QStringList getWorkspaceNames();
void fit();
void addAllowedSpectra(const QString &wsName, const QList<int> &wsIndices);
void addAllowedTableWorkspace(const QString &wsName);
void addAllowedTableWorkspace(const QString &wsName);
void setTextPlotGuess(const QString);
bool plotDiff() const;
......
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantidqt package
#
#
from __future__ import (absolute_import, unicode_literals)
from mantidqt.utils.qt import import_qt
ScriptRepositoryView = import_qt('.._common', 'mantidqt.widgets', 'ScriptRepositoryView')
This diff is collapsed.
......@@ -16,7 +16,6 @@
#include <QStringList>
#include <QVariant>
#include <QWidget>
#include <QtConcurrentRun>
class QLineEdit;
class QCheckBox;
......
......@@ -13,11 +13,9 @@
namespace MantidQt {
namespace API {
/** RepoTreeView : A specialization of QTreeView class that emits signal every
time
the selection change. It extends the currentChanged method in order to add
the
emition of the signal currentCell.
*/
* time the selection change. It extends the currentChanged method in order to
* add the emition of the signal currentCell.
*/
class EXPORT_OPT_MANTIDQT_COMMON RepoTreeView : public QTreeView {
Q_OBJECT
......
......@@ -8,6 +8,7 @@
#define MANTID_API_SCRIPTREPOSITORYVIEW_H_
#include "DllOption.h"
#include "MantidQtWidgets/Common/MantidDialog.h"
#include "ui_ScriptRepositoryView.h"
#include <QDialog>
#include <QStyledItemDelegate>
......@@ -16,17 +17,13 @@ namespace MantidQt {
namespace API {
class RepoModel;
/** ScriptRepositoryView : Provide the User Interface to the ScriptRepository.
It does so
through the Mantid Model View Framework. It is composed by a specialized
QTreeView
(RepoTreeView) and a TextBrowser. The TreeView is populated with the
RepoModel, wich wrappers
the ScriptRepository. Inside this class, there are two nested classes that
will implement
delegates to the columns of Status and AutoUpdate in order to improve the
User Experience.
It does so through the Mantid Model View Framework. It is composed by a
specialized QTreeView (RepoTreeView) and a TextBrowser. The TreeView is
populated with the RepoModel, wich wrappers the ScriptRepository. Inside this
class, there are two nested classes that will implement delegates to the
columns of Status and AutoUpdate in order to improve the User Experience.
*/
class EXPORT_OPT_MANTIDQT_COMMON ScriptRepositoryView : public QDialog {
class EXPORT_OPT_MANTIDQT_COMMON ScriptRepositoryView : public MantidDialog {
Q_OBJECT
/// Delegate to show the icons Download and Upload
......
......@@ -93,7 +93,7 @@ const QString dir_not_empty_label =
*
*/
ScriptRepositoryView::ScriptRepositoryView(QWidget *parent)
: QDialog(parent), ui(new Ui::ScriptRepositoryView) {
: MantidDialog(parent), ui(new Ui::ScriptRepositoryView) {
using Mantid::API::ScriptRepositoryFactory;
using Mantid::Kernel::ConfigService;
using Mantid::Kernel::ConfigServiceImpl;
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQT_API_SCRIPTREPOSITORYVIEWTEST_H_
#define MANTIDQT_API_SCRIPTREPOSITORYVIEWTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidQtWidgets/Common/ScriptRepositoryView.h"
using MantidQt::API::ScriptRepositoryView;
class ScriptRepositoryViewTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static ScriptRepositoryViewTest *createSuite() { return new ScriptRepositoryViewTest(); }
static void destroySuite( ScriptRepositoryViewTest *suite ) { delete suite; }
void test_Something()
{
ScriptRepositoryView();
}
};
#endif /* MANTIDQT_API_SCRIPTREPOSITORYVIEWTEST_H_ */
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment