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

Cancel track rename by pressing Escape key #3676

Merged
merged 1 commit into from
Jul 14, 2017
Merged

Conversation

M374LX
Copy link
Contributor

@M374LX M374LX commented Jul 1, 2017

With this pull request, the user is able to cancel a track rename action by pressing the Escape key.

Also renamed rename_dlg to renameDlg in TrackLabelButton::rename() so it complies to the naming conventions.

Fixes #3675.

/*
* TrackRenameLineEdit.h - class TrackRenameLineEdit
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
Copy link
Member

Choose a reason for hiding this comment

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

You should put your name here

Copy link
Contributor Author

@M374LX M374LX Jul 1, 2017

Choose a reason for hiding this comment

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

* represents the text field that appears when one
* double-clicks a track's label to rename it
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
Copy link
Member

Choose a reason for hiding this comment

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

Same here, your name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

@tresf
Copy link
Member

tresf commented Jul 1, 2017

stable-1.2 is on a feature freeze, right?

@PhysSong
Copy link
Member

PhysSong commented Jul 2, 2017

stable-1.2 is on a feature freeze, right?

@M374LX As @tresf said, stable-1.2 is on a feature freeze. You shouldn't introduce new feature into stable-1.2 unless it is related to a bug fix.
See #3662 (comment).

If many people agrees 1.2.0 needs this, however, it would be fine.

@@ -2,6 +2,7 @@
* TrackRenameLineEdit.h - class TrackRenameLineEdit
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2007 Alexandre Almeida <http://m374lx.users.sourceforge.net/>
Copy link
Member

Choose a reason for hiding this comment

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

You mistyped the date, it's 2017 now 😉

@Umcaruje
Copy link
Member

Umcaruje commented Jul 2, 2017

stable-1.2 is on a feature freeze, right?
You shouldn't introduce new feature into stable-1.2 unless it is related to a bug fix.

Well, I just checked and when renaming in LMMS 1.1.3 the escape key would close the rename dialog. To that extent, this can be considered a bug fix cause it brings back previous behaviour that was lost with the new feature. I vote this gets into stable-1.2

@PhysSong
Copy link
Member

PhysSong commented Jul 2, 2017

Well, I just checked and when renaming in LMMS 1.1.3 the escape key would close the rename dialog.

If it was in previous version of LMMS, I think it could a bug fix. I agree with @Umcaruje.

@M374LX
Copy link
Contributor Author

M374LX commented Jul 2, 2017

Also note that the rename dialog still exists in 1.2.0-rc3 when using compact track buttons and the Escape key also cancels it.




TrackRenameLineEdit::TrackRenameLineEdit( QWidget * _parent ) :
Copy link
Member

Choose a reason for hiding this comment

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

Per the coding conventions: Function parameters are not prefixed with "_" anymore

So this should be parent




void TrackRenameLineEdit::keyPressEvent( QKeyEvent * _ke )
Copy link
Member

Choose a reason for hiding this comment

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

Same as the previous comment: this should be ke

{
Q_OBJECT
public:
TrackRenameLineEdit( QWidget * _parent );
Copy link
Member

Choose a reason for hiding this comment

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

These should be updated as well.

Copy link
Member

@Umcaruje Umcaruje left a comment

Choose a reason for hiding this comment

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

Tested this out, looks like a charm, and the code looks good as well. Green light to merge from me 👍


void TrackRenameLineEdit::keyPressEvent( QKeyEvent * ke )
{
if( ke->key() == Qt::Key_Escape ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The brace should be in the next line

@tresf
Copy link
Member

tresf commented Jul 3, 2017

in LMMS 1.1.3 the escape key would close the rename dialog. To that extent, this can be considered a bug fix

Valid point.

Copy link
Member

@zonkmachine zonkmachine left a comment

Choose a reason for hiding this comment

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

Tests fine and looks good.

PS. When this is merged, please edit the commit message.

@Umcaruje
Copy link
Member

Umcaruje commented Jul 7, 2017

PS. When this is merged, please edit the commit message.

What do you mean by this?

@tresf
Copy link
Member

tresf commented Jul 7, 2017

PS. When this is merged, please edit the commit message.

What do you mean by this?

When a PR is squashed and merged it leaves a bunch of unnecessary comments in the history. This one will read:

* Create TrackRenameLineEdit.cpp

* Update TrackLabelButton.cpp

* Update TrackLabelButton.h

* Create TrackRenameLineEdit.h

* Update CMakeLists.txt

* Update TrackRenameLineEdit.cpp

* Update TrackRenameLineEdit.cpp

* Update TrackLabelButton.h

* Update TrackLabelButton.h

* Update TrackRenameLineEdit.h

* Update TrackRenameLineEdit.h

* Update TrackRenameLineEdit.cpp

* Update TrackRenameLineEdit.cpp

* Update TrackRenameLineEdit.h

* Update TrackRenameLineEdit.cpp

He's asking that the person that merges it doesn't leave the default text in there and instead cleans up the commit message on merge. This should be standard action on the merger's part but sometimes we forget to do it due to the small preview window.

@Umcaruje
Copy link
Member

Umcaruje commented Jul 7, 2017

Oh, thanks for explaining @tresf

@tresf tresf merged commit 3dfda61 into LMMS:stable-1.2 Jul 14, 2017
@Sawuare
Copy link
Member

Sawuare commented Jul 15, 2017

Instrument plug-ins are the only tracks that can be re-named from their own window, will this pull request enable the user to cancel the re-name action from the window by pressing the Esc key?
I mean from here:
image

@PhysSong
Copy link
Member

@Hussam-Eddin-Alhomsi No, change from plug-in windows are applied immediately, so can't be canceled by Esc key.

@Sawuare
Copy link
Member

Sawuare commented Jul 15, 2017

@PhysSong You're right. Didn't think about that.

sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
With this pull request, the user is able to cancel a track rename action by pressing the Escape key.

Also renamed rename_dlg to renameDlg in TrackLabelButton::rename() so it complies to the naming conventions.

Fixes LMMS#3675.
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.

7 participants