Mercurial > octave
changeset 24625:be37df6e1fb4
always enable paste action in windows (bug #52361)
* main-window.cc (clipboard_has_changed): no more clipboard-mode parameter;
(construct_edit_menu): using dataChanged signal from the clipboard instead
of changed signal; always enable paste action in windows since the signals
indicating a change of the clipboard are not working
* main-window.h: slot clipboard_has_changed wihtout parameter
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sat, 20 Jan 2018 09:29:07 +0100 |
parents | ce2eb28e0a6d |
children | 58dd3c2d5db8 |
files | libgui/src/main-window.cc libgui/src/main-window.h |
diffstat | 2 files changed, 20 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc Fri Jan 19 19:59:28 2018 -0800 +++ b/libgui/src/main-window.cc Sat Jan 20 09:29:07 2018 +0100 @@ -1666,20 +1666,17 @@ } void -main_window::clipboard_has_changed (QClipboard::Mode cp_mode) +main_window::clipboard_has_changed (void) { - if (cp_mode == QClipboard::Clipboard) + if (m_clipboard->text ().isEmpty ()) { - if (m_clipboard->text ().isEmpty ()) - { - m_paste_action->setEnabled (false); - m_clear_clipboard_action->setEnabled (false); - } - else - { - m_paste_action->setEnabled (true); - m_clear_clipboard_action->setEnabled (true); - } + m_paste_action->setEnabled (false); + m_clear_clipboard_action->setEnabled (false); + } + else + { + m_paste_action->setEnabled (true); + m_clear_clipboard_action->setEnabled (true); } } @@ -2265,9 +2262,16 @@ connect (m_clear_workspace_action, SIGNAL (triggered (void)), this, SLOT (handle_clear_workspace_request (void))); - connect (m_clipboard, SIGNAL (changed (QClipboard::Mode)), - this, SLOT (clipboard_has_changed (QClipboard::Mode))); - clipboard_has_changed (QClipboard::Clipboard); + connect (m_clipboard, SIGNAL (dataChanged (void)), + this, SLOT (clipboard_has_changed (void))); + clipboard_has_changed (); +#if defined (Q_OS_WIN32) + // Always enable paste action (unreliable clipboard signals in windows) + // FIXME: This has to be removed, when the clipboards signals in windows + // are working again + m_paste_action->setEnabled (true); + m_clear_clipboard_action->setEnabled (true); +#endif connect (m_preferences_action, SIGNAL (triggered (void)), this, SLOT (process_settings_dialog_request (void)));