Skip to content

Commit

Permalink
Version 0.5-1
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixx committed Mar 2, 2015
1 parent 8c81f67 commit 04ca07d
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 21 deletions.
10 changes: 7 additions & 3 deletions harbour-trulyyours.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ system(qdbusxml2cpp -p src/ambienced.h:src/ambienced.cpp src/ambienced.xml)
HEADERS += \
src/ambiencemanager.h \
src/tagmanager.h \
src/ambienced.h
src/ambienced.h \
src/preferences.h \
src/authkey.h

SOURCES += src/harbour-trulyyours.cpp \
src/ambiencemanager.cpp \
src/tagmanager.cpp \
src/ambienced.cpp
src/ambienced.cpp \
src/preferences.cpp

OTHER_FILES += rpm/$${TARGET}.spec \
rpm/$${TARGET}.yaml \
Expand All @@ -41,5 +44,6 @@ TRANSLATIONS += \
translations/$${TARGET}-ru.ts \
translations/$${TARGET}-de.ts \
translations/$${TARGET}-en.ts \
translations/$${TARGET}-es.ts
translations/$${TARGET}-es.ts \
translations/$${TARGET}-nl.ts

2 changes: 1 addition & 1 deletion qml/pages/CommentsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Page {
property bool loading: false

Component.onCompleted: {
Data.fetchComments(comments, mediaId, loading);
Data.fetchComments(comments, mediaId, loading, preferences.getAuthKey());
}
SilicaListView {
id: ambienceComments
Expand Down
8 changes: 6 additions & 2 deletions qml/pages/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ var tags = []
var tagCounts = []
var filteredCnt = 0;

function fetchAmbiences(tagMgr)
function fetchAmbiences(tagMgr, authkey)
{
var xhr = new XMLHttpRequest
var query = "https://www.jollawalls.com/api/media"
xhr.open("GET", query);
xhr.setRequestHeader('auth_key', authkey);

xhr.onreadystatechange = function()
{
if (xhr.readyState === XMLHttpRequest.DONE)
Expand Down Expand Up @@ -110,13 +112,15 @@ function hasTag(tag, tagString)
return false;
}

function fetchComments(model, id, loading)
function fetchComments(model, id, loading, authkey)
{
model.clear();
loading = true;
var xhr = new XMLHttpRequest
var query = "https://www.jollawalls.com/api/comments/" + id;
xhr.open("GET", query);
xhr.setRequestHeader('auth_key', authkey);

xhr.onreadystatechange = function()
{
if (xhr.readyState === XMLHttpRequest.DONE)
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/MainPage.qml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Page {
Component.onCompleted: {
tagMgr.tagsAvailable.connect(setTags);
tagCloud.tagClicked.connect(openFilteredAmbienceList);
Data.fetchAmbiences(tagMgr);
Data.fetchAmbiences(tagMgr, preferences.getAuthKey());
}

PullDownMenu {
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-trulyyours.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-trulyyours
Summary: TrulyYours - Mobile JollaWalls client
Version: 0.4
Version: 0.5
Release: 1
Group: Qt/Qt
URL: https://github.com/matrixx/TrulyYours
Expand Down
3 changes: 3 additions & 0 deletions src/harbour-trulyyours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <QQmlContext>
#include "ambiencemanager.h"
#include "tagmanager.h"
#include "preferences.h"

int main(int argc, char *argv[])
{
Expand All @@ -53,8 +54,10 @@ int main(int argc, char *argv[])
qDebug() << "locale:" << QLocale::system().name();
AmbienceManager mgr;
TagManager tagMgr;
Preferences preferences;
view->rootContext()->setContextProperty("ambienceMgr", &mgr);
view->rootContext()->setContextProperty("tagMgr", &tagMgr);
view->rootContext()->setContextProperty("preferences", &preferences);
view->setSource(QUrl(SailfishApp::pathTo("qml/harbour-trulyyours.qml")));

view->show();
Expand Down
38 changes: 38 additions & 0 deletions src/preferences.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 matrixx
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include "authkey.h"
#include "preferences.h"
#include <QDebug>


Preferences::Preferences(QObject *parent) :
QObject(parent)
{
}

QString Preferences::getAuthKey() const
{
return authkey;
}
45 changes: 45 additions & 0 deletions src/preferences.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 matrixx
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/


#ifndef PREFERENCES_H
#define PREFERENCES_H

#include <QObject>

class Preferences : public QObject
{
Q_OBJECT

public:
explicit Preferences(QObject *parent = 0);
Q_INVOKABLE QString getAuthKey() const;

public slots:

private:

};

#endif // PREFERENCES_H
8 changes: 4 additions & 4 deletions translations/harbour-trulyyours-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="49"/>
<source>Show comments</source>
<translation type="unfinished"></translation>
<translation>Show comments</translation>
</message>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="56"/>
Expand Down Expand Up @@ -37,17 +37,17 @@
<message>
<location filename="../qml/pages/CommentsPage.qml" line="44"/>
<source>Comments</source>
<translation type="unfinished"></translation>
<translation>Comments</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>Loading</source>
<translation type="unfinished">Loading</translation>
<translation>Loading</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>This ambience has no comments</source>
<translation type="unfinished"></translation>
<translation>This ambience has no comments</translation>
</message>
</context>
<context>
Expand Down
10 changes: 5 additions & 5 deletions translations/harbour-trulyyours-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="49"/>
<source>Show comments</source>
<translation type="unfinished"></translation>
<translation>Mostrar comentarios</translation>
</message>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="56"/>
Expand Down Expand Up @@ -37,25 +37,25 @@
<message>
<location filename="../qml/pages/CommentsPage.qml" line="44"/>
<source>Comments</source>
<translation type="unfinished"></translation>
<translation>Comentarios</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>Loading</source>
<translation type="unfinished">Cargando</translation>
<translation>Cargando</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>This ambience has no comments</source>
<translation type="unfinished"></translation>
<translation>Este ambiente no tiene comentarios</translation>
</message>
</context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="45"/>
<source>Show all ambiences</source>
<translation>Mostrar todos loa ambientes</translation>
<translation>Mostrar todos los ambientes</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="54"/>
Expand Down
71 changes: 71 additions & 0 deletions translations/harbour-trulyyours-nl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nl">
<context>
<name>AmbienceDetailPage</name>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="49"/>
<source>Show comments</source>
<translation>Toon reacties</translation>
</message>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="56"/>
<source>Save and create ambience</source>
<translation>Bewaren en creëren ambience</translation>
</message>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="64"/>
<source>Save to gallery</source>
<translation>Opslaan in Galerij</translation>
</message>
</context>
<context>
<name>BrowseAmbienceListPage</name>
<message>
<location filename="../qml/pages/BrowseAmbienceListPage.qml" line="39"/>
<source>Found ambiences</source>
<translation>Gevonden ambiences</translation>
</message>
<message>
<location filename="../qml/pages/BrowseAmbienceListPage.qml" line="39"/>
<source>Ambiences for &apos;%1&apos;</source>
<translation>Ambiences voor &apos;%1&apos;</translation>
</message>
</context>
<context>
<name>CommentsPage</name>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="44"/>
<source>Comments</source>
<translation>Reacties</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>Loading</source>
<translation>Laden</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>This ambience has no comments</source>
<translation>Geen reacties bij deze ambience</translation>
</message>
</context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="45"/>
<source>Show all ambiences</source>
<translation>Toon alle ambiences</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="54"/>
<source>Tags</source>
<translation>Tags</translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="71"/>
<source>Loading</source>
<translation>Laden</translation>
</message>
</context>
</TS>
8 changes: 4 additions & 4 deletions translations/harbour-trulyyours-ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="49"/>
<source>Show comments</source>
<translation type="unfinished"></translation>
<translation>Показать комментарии </translation>
</message>
<message>
<location filename="../qml/pages/AmbienceDetailPage.qml" line="56"/>
Expand Down Expand Up @@ -37,17 +37,17 @@
<message>
<location filename="../qml/pages/CommentsPage.qml" line="44"/>
<source>Comments</source>
<translation type="unfinished"></translation>
<translation>Комментарии</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>Loading</source>
<translation type="unfinished">Загрузка</translation>
<translation>Загрузка</translation>
</message>
<message>
<location filename="../qml/pages/CommentsPage.qml" line="64"/>
<source>This ambience has no comments</source>
<translation type="unfinished"></translation>
<translation>Эта атмосфера без комментариев</translation>
</message>
</context>
<context>
Expand Down

0 comments on commit 04ca07d

Please sign in to comment.