Mantid
Loading...
Searching...
No Matches
qt
widgets
common
inc
MantidQtWidgets
Common
ScriptRepositoryView.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2013 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
#include "
DllOption.h
"
10
#include "
MantidAPI/ScriptRepository.h
"
11
#include "
MantidQtWidgets/Common/MantidDialog.h
"
12
#include "ui_ScriptRepositoryView.h"
13
#include <QDialog>
14
#include <QStyledItemDelegate>
15
16
namespace
MantidQt
{
17
namespace
API
{
18
class
RepoModel;
26
class
EXPORT_OPT_MANTIDQT_COMMON
ScriptRepositoryView
:
public
MantidDialog
{
27
Q_OBJECT
28
30
class
RepoDelegate
:
public
QStyledItemDelegate {
31
public
:
32
RepoDelegate
(QObject *parent =
nullptr
);
33
34
void
paint(QPainter *painter,
const
QStyleOptionViewItem &option,
const
QModelIndex &
index
)
const override
;
35
bool
editorEvent(QEvent *event, QAbstractItemModel *model,
const
QStyleOptionViewItem &option,
36
const
QModelIndex &
index
)
override
;
37
QSize sizeHint(
const
QStyleOptionViewItem &option,
const
QModelIndex &
index
)
const override
;
38
QIcon getIcon(
const
QString &state)
const
;
39
};
41
class
CheckBoxDelegate
:
public
QStyledItemDelegate {
42
public
:
43
CheckBoxDelegate
(QObject *parent =
nullptr
);
44
void
paint(QPainter *painter,
const
QStyleOptionViewItem &option,
const
QModelIndex &
index
)
const override
;
45
bool
editorEvent(QEvent *event, QAbstractItemModel *model,
const
QStyleOptionViewItem &option,
46
const
QModelIndex &
index
)
override
;
47
};
50
class
RemoveEntryDelegate
:
public
QStyledItemDelegate {
51
public
:
52
RemoveEntryDelegate
(QObject *parent =
nullptr
);
53
void
paint(QPainter *painter,
const
QStyleOptionViewItem &option,
const
QModelIndex &
index
)
const override
;
54
bool
editorEvent(QEvent *event, QAbstractItemModel *model,
const
QStyleOptionViewItem &option,
55
const
QModelIndex &
index
)
override
;
56
};
57
58
public
:
59
// constuctor
60
ScriptRepositoryView
(QWidget *parent =
nullptr
);
61
// destructor - not virtual, because this is not intended to be base
62
~ScriptRepositoryView
()
override
;
63
64
signals:
65
// allow Mantid to open a python file to be seen
66
void
loadScript
(
const
QString
/*_t1*/
);
67
68
protected
slots:
69
// allow to interact with the cells, in order to update the description of the
70
// files
71
void
cell_activated(
const
QModelIndex &
/*in*/
);
72
void
updateModel();
73
void
currentChanged(
const
QModelIndex ¤t);
74
void
helpClicked();
75
void
openFolderLink(
const
QString &
/*link*/
);
76
77
private
:
78
bool
chooseLocationAndInstall(
Mantid::API::ScriptRepository_sptr
repo_ptr);
79
void
updateLocationString(
const
std::string &installDir);
80
81
Ui::ScriptRepositoryView *
ui
;
82
RepoModel
*
model
;
83
};
84
85
}
// namespace API
86
}
// namespace MantidQt
DllOption.h
EXPORT_OPT_MANTIDQT_COMMON
#define EXPORT_OPT_MANTIDQT_COMMON
Definition
DllOption.h:15
index
std::map< DeltaEMode::Type, std::string > index
Definition
DeltaEMode.cpp:19
MantidDialog.h
ScriptRepository.h
MantidQt::API::MantidDialog
Definition
MantidDialog.h:54
MantidQt::API::RepoModel
RepoModel : Wrapper for ScriptRepository to fit the Model View Qt Framework.
Definition
RepoModel.h:75
MantidQt::API::ScriptRepositoryView::CheckBoxDelegate
Delegate to show the checkbox for configuring the auto update.
Definition
ScriptRepositoryView.h:41
MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate
Delegate to show the icon to remove the entry from the local and central repository.
Definition
ScriptRepositoryView.h:50
MantidQt::API::ScriptRepositoryView::RepoDelegate
Delegate to show the icons Download and Upload.
Definition
ScriptRepositoryView.h:30
MantidQt::API::ScriptRepositoryView
ScriptRepositoryView : Provide the User Interface to the ScriptRepository.
Definition
ScriptRepositoryView.h:26
MantidQt::API::ScriptRepositoryView::ui
Ui::ScriptRepositoryView * ui
Definition
ScriptRepositoryView.h:81
MantidQt::API::ScriptRepositoryView::loadScript
void loadScript(const QString)
MantidQt::API::ScriptRepositoryView::model
RepoModel * model
Definition
ScriptRepositoryView.h:82
API
Definition
ChudleyElliotSQE.h:11
MantidQt
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Definition
AddWorkspaceDialog.h:18
Mantid::API::ScriptRepository_sptr
std::shared_ptr< ScriptRepository > ScriptRepository_sptr
shared pointer to the function base class
Definition
ScriptRepository.h:588
Generated by
1.9.8