Skip to content

Commit

Permalink
Try to fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Feb 7, 2017
1 parent 18e2244 commit 1c266e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
14 changes: 8 additions & 6 deletions tomviz/SaveWebReaction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include <cassert>

#include <QDialog>
#include <QDebug>
#include <QDialog>
#include <QMessageBox>
#include <QRegularExpression>

Expand All @@ -57,13 +57,15 @@ void SaveWebReaction::updateEnableState()

void SaveWebReaction::onTriggered()
{
WebExportWidget dialog;
if (dialog.exec() == QDialog::Accepted) {
this->saveWeb(dialog.getOutputPath(), dialog.getExportType(), dialog.getDeltaPhi(), dialog.getDeltaTheta());
}
WebExportWidget dialog;
if (dialog.exec() == QDialog::Accepted) {
this->saveWeb(dialog.getOutputPath(), dialog.getExportType(),
dialog.getDeltaPhi(), dialog.getDeltaTheta());
}
}

bool SaveWebReaction::saveWeb(const QString& filename, int type, int deltaPhi, int deltaTheta)
bool SaveWebReaction::saveWeb(const QString& filename, int type, int deltaPhi,
int deltaTheta)
{
cout << "Generate" << filename.toLatin1().data() << endl;
Python::initialize();
Expand Down
36 changes: 18 additions & 18 deletions tomviz/WebExportWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@

namespace tomviz {

WebExportWidget::WebExportWidget(QWidget* p)
: QDialog(p)
WebExportWidget::WebExportWidget(QWidget* p) : QDialog(p)
{
QVBoxLayout* v = new QVBoxLayout(this);
this->setMinimumWidth(500);
Expand Down Expand Up @@ -106,7 +105,8 @@ WebExportWidget::WebExportWidget(QWidget* p)
v->addLayout(actionGroup);

// UI binding
this->connect(this->outputPath, SIGNAL(textChanged(const QString &)), this, SLOT(onPathChange()));
this->connect(this->outputPath, SIGNAL(textChanged(const QString&)), this,
SLOT(onPathChange()));
this->connect(this->browseButton, SIGNAL(pressed()), this, SLOT(onBrowse()));
this->connect(this->exportButton, SIGNAL(pressed()), this, SLOT(onExport()));
this->connect(this->cancelButton, SIGNAL(pressed()), this, SLOT(onCancel()));
Expand All @@ -118,25 +118,25 @@ WebExportWidget::~WebExportWidget()

void WebExportWidget::onBrowse()
{
pqServer* server = pqActiveObjects::instance().activeServer();
pqFileDialog fileDialog(server, pqCoreUtilities::mainWidget(),
tr("Save Scene for Web:"), QString(), "");
fileDialog.setObjectName("DirectorySaveDialog");
fileDialog.setFileMode(pqFileDialog::Directory);
if (fileDialog.exec() == QDialog::Accepted) {
this->outputPath->setText(fileDialog.getSelectedFiles()[0]);
this->exportButton->setDisabled(false);
}
pqServer* server = pqActiveObjects::instance().activeServer();
pqFileDialog fileDialog(server, pqCoreUtilities::mainWidget(),
tr("Save Scene for Web:"), QString(), "");
fileDialog.setObjectName("DirectorySaveDialog");
fileDialog.setFileMode(pqFileDialog::Directory);
if (fileDialog.exec() == QDialog::Accepted) {
this->outputPath->setText(fileDialog.getSelectedFiles()[0]);
this->exportButton->setDisabled(false);
}
}

void WebExportWidget::onPathChange()
{
this->exportButton->setDisabled(!(this->outputPath->text().length() > 3));
this->exportButton->setDisabled(!(this->outputPath->text().length() > 3));
}

void WebExportWidget::onExport()
{
this->accept();
this->accept();
}

void WebExportWidget::onCancel()
Expand All @@ -146,21 +146,21 @@ void WebExportWidget::onCancel()

QString WebExportWidget::getOutputPath()
{
return this->outputPath->text();
return this->outputPath->text();
}

int WebExportWidget::getExportType()
{
return this->exportType->currentIndex();
return this->exportType->currentIndex();
}

int WebExportWidget::getDeltaPhi()
{
return this->deltaPhi->value();
return this->deltaPhi->value();
}

int WebExportWidget::getDeltaTheta()
{
return this->deltaTheta->value();
return this->deltaTheta->value();
}
}

0 comments on commit 1c266e5

Please sign in to comment.