summaryrefslogtreecommitdiffstats
path: root/gui/pages
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-07-11 01:50:36 +0200
committerPetr Mrázek <peterix@gmail.com>2014-07-11 01:50:36 +0200
commit0d4046de3904e7dfd190a05218e357e93dc8d058 (patch)
tree2ea1fa692e9a9ca98faf097780cf3c0e9d32026e /gui/pages
parent24698fe85fe85e21881fa69503c68b33e97775ea (diff)
downloadMultiMC-0d4046de3904e7dfd190a05218e357e93dc8d058.tar
MultiMC-0d4046de3904e7dfd190a05218e357e93dc8d058.tar.gz
MultiMC-0d4046de3904e7dfd190a05218e357e93dc8d058.tar.lz
MultiMC-0d4046de3904e7dfd190a05218e357e93dc8d058.tar.xz
MultiMC-0d4046de3904e7dfd190a05218e357e93dc8d058.zip
Add clear and copy buttons to the log page.
Diffstat (limited to 'gui/pages')
-rw-r--r--gui/pages/LogPage.cpp12
-rw-r--r--gui/pages/LogPage.h2
-rw-r--r--gui/pages/LogPage.ui23
3 files changed, 37 insertions, 0 deletions
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,12 +49,35 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="btnPaste">
+ <property name="toolTip">
+ <string>Upload the log to paste.ee - it will stay online for a month</string>
+ </property>
<property name="text">
<string>Upload Log</string>
</property>
</widget>
</item>
<item>
+ <widget class="QPushButton" name="btnCopy">
+ <property name="toolTip">
+ <string>Copy the whole log into the clipboard</string>
+ </property>
+ <property name="text">
+ <string>&amp;Copy Log</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnClear">
+ <property name="toolTip">
+ <string>Clear the log</string>
+ </property>
+ <property name="text">
+ <string>Clear</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>