Skip to content

Commit

Permalink
Merge pull request #55 from nagua/addWaitField
Browse files Browse the repository at this point in the history
Add wait functionality
  • Loading branch information
ploth committed May 13, 2017
2 parents cceda83 + b35277f commit dff148c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 23 deletions.
42 changes: 39 additions & 3 deletions qml/pages/DetailTask.qml
Expand Up @@ -9,6 +9,7 @@ Dialog {
property string description: getJsonField("description")
property string project: getJsonField("project")
property string due: getJsonField("due")
property string wait: getJsonField("wait")

TaskExecuter {
id: executer
Expand Down Expand Up @@ -45,12 +46,12 @@ Dialog {
Item {
anchors.left: parent.left
anchors.right: parent.right
height: queryicon.height
height: delete_due_icon.height
ValueButton {
label: "Due date"
value: formatDate(due)
anchors.left: parent.left
anchors.right: queryicon.left
anchors.right: delete_due_icon.left
onClicked: {
var dialog;
if (due !== "") {
Expand All @@ -66,14 +67,46 @@ Dialog {
}
}
IconButton {
id: queryicon
id: delete_due_icon
anchors.right: parent.right
icon.source: "image://theme/icon-m-clear"
onClicked: {
due = ""
}
}
}
Item {
anchors.left: parent.left
anchors.right: parent.right
height: delete_wait_icon.height
ValueButton {
label: "Wait until"
value: formatDate(wait)
anchors.left: parent.left
anchors.right: delete_wait_icon.left
onClicked: {
var dialog;
if (wait !== "") {
var js_date = new Date(UT.convert_tdate_to_jsdate(wait));
dialog = pageStack.push(Qt.resolvedUrl("DateView.qml"), {date_value: js_date})
} else {
dialog = pageStack.push(Qt.resolvedUrl("DateView.qml"))
}
dialog.accepted.connect(function() {
console.log(dialog.date_value);
wait = UT.convert_jsdate_to_tdate(dialog.date_value);
});
}
}
IconButton {
id: delete_wait_icon
anchors.right: parent.right
icon.source: "image://theme/icon-m-clear"
onClicked: {
wait = ""
}
}
}
}

onDone: {
Expand All @@ -84,13 +117,16 @@ Dialog {
json["description"] = descriptionfield.text;
json["project"] = projectfield.text !== "" ? projectfield.text : undefined
json["due"] = due !== "" ? due : undefined
json["wait"] = wait !== "" ? wait : undefined
console.log(JSON.stringify(json));
executer.executeTask(["import", "-"], JSON.stringify(json));
}
else {
json = UT.copyItem(taskData.rawData);
json["description"] = descriptionfield.text;
json["project"] = projectfield.text !== "" ? projectfield.text : undefined
json["due"] = due !== "" ? due : undefined
json["wait"] = wait !== "" ? wait : undefined
console.log(JSON.stringify(json));
executer.executeTask(["import", "-"], JSON.stringify(json));
}
Expand Down
8 changes: 8 additions & 0 deletions qml/pages/Viewlist.qml
Expand Up @@ -71,6 +71,14 @@ Page {
section: "Smart"
}

ListElement {
lid: -1
page: "Tasklist.qml"
name: "Waiting"
query: "status:waiting"
section: "Smart"
}

ListElement {
lid: -1
page: "Tasklist.qml"
Expand Down
20 changes: 10 additions & 10 deletions translations/harbour-taskwarrior-de.ts
Expand Up @@ -4,19 +4,19 @@
<context>
<name>DetailTask</name>
<message>
<location filename="../qml/pages/DetailTask.qml" line="32"/>
<location filename="../qml/pages/DetailTask.qml" line="34"/>
<location filename="../qml/pages/DetailTask.qml" line="33"/>
<location filename="../qml/pages/DetailTask.qml" line="35"/>
<source>Description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/DetailTask.qml" line="40"/>
<location filename="../qml/pages/DetailTask.qml" line="42"/>
<location filename="../qml/pages/DetailTask.qml" line="41"/>
<location filename="../qml/pages/DetailTask.qml" line="43"/>
<source>Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/DetailTask.qml" line="114"/>
<location filename="../qml/pages/DetailTask.qml" line="150"/>
<source>no due date set</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -85,27 +85,27 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="96"/>
<location filename="../qml/pages/Viewlist.qml" line="104"/>
<source>Task views</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="109"/>
<location filename="../qml/pages/Viewlist.qml" line="117"/>
<source>Custom query</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="110"/>
<location filename="../qml/pages/Viewlist.qml" line="118"/>
<source>Enter custom query</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="150"/>
<location filename="../qml/pages/Viewlist.qml" line="158"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="164"/>
<location filename="../qml/pages/Viewlist.qml" line="172"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
Expand Down
20 changes: 10 additions & 10 deletions translations/harbour-taskwarrior.ts
Expand Up @@ -4,19 +4,19 @@
<context>
<name>DetailTask</name>
<message>
<location filename="../qml/pages/DetailTask.qml" line="32"/>
<location filename="../qml/pages/DetailTask.qml" line="34"/>
<location filename="../qml/pages/DetailTask.qml" line="33"/>
<location filename="../qml/pages/DetailTask.qml" line="35"/>
<source>Description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/DetailTask.qml" line="40"/>
<location filename="../qml/pages/DetailTask.qml" line="42"/>
<location filename="../qml/pages/DetailTask.qml" line="41"/>
<location filename="../qml/pages/DetailTask.qml" line="43"/>
<source>Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/DetailTask.qml" line="114"/>
<location filename="../qml/pages/DetailTask.qml" line="150"/>
<source>no due date set</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -85,27 +85,27 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="96"/>
<location filename="../qml/pages/Viewlist.qml" line="104"/>
<source>Task views</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="109"/>
<location filename="../qml/pages/Viewlist.qml" line="117"/>
<source>Custom query</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="110"/>
<location filename="../qml/pages/Viewlist.qml" line="118"/>
<source>Enter custom query</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="150"/>
<location filename="../qml/pages/Viewlist.qml" line="158"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Viewlist.qml" line="164"/>
<location filename="../qml/pages/Viewlist.qml" line="172"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
Expand Down

0 comments on commit dff148c

Please sign in to comment.