fix(bug修复): wayland适配——双标题栏;窗口居中;修复bug同步

This commit is contained in:
zhaoyuzhen@kylinos.cn 2022-07-19 08:46:59 +08:00
parent 0ca04d08ef
commit 00760b759c
41 changed files with 1076 additions and 272 deletions

View File

@ -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=An interface-friendly scanner, which could be also used as one-click beautification, intelligent correction and text recognition tools.
Comment[zh_CN]=一款可用于普通扫描、一键美化、智能纠偏和文字识别的界面友好扫描仪软件。 Comment[zh_CN]=一款可用于普通扫描、一键美化、智能纠偏和文字识别的界面友好扫描仪软件。
Comment[bo_CN]=སྤྱིར་བཏང་གི་བཤར་འབེབས།མཐེབ་གཅིག་མཛེས་བཟོ།རིག་ནུས་ཡོ་འཁྱོག་དང་ཡི་གེ་དབྱེ་འབྱེད་་ལྡན་པའི་མཚམས་ངོས་མཛའ་མཐུན་གྱི་བཤར་འབེབས་མཉེན་ཆས་ཤིག Comment[bo_CN]=སྤྱིར་བཏང་གི་བཤར་འབེབས།མཐེབ་གཅིག་མཛེས་བཟོ།རིག་ནུས་ཡོ་འཁྱོག་དང་ཡི་གེ་དབྱེ་འབྱེད་་ལྡན་པའི་མཚམས་ངོས་མཛའ་མཐུན་གྱི་བཤར་འབེབས་མཉེན་ཆས་ཤིག
Exec=kylin-scanner %U Exec=/usr/bin/kylin-scanner %U
Icon=kylin-scanner Icon=kylin-scanner
Type=Application Type=Application
Categories=Application;Graphics;RasterGraphics;Scanning;OCR;2DGraphics; Categories=Application;Graphics;RasterGraphics;Scanning;OCR;2DGraphics;
Keywords=scannerfrontend Keywords=scannerfrontend
StartupNotify=true 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

BIN
data/kylin-scanner/kylin-scanner.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

15
debian/changelog vendored
View File

@ -1,3 +1,18 @@
kylin-scanner (3.2.0.4-ok3) yangtze; urgency=medium
* BUG号#109782 【用户手册】【摄像头】用户手册首页摄像头的图标icon需替换为寻光主题图标
#120922 【UI】【扫描】浅色模式下未连接扫描时”连接扫描仪“按钮字体颜色为白色看不清
#118765 【藏语】【扫描】藏文系统扫描部分界面显示为英文
#126288 【扫描】扫描-关于中没有版本号
#126519 【扫描】浅色主题下,开始扫描按钮不是蓝色的
#127014 【wayland】【扫描】识别到扫描仪可扫描状态下"开始扫描"按钮未变为蓝色,需要将鼠标移上去变亮
#127002 【wayland】【扫描】连接扫描仪后点击开始扫描提示"扫描失败请检查当前扫描仪连接..."低概率在10分钟后能够扫描成功
* 需求号:无
* 其他改动说明wayland部分适配:双标题栏;窗口不居中
* 其他改动影响域:无
-- zhaoyuzhen <zhaoyuzhen@kylinos.cn> Mon, 18 Jul 2022 10:39:12 +0800
kylin-scanner (3.2.0.4-ok2) yangtze; urgency=medium kylin-scanner (3.2.0.4-ok2) yangtze; urgency=medium
* Fix build error * Fix build error

43
debian/control vendored
View File

@ -4,31 +4,32 @@ Priority: optional
Maintainer: Kylin Team <team+kylin@tracker.debian.org> Maintainer: Kylin Team <team+kylin@tracker.debian.org>
Uploaders: handsome_feng <jianfengli@ubuntukylin.com> Uploaders: handsome_feng <jianfengli@ubuntukylin.com>
Build-Depends: debhelper-compat (=12), Build-Depends: debhelper-compat (=12),
libqt5svg5-dev,
libglib2.0-dev,
libx11-dev,
libgsettings-qt-dev,
libsane-dev,
libopencv-dev,
libstb-dev,
libgif-dev,
libpng-dev,
libfreeimage-dev, libfreeimage-dev,
libfreeimageplus-dev, libfreeimageplus-dev,
libgif-dev,
libglib2.0-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,
libstb-dev,
libtesseract-dev, libtesseract-dev,
libukui-log4qt-dev, libleptonica-dev,
libx11-dev, liblept5,
pkgconf,
policykit-1,
qt5-qmake, qt5-qmake,
qtbase5-dev, qtbase5-dev,
qtbase5-dev-tools, 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 Standards-Version: 4.5.0
Rules-Requires-Root: no Rules-Requires-Root: no
Homepage: https://github.com/ubuntukylin/kylin-scanner Homepage: https://github.com/ubuntukylin/kylin-scanner
@ -37,10 +38,10 @@ Vcs-Browser: https://github.com/ubuntukylin/kylin-scanner
Package: kylin-scanner Package: kylin-scanner
Architecture: any Architecture: any
Depends: tesseract-ocr, Depends: ${misc:Depends},
tesseract-ocr,
tesseract-ocr-chi-sim, tesseract-ocr-chi-sim,
tesseract-ocr-eng, tesseract-ocr-eng,
${misc:Depends},
${shlibs:Depends} ${shlibs:Depends}
Description: Scanning utility based on SANE Description: Scanning utility based on SANE
Kylin-scanner can scan according to the resolution, size and color Kylin-scanner can scan according to the resolution, size and color

53
kabase/Qt/log.hpp Normal file
View File

@ -0,0 +1,53 @@
/*
* Log Qt kysdk-log Qt库 kysdk-log
*/
#ifndef LOG_HPP_
#define LOG_HPP_
#include <qapplication.h>
#include <libkylog.h>
#include <QString>
#include <QByteArray>
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

View File

@ -0,0 +1,88 @@
#ifndef QT_WINDOWMANAGE_HPP_
#define QT_WINDOWMANAGE_HPP_
/*
* windowmanage 使 kysdk-waylandhelper 使 kysdk-waylandhelper
*/
#include <unistd.h>
#include <QApplication>
#include <QScreen>
#include <QWidget>
#include <QRect>
#include <windowmanager/windowmanager.h>
#include <ukuistylehelper/ukuistylehelper.h>
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

306
kabase/buriedpoint.hpp Normal file
View File

@ -0,0 +1,306 @@
/*
* BuriedPoint 使 kysdk-log kysdk-diagnostics kysdk-log kysdk-diagnostics
*/
#ifndef BURIEDPOINT_HPP_
#define BURIEDPOINT_HPP_
#include <sstream>
#include <iostream>
#include <string.h>
#include <map>
#include <libkydiagnostics.h>
#include <libkylog.h>
#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<std::string, std::string> 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<std::string, std::string>::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

88
kabase/utils.hpp Normal file
View File

@ -0,0 +1,88 @@
#ifndef UTILS_HPP_
#define UTILS_HPP_
#include <string>
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

View File

@ -13,9 +13,10 @@ QT += \
svg svg
# 配置kysdk # 配置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 += /usr/include/kysdk/applications/kabase/
INCLUDEPATH += kabase/ \
kabase/Qt
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = kylin-scanner TARGET = kylin-scanner

View File

