~osomon/webbrowser-app/uriboni-tab-context-menu

« back to all changes in this revision

Viewing changes to src/app/Share.qml

  • Committer: Olivier Tilloy
  • Date: 2015-09-23 18:43:10 UTC
  • mfrom: (1131.26.14 webbrowser-app)
  • Revision ID: olivier.tilloy@canonical.com-20150923184310-hyff8vgwcyurj2tv
Merge the latest changes from trunk and resolve a conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import QtQuick 2.4
20
20
import Ubuntu.Components 1.3
21
21
import Ubuntu.Components.Popups 1.3
22
 
import Ubuntu.DownloadManager 0.1
23
22
import Ubuntu.Content 0.1
24
23
 
25
24
Item {
36
35
 
37
36
    Component {
38
37
        id: contentItemComponent
39
 
        ContentItem { }
 
38
        ContentItem {}
40
39
    }
41
40
 
42
 
    function share(url, name, contentType) {
43
 
        var sharePopup = PopupUtils.open(shareDialog, shareItem, {"contentType" : contentType})
44
 
        sharePopup.items.push(contentItemComponent.createObject(shareItem, {"url" : url, "name" : name}))
 
41
    QtObject {
 
42
        id: internal
 
43
 
 
44
        function share(name, url, text, contentType) {
 
45
            var sharePopup = PopupUtils.open(shareDialog, shareItem, {"contentType" : contentType})
 
46
            sharePopup.items.push(contentItemComponent.createObject(shareItem, {"name" : name, "url" : url, "text": text}))
 
47
        }
45
48
    }
46
49
 
47
50
    function shareLink(url, title) {
48
 
        share(url, title, ContentType.Links)
 
51
        internal.share(title, url, "", ContentType.Links)
49
52
    }
50
53
 
 
54
    function shareText(text) {
 
55
        internal.share("", "", text, ContentType.Text)
 
56
    }
51
57
}