diff --git a/.gitignore b/.gitignore index e31cfb2..8411201 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.user +harbour-tooter.pro.user +harbour-tooter.pro.user diff --git a/harbour-tooter.pro b/harbour-tooter.pro index 12d4943..b970890 100644 --- a/harbour-tooter.pro +++ b/harbour-tooter.pro @@ -44,6 +44,7 @@ CONFIG += sailfishapp_i18n # following TRANSLATIONS line. And also do not forget to # modify the localized app name in the the .desktop file. TRANSLATIONS += \ + translations/harbour-tooter-es.ts \ translations/harbour-tooter-fr.ts \ translations/harbour-tooter-nl.ts \ translations/harbour-tooter-oc.ts diff --git a/qml/lib/Worker.js b/qml/lib/Worker.js index deaf7f4..44d2a05 100644 --- a/qml/lib/Worker.js +++ b/qml/lib/Worker.js @@ -75,6 +75,8 @@ WorkerScript.onMessage = function(msg) { for (var j = 0; j < data[i].length; j ++) { item = parseToot(data[i][j]); item['id'] = item['status_id'] + if (typeof item['attachments'] === "undefined") + item['attachments'] = []; items.push(item) console.log(JSON.stringify(data[i][j])) } diff --git a/qml/pages/Browser.qml b/qml/pages/Browser.qml index 8c97ff0..f34f6f3 100644 --- a/qml/pages/Browser.qml +++ b/qml/pages/Browser.qml @@ -68,7 +68,7 @@ Page { if ( xhr.status === 200 ) { console.log(xhr.responseText) var response = JSON.parse(xhr.responseText); - if (response.date_published) + //if (response.date_published) //articleDate = new Date(response.date_published.replace(/^(\w+) (\w+) (\d+) ([\d:]+) \+0000 (\d+)$/,"$1, $2 $3 $5 $4 GMT")); if (response.title) articleTitle = response.title; diff --git a/qml/pages/Conversation.qml b/qml/pages/Conversation.qml index 66e0f2e..a560c55 100644 --- a/qml/pages/Conversation.qml +++ b/qml/pages/Conversation.qml @@ -37,6 +37,13 @@ Page { right: parent.right } model: mdl + section { + property: 'section' + delegate: SectionHeader { + height: Theme.itemSizeExtraSmall + text: Format.formatDate(section, Formatter.DateMedium) + } + } delegate: VisualContainer {} onCountChanged: { for (var i = 0; i < mdl.count; i++){ @@ -55,6 +62,12 @@ Page { DockedPanel { id: panel open: true + onExpandedChanged: { + if (!expanded) { + show() + } + } + width: parent.width height: toot.height + btnContentWarning.height + Theme.paddingMedium + (warningContent.visible ? warningContent.height : 0) dock: Dock.Bottom diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 6378f5f..84f03c6 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -87,11 +87,21 @@ Page { onOpenDrawer: infoPanel.open = setDrawer } MyList{ - property string search; id: tlSearch; + property string search; + onSearchChanged: { + mdl = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject'); + if (search[0] === "#") { + tlSearch.type = "timelines/tag/"+search.substring(1) + loadData("append") + } + } + onTypeChanged: { + console.log("type changed") + } title: qsTr("Search") - type: "search" - mdl: Logic.modelTLsearch + type: "" + mdl: ListModel {} width: parent.width height: parent.height onOpenDrawer: infoPanel.open = setDrawer @@ -108,8 +118,8 @@ Page { } } ViewPlaceholder { - enabled: Logic.modelTLsearch.count === 0 - text: "Not implemented" + enabled: tlSearch.mdl === 0 + text: "Only #hastag search works" } } @@ -164,7 +174,7 @@ Page { console.log(JSON.stringify(test)) console.log(JSON.stringify(test.length)) if (test.length === 5 && (test[3] === "tags" || test[3] === "tag") ) { - tlSearch.search = "#"+test[4] + tlSearch.search = "#"+decodeURIComponent(test[4]) slideshow.positionViewAtIndex(3, ListView.SnapToItem) navigation.navigateTo('search') diff --git a/qml/pages/components/MediaBlock.qml b/qml/pages/components/MediaBlock.qml index ddb3b98..aa1d9e5 100644 --- a/qml/pages/components/MediaBlock.qml +++ b/qml/pages/components/MediaBlock.qml @@ -17,8 +17,10 @@ Item { } //console.log(JSON.stringify(model.get(0))) } - - switch(model.count){ + var count = 0 + if (model && model.count) + count = model.count + switch(count){ case 1: placeholder1.width = holder.width placeholder1.height = placeholder1.width*hRatio diff --git a/qml/pages/components/MyList.qml b/qml/pages/components/MyList.qml index 9b1765c..ba463d4 100644 --- a/qml/pages/components/MyList.qml +++ b/qml/pages/components/MyList.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.2 import Sailfish.Silica 1.0 import "../../lib/API.js" as Logic import "." @@ -25,6 +25,7 @@ SilicaListView { } + signal openDrawer (bool setDrawer) onOpenDrawer: { //console.log("Open drawer: " + setDrawer) @@ -92,7 +93,8 @@ SilicaListView { } } - delegate: VisualContainer {} //Toot {} + delegate: VisualContainer { + } //Toot {} add: Transition { NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 } @@ -160,14 +162,7 @@ SilicaListView { } Component.onCompleted: { - var msg = { - 'action' : type, - 'params' : [ ], - 'model' : model, - 'mode' : "append", - 'conf' : Logic.conf - }; - worker.sendMessage(msg); + loadData("prepend") } Timer { @@ -193,6 +188,7 @@ SilicaListView { 'mode' : mode, 'conf' : Logic.conf }; - worker.sendMessage(msg); + if (type !== "") + worker.sendMessage(msg); } } diff --git a/qml/pages/components/ProfileHeader.qml b/qml/pages/components/ProfileHeader.qml index 88dbe89..e557bcb 100644 --- a/qml/pages/components/ProfileHeader.qml +++ b/qml/pages/components/ProfileHeader.qml @@ -41,7 +41,7 @@ Item { } Column { anchors { - left: icon.left + left: icon.right leftMargin: Theme.paddingLarge right: parent.right rightMargin: Theme.paddingLarge diff --git a/qml/pages/components/VisualContainer.qml b/qml/pages/components/VisualContainer.qml index 2bb7b45..081ed5c 100644 --- a/qml/pages/components/VisualContainer.qml +++ b/qml/pages/components/VisualContainer.qml @@ -1,12 +1,13 @@ -import QtQuick 2.0 +import QtQuick 2.2 import Sailfish.Silica 1.0 BackgroundItem { + id: delegate signal send (string notice) signal navigateTo(string link) width: parent.width - height: miniHeader.height + (attachments && attachments.count ? media.height + Theme.paddingLarge + Theme.paddingMedium: Theme.paddingLarge) + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0) + height: mnu.height + miniHeader.height + (typeof attachments !== "undefined" && attachments.count ? media.height + Theme.paddingLarge + Theme.paddingMedium: Theme.paddingLarge) + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0) MiniStatus { id: ministatus anchors { @@ -108,25 +109,14 @@ BackgroundItem { "profileImage": "" }) } else { - pageStack.push(Qt.resolvedUrl("Browser.qml"), {"href" : href}) + pageStack.push(Qt.resolvedUrl("../Browser.qml"), {"href" : link}) } - /*if (link[0] === "@") { - pageStack.push(Qt.resolvedUrl("../Profile.qml"), { - "name": "", - "username": link.substring(1), - "profileImage": "" - }) - } else if (link[0] === "#") { - } else { - pageStack.push(Qt.resolvedUrl("../Browser.qml"), {"href" : link}) - }*/ - } - text: content.replace(new RegExp(" 0.1.6-1 +- Hashtag search added +- Coversation with sections diff --git a/rpm/harbour-tooter.spec b/rpm/harbour-tooter.spec index 0cfefc2..06e3a19 100644 --- a/rpm/harbour-tooter.spec +++ b/rpm/harbour-tooter.spec @@ -13,7 +13,7 @@ Name: harbour-tooter %{!?qtc_make:%define qtc_make make} %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: Tooter -Version: 0.1.5 +Version: 0.1.6 Release: 1 Group: Qt/Qt License: LICENSE diff --git a/rpm/harbour-tooter.yaml b/rpm/harbour-tooter.yaml index 5ddd8ed..1f435dc 100644 --- a/rpm/harbour-tooter.yaml +++ b/rpm/harbour-tooter.yaml @@ -1,6 +1,6 @@ Name: harbour-tooter Summary: Tooter -Version: 0.1.5 +Version: 0.1.6 Release: # The contents of the Group field should be one of the groups listed here: # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS