Add clear and copy buttons to the log page.

This commit is contained in:
Petr Mrázek 2014-07-11 01:50:36 +02:00
parent 24698fe85f
commit 0d4046de39
3 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -49,11 +49,34 @@
<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">