Remove Progress UI from OptionsDialog

This commit is contained in:
Florian Märkl 2018-05-27 22:06:57 +02:00
parent 39eee858e6
commit 7777707062
3 changed files with 1 additions and 114 deletions

View File

@ -18,9 +18,6 @@ OptionsDialog::OptionsDialog(MainWindow *main):
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
ui->progressBar->setVisible(0);
ui->statusLabel->setVisible(0);
ui->elapsedLabel->setVisible(0);
ui->logoSvgWidget->load(Config()->getLogoFile()); ui->logoSvgWidget->load(Config()->getLogoFile());
ui->analSlider->setValue(defaultAnalLevel); ui->analSlider->setValue(defaultAnalLevel);
@ -58,10 +55,6 @@ OptionsDialog::OptionsDialog(MainWindow *main):
connect(ui->scriptCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateScriptLayout())); connect(ui->scriptCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateScriptLayout()));
// Add this so the dialog resizes when widgets are shown/hidden
//this->layout()->setSizeConstraint(QLayout::SetFixedSize);
//connect(&analTask, SIGNAL(finished()), this, SLOT(analysisFinished()));
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
ui->programLineEdit->setText(main->getFilename()); ui->programLineEdit->setText(main->getFilename());
@ -86,13 +79,6 @@ void OptionsDialog::updateCPUComboBox()
ui->cpuComboBox->lineEdit()->setText(currentText); ui->cpuComboBox->lineEdit()->setText(currentText);
} }
void OptionsDialog::setInteractionEnabled(bool enabled)
{
ui->optionsWidget->setEnabled(enabled);
ui->okButton->setEnabled(enabled);
ui->cancelButton->setEnabled(enabled);
}
QString OptionsDialog::getSelectedArch() QString OptionsDialog::getSelectedArch()
{ {
QVariant archValue = ui->archComboBox->currentData(); QVariant archValue = ui->archComboBox->currentData();
@ -196,15 +182,6 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList<QString> advanced)
{ {
ui->analSlider->setValue(level); ui->analSlider->setValue(level);
setInteractionEnabled(false);
// Show Progress Bar
ui->progressBar->setVisible(true);
ui->statusLabel->setVisible(true);
ui->elapsedLabel->setVisible(true);
ui->statusLabel->setText(tr("Starting analysis"));
main->initUI(); main->initUI();
InitialOptions options; InitialOptions options;
@ -269,37 +246,13 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList<QString> advanced)
done(0); done(0);
} }
void OptionsDialog::updateProgress(const QString &status)
{
ui->statusLabel->setText(status);
}
void OptionsDialog::on_okButton_clicked() void OptionsDialog::on_okButton_clicked()
{ {
setupAndStartAnalysis(ui->analSlider->value(), getSelectedAdvancedAnalCmds()); setupAndStartAnalysis(ui->analSlider->value(), getSelectedAdvancedAnalCmds());
} }
void OptionsDialog::analysisFinished()
{
//if (analTask.isInterrupted()) {
// updateProgress(tr("Analysis aborted."));
// done(1);
// return;
//}
updateProgress(tr("Loading interface..."));
main->addOutput(tr(" > Analysis finished"));
main->finalizeOpen();
done(0);
}
void OptionsDialog::closeEvent(QCloseEvent *event) void OptionsDialog::closeEvent(QCloseEvent *event)
{ {
//if (analTask.isRunning()) {
// analTask.interruptAndWait();
//}
event->accept(); event->accept();
} }

View File

@ -24,9 +24,6 @@ public:
void setupAndStartAnalysis(int level, QList<QString> advanced); void setupAndStartAnalysis(int level, QList<QString> advanced);
public slots:
void updateProgress(const QString &str);
private slots: private slots:
void on_okButton_clicked(); void on_okButton_clicked();
void on_analSlider_valueChanged(int value); void on_analSlider_valueChanged(int value);
@ -39,8 +36,6 @@ private slots:
void updatePDBLayout(); void updatePDBLayout();
void updateScriptLayout(); void updateScriptLayout();
void analysisFinished();
protected: protected:
void closeEvent(QCloseEvent *event) override; void closeEvent(QCloseEvent *event) override;
@ -53,8 +48,6 @@ private:
void updateCPUComboBox(); void updateCPUComboBox();
void setInteractionEnabled(bool enabled);
public: public:
std::unique_ptr<Ui::OptionsDialog> ui; std::unique_ptr<Ui::OptionsDialog> ui;

View File

@ -220,7 +220,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-672</y> <y>0</y>
<width>564</width> <width>564</width>
<height>867</height> <height>867</height>
</rect> </rect>
@ -993,70 +993,11 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="statusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select analysis options</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QLabel" name="elapsedLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Timer label</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">