mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
GCS - Make the welcome plugin use the workspace names instead
of the mode names.
This commit is contained in:
parent
b93674cf64
commit
ab78e1aca3
@ -124,6 +124,17 @@ void ModeManager::activateMode(const QString &id)
|
||||
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)
|
||||
{
|
||||
IMode *mode = Aggregation::query<IMode>(obj);
|
||||
|
@ -80,6 +80,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void activateMode(const QString &id);
|
||||
void activateModeByWorkspaceName(const QString &id);
|
||||
void setFocusToCurrentMode();
|
||||
|
||||
private slots:
|
||||
|
@ -51,37 +51,37 @@ Rectangle {
|
||||
WelcomePageButton {
|
||||
baseIconName: "flightdata"
|
||||
label: "Flight Data"
|
||||
onClicked: welcomePlugin.openPage("Mode1")
|
||||
onClicked: welcomePlugin.openPage("Flight data")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "config"
|
||||
label: "Configuration"
|
||||
onClicked: welcomePlugin.openPage("Mode2")
|
||||
onClicked: welcomePlugin.openPage("Configuration")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "planner"
|
||||
label: "Flight Planner"
|
||||
onClicked: welcomePlugin.openPage("Mode3")
|
||||
onClicked: welcomePlugin.openPage("Flight Planner")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "scopes"
|
||||
label: "Scopes"
|
||||
onClicked: welcomePlugin.openPage("Mode4")
|
||||
onClicked: welcomePlugin.openPage("Scopes")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "hitl"
|
||||
label: "HIL"
|
||||
onClicked: welcomePlugin.openPage("Mode5")
|
||||
label: "HITL"
|
||||
onClicked: welcomePlugin.openPage("HITL")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "firmware"
|
||||
label: "Firmware"
|
||||
onClicked: welcomePlugin.openPage("Mode6")
|
||||
onClicked: welcomePlugin.openPage("Firmware")
|
||||
}
|
||||
} //icons grid
|
||||
} // images row
|
||||
|
@ -124,7 +124,7 @@ void WelcomeMode::openUrl(const QString &url)
|
||||
|
||||
void WelcomeMode::openPage(const QString &page)
|
||||
{
|
||||
Core::ModeManager::instance()->activateMode(page);
|
||||
Core::ModeManager::instance()->activateModeByWorkspaceName(page);
|
||||
}
|
||||
|
||||
} // namespace Welcome
|
||||
|
Loading…
Reference in New Issue
Block a user