@ -1,6 +1,6 @@
#include "about.h" #include "about.h"
#include "ui_about.h" #include "ui_about.h"
#include <kylin_system/window_management.hpp> #include "kabase/Qt/windowmanage.hpp"
#include <gsettings.hpp> #include <gsettings.hpp>
@ -24,9 +24,9 @@ AboutDialog::AboutDialog(QWidget *parent)
void AboutDialog::titlebar_icon_theme_changed() void AboutDialog::titlebar_icon_theme_changed()
{ {
setWindowIcon(QIcon::fromTheme("kylin-scanner")); // setWindowIcon(QIcon::fromTheme("kylin-scanner"));
ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size())); // ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size()));
ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96)); // ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96));
} }
void AboutDialog::titlebar_style_changed() void AboutDialog::titlebar_style_changed()
@ -59,11 +59,11 @@ AboutDialog::~AboutDialog()
void AboutDialog::initWindow() void AboutDialog::initWindow()
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setWindowModality(Qt::ApplicationModal); setWindowModality(Qt::ApplicationModal);
setWindowTitle(tr("About")); setWindowTitle(tr("About"));
setWindowIcon(QIcon::fromTheme("kylin-scanner")); // setWindowIcon(QIcon::fromTheme("kylin-scanner"));
setFixedSize(QSize(420, 448-80)); setFixedSize(QSize(420, 448-80));
} }
@ -72,9 +72,14 @@ void AboutDialog::initLayout()
{ {
QString appVersion = QCoreApplication::applicationVersion(); QString appVersion = QCoreApplication::applicationVersion();
ui->labelVersion->setText(tr("Version: " ) + appVersion); ui->labelVersion->setText(tr("Version: " ) + appVersion);
ui->titleIcon->setIcon(QIcon::fromTheme("kylin-scanner"));
ui->labelLogo->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(ui->labelLogo->size())); ui->titleIcon->setFixedSize(30,30);
ui->labelIcon->setPixmap(QIcon::fromTheme("kylin-scanner").pixmap(96, 96)); 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->labelName->setText(tr("Scanner"));
ui->labelTitle->setText(tr("Scanner")); ui->labelTitle->setText(tr("Scanner"));

View File

@ -66,7 +66,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="labelLogo"> <widget class="QPushButton" name="titleIcon">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>24</width> <width>24</width>
@ -79,9 +79,27 @@
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -141,12 +159,36 @@
<number>16</number> <number>16</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="labelIcon"> <widget class="QPushButton" name="bigIcon">
<property name="minimumSize">
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment"> <property name="iconSize">
<set>Qt::AlignCenter</set> <size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -36,12 +36,6 @@ bool FailedPageWidget::isDarkTheme()
} }
void FailedPageWidget::setupGui() 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_failedPageIcon->setFixedSize(FailedPageIconSize);
m_failedPageText->setEnabled(false); m_failedPageText->setEnabled(false);
@ -54,8 +48,13 @@ void FailedPageWidget::setupGui()
m_failedPageButton->setFocus(); m_failedPageButton->setFocus();
m_failedPageButton->setDefault(true); 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->setSpacing(0);
m_failedPageVLayout->addStretch(); m_failedPageVLayout->addStretch();

View File

