You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
#include "exportsetupdialog_p.h"
|
|
#include "ui_exportsetupdialog.h"
|
|
#include <QtMvvmCore/Binding>
|
|
using namespace QtMvvm;
|
|
|
|
ExportSetupDialog::ExportSetupDialog(ViewModel *viewModel, QWidget *parent) :
|
|
QDialog(parent),
|
|
_viewModel(static_cast<ExportSetupViewModel*>(viewModel)),
|
|
ui(new Ui::ExportSetupDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
if(parentWidget()) {
|
|
setWindowModality(Qt::WindowModal);
|
|
setWindowFlags(Qt::Sheet | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
|
|
} else {
|
|
setWindowModality(Qt::ApplicationModal);
|
|
setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
|
|
}
|
|
|
|
bind(_viewModel, "label",
|
|
ui->titleLabel, "text",
|
|
Binding::OneWayToView);
|
|
bind(_viewModel, "trusted",
|
|
ui->trustedCheckBox, "checked");
|
|
bind(_viewModel, "includeServer",
|
|
ui->includeServerCheckBox, "checked");
|
|
bind(_viewModel, "password",
|
|
ui->passwordLineEdit, "text",
|
|
Binding::OneWayToViewModel);
|
|
bind(_viewModel, "valid",
|
|
ui->buttonBox->button(QDialogButtonBox::Ok), "enabled",
|
|
Binding::OneWayToView);
|
|
}
|
|
|
|
ExportSetupDialog::~ExportSetupDialog() {}
|
|
|
|
void ExportSetupDialog::accept()
|
|
{
|
|
if(_viewModel->completeSetup())
|
|
QDialog::accept();
|
|
}
|
|
|