1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge remote-tracking branch 'origin/next' into Brian-PipXtreme-V2

This commit is contained in:
Brian Webb 2012-05-31 06:45:10 -07:00
commit 8afc223855
4 changed files with 20 additions and 8 deletions

View File

@ -124,6 +124,17 @@ void ModeManager::activateMode(const QString &id)
m_modeStack->setCurrentIndex(index); m_modeStack->setCurrentIndex(index);
} }
void ModeManager::activateModeByWorkspaceName(const QString &id)
{
for (int i = 0; i < m_modes.count(); ++i) {
if (m_modes.at(i)->name() == id)
{
m_modeStack->setCurrentIndex(i);
return;
}
}
}
void ModeManager::objectAdded(QObject *obj) void ModeManager::objectAdded(QObject *obj)
{ {
IMode *mode = Aggregation::query<IMode>(obj); IMode *mode = Aggregation::query<IMode>(obj);

View File

@ -80,6 +80,7 @@ signals:
public slots: public slots:
void activateMode(const QString &id); void activateMode(const QString &id);
void activateModeByWorkspaceName(const QString &id);
void setFocusToCurrentMode(); void setFocusToCurrentMode();
private slots: private slots:

View File

@ -51,37 +51,37 @@ Rectangle {
WelcomePageButton { WelcomePageButton {
baseIconName: "flightdata" baseIconName: "flightdata"
label: "Flight Data" label: "Flight Data"
onClicked: welcomePlugin.openPage("Mode1") onClicked: welcomePlugin.openPage("Flight data")
} }
WelcomePageButton { WelcomePageButton {
baseIconName: "config" baseIconName: "config"
label: "Configuration" label: "Configuration"
onClicked: welcomePlugin.openPage("Mode2") onClicked: welcomePlugin.openPage("Configuration")
} }
WelcomePageButton { WelcomePageButton {
baseIconName: "planner" baseIconName: "planner"
label: "Flight Planner" label: "Flight Planner"
onClicked: welcomePlugin.openPage("Mode3") onClicked: welcomePlugin.openPage("Flight Planner")
} }
WelcomePageButton { WelcomePageButton {
baseIconName: "scopes" baseIconName: "scopes"
label: "Scopes" label: "Scopes"
onClicked: welcomePlugin.openPage("Mode4") onClicked: welcomePlugin.openPage("Scopes")
} }
WelcomePageButton { WelcomePageButton {
baseIconName: "hitl" baseIconName: "hitl"
label: "HIL" label: "HITL"
onClicked: welcomePlugin.openPage("Mode5") onClicked: welcomePlugin.openPage("HITL")
} }
WelcomePageButton { WelcomePageButton {
baseIconName: "firmware" baseIconName: "firmware"
label: "Firmware" label: "Firmware"
onClicked: welcomePlugin.openPage("Mode6") onClicked: welcomePlugin.openPage("Firmware")
} }
} //icons grid } //icons grid
} // images row } // images row

View File

@ -124,7 +124,7 @@ void WelcomeMode::openUrl(const QString &url)
void WelcomeMode::openPage(const QString &page) void WelcomeMode::openPage(const QString &page)
{ {
Core::ModeManager::instance()->activateMode(page); Core::ModeManager::instance()->activateModeByWorkspaceName(page);
} }
} // namespace Welcome } // namespace Welcome