Conversation
|
Woohoo, it's working! Can't tell if the code okay, as well. Last recordings duration is visible for a second when new recording is started. Now that I tried it a few times, I think it might be handy to have a all-in-one widget, actually a dynamic button that handles [Recording],toggle_recording, displays [custom_text][recording duration] when recording and would clear when the recording is stopped. Text could be defined with If at all, it won't happen in this PR. The Label is useful already. |
| } else if (nodeName == "Time") { | ||
| result = wrapWidget(parseLabelWidget<WTime>(node)); | ||
| } else if (nodeName == "RecordingDuration") { | ||
| // result = wrapWidget(parseLabelWidget<WRecordingDuration>(node)); |
| } | ||
|
|
||
| void WRecordingDuration::refreshLabelText(QString durationRecorded) { | ||
| m_durationRecordedStr = durationRecorded; |
There was a problem hiding this comment.
m_durationRecordedStr is unused
There was a problem hiding this comment.
Will change. As I learned durationRecorded can be passed to setText directly if it shouldn't be stored for any other purpose.
Also I would like to clear the label when recording is stopped, so it doesn't show last duration when started again.
|
I have added some minor comments. The rest LGTM. |
|
Okay, done. New widget |
|
I will add info to the wiki when this is merged. |
| void WRecordingDuration::refreshLabelText(QString durationRecorded) { | ||
| m_durationRecordedStr = durationRecorded; | ||
| setText(m_durationRecordedStr); | ||
| void WRecordingDuration::clearLabel(bool toggle) { |
There was a problem hiding this comment.
Th function name is misleading. It is more like "clearLebleIfInactive()" or "slotRecordingActivChanged()"
There was a problem hiding this comment.
because it's not really cleared, just cleared from rec duration. okay.
slotReccordingInactive?
|
LGTM. Thank you. |
|
Cool! Added the info to the wiki. |
| connect(m_pRecordingManager, SIGNAL(durationRecorded(QString)), | ||
| this, SLOT(refreshLabel(QString))); | ||
| connect(m_pRecordingManager, SIGNAL(isRecording(bool)), | ||
| this, SLOT(slotReccordingInactive(bool))); |
There was a problem hiding this comment.
Typo? slotReccordingInactive -> slotRecordingInactive
| void WRecordingDuration::slotReccordingInactive(bool isRecording) { | ||
| // If recording is stopped/inactive | ||
| if(!isRecording) { | ||
| setText("--:--"); |
There was a problem hiding this comment.
Our other text widgets provide translatable tooltips, can you add one for <RecordingDuration> too?
|
|
||
| private slots: | ||
| void refreshLabel(QString); | ||
| void slotReccordingInactive(bool); |
| @@ -0,0 +1,28 @@ | |||
| // wrecordingduration.h | |||
| // WRecordingDuration is a widget showing the duration of running recoding | |||
There was a problem hiding this comment.
Typo? recoding-> recording
| this, SLOT(slotReccordingInactive(bool))); | ||
| } | ||
|
|
||
| void WRecordingDuration::slotReccordingInactive(bool isRecording) { |
There was a problem hiding this comment.
Correct, same typo as above, that's why it compiles fine...
Noticed it doesn't have a tooltip when adding wiki info.
Will add one and correct the typos.
|
Thanks for working on this. It serves as a nice timer to let me know how long my set has gone. :) |
[messed up #1220 with local production branch, so I start over here]
I'd like to introduce a simple label widget called with
<RecordingDuration>.It displays the duration of a running recording in the skin, apart from Recording section in Library.
A while ago I filed a wishlist bug but noone with more C++ experience & spare time picked this up so far.
Newbie that I am, I couldn't make something from the hints @daschuer posted there, so I tried to learn from WTime widget (simple widget) and dlgrecording.cpp (queries recordingmanager for recDurationString).