Commit 24b8ef31 authored by Tobias Hunger's avatar Tobias Hunger

Disable publishing action if we can not publish the project

Make sure the publishing action is disabled when we can not publish
a project. Currently the action is enabled and gets the user to a
selection dialog with misleading "I'm afraid I can not do that"
information.

Change-Id: Id3d749e4ada466a2af505586a7d248f2cdc814fe
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent cdfa382e
......@@ -1929,7 +1929,18 @@ void ProjectExplorerPlugin::updateActions()
d->m_cancelBuildAction->setEnabled(d->m_buildManager->isBuilding());
d->m_publishAction->setEnabled(!d->m_session->projects().isEmpty());
bool canPublish = false;
if (project) {
const QList<IPublishingWizardFactory *> &factories
= ExtensionSystem::PluginManager::getObjects<IPublishingWizardFactory>();
foreach (const IPublishingWizardFactory *const factory, factories) {
if (factory->canCreateWizard(project)) {
canPublish = true;
break;
}
}
}
d->m_publishAction->setEnabled(canPublish);
d->m_projectSelectorAction->setEnabled(!session()->projects().isEmpty());
d->m_projectSelectorActionMenu->setEnabled(!session()->projects().isEmpty());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment