Merge pull request #1183 from flylai/dev-log-copy-selected

feat: support copying selected logs
This commit is contained in:
flylai 2020-12-24 15:07:29 +08:00 committed by GitHub
commit 88a2b51da3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 38 deletions

View File

@ -192,6 +192,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), QvStateObject("Ma
//
// Actions for right click the log text browser
//
logRCM_Menu->addAction(action_RCM_CopySelected);
logRCM_Menu->addAction(action_RCM_CopyRecentLogs);
logRCM_Menu->addSeparator();
logRCM_Menu->addAction(action_RCM_SwitchCoreLog);
@ -200,6 +201,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), QvStateObject("Ma
connect(action_RCM_SwitchCoreLog, &QAction::triggered, [this] { masterLogBrowser->setDocument(vCoreLogDocument); });
connect(action_RCM_SwitchQv2rayLog, &QAction::triggered, [this] { masterLogBrowser->setDocument(qvLogDocument); });
connect(action_RCM_CopyRecentLogs, &QAction::triggered, this, &MainWindow::Action_CopyRecentLogs);
connect(action_RCM_CopySelected, &QAction::triggered, masterLogBrowser, &QTextBrowser::copy);
//
speedChartWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(speedChartWidget, &QWidget::customContextMenuRequested, [this](const QPoint &) { graphWidgetMenu->popup(QCursor::pos()); });

View File

@ -151,6 +151,7 @@ class MainWindow
DECL_ACTION(logRCM_Menu, action_RCM_SwitchCoreLog);
DECL_ACTION(logRCM_Menu, action_RCM_SwitchQv2rayLog);
DECL_ACTION(logRCM_Menu, action_RCM_CopyRecentLogs);
DECL_ACTION(logRCM_Menu, action_RCM_CopySelected);
#undef DECL_ACTION
QTextDocument *vCoreLogDocument = new QTextDocument(this);

View File

@ -233,4 +233,5 @@ void MainWindow::UpdateActionTranslations()
//
action_RCM_CopyGraph->setText(tr("Copy graph as image."));
action_RCM_CopyRecentLogs->setText(tr("Copy latest logs."));
action_RCM_CopySelected->setText(tr("Copy selected."));
}

View File

@ -1080,6 +1080,10 @@ This entry is ignored by V2Ray core when using DoH servers.</source>
<source>Removing Connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy selected.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OutboundEditor</name>