WSL/SLF GitLab Repository

MainPanel.h 2.22 KB
Newer Older
1
2
3
4
5
/*****************************************************************************/
/*  Copyright 2019 WSL Institute for Snow and Avalanche Research  SLF-DAVOS  */
/*****************************************************************************/
/* This file is part of INIshell.
   INIshell is free software: you can redistribute it and/or modify
6
   it under the terms of the GNU General Public License as published by
7
8
9
10
11
12
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   INIshell is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
   GNU General Public License for more details.
14

15
16
   You should have received a copy of the GNU General Public License
   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
17
18
*/

19
/*
20
 * The main information grouping element including the Workflow panel and main tab panel.
21
22
 * It is the central widget of the main window and is size-controlled by it.
 * All main content goes here.
23
 * 2019-10
24
25
26
27
28
 */

#ifndef MAINPANEL_H
#define MAINPANEL_H

29
#include "SectionTab.h"
30
#include "src/gui_elements/gui_elements.h"
31
#include "src/gui/WorkflowPanel.h"
32

33
#include <QList>
34
#include <QStackedWidget>
35
#include <QSplitter>
36
#include <QString>
37
#include <QStringList>
38
#include <QTabWidget>
39
#include <QWidget>
40
#include <QtXml>
41

42
43
44
45
46
class MainPanel : public QWidget {
	Q_OBJECT

	public:
		explicit MainPanel(QWidget *parent = nullptr);
47
		WorkflowPanel * getWorkflowPanel() const { return workflow_panel_; }
48
		QStackedWidget * getWorkflowStack() const { return workflow_stack_; }
49
		QString setIniValuesFromGui(INIParser *ini);
50
		void displayInfo();
51
		QList<int> getSplitterSizes() const;
52
		void setSplitterSizes(QList<int> sizes = QList<int>(), bool enforce_visible = false);
53
		void clearGuiElements();
54
		void clearGui(const bool &set_default = true);
55
		SectionTab * getSectionTab() const noexcept { return section_tab_; }
56
		template <class T> void clearDynamicPanels();
57

58
	private:
59
60
		WorkflowPanel *workflow_panel_ = nullptr;
		QStackedWidget *workflow_stack_ = nullptr;
61
		SectionTab *section_tab_ = nullptr;
62
		QSplitter *splitter_ = nullptr;
63
64
};

65
#endif //MAINPANEL_H