@ -216,8 +216,6 @@ void GlobalUserSignal::stopOcrTimer()
{ {
emit stopOcrTimerSignal(); emit stopOcrTimerSignal();
} }
GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent) GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent)
{ {

View File

@ -26,7 +26,7 @@
/******** Mainwidget ********/ /******** Mainwidget ********/
#define MainWidgetWidth 960 #define MainWidgetWidth 960
#define MainWidgetHeight 676 #define MainWidgetHeight 677
#define ApplicationName "Scanner" #define ApplicationName "Scanner"
/******** TitlebarWidget ********/ /******** TitlebarWidget ********/
@ -40,7 +40,7 @@
// font size by desinger maybe small, so normal font can make window large // font size by desinger maybe small, so normal font can make window large
#define AddWidthForLargeFontSize 20 #define AddWidthForLargeFontSize 20
#define ScanSettingsWidgetWidth (248+AddWidthForLargeFontSize) #define ScanSettingsWidgetWidth (250+AddWidthForLargeFontSize)
#define ScanSettingsWidgetHeight (MainWidgetHeight-TitlebarHeight) #define ScanSettingsWidgetHeight (MainWidgetHeight-TitlebarHeight)
#define ScanSettingsWidgetScanButtonSize QSize(144, 36)//216, 36 #define ScanSettingsWidgetScanButtonSize QSize(144, 36)//216, 36
#define ScanSettingsWidgetComboboxSize QSize(144, 36)//166, 36 #define ScanSettingsWidgetComboboxSize QSize(144, 36)//166, 36
@ -54,7 +54,7 @@
/******** LeftSuccessPageWidget ********/ /******** LeftSuccessPageWidget ********/
#define LeftSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth) #define LeftSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth)
#define LeftSuccessPageHeight (MainWidgetHeight-TitlebarHeight) #define LeftSuccessPageHeight (MainWidgetHeight-TitlebarHeight)
#define LeftSuccessPageIconSize QSize(101, 91) #define LeftSuccessPageIconSize QSize(128, 128)
/******** LeftImageHandleSuccessPageWidget ********/ /******** LeftImageHandleSuccessPageWidget ********/
#define LeftImageHandleSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth) #define LeftImageHandleSuccessPageWidth (MainWidgetWidth-ScanSettingsWidgetWidth)

View File

@ -16,6 +16,8 @@
* *
*/ */
#include "leftsuccesspagewidget.h" #include "leftsuccesspagewidget.h"
#include "include/theme.h"
#include <gsettings.hpp>
LeftSuccessPageWidget::LeftSuccessPageWidget(QWidget *parent) : LeftSuccessPageWidget::LeftSuccessPageWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
@ -24,12 +26,32 @@ LeftSuccessPageWidget::LeftSuccessPageWidget(QWidget *parent) :
m_connectSuccessVLayout(new QVBoxLayout(this)) m_connectSuccessVLayout(new QVBoxLayout(this))
{ {
setupGui(); 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() void LeftSuccessPageWidget::setupGui()
{ {
setMinimumSize(LeftSuccessPageWidth, LeftSuccessPageHeight); 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_connectSuccessIcon->setFixedSize(LeftSuccessPageIconSize);
m_connectSuccessText->setEnabled(false); m_connectSuccessText->setEnabled(false);

View File

@ -46,6 +46,9 @@ private:
QLabel *m_connectSuccessIcon; QLabel *m_connectSuccessIcon;
QLabel *m_connectSuccessText; QLabel *m_connectSuccessText;
QVBoxLayout *m_connectSuccessVLayout; QVBoxLayout *m_connectSuccessVLayout;
bool isDarkTheme();
private slots:
void initTheme();
}; };

View File

@ -38,8 +38,10 @@
#include <QFileInfo> #include <QFileInfo>
#include <fstream> #include <fstream>
#include <stdio.h> #include <stdio.h>
#include <log.hpp> #include "log.hpp"
#include <single_application/single_application.hpp> #include "windowmanage.hpp"
#include <singleapplication.h>
#include <QDebug>
#define TRANS_PATH "/usr/share/kylin-scanner/translations" #define TRANS_PATH "/usr/share/kylin-scanner/translations"
@ -148,7 +150,7 @@ static QString getAppVersion()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
/* 使用sdk管理日志 */ /* 使用sdk管理日志 */
qInstallMessageHandler(kdk::kabase::Log::logOutput); qInstallMessageHandler(::kabase::Log::logOutput);
QString scannerFileName; QString scannerFileName;
if (argc > 1) { if (argc > 1) {
@ -165,13 +167,13 @@ int main(int argc, char *argv[])
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif #endif
/* 适配4K屏 */
::kabase::WindowManage::setScalingProperties();
kdk::kabase::QtSingleApplication app(argc, argv); kdk::QtSingleApplication app(argc, argv);
createScannerDir(); createScannerDir();
// Global::global_init();
getSystemArchitecture(); getSystemArchitecture();
app.setApplicationVersion(getAppVersion()); app.setApplicationVersion(getAppVersion());
app.setWindowIcon (QIcon::fromTheme("kylin-scanner")); app.setWindowIcon (QIcon::fromTheme("kylin-scanner"));
@ -258,6 +260,7 @@ int main(int argc, char *argv[])
{ {
qDebug() << "加载中文失败"; qDebug() << "加载中文失败";
} }
app.setApplicationVersion("3.2.0");
if (! app.isRunning()) { if (! app.isRunning()) {
QString userNow = getCurrentUserName(); QString userNow = getCurrentUserName();
@ -265,11 +268,31 @@ int main(int argc, char *argv[])
doWrite(userNow, pidNow); doWrite(userNow, pidNow);
MainWidget w; MainWidget *w = new MainWidget;
// app.w = &w; /* 最小化拉起 */
// w.show(); app.setActivationWindow(w);
app.setActivationWindow(&w);
w.show(); /* 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(); return app.exec();

View File

@ -25,6 +25,7 @@
#include <gsettings.hpp> #include <gsettings.hpp>
#include <kylin_system/user_manual.hpp> #include <kylin_system/user_manual.hpp>
#include <KWindowEffects> #include <KWindowEffects>
#include "kabase/Qt/windowmanage.hpp"
@ -39,6 +40,7 @@ MainWidget::MainWidget(QWidget *parent)
// m_displayScrollArea(new QScrollArea), // m_displayScrollArea(new QScrollArea),
m_mainWidgetVLayout(new QVBoxLayout()) m_mainWidgetVLayout(new QVBoxLayout())
{ {
kabase::WindowManage::getWindowId(&windowId);
setupGui(); setupGui();
initConnect(); initConnect();
initGsettings(); initGsettings();
@ -68,13 +70,13 @@ void MainWidget::setupGui()
this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAttribute(Qt::WA_TranslucentBackground, true);
// Add window control protocol // Add window control protocol
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
resize(MainWidgetWidth, MainWidgetHeight); resize(MainWidgetWidth, MainWidgetHeight);
setMinimumSize(MainWidgetWidth, MainWidgetHeight); setMinimumSize(MainWidgetWidth, MainWidgetHeight);
setWindowTitle(tr("kylin-scanner")); setWindowTitle(tr("kylin-scanner"));
this->setWindowIcon(QIcon::fromTheme("kylin-scanner")); // this->setWindowIcon(QIcon::fromTheme("kylin-scanner"));
setMouseTracking(true); setMouseTracking(true);
setAutoFillBackground(true); setAutoFillBackground(true);
setAcceptDrops(true); setAcceptDrops(true);
@ -191,7 +193,7 @@ void MainWidget::themeChange()
void MainWidget::iconThemeNameChange() 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->setText(msg);
msgBox->setIcon(QMessageBox::Warning); msgBox->setIcon(QMessageBox::Warning);
msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); // msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner"));
msgBox->setWindowTitle(tr("Scanner")); msgBox->setWindowTitle(tr("Scanner"));
msgBox->setStandardButtons(QMessageBox::Yes); msgBox->setStandardButtons(QMessageBox::Yes);
msgBox->setContextMenuPolicy(Qt::NoContextMenu); msgBox->setContextMenuPolicy(Qt::NoContextMenu);
@ -374,7 +376,9 @@ void MainWidget::maximizeWindowSlot()
} }
} }
} }
quint32 MainWidget::getWindowId(){
return windowId;
}
void MainWidget::closeWindowSlot() void MainWidget::closeWindowSlot()
{ {
exit(0); exit(0);

View File

@ -162,10 +162,11 @@ public:
void fontSizeChange(); void fontSizeChange();
void transparencyChange(); void transparencyChange();
void warnMsg(QString msg); void warnMsg(QString msg);
quint32 getWindowId();
void reboot(); void reboot();
static int const EXIT_CODE_REBOOT; static int const EXIT_CODE_REBOOT;
quint32 windowId = 0;
protected: protected:
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;

View File

@ -17,8 +17,8 @@
*/ */
#include "runningdialog.h" #include "runningdialog.h"
#include <kylin_system/window_management.hpp>
#include <gsettings.hpp> #include <gsettings.hpp>
#include "kabase/Qt/windowmanage.hpp"
RunningDialog::RunningDialog(QWidget *parent) RunningDialog::RunningDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
@ -33,7 +33,8 @@ RunningDialog::RunningDialog(QWidget *parent)
, hLayoutCancel (new QHBoxLayout()) , hLayoutCancel (new QHBoxLayout())
, vLayout (new QVBoxLayout()) , vLayout (new QVBoxLayout())
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); /* 移除标题栏 */
::kabase::WindowManage::removeHeader(this);
setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT); setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT);
@ -119,7 +120,7 @@ RunningDialog::RunningDialog(QWidget *parent, QString text)
, vLayout (new QVBoxLayout()) , vLayout (new QVBoxLayout())
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT); setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT);

View File

@ -183,11 +183,13 @@ static SANE_Status onScanning(FILE *ofp)
do { do {
if (!first_frame) { if (!first_frame) {
qDebug() << "sane start!";
status = sane_start (g_device); status = sane_start (g_device);
if (status != SANE_STATUS_GOOD) if (status != SANE_STATUS_GOOD)
goto cleanup; goto cleanup;
} }
qDebug()<<"sane get parameter";
status = sane_get_parameters (g_device, &parm); status = sane_get_parameters (g_device, &parm);
KyInfo() << "Parm : status = " << sane_strstatus(status) KyInfo() << "Parm : status = " << sane_strstatus(status)
<< "format = " << parm.format << "format = " << parm.format
@ -230,6 +232,7 @@ static SANE_Status onScanning(FILE *ofp)
switch(g_sane_object->output_format) switch(g_sane_object->output_format)
{ {
case OUTPUT_PNM: case OUTPUT_PNM:
qDebug()<<"start write file!";
writePnmHeader (parm.format, parm.pixels_per_line, parm.lines, parm.depth, ofp); writePnmHeader (parm.format, parm.pixels_per_line, parm.lines, parm.depth, ofp);
break; break;
#if HAVE_LIBJPEG #if HAVE_LIBJPEG
@ -282,7 +285,9 @@ static SANE_Status onScanning(FILE *ofp)
hundred_percent = parm.bytes_per_line * parm.lines \ hundred_percent = parm.bytes_per_line * parm.lines \
*((parm.format == SANE_FRAME_RGB || parm.format == SANE_FRAME_GRAY) ? 1 : 3); *((parm.format == SANE_FRAME_RGB || parm.format == SANE_FRAME_GRAY) ? 1 : 3);
while (1) { while (1) {
static int i =0;
double progr; double progr;
qDebug()<<"read file!" << i++;
status = sane_read (g_device, g_buf, g_BufSize, &len); status = sane_read (g_device, g_buf, g_BufSize, &len);
total_bytes += (SANE_Word) len; total_bytes += (SANE_Word) len;
if(hundred_percent == 0){ 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; 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); 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) { if (status != SANE_STATUS_GOOD) {
KyInfo() << "status = " << status << "desc: " << sane_strstatus(status); KyInfo() << "status = " << status << "desc: " << sane_strstatus(status);
return 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; 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, status = sane_control_option(sane_handle, optnum,
SANE_ACTION_SET_VALUE, &val_size, nullptr); 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; SANE_Status status = SANE_STATUS_GOOD;
KyInfo() << "Size bottom-right location(xy) = " << val_size_br_x << val_size_br_y; KyInfo() << "Size bottom-right location(xy) = " << val_size_br_x << val_size_br_y;
int index = -1;
status = setOptionSizes(sane_handle, g_optDesc.numSizeBrX, SANE_FIX(val_size_br_x)); if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_BR_X,index)){
if (status != SANE_STATUS_GOOD) { status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_x));
KyInfo() << "status = " << sane_strstatus(status); if (status != SANE_STATUS_GOOD) {
return status; KyInfo() << "status = " << sane_strstatus(status);
return status;
}
index = -1;
} }
status = setOptionSizes(sane_handle, g_optDesc.numPageWidth, SANE_FIX(val_size_br_x)); if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_BR_Y,index)){
if (status != SANE_STATUS_GOOD) { status = setOptionSizes(sane_handle, index, SANE_FIX(val_size_br_y));
KyInfo() << "status = " << sane_strstatus(status); if (status != SANE_STATUS_GOOD) {
return status; KyInfo() << "status = " << sane_strstatus(status);
return status;
}
index = -1;
} }
status = setOptionSizes(sane_handle, g_optDesc.numSizeBrY, SANE_FIX(val_size_br_y)); if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_TL_X,index)){
if (status != SANE_STATUS_GOOD) { status = setOptionSizes(sane_handle, index, SANE_FIX(0));
KyInfo() << "status = " << sane_strstatus(status); if (status != SANE_STATUS_GOOD) {
return status; KyInfo() << "status = " << sane_strstatus(status);
return status;
}
index = -1;
} }
status = setOptionSizes(sane_handle, g_optDesc.numPageHeight, SANE_FIX(val_size_br_y)); if(g_sane_object->getSaneOptIndex(SANE_NAME_SCAN_TL_Y,index)){
if (status != SANE_STATUS_GOOD) { status = setOptionSizes(sane_handle, index, SANE_FIX(0));
KyInfo() << "status = " << sane_strstatus(status); if (status != SANE_STATUS_GOOD) {
return status; 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; return status;
} }
@ -1919,9 +1956,44 @@ void SaneObject::saneClose()
} }
stopSaneRead(true); 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 ()<<opt << desc->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() void SaneObject::setSaneAllParametersByUser()
{ {
dumpScannerOptions();
setSaneNameByUser(); setSaneNameByUser();
setSanePageNumberByUser(); setSanePageNumberByUser();
setSaneTimeByUser(); setSaneTimeByUser();
@ -2041,15 +2113,10 @@ void SaneObject::setSaneResolutionByUser()
SANE_Status status = SANE_STATUS_GOOD; SANE_Status status = SANE_STATUS_GOOD;
QString resolution = g_sane_object->userInfo.resolution; QString resolution = g_sane_object->userInfo.resolution;
SANE_Int i_resolution; SANE_Int i_resolution;
KyInfo() << "resolution = " << resolution; KyInfo() << "resolution = " << resolution;
resolutionValue = getSaneResolutionByUser(resolution); resolutionValue = getSaneResolutionByUser(resolution);
i_resolution = static_cast<SANE_Int>(resolutionValue); i_resolution = static_cast<SANE_Int>(resolutionValue);
resolution_value = i_resolution; resolution_value = i_resolution;
status = setOptionResolutions(g_sane_object->handle, i_resolution); status = setOptionResolutions(g_sane_object->handle, i_resolution);
if (status != SANE_STATUS_GOOD) { if (status != SANE_STATUS_GOOD) {
KyInfo() << "Failed to set option resolution: " << resolution KyInfo() << "Failed to set option resolution: " << resolution
@ -2299,3 +2366,16 @@ bool SaneObject::testScannerIsAlive(QString deviceName)
KyInfo() << "deviceName= " << deviceName; KyInfo() << "deviceName= " << deviceName;
return true; 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;
}

View File

@ -43,7 +43,7 @@
//using namespace std; //using namespace std;
#include "globalsignal.h" #include "globalsignal.h"
#include <QMap>
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif
@ -196,7 +196,7 @@ public:
int output_format = OUTPUT_PNM; int output_format = OUTPUT_PNM;
int resolution_value; int resolution_value;
bool getSaneOptIndex(QString desc,int &index);
private: private:
static SaneObject *instance; static SaneObject *instance;
@ -206,7 +206,9 @@ private:
SaneObject &operator = (const SaneObject &) = delete ; SaneObject &operator = (const SaneObject &) = delete ;
ScanDeviceInfo devicesInfo; ScanDeviceInfo devicesInfo;
//QString : 属性描述, int:属性index
QMap<QString,int> m_saneOptions;
void dumpScannerOptions();
public slots: public slots:
void stopSaneRead(bool isStoped); void stopSaneRead(bool isStoped);
void stopSaneForException(); void stopSaneForException();

View File

@ -27,7 +27,7 @@
SaveFileDialog::SaveFileDialog(QWidget *parent) : QFileDialog(parent) SaveFileDialog::SaveFileDialog(QWidget *parent) : QFileDialog(parent)
{ {
setWindowIcon(QIcon::fromTheme("kylin-scanner")); // setWindowIcon(QIcon::fromTheme("kylin-scanner"));
setNameFilter(QLatin1String("*.jpg;;*.png;;*.pdf;;*.bmp")); setNameFilter(QLatin1String("*.jpg;;*.png;;*.pdf;;*.bmp"));
setAcceptMode(QFileDialog::AcceptSave); setAcceptMode(QFileDialog::AcceptSave);
this->findChildren<QLineEdit *>("fileNameEdit").at(0)->setText(initFilename); this->findChildren<QLineEdit *>("fileNameEdit").at(0)->setText(initFilename);
@ -57,7 +57,7 @@ SaveFileDialog::SaveFileDialog(QWidget *parent, int ocrFlag, QString filename, Q
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
setWindowIcon(QIcon::fromTheme("kylin-scanner")); // setWindowIcon(QIcon::fromTheme("kylin-scanner"));
setWindowTitle(titlename); setWindowTitle(titlename);
setAcceptMode(QFileDialog::AcceptSave); setAcceptMode(QFileDialog::AcceptSave);

View File

@ -1,7 +1,7 @@
#include "scandialog.h" #include "scandialog.h"
#include "./utils/xatom-helper.h" #include "./utils/xatom-helper.h"
#include "globalsignal.h" #include "globalsignal.h"
#include <kylin_system/window_management.hpp> #include "kabase/Qt/windowmanage.hpp"
#include <gsettings.hpp> #include <gsettings.hpp>
#include "include/theme.h" #include "include/theme.h"
@ -22,10 +22,10 @@ ScanDialog::ScanDialog(QWidget *parent) : QDialog(parent),
void ScanDialog::setupGui() void ScanDialog::setupGui()
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setWindowModality(Qt::ApplicationModal); setWindowModality(Qt::ApplicationModal);
setWindowIcon(QIcon::fromTheme("kylin-scanner")); // setWindowIcon(QIcon::fromTheme("kylin-scanner"));
this->setWindowTitle(tr("Scanner")); this->setWindowTitle(tr("Scanner"));
this->setFixedSize(ScanDialogWindowSize); this->setFixedSize(ScanDialogWindowSize);

View File

@ -506,7 +506,11 @@ void ScanSettingsWidget::setupGui()
// m_scanButton->setFixedSize(QSize(193+AddWidthForLargeFontSize, 36)); // m_scanButton->setFixedSize(QSize(193+AddWidthForLargeFontSize, 36));
m_scanButton->setCursor(Qt::PointingHandCursor); m_scanButton->setCursor(Qt::PointingHandCursor);
scanButtonRightLabel->setStyleSheet("color:white;"); 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); // m_deviceComboBox->setFixedSize(ScanSettingsWidgetComboboxSize);
@ -579,8 +583,6 @@ void ScanSettingsWidget::setupGui()
m_sendMailButton->setMinimumSize(ScanSettingsWidgetButtonSize); m_sendMailButton->setMinimumSize(ScanSettingsWidgetButtonSize);
m_SaveAsButton->setMinimumSize(ScanSettingsWidgetButtonSize); m_SaveAsButton->setMinimumSize(ScanSettingsWidgetButtonSize);
m_buttonsHLayout->setSpacing(0); m_buttonsHLayout->setSpacing(0);
//m_buttonsHLayout->addSpacing(16-spacing); //m_buttonsHLayout->addSpacing(16-spacing);
m_buttonsHLayout->addWidget(m_sendMailButton); m_buttonsHLayout->addWidget(m_sendMailButton);
@ -594,9 +596,9 @@ void ScanSettingsWidget::setupGui()
m_mainVLayout->addSpacing(16); m_mainVLayout->addSpacing(16);
m_mainVLayout->addLayout(m_settingsFormLayout); m_mainVLayout->addLayout(m_settingsFormLayout);
//m_mainVLayout->addStretch(); //m_mainVLayout->addStretch();
m_mainVLayout->addSpacing(32);
m_mainVLayout->addLayout(m_buttonsHLayout);
m_mainVLayout->addSpacing(16); m_mainVLayout->addSpacing(16);
m_mainVLayout->addLayout(m_buttonsHLayout);
m_mainVLayout->addSpacing(24);
m_mainVLayout->setContentsMargins(0, 0, 0, 0); m_mainVLayout->setContentsMargins(0, 0, 0, 0);
@ -1125,7 +1127,7 @@ void ScanSettingsWidget::warnMsg(QString msg)
msgBox->setText(msg); msgBox->setText(msg);
msgBox->setIcon(QMessageBox::Warning); msgBox->setIcon(QMessageBox::Warning);
msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); // msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner"));
msgBox->setWindowTitle(tr("Scanner")); msgBox->setWindowTitle(tr("Scanner"));
msgBox->setStandardButtons(QMessageBox::Yes); msgBox->setStandardButtons(QMessageBox::Yes);
msgBox->setContextMenuPolicy(Qt::NoContextMenu); msgBox->setContextMenuPolicy(Qt::NoContextMenu);

View File

@ -18,6 +18,7 @@
#include "sendmail.h" #include "sendmail.h"
#include <kylin_system/window_management.hpp> #include <kylin_system/window_management.hpp>
#include "kabase/Qt/windowmanage.hpp"
NoMailDialog::NoMailDialog(QWidget *parent) : QDialog(parent) NoMailDialog::NoMailDialog(QWidget *parent) : QDialog(parent)
, m_noMailTitleTextLabel (new QLabel()) , m_noMailTitleTextLabel (new QLabel())
@ -47,7 +48,7 @@ NoMailDialog::~NoMailDialog()
void NoMailDialog::initWindow() void NoMailDialog::initWindow()
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setWindowTitle (tr("No email client")); setWindowTitle (tr("No email client"));
setFixedSize(NoMailWindowWidth, NoMainWindowHeight); setFixedSize(NoMailWindowWidth, NoMainWindowHeight);
@ -211,7 +212,7 @@ SendMailDialog::~SendMailDialog()
void SendMailDialog::initWindow() void SendMailDialog::initWindow()
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setWindowTitle (tr("Select email client")); setWindowTitle (tr("Select email client"));
setFixedSize(SendMailWindowWidth, SendMainWindowHeight); setFixedSize(SendMailWindowWidth, SendMainWindowHeight);

View File

@ -10,23 +10,25 @@ ThumbnailWidget::ThumbnailWidget(QWidget *parent) : QListView(parent)
setupGui(); setupGui();
initConnect(); initConnect();
initSettings(); initSettings();
themeChange();
} }
void ThumbnailWidget::paintEvent(QPaintEvent *event) //void ThumbnailWidget::paintEvent(QPaintEvent *event)
{ //{
Q_UNUSED(event); // Q_UNUSED(event);
QPainter p(this); // QPainter p(this);
p.setRenderHint(QPainter::Antialiasing); // p.setRenderHint(QPainter::Antialiasing);
QPainterPath rectPath; // QPainterPath rectPath;
rectPath.addRoundedRect(this->rect(), 0, 0); // rectPath.addRoundedRect(this->rect(), 0, 0);
QStyleOption opt; // QStyleOption opt;
opt.init(this); // opt.init(this);
QColor mainColor; // QColor mainColor;
mainColor = opt.palette.color(QPalette::Base); // mainColor = opt.palette.color(QPalette::Base);
p.fillPath(rectPath,QBrush(mainColor)); // p.fillPath(rectPath,QBrush(mainColor));
} //}
void ThumbnailWidget::setupGui() void ThumbnailWidget::setupGui()
{ {
this->setFixedWidth(ThumbnailWidgetMinimumWidth); this->setFixedWidth(ThumbnailWidgetMinimumWidth);
@ -52,11 +54,40 @@ void ThumbnailWidget::initConnect()
{ {
connect(g_user_signal, &GlobalUserSignal::scanThreadFinishedImageLoadSignal, this, &ThumbnailWidget::showNormalImageAfterScan); connect(g_user_signal, &GlobalUserSignal::scanThreadFinishedImageLoadSignal, this, &ThumbnailWidget::showNormalImageAfterScan);
connect(this, &ThumbnailWidget::clicked, this, &ThumbnailWidget::clickedItemSlot); 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() void ThumbnailWidget::initSettings()
{ {
showThumbnailIcon(); showThumbnailIcon();
@ -91,9 +122,9 @@ void ThumbnailWidget::showNormalImageAfterScan()
Mat iconMat = KylinImageCodec::loadThumbnailToMat(scanFullName).mat; Mat iconMat = KylinImageCodec::loadThumbnailToMat(scanFullName).mat;
QPixmap iconPix = KylinImageCodec::converFormat(iconMat); 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(); ScanStandardItem *item = new ScanStandardItem();
item->setIcon(QIcon(fitpixmap)); item->setIcon(QIcon(fitpixmap));
item->setToolTip(tooltipName); item->setToolTip(tooltipName);

View File

@ -25,7 +25,6 @@
#include <QFileInfo> #include <QFileInfo>
#include <QPaintEvent> #include <QPaintEvent>
#include <QPainter> #include <QPainter>
#include <QPainterPath>
#include <QStyleOption> #include <QStyleOption>
#include <QStyle> #include <QStyle>
@ -47,6 +46,7 @@ public:
private: private:
QString m_path; QString m_path;
int rowCountLocation; int rowCountLocation;
}; };
class ThumbnailWidget : public QListView class ThumbnailWidget : public QListView
@ -60,10 +60,12 @@ public:
void setupGui(); void setupGui();
void initConnect(); void initConnect();
void initSettings(); void initSettings();
void themeChange();
bool isDarkTheme();
protected: protected:
void paintEvent(QPaintEvent *event) override; // void paintEvent(QPaintEvent *event) override;
private: private:

View File

@ -40,6 +40,15 @@ TitleBar::TitleBar(QWidget *parent) :
m_menu->addAction(tr("About"), this, [ = ]() { m_menu->addAction(tr("About"), this, [ = ]() {
g_user_signal->showAboutDialog(); 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"), [ = ]() { 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->setText(tr("The current document is not saved. Do you want to save it?"));
msgBox->setIcon(QMessageBox::Warning); msgBox->setIcon(QMessageBox::Warning);
msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner")); // msgBox->setWindowIcon(QIcon::fromTheme("kylin-scanner"));
msgBox->setWindowTitle(tr("Scanner")); msgBox->setWindowTitle(tr("Scanner"));
// msgBox->setStandardButtons(QMessageBox::Yes); // msgBox->setStandardButtons(QMessageBox::Yes);
msgBox->setContextMenuPolicy(Qt::NoContextMenu); msgBox->setContextMenuPolicy(Qt::NoContextMenu);

View File

@ -31,6 +31,8 @@
#include <QWidget> #include <QWidget>
#include <QStyleOption> #include <QStyleOption>
#include <QSize> #include <QSize>
// 主题sdk关于
//#include "kaboutdialog.h"
//#include "../globalsignal.h" //#include "../globalsignal.h"
@ -77,6 +79,9 @@ public slots:
private: private:
Ui::TitleBar *ui; Ui::TitleBar *ui;
QMenu *m_menu = nullptr; QMenu *m_menu = nullptr;
// kdk::KAboutDialog *m_aboutWindow = nullptr; // 关于界面
// QString appShowingName = tr("kylin-camera");
// QString appVersion = qApp->applicationVersion();
}; };
#endif // TITLEBAR_H #endif // TITLEBAR_H

View File

@ -1,5 +1,5 @@
#include "watermarkdialog.h" #include "watermarkdialog.h"
#include <kylin_system/window_management.hpp> #include "kabase/Qt/windowmanage.hpp"
WatermarkDialog::WatermarkDialog(QWidget *parent) : QDialog(parent) WatermarkDialog::WatermarkDialog(QWidget *parent) : QDialog(parent)
, m_titleLable (new QLabel()) , m_titleLable (new QLabel())
@ -22,7 +22,7 @@ WatermarkDialog::WatermarkDialog(QWidget *parent) : QDialog(parent)
void WatermarkDialog::initWindow() void WatermarkDialog::initWindow()
{ {
kdk::kabase::WindowManagement::setWindowMotifHint(winId()); ::kabase::WindowManage::removeHeader(this);
setWindowTitle (tr("Scanner")); setWindowTitle (tr("Scanner"));
setFixedSize(QSize(380, 176)); setFixedSize(QSize(380, 176));

Binary file not shown.

View File

@ -582,7 +582,7 @@
</message> </message>
<message> <message>
<source>ADF Duplex</source> <source>ADF Duplex</source>
<translation>ADF Duplex</translation> <translation>ADF </translation>
</message> </message>
<message> <message>
<source>4800 dpi</source> <source>4800 dpi</source>
@ -694,6 +694,10 @@
<source>Multiple</source> <source>Multiple</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>ADF Duplex</source>
<translation type="unfinished">ADF </translation>
</message>
</context> </context>
<context> <context>
<name>ScanDialog</name> <name>ScanDialog</name>
@ -1096,7 +1100,7 @@
<name>main</name> <name>main</name>
<message> <message>
<source>Open file &lt;filename&gt;</source> <source>Open file &lt;filename&gt;</source>
<translation>&lt;filename&gt;</translation> <translation>&lt;&gt;</translation>
</message> </message>
<message> <message>
<source>Filename</source> <source>Filename</source>

Binary file not shown.

View File

@ -332,6 +332,10 @@
<source>Multiple</source> <source>Multiple</source>
<translation type="unfinished">Бірнешеу</translation> <translation type="unfinished">Бірнешеу</translation>
</message> </message>
<message>
<source>ADF Duplex</source>
<translation type="unfinished">ADF Duplex</translation>
</message>
</context> </context>
<context> <context>
<name>ScanDialog</name> <name>ScanDialog</name>

Binary file not shown.

View File

@ -332,6 +332,10 @@
<source>Multiple</source> <source>Multiple</source>
<translation type="unfinished">Көп</translation> <translation type="unfinished">Көп</translation>
</message> </message>
<message>
<source>ADF Duplex</source>
<translation type="unfinished">АДФ Дуплекс</translation>
</message>
</context> </context>
<context> <context>
<name>ScanDialog</name> <name>ScanDialog</name>

Binary file not shown.

View File

@ -332,6 +332,10 @@
<source>Multiple</source> <source>Multiple</source>
<translation type="unfinished">كۆپ</translation> <translation type="unfinished">كۆپ</translation>
</message> </message>
<message>
<source>ADF Duplex</source>
<translation type="unfinished">ADF Duplex</translation>
</message>
</context> </context>
<context> <context>
<name>ScanDialog</name> <name>ScanDialog</name>

Binary file not shown.

View File

@ -121,7 +121,7 @@
<translation type="vanished"> </translation> <translation type="vanished"> </translation>
</message> </message>
<message> <message>
<location filename="../src/detectpagewidget.cpp" line="43"/> <location filename="../src/detectpagewidget.cpp" line="44"/>
<source>Detect scanners, please waiting</source> <source>Detect scanners, please waiting</source>
<translation></translation> <translation></translation>
</message> </message>
@ -129,12 +129,12 @@
<context> <context>
<name>FailedPageWidget</name> <name>FailedPageWidget</name>
<message> <message>
<location filename="../src/failedpagewidget.cpp" line="44"/> <location filename="../src/failedpagewidget.cpp" line="42"/>
<source>Not detect scanners, please connect scanners firstly!</source> <source>Not detect scanners, please connect scanners firstly!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/failedpagewidget.cpp" line="47"/> <location filename="../src/failedpagewidget.cpp" line="45"/>
<source>Connect</source> <source>Connect</source>
<translation></translation> <translation></translation>
</message> </message>
@ -170,7 +170,7 @@
<context> <context>
<name>LeftSuccessPageWidget</name> <name>LeftSuccessPageWidget</name>
<message> <message>
<location filename="../src/leftsuccesspagewidget.cpp" line="36"/> <location filename="../src/leftsuccesspagewidget.cpp" line="58"/>
<source>Connect scanners, please click scan button to start scanning.</source> <source>Connect scanners, please click scan button to start scanning.</source>
<translation></translation> <translation></translation>
</message> </message>
@ -178,17 +178,17 @@
<context> <context>
<name>MainWidget</name> <name>MainWidget</name>
<message> <message>
<location filename="../src/mainwidget.cpp" line="75"/> <location filename="../src/mainwidget.cpp" line="76"/>
<source>kylin-scanner</source> <source>kylin-scanner</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="228"/> <location filename="../src/mainwidget.cpp" line="229"/>
<source>Scanner</source> <source>Scanner</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="231"/> <location filename="../src/mainwidget.cpp" line="232"/>
<source>Yes</source> <source>Yes</source>
<translation></translation> <translation></translation>
</message> </message>
@ -197,67 +197,67 @@
<translation type="vanished">使</translation> <translation type="vanished">使</translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="489"/> <location filename="../src/mainwidget.cpp" line="496"/>
<location filename="../src/mainwidget.cpp" line="510"/> <location filename="../src/mainwidget.cpp" line="517"/>
<location filename="../src/mainwidget.cpp" line="548"/> <location filename="../src/mainwidget.cpp" line="555"/>
<source>There is a new scanner connect, redetect all scanners, please wait a moment. </source> <source>There is a new scanner connect, redetect all scanners, please wait a moment. </source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="521"/> <location filename="../src/mainwidget.cpp" line="528"/>
<location filename="../src/mainwidget.cpp" line="592"/> <location filename="../src/mainwidget.cpp" line="599"/>
<source>No available device</source> <source>No available device</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="605"/> <location filename="../src/mainwidget.cpp" line="612"/>
<location filename="../src/mainwidget.cpp" line="623"/> <location filename="../src/mainwidget.cpp" line="630"/>
<source>device </source> <source>device </source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="605"/> <location filename="../src/mainwidget.cpp" line="612"/>
<location filename="../src/mainwidget.cpp" line="623"/> <location filename="../src/mainwidget.cpp" line="630"/>
<source> has been disconnect.</source> <source> has been disconnect.</source>
<translation> </translation> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="700"/> <location filename="../src/mainwidget.cpp" line="707"/>
<source>Single</source> <source>Single</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="741"/> <location filename="../src/mainwidget.cpp" line="748"/>
<source>Invalid argument, please change arguments or switch other scanners.</source> <source>Invalid argument, please change arguments or switch other scanners.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="757"/> <location filename="../src/mainwidget.cpp" line="764"/>
<source>Device busy, please wait or switch other scanners.</source> <source>Device busy, please wait or switch other scanners.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="759"/> <location filename="../src/mainwidget.cpp" line="766"/>
<source>Document feeder out of documents, please place papers and scan again.</source> <source>Document feeder out of documents, please place papers and scan again.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="761"/> <location filename="../src/mainwidget.cpp" line="768"/>
<source>Scan operation has been cancelled.</source> <source>Scan operation has been cancelled.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="763"/> <location filename="../src/mainwidget.cpp" line="770"/>
<source>Scan failed, please check your scanner or switch other scanners.</source> <source>Scan failed, please check your scanner or switch other scanners.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="807"/> <location filename="../src/mainwidget.cpp" line="814"/>
<source>Running beauty ...</source> <source>Running beauty ...</source>
<translation> ...</translation> <translation> ...</translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="836"/> <location filename="../src/mainwidget.cpp" line="843"/>
<source>Running rectify ...</source> <source>Running rectify ...</source>
<translation> ...</translation> <translation> ...</translation>
</message> </message>
@ -308,8 +308,8 @@
<context> <context>
<name>OcrThread</name> <name>OcrThread</name>
<message> <message>
<location filename="../src/mainwidget.cpp" line="1088"/> <location filename="../src/mainwidget.cpp" line="1095"/>
<location filename="../src/mainwidget.cpp" line="1101"/> <location filename="../src/mainwidget.cpp" line="1108"/>
<source>Unable to read text</source> <source>Unable to read text</source>
<translation></translation> <translation></translation>
</message> </message>
@ -366,87 +366,87 @@
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="871"/> <location filename="../src/saneobject.cpp" line="874"/>
<source>Flatbed</source> <source>Flatbed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="881"/> <location filename="../src/saneobject.cpp" line="884"/>
<source>ADF</source> <source>ADF</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="890"/> <location filename="../src/saneobject.cpp" line="893"/>
<source>ADF Front</source> <source>ADF Front</source>
<translation>ADF </translation> <translation>ADF </translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="899"/> <location filename="../src/saneobject.cpp" line="902"/>
<source>ADF Back</source> <source>ADF Back</source>
<translation>ADF背面</translation> <translation>ADF背面</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="908"/> <location filename="../src/saneobject.cpp" line="911"/>
<source>ADF Duplex</source> <source>ADF Duplex</source>
<translation>ADF </translation> <translation>ADF </translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="959"/> <location filename="../src/saneobject.cpp" line="961"/>
<location filename="../src/saneobject.cpp" line="1023"/> <location filename="../src/saneobject.cpp" line="1025"/>
<source>4800 dpi</source> <source>4800 dpi</source>
<translation>4800 dpi</translation> <translation>4800 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="962"/> <location filename="../src/saneobject.cpp" line="964"/>
<location filename="../src/saneobject.cpp" line="1027"/> <location filename="../src/saneobject.cpp" line="1029"/>
<source>2400 dpi</source> <source>2400 dpi</source>
<translation>2400 dpi</translation> <translation>2400 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="965"/> <location filename="../src/saneobject.cpp" line="967"/>
<location filename="../src/saneobject.cpp" line="1031"/> <location filename="../src/saneobject.cpp" line="1033"/>
<source>1200 dpi</source> <source>1200 dpi</source>
<translation>1200 dpi</translation> <translation>1200 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="968"/> <location filename="../src/saneobject.cpp" line="970"/>
<location filename="../src/saneobject.cpp" line="1035"/> <location filename="../src/saneobject.cpp" line="1037"/>
<source>600 dpi</source> <source>600 dpi</source>
<translation>600 dpi</translation> <translation>600 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="971"/> <location filename="../src/saneobject.cpp" line="973"/>
<location filename="../src/saneobject.cpp" line="1039"/> <location filename="../src/saneobject.cpp" line="1041"/>
<source>300 dpi</source> <source>300 dpi</source>
<translation>300 dpi</translation> <translation>300 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="974"/> <location filename="../src/saneobject.cpp" line="976"/>
<location filename="../src/saneobject.cpp" line="1043"/> <location filename="../src/saneobject.cpp" line="1045"/>
<source>200 dpi</source> <source>200 dpi</source>
<translation>200 dpi</translation> <translation>200 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="977"/> <location filename="../src/saneobject.cpp" line="979"/>
<location filename="../src/saneobject.cpp" line="1047"/> <location filename="../src/saneobject.cpp" line="1049"/>
<source>150 dpi</source> <source>150 dpi</source>
<translation>150 dpi</translation> <translation>150 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="980"/> <location filename="../src/saneobject.cpp" line="982"/>
<location filename="../src/saneobject.cpp" line="1051"/> <location filename="../src/saneobject.cpp" line="1053"/>
<source>100 dpi</source> <source>100 dpi</source>
<translation>100 dpi</translation> <translation>100 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="983"/> <location filename="../src/saneobject.cpp" line="985"/>
<location filename="../src/saneobject.cpp" line="1055"/> <location filename="../src/saneobject.cpp" line="1057"/>
<source>75 dpi</source> <source>75 dpi</source>
<translation>75 dpi</translation> <translation>75 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="1001"/> <location filename="../src/saneobject.cpp" line="1003"/>
<location filename="../src/saneobject.cpp" line="1071"/> <location filename="../src/saneobject.cpp" line="1073"/>
<source>Auto</source> <source>Auto</source>
<translation></translation> <translation></translation>
</message> </message>
@ -469,27 +469,27 @@
<context> <context>
<name>SaneObject</name> <name>SaneObject</name>
<message> <message>
<location filename="../src/saneobject.cpp" line="1987"/> <location filename="../src/saneobject.cpp" line="1989"/>
<source>Default Type</source> <source>Default Type</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="1979"/> <location filename="../src/saneobject.cpp" line="1981"/>
<source>Flatbed</source> <source>Flatbed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="1981"/> <location filename="../src/saneobject.cpp" line="1983"/>
<source>ADF</source> <source>ADF</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="1983"/> <location filename="../src/saneobject.cpp" line="1985"/>
<source>ADF Front</source> <source>ADF Front</source>
<translation>ADF </translation> <translation>ADF </translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="1985"/> <location filename="../src/saneobject.cpp" line="1987"/>
<source>ADF Back</source> <source>ADF Back</source>
<translation>ADF </translation> <translation>ADF </translation>
</message> </message>
@ -506,52 +506,57 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2058"/> <location filename="../src/saneobject.cpp" line="1991"/>
<source>ADF Duplex</source>
<translation type="unfinished">ADF </translation>
</message>
<message>
<location filename="../src/saneobject.cpp" line="2062"/>
<source>Auto</source> <source>Auto</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2062"/> <location filename="../src/saneobject.cpp" line="2066"/>
<source>75 dpi</source> <source>75 dpi</source>
<translation>75 dpi</translation> <translation>75 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2064"/> <location filename="../src/saneobject.cpp" line="2068"/>
<source>150 dpi</source> <source>150 dpi</source>
<translation>150 dpi</translation> <translation>150 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2066"/> <location filename="../src/saneobject.cpp" line="2070"/>
<source>200 dpi</source> <source>200 dpi</source>
<translation>200 dpi</translation> <translation>200 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2068"/> <location filename="../src/saneobject.cpp" line="2072"/>
<source>300 dpi</source> <source>300 dpi</source>
<translation>300 dpi</translation> <translation>300 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2070"/> <location filename="../src/saneobject.cpp" line="2074"/>
<source>600 dpi</source> <source>600 dpi</source>
<translation>600 dpi</translation> <translation>600 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2072"/> <location filename="../src/saneobject.cpp" line="2076"/>
<source>1200 dpi</source> <source>1200 dpi</source>
<translation>1200 dpi</translation> <translation>1200 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2074"/> <location filename="../src/saneobject.cpp" line="2078"/>
<source>2400 dpi</source> <source>2400 dpi</source>
<translation>2400 dpi</translation> <translation>2400 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2076"/> <location filename="../src/saneobject.cpp" line="2080"/>
<source>4800 dpi</source> <source>4800 dpi</source>
<translation>4800 dpi</translation> <translation>4800 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/saneobject.cpp" line="2260"/> <location filename="../src/saneobject.cpp" line="2264"/>
<source>Multiple</source> <source>Multiple</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -598,95 +603,95 @@
<context> <context>
<name>ScanSettingsWidget</name> <name>ScanSettingsWidget</name>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="477"/> <location filename="../src/scansettingswidget.cpp" line="494"/>
<source>Begin Scan</source> <source>Begin Scan</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="496"/> <location filename="../src/scansettingswidget.cpp" line="513"/>
<source>Scanner device</source> <source>Scanner device</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="431"/> <location filename="../src/scansettingswidget.cpp" line="448"/>
<location filename="../src/scansettingswidget.cpp" line="624"/> <location filename="../src/scansettingswidget.cpp" line="639"/>
<source>Time</source> <source>Time</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="511"/> <location filename="../src/scansettingswidget.cpp" line="528"/>
<source>File settings</source> <source>File settings</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="429"/> <location filename="../src/scansettingswidget.cpp" line="446"/>
<source>Device</source> <source>Device</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="101"/> <location filename="../src/scansettingswidget.cpp" line="111"/>
<source>Select a directory</source> <source>Select a directory</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="123"/> <location filename="../src/scansettingswidget.cpp" line="133"/>
<source>Currently user has no permission to modify directory </source> <source>Currently user has no permission to modify directory </source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="180"/> <location filename="../src/scansettingswidget.cpp" line="190"/>
<location filename="../src/scansettingswidget.cpp" line="695"/> <location filename="../src/scansettingswidget.cpp" line="710"/>
<source>Multiple</source> <source>Multiple</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="430"/> <location filename="../src/scansettingswidget.cpp" line="447"/>
<source>Pages</source> <source>Pages</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="432"/> <location filename="../src/scansettingswidget.cpp" line="449"/>
<source>Type</source> <source>Type</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="217"/> <location filename="../src/scansettingswidget.cpp" line="234"/>
<location filename="../src/scansettingswidget.cpp" line="748"/> <location filename="../src/scansettingswidget.cpp" line="763"/>
<source>Color</source> <source>Color</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="434"/> <location filename="../src/scansettingswidget.cpp" line="451"/>
<source>Resolution</source> <source>Resolution</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="435"/> <location filename="../src/scansettingswidget.cpp" line="452"/>
<source>Size</source> <source>Size</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="436"/> <location filename="../src/scansettingswidget.cpp" line="453"/>
<source>Format</source> <source>Format</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="437"/> <location filename="../src/scansettingswidget.cpp" line="454"/>
<source>Name</source> <source>Name</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="518"/> <location filename="../src/scansettingswidget.cpp" line="535"/>
<source>scanner01</source> <source>scanner01</source>
<translation>scanner01</translation> <translation>scanner01</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="438"/> <location filename="../src/scansettingswidget.cpp" line="455"/>
<source>Save</source> <source>Save</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="443"/> <location filename="../src/scansettingswidget.cpp" line="460"/>
<source>Mail to</source> <source>Mail to</source>
<translation></translation> <translation></translation>
</message> </message>
@ -695,143 +700,143 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="537"/> <location filename="../src/scansettingswidget.cpp" line="554"/>
<location filename="../src/scansettingswidget.cpp" line="885"/> <location filename="../src/scansettingswidget.cpp" line="900"/>
<source>Save as</source> <source>Save as</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="667"/> <location filename="../src/scansettingswidget.cpp" line="682"/>
<source>No available scanners</source> <source>No available scanners</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="191"/> <location filename="../src/scansettingswidget.cpp" line="201"/>
<location filename="../src/scansettingswidget.cpp" line="695"/> <location filename="../src/scansettingswidget.cpp" line="710"/>
<source>Single</source> <source>Single</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="230"/> <location filename="../src/scansettingswidget.cpp" line="247"/>
<source>4800 dpi</source> <source>4800 dpi</source>
<translation>4800 dpi</translation> <translation>4800 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="231"/> <location filename="../src/scansettingswidget.cpp" line="248"/>
<source>2400 dpi</source> <source>2400 dpi</source>
<translation>2400 dpi</translation> <translation>2400 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="232"/> <location filename="../src/scansettingswidget.cpp" line="249"/>
<source>1200 dpi</source> <source>1200 dpi</source>
<translation>1200 dpi</translation> <translation>1200 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="234"/> <location filename="../src/scansettingswidget.cpp" line="251"/>
<source>This resolution will take a loog time to scan, please choose carelly.</source> <source>This resolution will take a loog time to scan, please choose carelly.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="259"/> <location filename="../src/scansettingswidget.cpp" line="276"/>
<location filename="../src/scansettingswidget.cpp" line="378"/> <location filename="../src/scansettingswidget.cpp" line="395"/>
<source>cannot contain &apos;/&apos; character.</source> <source>cannot contain &apos;/&apos; character.</source>
<translation> / </translation> <translation> / </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="265"/> <location filename="../src/scansettingswidget.cpp" line="282"/>
<location filename="../src/scansettingswidget.cpp" line="383"/> <location filename="../src/scansettingswidget.cpp" line="400"/>
<source>cannot save as hidden file.</source> <source>cannot save as hidden file.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="332"/> <location filename="../src/scansettingswidget.cpp" line="349"/>
<location filename="../src/scansettingswidget.cpp" line="877"/> <location filename="../src/scansettingswidget.cpp" line="892"/>
<source>Store text</source> <source>Store text</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="342"/> <location filename="../src/scansettingswidget.cpp" line="359"/>
<source>Save as dialog</source> <source>Save as dialog</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="433"/> <location filename="../src/scansettingswidget.cpp" line="450"/>
<source>Colour</source> <source>Colour</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="709"/> <location filename="../src/scansettingswidget.cpp" line="724"/>
<source>3s</source> <source>3s</source>
<translation>3 </translation> <translation>3 </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="709"/> <location filename="../src/scansettingswidget.cpp" line="724"/>
<source>5s</source> <source>5s</source>
<translation>5 </translation> <translation>5 </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="709"/> <location filename="../src/scansettingswidget.cpp" line="724"/>
<source>7s</source> <source>7s</source>
<translation>7 </translation> <translation>7 </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="709"/> <location filename="../src/scansettingswidget.cpp" line="724"/>
<source>10s</source> <source>10s</source>
<translation>10 </translation> <translation>10 </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="709"/> <location filename="../src/scansettingswidget.cpp" line="724"/>
<source>15s</source> <source>15s</source>
<translation>15 </translation> <translation>15 </translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="726"/> <location filename="../src/scansettingswidget.cpp" line="741"/>
<source>Flatbed</source> <source>Flatbed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="726"/> <location filename="../src/scansettingswidget.cpp" line="741"/>
<source>ADF</source> <source>ADF</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="748"/> <location filename="../src/scansettingswidget.cpp" line="763"/>
<source>Gray</source> <source>Gray</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="219"/> <location filename="../src/scansettingswidget.cpp" line="236"/>
<location filename="../src/scansettingswidget.cpp" line="748"/> <location filename="../src/scansettingswidget.cpp" line="763"/>
<source>Lineart</source> <source>Lineart</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="770"/> <location filename="../src/scansettingswidget.cpp" line="785"/>
<source>75 dpi</source> <source>75 dpi</source>
<translation>75 dpi</translation> <translation>75 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="770"/> <location filename="../src/scansettingswidget.cpp" line="785"/>
<source>100 dpi</source> <source>100 dpi</source>
<translation>100 dpi</translation> <translation>100 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="770"/> <location filename="../src/scansettingswidget.cpp" line="785"/>
<source>150 dpi</source> <source>150 dpi</source>
<translation>150 dpi</translation> <translation>150 dpi</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="787"/> <location filename="../src/scansettingswidget.cpp" line="802"/>
<source>Resolution is empty!</source> <source>Resolution is empty!</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="802"/> <location filename="../src/scansettingswidget.cpp" line="817"/>
<source>A4</source> <source>A4</source>
<translation>A4</translation> <translation>A4</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="802"/> <location filename="../src/scansettingswidget.cpp" line="817"/>
<source>A5</source> <source>A5</source>
<translation>A5</translation> <translation>A5</translation>
</message> </message>
@ -840,12 +845,12 @@
<translation type="vanished">252</translation> <translation type="vanished">252</translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="1115"/> <location filename="../src/scansettingswidget.cpp" line="1127"/>
<source>Scanner</source> <source>Scanner</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/scansettingswidget.cpp" line="1118"/> <location filename="../src/scansettingswidget.cpp" line="1130"/>
<source>Yes</source> <source>Yes</source>
<translation></translation> <translation></translation>
</message> </message>
@ -853,32 +858,32 @@
<context> <context>
<name>ScanThread</name> <name>ScanThread</name>
<message> <message>
<location filename="../src/mainwidget.cpp" line="904"/> <location filename="../src/mainwidget.cpp" line="911"/>
<source>Multiple</source> <source>Multiple</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="983"/> <location filename="../src/mainwidget.cpp" line="990"/>
<source>3s</source> <source>3s</source>
<translation>3 </translation> <translation>3 </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="986"/> <location filename="../src/mainwidget.cpp" line="993"/>
<source>5s</source> <source>5s</source>
<translation>5 </translation> <translation>5 </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="989"/> <location filename="../src/mainwidget.cpp" line="996"/>
<source>7s</source> <source>7s</source>
<translation>7 </translation> <translation>7 </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="992"/> <location filename="../src/mainwidget.cpp" line="999"/>
<source>10s</source> <source>10s</source>
<translation>10 </translation> <translation>10 </translation>
</message> </message>
<message> <message>
<location filename="../src/mainwidget.cpp" line="995"/> <location filename="../src/mainwidget.cpp" line="1002"/>
<source>15s</source> <source>15s</source>
<translation>15 </translation> <translation>15 </translation>
</message> </message>
@ -926,7 +931,7 @@
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.ui" line="112"/> <location filename="../src/titlebar/titlebar.ui" line="112"/>
<location filename="../src/titlebar/titlebar.cpp" line="161"/> <location filename="../src/titlebar/titlebar.cpp" line="160"/>
<source>Scanner</source> <source>Scanner</source>
<translation></translation> <translation></translation>
</message> </message>
@ -947,7 +952,7 @@
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.ui" line="260"/> <location filename="../src/titlebar/titlebar.ui" line="260"/>
<location filename="../src/titlebar/titlebar.cpp" line="104"/> <location filename="../src/titlebar/titlebar.cpp" line="103"/>
<source>Maximize</source> <source>Maximize</source>
<translation></translation> <translation></translation>
</message> </message>
@ -976,22 +981,22 @@
<translation>退</translation> <translation>退</translation>
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.cpp" line="101"/> <location filename="../src/titlebar/titlebar.cpp" line="100"/>
<source>Restore</source> <source>Restore</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.cpp" line="158"/> <location filename="../src/titlebar/titlebar.cpp" line="157"/>
<source>The current document is not saved. Do you want to save it?</source> <source>The current document is not saved. Do you want to save it?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.cpp" line="165"/> <location filename="../src/titlebar/titlebar.cpp" line="164"/>
<source>Straight &amp;Exit</source> <source>Straight &amp;Exit</source>
<translation>退</translation> <translation>退</translation>
</message> </message>
<message> <message>
<location filename="../src/titlebar/titlebar.cpp" line="167"/> <location filename="../src/titlebar/titlebar.cpp" line="166"/>
<source>&amp;Save Exit</source> <source>&amp;Save Exit</source>
<translation>退</translation> <translation>退</translation>
</message> </message>
@ -1076,17 +1081,17 @@
<context> <context>
<name>main</name> <name>main</name>
<message> <message>
<location filename="../src/main.cpp" line="199"/> <location filename="../src/main.cpp" line="201"/>
<source>Open file &lt;filename&gt;</source> <source>Open file &lt;filename&gt;</source>
<translation> &lt;filename&gt;</translation> <translation> &lt;filename&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/main.cpp" line="200"/> <location filename="../src/main.cpp" line="202"/>
<source>Filename</source> <source>Filename</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/main.cpp" line="204"/> <location filename="../src/main.cpp" line="206"/>
<source>Hide scan settings widget</source> <source>Hide scan settings widget</source>
<translation></translation> <translation></translation>
</message> </message>