mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-11-20 08:10:11 +00:00
Add clear and copy buttons to the log page.
This commit is contained in:
parent
24698fe85f
commit
0d4046de39
@ -73,6 +73,18 @@ void LogPage::on_btnPaste_clicked()
|
|||||||
delete paste;
|
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)
|
void LogPage::writeColor(QString text, const char *color, const char * background)
|
||||||
{
|
{
|
||||||
// append a paragraph
|
// append a paragraph
|
||||||
|
@ -62,6 +62,8 @@ private slots:
|
|||||||
*/
|
*/
|
||||||
void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC);
|
void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC);
|
||||||
void on_btnPaste_clicked();
|
void on_btnPaste_clicked();
|
||||||
|
void on_btnCopy_clicked();
|
||||||
|
void on_btnClear_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LogPage *ui;
|
Ui::LogPage *ui;
|
||||||
|
@ -49,11 +49,34 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnPaste">
|
<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">
|
<property name="text">
|
||||||
<string>Upload Log</string>
|
<string>Upload Log</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnCopy">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Copy the whole log into the clipboard</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&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>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user