Fix broken enabled/ disabled emulator startbutton state.

Functionality depends entirely on the active start-up project, all other
projects should have the the button disabled if they have no Maemo run
config or the the run config is not the active on.

Reviewed-by: ck
This commit is contained in:
kh1
2010-03-01 16:47:32 +01:00
parent 044ca68e1e
commit adefff60ad
5 changed files with 73 additions and 37 deletions

View File

@@ -144,7 +144,7 @@ MaemoManager::addQemuSimulatorStarter(Project *project)
m_qemuCommand = actionManager->registerAction(action, "MaemoEmulator",
QList<int>() << Core::Constants::C_GLOBAL_ID);
modeManager->addAction(m_qemuCommand, 1);
m_qemuCommand->action()->setEnabled(true);
m_qemuCommand->action()->setEnabled(false);
m_qemuCommand->setAttribute(Core::Command::CA_UpdateText);
m_qemuCommand->setAttribute(Core::Command::CA_UpdateIcon);
@@ -154,9 +154,11 @@ MaemoManager::addQemuSimulatorStarter(Project *project)
void
MaemoManager::removeQemuSimulatorStarter(Project *project)
{
projects.remove(project);
if (projects.isEmpty() && m_qemuCommand)
m_qemuCommand->action()->setVisible(false);
if (projects.contains(project)) {
projects.remove(project);
if (projects.isEmpty() && m_qemuCommand)
m_qemuCommand->action()->setVisible(false);
}
}
void