From 0d4046de3904e7dfd190a05218e357e93dc8d058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 11 Jul 2014 01:50:36 +0200 Subject: Add clear and copy buttons to the log page. --- gui/pages/LogPage.cpp | 12 ++++++++++++ gui/pages/LogPage.h | 2 ++ gui/pages/LogPage.ui | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+) (limited to 'gui') diff --git a/gui/pages/LogPage.cpp b/gui/pages/LogPage.cpp index a9e32cc2..65b84b03 100644 --- a/gui/pages/LogPage.cpp +++ b/gui/pages/LogPage.cpp @@ -73,6 +73,18 @@ void LogPage::on_btnPaste_clicked() delete paste; } +void LogPage::on_btnCopy_clicked() +{ + auto text = ui->text->toPlainText(); + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(text); +} + +void LogPage::on_btnClear_clicked() +{ + ui->text->clear(); +} + void LogPage::writeColor(QString text, const char *color, const char * background) { // append a paragraph diff --git a/gui/pages/LogPage.h b/gui/pages/LogPage.h index 7cdea2c1..933e518b 100644 --- a/gui/pages/LogPage.h +++ b/gui/pages/LogPage.h @@ -62,6 +62,8 @@ private slots: */ void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC); void on_btnPaste_clicked(); + void on_btnCopy_clicked(); + void on_btnClear_clicked(); private: Ui::LogPage *ui; diff --git a/gui/pages/LogPage.ui b/gui/pages/LogPage.ui index 00b611b5..924babdb 100644 --- a/gui/pages/LogPage.ui +++ b/gui/pages/LogPage.ui @@ -49,11 +49,34 @@ + + Upload the log to paste.ee - it will stay online for a month + Upload Log + + + + Copy the whole log into the clipboard + + + &Copy Log + + + + + + + Clear the log + + + Clear + + + -- cgit v1.2.3