mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
GuiLog: Use GuiClipboard to put the log on the clipboard
All direct interaction with the Qt clipboard is now done in either GuiClipboard or GuiSelection.
This commit is contained in:
parent
847d1fb2f5
commit
2552c737be
@ -75,6 +75,9 @@ public:
|
||||
*/
|
||||
virtual void put(std::string const & lyx, docstring const & html, docstring const & text) = 0;
|
||||
|
||||
/// Put a general string on the system clipboard (not LyX text)
|
||||
virtual void put(std::string const & text) const = 0;
|
||||
|
||||
/// Does the clipboard contain text contents?
|
||||
virtual bool hasTextContents(TextType type = AnyTextType) const = 0;
|
||||
/// Does the clipboard contain graphics contents of a certain type?
|
||||
|
@ -413,6 +413,12 @@ docstring const GuiClipboard::getAsText(TextType type) const
|
||||
}
|
||||
|
||||
|
||||
void GuiClipboard::put(string const & text) const
|
||||
{
|
||||
qApp->clipboard()->setText(toqstr(text));
|
||||
}
|
||||
|
||||
|
||||
void GuiClipboard::put(string const & lyx, docstring const & html, docstring const & text)
|
||||
{
|
||||
LYXERR(Debug::ACTION, "GuiClipboard::put(`" << lyx << "' `"
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
std::string const getAsLyX() const;
|
||||
FileName getAsGraphics(Cursor const & cur, GraphicsType type) const;
|
||||
docstring const getAsText(TextType type) const;
|
||||
void put(std::string const & text) const;
|
||||
void put(std::string const & lyx, docstring const & html, docstring const & text);
|
||||
bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const;
|
||||
bool hasTextContents(TextType typetype = AnyTextType) const;
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "qt_helpers.h"
|
||||
#include "Lexer.h"
|
||||
|
||||
#include "frontends/Clipboard.h"
|
||||
|
||||
#include "support/docstring.h"
|
||||
#include "support/FileName.h"
|
||||
#include "support/gettext.h"
|
||||
@ -313,7 +315,7 @@ void GuiLog::getContents(ostream & ss) const
|
||||
|
||||
void GuiLog::on_copyPB_clicked()
|
||||
{
|
||||
qApp->clipboard()->setText(logTB->toPlainText());
|
||||
theClipboard().put(fromqstr(logTB->toPlainText()));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user