Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to show both elapsed and remaining time simultaneously #1216

Merged
merged 9 commits into from
Mar 29, 2017

Conversation

Be-ing
Copy link
Contributor

@Be-ing Be-ing commented Mar 13, 2017

Add a third option for WNumberPos to show both the elapsed and remaining time on a deck. When this is chosen, the format is "elapsed time / remaining time".

@@ -482,6 +482,16 @@
</attribute>
</widget>
</item>
<item row="9" column="3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introduction of a 3rd column throws off the positioning/aligning of the existing options. Instead, like with the tooltips options, use a horizontal layout for the time display options.

if (dPosSecondsElapsed >= 0.0) {
setText(mixxx::Duration::formatSeconds(
dPosSecondsElapsed, mixxx::Duration::Precision::CENTISECONDS)
% QLatin1String(" / -") %
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me the / separator is unneeded.
Depending on the font, i found it harder to read with it, we already have the -in front of the remaining time display as separator, so 3 spaces and - should do it.

@esbrandt
Copy link
Contributor

esbrandt commented Mar 14, 2017

Thanks for adding a long standing request.
Related https://bugs.launchpad.net/mixxx/+bug/1081456

Edit: track_time tooltip needs update because of the added feature.

@esbrandt
Copy link
Contributor

LGTM

@@ -70,9 +70,14 @@ DlgPrefControls::DlgPrefControls(QWidget * parent, MixxxMainWindow * mixxx,
if (!m_pConfig->exists(ConfigKey("[Controls]","PositionDisplay")))
m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"),ConfigValue(0));

if (m_pConfig->getValueString(ConfigKey("[Controls]", "PositionDisplay")).toInt() == 1) {
int positionDisplayType = m_pConfig->getValueString(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can combine this line and the line above by

int positionDisplayType = m_pConfig->getValue(ConfigKey("[Controls]", "PositionDisplay"), 0);

if (m_pConfig->getValueString(ConfigKey("[Controls]", "PositionDisplay")).toInt() == 1) {
int positionDisplayType = m_pConfig->getValueString(
ConfigKey("[Controls]", "PositionDisplay")).toInt();
if (positionDisplayType == 1) {
radioButtonRemaining->setChecked(true);
m_pControlTrackTimeDisplay->set(1.0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use constexpr for these magic numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how a constexpr would help here. Do you mean an enum class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot convert a enum class to a double without a cast.
The idea was to define
constexpr double k... = 1.0
to get around this.

Everything that replaces the 1.0 by a readable text works for me here, I do not care much about type safety here.
You already use a private enum class inside the widget with the same values. Maybe you find common solution for both.

@MK-42
Copy link
Contributor

MK-42 commented Mar 26, 2017

Tested on Shade, Deere and LateNight, LGTM

@daschuer
Copy link
Member

Clang build fails:

In file included from src/preferences/dialog/dlgprefcontrols.cpp:27:
src/preferences/dialog/dlgprefcontrols.h:34:11: error: redefinition of 'Duration' as different kind of symbol
namespace Duration {
          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/MacTypes.h:286:41: note: previous definition is here
typedef SInt32                          Duration;
                                        ^

@Be-ing
Copy link
Contributor Author

Be-ing commented Mar 27, 2017

Build fixed on all platforms.

@Be-ing
Copy link
Contributor Author

Be-ing commented Mar 28, 2017

Ready for merge?

@@ -70,12 +70,23 @@ DlgPrefControls::DlgPrefControls(QWidget * parent, MixxxMainWindow * mixxx,
if (!m_pConfig->exists(ConfigKey("[Controls]","PositionDisplay")))
m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"),ConfigValue(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should also use the TrackTime::DisplayMode class.
This value does not match the value set in slotResetToDefaults()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a common issue whenever someone works on a preferences dialog. Perhaps as part of @Pegasus-RPG's refactoring of the preferences we can come up with a better solution.

@daschuer
Copy link
Member

Thank you for working on that (and all the other stuff)
LGTM

@daschuer daschuer merged commit 23f8a08 into mixxxdj:master Mar 29, 2017
@Be-ing Be-ing deleted the elapsed_and_remaining_time branch March 29, 2017 20:34
@esbrandt esbrandt mentioned this pull request Jun 24, 2017
37 tasks
esbrandt added a commit to esbrandt/manual that referenced this pull request Jun 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants