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

TextMessage, RichTextEditor: accept TextMessage dialog when Ctrl-Enter is pressed. #2408

Merged
merged 1 commit into from Jul 9, 2016

Conversation

@mkrautz
Copy link
Member

commented Jul 7, 2016

A new signal, accept(), is added on RichTextEditor.
This signal is emitted when Ctrl-Enter is pressed in a RichTextEditor.

This commit rips out an old non-working event filter TextMessage
that was supposed to accept the dialog when the user pressed
Enter. However, this code didn't work anymore because the
QTextEditor widgets of RichTextEditor swallowed all the KeyPress
events.

Finally, in the TextMessage class, the accept() signal from RichTextEditor
is connected to the accept() of TextMessage's QDialog, allowing
users to accept the dialog with Ctrl-Enter.

Fixes #2294

@mkrautz mkrautz force-pushed the mkrautz:rte-ctrl-enter branch from c048c0a to 370e78c Jul 7, 2016

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Jul 7, 2016

}
}
return false;
void TextMessage::accept() {

This comment has been minimized.

Copy link
@hacst

hacst Jul 8, 2016

Member

Forgot to remove debug code?

public:
RichTextEditor(QWidget *p = NULL);
QString text();
bool isModified() const;
signals:
void accept();

This comment has been minimized.

Copy link
@hacst

hacst Jul 8, 2016

Member

Could use a comment.

@hacst

This comment has been minimized.

Copy link
Member

commented Jul 8, 2016

LGTM except comments.

@mkrautz mkrautz force-pushed the mkrautz:rte-ctrl-enter branch from 370e78c to 7117ebe Jul 9, 2016

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Jul 9, 2016

Updated. I'll land after I've tested it... Feel free to take a peek if you have time before that. :-)

static QString autoFormat(QString qsPlain);
bool bTreeMessage;
void accept() Q_DECL_OVERRIDE;

This comment has been minimized.

Copy link
@hacst

hacst Jul 9, 2016

Member

You forgot to drop that one too.

@hacst

This comment has been minimized.

Copy link
Member

commented Jul 9, 2016

Doesn't compile ;)

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Jul 9, 2016

👍

@hacst

This comment has been minimized.

Copy link
Member

commented Jul 9, 2016

Works for me on Ubuntu 16.04 if I remove the offending line btw.

TextMessage, RichTextEditor: accept TextMessage dialog when Ctrl-Ente…
…r is pressed.

A new signal, accept(), is added on RichTextEditor.
This signal is emitted when Ctrl-Enter is pressed in a RichTextEditor.

This commit rips out an old non-working event filter TextMessage
that was supposed to accept the dialog when the user pressed
Enter. However, this code didn't work anymore because the
QTextEditor widgets of RichTextEditor swallowed all the KeyPress
events.

Finally, in the TextMessage class, the accept() signal from RichTextEditor
is connected to the accept() of TextMessage's QDialog, allowing
users to accept the dialog with Ctrl-Enter.

Fixes #2294

@mkrautz mkrautz force-pushed the mkrautz:rte-ctrl-enter branch from 7117ebe to 7d2e1ef Jul 9, 2016

@mkrautz mkrautz merged commit 7d2e1ef into mumble-voip:master Jul 9, 2016

mkrautz added a commit that referenced this pull request Jul 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.