diff --git a/data/kylin-scanner.desktop b/data/kylin-scanner.desktop index 3b4f69a973341774320d3e73bec636fff49ed50b..6bfa0118f9aa8eaef1457452b2d53207b77d4e32 100644 --- a/data/kylin-scanner.desktop +++ b/data/kylin-scanner.desktop @@ -8,9 +8,10 @@ GenericName[bo_CN]=བཤར་འབེབས། Comment=An interface-friendly scanner, which could be also used as one-click beautification, intelligent correction and text recognition tools. Comment[zh_CN]=一款可用于普通扫描、一键美化、智能纠偏和文字识别的界面友好扫描仪软件。 Comment[bo_CN]=སྤྱིར་བཏང་གི་བཤར་འབེབས།མཐེབ་གཅིག་མཛེས་བཟོ།རིག་ནུས་ཡོ་འཁྱོག་དང་ཡི་གེ་དབྱེ་འབྱེད་་ལྡན་པའི་མཚམས་ངོས་མཛའ་མཐུན་གྱི་བཤར་འབེབས་མཉེན་ཆས་ཤིག -Exec=kylin-scanner %U +Exec=/usr/bin/kylin-scanner %U Icon=kylin-scanner Type=Application Categories=Application;Graphics;RasterGraphics;Scanning;OCR;2DGraphics; Keywords=scannerfrontend StartupNotify=true +X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_plasma_activation_feedback,org_kde_kwin_keystate,org_kde_kwin_fake_input,zkde_screencast_unstable_v1 \ No newline at end of file diff --git a/data/kylin-scanner/kylin-scanner.png b/data/kylin-scanner/kylin-scanner.png old mode 100644 new mode 100755 index 4bcab5ae1d8635ad8045e43fa15ff1f4ba3ccedc..b3c7e95c44ee6704672ad653c3a7f93212db5c8e Binary files a/data/kylin-scanner/kylin-scanner.png and b/data/kylin-scanner/kylin-scanner.png differ diff --git a/debian/changelog b/debian/changelog index 1a887d43f7cce39eed44394c8cab56c91e518970..c0a63c88074de32bb432a4537f73fdf5e96233fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,26 @@ +kylin-scanner (3.2.0.6) v101; urgency=medium + + * BUG号:#127014 【wayland】【扫描】识别到扫描仪可扫描状态下"开始扫描"按钮未变为蓝色,需要将鼠标移上去变亮 + #127002 【wayland】【扫描】连接扫描仪后点击开始扫描,提示"扫描失败请检查当前扫描仪连接..."(低概率在10分钟后能够扫描成功) + * 需求号:无 + * 其他改动说明:wayland部分适配:双标题栏;窗口不居中 + * 其他改动影响域:无 + + -- zhaoyuzhen Mon, 18 Jul 2022 10:39:12 +0800 + +kylin-scanner (3.2.0.5) v101; urgency=medium + + * BUG号:#109782 【用户手册】【摄像头】用户手册首页摄像头的图标icon需替换为寻光主题图标 + #120922 【UI】【扫描】浅色模式下,未连接扫描时,”连接扫描仪“按钮字体颜色为白色看不清 + #118765 【藏语】【扫描】藏文系统扫描部分界面显示为英文 + #126288 【扫描】扫描-关于中没有版本号 + #126519 【扫描】浅色主题下,开始扫描按钮不是蓝色的 + * 需求号:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- zhaoyuzhen Mon, 27 Jun 2022 09:40:56 +0800 + kylin-scanner (3.2.0.4-ok2) yangtze; urgency=medium * Fix build error diff --git a/debian/control b/debian/control index efe2e87067f9cba0eea3adf219176587f5fa3ae1..689f2968c6e658b0d70da9bca2f5f766f78875a1 100644 --- a/debian/control +++ b/debian/control @@ -4,31 +4,32 @@ Priority: optional Maintainer: Kylin Team Uploaders: handsome_feng Build-Depends: debhelper-compat (=12), - libfreeimage-dev, - libfreeimageplus-dev, - libgif-dev, + libqt5svg5-dev, libglib2.0-dev, + libx11-dev, libgsettings-qt-dev, - libkf5windowsystem-dev, - libkysdk-base-dev, - libkysdk-kabase-dev, - liblept5, - libleptonica-dev, - libopencv-dev, - libpng-dev, - libqt5svg5-dev, - libqt5x11extras5-dev, libsane-dev, + libopencv-dev, libstb-dev, + libgif-dev, + libpng-dev, + libfreeimage-dev, + libfreeimageplus-dev, libtesseract-dev, - libukui-log4qt-dev, - libx11-dev, - pkgconf, - policykit-1, + libleptonica-dev, + liblept5, qt5-qmake, qtbase5-dev, qtbase5-dev-tools, - qttools5-dev-tools + qttools5-dev-tools, + libkf5windowsystem-dev, + libqt5x11extras5-dev, + pkgconf, + libukui-log4qt-dev, + policykit-1, + libkysdk-kabase-dev, + libkysdk-base-dev, + libkysdk-applications-dev Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ubuntukylin/kylin-scanner @@ -37,10 +38,10 @@ Vcs-Browser: https://github.com/ubuntukylin/kylin-scanner Package: kylin-scanner Architecture: any -Depends: tesseract-ocr, +Depends: ${misc:Depends}, + tesseract-ocr, tesseract-ocr-chi-sim, tesseract-ocr-eng, - ${misc:Depends}, ${shlibs:Depends} Description: Scanning utility based on SANE Kylin-scanner can scan according to the resolution, size and color diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db8f88b823b6a7eabf55e203658739da122..0000000000000000000000000000000000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/kabase/Qt/log.hpp b/kabase/Qt/log.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a0ccd88150e1bf1fac3c47bf1750150749d015d6 --- /dev/null +++ b/kabase/Qt/log.hpp @@ -0,0 +1,53 @@ +/* + * Log 类中实现了 Qt 的日志注册函数并且调用了 kysdk-log 库中的日志模块,调用方需要链接 Qt库 及 kysdk-log 库 + */ + +#ifndef LOG_HPP_ +#define LOG_HPP_ + +#include +#include +#include +#include + +namespace kabase +{ + +class Log +{ +public: + Log() = default; + ~Log() = default; + + static void logOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) + { + QByteArray localMsg = msg.toLocal8Bit(); + const char *message = localMsg.constData(); + const char *file = context.file ? context.file : ""; + const char *function = context.function ? context.function : ""; + + switch (type) { + case QtDebugMsg: + klog_debug("%s (%s:%u,%s)\n", message, file, context.line, function); + break; + case QtInfoMsg: + klog_info("%s (%s:%u,%s)\n", message, file, context.line, function); + break; + case QtWarningMsg: + klog_warning("%s (%s:%u,%s)\n", message, file, context.line, function); + break; + case QtCriticalMsg: + klog_err("%s (%s:%u,%s)\n", message, file, context.line, function); + break; + case QtFatalMsg: + klog_emerg("%s (%s:%u,%s)\n", message, file, context.line, function); + break; + } + + return; + }; +}; + +} + +#endif \ No newline at end of file diff --git a/kabase/Qt/windowmanage.hpp b/kabase/Qt/windowmanage.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6894e24eb14de37000a3c1116925e5de0022dbbb --- /dev/null +++ b/kabase/Qt/windowmanage.hpp @@ -0,0 +1,88 @@ +#ifndef QT_WINDOWMANAGE_HPP_ +#define QT_WINDOWMANAGE_HPP_ + +/* + * windowmanage 类使用了 kysdk-waylandhelper 库,使用时需要链接 kysdk-waylandhelper 库 + */ + +#include + +#include +#include +#include +#include + +#include +#include + +namespace kabase +{ + +class WindowManage : public QObject +{ + Q_OBJECT +public: + WindowManage() = default; + ~WindowManage() = default; + + static void setScalingProperties(void) + { + #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + #endif + + #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); + #endif + + return; + }; + + static void setMiddleOfScreen(QWidget *w) { + int sw = QGuiApplication::primaryScreen()->availableGeometry().width(); + int sh = QGuiApplication::primaryScreen()->availableGeometry().height(); + kdk::WindowManager::setGeometry(w->windowHandle(), QRect((sw - w->width()) / 2, (sh - w->height()) / 2, w->width(), w->height())); + + return; + }; + + static void removeHeader(QWidget *w) { + kdk::UkuiStyleHelper::self()->removeHeader(w); + + return; + }; + + /* id 的初始值必须为 0 */ + static void getWindowId(quint32 *id) { + connect(kdk::WindowManager::self(), &kdk::WindowManager::windowAdded, [=](const kdk::WindowId &windowId) { + if (getpid() == (int)kdk::WindowManager::getPid(windowId) && *id == 0) { + *id = windowId.toLongLong(); + } + }); + + return; + }; + + static void keepWindowAbove(const quint32 id) { + kdk::WindowManager::keepWindowAbove(id); + + return; + }; + + static void activateWindow(const quint32 id) { + kdk::WindowManager::activateWindow(id); + + return; + } +}; + +} + +/* + * wayland 下使用窗口置顶接口 desktop 文件需要注意以下两点 + * 1. 增加字段: X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_plasma_activation_feedback,org_kde_kwin_keystate,org_kde_kwin_fake_input,zkde_screencast_unstable_v1 + * 2. Exec字段需要为绝对路径并且不能携带参数 + */ + +#endif \ No newline at end of file diff --git a/kabase/buriedpoint.hpp b/kabase/buriedpoint.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1413571fe586d89e96c8ad29b98c1fe12596fa1a --- /dev/null +++ b/kabase/buriedpoint.hpp @@ -0,0 +1,306 @@ +/* + * BuriedPoint 类使用了 kysdk-log 和 kysdk-diagnostics 库,调用方需要链接 kysdk-log 和 kysdk-diagnostics 库 + */ + +#ifndef BURIEDPOINT_HPP_ +#define BURIEDPOINT_HPP_ + +#include +#include +#include +#include + +#include +#include + +#include "utils.hpp" + +namespace kabase +{ + +class BuriedPoint +{ +public: + BuriedPoint() = default; + ~BuriedPoint() = default; + + /* 埋点类型 */ + enum BuriedPointType { + FunctionType = 0, /* 功能性打点 */ + PerformanceType, /* 性能型打点 */ + StabilityType, /* 稳定型打点 */ + TestType /* 测试预留 */ + }; + + /* 点位 */ + /* 规则说明 */ + /* 0x 00 0 000 + * | | | + * 应用标识 类型标识 点位 + */ + enum PT { + KylinIpmsgNicknameModify = 0x010001, /* 昵称修改 */ + KylinIpmsgOpenSaveDir = 0x010002, /* 打开文件保存目录(主界面入口) */ + KylinIpmsgMainSearch = 0x010003, /* 主界面搜索 */ + KylinIpmsgHistorySearch = 0x010004, /* 历史记录搜索 */ + KylinIpmsgSetTop = 0x010005, /* 设置置顶 */ + KylinIpmsgModifyFriendNotes = 0x010006, /* 修改好友备注 */ + KylinIpmsgViewInformation = 0x010007, /* 查看资料 */ + KylinIpmsgChangeDir = 0x010008, /* 更改目录 */ + KylinIpmsgCleanCache = 0x010009, /* 清空缓存 */ + KylinIpmsgClearChatRecord = 0x010010, /* 清空聊天记录 */ + KylinIpmsgClearSingleChatRecord = 0x010011, /* 清空单人聊天记录 */ + KylinIpmsgDeleteRecord = 0x010012, /* 删除记录 */ + KylinIpmsgBatchDelete = 0x010013, /* 批量删除 */ + KylinIpmsgSendMessage = 0x010014, /* 发送消息 */ + KylinIpmsgSendFiles = 0x010015, /* 发送文件 */ + KylinIpmsgSendDir = 0x010016, /* 发送目录 */ + KylinIpmsgSendScreenshot = 0x010017, /* 发送截屏 */ + KylinIpmsgResend = 0x010018, /* 重新发送 */ + KylinIpmsgCopy = 0x010019, /* 复制 */ + KylinIpmsgOpen = 0x010020, /* 打开 */ + KylinIpmsgOpenDir = 0x010021, /* 打开目录 */ + KylinIpmsgSaveAs = 0x010022, /* 另存为 */ + KylinIpmsgTray = 0x010023, /* 托盘 */ + + KylinFontViewInstallFont = 0x020001, /* 安装字体 */ + KylinFontViewUninstallFont = 0x020002, /* 卸载字体 */ + KylinFontViewSearchFont = 0x020003, /* 搜索字体 */ + KylinFontViewApplyFont = 0x020004, /* 应用字体 */ + KylinFontViewExportFont = 0x020005, /* 导出字体 */ + KylinFontViewCollectionFont = 0x020006, /* 收藏字体 */ + KylinFontViewCancelCollectionFont = 0x020007, /* 取消收藏字体 */ + KylinFontViewFontInformation = 0x020008, /* 字体信息 */ + KylinFontViewCopywritingChange = 0x020009, /* 文案更改 */ + KylinFontViewFontSizeChange = 0x020010, /* 预览字号调整 */ + + KylinCalaulatorStandardMode = 0x030001, /* 标准模式 */ + KylinCalaulatorScientificMode = 0x030002, /* 科学模式 */ + KylinCalaulatorRateMode = 0x030003, /* 汇率模式 */ + KylinCalaulatorProgrammerMode = 0x030004, /* 程序员模式 */ + + KylinWeatherCollection = 0x040001, /* 收藏 */ + KylinWeatherChangeCity = 0x040002, /* 切换城市 */ + KylinWeatherCitySearch = 0x040003, /* 城市搜索 */ + KylinWeatherFullScreen = 0x040004, /* 全屏 */ + + KylinPhotoViewerOpenPicture = 0x050001, /* 打开图片 */ + KylinPhotoViewerSwitchPicture = 0x050002, /* 切换图片 */ + KylinPhotoViewerFlip = 0x050003, /* 翻转 */ + KylinPhotoViewerRotate = 0x050004, /* 旋转 */ + KylinPhotoViewerAddPicture = 0x050005, /* 添加图片 */ + KylinPhotoViewerZoomInandOut = 0x050006, /* 放大缩小 */ + KylinPhotoViewerPictureDetails = 0x050007, /* 图片详情 */ + KylinPhotoViewerCutting = 0x050008, /* 裁剪 */ + KylinPhotoViewerCoyp = 0x050009, /* 复制 */ + KylinPhotoViewerPrint = 0x050010, /* 打印 */ + KylinPhotoViewerDelete = 0x050011, /* 删除 */ + KylinPhotoViewerSaveAs = 0x050012, /* 另存为 */ + KylinPhotoViewerRename = 0x050013, /* 重命名 */ + KylinPhotoViewerSetAsDesktopWallpaper = 0x050014, /* 设置为桌面壁纸 */ + KylinPhotoViewerShowInFolder = 0x050015, /* 在文件夹中显示 */ + KylinPhotoViewerPicturePreview = 0x050016, /* 图片预览 */ + KylinPhotoViewerCurrentPointZoom = 0x050017, /* 当前点缩放 */ + + KylinServiceSupportFileUpload = 0x060001, /* 文件上传 */ + KylinServiceSupportVideoape = 0x060002, /* 录像 */ + KylinServiceSupportFileCopy = 0x060003, /* 文件拷贝 */ + KylinServiceSupportJumpOfficicalWebsite = 0x060004, /* 跳转官网主页 */ + KylinServiceSupportJumpOnlineService = 0x060005, /* 跳转在线客服 */ + + KylinPrinterManuallyInstallPrinter = 0x070001, /* 手动安装打印机 */ + KylinPrinterSetResolution = 0x070002, /* 设置分辨率 */ + KylinPrinterSetPaperSize = 0x070003, /* 设置纸张大小 */ + KylinPrinterSetPaperType = 0x070004, /* 设置纸张类型 */ + KylinPrinterSetCationSource = 0x070005, /* 设置纸盒来源 */ + KylinPrinterSetDuplexPrint = 0x070006, /* 设置双面打印 */ + KylinPrinterSetInkType = 0x070007, /* 设置墨水类型 */ + KylinPrinterADDRemovePrinter = 0x070008, /* 添加删除打印机 */ + KylinPrinterSetShareStartup = 0x070009, /* 设置共享启动 */ + KylinPrintTestPage = 0x070010, /* 打印测试页 */ + KylinPrinterCancelPrintJob = 0x070011, /* 取消打印任务 */ + KylinPrinterDeletePrintJob = 0x070012, /* 删除打印任务 */ + KylinPrinterRePrint = 0x070013, /* 重新打印 */ + KylinPrinterManualyModifyDrive = 0x070014, /* 手动修改驱动 */ + KylinPrinterRename = 0x070015, /* 重命名 */ + + KylinRecorderRecording = 0x080001, /* 录音 */ + KylinRecorderPlayPause = 0x080002, /* 播放暂停 */ + KylinRecorderClip = 0x080003, /* 剪辑 */ + KylinRecorderSign = 0x080004, /* 标记 */ + KylinRecorderDelete = 0x080005, /* 删除 */ + KylinRecorderBluetoothRecord = 0x080006, /* 蓝牙录音 */ + KylinRecorderSaveAs = 0x080007, /* 另存为 */ + KylinRecorderOpenFileLocation = 0x080008, /* 打开文件位置 */ + KylinRecorderTopicSwitch = 0x080009, /* 主题切换 */ + + KylinCameraPreviewMonitor = 0x090001, /* 预览画面 */ + KylinCameraSingleShot = 0x090002, /* 单拍 */ + KylinCameraContinuousShot = 0x090003, /* 连拍 */ + KylinCameraDelay = 0x090004, /* 延时拍照 */ + KylinCameraVideotape = 0x090005, /* 录像 */ + KylinCameraCameraSelection = 0x090006, /* 摄像头选用 */ + KylinCameraResolutionSelection = 0x090007, /* 分辨率选用 */ + KylinCameraVideoFormatSelection = 0x090008, /* 视频格式选用 */ + KylinCameraPictureFormatSelection = 0x090009, /* 图片格式选用 */ + KylinCameraChangeSavePath = 0x090010, /* 更改存储路径 */ + KylinCameraThumbnail = 0x090011, /* 缩略图 */ + KylinCameraGridLine = 0x090012, /* 网格线 */ + KylinCameraMirrorFun = 0x090013, /* 镜像功能 */ + + KylinNotebookOrderList = 0x100001, /* 有序列表 */ + KylinNotebookUnorderList = 0x100002, /* 无序列表 */ + KylinNotebookBold = 0x100003, /* 加粗 */ + KylinNotebookItalics = 0x100004, /* 斜体 */ + KylinNotebookUnderline = 0x100005, /* 下划线 */ + KylinNotebookDeleteline = 0x100006, /* 删除线 */ + KylinNotebookFontSize = 0x100007, /* 字号 */ + KylinNotebookFontColor = 0x100008, /* 字体颜色 */ + KylinNotebookInsertPicture = 0x100009, /* 插入图片 */ + KylinNotebookInterfaceColor = 0x100010, /* 界面配色 */ + KylinNotebookDeleteCurrent = 0x100011, /* 删除当前 */ + KylinNotebookUiTop = 0x100012, /* UI 置顶 */ + KylinNotebookListMode = 0x100013, /* 列表模式 */ + KylinNotebookIconMode = 0x100014, /* 图标模式 */ + KylinNotebookNewNote = 0x100015, /* 新建便签 */ + KylinNotebookSearch = 0x100016, /* 搜索 */ + KylinNotebookDelete = 0x100017, /* 删除 */ + KylinNotebookModeChange = 0x100018, /* 模式切换 */ + + KylinOsManagerGarbageClean = 0x110001, /* 垃圾清理 */ + KylinOsManagerFileShredding = 0x110002, /* 文件粉碎 */ + + KylinGpuControllerBaseInfo = 0x120001, /* 基本信息 */ + KylinGpuControllerRunState = 0x120002, /* 运行状态 */ + KylinGpuControllerDriveInfo = 0x120003, /* 驱动信息 */ + KylinGpuControllerSwitch = 0x120003, /* 显卡切换 */ + + KylinNetworkCheckStartCheck = 0x130001, /* 开始检测 */ + + KylinGallerySwitchFolder = 0x140001, /* 切换目录 */ + KylinGalleryOpenViewer = 0x140002, /* 打开麒麟看图 */ + + KylinMobileAssistantAndroidConn = 0x150001, /* 安卓链接 */ + KylinMobileAssistantPcConn = 0x150002, /* PC链接 */ + KylinMobileAssistantUsbConn = 0x150003, /* Usb链接 */ + KylinMobileAssistantWifiConn = 0x150004, /* Wifi链接 */ + KylinMobileAssistantDeviceDiscovery = 0x150005, /* 设备发现 */ + KylinMobileAssistantDisconnect = 0x150006, /* 断开链接 */ + KylinMobileAssistantMobileScreen = 0x150007, /* 手机投屏 */ + KylinMobileAssistantPcScreen = 0x150008, /* PC 投屏 */ + KylinMobileAssistantPictureList = 0x150009, /* 图片列表 */ + KylinMobileAssistantVideoList = 0x150010, /* 视频列表 */ + KylinMobileAssistantAudioList = 0x150011, /* 音频列表 */ + KylinMobileAssistantDocList = 0x150012, /* 文档列表 */ + KylinMobileAssistantQQFileList = 0x150013, /* QQ 文件列表 */ + KylinMobileAssistantWechatFileList = 0x150014, /* 微信文件列表 */ + KylinMobileAssistantMobileStorage = 0x150015, /* 手机存储 */ + KylinMobileAssistantSwitchView = 0x150016, /* 切换视图 */ + KylinMobileAssistantRefreshList = 0x150017, /* 刷新列表 */ + KylinMobileAssistantUploadFile = 0x150018, /* 上传文件 */ + KylinMobileAssistantDownloadFile = 0x150019, /* 下载文件 */ + KylinMobileAssistantOpenFile = 0x150020, /* 打开文件 */ + + KylinScannerOneClickBeautification = 0x160001, /* 一键美化 */ + KylinScannerRectification = 0x160002, /* 自动纠偏 */ + KylinScannerTextRecognition = 0x160003, /* 文本识别 */ + KylinScannerCutting = 0x160004, /* 裁剪 */ + KylinScannerRotate = 0x160005, /* 旋转 */ + KylinScannerImage = 0x160006, /* 镜像 */ + KylinScannerAddWatermark = 0x160007, /* 加水印 */ + KylinScannerSendMail = 0x160008, /* 发送邮件 */ + KylinScannerSaveAs = 0x160009, /* 另存为 */ + KylinScannerSinglePageScan = 0x160010, /* 单页扫描 */ + KylinScannerMultiPageScan = 0x160011, /* 多页扫描 */ + + KylinCalendarMonthDetails = 0x170001, /* 查看月详情 */ + KylinCalendarMonthSwitch = 0x170002, /* 月切换 */ + KylinCalendarDoday = 0x170003, /* 定位到今天 */ + + TestFunPoint = 0x999999 /* 测试预留 */ + }; + + static bool functionBuriedPoint(AppName packageName, PT point) + { + static char *messageType = (char *)"FunctionType"; + char *appName = strdup(Utils::getAppName(packageName).c_str()); + + std::string hex; + std::stringstream ss; + + ss << std::hex << point; + ss >> hex; + + KBuriedPoint pt; + pt.key = "FunctionName"; + pt.value = hex.c_str(); + + if (kdk_buried_point(appName, messageType, &pt, 1)) { + free(appName); + klog_err("kabase: buried point fail !\n"); + return false; + } + + free(appName); + + return true; + }; + + static bool buriedPoint(AppName packageName, BuriedPointType buriedPointType, std::map data) + { + char *appName = strdup(Utils::getAppName(packageName).c_str()); + + char type[128]; + memset(type, '\0', sizeof(type)); + switch (buriedPointType) { + case BuriedPointType::FunctionType: + strcpy(type, "FunctionType"); + break; + case BuriedPointType::PerformanceType: + strcpy(type, "PerformanceType"); + break; + case BuriedPointType::StabilityType: + strcpy(type, "StabilityType"); + break; + default: + break; + } + + if (!strlen(type)) { + klog_err("kabase: buried point type is empty !\n"); + return false; + } + + int size = data.size(); + if (size == 0) { + klog_err("kabase: buried point data is empty !\n"); + return false; + } + + KBuriedPoint *pt = (KBuriedPoint *)malloc(sizeof(KBuriedPoint) * size); + { + int i; + std::map::iterator it; + for (i = 0, it = data.begin(); it != data.end() && i < size; it++, i++) { + pt[i].key = it->first.c_str(); + pt[i].value = it->second.c_str(); + } + } + + if (kdk_buried_point(appName, type, pt, size)) { + free(appName); + free(pt); + klog_err("kabase: buried point fail !\n"); + return false; + } + + free(appName); + free(pt); + + return true; + }; +}; + +} + +#endif \ No newline at end of file diff --git a/kabase/utils.hpp b/kabase/utils.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7cb5e4803019f063d6dc9f4f1ee645a7c860dc49 --- /dev/null +++ b/kabase/utils.hpp @@ -0,0 +1,88 @@ +#ifndef UTILS_HPP_ +#define UTILS_HPP_ + +#include + +namespace kabase +{ + +/* 应用名 */ +enum AppName { + KylinIpmsg = 0, /* 传书 */ + KylinFontViewer, /* 字体管理器 */ + KylinCalculator, /* 麒麟计算器 */ + KylinGpuController, /* 显卡控制器 */ + KylinMusic, /* 音乐 */ + KylinWeather, /* 天气 */ + KylinPhotoViewer, /* 看图 */ + KylinServiceSupport, /* 服务与支持 */ + KylinPrinter, /* 麒麟打印 */ + KylinCalendar, /* 日历 */ + KylinRecorder, /* 录音 */ + KylinCamera, /* 摄像头 */ + KylinNotebook, /* 便签 */ + KylinOsManager, /* 麒麟管家 */ + KylinNetworkCheck, /* 网络检测工具 */ + KylinGallery, /* 相册 */ + KylinScanner, /* 扫描 */ + KylinMobileAssistant, /* 多端协同 */ + KylinTest /* 测试预留 */ +}; + +class Utils +{ +public: + Utils() = default; + ~Utils() = default; + + static std::string getAppName(AppName appName) + { + switch (appName) { + case AppName::KylinCalculator: + return "kylin-calaulator"; + case AppName::KylinCalendar: + return "kylin-calendar"; + case AppName::KylinCamera: + return "kylin-camera"; + case AppName::KylinFontViewer: + return "kylin-font-viewer"; + case AppName::KylinGpuController: + return "kylin-gpu-controller"; + case AppName::KylinIpmsg: + return "kylin-ipmsg"; + case AppName::KylinMusic: + return "kylin-music"; + case AppName::KylinPhotoViewer: + return "kylin-photo-viewer"; + case AppName::KylinPrinter: + return "kylin-printer"; + case AppName::KylinRecorder: + return "kylin-recorder"; + case AppName::KylinServiceSupport: + return "kylin-service-support"; + case AppName::KylinWeather: + return "kylin-weather"; + case AppName::KylinNotebook: + return "kylin-notebook"; + case AppName::KylinOsManager: + return "kylin-os-manager"; + case AppName::KylinNetworkCheck: + return "kylin-network-check-tools"; + case AppName::KylinGallery: + return "kylin-gallery"; + case AppName::KylinScanner: + return "kylin-scanner"; + case AppName::KylinMobileAssistant: + return "kylin-mobile-assistant"; + default: + return ""; + } + + /* 不应该被执行 */ + return ""; + }; +}; + +} + +#endif \ No newline at end of file diff --git a/kylin-scanner.pro b/kylin-scanner.pro index 48807c51074c52cbf3b77639543d2ec69b7d6332..d7d4f67545f8f9ee7f2ea5fce01269d4fd57a2dc 100644 --- a/kylin-scanner.pro +++ b/kylin-scanner.pro @@ -13,9 +13,10 @@ QT += \ svg # 配置kysdk -PKGCONFIG += kysdk-kabase +PKGCONFIG += kysdk-kabase kysdk-waylandhelper kysdk-qtwidgets kysdk-waylandhelper kysdk-alm kysdk-ukenv kysdk-log kysdk-diagnostics INCLUDEPATH += /usr/include/kysdk/applications/kabase/ - +INCLUDEPATH += kabase/ \ + kabase/Qt greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = kylin-scanner diff --git a/src/about/about.cpp b/src/about/about.cpp index e61857e37dc984ca55d305e78e7cdcdbed64b3fc..f78ba759020d1ec810a7977e12e2bb7ed42718bc 100644 --- a/src/about/about.cpp +++ b/src/about/about.cpp @@ -1,6 +1,6 @@ #include "about.h" #include "ui_about.h" -#include +#include "kabase/Qt/windowmanage.hpp" #include @@ -24,9 +24,9 @@ AboutDialog::AboutDialog(QWidget *parent) void AboutDialog::titlebar_icon_theme_changed() { - setWindowIcon(QIcon::fromTheme("kylin-scanner")); - ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size())); - ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96)); +// setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size())); +// ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96)); } void AboutDialog::titlebar_style_changed() @@ -59,11 +59,11 @@ AboutDialog::~AboutDialog() void AboutDialog::initWindow() { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setWindowModality(Qt::ApplicationModal); setWindowTitle(tr("About")); - setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// setWindowIcon(QIcon::fromTheme("kylin-scanner")); setFixedSize(QSize(420, 448-80)); } @@ -72,9 +72,14 @@ void AboutDialog::initLayout() { QString appVersion = QCoreApplication::applicationVersion(); ui->labelVersion->setText(tr("Version: " ) + appVersion); - - ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size())); - ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96)); + ui->titleIcon->setIcon(QIcon::fromTheme("kylin-scanner")); + ui->titleIcon->setFixedSize(30,30); + ui->titleIcon->setIconSize(QSize(24,24)); + ui->titleIcon->setStyleSheet("QPushButton{border:0px;background:transparent;}"); + ui->bigIcon->setIcon(QIcon::fromTheme("kylin-scanner")); + ui->bigIcon->setFixedSize(96,96); + ui->bigIcon->setIconSize(QSize(96,96)); + ui->bigIcon->setStyleSheet("QPushButton{border:0px;background:transparent;}"); ui->labelName->setText(tr("Scanner")); ui->labelTitle->setText(tr("Scanner")); diff --git a/src/about/about.ui b/src/about/about.ui index eb561f13b69694d1e8f17e05c907fd884265f305..6e2ebb4f3766ec52356f705f235ae4122bf8806d 100644 --- a/src/about/about.ui +++ b/src/about/about.ui @@ -66,7 +66,7 @@ 0 - + 24 @@ -79,9 +79,27 @@ 24 + + Qt::NoFocus + + + + + + + 24 + 24 + + + + false + + + true + @@ -141,12 +159,36 @@ 16 - + + + + 96 + 96 + + + + + 96 + 96 + + + + Qt::NoFocus + - - Qt::AlignCenter + + + 96 + 96 + + + + false + + + true diff --git a/src/failedpagewidget.cpp b/src/failedpagewidget.cpp index bf53d1c1cd87f0498e526ea1bca2686aa66ed5d0..11775fe7c3b2254cb80f3ee776d7b5c6c90b78dc 100644 --- a/src/failedpagewidget.cpp +++ b/src/failedpagewidget.cpp @@ -36,12 +36,6 @@ bool FailedPageWidget::isDarkTheme() } void FailedPageWidget::setupGui() { - if(themeColor == "white"){ - m_failedPageIcon->setPixmap(QPixmap(":/default-connect-page/detect_fail_light.svg")); - }else{ - m_failedPageIcon->setPixmap(QPixmap(":/default-connect-page/detect_fail_dark.svg")); - } - m_failedPageIcon->setFixedSize(FailedPageIconSize); m_failedPageText->setEnabled(false); @@ -54,8 +48,13 @@ void FailedPageWidget::setupGui() m_failedPageButton->setFocus(); m_failedPageButton->setDefault(true); - m_failedPageButton->setStyleSheet("QPushButton{background-color:rgb(55,144,250);color:rgb(255,255,255);}"); - +// m_failedPageButton->setStyleSheet("QPushButton{background-color:rgb(55,144,250);color:rgb(255,255,255);}"); + QPalette palette; + QColor color(55, 144, 250); + palette.setColor(QPalette::Button, color); + QColor colorFont(255, 255, 255); + palette.setColor(QPalette::ButtonText,colorFont); + m_failedPageButton->setPalette(palette); m_failedPageVLayout->setSpacing(0); m_failedPageVLayout->addStretch(); diff --git a/src/globalsignal.cpp b/src/globalsignal.cpp index 73cb2bcddd1141c4c6c443c97de904f420d2fdb6..90eacc0413a0edfdb41e263eb4f69581bae8596a 100644 --- a/src/globalsignal.cpp +++ b/src/globalsignal.cpp @@ -216,8 +216,6 @@ void GlobalUserSignal::stopOcrTimer() { emit stopOcrTimerSignal(); } - - GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent) { diff --git a/src/include/common.h b/src/include/common.h index 460f0c7c7f0e79b7fb5f82b827ec6c1e9b48e549..00fe7ff48366ca5b98291c3a3099f2e5ed6a5b46 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -26,7 +26,7 @@ /******** Mainwidget ********/ #define MainWidgetWidth 960 -#define MainWidgetHeight 676 +#define MainWidgetHeight 677 #define ApplicationName "Scanner" /******** TitlebarWidget ********/ @@ -40,7 +40,7 @@ // font size by desinger maybe small, so normal font can make window large #define AddWidthForLargeFontSize 20 -#define ScanSettingsWidgetWidth (248+AddWidthForLargeFontSize) +#define ScanSettingsWidgetWidth (250+AddWidthForLargeFontSize) #define ScanSettingsWidgetHeight (MainWidgetHeight-TitlebarHeight) #define ScanSettingsWidgetScanButtonSize QSize(144, 36)//216, 36 #define ScanSettingsWidgetComboboxSize QSize(144, 36)//166, 36 @@ -54,7 +54,7 @@ /******** LeftSuccessPageWidget ********/ #define LeftSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth) #define LeftSuccessPageHeight (MainWidgetHeight-TitlebarHeight) -#define LeftSuccessPageIconSize QSize(101, 91) +#define LeftSuccessPageIconSize QSize(128, 128) /******** LeftImageHandleSuccessPageWidget ********/ #define LeftImageHandleSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth) diff --git a/src/leftsuccesspagewidget.cpp b/src/leftsuccesspagewidget.cpp index 2ce0bf229d12ae94f1ea76b70975501a2d4bacc1..7e06bdf0492bc51f003d081babfaf29d74289aa2 100644 --- a/src/leftsuccesspagewidget.cpp +++ b/src/leftsuccesspagewidget.cpp @@ -16,6 +16,8 @@ * */ #include "leftsuccesspagewidget.h" +#include "include/theme.h" +#include LeftSuccessPageWidget::LeftSuccessPageWidget(QWidget *parent) : QWidget(parent), @@ -24,12 +26,32 @@ LeftSuccessPageWidget::LeftSuccessPageWidget(QWidget *parent) : m_connectSuccessVLayout(new QVBoxLayout(this)) { setupGui(); + initTheme(); + connect(kdk::kabase::Gsettings::getPoint(), &kdk::kabase::Gsettings::systemThemeChange, this, &LeftSuccessPageWidget::initTheme); +} + +void LeftSuccessPageWidget::initTheme(){ + if (isDarkTheme()) { + m_connectSuccessIcon->setPixmap(QPixmap(":/default-connect-page/detect_fail_dark.svg")); + } else { + m_connectSuccessIcon->setPixmap(QPixmap(":/default-connect-page/detect_fail_light.svg")); + } +} +bool LeftSuccessPageWidget::isDarkTheme() +{ + QString systemTheme = kdk::kabase::Gsettings::getSystemTheme().toString(); + + if (systemTheme == STYLE_NAME_KEY_DARK || systemTheme == STYLE_NAME_KEY_BLACK) { + return true; + } else { + return false; + } } void LeftSuccessPageWidget::setupGui() { setMinimumSize(LeftSuccessPageWidth, LeftSuccessPageHeight); - m_connectSuccessIcon->setPixmap(QPixmap(":/default-connect-page/detect-success.svg")); + m_connectSuccessIcon->setPixmap(QPixmap(":/default-connect-page/detect_fail_light.svg")); m_connectSuccessIcon->setFixedSize(LeftSuccessPageIconSize); m_connectSuccessText->setEnabled(false); diff --git a/src/leftsuccesspagewidget.h b/src/leftsuccesspagewidget.h index fcfa1eb59b3ff5c43f260a683dc0fd528ebdc5e6..0f3b937fa5eb09fa665785927302dd86c1828f5b 100644 --- a/src/leftsuccesspagewidget.h +++ b/src/leftsuccesspagewidget.h @@ -46,6 +46,9 @@ private: QLabel *m_connectSuccessIcon; QLabel *m_connectSuccessText; QVBoxLayout *m_connectSuccessVLayout; + bool isDarkTheme(); +private slots: + void initTheme(); }; diff --git a/src/main.cpp b/src/main.cpp index 32fe7e40301c5e49ffd79d7752833a60a7d645ac..e55251e473b48bbf69176a14d8ffedf0a6aa4371 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,8 +38,10 @@ #include #include #include -#include -#include +#include "log.hpp" +#include "windowmanage.hpp" +#include +#include #define TRANS_PATH "/usr/share/kylin-scanner/translations" @@ -148,7 +150,7 @@ static QString getAppVersion() int main(int argc, char *argv[]) { /* 使用sdk管理日志 */ - qInstallMessageHandler(kdk::kabase::Log::logOutput); + qInstallMessageHandler(::kabase::Log::logOutput); QString scannerFileName; if (argc > 1) { @@ -165,13 +167,13 @@ int main(int argc, char *argv[]) #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif + /* 适配4K屏 */ + ::kabase::WindowManage::setScalingProperties(); - kdk::kabase::QtSingleApplication app(argc, argv); + kdk::QtSingleApplication app(argc, argv); createScannerDir(); -// Global::global_init(); - getSystemArchitecture(); app.setApplicationVersion(getAppVersion()); app.setWindowIcon (QIcon::fromTheme("kylin-scanner")); @@ -258,6 +260,7 @@ int main(int argc, char *argv[]) { qDebug() << "加载中文失败"; } + app.setApplicationVersion("3.2.0"); if (! app.isRunning()) { QString userNow = getCurrentUserName(); @@ -265,11 +268,31 @@ int main(int argc, char *argv[]) doWrite(userNow, pidNow); - MainWidget w; -// app.w = &w; -// w.show(); - app.setActivationWindow(&w); - w.show(); + MainWidget *w = new MainWidget; + /* 最小化拉起 */ + app.setActivationWindow(w); + + /* wayland最小化拉起 */ + quint32 mainWidgetWindowId = w->getWindowId(); + qDebug() << "mainWidgetWindowId: " << mainWidgetWindowId; + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) { + QObject::connect(&app, &kdk::QtSingleApplication::messageReceived, [=](){ + printf("mainWidgetWindowId: %d",mainWidgetWindowId); + qDebug() << "mainWidgetWindowId: " << mainWidgetWindowId; + ::kabase::WindowManage::activateWindow(mainWidgetWindowId); + }); + } + + /* 移除标题栏 */ + ::kabase::WindowManage::removeHeader(w); + + /* 解决置顶失效 */ + kabase::WindowManage::keepWindowAbove(w->windowId); + + w->show(); + + /* 居中显示 */ + ::kabase::WindowManage::setMiddleOfScreen(w); return app.exec(); diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index 0a7ec73c80fd32ba085c8be84092772797f42299..15da81ac5dd749ac46763d8cfe763cbd59d80b7f 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -25,6 +25,7 @@ #include #include #include +#include "kabase/Qt/windowmanage.hpp" @@ -39,6 +40,7 @@ MainWidget::MainWidget(QWidget *parent) // m_displayScrollArea(new QScrollArea), m_mainWidgetVLayout(new QVBoxLayout()) { + kabase::WindowManage::getWindowId(&windowId); setupGui(); initConnect(); initGsettings(); @@ -68,13 +70,13 @@ void MainWidget::setupGui() this->setAttribute(Qt::WA_TranslucentBackground, true); // Add window control protocol - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); resize(MainWidgetWidth, MainWidgetHeight); setMinimumSize(MainWidgetWidth, MainWidgetHeight); setWindowTitle(tr("kylin-scanner")); - this->setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// this->setWindowIcon(QIcon::fromTheme("kylin-scanner")); setMouseTracking(true); setAutoFillBackground(true); setAcceptDrops(true); @@ -191,7 +193,7 @@ void MainWidget::themeChange() void MainWidget::iconThemeNameChange() { - this->setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// this->setWindowIcon(QIcon::fromTheme("kylin-scanner")); } @@ -225,7 +227,7 @@ void MainWidget::warnMsg(QString msg) msgBox->setText(msg); msgBox->setIcon(QMessageBox::Warning); - msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); msgBox->setWindowTitle(tr("Scanner")); msgBox->setStandardButtons(QMessageBox::Yes); msgBox->setContextMenuPolicy(Qt::NoContextMenu); @@ -374,7 +376,9 @@ void MainWidget::maximizeWindowSlot() } } } - +quint32 MainWidget::getWindowId(){ + return windowId; +} void MainWidget::closeWindowSlot() { exit(0); diff --git a/src/mainwidget.h b/src/mainwidget.h index 41126403b451b772ffa0e9aabbe7a7c7d1c8dfb7..37c93c0cca5d2f665eb50b519ba9975897d60788 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -162,10 +162,11 @@ public: void fontSizeChange(); void transparencyChange(); void warnMsg(QString msg); - + quint32 getWindowId(); void reboot(); static int const EXIT_CODE_REBOOT; + quint32 windowId = 0; protected: void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; diff --git a/src/runningdialog.cpp b/src/runningdialog.cpp index 3250d69e9e76c325329a487e048e350166f1c5cc..183b622324d40f108848ced9ce03f9dc1628dea4 100644 --- a/src/runningdialog.cpp +++ b/src/runningdialog.cpp @@ -17,8 +17,8 @@ */ #include "runningdialog.h" -#include #include +#include "kabase/Qt/windowmanage.hpp" RunningDialog::RunningDialog(QWidget *parent) : QDialog(parent) @@ -33,7 +33,8 @@ RunningDialog::RunningDialog(QWidget *parent) , hLayoutCancel (new QHBoxLayout()) , vLayout (new QVBoxLayout()) { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + /* 移除标题栏 */ + ::kabase::WindowManage::removeHeader(this); setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT); @@ -119,7 +120,7 @@ RunningDialog::RunningDialog(QWidget *parent, QString text) , vLayout (new QVBoxLayout()) { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT); diff --git a/src/saneobject.cpp b/src/saneobject.cpp index f3cfabdb414ff8b843c93ea37c5bd4404f9b8a34..d280607cd20ba86aa4bc6db816fe2e5943ccc260 100644 --- a/src/saneobject.cpp +++ b/src/saneobject.cpp @@ -183,11 +183,13 @@ static SANE_Status onScanning(FILE *ofp) do { if (!first_frame) { + qDebug() << "sane start!"; status = sane_start (g_device); if (status != SANE_STATUS_GOOD) goto cleanup; } + qDebug()<<"sane get parameter"; status = sane_get_parameters (g_device, &parm); KyInfo() << "Parm : status = " << sane_strstatus(status) << "format = " << parm.format @@ -230,6 +232,7 @@ static SANE_Status onScanning(FILE *ofp) switch(g_sane_object->output_format) { case OUTPUT_PNM: + qDebug()<<"start write file!"; writePnmHeader (parm.format, parm.pixels_per_line, parm.lines, parm.depth, ofp); break; #if HAVE_LIBJPEG @@ -282,7 +285,9 @@ static SANE_Status onScanning(FILE *ofp) hundred_percent = parm.bytes_per_line * parm.lines \ *((parm.format == SANE_FRAME_RGB || parm.format == SANE_FRAME_GRAY) ? 1 : 3); while (1) { + static int i =0; double progr; + qDebug()<<"read file!" << i++; status = sane_read (g_device, g_buf, g_BufSize, &len); total_bytes += (SANE_Word) len; if(hundred_percent == 0){ @@ -1083,9 +1088,13 @@ SANE_Status setOptionResolutions(SANE_Handle sane_handle, SANE_Int val_resolutio KyInfo() << "Set resolution option = " << val_resolution; - status = sane_control_option(sane_handle, g_optDesc.numResolution, + int index = -1; + if(!g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_RESOLUTION,index)){ + status = sane_control_option(sane_handle, g_optDesc.numResolution, SANE_ACTION_SET_VALUE, &val_resolution, nullptr); - + }else{ + status = sane_control_option(sane_handle,index,SANE_ACTION_SET_VALUE, &val_resolution, nullptr); + } if (status != SANE_STATUS_GOOD) { KyInfo() << "status = " << status << "desc: " << sane_strstatus(status); return status; @@ -1128,7 +1137,7 @@ SANE_Status setOptionSizes(SANE_Handle sane_handle, int optnum, SANE_Int val_siz { SANE_Status status = SANE_STATUS_GOOD; - KyInfo() << "Set size option = " << val_size; + KyInfo() << "Set size option = "<< optnum << val_size; status = sane_control_option(sane_handle, optnum, SANE_ACTION_SET_VALUE, &val_size, nullptr); @@ -1146,26 +1155,54 @@ SANE_Status setOptionSizesReal(SANE_Handle sane_handle, SANE_Int val_size_br_x, { SANE_Status status = SANE_STATUS_GOOD; KyInfo() << "Size bottom-right location(xy) = " << val_size_br_x << val_size_br_y; - - status = setOptionSizes(sane_handle, g_optDesc.numSizeBrX, SANE_FIX(val_size_br_x)); - if (status != SANE_STATUS_GOOD) { - KyInfo() << "status = " << sane_strstatus(status); - return status; + int index = -1; + if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_BR_X,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_x)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; } - status = setOptionSizes(sane_handle, g_optDesc.numPageWidth, SANE_FIX(val_size_br_x)); - if (status != SANE_STATUS_GOOD) { - KyInfo() << "status = " << sane_strstatus(status); - return status; + if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_BR_Y,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_y)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; } - status = setOptionSizes(sane_handle, g_optDesc.numSizeBrY, SANE_FIX(val_size_br_y)); - if (status != SANE_STATUS_GOOD) { - KyInfo() << "status = " << sane_strstatus(status); - return status; + if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_TL_X,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(0)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; } - status = setOptionSizes(sane_handle, g_optDesc.numPageHeight, SANE_FIX(val_size_br_y)); - if (status != SANE_STATUS_GOOD) { - KyInfo() << "status = " << sane_strstatus(status); - return status; + if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_TL_Y,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(0)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; + } + if(g_sane_object->getSaneOptIndex(SANE_NAME_PAGE_WIDTH,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_x - 0)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; + } + if(g_sane_object->getSaneOptIndex(SANE_NAME_PAGE_HEIGHT,index)){ + status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_y - 0)); + if (status != SANE_STATUS_GOOD) { + KyInfo() << "status = " << sane_strstatus(status); + return status; + } + index = -1; } return status; } @@ -1919,9 +1956,44 @@ void SaneObject::saneClose() } stopSaneRead(true); } +/* + * #define SANE_NAME_SCAN_MODE "mode" +#define SANE_NAME_SCAN_SPEED "speed" +#define SANE_NAME_SCAN_SOURCE "source" +#define SANE_NAME_SCAN_TL_X "tl-x" +#define SANE_NAME_SCAN_TL_Y "tl-y" +#define SANE_NAME_SCAN_BR_X "br-x" +#define SANE_NAME_SCAN_BR_Y "br-y" +#define SANE_NAME_SCAN_RESOLUTION "resolution" +#define SANE_NAME_SCAN_X_RESOLUTION "x-resolution" +#define SANE_NAME_SCAN_Y_RESOLUTION "y-resolution" +#define SANE_NAME_PAGE_WIDTH "page-width" +#define SANE_NAME_PAGE_HEIGHT "page-height" +*/ +void SaneObject::dumpScannerOptions() +{ + m_saneOptions.clear(); + for(auto opt = 0; const SANE_Option_Descriptor *desc = sane_get_option_descriptor(g_sane_object->handle,opt);opt++) + { + qDebug ()<name << desc->desc; + if(QString::compare(SANE_NAME_SCAN_MODE,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_SOURCE,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_RESOLUTION,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_TL_X,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_TL_Y,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_BR_X,desc->name) == 0 || + QString::compare(SANE_NAME_SCAN_BR_Y,desc->name) == 0 || + QString::compare(SANE_NAME_PAGE_WIDTH,desc->name) == 0 || + QString::compare(SANE_NAME_PAGE_HEIGHT,desc->name) == 0) { + m_saneOptions.insert(desc->name,opt); + } + } + qDebug() << m_saneOptions; +} void SaneObject::setSaneAllParametersByUser() { + dumpScannerOptions(); setSaneNameByUser(); setSanePageNumberByUser(); setSaneTimeByUser(); @@ -2041,15 +2113,10 @@ void SaneObject::setSaneResolutionByUser() SANE_Status status = SANE_STATUS_GOOD; QString resolution = g_sane_object->userInfo.resolution; SANE_Int i_resolution; - KyInfo() << "resolution = " << resolution; - resolutionValue = getSaneResolutionByUser(resolution); i_resolution = static_cast(resolutionValue); - resolution_value = i_resolution; - - status = setOptionResolutions(g_sane_object->handle, i_resolution); if (status != SANE_STATUS_GOOD) { KyInfo() << "Failed to set option resolution: " << resolution @@ -2299,3 +2366,16 @@ bool SaneObject::testScannerIsAlive(QString deviceName) KyInfo() << "deviceName= " << deviceName; return true; } + +bool SaneObject::getSaneOptIndex(QString desc,int &index) +{ + auto k = m_saneOptions.find(desc); + if(k==m_saneOptions.end()){ + return false; + } else { + qDebug() << "Found" << k.key() << k.value(); + index = k.value(); + return true; + } + return false; +} diff --git a/src/saneobject.h b/src/saneobject.h index 44c5e2411734fc1dfdb27733fc564a4945c02cbf..43851b3eb5187af3e47fde4572c269e55c55372c 100644 --- a/src/saneobject.h +++ b/src/saneobject.h @@ -43,7 +43,7 @@ //using namespace std; #include "globalsignal.h" - +#include #ifndef PATH_MAX #define PATH_MAX 1024 #endif @@ -196,7 +196,7 @@ public: int output_format = OUTPUT_PNM; int resolution_value; - + bool getSaneOptIndex(QString desc,int &index); private: static SaneObject *instance; @@ -206,7 +206,9 @@ private: SaneObject &operator = (const SaneObject &) = delete ; ScanDeviceInfo devicesInfo; - + //QString : 属性描述, int:属性index + QMap m_saneOptions; + void dumpScannerOptions(); public slots: void stopSaneRead(bool isStoped); void stopSaneForException(); diff --git a/src/savefile.cpp b/src/savefile.cpp index 558b9ed941798629048293a45da66cfa291abcf7..cefcdb4868799471b4889c3047baeae4a0d4408a 100644 --- a/src/savefile.cpp +++ b/src/savefile.cpp @@ -27,7 +27,7 @@ SaveFileDialog::SaveFileDialog(QWidget *parent) : QFileDialog(parent) { - setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// setWindowIcon(QIcon::fromTheme("kylin-scanner")); setNameFilter(QLatin1String("*.jpg;;*.png;;*.pdf;;*.bmp")); setAcceptMode(QFileDialog::AcceptSave); this->findChildren("fileNameEdit").at(0)->setText(initFilename); @@ -57,7 +57,7 @@ SaveFileDialog::SaveFileDialog(QWidget *parent, int ocrFlag, QString filename, Q { Q_UNUSED(parent); - setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// setWindowIcon(QIcon::fromTheme("kylin-scanner")); setWindowTitle(titlename); setAcceptMode(QFileDialog::AcceptSave); diff --git a/src/scandialog.cpp b/src/scandialog.cpp index 53fe5585e6f8dbd96c3284524e656093821f5f49..9271091f2b0c6d31ec2d6c7fed15db653558db14 100644 --- a/src/scandialog.cpp +++ b/src/scandialog.cpp @@ -1,7 +1,7 @@ #include "scandialog.h" #include "./utils/xatom-helper.h" #include "globalsignal.h" -#include +#include "kabase/Qt/windowmanage.hpp" #include #include "include/theme.h" @@ -22,10 +22,10 @@ ScanDialog::ScanDialog(QWidget *parent) : QDialog(parent), void ScanDialog::setupGui() { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setWindowModality(Qt::ApplicationModal); - setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// setWindowIcon(QIcon::fromTheme("kylin-scanner")); this->setWindowTitle(tr("Scanner")); this->setFixedSize(ScanDialogWindowSize); diff --git a/src/scansettingswidget.cpp b/src/scansettingswidget.cpp index 2c9c5907de3865ecd44859058dcebd1e64959be4..a89884f697be714b162791e650915f607a31355d 100644 --- a/src/scansettingswidget.cpp +++ b/src/scansettingswidget.cpp @@ -506,7 +506,11 @@ void ScanSettingsWidget::setupGui() // m_scanButton->setFixedSize(QSize(193+AddWidthForLargeFontSize, 36)); m_scanButton->setCursor(Qt::PointingHandCursor); scanButtonRightLabel->setStyleSheet("color:white;"); - m_scanButton->setStyleSheet("QPushButton{background: rgba(55, 144, 250, 1);}"); +// m_scanButton->setStyleSheet("QPushButton{background: rgb(55, 144, 250);}"); + QPalette palette; + QColor color(55, 144, 250); + palette.setColor(QPalette::Button, color); + m_scanButton->setPalette(palette); // m_deviceComboBox->setFixedSize(ScanSettingsWidgetComboboxSize); @@ -579,8 +583,6 @@ void ScanSettingsWidget::setupGui() m_sendMailButton->setMinimumSize(ScanSettingsWidgetButtonSize); m_SaveAsButton->setMinimumSize(ScanSettingsWidgetButtonSize); - - m_buttonsHLayout->setSpacing(0); //m_buttonsHLayout->addSpacing(16-spacing); m_buttonsHLayout->addWidget(m_sendMailButton); @@ -594,9 +596,9 @@ void ScanSettingsWidget::setupGui() m_mainVLayout->addSpacing(16); m_mainVLayout->addLayout(m_settingsFormLayout); //m_mainVLayout->addStretch(); - m_mainVLayout->addSpacing(32); - m_mainVLayout->addLayout(m_buttonsHLayout); m_mainVLayout->addSpacing(16); + m_mainVLayout->addLayout(m_buttonsHLayout); + m_mainVLayout->addSpacing(24); m_mainVLayout->setContentsMargins(0, 0, 0, 0); @@ -1125,7 +1127,7 @@ void ScanSettingsWidget::warnMsg(QString msg) msgBox->setText(msg); msgBox->setIcon(QMessageBox::Warning); - msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); msgBox->setWindowTitle(tr("Scanner")); msgBox->setStandardButtons(QMessageBox::Yes); msgBox->setContextMenuPolicy(Qt::NoContextMenu); diff --git a/src/sendmail.cpp b/src/sendmail.cpp index d4c6973c1d0509ef163c4c4b6d905329ee040b97..0de7b4e58e1450c1f23cd62fc89bc82d4abf75d6 100644 --- a/src/sendmail.cpp +++ b/src/sendmail.cpp @@ -18,6 +18,7 @@ #include "sendmail.h" #include +#include "kabase/Qt/windowmanage.hpp" NoMailDialog::NoMailDialog(QWidget *parent) : QDialog(parent) , m_noMailTitleTextLabel (new QLabel()) @@ -47,7 +48,7 @@ NoMailDialog::~NoMailDialog() void NoMailDialog::initWindow() { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setWindowTitle (tr("No email client")); setFixedSize(NoMailWindowWidth, NoMainWindowHeight); @@ -211,7 +212,7 @@ SendMailDialog::~SendMailDialog() void SendMailDialog::initWindow() { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setWindowTitle (tr("Select email client")); setFixedSize(SendMailWindowWidth, SendMainWindowHeight); diff --git a/src/thumbnailwidget.cpp b/src/thumbnailwidget.cpp index a5f822a805bd562260f17edc9f7adafcae77b81b..ac5afb68e84adcda0b6d8db5e76daad6581dacb5 100644 --- a/src/thumbnailwidget.cpp +++ b/src/thumbnailwidget.cpp @@ -10,23 +10,25 @@ ThumbnailWidget::ThumbnailWidget(QWidget *parent) : QListView(parent) setupGui(); initConnect(); initSettings(); -} + themeChange(); -void ThumbnailWidget::paintEvent(QPaintEvent *event) -{ - Q_UNUSED(event); - QPainter p(this); - p.setRenderHint(QPainter::Antialiasing); - QPainterPath rectPath; - rectPath.addRoundedRect(this->rect(), 0, 0); - QStyleOption opt; - opt.init(this); - - QColor mainColor; - mainColor = opt.palette.color(QPalette::Base); - - p.fillPath(rectPath,QBrush(mainColor)); } + +//void ThumbnailWidget::paintEvent(QPaintEvent *event) +//{ +// Q_UNUSED(event); +// QPainter p(this); +// p.setRenderHint(QPainter::Antialiasing); +// QPainterPath rectPath; +// rectPath.addRoundedRect(this->rect(), 0, 0); +// QStyleOption opt; +// opt.init(this); + +// QColor mainColor; +// mainColor = opt.palette.color(QPalette::Base); + +// p.fillPath(rectPath,QBrush(mainColor)); +//} void ThumbnailWidget::setupGui() { this->setFixedWidth(ThumbnailWidgetMinimumWidth); @@ -52,11 +54,40 @@ void ThumbnailWidget::initConnect() { connect(g_user_signal, &GlobalUserSignal::scanThreadFinishedImageLoadSignal, this, &ThumbnailWidget::showNormalImageAfterScan); - connect(this, &ThumbnailWidget::clicked, this, &ThumbnailWidget::clickedItemSlot); + connect(kdk::kabase::Gsettings::getPoint(), &kdk::kabase::Gsettings::systemThemeChange, this, &ThumbnailWidget::themeChange); } +void ThumbnailWidget::themeChange() +{ + QPalette pal(palette()); + if (isDarkTheme()) { + this->setStyleSheet("QListView{outline:none;background:rgba(38,38, 38, 1);border-radius: 0px;}" + "QListView::item{margin:0 1px 0 1px;background:rgba(38, 38, 38, 0.8);border-radius: 6px; }" + "QListView::item:selected{border:1px solid #3790FA;background:rgba(38, 38, 38, 0.8);}" + "QListView::item:hover{background:rgba(55, 144, 250, 0.5);}"); +// pal.setColor(QPalette::Background, QColor(64, 64, 64)); + } else { + this->setStyleSheet("QListView{outline:none;background:rgba(255,255, 255, 1);border-radius: 0px;}" + "QListView::item{margin:0 1px 0 1px;background:rgba(255, 255, 255, 0.8);border-radius: 6px; }" + "QListView::item:selected{border:1px solid #3790FA;background:rgba(255, 255, 255, 0.8);}" + "QListView::item:hover{background:rgba(55, 144, 250, 0.5);}"); + +// pal.setColor(QPalette::Background, QColor(240, 240, 240)); + } + setAutoFillBackground(true); + setPalette(pal); +} +bool ThumbnailWidget::isDarkTheme() +{ + QString systemTheme = kdk::kabase::Gsettings::getSystemTheme().toString(); + if (systemTheme == STYLE_NAME_KEY_DARK || systemTheme == STYLE_NAME_KEY_BLACK) { + return true; + } else { + return false; + } +} void ThumbnailWidget::initSettings() { showThumbnailIcon(); @@ -91,9 +122,9 @@ void ThumbnailWidget::showNormalImageAfterScan() Mat iconMat = KylinImageCodec::loadThumbnailToMat(scanFullName).mat; QPixmap iconPix = KylinImageCodec::converFormat(iconMat); - QPixmap fitpixmap =iconPix.scaled(QSize(40, 40), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); - + QPixmap fitpixmap = iconPix.scaled(QSize(40, 40), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + qDebug() << "image mesg:" << fitpixmap; ScanStandardItem *item = new ScanStandardItem(); item->setIcon(QIcon(fitpixmap)); item->setToolTip(tooltipName); diff --git a/src/thumbnailwidget.h b/src/thumbnailwidget.h index 81c482a43d2260a1f21107abec7d0ec8e2d8f80a..ad2c4d82edf6848c47c782404e4fc36859d91540 100644 --- a/src/thumbnailwidget.h +++ b/src/thumbnailwidget.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -47,6 +46,7 @@ public: private: QString m_path; int rowCountLocation; + }; class ThumbnailWidget : public QListView @@ -60,10 +60,12 @@ public: void setupGui(); void initConnect(); void initSettings(); + void themeChange(); + bool isDarkTheme(); protected: - void paintEvent(QPaintEvent *event) override; +// void paintEvent(QPaintEvent *event) override; private: diff --git a/src/titlebar/titlebar.cpp b/src/titlebar/titlebar.cpp index d61b03f87b84493a24107506ca2b749afe15488b..154dcd0df8494bff2b953f706d1d5f01f5037ae4 100644 --- a/src/titlebar/titlebar.cpp +++ b/src/titlebar/titlebar.cpp @@ -40,6 +40,15 @@ TitleBar::TitleBar(QWidget *parent) : m_menu->addAction(tr("About"), this, [ = ]() { g_user_signal->showAboutDialog(); +// using namespace kdk; +// m_aboutWindow = new KAboutDialog(this,QIcon::fromTheme("kylin-camera"),tr(appShowingName.toLocal8Bit()),tr("Version: ") + appVersion); +// m_aboutWindow->setBodyText(tr("Message provides text chat and file transfer functions in the LAN. " +// "There is no need to build a server. " +// "It supports multiple people to interact at the same time " +// "and send and receive in parallel.")); +// m_aboutWindow->setBodyTextVisiable(true); +// m_aboutWindow->setWindowModality(Qt::WindowModal); +// m_aboutWindow->setWindowModality(Qt::ApplicationModal); }); m_menu->addAction(tr("Exit"), [ = ]() { @@ -156,7 +165,7 @@ int TitleBar::warnCloseWindow() msgBox->setText(tr("The current document is not saved. Do you want to save it?")); msgBox->setIcon(QMessageBox::Warning); - msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); +// msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); msgBox->setWindowTitle(tr("Scanner")); // msgBox->setStandardButtons(QMessageBox::Yes); msgBox->setContextMenuPolicy(Qt::NoContextMenu); diff --git a/src/titlebar/titlebar.h b/src/titlebar/titlebar.h index d94275232ec56abec05dfdef1fbdc368708d8e63..2c1c7344aaa0023a3ff24f27fc4ddb353115a960 100644 --- a/src/titlebar/titlebar.h +++ b/src/titlebar/titlebar.h @@ -31,6 +31,8 @@ #include #include #include +// 主题sdk关于 +//#include "kaboutdialog.h" //#include "../globalsignal.h" @@ -77,6 +79,9 @@ public slots: private: Ui::TitleBar *ui; QMenu *m_menu = nullptr; +// kdk::KAboutDialog *m_aboutWindow = nullptr; // 关于界面 +// QString appShowingName = tr("kylin-camera"); +// QString appVersion = qApp->applicationVersion(); }; #endif // TITLEBAR_H diff --git a/src/watermarkdialog.cpp b/src/watermarkdialog.cpp index f0592aef64b92ece7fd5ec71f5bb01f10f9e6d15..6c6f86ef84ee37d0c2269205366fd6f4dee4771d 100644 --- a/src/watermarkdialog.cpp +++ b/src/watermarkdialog.cpp @@ -1,5 +1,5 @@ #include "watermarkdialog.h" -#include +#include "kabase/Qt/windowmanage.hpp" WatermarkDialog::WatermarkDialog(QWidget *parent) : QDialog(parent) , m_titleLable (new QLabel()) @@ -22,7 +22,7 @@ WatermarkDialog::WatermarkDialog(QWidget *parent) : QDialog(parent) void WatermarkDialog::initWindow() { - kdk::kabase::WindowManagement::setWindowMotifHint(winId()); + ::kabase::WindowManage::removeHeader(this); setWindowTitle (tr("Scanner")); setFixedSize(QSize(380, 176)); diff --git a/translations/kylin-scanner_bo_CN.qm b/translations/kylin-scanner_bo_CN.qm index 183c75b7c928cc06d8c0a440bdef2e742a3205b2..042bb360280f15f3ff8b84c29d5b8d8c2c0db52e 100644 Binary files a/translations/kylin-scanner_bo_CN.qm and b/translations/kylin-scanner_bo_CN.qm differ diff --git a/translations/kylin-scanner_bo_CN.ts b/translations/kylin-scanner_bo_CN.ts index ac0458abee203ffe00f8159477d20581f26aaada..fe836e00fc03be325f1d3bf2bff8430ed4df89e3 100644 --- a/translations/kylin-scanner_bo_CN.ts +++ b/translations/kylin-scanner_bo_CN.ts @@ -582,7 +582,7 @@ ADF Duplex - ADF Duplex + ADF གོ་ཉིས་ཆོད་ 4800 dpi @@ -694,6 +694,10 @@ Multiple སྣ་མང་། + + ADF Duplex + ADF གོ་ཉིས་ཆོད་ + ScanDialog @@ -1096,7 +1100,7 @@ main Open file <filename> - ཁ་ཕྱེ་བའི་ཡིག་ཆ།<filename> + ཁ་ཕྱེ་བའི་ཡིག་ཆ།<ཡིག་ཆའི་མིང་།> Filename diff --git a/translations/kylin-scanner_kk.qm b/translations/kylin-scanner_kk.qm index fb081eb476f03bc8ed145f5a5f8f717c5fa401b2..f81f87232053f8f34a5c90419d14e83bbc864390 100644 Binary files a/translations/kylin-scanner_kk.qm and b/translations/kylin-scanner_kk.qm differ diff --git a/translations/kylin-scanner_kk.ts b/translations/kylin-scanner_kk.ts index a55e958ed244faaa0e989024ced6cab8d66183e5..d8cba1b35b216909e0e8f60e13023baae6b745b7 100644 --- a/translations/kylin-scanner_kk.ts +++ b/translations/kylin-scanner_kk.ts @@ -332,6 +332,10 @@ Multiple Бірнешеу + + ADF Duplex + ADF Duplex + ScanDialog diff --git a/translations/kylin-scanner_ky.qm b/translations/kylin-scanner_ky.qm index f5733be8bd7201aebb9a88a0ef571420aff3843e..0f64c34a25f134af3c362d333f9fe573c924e2f4 100644 Binary files a/translations/kylin-scanner_ky.qm and b/translations/kylin-scanner_ky.qm differ diff --git a/translations/kylin-scanner_ky.ts b/translations/kylin-scanner_ky.ts index 8f631977785f0b15a53ef0a1a6930375845a554a..1f4bbf13bfe6608e0c73a0c5a52f0296de0cb44d 100644 --- a/translations/kylin-scanner_ky.ts +++ b/translations/kylin-scanner_ky.ts @@ -332,6 +332,10 @@ Multiple Көп + + ADF Duplex + АДФ Дуплекс + ScanDialog diff --git a/translations/kylin-scanner_ug.qm b/translations/kylin-scanner_ug.qm index 23c63ede8c32326ad1af178f83401d1adb29c471..3c2cbb7bc8492569d892f5e1aa0f5e17be8b5d8c 100644 Binary files a/translations/kylin-scanner_ug.qm and b/translations/kylin-scanner_ug.qm differ diff --git a/translations/kylin-scanner_ug.ts b/translations/kylin-scanner_ug.ts index 6ff52535f04749715ffbd68cd7087281918ef5a2..10a932fdbb72ac10069d4130af8a139758e03eda 100644 --- a/translations/kylin-scanner_ug.ts +++ b/translations/kylin-scanner_ug.ts @@ -332,6 +332,10 @@ Multiple كۆپ + + ADF Duplex + ADF Duplex + ScanDialog diff --git a/translations/kylin-scanner_zh_CN.qm b/translations/kylin-scanner_zh_CN.qm index 01b4f7dbbc8378303cced6a3a26b9af01f6cfe48..60048235ddddea5cb0d806b9c08e162101a052cc 100644 Binary files a/translations/kylin-scanner_zh_CN.qm and b/translations/kylin-scanner_zh_CN.qm differ diff --git a/translations/kylin-scanner_zh_CN.ts b/translations/kylin-scanner_zh_CN.ts index 1374233673fb06e30f0528a04e69bffd4992c7cd..17510330aae0e34048b0caceaaab208b12f4e8f3 100644 --- a/translations/kylin-scanner_zh_CN.ts +++ b/translations/kylin-scanner_zh_CN.ts @@ -121,7 +121,7 @@ 检测扫描设备中,请稍后 …… - + Detect scanners, please waiting 检测扫描设备中,请稍后 @@ -129,12 +129,12 @@ FailedPageWidget - + Not detect scanners, please connect scanners firstly! 未检测到可用扫描设备,请先连接扫描设备 - + Connect 连接扫描仪 @@ -170,7 +170,7 @@ LeftSuccessPageWidget - + Connect scanners, please click scan button to start scanning. 已连接扫描设备,点击按钮开始扫描 @@ -178,17 +178,17 @@ MainWidget - + kylin-scanner 麒麟扫描 - + Scanner 扫描 - + Yes @@ -197,67 +197,67 @@ 存在新设备连接,请手动重启应用使用该新设备。 - - - + + + There is a new scanner connect, redetect all scanners, please wait a moment. 存在新设备连接,正在重新检测所有扫描设备,请稍等。 - - + + No available device 无可用设备 - - + + device 设备 - - + + has been disconnect. 已经断开连接! - + Single 单页扫描 - + Invalid argument, please change arguments or switch other scanners. 非法参数,请更改扫描参数或切换到其他扫描仪。 - + Device busy, please wait or switch other scanners. 设备正忙,请耐心等待或切换到其他扫描仪。 - + Document feeder out of documents, please place papers and scan again. 扫描件为空,请放置扫描件重新扫描。 - + Scan operation has been cancelled. 扫描操作已经被取消! - + Scan failed, please check your scanner or switch other scanners. 扫描失败,请检查当前扫描仪连接或切换到其他扫描仪。 - + Running beauty ... 一键美化中 ... - + Running rectify ... 智能纠偏中 ... @@ -308,8 +308,8 @@ OcrThread - - + + Unable to read text 不能识别到文本。 @@ -366,87 +366,87 @@ 默认类型 - + Flatbed 平板式 - + ADF 馈纸式 - + ADF Front ADF 正面 - + ADF Back ADF背面 - + ADF Duplex ADF 双面 - - + + 4800 dpi 4800 dpi - - + + 2400 dpi 2400 dpi - - + + 1200 dpi 1200 dpi - - + + 600 dpi 600 dpi - - + + 300 dpi 300 dpi - - + + 200 dpi 200 dpi - - + + 150 dpi 150 dpi - - + + 100 dpi 100 dpi - - + + 75 dpi 75 dpi - - + + Auto 自动 @@ -469,27 +469,27 @@ SaneObject - + Default Type 默认类型 - + Flatbed 平板式 - + ADF 馈纸式 - + ADF Front ADF 正面 - + ADF Back ADF 背面 @@ -506,52 +506,57 @@ 彩色 - + + ADF Duplex + ADF 双面 + + + Auto 自动 - + 75 dpi 75 dpi - + 150 dpi 150 dpi - + 200 dpi 200 dpi - + 300 dpi 300 dpi - + 600 dpi 600 dpi - + 1200 dpi 1200 dpi - + 2400 dpi 2400 dpi - + 4800 dpi 4800 dpi - + Multiple 多页扫描 @@ -598,95 +603,95 @@ ScanSettingsWidget - + Begin Scan 开始扫描 - + Scanner device 扫描仪设备 - - + + Time 延时 - + File settings 文件预设 - + Device 设备 - + Select a directory 选择目录 - + Currently user has no permission to modify directory 目前用户没有权限更改目录 - - + + Multiple 多页扫描 - + Pages 页数 - + Type 类型 - - + + Color 彩色 - + Resolution 分辨率 - + Size 尺寸 - + Format 格式 - + Name 名称 - + scanner01 scanner01 - + Save 扫描至 - + Mail to 发送邮件 @@ -695,143 +700,143 @@ 发送至邮箱 - - + + Save as 另存为 - + No available scanners 无可用设备 - - + + Single 单页扫描 - + 4800 dpi 4800 dpi - + 2400 dpi 2400 dpi - + 1200 dpi 1200 dpi - + This resolution will take a loog time to scan, please choose carelly. 该分辨率将会花费很长时间扫描,请谨慎选择! - - + + cannot contain '/' character. 不能包含字符 / 。 - - + + cannot save as hidden file. 不能存为隐藏文件。 - - + + Store text 存储文本 - + Save as dialog 另存为 - + Colour 颜色 - + 3s 3 秒 - + 5s 5 秒 - + 7s 7 秒 - + 10s 10 秒 - + 15s 15 秒 - + Flatbed 平板式 - + ADF 馈纸式 - + Gray 灰度 - - + + Lineart 黑白 - + 75 dpi 75 dpi - + 100 dpi 100 dpi - + 150 dpi 150 dpi - + Resolution is empty! 当前扫描分辨率为空! - + A4 A4 - + A5 A5 @@ -840,12 +845,12 @@ 扫描文档名称的长度不能超过252。 - + Scanner 扫描 - + Yes @@ -853,32 +858,32 @@ ScanThread - + Multiple 多页扫描 - + 3s 3 秒 - + 5s 5 秒 - + 7s 7 秒 - + 10s 10 秒 - + 15s 15 秒 @@ -926,7 +931,7 @@ - + Scanner 扫描 @@ -947,7 +952,7 @@ - + Maximize 最大化 @@ -976,22 +981,22 @@ 退出 - + Restore 还原 - + The current document is not saved. Do you want to save it? 当前文档未保存,是否保存? - + Straight &Exit 直接退出 - + &Save Exit 保存后退出 @@ -1076,17 +1081,17 @@ main - + Open file <filename> 打开文件 <filename> - + Filename 文件名 - + Hide scan settings widget 隐藏扫描设置页面