diff --git a/assets/translations/en_US.ts b/assets/translations/en_US.ts
index 9cc61a922..013e3bf8f 100644
--- a/assets/translations/en_US.ts
+++ b/assets/translations/en_US.ts
@@ -45,47 +45,47 @@
BinaryToolsConfigView
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -100,83 +100,83 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -782,6 +782,11 @@ The dap port is not ready, please retry.
DetailWidget
+
+
+
+
+
@@ -2371,14 +2376,21 @@ storage: %2
-
+
+
+
+
+
+
+
+
@@ -2412,14 +2424,14 @@ storage: %2
QPushButton
-
+
-
+
diff --git a/assets/translations/zh_CN.ts b/assets/translations/zh_CN.ts
index 8330ef517..99aaf70fd 100644
--- a/assets/translations/zh_CN.ts
+++ b/assets/translations/zh_CN.ts
@@ -45,47 +45,47 @@
BinaryToolsConfigView
-
+
添加
-
+
删除
-
+
重命名
-
+
组合
-
+
运行配置:
-
+
命令组合:
-
+
使用组合命令
-
+
警告
-
+
请选择工作目录。
@@ -100,83 +100,83 @@
命令名称:
-
+
删除配置?
-
+
确定要删除<b>%1</b>吗?
-
+
重命名...
-
+
<b>%1</b>的新名称:
-
+
命令:
-
+
工具参数:
-
+
请输入参数.
-
+
可执行文件:
-
-
+
+
浏览...
-
+
工作目录:
-
+
当前命令的配置环境。
-
+
添加(&A)
-
+
删除(&D)
-
+
重置(&R)
-
+
选择执行路径
-
+
选择工作目录
@@ -806,6 +806,11 @@ dap端口未就绪,请重试。
DetailWidget
+
+
+
+ 浏览...
+
@@ -2406,14 +2411,21 @@ storage: %2
-
- 确定
+
+
+ 是
+
取消
+
+
+
+ 否
+
@@ -2447,14 +2459,14 @@ storage: %2
QPushButton
-
+
确定
-
+
取消
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000000000..a2d7fc972
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+deepin-unioncode (1.1.19) unstable; urgency=medium
+
+ *
+
+ -- MAINTAINER Fri, 01 Sep 2023 14:49:15 +0800
diff --git a/src/common/dialog/contextdialog.cpp b/src/common/dialog/contextdialog.cpp
index 44a6f6731..0657168d7 100644
--- a/src/common/dialog/contextdialog.cpp
+++ b/src/common/dialog/contextdialog.cpp
@@ -25,8 +25,8 @@ void ContextDialog::okCancel(QString text, QString title,
messageBox.setWindowTitle(title);
messageBox.setText(text);
messageBox.setIcon(icon);
- messageBox.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel);
- messageBox.button(QMessageBox::Ok)->setText(QObject::tr("OK"));
+ messageBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+ messageBox.button(QMessageBox::Ok)->setText(QObject::tr("Ok"));
messageBox.button(QMessageBox::Cancel)->setText(QObject::tr("Cancel"));
if (okCallBack)
QObject::connect(messageBox.button(QMessageBox::Ok),
@@ -49,13 +49,38 @@ void ContextDialog::ok(QString text, QString title,
messageBox.setText(text);
messageBox.setIcon(icon);
messageBox.setStandardButtons(QMessageBox::Ok);
- messageBox.button(QMessageBox::Ok)->setText(QObject::tr("OK"));
+ messageBox.button(QMessageBox::Ok)->setText(QObject::tr("Ok"));
if (okCallBack)
QObject::connect(messageBox.button(QMessageBox::Ok),
&QAbstractButton::clicked, okCallBack);
messageBox.exec();
}
+void ContextDialog::question(QString text, QString title, QMessageBox::Icon icon, std::function okCallBack, std::function noCallBack, std::function cancelCallBack)
+{
+ if (text.isEmpty())
+ return;
+
+ QMessageBox messageBox;
+ messageBox.setWindowTitle(title);
+ messageBox.setText(text);
+ messageBox.setIcon(icon);
+ messageBox.setStandardButtons(QMessageBox::Ok | QMessageBox::No | QMessageBox::Cancel);
+ messageBox.button(QMessageBox::Ok)->setText(QObject::tr("Ok"));
+ messageBox.button(QMessageBox::No)->setText(QObject::tr("No"));
+ messageBox.button(QMessageBox::Cancel)->setText(QObject::tr("Cancel"));
+ if (okCallBack)
+ QObject::connect(messageBox.button(QMessageBox::Ok),
+ &QAbstractButton::clicked, okCallBack);
+ if (noCallBack)
+ QObject::connect(messageBox.button(QMessageBox::No),
+ &QAbstractButton::clicked, noCallBack);
+ if (cancelCallBack)
+ QObject::connect(messageBox.button(QMessageBox::Cancel),
+ &QAbstractButton::clicked, cancelCallBack);
+ messageBox.exec();
+}
+
void ContextDialog::singleChoice(QSet infos,
QString windowTitle, QString choiceTitle,
std::function okCallBack,
diff --git a/src/common/dialog/contextdialog.h b/src/common/dialog/contextdialog.h
index 0d1e0281f..5e819e377 100644
--- a/src/common/dialog/contextdialog.h
+++ b/src/common/dialog/contextdialog.h
@@ -31,6 +31,13 @@ class ContextDialog final
QMessageBox::Icon icon = QMessageBox::Critical,
std::function okCallBack = nullptr);
+ static void question(QString text,
+ QString title = "Question",
+ QMessageBox::Icon icon = QMessageBox::Question,
+ std::function okCallBack = nullptr,
+ std::function noCallBack = nullptr,
+ std::function cancelCallBack = nullptr);
+
static void singleChoice(QSet infos,
QString windowTitle = "Infos Selection",
QString choiceTitle = "Single Choice",
diff --git a/src/plugins/binarytools/mainframe/binarytoolsconfigview.cpp b/src/plugins/binarytools/mainframe/binarytoolsconfigview.cpp
index a5f044ff6..933ee97f5 100644
--- a/src/plugins/binarytools/mainframe/binarytoolsconfigview.cpp
+++ b/src/plugins/binarytools/mainframe/binarytoolsconfigview.cpp
@@ -8,6 +8,7 @@
#include "common/widget/collapsewidget.h"
#include "common/util/custompaths.h"
+#include "common/dialog/contextdialog.h"
#include
#include
@@ -237,7 +238,7 @@ void BinaryToolsConfigView::currentConfigChanged(const QString &text)
void BinaryToolsConfigView::initializeCombo()
{
QString fileName = CustomPaths::global(CustomPaths::Flags::Configures)
- + QDir::separator() + QString("binarytool.support");
+ + QDir::separator() + QString("binarytool.support");
QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
QByteArray data = file.readAll();
@@ -285,10 +286,9 @@ void BinaryToolsConfigView::addCompatConfig()
return;
bool ok;
- QInputDialog inputDialog;
- QString name = inputDialog.getText(this, tr("Add new command"),
- tr("New command name:"),
- QLineEdit::Normal, "", &ok);
+ QString name = QInputDialog::getText(this, tr("Add new command"),
+ tr("New command name:"),
+ QLineEdit::Normal, "", &ok);
if (!ok)
return;
@@ -297,12 +297,24 @@ void BinaryToolsConfigView::addCompatConfig()
void BinaryToolsConfigView::deleteCompatConfig()
{
- QMessageBox msgBox(QMessageBox::Question, tr("Delete Configuration?"),
- tr("Do you really want to delete the command %1?").arg(d->nameLabel->text()),
- QMessageBox::Yes|QMessageBox::No, this);
- msgBox.setDefaultButton(QMessageBox::No);
- msgBox.setEscapeButton(QMessageBox::No);
- if (msgBox.exec() == QMessageBox::No)
+ bool doSave = false, doCancle = false;
+ auto ok = [&](bool checked) {
+ Q_UNUSED(checked);
+ doSave = true;
+ };
+ auto no = [&](bool checked) {
+ Q_UNUSED(checked);
+ doSave = false;
+ };
+ auto cancel = [&](bool checked) {
+ Q_UNUSED(checked);
+ };
+
+ ContextDialog::question(tr("Delete Configuration?"),
+ tr("Do you really want to delete the command %1?").arg(d->nameLabel->text()),
+ QMessageBox::Question,
+ ok, no, cancel);
+ if (!doSave || doCancle)
return;
QStringList allCommand = qvariant_cast(d->settings->getValue(ALL_COMMAND));
@@ -321,12 +333,11 @@ void BinaryToolsConfigView::deleteCompatConfig()
void BinaryToolsConfigView::renameCompatConfig()
{
bool ok;
- QInputDialog inputDialog;
- QString name = inputDialog.getText(this, tr("Rename..."),
- tr("New name for command %1:").
- arg(d->runComandCombo->currentText()),
- QLineEdit::Normal,
- d->runComandCombo->currentText(), &ok);
+ QString name = QInputDialog::getText(this, tr("Rename..."),
+ tr("New name for command %1:").
+ arg(d->runComandCombo->currentText()),
+ QLineEdit::Normal,
+ d->runComandCombo->currentText(), &ok);
if (!ok)
return;
diff --git a/src/plugins/template/wizard/detailwidget.cpp b/src/plugins/template/wizard/detailwidget.cpp
index c1583d2bc..0fc83a64a 100644
--- a/src/plugins/template/wizard/detailwidget.cpp
+++ b/src/plugins/template/wizard/detailwidget.cpp
@@ -70,7 +70,7 @@ DetailWidget::DetailWidget(const QString &templatePath, QWidget *parent)
lineEdit->setFixedSize(300, 30);
lineEdit->setReadOnly(true);
- QPushButton *browse = new QPushButton("Browse...");
+ QPushButton *browse = new QPushButton(tr("Browse..."));
browse->setFixedSize(100, 30);
hLayout->addWidget(browse, 0, Qt::AlignRight);
hLayout->setStretchFactor(browse, 1);