Set enabled for tool button in different mode.

--HG--
branch : feature
This commit is contained in:
dismine 2014-01-12 22:04:15 +02:00
parent 502b66df29
commit bc97dc7855

View File

@ -701,6 +701,7 @@ void MainWindow::ToolBarDraws()
ui->toolBarDraws->addAction(ui->actionLayout); ui->toolBarDraws->addAction(ui->actionLayout);
connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout); connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout);
ui->actionLayout->setEnabled(false);
} }
void MainWindow::currentDrawChanged( int index ) void MainWindow::currentDrawChanged( int index )
@ -928,6 +929,11 @@ void MainWindow::ActionDraw(bool checked)
SetEnableTool(true); SetEnableTool(true);
doc->setCurrentData(); doc->setCurrentData();
ui->toolBox->setCurrentIndex(currentToolBoxIndex); ui->toolBox->setCurrentIndex(currentToolBoxIndex);
ui->actionHistory->setEnabled(true);
ui->actionLayout->setEnabled(false);
ui->actionOptionDraw->setEnabled(true);
ui->actionNewDraw->setEnabled(true);
} }
else else
{ {
@ -956,6 +962,11 @@ void MainWindow::ActionDetails(bool checked)
SetEnableTool(true); SetEnableTool(true);
currentToolBoxIndex = ui->toolBox->currentIndex(); currentToolBoxIndex = ui->toolBox->currentIndex();
ui->toolBox->setCurrentIndex(4); ui->toolBox->setCurrentIndex(4);
ui->actionHistory->setEnabled(false);
ui->actionLayout->setEnabled(true);
ui->actionOptionDraw->setEnabled(false);
ui->actionNewDraw->setEnabled(false);
} }
else else
{ {