forked from SiriusDely/Cascades-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
416 changed files
with
10,430 additions
and
8,575 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,8 @@ | ||
TEMPLATE = app | ||
TARGET = BucketList | ||
APP_NAME = bucketlist | ||
|
||
CONFIG += qt warn_on debug_and_release cascades | ||
CONFIG += qt warn_on cascades10 | ||
|
||
LIBS += -lbbdata | ||
LIBS += -lbbplatformbbm | ||
|
||
INCLUDEPATH += ../src | ||
SOURCES += ../src/*.cpp | ||
HEADERS += ../src/*.h | ||
|
||
device { | ||
CONFIG(release, debug|release) { | ||
DESTDIR = o.le-v7 | ||
} | ||
CONFIG(debug, debug|release) { | ||
DESTDIR = o.le-v7-g | ||
} | ||
} | ||
|
||
simulator { | ||
CONFIG(release, debug|release) { | ||
DESTDIR = o | ||
} | ||
CONFIG(debug, debug|release) { | ||
DESTDIR = o-g | ||
} | ||
} | ||
|
||
OBJECTS_DIR = $${DESTDIR}/.obj | ||
MOC_DIR = $${DESTDIR}/.moc | ||
RCC_DIR = $${DESTDIR}/.rcc | ||
UI_DIR = $${DESTDIR}/.ui | ||
|
||
include(config.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,6 @@ | ||
QMAKE_TARGET = BucketList | ||
QMAKE = $(QNX_HOST)/usr/bin/qmake | ||
TARGET = $(QMAKE_TARGET) | ||
QMAKE_TARGET = bucketlist | ||
PROJECT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) | ||
I18N_DIR := $(PROJECT_DIR)/translations | ||
|
||
include mk/cs-base.mk | ||
|
||
all: Makefile $(QMAKE_TARGET) | ||
|
||
clean: | ||
$(MAKE) -C ./arm -f Makefile distclean | ||
$(MAKE) -C ./x86 -f Makefile distclean | ||
|
||
|
||
Makefile: FORCE | ||
$(QMAKE) -spec unsupported/blackberry-armv7le-qcc -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device | ||
$(QMAKE) -spec unsupported/blackberry-x86-qcc -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator | ||
|
||
FORCE: | ||
|
||
$(QMAKE_TARGET): device simulator | ||
|
||
device: | ||
$(MAKE) -C ./arm -f Makefile all | ||
|
||
Device-Debug: Makefile | ||
$(MAKE) -C ./arm -f Makefile debug | ||
|
||
Device-Release: Makefile | ||
$(MAKE) -C ./arm -f Makefile release | ||
|
||
simulator: | ||
$(MAKE) -C ./x86 -f Makefile all | ||
|
||
Simulator-Debug: Makefile | ||
$(MAKE) -C ./x86 -f Makefile debug |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* Copyright (c) 2012 Research In Motion Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import bb.cascades 1.0 | ||
|
||
Sheet { | ||
id: bbmConnectSheet | ||
|
||
property string waitingMessage | ||
property string waitingImage | ||
property string errorMessage | ||
signal connectToBBM(bool connect) | ||
|
||
// Page with UI for connection to BBM. | ||
Page { | ||
id: bbmConnectScreen | ||
|
||
Container { | ||
verticalAlignment: VerticalAlignment.Center | ||
leftPadding: 50 | ||
rightPadding: leftPadding | ||
|
||
Container { | ||
|
||
Label { | ||
horizontalAlignment: HorizontalAlignment.Center | ||
text: "Connect Bucket List to BBM?" | ||
} | ||
|
||
Container { | ||
layout: StackLayout { | ||
orientation: LayoutOrientation.LeftToRight | ||
} | ||
|
||
Button { | ||
text: "Yes" | ||
onClicked: { | ||
// When yes has been answered the only outcome is sucess or | ||
// failure, after failure it is not possible to try again. | ||
enabled = false; | ||
bbmConnectSheet.connectToBBM(true); | ||
} | ||
} | ||
|
||
Button { | ||
text: "No" | ||
onClicked: { | ||
bbmConnectSheet.connectToBBM(false); | ||
} | ||
} | ||
} | ||
|
||
Label { | ||
horizontalAlignment: HorizontalAlignment.Center | ||
multiline: true | ||
text: bbmConnectSheet.errorMessage | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
/* Copyright (c) 2012 Research In Motion Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import bb.cascades 1.0 | ||
|
||
// Import the bucketmodel set as a type in the application constructor | ||
import com.bucketlist.bucketdata 1.0 | ||
|
||
// Import the items folder for the cusom list items | ||
import "items" | ||
|
||
ListView { | ||
id: bucketList | ||
|
||
// Signal that tells the application that the BBM status should be updated | ||
signal newBBMStatus(string message, string icon) | ||
|
||
// The data model is defined in the attached object list below. | ||
dataModel: bucketModel | ||
|
||
|
||
layoutProperties: StackLayoutProperties { | ||
spaceQuota: 1 | ||
} | ||
|
||
listItemComponents: [ | ||
ListItemComponent { | ||
type: "todo" | ||
TodoItem { | ||
// List item component (see items/TodoItem.qml for definition). | ||
} | ||
} | ||
] | ||
|
||
// The multi-select handler of the ListView, which will add an additional multi-select item to the list-items | ||
// context menu (accessed by long-pressing an item). In the multi-select session, it is possible to select | ||
// several items in the list and perform a collective action on them (like e.g. deleting many items at once). | ||
multiSelectHandler { | ||
status: "None selected" | ||
|
||
// The actions that can be performed in a multi-select sessions are set up in the actions list. | ||
actions: [ | ||
ActionItem { | ||
title: "Todo" | ||
|
||
// Since it is only possible to change the state from one state to another, | ||
// ActionItems are disabled if they do not result in a state change. | ||
// For example, todo -> finished is allowed but todo -> todo is not. | ||
enabled: bucketModel.filter == "todo" ? false : true | ||
imageSource: "asset:///images/todo.png" | ||
onTriggered: { | ||
if (enabled) { | ||
// Change the status of the selected items to "todo", clear selection before | ||
// performing the action, since otherwise the ListItem will not be in the correct | ||
// state when it is recycled by the list view (it will blink) | ||
var selectionList = bucketList.selectionList(); | ||
bucketList.clearSelection(); | ||
bucketModel.setStatus(selectionList, "todo"); | ||
updateBBMStatus("Added some items to my bucket list", "images/todo.png"); | ||
} | ||
} | ||
}, | ||
ActionItem { | ||
title: "Finished" | ||
enabled: bucketModel.filter == "finished" ? false : true | ||
imageSource: "asset:///images/finished.png" | ||
onTriggered: { | ||
if (enabled) { | ||
// Change the status of the selected items to "finished". Clear selection before items are manipulated to avoid blink. | ||
var selectionList = bucketList.selectionList(); | ||
bucketList.clearSelection(); | ||
bucketModel.setStatus(selectionList, "finished"); | ||
updateBBMStatus("Finished some items to my bucket list", "images/finished.png"); | ||
} | ||
} | ||
}, | ||
ActionItem { | ||
title: "Chickened out" | ||
enabled: bucketModel.filter == "chickened" ? false : true | ||
imageSource: "asset:///images/chickened.png" | ||
onTriggered: { | ||
if (enabled) { | ||
// Change the status of the selected items to "chickened". Clear selection before items are manipulated to avoid blink. | ||
var selectionList = bucketList.selectionList(); | ||
bucketList.clearSelection(); | ||
bucketModel.setStatus(selectionList, "chickened"); | ||
updateBBMStatus("Chikened out on some items to my bucket list", "images/chickened.png"); | ||
} | ||
} | ||
}, | ||
// Since the delete action has a reserved space at the bottom of the list in the | ||
// context menu it needs to be defined as a special DeleteActionItem to be shown in the | ||
// correct place. | ||
DeleteActionItem { | ||
title: "Delete" | ||
onTriggered: { | ||
// Delete the selected items. Clear selection before items are manipulated to avoid blink. | ||
var selectionList = bucketList.selectionList(); | ||
bucketList.clearSelection(); | ||
bucketModel.deleteBucketItems(selectionList); | ||
} | ||
} | ||
] | ||
} | ||
|
||
onTriggered: { | ||
// When an item is triggered, a navigation takes place to a detailed | ||
// view of the item where the user can edit the item. The page is created | ||
// via the ComponentDefinition from the attached objects in the NavigationPane. | ||
var chosenItem = dataModel.data(indexPath); | ||
var page = bucketPage.createObject(); | ||
|
||
// Set the Page properties and push the Page to the NavigationPane. | ||
page.item = chosenItem; | ||
page.bucketModel = bucketModel; | ||
var option = segmentedTitle.selectedOption; | ||
page.title = option.text; | ||
nav.push(page); | ||
} | ||
|
||
onSelectionChanged: { | ||
// Call a function to update the number of selected items in the multi-select view. | ||
updateMultiStatus(); | ||
} | ||
|
||
function itemType(data, indexPath) { | ||
// There is only have one type of item in the list, so "todo" is always returned. | ||
return "todo"; | ||
} | ||
|
||
function updateMultiStatus() { | ||
|
||
// The status text of the multi-select handler is updated to show how | ||
// many items are currently selected. | ||
if (selectionList().length > 1) { | ||
multiSelectHandler.status = selectionList().length + " items selected"; | ||
} else if (selectionList().length == 1) { | ||
multiSelectHandler.status = "1 item selected"; | ||
} else { | ||
multiSelectHandler.status = "None selected"; | ||
} | ||
} | ||
|
||
function updateBBMStatus(message, image) { | ||
newBBMStatus(message, image); | ||
} | ||
} |
Oops, something went wrong.