Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
GCR v3.5.0.0:
Browse files Browse the repository at this point in the history
Issue 12:	Add invocation target for qu'ran search
Issue 67:	Add ability to set a bookmark/shortcut name
Issue 103:	resume the app from where it was closed ie. last read verse
Issue 136:	Animate a bookmark when it is being deleted
Issue 143:	Certain characters cause the search to fail
Issue 151:	Basmalah gets truncated if font size is too large
  • Loading branch information
ragaeeb committed Apr 27, 2014
1 parent 91d09f9 commit a7b601f
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 151 deletions.
197 changes: 94 additions & 103 deletions assets/BookmarksPane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NavigationPane
actions: [
DeleteActionItem
{
enabled: listDelegate.delegateActive
enabled: listView.visible
imageSource: "images/menu/ic_bookmark_delete.png"
title: qsTr("Clear Bookmarks") + Retranslate.onLanguageChanged

Expand All @@ -40,111 +40,101 @@ NavigationPane
labelText: qsTr("You have no favourites. To mark a favourite, press-and-hold on an ayat or tafsir and choose 'Mark Favourite' from the context-menu.") + Retranslate.onLanguageChanged
}

ControlDelegate
ListView
{
id: listDelegate
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill

layoutProperties: StackLayoutProperties {
spaceQuota: 1
id: listView
dataModel: ArrayDataModel {
id: adm
}

sourceComponent: ComponentDefinition

function itemType(data, indexPath) {
return data.type;
}

function deleteBookmark(indexPath)
{
ListView
var bookmarks = persist.getValueFor("bookmarks");

if (bookmarks && bookmarks.length > 0)
{
id: listView
dataModel: ArrayDataModel {}

function itemType(data, indexPath) {
return data.type;
}
bookmarks.splice(indexPath, 1);

persist.saveValueFor("bookmarks", bookmarks);
persist.showToast( qsTr("Removed bookmark!"), "", "asset:///images/menu/ic_bookmark_delete.png" );
}
}

listItemComponents: [
ListItemComponent
{
type: "verse"

function deleteBookmark(indexPath)
StandardListItem
{
var bookmarks = persist.getValueFor("bookmarks");

if (bookmarks && bookmarks.length > 0)
{
bookmarks.splice(indexPath, 1);

persist.saveValueFor("bookmarks", bookmarks);
persist.showToast( qsTr("Removed bookmark!"), "", "asset:///images/menu/ic_bookmark_delete.png" );
}
}

listItemComponents: [
ListItemComponent
{
type: "verse"

StandardListItem
id: sli
title: ListItemData.surah_name
status: "%1:%2".arg(ListItemData.surah_id).arg(ListItemData.verse_id)
description: ListItemData.text
imageSource: "images/ic_quran.png"
scaleX: 1

contextActions: [
ActionSet
{
id: sli
title: ListItemData.surah_name
status: "%1:%2".arg(ListItemData.surah_id).arg(ListItemData.verse_id)
description: ListItemData.text
imageSource: "images/ic_quran.png"

contextActions: [
ActionSet
{
title: sli.title
subtitle: sli.description

DeleteActionItem
{
imageSource: "images/menu/ic_bookmark_delete.png"
title: qsTr("Remove") + Retranslate.onLanguageChanged

onTriggered: {
console.log("UserEvent: RemoveBookmark");
itemDeletedAnim.play();
}
}
}
]
title: sli.title
subtitle: sli.description

animations: [
ScaleTransition
{
id: itemDeletedAnim
fromX: 1
toX: 0
duration: 500
easingCurve: StockCurve.CubicOut

onEnded: {
sli.ListItem.view.deleteBookmark(sli.ListItem.indexPath);
}
DeleteActionItem
{
imageSource: "images/menu/ic_bookmark_delete.png"
title: qsTr("Remove") + Retranslate.onLanguageChanged

onTriggered: {
console.log("UserEvent: RemoveBookmark");
itemDeletedAnim.play();
}
]
}
}
}
]

onTriggered: {
console.log("UserEvent: Bookmark Triggered");
var data = dataModel.data(indexPath);

definition.source = "SurahPage.qml";
var sp = definition.createObject();
navigationPane.push(sp);
sp.surahId = data.surah_id;
sp.requestedVerse = data.verse_id;
]

animations: [
ScaleTransition
{
id: itemDeletedAnim
fromX: 1
toX: 0
duration: 500
easingCurve: StockCurve.CubicOut

onEnded: {
sli.ListItem.view.deleteBookmark(sli.ListItem.indexPath);
sli.scaleX = 1;
}
}
]
}

horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill

attachedObjects: [
ComponentDefinition {
id: definition
}
]
}
]

onTriggered: {
console.log("UserEvent: Bookmark Triggered");
var data = dataModel.data(indexPath);

definition.source = "SurahPage.qml";
var sp = definition.createObject();
navigationPane.push(sp);
sp.surahId = data.surah_id;
sp.requestedVerse = data.verse_id;
}

horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill

attachedObjects: [
ComponentDefinition {
id: definition
}
]
}

onCreationCompleted: {
Expand All @@ -158,17 +148,18 @@ NavigationPane
{
var bookmarks = persist.getValueFor("bookmarks");

if (bookmarks && bookmarks.length > 0) {
noElements.delegateActive = false;
listDelegate.delegateActive = true;
if (!bookmarks) {
bookmarks = [];
}

listDelegate.control.dataModel.clear();
listDelegate.control.dataModel.append(bookmarks);

if ( persist.tutorial( "tutorialBookmarkDel", qsTr("To delete an existing bookmark, simply press-and-hold on it and choose 'Remove' from the menu."), "asset:///images/menu/ic_bookmark_delete.png" ) ) {}
} else {
noElements.delegateActive = true;
listDelegate.delegateActive = false;
adm.clear();
adm.append(bookmarks);

noElements.delegateActive = adm.isEmpty();
listView.visible = !noElements.delegateActive;

if (listView.visible) {
persist.tutorial( "tutorialBookmarkDel", qsTr("To delete an existing bookmark, simply press-and-hold on it and choose 'Remove' from the menu."), "asset:///images/menu/ic_bookmark_delete.png" );
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions assets/MushafSheet.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Sheet
peekEnabled: false
property int currentPage: persist.contains("savedPage") ? persist.getValueFor("savedPage") : 1

onCurrentPageChanged: {
mushaf.requestPage(currentPage);
}

Page
{
id: mainPage
Expand Down Expand Up @@ -97,7 +101,7 @@ Sheet
title: qsTr("Surah") + Retranslate.onLanguageChanged

onSelectedValueChanged: {
mushaf.requestPage(selectedValue);
currentPage = selectedValue;
}

function onDataLoaded(id, data)
Expand Down Expand Up @@ -186,7 +190,6 @@ Sheet

onClicked: {
++currentPage;
mushaf.requestPage(currentPage);
}
}

Expand All @@ -201,7 +204,6 @@ Sheet

onClicked: {
--currentPage;
mushaf.requestPage(currentPage);
}
}
}
Expand Down
19 changes: 10 additions & 9 deletions assets/SearchPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,24 @@ Page
function onDataLoaded(id, data)
{
theDataModel.insertList(data);


var primary = persist.getValueFor("primary");
var translation = persist.getValueFor("translation");

if (id == QueryId.SearchQueryTranslation) {
translationLoaded = true
translationLoaded = true;
} else if (id == QueryId.SearchQueryPrimary) {
arabicLoaded = true
arabicLoaded = true;
}
if ( (translationLoaded && arabicLoaded) || (translation == "" && arabicLoaded) ) {
busy.running = false

if ( (translationLoaded && arabicLoaded) || (translation == "" && arabicLoaded) || (primary == "transliteration") ) {
busy.running = false;
}

noElements.delegateActive = theDataModel.isEmpty();
listView.visible = !theDataModel.isEmpty();
}

dataModel: GroupDataModel
{
id: theDataModel
Expand Down
2 changes: 1 addition & 1 deletion assets/SurahPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Page
{
console.log("UserEvent: PlayAll");

if ( !persist.contains("hideDataWarning") )
if ( !persist.contains("hideDataWarning") && !player.playing )
{
var yesClicked = persist.showBlockingDialog( qsTr("Confirmation"), qsTr("We are about to download a whole bunch of MP3 recitations, you should only attempt to do this if you have either an unlimited data plan, or are connected via Wi-Fi. Otherwise you might incur a lot of data charges. Are you sure you want to continue? If you select No you can always attempt to download again later."), qsTr("Yes"), qsTr("No") );

Expand Down
1 change: 1 addition & 0 deletions assets/VersesListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ListView
textStyle.color: Color.Black
textStyle.fontSize: FontSize.PointValue
textStyle.fontSizeValue: primarySize
multiline: true

layoutProperties: StackLayoutProperties {
spaceQuota: 1
Expand Down
2 changes: 1 addition & 1 deletion bar-descriptor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>4.0.0</versionNumber>
<versionNumber>3.5.0</versionNumber>

<!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->
Expand Down
Binary file removed res/036.psd
Binary file not shown.
Binary file removed res/036_1.psd
Binary file not shown.
Binary file removed res/6.psd
Binary file not shown.
Binary file removed res/Quran10-2_9_0_7.bar
Binary file not shown.
Binary file removed res/Social_Media_Cubes_04.psd
Binary file not shown.
Binary file removed res/euro-xb.TTF
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit a7b601f

Please sign in to comment.