2020-09-16 00:35:12 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2017 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2018 Abhijeet Sharma <sharma.abhijeet2096@gmail.com>
|
|
|
|
SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#if !defined(PARTPROPSWIDGET_H)
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#define PARTPROPSWIDGET_H
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
#include "ui_partpropswidgetbase.h"
|
|
|
|
|
2015-07-17 12:37:30 +01:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "util/guihelpers.h"
|
|
|
|
|
2010-05-18 23:27:30 +01:00
|
|
|
/** Central widget in the PartPropsDialog.
|
2015-07-13 15:17:41 +01:00
|
|
|
@author Volker Lanz <vl@fidra.de>
|
2008-09-24 20:32:01 +01:00
|
|
|
*/
|
|
|
|
class PartPropsWidget : public QWidget, public Ui::PartPropsWidgetBase
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
public:
|
2019-12-09 16:33:04 +00:00
|
|
|
explicit PartPropsWidget(QWidget* parent) : QWidget(parent) {
|
2015-07-13 15:17:41 +01:00
|
|
|
setupUi(this);
|
2015-07-17 12:37:30 +01:00
|
|
|
|
|
|
|
m_PartWidget->setFileSystemColorCode(GuiHelpers::fileSystemColorCodesFromSettings());
|
|
|
|
MainWindow* mw = nullptr;
|
2016-09-01 00:44:33 +01:00
|
|
|
const auto widgets = qApp->topLevelWidgets();
|
|
|
|
for (auto &widget : widgets)
|
2015-07-17 12:37:30 +01:00
|
|
|
{
|
|
|
|
mw = qobject_cast< MainWindow* >( widget );
|
|
|
|
if ( mw )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( mw )
|
|
|
|
{
|
|
|
|
connect( mw, &MainWindow::settingsChanged,
|
|
|
|
this, [this]
|
|
|
|
{
|
|
|
|
m_PartWidget->setFileSystemColorCode(GuiHelpers::fileSystemColorCodesFromSettings());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
PartWidget& partWidget() {
|
|
|
|
Q_ASSERT(m_PartWidget);
|
|
|
|
return *m_PartWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& mountPoint() {
|
|
|
|
Q_ASSERT(m_LabelMountPoint);
|
|
|
|
return *m_LabelMountPoint;
|
|
|
|
}
|
|
|
|
QLabel& role() {
|
|
|
|
Q_ASSERT(m_LabelRole);
|
|
|
|
return *m_LabelRole;
|
|
|
|
}
|
|
|
|
QLabel& capacity() {
|
|
|
|
Q_ASSERT(m_LabelCapacity);
|
|
|
|
return *m_LabelCapacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textAvailable() {
|
|
|
|
Q_ASSERT(m_LabelTextAvailable);
|
|
|
|
return *m_LabelTextAvailable;
|
|
|
|
}
|
|
|
|
QLabel& available() {
|
|
|
|
Q_ASSERT(m_LabelAvailable);
|
|
|
|
return *m_LabelAvailable;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textUsed() {
|
|
|
|
Q_ASSERT(m_LabelTextUsed);
|
|
|
|
return *m_LabelTextUsed;
|
|
|
|
}
|
|
|
|
QLabel& used() {
|
|
|
|
Q_ASSERT(m_LabelUsed);
|
|
|
|
return *m_LabelUsed;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textFileSystem() {
|
|
|
|
Q_ASSERT(m_LabelFileSystem);
|
|
|
|
return *m_LabelFileSystem;
|
|
|
|
}
|
|
|
|
QComboBox& fileSystem() {
|
|
|
|
Q_ASSERT(m_ComboFileSystem);
|
|
|
|
return *m_ComboFileSystem;
|
|
|
|
}
|
|
|
|
const QComboBox& fileSystem() const {
|
|
|
|
Q_ASSERT(m_ComboFileSystem);
|
|
|
|
return *m_ComboFileSystem;
|
|
|
|
}
|
|
|
|
|
|
|
|
QCheckBox& checkRecreate() {
|
|
|
|
Q_ASSERT(m_CheckRecreate);
|
|
|
|
return *m_CheckRecreate;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& firstSector() {
|
|
|
|
Q_ASSERT(m_LabelFirstSector);
|
|
|
|
return *m_LabelFirstSector;
|
|
|
|
}
|
|
|
|
QLabel& lastSector() {
|
|
|
|
Q_ASSERT(m_LabelLastSector);
|
|
|
|
return *m_LabelLastSector;
|
|
|
|
}
|
|
|
|
QLabel& numSectors() {
|
|
|
|
Q_ASSERT(m_LabelNumSectors);
|
|
|
|
return *m_LabelNumSectors;
|
|
|
|
}
|
|
|
|
QLabel& status() {
|
|
|
|
Q_ASSERT(m_LabelStatus);
|
|
|
|
return *m_LabelStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textUuid() {
|
|
|
|
Q_ASSERT(m_LabelTextUuid);
|
|
|
|
return *m_LabelTextUuid;
|
|
|
|
}
|
|
|
|
QLabel& uuid() {
|
|
|
|
Q_ASSERT(m_LabelUuid);
|
|
|
|
return *m_LabelUuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textLabel() {
|
|
|
|
Q_ASSERT(m_LabelTextLabel);
|
|
|
|
return *m_LabelTextLabel;
|
|
|
|
}
|
|
|
|
QLineEdit& label() {
|
|
|
|
Q_ASSERT(m_EditLabel);
|
|
|
|
return *m_EditLabel;
|
|
|
|
}
|
2018-02-13 21:22:51 +00:00
|
|
|
|
|
|
|
QLabel& partitionTextUuid() {
|
|
|
|
Q_ASSERT(m_LabelTextPartitionUuid);
|
|
|
|
return *m_LabelTextPartitionUuid;
|
|
|
|
}
|
|
|
|
QLabel& partitionUuid() {
|
|
|
|
Q_ASSERT(m_LabelPartitionUuid);
|
|
|
|
return *m_LabelPartitionUuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& partitionTextLabel() {
|
|
|
|
Q_ASSERT(m_LabelTextPartitionLabel);
|
|
|
|
return *m_LabelTextPartitionLabel;
|
|
|
|
}
|
|
|
|
QLabel& partitionLabel() {
|
|
|
|
Q_ASSERT(m_LabelPartitionLabel);
|
|
|
|
return *m_LabelPartitionLabel;
|
|
|
|
}
|
2015-07-13 15:17:41 +01:00
|
|
|
const QLineEdit& label() const {
|
|
|
|
Q_ASSERT(m_EditLabel);
|
|
|
|
return *m_EditLabel;
|
|
|
|
}
|
|
|
|
QLabel& noSetLabel() {
|
|
|
|
Q_ASSERT(m_LabelTextNoSetLabel);
|
|
|
|
return *m_LabelTextNoSetLabel;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLabel& textFlags() {
|
|
|
|
Q_ASSERT(m_LabelTextFlags);
|
|
|
|
return *m_LabelTextFlags;
|
|
|
|
}
|
|
|
|
QListWidget& listFlags() {
|
|
|
|
Q_ASSERT(m_ListFlags);
|
|
|
|
return *m_ListFlags;
|
|
|
|
}
|
|
|
|
const QListWidget& listFlags() const {
|
|
|
|
Q_ASSERT(m_ListFlags);
|
|
|
|
return *m_ListFlags;
|
|
|
|
}
|
|
|
|
QFrame& lineFlags() {
|
|
|
|
Q_ASSERT(m_LineListFlags);
|
|
|
|
return *m_LineListFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
void showAvailable(bool b) {
|
|
|
|
available().setVisible(b);
|
|
|
|
textAvailable().setVisible(b);
|
|
|
|
}
|
|
|
|
void showUsed(bool b) {
|
|
|
|
used().setVisible(b);
|
|
|
|
textUsed().setVisible(b);
|
|
|
|
}
|
|
|
|
void showFileSystem(bool b) {
|
|
|
|
fileSystem().setVisible(b);
|
|
|
|
textFileSystem().setVisible(b);
|
|
|
|
}
|
|
|
|
void showCheckRecreate(bool b) {
|
|
|
|
checkRecreate().setVisible(b);
|
|
|
|
}
|
|
|
|
void showListFlags(bool b) {
|
|
|
|
listFlags().setVisible(b);
|
|
|
|
textFlags().setVisible(b);
|
|
|
|
lineFlags().setVisible(b);
|
|
|
|
}
|
|
|
|
void showLabel(bool b) {
|
|
|
|
textLabel().setVisible(b);
|
|
|
|
label().setVisible(b);
|
|
|
|
}
|
|
|
|
void showUuid(bool b) {
|
|
|
|
textUuid().setVisible(b);
|
|
|
|
uuid().setVisible(b);
|
|
|
|
}
|
2008-09-24 20:32:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|