Skip to content

Cancel track rename by pressing Escape key#3676

Merged
tresf merged 1 commit into
LMMS:stable-1.2from
M374LX:stable-1.2
Jul 14, 2017
Merged

Cancel track rename by pressing Escape key#3676
tresf merged 1 commit into
LMMS:stable-1.2from
M374LX:stable-1.2

Conversation

@M374LX

@M374LX M374LX commented Jul 1, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@M374LX M374LX Jul 1, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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

tresf commented Jul 1, 2017

Copy link
Copy Markdown
Member

stable-1.2 is on a feature freeze, right?

@PhysSong

PhysSong commented Jul 2, 2017

Copy link
Copy Markdown
Member

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.

Comment thread include/TrackRenameLineEdit.h Outdated
* 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
Copy Markdown
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

Umcaruje commented Jul 2, 2017

Copy link
Copy Markdown
Member

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

PhysSong commented Jul 2, 2017

Copy link
Copy Markdown
Member

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

M374LX commented Jul 2, 2017

Copy link
Copy Markdown
Contributor Author

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.

Comment thread src/gui/widgets/TrackRenameLineEdit.cpp Outdated



TrackRenameLineEdit::TrackRenameLineEdit( QWidget * _parent ) :

Copy link
Copy Markdown
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

Comment thread src/gui/widgets/TrackRenameLineEdit.cpp Outdated



void TrackRenameLineEdit::keyPressEvent( QKeyEvent * _ke )

Copy link
Copy Markdown
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

Comment thread include/TrackRenameLineEdit.h Outdated
{
Q_OBJECT
public:
TrackRenameLineEdit( QWidget * _parent );

Copy link
Copy Markdown
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.

@Umcaruje Umcaruje left a comment

Copy link
Copy Markdown
Member

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 👍

Comment thread src/gui/widgets/TrackRenameLineEdit.cpp Outdated

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

Copy link
Copy Markdown
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

tresf commented Jul 3, 2017

Copy link
Copy Markdown
Member

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.

@zonkmachine zonkmachine left a comment

Copy link
Copy Markdown
Contributor

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

Umcaruje commented Jul 7, 2017

Copy link
Copy Markdown
Member

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

What do you mean by this?

@tresf

tresf commented Jul 7, 2017

Copy link
Copy Markdown
Member

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

Umcaruje commented Jul 7, 2017

Copy link
Copy Markdown
Member

Oh, thanks for explaining @tresf

@tresf tresf merged commit 3dfda61 into LMMS:stable-1.2 Jul 14, 2017
@husamalhomsi

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

@husamalhomsi

Copy link
Copy Markdown
Member

@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