diff --git a/assets/.assets.index b/assets/.assets.index index 564fe2e..5ddf8ea 100644 --- a/assets/.assets.index +++ b/assets/.assets.index @@ -1,11 +1,10 @@ 1 -47 +48 AppCover.qml LoginSheet.qml main.qml moment.js NewPostSheet.qml -ProfilePage.qml RefreshItem.qml SettingsPage.qml ThreadPage.qml @@ -42,8 +41,10 @@ icons/retweet.png icons/sign-out.png icons/star-o.png icons/star.png -PostItem.qml +icons/ic_copy.png StreamTab.qml WebViewSheet.qml +PostItem.qml +ProfilePage.qml parser.js AboutPage.qml diff --git a/assets/PostItem.qml b/assets/PostItem.qml index 0bde87e..dc93478 100644 --- a/assets/PostItem.qml +++ b/assets/PostItem.qml @@ -240,6 +240,13 @@ Container { postitem.ListItem.view.viewProfile(ListItemData.user) } } + ActionItem { + title: qsTr("Copy text") + imageSource: "asset:///icons/ic_copy.png" + onTriggered: { + postitem.ListItem.view.copyText(ListItemData.content.text) + } + } // ActionItem { // id: edItem // enabled: (ListItemData.user.username === postitem.ListItem.view.getUserName()) diff --git a/assets/StreamTab.qml b/assets/StreamTab.qml index 9c4ccef..54dd8db 100644 --- a/assets/StreamTab.qml +++ b/assets/StreamTab.qml @@ -116,6 +116,9 @@ NavigationPane { return false } } + function copyText(text) { + _app.copyText(text) + } attachedObjects: [ ListScrollStateHandler { onAtEndChanged: { diff --git a/assets/icons/ic_copy.png b/assets/icons/ic_copy.png new file mode 100644 index 0000000..dd30d2c Binary files /dev/null and b/assets/icons/ic_copy.png differ diff --git a/config.pri b/config.pri index de47a36..52a0f73 100644 --- a/config.pri +++ b/config.pri @@ -92,6 +92,7 @@ config_pri_assets { $$quote($$BASEDIR/assets/icons/ic_cancel.png) \ $$quote($$BASEDIR/assets/icons/ic_compose.png) \ $$quote($$BASEDIR/assets/icons/ic_contact.png) \ + $$quote($$BASEDIR/assets/icons/ic_copy.png) \ $$quote($$BASEDIR/assets/icons/ic_del_bookmarks.png) \ $$quote($$BASEDIR/assets/icons/ic_edit.png) \ $$quote($$BASEDIR/assets/icons/ic_favorite.png) \ diff --git a/src/applicationui.cpp b/src/applicationui.cpp index 61e321d..cadc3ff 100644 --- a/src/applicationui.cpp +++ b/src/applicationui.cpp @@ -24,6 +24,7 @@ #include #include #include +#include using namespace bb::cascades; @@ -94,3 +95,10 @@ QString ApplicationUI::appversion() bb::ApplicationInfo appinfo; return appinfo.version(); } + +void ApplicationUI::copyText(QByteArray text) +{ + bb::system::Clipboard clipboard; + clipboard.clear(); + clipboard.insert("text/plain", text); +} diff --git a/src/applicationui.hpp b/src/applicationui.hpp index 46d0e60..740cdfe 100644 --- a/src/applicationui.hpp +++ b/src/applicationui.hpp @@ -45,6 +45,7 @@ public: Q_INVOKABLE QVariant setting(const QString &key); Q_INVOKABLE void setSetting(const QString &key, const QString &value); Q_INVOKABLE QString appversion(); + Q_INVOKABLE void copyText(QByteArray text); private slots: void onSystemLanguageChanged(); private: diff --git a/translations/Goober.ts b/translations/Goober.ts index e0f4432..3f1c23b 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -30,47 +30,52 @@ PostItem - + Reply - + Reply All - + Add Bookmark - + Delete Bookmark - + Repost - + Delete Repost - + Quote - + View Profile - + + Copy text + + + + Delete @@ -185,22 +190,22 @@ StreamTab - + New Post - + To Top - + To Bottom - + Reload