-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
901 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include "attachpvpopover.h" | ||
#include "ui_attachpvpopover.h" | ||
|
||
#include <DriveObjects/volumegroup.h> | ||
#include <driveobjectmanager.h> | ||
#include <tcontentsizer.h> | ||
#include <terrorflash.h> | ||
#include <volumegroupmodel.h> | ||
|
||
struct AttachPvPopoverPrivate { | ||
DiskObject* disk; | ||
VolumeGroupModel* vgModel; | ||
}; | ||
|
||
AttachPvPopover::AttachPvPopover(DiskObject* disk, QWidget* parent) : | ||
QWidget(parent), | ||
ui(new Ui::AttachPvPopover) { | ||
ui->setupUi(this); | ||
d = new AttachPvPopoverPrivate(); | ||
d->disk = disk; | ||
|
||
new tContentSizer(ui->optionsWidget); | ||
new tContentSizer(ui->newVgOptionsWidget); | ||
ui->stackedWidget->setCurrentAnimation(tStackedWidget::SlideHorizontal); | ||
|
||
d->vgModel = new VolumeGroupModel(this); | ||
d->vgModel->setShowAddButton(true); | ||
ui->vgList->setModel(d->vgModel); | ||
} | ||
|
||
AttachPvPopover::~AttachPvPopover() { | ||
delete d; | ||
delete ui; | ||
} | ||
|
||
void AttachPvPopover::on_titleLabel_backButtonClicked() { | ||
emit done(); | ||
} | ||
|
||
void AttachPvPopover::on_vgList_activated(const QModelIndex& index) { | ||
auto vg = index.data(VolumeGroupModel::VolumeGroupRole).value<VolumeGroup*>(); | ||
if (!vg) { | ||
ui->stackedWidget->setCurrentWidget(ui->addVgPage); | ||
} | ||
} | ||
|
||
void AttachPvPopover::on_titleLabel_2_backButtonClicked() { | ||
ui->stackedWidget->setCurrentWidget(ui->selectVgPage); | ||
} | ||
|
||
void AttachPvPopover::on_attachToNewVgButton_clicked() { | ||
auto vgName = ui->newVgName->text(); | ||
if (vgName.isEmpty()) { | ||
tErrorFlash::flashError(ui->newVgName); | ||
return; | ||
} | ||
|
||
DriveObjectManager::volumeGroupCreate(ui->newVgName->text(), {d->disk}, {}); | ||
emit done(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef ATTACHPVPOPOVER_H | ||
#define ATTACHPVPOPOVER_H | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui { | ||
class AttachPvPopover; | ||
} | ||
|
||
class DiskObject; | ||
struct AttachPvPopoverPrivate; | ||
class AttachPvPopover : public QWidget { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit AttachPvPopover(DiskObject* disk, QWidget* parent = nullptr); | ||
~AttachPvPopover(); | ||
|
||
signals: | ||
void done(); | ||
|
||
private slots: | ||
void on_titleLabel_backButtonClicked(); | ||
|
||
void on_vgList_activated(const QModelIndex& index); | ||
|
||
void on_titleLabel_2_backButtonClicked(); | ||
|
||
void on_attachToNewVgButton_clicked(); | ||
|
||
private: | ||
Ui::AttachPvPopover* ui; | ||
AttachPvPopoverPrivate* d; | ||
}; | ||
|
||
#endif // ATTACHPVPOPOVER_H |
Oops, something went wrong.