Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerExtensionsManagerWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerExtensionsManagerWidget_h
22 #define __qSlicerExtensionsManagerWidget_h
23 
24 // CTK includes
25 #include <ctkErrorLogLevel.h>
26 
27 // Qt includes
28 #include <QUrl>
29 #include <QWidget>
30 
31 // QtGUI includes
32 #include "qSlicerBaseQTGUIExport.h"
33 
34 // CTK includes
35 #include <ctkErrorLogLevel.h>
36 
37 class qSlicerExtensionsManagerWidgetPrivate;
39 
40 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerExtensionsManagerWidget
41  : public QWidget
42 {
43  Q_OBJECT
44 public:
46  typedef QWidget Superclass;
47 
49  explicit qSlicerExtensionsManagerWidget(QWidget* parent = nullptr);
50 
53 
54  Q_INVOKABLE qSlicerExtensionsManagerModel* extensionsManagerModel()const;
55  Q_INVOKABLE void setExtensionsManagerModel(qSlicerExtensionsManagerModel* model);
56 
58  bool confirmClose();
59 
60  bool isInBatchProcessing();
61 
62 signals:
63 
66  void inBatchProcessing(bool batch);
67 
68 public slots:
69  void refreshInstallWidget();
70 
71  // Request update state of automatic extension update check and install checkbox states
72  void updateAutoUpdateWidgetsFromModel();
73 
74 protected slots:
75  void onModelUpdated();
76 
77  void onCurrentTabChanged(int index);
78 
79  void onManageLinkActivated(const QUrl& link);
80  void onManageUrlChanged(const QUrl& newUrl);
81  void onInstallUrlChanged(const QUrl& newUrl);
82  void onSearchTextChanged(const QString& newText);
83 
84  void onCheckForUpdatesTriggered();
85  void onEditBookmarksTriggered();
86  void onInstallUpdatesTriggered();
87  void onInstallBookmarkedTriggered();
88  void onInstallFromFileTriggered();
89 
90  void setAutoUpdateCheck(bool toggle);
91  void setAutoUpdateInstall(bool toggle);
92  void setAutoInstallDependencies(bool toggle);
93 
94  void onMessageLogged(const QString& text, ctkErrorLogLevel::LogLevels level);
95  void onMessagesAcknowledged();
96 
97 protected:
98  void timerEvent(QTimerEvent*) override;
99 
100  void processSearchTextChange();
101 
102  QScopedPointer<qSlicerExtensionsManagerWidgetPrivate> d_ptr;
103 
104 private:
105  Q_DECLARE_PRIVATE(qSlicerExtensionsManagerWidget);
106  Q_DISABLE_COPY(qSlicerExtensionsManagerWidget);
107 };
108 
109 #endif
Class querying and storing extensions data.
QScopedPointer< qSlicerExtensionsManagerWidgetPrivate > d_ptr