Skip to content

Commit 0285033

Browse files
Lankasterfathomssen
authored andcommitted
Add time entry comment (#119)
* Add time entry comment * Time entry comment -> text to placeholder (cherry picked from commit 1c94200)
1 parent 8bf3f90 commit 0285033

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

gui/MainWindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ MainWindow::MainWindow( QApplication* parent, QString profileId )
7171
timer_->setTimerType( Qt::VeryCoarseTimer );
7272
timer_->setInterval( 1000 );
7373

74+
// Placeholders sets
75+
qml("entryComment")->setProperty( "placeholderText", quickComment_ );
76+
7477
// Initially connect and update the GUI
7578
reconnect();
7679
refreshGui();
@@ -1365,6 +1368,7 @@ MainWindow::stop( bool resetTimerOnError, bool stopTimerAfterSaving, SuccessCb c
13651368
timeEntry.activity.id = activityId_;
13661369
timeEntry.hours = counter() / 3600; // Seconds to hours conversion
13671370
timeEntry.issue.id = issue_.id;
1371+
timeEntry.comment = qml("entryComment")->property("text").toString(); // Time entry comment
13681372

13691373
// Possibly save start and end time as well
13701374
const ProfileData* data = profileData();

gui/MainWindow.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ class MainWindow : public Window
127127
/// Quick pick placeholder text
128128
const QString quickPick_ = "<Enter or select issue>";
129129

130+
/// Time entry placeholder text
131+
const QString quickComment_ = "<Enter time entry comment>";
132+
130133
private:
131134
/**
132135
* @brief Add an issue to the list of recent issues

gui/qml/MainWindowForm.ui.qml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Item {
2020
property alias selectIssue: selectIssue
2121
property alias settings: settings
2222
property alias startStop: startStop
23+
property alias entryComment: entryComment
2324

2425
ToolBar {
2526
id: toolBar
@@ -50,11 +51,13 @@ Item {
5051
anchors.right: reload.left
5152
tooltip: "Connection status"
5253
iconSource: "qrc:/open-iconic/svg/signal.svg"
53-
style: ButtonStyle{ background: Rectangle{
54+
style: ButtonStyle{
55+
background: Rectangle {
5456
id: connectionStatusStyle
5557
objectName: "connectionStatusStyle"
5658
color: "transparent"
57-
} }
59+
}
60+
}
5861
}
5962

6063
Button {
@@ -168,8 +171,6 @@ Item {
168171
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
169172
}
170173
}
171-
172-
173174
}
174175
}
175176

@@ -219,6 +220,15 @@ Item {
219220
model: issueStatusModel
220221
textRole: "name"
221222
}
223+
224+
TextField {
225+
id: entryComment
226+
width: 259
227+
height: 30
228+
objectName: "entryComment"
229+
text: qsTr("")
230+
Layout.fillWidth: true
231+
font.pointSize: 0
232+
}
222233
}
223234
}
224-

0 commit comments

Comments
 (0)