All direct interaction with the Qt clipboard is now done in either GuiClipboard or GuiSelection.
*/
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?
}
+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 << "' `"
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;
#include "qt_helpers.h"
#include "Lexer.h"
+#include "frontends/Clipboard.h"
+
#include "support/docstring.h"
#include "support/FileName.h"
#include "support/gettext.h"
void GuiLog::on_copyPB_clicked()
{
- qApp->clipboard()->setText(logTB->toPlainText());
+ theClipboard().put(fromqstr(logTB->toPlainText()));
}