10-06-2012 10:04 PM
Hi,
I am able to get a settings screen from calling SettingsActionItem. The problem is that it can be called multiple times. How would you prevent this?
Here is my code:
NavigationPane {
id: navigationPane
Menu.definition: MenuDefinition {
settingsAction: SettingsActionItem {
imageSource: "asset:///icons/setting.png"
onTriggered: {
var page = pageDefinition.createObject();
navigationPane.push(page);
}
attachedObjects: ComponentDefinition {
id: pageDefinition;
source: "Settings.qml";
}
}
}
Solved! Go to Solution.
10-09-2012 11:12 AM
I'm not really sure I understand the problem. Shouldn't the user be able to open the settings screen more than once?
10-09-2012 11:16 AM
I guess I should have been more clear.
The problem is that when you open up the settings screen, you can do a down swipe and open the settings screen from the settings screen, etc until you can be multiple screens deep into the settings screen. I was trying to say that you should only have the settings screen open once.
10-10-2012 09:29 AM
10-10-2012 01:43 PM
@PBernhardt
That is what I thought. I was hoping for a different way. Here is what I did so others can do the same. This is in the main.qml file.
NavigationPane {
id: navigationPane
onPopTransitionEnded: page.destroy()
Menu.definition: MenuDefinition {
settingsAction: SettingsActionItem {
imageSource: "asset:///icons/setting.png"
onTriggered: {
if (_App.m_AppMenuActive == false) {
_App.appMenuActiveSetValue(true);
var page = pageDefinition.createObject();
navigationPane.push(page);
}
}
attachedObjects: ComponentDefinition {
id: pageDefinition;
source: "Settings.qml";
}
}
} This is in the Settings.qml file.
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
title: "Back"
imageSource: "asset:///icons/prev.jpg"
onTriggered: {
_App.appMenuActiveSetValue(false);
navigationPane.pop();
}
}
}
In the .cpp file.
bool App::appMenuActiveValue() {
return m_AppMenuActive;
}
void App::appMenuActiveSetValue(bool i) {
m_AppMenuActive = i;
}In the .hpp file.
Q_PROPERTY(bool m_AppMenuActive READ appMenuActiveValue WRITE appMenuActiveSetValue)
Q_INVOKABLE
void appMenuActiveSetValue(bool i);
bool appMenuActiveValue();
private:
bool m_AppMenuActive;
10-11-2012 11:07 AM
10-14-2012 03:19 AM
I'm using a Sheet for Settings from Application Menu
then - while editing the settings I cannot open them again from swipe-down application menu
from my POV a much easier solution
10-14-2012 09:13 AM
@ekke
A sheet is easier, but does not match the UI guidelines for settings.
http://docs.blackberry.com/en/developers/deliverab
10-14-2012 10:23 AM
you're right
(my settings have to be stored in a cloud service, so I used the sheet there to have explicite save / cancel)
3 weeks ago
Hi,
Quite old thread but anyhow I found this to be the easiest solution
Application.menuEnabled = false;
settingsAction: SettingsActionItem {
onTriggered: {
var settingsPage = goToSettingsPage.createObject()
mainMenuPage.push(settingsPage)
Application.menuEnabled = false;
}
attachedObjects: ComponentDefinition {
id: goToSettingsPage
source: "settings.qml"
}
...
onPopTransitionEnded: {
Application.menuEnabled = true;
page.destroy();
}See you,
Michael