source: calamares/trunk/fuentes/src/modules/partition/gui/PartitionDialogHelpers.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.4 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Aurélien Gâteau <agateau@kde.org>
4 *   Copyright 2016, Teo Mrnjavac <teo@kde.org>
5 *   Copyright 2018, Adriaan de Groot <groot@kde.org>
6 *
7 *   Calamares is free software: you can redistribute it and/or modify
8 *   it under the terms of the GNU General Public License as published by
9 *   the Free Software Foundation, either version 3 of the License, or
10 *   (at your option) any later version.
11 *
12 *   Calamares is distributed in the hope that it will be useful,
13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 *   GNU General Public License for more details.
16 *
17 *   You should have received a copy of the GNU General Public License
18 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef PARTITION_GUI_PARTITIONDIALOGHELPERS
22#define PARTITION_GUI_PARTITIONDIALOGHELPERS
23
24#include <kpmcore/core/partitiontable.h>
25
26#include <QStringList>
27
28class QComboBox;
29class QListWidget;
30
31/**
32 * Returns a list of standard mount points (e.g. /, /usr, ...).
33 * This also includes the EFI mount point if that is necessary
34 * on the target system.
35 */
36QStringList standardMountPoints();
37
38/**
39 * Clears the combobox and fills it with "(no mount point)"
40 * and the elements of standardMountPoints(), above.
41 */
42void standardMountPoints( QComboBox& );
43
44/**
45 * As above, but also sets the displayed mount point to @p selected,
46 * unless it is empty, in which case "(no mount point)" is chosen.
47 */
48void standardMountPoints( QComboBox&, const QString& selected );
49
50/**
51 * Get the mount point selected in the combo box (which should
52 * have been set up with standardMountPoints(), above); this
53 * will map the topmost item (i.e. "(no mount point)") back
54 * to blank, to allow easy detection of no-mount-selected.
55 */
56QString selectedMountPoint( QComboBox& combo );
57static inline QString selectedMountPoint(QComboBox* combo) { return selectedMountPoint(*combo); }
58
59void setSelectedMountPoint( QComboBox& combo, const QString& selected );
60static inline void setSelectedMountPoint(QComboBox* combo, const QString& selected) { setSelectedMountPoint( *combo, selected); }
61
62/**
63 * Get the flags that have been checked in the list widget.
64 */
65PartitionTable::Flags flagsFromList( const QListWidget& list );
66void setFlagList( QListWidget& list, PartitionTable::Flags available, PartitionTable::Flags checked );
67
68#endif
Note: See TracBrowser for help on using the repository browser.