WSL/SLF GitLab Repository

MainPanel.h 2.21 KB
Newer Older
Mathias Bavay's avatar
Mathias Bavay committed
1
//SPDX-License-Identifier: GPL-3.0-or-later
2
3
4
5
6
/*****************************************************************************/
/*  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
7
   it under the terms of the GNU General Public License as published by
8
9
10
11
12
13
   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
14
   GNU General Public License for more details.
15

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

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

#ifndef MAINPANEL_H
#define MAINPANEL_H

30
31
32
#include <src/gui/SectionTab.h>
#include <src/gui/WorkflowPanel.h>
#include <src/panels/panels.h>
33

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

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

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