[-]
[+]
|
Changed |
_service:tar_git:harbour-maira.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/kimmoli/maira.git</param>
<param name="branch">master</param>
- <param name="revision">75e2f0c9e79bcdc66355236703c00dcb09c8c720</param>
+ <param name="revision">0d870a43d0996c5e25b11b6ebf554d66d553089d</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/maira.pro
^
|
@@ -82,7 +82,12 @@
icons/86x86/apps/harbour-maira.png \
icons/108x108/apps/harbour-maira.png \
icons/128x128/apps/harbour-maira.png \
- icons/256x256/apps/harbour-maira.png
+ icons/256x256/apps/harbour-maira.png \
+ qml/components/MainListDelegate.qml \
+ qml/components/CommentDelegate.qml \
+ qml/components/AttachmentDelegate.qml \
+ qml/components/CreatedByItem.qml \
+ qml/components/LinkDelegate.qml
SOURCES += \
src/main.cpp \
|
[-]
[+]
|
Added |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/components/AttachmentDelegate.qml
^
|
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015-2017 kimmoli <kimmo.lindholm@eke.fi>
+ * All rights reserved.
+ *
+ * This file is part of Maira
+ *
+ * You may use this file under the terms of BSD license
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+BackgroundItem
+{
+ id: delegate
+ visible: index <3
+ width: column.width
+ height: Theme.itemSizeExtraSmall
+ clip: true
+
+ onClicked:
+ {
+ pageStack.push(Qt.resolvedUrl("../pages/AttachmentView.qml"), {attachment: attachments.get(index)})
+ }
+
+ Column
+ {
+ x: Theme.paddingSmall
+ width: parent.width - 2*Theme.paddingSmall
+
+ Label
+ {
+ text: filename
+ width: parent.width
+ height: Theme.itemSizeExtraSmall/2
+ font.pixelSize: Theme.fontSizeSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ elide: Text.ElideRight
+ }
+
+ CreatedByItem {}
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/components/CreatedByItem.qml
^
|
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015-2017 kimmoli <kimmo.lindholm@eke.fi>
+ * All rights reserved.
+ *
+ * This file is part of Maira
+ *
+ * You may use this file under the terms of BSD license
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Item
+{
+ width: parent.width
+ height: Theme.itemSizeExtraSmall/2
+ Label
+ {
+ text: author
+ anchors.left: parent.left
+ font.pixelSize: Theme.fontSizeExtraSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
+ }
+ Label
+ {
+ text: Qt.formatDateTime(new Date(created), "hh:mm dd.MM.yyyy")
+ anchors.right: parent.right
+ font.pixelSize: Theme.fontSizeExtraSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/components/LinkDelegate.qml
^
|
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015-2017 kimmoli <kimmo.lindholm@eke.fi>
+ * All rights reserved.
+ *
+ * This file is part of Maira
+ *
+ * You may use this file under the terms of BSD license
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+BackgroundItem
+{
+ id: delegate
+ visible: opacity > 0.0
+ opacity: index < showLinks ? 1.0 : 0.0
+ Behavior on opacity { FadeAnimation {} }
+ width: column.width
+ height: Theme.itemSizeExtraSmall
+ clip: true
+
+ Column
+ {
+ anchors.verticalCenter: parent.verticalCenter
+ x: Theme.paddingSmall
+ width: parent.width - 2*Theme.paddingSmall
+
+ Label
+ {
+ text: linktype + " " + linkedissuekey
+ height: Theme.itemSizeExtraSmall/2
+ width: parent.width
+ font.pixelSize: Theme.fontSizeSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ elide: Text.ElideRight
+ }
+ Label
+ {
+ text: linkedissuesummary
+ height: Theme.itemSizeExtraSmall/2
+ width: parent.width
+ font.pixelSize: Theme.fontSizeExtraSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ elide: Text.ElideRight
+ }
+ }
+
+ onClicked: followlink(linkedissuekey)
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/components/MainListDelegate.qml
^
|
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2015-2017 kimmoli <kimmo.lindholm@eke.fi>
+ * All rights reserved.
+ *
+ * This file is part of Maira
+ *
+ * You may use this file under the terms of BSD license
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+BackgroundItem
+{
+ id: delegate
+ width: column.width
+ height: 4 * Theme.paddingSmall + 3 * Theme.itemSizeExtraSmall / 2
+
+ onClicked:
+ {
+ fetchissue(key, function()
+ {
+ pageStack.push(Qt.resolvedUrl("../pages/IssueView.qml"))
+ })
+ }
+
+ Item
+ {
+ anchors.fill: parent
+ anchors.margins: Theme.paddingSmall
+
+ Row
+ {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ spacing: Theme.paddingSmall
+ height: Theme.itemSizeExtraSmall / 2
+ Image
+ {
+ source: issueicon
+ width: parent.height
+ height: parent.height
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Label
+ {
+ text: key
+ anchors.verticalCenter: parent.verticalCenter
+ color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ }
+ }
+
+ Label
+ {
+ text: since
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.rightMargin: Theme.itemSizeExtraSmall / 2 + Theme.paddingMedium
+ font.pixelSize: Theme.fontSizeExtraSmall
+ font.italic: true
+ color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
+ }
+
+ Label
+ {
+ text: summary
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.rightMargin: Theme.itemSizeExtraSmall / 2 + Theme.paddingMedium
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: Theme.fontSizeSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
+ elide: Text.ElideRight
+ }
+
+ Label
+ {
+ text: assignee
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeSmall
+ color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
+ elide: Text.ElideRight
+ }
+
+ Column
+ {
+ anchors.top: parent.top
+ anchors.right: parent.right
+ spacing: Theme.paddingSmall
+ Image
+ {
+ source: priorityicon
+ width: Theme.itemSizeExtraSmall / 2
+ height: width
+ }
+ Image
+ {
+ source: statusicon
+ width: Theme.itemSizeExtraSmall / 2
+ height: width
+ }
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/maira.qml
^
|
@@ -626,7 +626,7 @@
onDownloadFailed:
{
bi.stop()
- msgbox.showError("Download failed")
+ msgbox.showError(errorMsg)
}
}
@@ -643,7 +643,7 @@
onUploadFailed:
{
bi.stop()
- msgbox.showError("Upload failed")
+ msgbox.showError(errorMsg)
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/pages/IssueView.qml
^
|
@@ -211,17 +211,30 @@
{
text: "Description"
}
- Label
+ SilicaFlickable
{
+ id: descriptionFlick
+ clip: true
x: Theme.paddingSmall
width: parent.width - 2* Theme.paddingSmall
- wrapMode: Text.Wrap
- textFormat: Text.RichText
- font.pixelSize: Theme.fontSizeSmall
- text: rendereddescriptiontext.length > 0 ? rendereddescriptiontext : currentissue.fields.description
- onLinkActivated: openLink(link)
+ height: descriptionText.height
+ contentWidth: descriptionText.contentWidth
+ contentHeight: descriptionText.height
+
+ Label
+ {
+ id: descriptionText
+ text: rendereddescriptiontext.length > 0 ? rendereddescriptiontext : currentissue.fields.description
+ width: column.width - 2* Theme.paddingSmall
+ wrapMode: Text.Wrap
+ textFormat: Text.RichText
+ font.pixelSize: Theme.fontSizeSmall
+ onLinkActivated: openLink(link)
+ }
}
+ HorizontalScrollDecorator { flickable: descriptionFlick }
+
SectionHeader
{
visible: currentissue.fields.issuelinks.length > 0
@@ -231,41 +244,7 @@
Repeater
{
model: links
- delegate: BackgroundItem
- {
- visible: opacity > 0.0
- opacity: index < showLinks ? 1.0 : 0.0
- Behavior on opacity { FadeAnimation {} }
- width: column.width
- height: Theme.itemSizeExtraSmall
- clip: true
-
- Column
- {
- anchors.verticalCenter: parent.verticalCenter
- x: Theme.paddingSmall
- width: parent.width - 2*Theme.paddingSmall
-
- Label
- {
- height: Theme.itemSizeExtraSmall/2
- width: parent.width
- font.pixelSize: Theme.fontSizeSmall
- text: linktype + " " + linkedissuekey
- elide: Text.ElideRight
- }
- Label
- {
- height: Theme.itemSizeExtraSmall/2
- width: parent.width
- font.pixelSize: Theme.fontSizeExtraSmall
- text: linkedissuesummary
- elide: Text.ElideRight
- }
- }
-
- onClicked: followlink(linkedissuekey)
- }
+ delegate: LinkDelegate {}
}
NumberAnimation
@@ -309,46 +288,7 @@
Repeater
{
model: attachments
- delegate: BackgroundItem
- {
- visible: index <3
- width: column.width
- height: Theme.itemSizeExtraSmall
- clip: true
-
- onClicked: pageStack.push(Qt.resolvedUrl("AttachmentView.qml"), {attachment: attachments.get(index)})
-
- Column
- {
- x: Theme.paddingSmall
- width: parent.width - 2*Theme.paddingSmall
- Item
- {
- width: parent.width
- height: Theme.itemSizeExtraSmall/2
- Label
- {
- anchors.left: parent.left
- font.pixelSize: Theme.fontSizeSmall
- text: author
- }
- Label
- {
- anchors.right: parent.right
- font.pixelSize: Theme.fontSizeSmall
- text: Qt.formatDateTime(new Date(created), "hh:mm dd.MM.yyyy")
- }
- }
- Label
- {
- width: parent.width
- height: Theme.itemSizeExtraSmall/2
- font.pixelSize: Theme.fontSizeExtraSmall
- elide: Text.ElideRight
- text: filename
- }
- }
- }
+ delegate: AttachmentDelegate {}
}
BackgroundItem
{
@@ -377,46 +317,7 @@
Repeater
{
model: comments
- delegate: BackgroundItem
- {
- width: column.width
- height: Theme.itemSizeExtraSmall
- onClicked:
- {
- var cv = pageStack.push(Qt.resolvedUrl("CommentView.qml"), {comment: comments.get(index)})
- }
-
- Column
- {
- x: Theme.paddingSmall
- width: parent.width - 2*Theme.paddingSmall
- Item
- {
- width: parent.width
- height: Theme.itemSizeExtraSmall/2
- Label
- {
- anchors.left: parent.left
- font.pixelSize: Theme.fontSizeSmall
- text: author
- }
- Label
- {
- anchors.right: parent.right
- font.pixelSize: Theme.fontSizeSmall
- text: Qt.formatDateTime(new Date(created), "hh:mm dd.MM.yyyy")
- }
- }
- Label
- {
- width: parent.width
- height: Theme.itemSizeExtraSmall/2
- font.pixelSize: Theme.fontSizeExtraSmall
- elide: Text.ElideRight
- text: body.replace(/[\n\r]/g, ' ')
- }
- }
- }
+ delegate: CommentDelegate {}
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/qml/pages/MainPage.qml
^
|
@@ -77,236 +77,171 @@
contentHeight: column.height + Theme.paddingLarge
- Column
+ Column
{
id: column
width: page.width
spacing: Theme.paddingLarge
-
- PageHeader
- {
- id: pageHeader
- title: serverinfo !== undefined ? serverinfo.serverTitle : "Maira"
- }
- Item
+
+ Column
{
- width: parent.width
- height: jql.height + acl.height
- InverseMouseArea
+ width: page.width
+ spacing: Theme.paddingLarge
+
+ PageHeader
+ {
+ id: pageHeader
+ title: serverinfo !== undefined ? serverinfo.serverTitle : "Maira"
+ }
+ Item
{
- anchors.fill: parent
- onClickedOutside: jql.focus = false
+ width: parent.width
+ height: jql.height + acl.height
- TextArea
+ InverseMouseArea
{
- id: jql
+ anchors.fill: parent
+ onClickedOutside: jql.focus = false
- label: "JQL"
- placeholderText: label
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- width: parent.width - 2*Theme.paddingSmall
- height: Math.max(implicitHeight, buttoncol.height)
- wrapMode: Text.WrapAnywhere
- inputMethodHints: Qt.ImhUrlCharactersOnly
- text: jqlstring.value
- textRightMargin: Theme.paddingSmall + buttoncol.width
- EnterKey.iconSource: "image://theme/icon-m-search"
- focusOutBehavior: FocusBehavior.KeepFocus
- EnterKey.onClicked:
- {
- focus = false
- jqlstring.value = jql.text
- if (loggedin)
- jqlsearch(0)
- else
- msgbox.showError("You're not logged in")
- }
+ TextArea
+ {
+ id: jql
+
+ label: "JQL"
+ placeholderText: label
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ width: parent.width - 2*Theme.paddingSmall
+ height: Math.max(implicitHeight, buttoncol.height)
+ wrapMode: Text.WrapAnywhere
+ inputMethodHints: Qt.ImhUrlCharactersOnly
+ text: jqlstring.value
+ textRightMargin: Theme.paddingSmall + buttoncol.width
+ EnterKey.iconSource: "image://theme/icon-m-search"
+ focusOutBehavior: FocusBehavior.KeepFocus
+ EnterKey.onClicked:
+ {
+ focus = false
+ jqlstring.value = jql.text
+ if (loggedin)
+ jqlsearch(0)
+ else
+ msgbox.showError("You're not logged in")
+ }
- onTextChanged:
- {
- text = text.replace(/\n/g, "")
- processacl()
- }
+ onTextChanged:
+ {
+ text = text.replace(/\n/g, "")
+ processacl()
+ }
- property bool aclchange: false
- function processacl()
- {
- if (loggedin && !aclchange)
+ property bool aclchange: false
+ function processacl()
{
- var currentword = text.slice(0, cursorPosition).split(" ").filter(function(e) {return e.length > 0}).pop()
- acdata.filter(currentword, text.charAt(cursorPosition-1) === " ")
+ if (loggedin && !aclchange)
+ {
+ var currentword = text.slice(0, cursorPosition).split(" ").filter(function(e) {return e.length > 0}).pop()
+ acdata.filter(currentword, text.charAt(cursorPosition-1) === " ")
+ }
}
+
}
+ AutoCompleteJQL
+ {
+ id: acl
+ enabled: loggedin
+ anchors.left: parent.left
+ anchors.top: jql.bottom
+ width: parent.width
+ height: Theme.itemSizeSmall
+ clip: true
+ onSelected:
+ {
+ var tmp = jql.text.slice(0, jql.cursorPosition).split(" ")
+ var rem = jql.text.slice(jql.cursorPosition)
+ tmp.pop()
+ tmp.push(name + " ")
+ var beg = tmp.join(" ")
+ jql.aclchange = true
+ jql.text = beg + rem
+ jql.cursorPosition = beg.length
+ jql.aclchange = false
+ jql.processacl()
+ jql.forceActiveFocus()
+ }
+ }
}
- AutoCompleteJQL
+ Column
{
- id: acl
- enabled: loggedin
- anchors.left: parent.left
- anchors.top: jql.bottom
- width: parent.width
- height: Theme.itemSizeSmall
- clip: true
+ id: buttoncol
+ anchors.right: parent.right
+ anchors.rightMargin: Theme.paddingSmall
+ anchors.top: parent.top
- onSelected:
+ IconButton
{
- var tmp = jql.text.slice(0, jql.cursorPosition).split(" ")
- var rem = jql.text.slice(jql.cursorPosition)
- tmp.pop()
- tmp.push(name + " ")
- var beg = tmp.join(" ")
- jql.aclchange = true
- jql.text = beg + rem
- jql.cursorPosition = beg.length
- jql.aclchange = false
- jql.processacl()
- jql.forceActiveFocus()
+ icon.source: "image://theme/icon-m-favorite"
+ onClicked:
+ {
+ var f = pageStack.push(Qt.resolvedUrl("FilterSelector.qml"), {newjql: jql.text})
+ f.filterselected.connect(function()
+ {
+ jqlstring.value = f.newjql
+ jqlsearch(0)
+ })
+ }
}
- }
- }
- Column
- {
- id: buttoncol
- anchors.right: parent.right
- anchors.rightMargin: Theme.paddingSmall
- anchors.top: parent.top
- IconButton
- {
- icon.source: "image://theme/icon-m-favorite"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/src/filedownloader.cpp
^
|
@@ -51,7 +51,11 @@
if (httpstatus == 200)
{
QFile file(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + "/" + m_filename);
- file.open(QIODevice::WriteOnly);
+ if (!file.open(QIODevice::WriteOnly))
+ {
+ emit downloadFailed("Download failed, can't create file");
+ return;
+ }
file.write(m_DownloadedData);
file.close();
emit downloadSuccess();
@@ -59,6 +63,6 @@
}
else
{
- emit downloadFailed();
+ emit downloadFailed(QString("Download failed, error %1").arg(httpstatus));
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/src/filedownloader.h
^
|
@@ -31,7 +31,7 @@
signals:
void downloadStarted();
void downloadSuccess();
- void downloadFailed();
+ void downloadFailed(QString errorMsg);
private slots:
void fileDownloaded();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/src/fileuploader.cpp
^
|
@@ -21,7 +21,7 @@
{
emit uploadStarted();
- QString filename = source.toString(QUrl::RemoveScheme);
+ QString filename = source.toLocalFile();
qDebug() << "url" << url << "filename" << filename;
@@ -34,7 +34,12 @@
filePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"file\"; filename=\"" + filename.split("/").last() + "\""));
QFile *file = new QFile(filename);
- file->open(QIODevice::ReadOnly);
+ if (!file->open(QIODevice::ReadOnly))
+ {
+ emit uploadFailed("Upload failed, can't read file");
+ return;
+ }
+
filePart.setBodyDevice(file);
file->setParent(multiPart);
@@ -60,7 +65,7 @@
if (httpstatus == 200)
emit uploadSuccess();
else
- emit uploadFailed();
+ emit uploadFailed(QString("Upload failed, error %1").arg(httpstatus));
pReply->deleteLater();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-maira-0.1.11.tar.bz2/src/fileuploader.h
^
|
@@ -27,7 +27,7 @@
signals:
void uploadStarted();
void uploadSuccess();
- void uploadFailed();
+ void uploadFailed(QString errorMsg);
private slots:
void fileUploaded();
|