mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Dispatch files in core/ gui/ and jobs/ dirs
This commit is contained in:
parent
8e2b4050e7
commit
693e9229c8
53 changed files with 127 additions and 120 deletions
61
src/modules/partition/gui/PartitionSizeController.h
Normal file
61
src/modules/partition/gui/PartitionSizeController.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares 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
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PARTITIONSIZECONTROLLER_H
|
||||
#define PARTITIONSIZECONTROLLER_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
class QSpinBox;
|
||||
|
||||
class Device;
|
||||
class Partition;
|
||||
class PartResizerWidget;
|
||||
|
||||
/**
|
||||
* Synchronizes a PartResizerWidget and a QSpinBox, making sure any change made
|
||||
* to one is reflected in the other.
|
||||
*/
|
||||
class PartitionSizeController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PartitionSizeController( QObject* parent = nullptr );
|
||||
void setPartResizerWidget( PartResizerWidget* widget );
|
||||
void setSpinBox( QSpinBox* spinBox );
|
||||
void init( Device* device, Partition* partition, const QColor& color );
|
||||
|
||||
private:
|
||||
QPointer< PartResizerWidget > m_partResizerWidget;
|
||||
QPointer< QSpinBox > m_spinBox;
|
||||
Device* m_device = nullptr;
|
||||
Partition* m_partition = nullptr;
|
||||
QColor m_partitionColor;
|
||||
bool m_updating = false;
|
||||
|
||||
void updateConnections();
|
||||
void doUpdateSpinBox();
|
||||
|
||||
private Q_SLOTS:
|
||||
void updatePartResizerWidget();
|
||||
void updateSpinBox();
|
||||
};
|
||||
|
||||
#endif /* PARTITIONSIZECONTROLLER_H */
|
Loading…
Add table
Add a link
Reference in a new issue