勾选除摩尔纹除网纹增加提示,保存功能去除ocr-rtf格式

This commit is contained in:
yangjiaxuan 2023-06-25 10:55:41 +08:00
parent c449b57d0c
commit b79c6b2ebd
5 changed files with 18 additions and 5 deletions

View File

@ -59,9 +59,10 @@ public:
}; };
Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) : Dialog_SaveAs::Dialog_SaveAs(bool isSaveAs, QWidget *parent) :
QDialog(parent) QDialog(parent)
, ui(new Ui::Dialog_SaveAs) , ui(new Ui::Dialog_SaveAs)
, m_isSaveAs(isSaveAs)
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
@ -88,7 +89,8 @@ Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) :
#elif !defined (x86_64) && !defined (loongarch64) #elif !defined (x86_64) && !defined (loongarch64)
filter += ";;OCR->PDF - Portable Document Format(*.pdf)"; filter += ";;OCR->PDF - Portable Document Format(*.pdf)";
filter += ";;OCR->OFD - Open Fixed-layout Document(*.ofd)"; 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 #endif
ui->fileDialog->setNameFilter(filter); ui->fileDialog->setNameFilter(filter);

View File

@ -12,7 +12,7 @@ class Dialog_SaveAs : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit Dialog_SaveAs(QWidget *parent = nullptr); explicit Dialog_SaveAs(bool isSaveAs, QWidget *parent = nullptr);
~Dialog_SaveAs(); ~Dialog_SaveAs();
void set_current_directory(const QString& dir); void set_current_directory(const QString& dir);
@ -31,6 +31,7 @@ private slots:
private: private:
Ui::Dialog_SaveAs *ui; Ui::Dialog_SaveAs *ui;
bool m_isSaveAs;
QString m_savePath; QString m_savePath;
int m_suffix; int m_suffix;
}; };

View File

@ -1968,7 +1968,7 @@ void MainWindow::on_act_save_triggered()
if(!auto_save_changes_ || auto_save_info_.path.isEmpty()) if(!auto_save_changes_ || auto_save_info_.path.isEmpty())
{ {
Dialog_SaveAs dlg(this); Dialog_SaveAs dlg(false, this);
if(savePath.length()) if(savePath.length())
{ {
int pos = savePath.lastIndexOf('/'); int pos = savePath.lastIndexOf('/');
@ -2150,7 +2150,7 @@ void MainWindow::on_act_saveAs_triggered()
return; return;
} }
Dialog_SaveAs dlg(this); Dialog_SaveAs dlg(true, this);
if (dlg.exec()) if (dlg.exec())
{ {
QString savePath = dlg.getSavePath(); QString savePath = dlg.getSavePath();

View File

@ -989,6 +989,11 @@ void hg_settingdialog::slot_checkedClicked()
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0) else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
btn_gamma_->setEnabled(checkBoxcurrentState); btn_gamma_->setEnabled(checkBoxcurrentState);
cur_scheme_->config_changed(id, (char*)&checkBoxcurrentState, sizeof(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() void hg_settingdialog::slot_string_list_comboBoxClicked()

View File

@ -1033,6 +1033,11 @@ void hg_settingdialog::slot_checkedClicked()
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0) else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
btn_gamma_->setEnabled(checkBoxcurrentState); btn_gamma_->setEnabled(checkBoxcurrentState);
cur_scheme_->config_changed(id, (char*)&checkBoxcurrentState, sizeof(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() void hg_settingdialog::slot_string_list_comboBoxClicked()