Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8888bdc
Update README.md
osanwe Sep 2, 2016
3113316
Merge branch 'master' of https://github.com/osanwe/Kat
osanwe Dec 21, 2016
92f22f1
Fix month in ProfilePage
sash13 Jan 31, 2017
1299edb
Fix error in month calculation
Feb 10, 2017
15dfff4
Now we can open user profile from Dialog
Feb 10, 2017
43c83c1
Fix gender specified text in Profile view
Feb 11, 2017
6cf9a50
git push origin masterMerge branch 'sash13-patch-1'
osanwe Feb 19, 2017
cb0b0b0
Spaces in russian translation are fixed
osanwe Feb 19, 2017
d00b893
Code style fixes
osanwe Feb 19, 2017
2979aaa
Added online/offline mode
osanwe Feb 19, 2017
9f50734
Added ban/unban user option
osanwe Feb 19, 2017
12d74fa
Added Dutch localization
osanwe Feb 19, 2017
494b763
New version
osanwe Feb 19, 2017
1029e49
The model for attached images
osanwe Mar 10, 2017
22d4758
Updated ImageViewPage
osanwe Mar 22, 2017
25e2b5b
Fix a few mem leaks
nib952051 Mar 14, 2017
135186d
Account port to makeApiGetRequest
nib952051 Mar 23, 2017
fefea8e
ApiRequest remove _history, pass args async
nib952051 Mar 23, 2017
612b589
added RequestBase, const refs in some places
nib952051 Mar 23, 2017
9d706ba
Showing photos from groups and profiles
osanwe Mar 26, 2017
b5f7191
Basic topics support in groups
osanwe Apr 18, 2017
43db8cd
Fixed comments in groups
osanwe Apr 18, 2017
e585def
New version
osanwe Apr 18, 2017
c809672
Merge branch 'master' into dev-fix-a-few-mem-leaks-and-refactoring
osanwe Apr 18, 2017
1e6a989
Merge pull request #33 from nib952051/dev-fix-a-few-mem-leaks-and-ref…
osanwe Apr 18, 2017
07cc324
Build fix
neochapay May 10, 2017
4dc893a
Merge pull request #35 from neochapay/master
osanwe May 18, 2017
dc6e5e1
Fix Likes/Wall/Board
nib952051 May 18, 2017
75649ff
Merge pull request #39 from nib952051/fix-likes
osanwe May 19, 2017
2906688
* add BackgrounItem to CoverPage, but harbour-cat.png not deploy to
Jul 15, 2017
66d888e
+ add Kat icon to CoverPage.qml
Jul 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Kat
The unofficial client for the most popular russian social network shared under the terms of the GNU GPL v3.

This is an unofficial vk.com client for Jolla Sailfish OS.

__You can:__
+ Viewing profiles
+ Reading news
+ Chatting
+ Listening to audios

__For developers:__
+ _master_ branch is for releases
+ _dev_ branch is for bug fixes
+ _dev-new_ branch is for new features
+ _dev_ branch is for development process
16 changes: 12 additions & 4 deletions harbour-kat.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ include("vksdk/vksdk.pri")
HEADERS += \
src/settingswrapper.h \
src/mediaplayerwrapper.h \
src/playlistmodel.h
src/playlistmodel.h \
src/filesaver.h

SOURCES += \
src/harbour-kat.cpp \
src/settingswrapper.cpp \
src/mediaplayerwrapper.cpp \
src/playlistmodel.cpp
src/playlistmodel.cpp \
src/filesaver.cpp

