From b79c6b2ebd744b590c4cafb8bcca692fbcecdf63 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Sun, 25 Jun 2023 10:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8B=BE=E9=80=89=E9=99=A4=E6=91=A9=E5=B0=94?= =?UTF-8?q?=E7=BA=B9=E9=99=A4=E7=BD=91=E7=BA=B9=E5=A2=9E=E5=8A=A0=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=8A=9F=E8=83=BD=E5=8E=BB?= =?UTF-8?q?=E9=99=A4ocr-rtf=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner2/dialog_saveas.cpp | 6 ++++-- app/scanner2/dialog_saveas.h | 3 ++- app/scanner2/mainwindow.cpp | 4 ++-- modules/saneui/hg_settingdialog.cpp | 5 +++++ modules/twainui/hg_settingdialog.cpp | 5 +++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/scanner2/dialog_saveas.cpp b/app/scanner2/dialog_saveas.cpp index fd731816..f5eaefed 100644 --- a/app/scanner2/dialog_saveas.cpp +++ b/app/scanner2/dialog_saveas.cpp @@ -59,9 +59,10 @@ public: }; -Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) : +Dialog_SaveAs::Dialog_SaveAs(bool isSaveAs, QWidget *parent) : QDialog(parent) , ui(new Ui::Dialog_SaveAs) + , m_isSaveAs(isSaveAs) { ui->setupUi(this); setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); @@ -88,7 +89,8 @@ Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) : #elif !defined (x86_64) && !defined (loongarch64) filter += ";;OCR->PDF - Portable Document Format(*.pdf)"; filter += ";;OCR->OFD - Open Fixed-layout Document(*.ofd)"; - filter += ";;OCR->RTF - Rich Text Format(*.rtf)"; + if (m_isSaveAs) + filter += ";;OCR->RTF - Rich Text Format(*.rtf)"; #endif ui->fileDialog->setNameFilter(filter); diff --git a/app/scanner2/dialog_saveas.h b/app/scanner2/dialog_saveas.h index c1e3a437..e5450eca 100644 --- a/app/scanner2/dialog_saveas.h +++ b/app/scanner2/dialog_saveas.h @@ -12,7 +12,7 @@ class Dialog_SaveAs : public QDialog Q_OBJECT public: - explicit Dialog_SaveAs(QWidget *parent = nullptr); + explicit Dialog_SaveAs(bool isSaveAs, QWidget *parent = nullptr); ~Dialog_SaveAs(); void set_current_directory(const QString& dir); @@ -31,6 +31,7 @@ private slots: private: Ui::Dialog_SaveAs *ui; + bool m_isSaveAs; QString m_savePath; int m_suffix; }; diff --git a/app/scanner2/mainwindow.cpp b/app/scanner2/mainwindow.cpp index cd7810f5..5cec28f2 100644 --- a/app/scanner2/mainwindow.cpp +++ b/app/scanner2/mainwindow.cpp @@ -1968,7 +1968,7 @@ void MainWindow::on_act_save_triggered() if(!auto_save_changes_ || auto_save_info_.path.isEmpty()) { - Dialog_SaveAs dlg(this); + Dialog_SaveAs dlg(false, this); if(savePath.length()) { int pos = savePath.lastIndexOf('/'); @@ -2150,7 +2150,7 @@ void MainWindow::on_act_saveAs_triggered() return; } - Dialog_SaveAs dlg(this); + Dialog_SaveAs dlg(true, this); if (dlg.exec()) { QString savePath = dlg.getSavePath(); diff --git a/modules/saneui/hg_settingdialog.cpp b/modules/saneui/hg_settingdialog.cpp index dfaf5ab7..12034657 100644 --- a/modules/saneui/hg_settingdialog.cpp +++ b/modules/saneui/hg_settingdialog.cpp @@ -989,6 +989,11 @@ void hg_settingdialog::slot_checkedClicked() else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0) btn_gamma_->setEnabled(checkBoxcurrentState); cur_scheme_->config_changed(id, (char*)&checkBoxcurrentState, sizeof(checkBoxcurrentState)); + + if (0 == strcmp(opt->name, SANE_STD_OPT_NAME_RID_MORR) || 0 == strcmp(opt->name, SANE_STD_OPT_NAME_RID_GRID)) + { + QMessageBox::information(this, tr("Prompt"), tr("This function may cause a decrease in the speed of drawing.")); + } } void hg_settingdialog::slot_string_list_comboBoxClicked() diff --git a/modules/twainui/hg_settingdialog.cpp b/modules/twainui/hg_settingdialog.cpp index b8e27fe7..cf445948 100644 --- a/modules/twainui/hg_settingdialog.cpp +++ b/modules/twainui/hg_settingdialog.cpp @@ -1033,6 +1033,11 @@ void hg_settingdialog::slot_checkedClicked() else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0) btn_gamma_->setEnabled(checkBoxcurrentState); cur_scheme_->config_changed(id, (char*)&checkBoxcurrentState, sizeof(checkBoxcurrentState)); + + if (0 == strcmp(opt->name, SANE_STD_OPT_NAME_RID_MORR) || 0 == strcmp(opt->name, SANE_STD_OPT_NAME_RID_GRID)) + { + QMessageBox::information(this, tr("Prompt"), tr("This function may cause a decrease in the speed of drawing.")); + } } void hg_settingdialog::slot_string_list_comboBoxClicked()