-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
/* | ||
* TrackRenameLineEdit.h - class TrackRenameLineEdit | ||
* | ||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alexandre Almeida <http://m374lx.users.sourceforge.net/>
* 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, your name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
|
@M374LX As @tresf said, If many people agrees 1.2.0 needs this, however, it would be fine. |
include/TrackRenameLineEdit.h
Outdated
@@ -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/> |
There was a problem hiding this comment.
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 😉
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 |
If it was in previous version of LMMS, I think it could a bug fix. I agree with @Umcaruje. |
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 ) : |
There was a problem hiding this comment.
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 ) |
There was a problem hiding this comment.
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
include/TrackRenameLineEdit.h
Outdated
{ | ||
Q_OBJECT | ||
public: | ||
TrackRenameLineEdit( QWidget * _parent ); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 ) { |
There was a problem hiding this comment.
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
Valid point. |
There was a problem hiding this 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.
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:
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. |
Oh, thanks for explaining @tresf |
@Hussam-Eddin-Alhomsi No, change from plug-in windows are applied immediately, so can't be canceled by Esc key. |
@PhysSong You're right. Didn't think about that. |
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.
With this pull request, the user is able to cancel a track rename action by pressing the Escape key.
Also renamed
rename_dlg
torenameDlg
inTrackLabelButton::rename()
so it complies to the naming conventions.Fixes #3675.