Skip to content

Commit

Permalink
Add time entry comment (#119)
Browse files Browse the repository at this point in the history
* Add time entry comment

* Time entry comment -> text to placeholder

(cherry picked from commit 1c94200)
  • Loading branch information
Lankaster authored and fathomssen committed May 24, 2018
1 parent 8bf3f90 commit 0285033
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ MainWindow::MainWindow( QApplication* parent, QString profileId )
timer_->setTimerType( Qt::VeryCoarseTimer );
timer_->setInterval( 1000 );

// Placeholders sets
qml("entryComment")->setProperty( "placeholderText", quickComment_ );

// Initially connect and update the GUI
reconnect();
refreshGui();
Expand Down Expand Up @@ -1365,6 +1368,7 @@ MainWindow::stop( bool resetTimerOnError, bool stopTimerAfterSaving, SuccessCb c
timeEntry.activity.id = activityId_;
timeEntry.hours = counter() / 3600; // Seconds to hours conversion
timeEntry.issue.id = issue_.id;
timeEntry.comment = qml("entryComment")->property("text").toString(); // Time entry comment

// Possibly save start and end time as well
const ProfileData* data = profileData();
Expand Down
3 changes: 3 additions & 0 deletions gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ class MainWindow : public Window
/// Quick pick placeholder text
const QString quickPick_ = "<Enter or select issue>";

/// Time entry placeholder text
const QString quickComment_ = "<Enter time entry comment>";

private:
/**
* @brief Add an issue to the list of recent issues
Expand Down
20 changes: 15 additions & 5 deletions gui/qml/MainWindowForm.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Item {
property alias selectIssue: selectIssue
property alias settings: settings
property alias startStop: startStop
property alias entryComment: entryComment

ToolBar {
id: toolBar
Expand Down Expand Up @@ -50,11 +51,13 @@ Item {
anchors.right: reload.left
tooltip: "Connection status"
iconSource: "qrc:/open-iconic/svg/signal.svg"
style: ButtonStyle{ background: Rectangle{
style: ButtonStyle{
background: Rectangle {
id: connectionStatusStyle
objectName: "connectionStatusStyle"
color: "transparent"
} }
}
}
}

Button {
Expand Down Expand Up @@ -168,8 +171,6 @@ Item {
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
}
}


}
}

Expand Down Expand Up @@ -219,6 +220,15 @@ Item {
model: issueStatusModel
textRole: "name"
}

TextField {
id: entryComment
width: 259
height: 30
objectName: "entryComment"
text: qsTr("")
Layout.fillWidth: true
font.pointSize: 0
}
}
}

0 comments on commit 0285033

Please sign in to comment.