Show layout settings dialog if a layout was not created.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-05-12 20:59:36 +03:00
parent 46948a9fc4
commit 80d7c39a92
2 changed files with 11 additions and 4 deletions

View File

@ -1340,6 +1340,11 @@ void MainWindow::ActionLayout(bool checked)
ui->dockWidgetToolOptions->setVisible(false);
ShowPaper(ui->listWidget->currentRow());
if (scenes.isEmpty())
{
ui->toolButtonLayoutSettings->click();
}
}
else
{

View File

@ -57,6 +57,9 @@ MainWindowsNoGUI::~MainWindowsNoGUI()
//---------------------------------------------------------------------------------------------------------------------
void MainWindowsNoGUI::ToolLayoutSettings(bool checked)
{
QToolButton *tButton = qobject_cast< QToolButton * >(this->sender());
SCASSERT(tButton != nullptr)
if (checked)
{
VLayoutGenerator lGenerator(this);
@ -65,6 +68,7 @@ void MainWindowsNoGUI::ToolLayoutSettings(bool checked)
DialogLayoutSettings layout(&lGenerator, this);
if (layout.exec() == QDialog::Rejected)
{
tButton->setChecked(false);
return;
}
@ -98,15 +102,13 @@ void MainWindowsNoGUI::ToolLayoutSettings(bool checked)
default:
break;
}
tButton->setChecked(false);
}
else
{
if (QToolButton *tButton = qobject_cast< QToolButton * >(this->sender()))
{
tButton->setChecked(true);
}
}
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VDetail> *details)