From cee72c5360feca2e2cf1b4c2d0c67760cf22b1e6 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Sat, 26 Aug 2023 15:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=EF=BC=9A=E5=9B=BD=E4=BA=A7?= =?UTF-8?q?=E9=BE=99=E8=8A=AF=E5=92=8Cx86=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E7=9A=84bug=EF=BC=8C=E8=B0=83=E6=95=B4sane=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/twainui/dialog_progress_ui.cpp | 22 ++++++++++++++++++++-- modules/twainui/hg_settingdialog.cpp | 18 ++++++++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/modules/twainui/dialog_progress_ui.cpp b/modules/twainui/dialog_progress_ui.cpp index 716916bc..0f451b7b 100644 --- a/modules/twainui/dialog_progress_ui.cpp +++ b/modules/twainui/dialog_progress_ui.cpp @@ -148,14 +148,32 @@ void Dialog_progress_ui::FuncNotify(int event, void *msg, int flag) { case SANE_EVENT_WORKING: { - QString finishInfo(tr("Start scan...")); + QString finishInfo; + if (msg != nullptr) + { + finishInfo = (char*)msg; + } + else + { + finishInfo = tr("Start scan..."); + } + emit p->scan_status(finishInfo, true); } break; case SANE_EVENT_SCAN_FINISHED: { - QString finishInfo(tr("Scan completed")); + QString finishInfo; + if (msg != nullptr) + { + finishInfo = (char*)msg; + } + else + { + finishInfo = tr("Scan completed"); + } + emit p->scan_finish(flag, finishInfo); } break; diff --git a/modules/twainui/hg_settingdialog.cpp b/modules/twainui/hg_settingdialog.cpp index bc8ba9f6..c6846097 100644 --- a/modules/twainui/hg_settingdialog.cpp +++ b/modules/twainui/hg_settingdialog.cpp @@ -317,6 +317,12 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) bool enabled = false; QHBoxLayout *hLayout = new QHBoxLayout(); int width = 180; + int width2 = 100; + +#if defined (loongarch64) + width2 = 120; +#endif + std::vector schemes; std::string cur_schm(cur_cfg_->get_current_scheme_name()); @@ -347,7 +353,7 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) m_pbtn_addNew = new QPushButton(this); m_pbtn_addNew->setText(tr("Add new")); - m_pbtn_addNew->setFixedWidth(100); + m_pbtn_addNew->setFixedWidth(width2); layout->addWidget(m_pbtn_addNew); connect(m_pbtn_addNew, SIGNAL(clicked(bool)), this, SLOT(slot_pushButton_scheme_management())); @@ -355,7 +361,7 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) m_pbtn_Save = new QPushButton(this); m_pbtn_Save->setText(tr("Save")); - m_pbtn_Save->setFixedWidth(100); + m_pbtn_Save->setFixedWidth(width2); layout->addWidget(m_pbtn_Save); connect(m_pbtn_Save, SIGNAL(clicked(bool)), this, SLOT(slot_pushButton_scheme_management())); @@ -364,7 +370,7 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) m_deleteCur = new QPushButton(this); m_deleteCur->setText(tr("Delete")); m_deleteCur->setEnabled(enabled); - m_deleteCur->setFixedWidth(100); + m_deleteCur->setFixedWidth(width2); layout->addWidget(m_deleteCur); connect(m_deleteCur, SIGNAL(clicked(bool)), this, SLOT(slot_pushButton_scheme_management())); @@ -373,7 +379,7 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) m_deleteAll = new QPushButton(this); m_deleteAll->setText(tr("Delete all")); m_deleteAll->setEnabled(enabled); - m_deleteAll->setFixedWidth(100); + m_deleteAll->setFixedWidth(width2); layout->addWidget(m_deleteAll); connect(m_deleteAll, SIGNAL(clicked(bool)), this, SLOT(slot_pushButton_scheme_management())); @@ -387,7 +393,7 @@ void hg_settingdialog::create_scheme_management_ui(QVBoxLayout* layout) m_pbtn_restore = new QPushButton(this); m_pbtn_restore->setText(tr("Restore")); - m_pbtn_restore->setFixedWidth(100); + m_pbtn_restore->setFixedWidth(width2); layout->addWidget(m_pbtn_restore); connect(m_pbtn_restore, SIGNAL(clicked(bool)), this, SLOT(slot_pushButton_scheme_management())); @@ -1887,7 +1893,7 @@ void hg_settingdialog::slot_buttonAboutClicked() QMessageBox msg(QMessageBox::NoIcon, title, content, QMessageBox::Ok, this); - msg.setStyleSheet("QLabel{""min-width: 260px;""}"); + msg.setStyleSheet("QLabel{""min-width: 280px;""}"); msg.exec(); }