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,13 +102,11 @@ void MainWindowsNoGUI::ToolLayoutSettings(bool checked)
default:
break;
}
tButton->setChecked(false);
}
else
{
if (QToolButton *tButton = qobject_cast< QToolButton * >(this->sender()))
{
tButton->setChecked(true);
}
tButton->setChecked(true);
}
}