OTHER_FILES += \
qml/harbour-kat.qml \
Expand All @@ -42,14 +44,17 @@ OTHER_FILES += \
translations/*.ts \
rpm/harbour-kat.yaml \
rpm/harbour-kat.spec \
harbour-kat.png\
harbour-kat.desktop\
rpm/harbour-kat.changes.in \
LICENSE \
README.md

CONFIG += sailfishapp_i18n
TRANSLATIONS += \
translations/harbour-kat-ru.ts \
translations/harbour-kat-it.ts
translations/harbour-kat-it.ts \
translations/harbour-kat-nl.ts

DISTFILES += \
qml/pages/MainMenuPage.qml \
Expand Down Expand Up @@ -86,5 +91,8 @@ DISTFILES += \
qml/views/WallItem.qml \
qml/pages/RepostPage.qml \
qml/pages/StatisticsPage.qml \
translations/harbour-kat-it.ts
qml/pages/SettingsPage.qml \
qml/pages/PhotoAlbumPage.qml \
qml/pages/TopicsPage.qml \
qml/pages/TopicPage.qml

14 changes: 14 additions & 0 deletions qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ import Sailfish.Silica 1.0
CoverBackground {
id: cover

BackgroundItem {
id: background
anchors.fill: parent
Image {
id: bg_image
anchors.fill: parent
width: parent.width
height: parent.height
fillMode: Image.PreserveAspectCrop
source: "/usr/share/icons/hicolor/86x86/apps/harbour-kat.png"
opacity: 0.2
}
}

Column {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Expand Down
18 changes: 14 additions & 4 deletions qml/pages/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ Page {
anchors.horizontalCenter: parent.horizontalCenter
width: Theme.iconSizeExtraLarge
height: Theme.iconSizeExtraLarge
source: "../harbour-kat.png"
source: "/usr/share/icons/hicolor/86x86/apps/harbour-kat.png"
}

Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: "v0.5.1"
text: "v0.5.3"
}

Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: "© 2015-2016 Petr Vytovtov"
text: "© 2015-2017 Petr Vytovtov"
}

Label {
Expand Down Expand Up @@ -89,13 +89,23 @@ Page {
onClicked: Qt.openUrlExternally("https://github.com/osanwe/Kat")
}

Label {
width: parent.width
wrapMode: Text.WordWrap
linkColor: Theme.highlightColor
onLinkActivated: Qt.openUrlExternally(link)
text: qsTr("Thanks for features") + ":<br>" +
"<a href=\"https://github.com/sash13\">Alexander Ryzhkov</a>"
}

Label {
width: parent.width
wrapMode: Text.WordWrap
linkColor: Theme.highlightColor
onLinkActivated: Qt.openUrlExternally(link)
text: qsTr("Localization") + ":<br>" +
qsTr("Italian") + ": <a href=\"https://github.com/fravaccaro\">Fra</a>"
qsTr("Italian") + ": <a href=\"https://github.com/fravaccaro\">Fra</a><br>" +
qsTr("Dutch") + ": <a href=\"https://github.com/richdb\">Richard</a><br>"
}
}

Expand Down
1 change: 1 addition & 0 deletions qml/pages/DialogPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Page {
anchors.left: parent.left
anchors.right: parent.right

userId: fromId
date: datetime
isOut: out
isRead: read
Expand Down
46 changes: 25 additions & 21 deletions qml/pages/GroupProfilePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -111,40 +111,44 @@ Page {
text: qsTr("Photos")
counter: group.photosCount
visible: group.photosCount !== 0
}

MoreButton {
width: parent.width
height: Theme.itemSizeMedium
text: qsTr("Audios")
counter: group.audiosCount
visible: group.audiosCount !== 0
onClicked: pageContainer.push(Qt.resolvedUrl("PhotoAlbumPage.qml"), { ownerId: groupId })
}

MoreButton {
width: parent.width
height: Theme.itemSizeMedium
text: qsTr("Videos")
counter: group.videosCount
visible: group.videosCount !== 0
}
// MoreButton {
// width: parent.width
// height: Theme.itemSizeMedium
// text: qsTr("Audios")
// counter: group.audiosCount
// visible: group.audiosCount !== 0
// }

// MoreButton {
// width: parent.width
// height: Theme.itemSizeMedium
// text: qsTr("Videos")
// counter: group.videosCount
// visible: group.videosCount !== 0
// }

MoreButton {
width: parent.width
height: Theme.itemSizeMedium
text: qsTr("Topics")
counter: group.topicsCount
visible: group.topicsCount !== 0
}

MoreButton {
width: parent.width
height: Theme.itemSizeMedium
text: qsTr("Documents")
counter: group.docsCount
visible: group.docsCount !== 0
onClicked: pageContainer.push(Qt.resolvedUrl("TopicsPage.qml"), { ownerId: groupId })
}

// MoreButton {
// width: parent.width
// height: Theme.itemSizeMedium
// text: qsTr("Documents")
// counter: group.docsCount
// visible: group.docsCount !== 0
// }

MoreButton {
id: wallButton
width: parent.width
Expand Down
140 changes: 99 additions & 41 deletions qml/pages/ImageViewPage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Petr Vytovtov
Copyright (C) 2016-2017 Petr Vytovtov
Contact: Petr Vytovtov <osanwe@protonmail.ch>
All rights reserved.

Expand All @@ -25,55 +25,113 @@ import Sailfish.Silica 1.0
Page {
id: imageViewPage

property var ownerIds
property var photoIds
property var imagesModel
property var current
property bool fromAlbum: false

SilicaListView {
id: flick
Drawer {
id: drawer
anchors.fill: parent
anchors.bottomMargin: audioPlayer.open ? audioPlayer.height : 0
clip: true
snapMode: ListView.SnapOneItem
orientation: ListView.HorizontalFlick
highlightRangeMode: ListView.StrictlyEnforceRange
cacheBuffer: width

model: ListModel {}

delegate: Item {
width: flick.width
height: flick.height
clip: true

Image {
anchors.fill: parent
sourceSize.height: window.height * 2
fillMode: Image.PreserveAspectFit
source: source_

PinchArea {
anchors.fill: parent
pinch.target: parent
pinch.minimumScale: 1
pinch.maximumScale: 4

open: true

background: SilicaListView {
anchors.fill: parent

model: ListModel {

ListElement { title: "Save" }
ListElement { title: "Like" }
ListElement { title: "Share" }
ListElement { title: "Copy link" }
}

header: PageHeader {
title: (slideshowView.currentIndex + 1) + ' / ' + (fromAlbum ? vksdk.photosModel.count : imagesModel.length)
}

delegate: ListItem {

width: parent.width
height: Theme.itemSizeSmall

Label {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width - 2 * Theme.horizontalPageMargin
text: model.title
}

onClicked: switch (index) {
case 0:
fileSaver.save(fromAlbum ? vksdk.photosModel.getUrl(slideshowView.currentIndex) : imagesModel[slideshowView.currentIndex])
break;
case 1:
if (fromAlbum)
vksdk.likes.addPhoto(vksdk.photosModel.getOwnerId(slideshowView.currentIndex),
vksdk.photosModel.getPhotoId(slideshowView.currentIndex))
else
vksdk.likes.addPhoto(ownerIds[slideshowView.currentIndex],
photoIds[slideshowView.currentIndex])
break;
case 2:
if (fromAlbum)
pageStack.push(Qt.resolvedUrl("RepostPage.qml"),
{ sourceId: vksdk.photosModel.getOwnerId(slideshowView.currentIndex),
postId: vksdk.photosModel.getPhotoId(slideshowView.currentIndex),
type: "photo" })
else
pageStack.push(Qt.resolvedUrl("RepostPage.qml"), { sourceId: ownerIds[slideshowView.currentIndex],
postId: photoIds[slideshowView.currentIndex],
type: "photo" })
break;
case 3:
Clipboard.text = imagesModel[slideshowView.currentIndex]
break;
}
}
}
}

Label {
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingLarge
text: (flick.currentIndex + 1) + ' / ' + imagesModel.length
SlideshowView {
id: slideshowView
width: imageViewPage.width
height: imageViewPage.height
model: fromAlbum ? vksdk.photosModel : imagesModel.length

delegate: Image {
id: imageView
width: imageViewPage.width
height: width * (sourceSize.height / sourceSize.width)
fillMode: Image.PreserveAspectFit
source: fromAlbum ? photoUrl : imagesModel[index]

PinchArea {
anchors.fill: parent
pinch.target: parent
pinch.minimumScale: 1
pinch.maximumScale: 4

MouseArea {
anchors.fill: parent
drag.target: imageView
drag.axis: Drag.XAndYAxis
drag.minimumX: (slideshowView.width - imageView.width * imageView.scale) / 2
drag.minimumY: (slideshowView.height - imageView.height * imageView.scale) / 2
drag.maximumX: Math.abs(slideshowView.width - imageView.width * imageView.scale) / 2
drag.maximumY: Math.abs(slideshowView.height - imageView.height * imageView.scale) / 2
onClicked: drawer.open = !drawer.open
onPositionChanged: { // TODO
console.log(drag.minimumX + " <= " + imageView.x + " <= " + drag.maximumX)
console.log(drag.minimumY + " <= " + imageView.y + " <= " + drag.maximumY)
}
}
}
}
}
}

// onStatusChanged: if (status === PageStatus.Active) pageStack.pushAttached(Qt.resolvedUrl("AudioPlayerPage.qml"))

Component.onCompleted: {
for (var index in imagesModel) flick.model.append({ source_: imagesModel[index] })
flick.currentIndex = current
}
Component.onCompleted: slideshowView.currentIndex = current
}

Loading