日志内容清空功能。
This commit is contained in:
@@ -23,6 +23,7 @@ variables:
|
|||||||
# 功能新增
|
# 功能新增
|
||||||
|
|
||||||
- 对照传输支持按照类型传输。
|
- 对照传输支持按照类型传输。
|
||||||
|
- 添加日志内容清空按钮。
|
||||||
|
|
||||||
# 关于预构建包
|
# 关于预构建包
|
||||||
|
|
||||||
|
|||||||
@@ -45,17 +45,6 @@ void Compare::InitMenu()
|
|||||||
auto path = item->text();
|
auto path = item->text();
|
||||||
emit sigTryVisit(false, path);
|
emit sigTryVisit(false, path);
|
||||||
});
|
});
|
||||||
menu_->addAction(tr("添加新行"), this, [this]() {
|
|
||||||
int cnt = ui->tableWidget->rowCount();
|
|
||||||
ui->tableWidget->insertRow(cnt);
|
|
||||||
auto item1 = new QTableWidgetItem("");
|
|
||||||
auto item2 = new QTableWidgetItem("");
|
|
||||||
auto item3 = new QTableWidgetItem("");
|
|
||||||
ui->tableWidget->setItem(cnt, 0, item1);
|
|
||||||
ui->tableWidget->setItem(cnt, 1, item2);
|
|
||||||
ui->tableWidget->setItem(cnt, 2, item3);
|
|
||||||
});
|
|
||||||
menu_->addAction(tr("删除"), this, [this]() { deleteSelectedRows(); });
|
|
||||||
menu_->addAction(tr("尝试打开本地路径"), this, [this]() {
|
menu_->addAction(tr("尝试打开本地路径"), this, [this]() {
|
||||||
auto selected = ui->tableWidget->selectedItems();
|
auto selected = ui->tableWidget->selectedItems();
|
||||||
if (selected.size() != 3) {
|
if (selected.size() != 3) {
|
||||||
@@ -70,6 +59,17 @@ void Compare::InitMenu()
|
|||||||
}
|
}
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||||
});
|
});
|
||||||
|
menu_->addAction(tr("添加新行"), this, [this]() {
|
||||||
|
int cnt = ui->tableWidget->rowCount();
|
||||||
|
ui->tableWidget->insertRow(cnt);
|
||||||
|
auto item1 = new QTableWidgetItem("");
|
||||||
|
auto item2 = new QTableWidgetItem("");
|
||||||
|
auto item3 = new QTableWidgetItem("");
|
||||||
|
ui->tableWidget->setItem(cnt, 0, item1);
|
||||||
|
ui->tableWidget->setItem(cnt, 1, item2);
|
||||||
|
ui->tableWidget->setItem(cnt, 2, item3);
|
||||||
|
});
|
||||||
|
menu_->addAction(tr("删除"), this, [this]() { deleteSelectedRows(); });
|
||||||
menu_->addAction(tr("上传"), this, [this]() { TransToRight(false); });
|
menu_->addAction(tr("上传"), this, [this]() { TransToRight(false); });
|
||||||
menu_->addAction(tr("下载"), this, [this]() { TransToLeft(false); });
|
menu_->addAction(tr("下载"), this, [this]() { TransToLeft(false); });
|
||||||
menu_->addSeparator();
|
menu_->addSeparator();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QStandardItem>
|
#include <QStandardItem>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@@ -25,6 +26,15 @@ void LogPrint::InitControl()
|
|||||||
connect(styleHints_, &QStyleHints::colorSchemeChanged, this, &LogPrint::ColorChange);
|
connect(styleHints_, &QStyleHints::colorSchemeChanged, this, &LogPrint::ColorChange);
|
||||||
#endif
|
#endif
|
||||||
ui->pedText->setReadOnly(true);
|
ui->pedText->setReadOnly(true);
|
||||||
|
|
||||||
|
connect(ui->btnClear, &QPushButton::clicked, [this]() {
|
||||||
|
QMessageBox::StandardButton reply = QMessageBox::question(this, tr("确认清空"), tr("确定要清空所有内容吗?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
|
|
||||||
|
if (reply == QMessageBox::Yes) {
|
||||||
|
ui->pedText->clear();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LogPrint::now_str()
|
std::string LogPrint::now_str()
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>767</width>
|
<width>831</width>
|
||||||
<height>291</height>
|
<height>396</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -17,6 +17,33 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPlainTextEdit" name="pedText"/>
|
<widget class="QPlainTextEdit" name="pedText"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Policy::Maximum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>4000</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnClear">
|
||||||
|
<property name="text">
|
||||||
|
<string>清空</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
Reference in New Issue
Block a user