diff --git a/data/kylin-scanner.desktop b/data/kylin-scanner.desktop index 3b4f69a973341774320d3e73bec636fff49ed50b..bc8cf2288ff5bf8efe2dd93c8037f3aa33d31fed 100644 --- a/data/kylin-scanner.desktop +++ b/data/kylin-scanner.desktop @@ -2,15 +2,21 @@ Name=Scanner Name[zh_CN]=扫描 Name[bo_CN]=བཤར་འབེབས། +Name[mn]=ᠰᠢᠷᠪᠢᠬᠦ +Name[zh_HK]=掃描 GenericName=Scanner GenericName[zh_CN]=扫描 GenericName[bo_CN]=བཤར་འབེབས། +GenericName[mn]=ᠰᠢᠷᠪᠢᠬᠦ +Name[zh_HK]=掃描 Comment=An interface-friendly scanner, which could be also used as one-click beautification, intelligent correction and text recognition tools. Comment[zh_CN]=一款可用于普通扫描、一键美化、智能纠偏和文字识别的界面友好扫描仪软件。 Comment[bo_CN]=སྤྱིར་བཏང་གི་བཤར་འབེབས།མཐེབ་གཅིག་མཛེས་བཟོ།རིག་ནུས་ཡོ་འཁྱོག་དང་ཡི་གེ་དབྱེ་འབྱེད་་ལྡན་པའི་མཚམས་ངོས་མཛའ་མཐུན་གྱི་བཤར་འབེབས་མཉེན་ཆས་ཤིག +Comment[mn]=ᠨᠢᠭᠡᠨ ᠡᠩ ᠤ᠋ᠨ ᠰᠢᠷᠪᠢᠯᠳᠡ᠂ ᠨᠢᠭᠡ ᠳᠠᠷᠤᠪᠴᠢ ᠪᠡᠷ ᠭᠤᠸᠠᠵᠢᠭᠤᠯᠬᠤ᠂ ᠤᠶᠤᠯᠢᠭ ᠵᠢᠡᠷ ᠵᠠᠯᠠᠷᠠᠭᠤᠯᠬᠤ ᠪᠠ ᠦᠰᠦᠭ ᠢᠯᠭᠠᠨ ᠳᠠᠨᠢᠬᠤ ᠵᠤᠯᠭᠠᠭᠤᠷ ᠤ᠋ᠨ ᠨᠠᠢᠷᠰᠠᠭ ᠰᠢᠷᠪᠢᠬᠦᠷ ᠰᠣᠹᠲ ᠪᠣᠯᠤᠨ᠎ᠠ +Comment[zh_HK]=一款可用於普通掃描、一鍵美化、智慧糾偏和文字識別的介面友好掃描儀軟件。 Exec=kylin-scanner %U Icon=kylin-scanner Type=Application -Categories=Application;Graphics;RasterGraphics;Scanning;OCR;2DGraphics; +Categories=Application;Office;RasterGraphics;Scanning;OCR;2DGraphics; Keywords=scannerfrontend StartupNotify=true diff --git a/data/kylin-scanner/bo_CN/image/OCR.png b/data/kylin-scanner/bo_CN/image/OCR.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/beauty.png b/data/kylin-scanner/bo_CN/image/beauty.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/crop.png b/data/kylin-scanner/bo_CN/image/crop.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/darkMode.png b/data/kylin-scanner/bo_CN/image/darkMode.png index fbb11e3f7f80810d58d400193a8aebd560a819c2..4718f95d7a4ba2c2e817456a194b4e0589355374 100644 Binary files a/data/kylin-scanner/bo_CN/image/darkMode.png and b/data/kylin-scanner/bo_CN/image/darkMode.png differ diff --git a/data/kylin-scanner/bo_CN/image/detectPage.png b/data/kylin-scanner/bo_CN/image/detectPage.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/driverInstall.png b/data/kylin-scanner/bo_CN/image/driverInstall.png new file mode 100644 index 0000000000000000000000000000000000000000..3fbde1d12be28c06ba75570921722c500ea39bc5 Binary files /dev/null and b/data/kylin-scanner/bo_CN/image/driverInstall.png differ diff --git a/data/kylin-scanner/bo_CN/image/lightMode.png b/data/kylin-scanner/bo_CN/image/lightMode.png index d191e29864fe70a6d19ea0f32e9445d7c92c4e4f..2cd3a74cbec032c56cb6eb61332b2f6aecc519c0 100644 Binary files a/data/kylin-scanner/bo_CN/image/lightMode.png and b/data/kylin-scanner/bo_CN/image/lightMode.png differ diff --git a/data/kylin-scanner/bo_CN/image/logo.png b/data/kylin-scanner/bo_CN/image/logo.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/mirror.png b/data/kylin-scanner/bo_CN/image/mirror.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/rectify.png b/data/kylin-scanner/bo_CN/image/rectify.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/rotate.png b/data/kylin-scanner/bo_CN/image/rotate.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/scan.png b/data/kylin-scanner/bo_CN/image/scan.png index d191e29864fe70a6d19ea0f32e9445d7c92c4e4f..2cd3a74cbec032c56cb6eb61332b2f6aecc519c0 100644 Binary files a/data/kylin-scanner/bo_CN/image/scan.png and b/data/kylin-scanner/bo_CN/image/scan.png differ diff --git a/data/kylin-scanner/bo_CN/image/search.png b/data/kylin-scanner/bo_CN/image/search.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/startMenu.png b/data/kylin-scanner/bo_CN/image/startMenu.png old mode 100644 new mode 100755 index fdb15685286a3d1dce5acf3abf8746d8591619ca..15682477612292dacb1f0aaec98a2eeddaebd33a Binary files a/data/kylin-scanner/bo_CN/image/startMenu.png and b/data/kylin-scanner/bo_CN/image/startMenu.png differ diff --git a/data/kylin-scanner/bo_CN/image/watermark.png b/data/kylin-scanner/bo_CN/image/watermark.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/image/zoomInOut.png b/data/kylin-scanner/bo_CN/image/zoomInOut.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/bo_CN/index.md b/data/kylin-scanner/bo_CN/index.md old mode 100644 new mode 100755 index 202e969a3fe88a8f5ede824cef00ebc0b96e8250..8f7c47d44b5b603e1f3a334556d6f05e3142d34f --- a/data/kylin-scanner/bo_CN/index.md +++ b/data/kylin-scanner/bo_CN/index.md @@ -7,8 +7,8 @@ ## ཁ་ཕྱེ་སྟངས། -- “འགོ་འཛུགས་འདེམས་བྱང་”>>“བཤར་འབེབས་” -- "ལས་འགན་སྡེ་">"བཤེར་འཚོལ་"![](image/search.png)"> “བཤར་འབེབས་" +- “འགོ་འཛུགས་འདེམས་བྱང་”>>“བཤར་འབེབས་” +- "ལས་འགན་སྡེ་">"བཤེར་འཚོལ་"![](image/search.png)> "བཤར་འབེབས་"
@@ -37,7 +37,18 @@
-- ### བཤར་འབེབས་ཡོ་ཆས་སྒྲིག་འགོད། +- #### བཤར་འབེབས་ཡོ་ཆས་སྒྲིག་སྦྱོར་ལ་བརྟེན་ནས་། + + +​ བཤར་འབེབས་མཉེན་ཆས་ཁ་ཕྱེ་རྗེས།རང་འགུལ་ཞིབ་དཔྱད་ཚད་ལེན་USBབརྒྱུད་པའམ་ཡང་ན་དྲ་རྒྱའི་སྦྲེལ་མཐུད་ཀྱི་བཤར་འབེབས་ཡོ་ཆས་བཙུགས་ནས་སྤྱོད་རུང་སྒྲིག་ཆས་ལ་ཞིབ་དཔྱད་ཚད་ལེན་མ་བྱས་ཚེ།སྒུལ་གཏོང་སྒྲིག་ཆས་སྒྲིག་སྦྱོར་མ་བྱས་པའི་ཞིབ་དཔྱད་ཚད་ལེན་གོ་རིམ་འཕྲད་ཀྱི་ཡོད།གལ་ཏེ་སྒུལ་གཏོང་རྣམ་པའི་བཤར་འབེབས་ཡོ་ཆས་མཐོང་ཚེ།སྒུལ་གཏོང་རྣམ་པའི་སྒུལ་གཏོང་རྣམ་པའི་རང་འགུལ་སྒྲིག་སྦྱོར་བྱེད་ཀྱི་ཡོད། + +
+ +![རི་མོ་ 3 བཤེར་འཇལ་བཤར་འབེབས་ཆས་](image/driverInstall.png) + +
+ +- **བཤར་འབེབས་ཡོ་ཆས་སྒྲིག་འགོད།** ​ ཞིབ་བཤེར་བྱས་ནས་བཤར་འབེབས་སྒྲིག་ཆས་དང་རང་འགུལ་ངང་སྦྲེལ་མཐུད་བྱས་རྗེས།གཡས་ཀྱི་ལེ་ཚན་ནང་བཤར་འབེབས་ཡོ་ཆས་སྒྲིག་ཆས་ཀྱི་འབྲེལ་ཡོད་ཞུགས་གྲངས(སྒྲིག་ཆས་དང་།ཤོག་གྲངས།རིགས།ཚོན་མདོགདབྱེ་འབྱེད་ཚད་བཅད)དང་ཡིག་ཆའི་ནང་ཞུགས་གྲངས་སྔོན་འགོད་བྱས་ནས(ཆེ་ཆུང་དང་།རྣམ་པ།མིང་།དེ་བཞིན་གསོག་ཉར་ཐབས་ལམ་བཅས)བཀོད་སྒྲིག་བྱས་རྗེས།བཀོད་སྒྲིག་བྱས་ཟིན་རྗེས།“བཤར་འབེབས་བྱེད་འགོ་འཛུགས་པའི”ཡིག་ཚགས་བཤར་འབེབས་བྱེད་དགོས། @@ -55,14 +66,14 @@ | གསར་འཛུགས་ | ཞིབ་བརྗོད། | | :-----------: | :----------------------------------------------------------- | | སྒྲིག་ཆས། | བཤར་འབེབས་སྒྲིག་ཆས་འདེམས་པ། | -| ལྡེབ་ངོས་གྲངས་ | 1. ལྡེབ་གཅིག་བཤར་འབེབས།བཤར་འབེབས་ཐེངས་གཅིག་མ་གཏོགས་བྱས་མི་ཆོགབཤར་འབེབས་མཇུག་བསྒྲིལ་རྗེས་རང་འགུལ་གྱིས་བཤར་འབེབས་མི་བྱེད།
2. ཤོག་ངོས་མང་པོའི་བཤར་འབེབས།བྱབས་འབེབས་ཐེངས་མང་བྱས་ཆོག་སྟེ།ཐེངས་དང་པོར་བཤར་འབེབས་མཇུག་བསྒྲིལ་རྗེས།བཀོད་སྒྲིག་བྱས་པའི་དུས་འགྱངས་དུས་ཚོད་ལྟར་ཐེངས་རྗེས་མའི་བཤར་འབེབས་བྱས་ཆོག་སྟེ།སྤྱོད་མཁན་གྱིས་རང་འགུལ་ངང་བཤར་འབེབས་མཇུག་བསྒྲིལ་བའམ་རྒྱུན་ལྡན་མིན་པའི་གནས་ཚུལ་ལ་འཕྲད་རག་བར་དུ་ཆོག
རྒྱུན་མཐོང་གི་རྒྱུན་ལྡན་མིན་པའི་གནས་ཚུལ་ནི།བཤར་འབེབས་ཆས་ནང་དུ་མེད་པའི་བཤར་འབེབས་ཡིག་ཚགས་དང་བཤར་འབེབས་ཞུགས་གྲངས་ནོར་འཁྲུལ།བཤར་འབེབས་ioནོར་འཁྲུལ་སོགས་ཡོད། | -| རིགས་ | འདེམ་བསལ་གཏན་ཁེལ་བྱས་པའི་བཤར་འབེབས་ཆས་ལ་གཞིགས་ནས་བསྡུ་ལེན་བྱས་རིགས།འདེམས་རུང་བའི་ཞུགས་གྲངས་ལ་སྙོམས་ངོས་རྣམ་པ་དང་ཤོག་སྙོད་རྣམ་པ་གཉིས་ཡོད། བཤར་འབེབས་ཆས་མི་འདྲ་བས་རྒྱབ་སྐྱོར་བྱས་པའི་བཤར་འབེབས་ཆས་ཀྱི་རིགས་མི་འདྲ་སྟེ།
1. སྙོམས་ངོས་ཁོ་ནར་རྒྱབ་སྐྱོར་བྱེད་ཀྱི་ཡོད་པ་སྟེ།Canon li214,Canon lia 300,Canon lid400སོགས།
2. ཤོག་སྙོད་རྣམ་པ་ལ་རྒྱབ་སྐྱོར་བྱེད་པ།:hp OfficeJet_250_Mobile_seriesསོགས་;
3. ངོས་ལེབ་དང་ཤོག་སྙོད་རྣམ་པ་ལ་རྒྱབ་སྐྱོར་བྱེད་དགོས།:hp Color LaserJet Pro MFP M281fdwསོགས。 | -| མདོག | བཤར་འབེབས་ཡིག་ཆའི་ཁ་དོག་འཛུགས་པ་དང་།ཚོན་ལྡན་ཡང་ན་དཀར་ནག་། | +| ལྡེབ་ངོས་གྲངས་ | 1. ལྡེབ་གཅིག་བཤར་འབེབས།བཤར་འབེབས་ཐེངས་གཅིག་མ་གཏོགས་བྱས་མི་ཆོགབཤར་འབེབས་མཇུག་བསྒྲིལ་རྗེས་རང་འགུལ་གྱིས་བཤར་འབེབས་མི་བྱེད།
2. ཤོག་ངོས་མང་པོའི་བཤར་འབེབས།བྱབས་འབེབས་ཐེངས་མང་བྱས་ཆོག་སྟེ།ཐེངས་དང་པོར་བཤར་འབེབས་མཇུག་བསྒྲིལ་རྗེས།བཀོད་སྒྲིག་བྱས་པའི་དུས་འགྱངས་དུས་ཚོད་ལྟར་ཐེངས་རྗེས་མའི་བཤར་འབེབས་བྱས་ཆོག་སྟེ།སྤྱོད་མཁན་གྱིས་རང་འགུལ་ངང་བཤར་འབེབས་མཇུག་བསྒྲིལ་བའམ་རྒྱུན་ལྡན་མིན་པའི་གནས་ཚུལ་ལ་འཕྲད་རག་བར་དུ་ཆོག
3. ADFངོས་གཉིས་དང་ADFཡི་དྲང་ཕྱོགས་དང་ལྡོག་ཕྱོགས་གཉིས་ནས་ཕྱོགས་གཉིས་དང་ལྡོག་ཕྱོགས་ནས་བཤར་ཕབ་བྱས་ཆོག
རྒྱུན་མཐོང་གི་རྒྱུན་ལྡན་མིན་པའི་གནས་ཚུལ་ནི།བཤར་འབེབས་ཆས་ནང་དུ་མེད་པའི་བཤར་འབེབས་ཡིག་ཚགས་དང་བཤར་འབེབས་ཞུགས་གྲངས་ནོར་འཁྲུལ།བཤར་འབེབས་ioནོར་འཁྲུལ་སོགས་ཡོད། | +| རིགས་ | འདེམ་བསལ་གཏན་ཁེལ་བྱས་པའི་བཤར་འབེབས་ཆས་ལ་གཞིགས་ནས་བསྡུ་ལེན་བྱས་རིགས།འདེམས་རུང་བའི་ཞུགས་གྲངས་ལ་སྙོམས་ངོས་རྣམ་པ་དང་ཤོག་སྙོད་རྣམ་པ་གཉིས་ཡོད། བཤར་འབེབས་ཆས་མི་འདྲ་བས་རྒྱབ་སྐྱོར་བྱས་པའི་བཤར་འབེབས་ཆས་ཀྱི་རིགས་མི་འདྲ་སྟེ།
1. སྙོམས་ངོས་ཁོ་ནར་རྒྱབ་སྐྱོར་བྱེད་ཀྱི་ཡོད་པ་སྟེ།Canon li214,Canon lia 300,Canon lid400སོགས།
2. ཤོག་སྙོད་རྣམ་པ་ལ་རྒྱབ་སྐྱོར་བྱེད་པ།:hp OfficeJet_250_Mobile_seriesསོགས་;
3.ཤོག་སྙོད་རྣམ་པ་དང་ADFངོ་གཉིས་དང་།Brther ADS-3600W HanWang HW 3130སོགས་ལ་རྒྱབ་སྐྱོར་བྱས་པ།
4. ངོས་ལེབ་དང་ཤོག་སྙོད་རྣམ་པ་ལ་རྒྱབ་སྐྱོར་བྱེད་དགོས།:hp Color LaserJet Pro MFP M281fdwསོགས。 | +| མདོག | བཤར་འབེབས་ཡིག་ཆ་བཟོ་མདོག་དང་།ཚོན་མདོགདཀར་ནག་ཡང་ན་སྐྱ་ཚའི་ཚད། | | ཤན་འབྱེད་ཕྱོད་ | བཤར་འབེབས་ཆས་མི་འདྲ་བ་བཙུགས་པའི་དབྱེ་འབྱེད་ཚད་ནི།ཞུགས་གྲངས་དེ་ཡང་དམིགས་འཛུགས་བཤར་འབེབས་ཆས་ལ་གཞིགས་ནས་ཐོབ་པ་ཡིན་ལ།དབྱེ་འབྱེད་ཚད་འདེམས་ཆོག་པ་གཤམ་གསལ། 75, 100, 150, 200, 300, 600, 1200, 2400。
ཤན་འབྱེད་ཕྱོད་ཇི་ལྟར་མཐོ་ན་བྱབས་འབེབས་དུས་ཡུན་ཇི་ལྟར་རིང་ན་བཤར་འབེབས་བྱས་པའི་པར་རིས་ཀྱིས་ནང་གསོག་གང་ཙམ་མང་ན་དུས་མཇུག་གི་བརྙན་རིས་ཐག་གཅོད་བཀོལ་སྤྱོད་ལ་འོས་འཚམ་གྱི་སྣོན་འགོད་དལ་དྲགས་པའི་སྣང་ཚུལ་ཡོད་པས།དབྱེ་འབྱེད་ཚད་600ལས་ཆེ་བའི་རིགས་བདམས་ནས་བཤར་འབེབས་བྱེད་སྐབས་རྒྱུད་ཁོངས་ལ་ལྟོས་འཇོག་གི་གསལ་འདེབས་ཡོད། | | ཆེ་ཆུང་། | བཀོལ་མཁན་གྱིས་བདམས་པའི་བཤར་འབེབས་ཆས་ཀྱི་སྒྲིག་ཆས་ལས་བཤར་འབེབས་ཆེ་ཆུང་གསལ་བོ་བླངས་ན།ཞུགས་གྲངས་འདེམ་ཆོག་སྟེ།A4, A5, A6。 | -| རྣམ་གཞག་ | བཤར་འབེབས་རྣམ་པ་མི་འདྲ་བ་བཀོད་སྒྲིག་བྱས་ཆོག་ཉར་ཚགས་བཤར་འབེབས་ཀྱི་ཡིག་ཚགས་ལ་སྤྱོད་དགོས། འདེམས་རུང་ཞུགས་གྲངས་ནི།jpg, png, pdf, bmp。 | +| རྣམ་གཞག་ | བཤར་འབེབས་རྣམ་པ་མི་འདྲ་བ་བཀོད་སྒྲིག་བྱས་ཆོག་ཉར་ཚགས་བཤར་འབེབས་ཀྱི་ཡིག་ཚགས་ལ་སྤྱོད་དགོས། འདེམས་རུང་ཞུགས་གྲངས་ནི།jpg, png, pdf, bmp,tiff。 | | མིང་། | བཤར་འབེབས་ཡིག་ཆའི་མིང་བཟོ་བ། | -| བཤར་འབེབས་བར། | བཤར་འབེབས་ཡིག་ཚགས་ཀྱི་ཐོག་མའི་ཉར་ཚགས་ཐབས་ལམ་བཀོད་སྒྲིག་དང་།སོར་བཞག་ཁྱིམ་དཀར་ཆག་འོག་གི་།“pictures/kylin-scanner-images”。 | +| བཤར་འབེབས་བར། | བཤར་འབེབས་ཡིག་ཚགས་ཀྱི་ཐོག་མའི་ཉར་ཚགས་ཐབས་ལམ་བཀོད་སྒྲིག་དང་།སོར་བཞག་ཁྱིམ་དཀར་ཆག་འོག་གི་།“pictures/བཤར་འབེབས་འབུར་ཐོན་”。 | | སྦྲག་བསྐུར་གཏོང་བ་ | བཤར་འབེབས་བྱས་ཚར་རྗེས།བཤར་འབེབས་ཡིག་ཚགས་མ་ལག་ནས་སྒྲིག་སྦྱོར་བྱས་པའི་སྦྲག་རྫས་ཀྱི་དུད་སྣེ་བརྒྱུད་དེ་སྦྲག་རྫས་སྐུར་ཆོག | | གཞན་ཉར་ | བཤར་འབེབས་ལེགས་སྒྲུབ་བྱས་པའམ་ཡང་ན་བཤར་འབེབས་ཡིག་ཚགས་རྩོམ་སྒྲིག་བཀོལ་སྤྱོད་བྱས་རྗེས་བཤར་འབེབས་ཡིག་ཚགས་དེ་རྣམ་པ་མི་འདྲ་བའི་ཡིག་ཆ་ཟུར་དུ་ཉར་ཚགས་བྱས་ཆོག | diff --git a/data/kylin-scanner/en_US/image/OCR.png b/data/kylin-scanner/en_US/image/OCR.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/beauty.png b/data/kylin-scanner/en_US/image/beauty.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/crop.png b/data/kylin-scanner/en_US/image/crop.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/darkMode.png b/data/kylin-scanner/en_US/image/darkMode.png index 31af94fa5584235a62f759918c444f1042b24155..41cfe8abf5a0ed6fbe43f0d52531c62278792327 100644 Binary files a/data/kylin-scanner/en_US/image/darkMode.png and b/data/kylin-scanner/en_US/image/darkMode.png differ diff --git a/data/kylin-scanner/en_US/image/detectPage.png b/data/kylin-scanner/en_US/image/detectPage.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/driverInstall.png b/data/kylin-scanner/en_US/image/driverInstall.png new file mode 100644 index 0000000000000000000000000000000000000000..f82f2fb9ca73de7601f93bceac9b1bd4dea963e5 Binary files /dev/null and b/data/kylin-scanner/en_US/image/driverInstall.png differ diff --git a/data/kylin-scanner/en_US/image/lightMode.png b/data/kylin-scanner/en_US/image/lightMode.png index 81f6ae3f7b30a2cf4244a04fa54ebec2915642ac..a76156e781ef34d8682bc3d08618c8ec217a28ee 100644 Binary files a/data/kylin-scanner/en_US/image/lightMode.png and b/data/kylin-scanner/en_US/image/lightMode.png differ diff --git a/data/kylin-scanner/en_US/image/logo.png b/data/kylin-scanner/en_US/image/logo.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/mirror.png b/data/kylin-scanner/en_US/image/mirror.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/rectify.png b/data/kylin-scanner/en_US/image/rectify.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/rotate.png b/data/kylin-scanner/en_US/image/rotate.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/scan.png b/data/kylin-scanner/en_US/image/scan.png index 81f6ae3f7b30a2cf4244a04fa54ebec2915642ac..a76156e781ef34d8682bc3d08618c8ec217a28ee 100644 Binary files a/data/kylin-scanner/en_US/image/scan.png and b/data/kylin-scanner/en_US/image/scan.png differ diff --git a/data/kylin-scanner/en_US/image/search.png b/data/kylin-scanner/en_US/image/search.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/startMenu.png b/data/kylin-scanner/en_US/image/startMenu.png old mode 100644 new mode 100755 index fdb15685286a3d1dce5acf3abf8746d8591619ca..15682477612292dacb1f0aaec98a2eeddaebd33a Binary files a/data/kylin-scanner/en_US/image/startMenu.png and b/data/kylin-scanner/en_US/image/startMenu.png differ diff --git a/data/kylin-scanner/en_US/image/watermark.png b/data/kylin-scanner/en_US/image/watermark.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/image/zoomInOut.png b/data/kylin-scanner/en_US/image/zoomInOut.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/en_US/index.md b/data/kylin-scanner/en_US/index.md old mode 100644 new mode 100755 index 6aacb2c1d699712be033fe27c5a1fd52bfabe4fa..dc1f893b1fd51894210ef62de981eac9ec16f341 --- a/data/kylin-scanner/en_US/index.md +++ b/data/kylin-scanner/en_US/index.md @@ -1,31 +1,31 @@ -# kylin-scanner +# Scanner ## summary -​ kylin-scanner is a convenient and fast scanning tool developed by ourselves. It can save the scanned electronic documents of paper documents to the system folder. It supports document preset, document editing, one click beautification, intelligent correction, text recognition and other operations. +​ Scanner is a convenient and fast scanning tool developed by ourselves. It can save the scanned electronic documents of paper documents to the system folder. It supports document preset, document editing, one click beautification, intelligent correction, text recognition and other operations.
## open -- “menu”>>“kylin-scanner” -- "taskbar">"search"![](../en_US/image/search.png)"> “kylin-scanner" +- “menu”>>“Scanner” +- "taskbar">"search"![](../en_US/image/search.png)> "Scanner"
-![Figure 1 kylin-scanner-LightMode](../en_US/image/lightMode.png) +![Figure 1 Scanner-LightMode](../en_US/image/lightMode.png)
-![Figure 2 kylin-scanner-darkMode](../en_US/image/darkMode.png) +![Figure 2 Scanner-darkMode](../en_US/image/darkMode.png)
## Basic operation -- ### Detection scanner +- **Detection scanner** ​ After the scanning software is opened, it will automatically detect the scanner connected directly through USB or set up a network connection. @@ -38,10 +38,21 @@
-- ### Scanner settings +- **Install Scanner Driver** -​ After the scanning device is detected and automatically connected, relevant parameters of the scanner device (device, number of pages, type, color and resolution) and file preset parameters (size, format, name and storage path) can be set in the right column. After setting, click **start scanning** to scan the document. +​ After the scanner software is opened, it will automatically detect scanners connected directly through USB or set up network connection. If no available devices are detected, a detection program for devices without drivers will be triggered. If a scanner device with drivers that can be installed is found, the corresponding driver will be recommended for automatic installation. + +
+ +![Figure 3 driver install](../en_US/image/driverInstall.png) + +
+ +- **Scanner settings** + + +​ After the scanning device is detected and automatically connected, relevant parameters of the scanner device (device, number of pages, type, color and resolution) and file preset parameters (size, format, name and storage path) can be set in the right column. After setting, click **start scan** to scan the document.
@@ -56,14 +67,14 @@ | Setting | description | | :-------------: | :----------------------------------------------------------- | | equipment | Select scanning device | -| Number of pages | 1. Single page scan: only one scan can be performed. After the scan is completed, no automatic scan is performed;
2. Multi page scanning: multiple scans can be performed. After the first scan is completed, the next scan can be performed according to the set delay interval until the user automatically ends the scan or encounters abnormal conditions.
Common exceptions include: no scannable documents in the scanner, scan parameter error, scan IO error, etc | -| Type | According to the selected scanner, the optional parameters are: flat plate type and paper feed type. Different scanners support different scanner types:
1. Only flat type is supported: Canon Lide 210, Canon Lide 300, Canon Lide 400, etc;
2. Support paper feed: HP Officejet_ 250_ Mobile_ Series, etc;
3. Flat panel and paper feed support: HP color LaserJet Pro MFP m281fdw, etc. | -| Color | Set scan file color, color or black and white | +| Number of pages | 1. Single page scan: only one scan can be performed. After the scan is completed, no automatic scan is performed;
2. Multi page scanning: multiple scans can be performed.
3. ADF double-sided and ADF front/back scanning: perform double-sided and front and back scanning
Common exceptions include: no scannable documents in the scanner, scan parameter error, scan IO error, etc | +| Type | According to the selection of the specified scanner for acquisition, due to the different scanner signals, the possible selection parameters are: flat panel type, paper feeding type, ADF double-sided and ADF front/back. Different scanners support different types of scanners:
1. Only flat type is supported: Canon Lide 210, Canon Lide 300, Canon Lide 400, etc;
2. Support paper feed: HP Officejet_ 250_ Mobile_ Series, etc;
3. Support paper feeder ADF double-sided and ADF front/back: Brother ADS-3600W, HanWang HW-3130, etc.
4. Flat panel and paper feed support: HP color LaserJet Pro MFP m281fdw, etc. | +| Color | Set the color, color, black and white, or grayscale of the scanned file | | Resolution | Set different scanner resolutions. This parameter is also obtained according to the specified scanner. The optional resolutions are: 75,100,150,200,300,600,1200,2400.
The higher the resolution, the longer the scanning time, the larger the memory occupied by the scanned image, and the later image processing operation will be too slow to load properly. When selecting a resolution greater than 600 for scanning, the system will give a corresponding prompt. | | Size | The specific scanning size is obtained from the scanner equipment selected by the user. The optional parameters are A4, A5 and A6. | -| Format | Different scan formats can be set for storing scanned documents. The optional parameters are: JPG, PNG, PDF, BMP. | +| Format | Different scan formats can be set for storing scanned documents. The optional parameters are: JPG, PNG, PDF, BMP,TIFF. | | Name | Sets the name of the scan file | -| Scan to | Set the initial save path of the scanned document, and the default is "images / kylin scanner images" under the home directory. | +| Scan to | Set the initial save path of the scanned document, and the default is "Pictures/kylin_scanner_images" under the home directory. | | Send mail | After scanning, you can send the scanned documents to the installed mail client of the system. | | Save As | After scanning or editing the scanned document, you can save the scanned document as a file in different formats. | diff --git a/data/kylin-scanner/zh_CN/image/OCR.png b/data/kylin-scanner/zh_CN/image/OCR.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/beauty.png b/data/kylin-scanner/zh_CN/image/beauty.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/crop.png b/data/kylin-scanner/zh_CN/image/crop.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/darkMode.png b/data/kylin-scanner/zh_CN/image/darkMode.png index daed3b867b2370089d1cea041815e8c73d06e102..53b662edad4d8e24b83de22cfe35398b2102abb8 100644 Binary files a/data/kylin-scanner/zh_CN/image/darkMode.png and b/data/kylin-scanner/zh_CN/image/darkMode.png differ diff --git a/data/kylin-scanner/zh_CN/image/detectPage.png b/data/kylin-scanner/zh_CN/image/detectPage.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/driverInstall.png b/data/kylin-scanner/zh_CN/image/driverInstall.png new file mode 100644 index 0000000000000000000000000000000000000000..1d9b7d5415247f229d4993636cbac4609a67ecf1 Binary files /dev/null and b/data/kylin-scanner/zh_CN/image/driverInstall.png differ diff --git a/data/kylin-scanner/zh_CN/image/lightMode.png b/data/kylin-scanner/zh_CN/image/lightMode.png index c2917edfac355dcb8a6d485be3f4425c4406ba41..1c7775974353d73a04557be66023f4feac089439 100644 Binary files a/data/kylin-scanner/zh_CN/image/lightMode.png and b/data/kylin-scanner/zh_CN/image/lightMode.png differ diff --git a/data/kylin-scanner/zh_CN/image/logo.png b/data/kylin-scanner/zh_CN/image/logo.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/mirror.png b/data/kylin-scanner/zh_CN/image/mirror.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/rectify.png b/data/kylin-scanner/zh_CN/image/rectify.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/rotate.png b/data/kylin-scanner/zh_CN/image/rotate.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/scan.png b/data/kylin-scanner/zh_CN/image/scan.png index c2917edfac355dcb8a6d485be3f4425c4406ba41..1c7775974353d73a04557be66023f4feac089439 100644 Binary files a/data/kylin-scanner/zh_CN/image/scan.png and b/data/kylin-scanner/zh_CN/image/scan.png differ diff --git a/data/kylin-scanner/zh_CN/image/search.png b/data/kylin-scanner/zh_CN/image/search.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/startMenu.png b/data/kylin-scanner/zh_CN/image/startMenu.png old mode 100644 new mode 100755 index fdb15685286a3d1dce5acf3abf8746d8591619ca..15682477612292dacb1f0aaec98a2eeddaebd33a Binary files a/data/kylin-scanner/zh_CN/image/startMenu.png and b/data/kylin-scanner/zh_CN/image/startMenu.png differ diff --git a/data/kylin-scanner/zh_CN/image/watermark.png b/data/kylin-scanner/zh_CN/image/watermark.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/image/zoomInOut.png b/data/kylin-scanner/zh_CN/image/zoomInOut.png old mode 100644 new mode 100755 diff --git a/data/kylin-scanner/zh_CN/index.md b/data/kylin-scanner/zh_CN/index.md old mode 100644 new mode 100755 index 0673117cf98e4f6e30475e5bd4ad4e5b51af3487..c2b085a101d745470f388369e9629ddd3b39111b --- a/data/kylin-scanner/zh_CN/index.md +++ b/data/kylin-scanner/zh_CN/index.md @@ -7,24 +7,24 @@ ## 打开方式 -- “开始菜单”>>“扫描” -- "任务栏">"搜索"![](image/search.png)"> “扫描" +- “开始菜单”>>“扫描” +- “任务栏”>![](image/search.png)“搜索”> “扫描”
-![图 1 扫描-日间模式](image/lightMode.png) +![图 1 扫描-浅色模式](image/lightMode.png)

-![图 2 扫描-夜间模式](image/darkMode.png) +![图 2 扫描-深色模式](image/darkMode.png)
## 基本操作 -- ### 检测扫描仪 +- **检测扫描仪** ​ 扫描软件打开后,会自动检测通过USB直连或者设置网络连接的扫描仪。 @@ -37,7 +37,18 @@
-- ### 扫描仪设置 +- **安装扫描仪驱动** + + +​ 扫描软件打开后,会自动检测通过USB直连或者设置网络连接的扫描仪,未检测到可用设备时,会触发对未安装驱动设备的检测程序,若发现可安装驱动的扫描仪设备,会推荐对应的驱动进行自动安装。 + +
+ +![图 3 扫描仪驱动安装](image/driverInstall.png) + +
+ +- **扫描仪设置** ​ 检测到并自动连接扫描设备后,右侧栏中可设置扫描仪设备相关参数(设备、页数、类型、颜色及分辨率)和文件预设参数(尺寸、格式、名称及存储路径),完成设置后,点击“**开始扫描**”将进行文档的扫描操作。 @@ -48,21 +59,21 @@
-​ 扫描完成后可对文档进行编辑操作。完成编辑后,可通过界面右侧栏中的“**发送至邮件**”或“**另存为**”选择文档保存的方式、路径。 +​ 扫描完成后可对文档进行编辑操作。完成编辑后,可通过界面右侧栏中的“**发送邮件**”或“**另存为**”选择文档保存的方式、路径。 ​ 下表列出了扫描设置及描述。 | 设置 | 描述 | | :------: | :----------------------------------------------------------- | | 设备 | 选择扫描设备 | -| 页数 | 1. 单页扫描:只能进行一次扫描,扫描结束后,不自动扫描;
2. 多页扫描:可以进行多次扫描,当第一次扫描结束后,可以根据设置的延时间隔进行下一次扫描,直到用户自动结束扫描或遇到异常情况。
常见异常情况有:扫描仪中无可扫描文档、扫描参数错误、扫描io错误等。 | -| 类型 | 根据选择指定的扫描仪进行获取的,可选参数有:平板式和馈纸式。不同的扫描仪支持的扫描仪类型不同:
1. 只支持平板式:Canon lide 210, Canon lide 300, Canon lide 400等;
2. 支持馈纸式:hp OfficeJet_250_Mobile_series等;
3. 平板式和馈纸式都支持:hp Color LaserJet Pro MFP M281fdw等。 | -| 颜色 | 设置扫描文件颜色,彩色或黑白 | +| 页数 | 1. 单页扫描:只能进行一次扫描,扫描结束后,不自动扫描;
2. 多页扫描:可以进行多次扫描。
3. ADF双面和ADF正面/反面:可以进行双面和正反面扫描
常见异常情况有:扫描仪中无可扫描文档、扫描参数错误、扫描io错误等。 | +| 类型 | 根据选择指定的扫描仪进行获取的,由于扫描仪信号的不同,可能的选参数有:平板式\馈纸式\ADF双面\ADF正面/反面。不同的扫描仪支持的扫描仪类型不同:
1. 只支持平板式:Canon lide 210, Canon lide 300, Canon lide 400等;
2. 支持馈纸式:hp OfficeJet_250_Mobile_series等;
3. 支持馈纸式、ADF双面和ADF正面/反面:Brother ADS-3600W、HanWang HW-3130等;
4. 平板式和馈纸式都支持:hp Color LaserJet Pro MFP M281fdw等。 | +| 颜色 | 设置扫描文件颜色,彩色、黑白或灰度 | | 分辨率 | 设置不同扫描仪分辨率,该参数也是根据指定扫描仪进行获取,可选分辨率有: 75, 100, 150, 200, 300, 600, 1200, 2400。
分辨率越高,扫描时长越长,扫描出的图片所占内存越大,后期的图像处理操作会有适当加载过慢现象,选择大于600的分辨率进行扫描时,系统会有对应提示。 | | 尺寸 | 从用户选定的扫描仪设备获取具体的扫描尺寸,可选参数为:A4, A5, A6。 | -| 格式 | 可设置不同的扫描格式用于存储扫描的文档。可选参数为:jpg, png, pdf, bmp。 | +| 格式 | 可设置不同的扫描格式用于存储扫描的文档。可选参数为:jpg, png, pdf, bmp,tiff。 | | 名称 | 设置扫描文件的名称 | -| 扫描至 | 设置扫描文档的初始保存路径,默认为家目录下的“图片/kylin-scanner-images”。 | +| 扫描至 | 设置扫描文档的初始保存路径,默认为家目录下的“图片/扫描图像”。 | | 发送邮件 | 扫描完成后,可以将扫描文档通过系统已安装的邮件客户端进行发送邮件。 | | 另存为 | 扫描完成或通过对扫描文档编辑操作后,可以将扫描文档另存为不同格式的文件。 | @@ -70,18 +81,16 @@ 下表列出了扫描工具栏功能对应的图标及说明。 -
图标及其功能: - -| 图标 | 名称 | 功能说明 | -| :----------------------: | :------: | :----------------------: | -| ![](image/beauty.png) | 一键美化 | 一键智能美化文档 | -| ![](image/rectify.png) | 智能纠偏 | 智能矫正文档页面 | -| ![](image/OCR.png) | 文字识别 | 提取文档文字内容 | -| ![](image/crop.png) | 裁切 | 剪裁文档页面 | -| ![](image/rotate.png) | 旋转 | 旋转文档页面 | -| ![](image/mirror.png) | 水平镜像 | 水平翻转文档页面 | -| ![](image/watermark.png) | 水印 | 添加水印 | -| ![](image/zoomInOut.png) | 页面缩放 | 选择不同页面缩放比例文档 | - -
+图标及其功能: + +| 图标 | 名称 | 功能说明 | +| :----------------------: | :------: | :------------------: | +| ![](image/beauty.png) | 一键美化 | 一键智能美化文档 | +| ![](image/rectify.png) | 智能纠偏 | 智能矫正文档页面 | +| ![](image/OCR.png) | 文字识别 | 提取文档文字内容 | +| ![](image/crop.png) | 裁切 | 剪裁文档页面 | +| ![](image/rotate.png) | 旋转 | 旋转文档页面 | +| ![](image/mirror.png) | 水平镜像 | 水平翻转文档页面 | +| ![](image/watermark.png) | 水印 | 添加水印 | +| ![](image/zoomInOut.png) | 页面缩放 | 选择不同页面缩放比例 | diff --git a/data/org.kylin-scanner-data.gschema.xml b/data/org.kylin-scanner-data.gschema.xml new file mode 100644 index 0000000000000000000000000000000000000000..647ae0d856f6560a639103a267b0dd7e4939d1a2 --- /dev/null +++ b/data/org.kylin-scanner-data.gschema.xml @@ -0,0 +1,9 @@ + + + + "" + scannerpath + scannerpath + + + diff --git a/data/org.ukui.log4qt.kylin-scanner.gschema.xml b/data/org.ukui.log4qt.kylin-scanner.gschema.xml new file mode 100644 index 0000000000000000000000000000000000000000..6710f702e0c9c7456a6917a8e417b1f6c3d11af5 --- /dev/null +++ b/data/org.ukui.log4qt.kylin-scanner.gschema.xml @@ -0,0 +1,39 @@ + + + + "true" + hook qt messages + Control if hook qt messages + + + "DEBUG,console,daily" + config rootLogger's level and appenders + config rootLogger's level and appenders:"level,appender" + + + ".yyyy-MM-dd" + daily log file pattern + set daily log file pattern format:one day + + + "%d{yyyy-MM-dd HH:mm:ss,zzz}(%-4r)[%t]|%-5p| - %m%n" + set log message's format + set log message's format + + + 3600 + set check log files delay time + set check log files delay time + + + 7 + set log files count + set log files count,unit s + + + 512 + set log files total size + set log files total size, unit M + + + diff --git a/data/scanner-buriedpoint.txt b/data/scanner-buriedpoint.txt new file mode 100644 index 0000000000000000000000000000000000000000..b4cfe6b1e5868ca501bfb37ae31e1bc13f3b2e8d --- /dev/null +++ b/data/scanner-buriedpoint.txt @@ -0,0 +1,223 @@ +事件名称:kylin-scanner连接服务端事件 +事件:100 +事件编码:address_connect +事件描述:kylin-scanner连接服务端事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner设备信息事件 +事件:100 +事件编码:device_info +事件描述:kylin-scanner设备信息事件 +事件来源类型:0 +事件自定义属性列表: +key: functionName +value: 扫描当前执行的方法 +key: deviceVendor +value: 设备厂商 +key:deviceName +value: 设备名称 +key: deviceModel +value: 设备型号 +key:deviceSerial +value: 设备序列号 +key:deviceVID +value: 设备VID +key:devicePID +value: 设备PID + +事件名称:kylin-scanner无驱动设备信息事件 +事件:100 +事件编码:DeviceNoDriver +事件描述:kylin-scanner无驱动设备信息事件 +事件来源类型:0 +事件自定义属性列表: +key: functionName +value: 扫描当前执行的方法 +key: deviceVendor +value: 设备厂商 +key:deviceName +value: 设备名称 +key: deviceModel +value: 设备型号 +key:deviceSerial +value: 设备序列号 +key:deviceVID +value: 设备VID +key:devicePID +value: 设备PID + +事件名称:kylin-scanner自动安装事件 +事件:100 +事件编码:DriverCanAutoInstall +事件描述:kylin-scanner自动安装事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner多页扫描事件 +事件:100 +事件编码:MultiPageScan +事件描述:kylin-scanner多页扫描事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner单页扫描事件 +事件:100 +事件编码:SinglePageScan +事件描述:kylin-scanner单页扫描事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner发送邮件事件 +事件:100 +事件编码:SendMail +事件描述:kylin-scanner发送邮件事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: Send Mail +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner另存事件 +事件:100 +事件编码:ScannerSaveAs +事件描述:kylin-scanner另存事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner当前无可用扫描仪事件 +事件:100 +事件编码:FindNoDriverDevice +事件描述:kylin-scanner当前无可用扫描仪事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner美化图片事件 +事件:100 +事件编码:ClickBeautification +事件描述:kylin-scanner美化图片事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner纠偏事件 +事件:100 +事件编码:Rectification +事件描述:kylin-scanner纠偏事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scannerOCR事件 +事件:100 +事件编码:TextRecognition +事件描述:kylin-scannerOCR事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner图片裁剪事件 +事件:100 +事件编码:Cutting +事件描述:kylin-scanner图片裁剪事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner图片旋转事件 +事件:100 +事件编码:Rotate +事件描述:kylin-scanner图片旋转事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner图片镜像事件 +事件:100 +事件编码:Mirror +事件描述:kylin-scanner图片镜像事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 + +事件名称:kylin-scanner添加水印事件 +事件:100 +事件编码:AddWatermark +事件描述:kylin-scanner添加水印事件 +事件来源类型:0 +事件自定义属性列表: +key:functionName +value: 扫描当前执行的方法 +key: action +value: 当前方法的动作 +key:function +value: 当前方法所处源码位置 diff --git a/debian/changelog b/debian/changelog index 0cb0e79bc4c9867c3e425d01e3b3586aba3af240..de9f6c491a73cee074fbc067f265c83dad9c275f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +kylin-scanner (3.2.1-ok2.8) nile; urgency=medium + + * BUG号: + #I90OQ2【扫描】【主要】调整分辨率为1200dpi,修改名称为888,修改格式为png后,扫描闪退 + * 需求号:无 + * 任务号: 无 + * 其他改动说明: 无 + * 其他改动影响域:无 + + -- fanyuchen Thu, 29 Feb 2024 15:18:49 +0800 + kylin-scanner (3.2.1-ok2.7) nile; urgency=medium * BUG号: diff --git a/debian/control b/debian/control index 14b7bd9d14b91929c3867c16dcbba3835bfa636d..058af0a96e1fe1ed0fc6f8c955c2036bb9dd9588 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,6 @@ Build-Depends: debhelper-compat (=12), libkf5windowsystem-dev, libqt5x11extras5-dev, pkgconf, - libkysdk-log-dev, libukui-log4qt-dev, policykit-1, libkysdk-kabase-dev, @@ -40,6 +39,8 @@ Build-Depends: debhelper-compat (=12), libsnmp-dev, libusb-1.0-0-dev, libbsd-dev, + libgraphicsmagick1-dev, + libgraphicsmagick-q16-3, libkysdk-datacollect-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no @@ -53,7 +54,6 @@ Depends: ${misc:Depends}, tesseract-ocr, tesseract-ocr-chi-sim, tesseract-ocr-eng, - imagemagick, kylin-system-updater, ghostscript, ${shlibs:Depends} diff --git a/debian/copyright b/debian/copyright index 70b1482f8abb375cbb960d0f26b6fe48ed4be7f9..7242174fbe6d77bb290110df9810ce16a00062a5 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: kylin-scanner -Upstream-Contact: yushuoqi +Upstream-Contact: fanyuchen Source: https://github.com/ukui/kylin-scanner Files: * diff --git a/kylin-scanner.pro b/kylin-scanner.pro index e7daad1084acbf15ad067e52bc0a4f034b1f2f38..b6ca7e6a59adf77333ef5387666c9b856078ca84 100644 --- a/kylin-scanner.pro +++ b/kylin-scanner.pro @@ -11,7 +11,7 @@ QT += \ svg # 配置kysdk -PKGCONFIG += kysdk-alm kysdk-qtwidgets kysdk-ukenv kysdk-datacollect kysdk-powermanagement kysdk-waylandhelper kysdk-ocr +PKGCONFIG += kysdk-alm kysdk-qtwidgets kysdk-ukenv kysdk-diagnostics kysdk-datacollect kysdk-powermanagement kysdk-waylandhelper kysdk-ocr INCLUDEPATH += /usr/include/kysdk/applications/kabase/ INCLUDEPATH += ./src/kabase/ INCLUDEPATH += ./src/kabase/Qt/ @@ -44,11 +44,13 @@ LIBS += \ -lX11 \ -L/usr/lib/libukui-log4qt.so.1.0.0 -lukui-log4qt\ -ltiff \ + -lGraphicsMagick \ + -ljpeg +INCLUDEPATH += /usr/include/GraphicsMagick #freeimage LIBS += -lfreeimage \ - -lfreeimageplus \ INCLUDEPATH += /usr/include/cImg.h @@ -77,6 +79,7 @@ SOURCES += \ src/failedpagewidget.cpp \ src/global.cpp \ src/globalsignal.cpp \ + src/imageBaseOP/imageconverter.cpp \ src/imageBaseOP/loadimage.cpp \ src/imageBaseOP/pngsaver.cpp \ src/imageBaseOP/savefilebase.cpp \ @@ -120,6 +123,7 @@ SOURCES += \ src/watermarkdialog.cpp \ src/custom_push_button.cpp \ src/navigator.cpp \ + src/include/customlabel.cpp \ HEADERS += \ src/crop.h \ @@ -129,6 +133,7 @@ HEADERS += \ src/failedpagewidget.h \ src/global.h \ src/globalsignal.h \ + src/imageBaseOP/imageconverter.h \ src/imageBaseOP/loadimage.h \ src/imageBaseOP/pngsaver.h \ src/imageBaseOP/savefilebase.h \ @@ -174,7 +179,7 @@ HEADERS += \ src/custom_push_button.h \ src/navigator.h \ src/kabase/buriedpoint.hpp \ - src/kabase/Qt/log.hpp + src/include/customlabel.h \ # Manual DISTFILES += \ @@ -268,9 +273,21 @@ qm_files.path = /usr/share/kylin-scanner/translations/ help_files.files = data/kylin-scanner/ help_files.path = /usr/share/kylin-user-guide/data/guide/ +schemes.files += \ + $$PWD/data/org.kylin-scanner-data.gschema.xml \ + $$PWD/data/org.ukui.log4qt.kylin-scanner.gschema.xml + +schemes.path = /usr/share/glib-2.0/schemas/ + + + # Install file in system -INSTALLS += target desktop icons qm_files help_files +INSTALLS += target desktop icons qm_files help_files schemes RESOURCES += \ src/icons/icons.qrc \ src/qss/scrollbar.qrc + +DISTFILES += \ + data/org.kylin-scanner-data.gschema.xml \ + data/org.ukui.log4qt.kylin-scanner.gschema.xml \ diff --git a/src/crop.h b/src/crop.h index 60aa3133baabde3439a67022aa57fb4db5b82302..fb8e956e1f5d9c2e854e602d5f6531555ff82c18 100644 --- a/src/crop.h +++ b/src/crop.h @@ -15,7 +15,6 @@ * along with this program; if not, see setContentsMargins(0, 0, 0, 0); setLayout(m_detectPageVLayout); - - } void DetectPageWidget::initConnect() diff --git a/src/detectpagewidget.h b/src/detectpagewidget.h index 485cb1acd5655f31e62724e8ea5209700a58d0b3..6c31fce10b4d3b2d57c789d323cd4998b588599b 100644 --- a/src/detectpagewidget.h +++ b/src/detectpagewidget.h @@ -69,7 +69,6 @@ private: QGSettings *m_themeData = nullptr; QVBoxLayout *m_detectPageVLayout = nullptr; - }; #endif // DETECTPAGEWIDGET_H diff --git a/src/device/device_information.cpp b/src/device/device_information.cpp index af381d473978397bc5e38ae66bc7ff9463a36653..990b735e49bd9a68bafa137dc0e9e1030c86abe6 100644 --- a/src/device/device_information.cpp +++ b/src/device/device_information.cpp @@ -199,13 +199,13 @@ DeviceInformation::DeviceInformation() void buriedNoDriverDevice(DeviceInformation device) { QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::kylinScannerDeviceNoDriver))); - buried_data.insert("device_vendor", device.vendor); - buried_data.insert("device_name", device.name); - buried_data.insert("device_model", device.model); - buried_data.insert("device_serial", device.serial); - buried_data.insert("device_VID", device.VID); - buried_data.insert("device_PID", device.PID); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::kylinScannerDeviceNoDriver))); + buried_data.insert("deviceVendor", device.vendor); + buried_data.insert("deviceName", device.name); + buried_data.insert("deviceModel", device.model); + buried_data.insert("deviceSerial", device.serial); + buried_data.insert("deviceVid", device.VID); + buried_data.insert("devicePid", device.PID); int cursor{0}; KCustomProperty property[buried_data.size()]; @@ -216,7 +216,7 @@ void buriedNoDriverDevice(DeviceInformation device) } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("DeviceNoDriver").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "device_no_driver", const_cast("mainPage")); kdk_dia_data_free(node); } diff --git a/src/device/ukui_apt.cpp b/src/device/ukui_apt.cpp index 1578e3da9b3ee2ac3e471e4eb8c018d77c0b923d..bed391af7a9fc4f9979269f7413c7f2e3798c4e2 100644 --- a/src/device/ukui_apt.cpp +++ b/src/device/ukui_apt.cpp @@ -53,8 +53,9 @@ void AptUtilHelper::processPkg() { qDebug("Pkg Worker Started!"); //Get Package... - if (m_device.packageNameList.isEmpty()) - getPackagesNameFromHttp(m_device); + if (m_device.packageNameList.isEmpty()){ + getPackagesNameFromHttp(m_device); + } m_packages = m_device.packageNameList; qDebug() << m_packages; diff --git a/src/device/usbFinder.cpp b/src/device/usbFinder.cpp index aa20ff5752e65b20a2413c666a818e989cfe5eb6..5c215b9ee0d76f02a4c17417c3f204b96005b05f 100644 --- a/src/device/usbFinder.cpp +++ b/src/device/usbFinder.cpp @@ -227,13 +227,13 @@ devpath_from_usb_devaddr (const QString &devaddr, DeviceInformation &info) bool usbClassCheck(int bInterfaceClass, int bInterfaceSubClass) { switch (bInterfaceClass) { - case LIBUSB_CLASS_PRINTER: +// case LIBUSB_CLASS_PRINTER: case LIBUSB_CLASS_IMAGE: return true; case LIBUSB_CLASS_VENDOR_SPEC: - if (bInterfaceSubClass == LIBUSB_CLASS_VENDOR_SPEC) { +// if (bInterfaceSubClass == LIBUSB_CLASS_VENDOR_SPEC) { return true; - } +// } return false; default: return false; diff --git a/src/failedpagewidget.cpp b/src/failedpagewidget.cpp index 82281e5ea76ebb077f62f3e29eadc69e1b5ecc06..4f3a9612aa6603dd5a4f944d44ceac7143dcc173 100644 --- a/src/failedpagewidget.cpp +++ b/src/failedpagewidget.cpp @@ -18,6 +18,8 @@ #include "failedpagewidget.h" #include +#include + #include #include #include @@ -64,8 +66,6 @@ void FailedPageWidget::setupGui() m_failedPageButton->setProperty("isImportant",true); m_failedPageButton->setMinimumSize(FailedPageButtonSize); - bool isPCMode = GlobalUserSignal::getInstance()->getCurrentMode(); - rotateChangedSlot(isPCMode); m_failedPageButton->setText(tr("Connect")); m_failedPageButton->adjustSize(); m_failedPageButton->setFocusPolicy(Qt::StrongFocus); @@ -75,9 +75,9 @@ void FailedPageWidget::setupGui() m_failedPageVLayout->setSpacing(0); m_failedPageVLayout->addStretch(); m_failedPageVLayout->addWidget(m_failedPageIcon, 0, Qt::AlignCenter); - m_failedPageVLayout->addSpacing(13); + m_failedPageVLayout->addSpacing(8); m_failedPageVLayout->addWidget(m_failedPageText, 0, Qt::AlignCenter); - m_failedPageVLayout->addSpacing(29); + m_failedPageVLayout->addSpacing(24); m_failedPageVLayout->addWidget(m_failedPageButton, 0, Qt::AlignCenter); m_failedPageVLayout->addStretch(); m_failedPageVLayout->setContentsMargins(0, 0, 0, 0); diff --git a/src/globalsignal.cpp b/src/globalsignal.cpp index 82e7eccf574c5a0906817138e5e36e4e18adac1b..6102247c1b421140c69620f22858aa8b119c7ccc 100644 --- a/src/globalsignal.cpp +++ b/src/globalsignal.cpp @@ -18,6 +18,7 @@ #include "globalsignal.h" #include +#define KYLINSCANNER "org.kylin-scanner-data.settings" GlobalUserSignal* GlobalUserSignal::instance = new GlobalUserSignal; @@ -254,9 +255,9 @@ void GlobalUserSignal::stopOcrTimer() { emit stopOcrTimerSignal(); } - GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent) { + } GlobalUserSignal::~GlobalUserSignal() @@ -292,22 +293,28 @@ GlobalConfigSignal *GlobalConfigSignal::getInstance() GlobalConfigSignal::GlobalConfigSignal(QObject *parent) { + if(QGSettings::isSchemaInstalled(KYLINSCANNER)){ + m_data = new QGSettings(KYLINSCANNER); + } m_configPath = QDir::homePath() + "/.config"; m_scannerPath = m_configPath + "/kylin-scanner"; m_scannerPnmImagePath = QStandardPaths::standardLocations(QStandardPaths::TempLocation).at(0)+ "/kylin-scanner/images"; - QLocale locale = QLocale::system().name(); - if(locale.language() == QLocale::Chinese){ - m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/扫描图像"; - }else if(locale.language() == QLocale::English){ - m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/kylin-scanner-images"; - }else if(locale.language() == QLocale::Tibetan){ - m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/བཤར་འབེབས་འབུར་ཐོན་"; + if(m_data->get("scannerpath").toString() != ""){ + m_scannerImagePath = m_data->get("scannerpath").toString(); + }else{ + QLocale locale = QLocale::system().name(); + if(locale.language() == QLocale::Chinese){ + m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/扫描图像"; + }else if(locale.language() == QLocale::English){ + m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/kylin-scanner-images"; + }else if(locale.language() == QLocale::Tibetan){ + m_scannerImagePath = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0) + "/བཤར་འབེབས་འབུར་ཐོན་"; + } } - m_scannerTempPath = QDir::tempPath() + "/kylin-scanner"; m_kylinScannerImageDebug = false; diff --git a/src/globalsignal.h b/src/globalsignal.h index 84f4da58db0a38516106fefdb35b5c35579638ff..3fa16fc7777d48c4e35d870833bb067e5f9d8822 100644 --- a/src/globalsignal.h +++ b/src/globalsignal.h @@ -26,7 +26,7 @@ #include #include #include "utils/rotatechangeinfo.h" - +#include /** * @brief The GlobalUserSignal class @@ -110,8 +110,6 @@ public: void switchToDetectPage(); signals: - void cropOpSig(); - void rollBackOperationSig(); void openDeviceSignal(int); void updateSettingSignal(); void warnMsgSignal(QString); @@ -194,7 +192,6 @@ signals: void showScanWidgetSignal(QString path); void findNoDriverDeviceSignal(); void cancleCorpSignal(); - void mutexUnlockSignal(); void exitOcrWhenScanSignal(); void rotationChangedSig(bool); @@ -204,11 +201,11 @@ private: QList deviceList; SANE_Device inUseDevice; bool isFailPage = false; + explicit GlobalUserSignal(QObject *parent = nullptr); ~GlobalUserSignal(); GlobalUserSignal(const GlobalUserSignal &) = delete; GlobalUserSignal &operator = (const GlobalUserSignal &) = delete; - }; @@ -249,7 +246,7 @@ public: bool m_hideScanSettingsWidget; double m_transparency = 0.60; - + QGSettings *m_data = nullptr; private: static GlobalConfigSignal *instance; diff --git a/src/imageBaseOP/imageconverter.cpp b/src/imageBaseOP/imageconverter.cpp new file mode 100644 index 0000000000000000000000000000000000000000..138d37837c45e78147d0518a3b192dea90b85ef2 --- /dev/null +++ b/src/imageBaseOP/imageconverter.cpp @@ -0,0 +1,19 @@ +#include "imageconverter.h" + +ImageConverter::ImageConverter(QObject *parent) : QObject(parent) { + +} + +void ImageConverter::convertImage(QString pnmpath, QString jpgpath) +{ + char *exec_argv[5]; + exec_argv[0] = "gm"; + exec_argv[1] = "convert"; + exec_argv[2] = pnmpath.toUtf8().data(); + exec_argv[3] = jpgpath.toUtf8().data(); + exec_argv[4] = NULL; + + qDebug()<< "start"; + qDebug() << "图片转换结果:" << GMCommand(4,exec_argv); + qDebug()<< "finish"; +} diff --git a/src/imageBaseOP/imageconverter.h b/src/imageBaseOP/imageconverter.h new file mode 100644 index 0000000000000000000000000000000000000000..6a83fb59d5b4ccddfe44f01a4172d633fa6f02eb --- /dev/null +++ b/src/imageBaseOP/imageconverter.h @@ -0,0 +1,19 @@ +#ifndef IMAGECONVERTER_H +#define IMAGECONVERTER_H + +#include +#include +#include +#include + +class ImageConverter : public QObject { + Q_OBJECT + +public: + ImageConverter(QObject *parent = nullptr); + +public slots: + void convertImage(QString pnmpath, QString jpgpath); +}; + +#endif // IMAGECONVERTER_H diff --git a/src/imageBaseOP/loadimage.cpp b/src/imageBaseOP/loadimage.cpp index 36727b6c8bcbbe7f433ec26866f9b4ce078aecdb..c3a52390e08a6a035a73ab6c1afa05e41eb3bf1e 100644 --- a/src/imageBaseOP/loadimage.cpp +++ b/src/imageBaseOP/loadimage.cpp @@ -20,7 +20,6 @@ #include #include #include -#include LoadImage::LoadImage(QObject *parent) : QObject(parent) { m_flag = false; @@ -36,10 +35,6 @@ void LoadImage::loadImageToWidget(QString loadPath, QString save_path, QImage *i QFileInfo loadPathInfo(loadPath); QString newLoadPath = loadPathInfo.absolutePath() + "/" + loadPathInfo.baseName() + ".jpg"; - loadAndSave(newLoadPath, loadPath); - - // cv::imwrite(std::string(newLoadPath.toLocal8Bit().data()), KylinImageCodec::loadImageToMat(loadPath).mat); - img->load(newLoadPath); @@ -89,11 +84,5 @@ void LoadImage::loadImageToWidget(QString loadPath, QString save_path, QImage *i emit finished(save_path, proportion, image); } -void LoadImage::loadAndSave(QString newLoadPath, QString loadPath) -{ - cimg_library::CImg img(loadPath.toLocal8Bit().data()); - if(!QFile(newLoadPath).exists()){ - img.save_jpeg(newLoadPath.toLocal8Bit().data()); - } -} + diff --git a/src/imageBaseOP/loadimage.h b/src/imageBaseOP/loadimage.h index c01393ca16799684e7ea99446828900d3ffaacce..4324d91881211f8e5f411bde90c3d0e1c4315a53 100644 --- a/src/imageBaseOP/loadimage.h +++ b/src/imageBaseOP/loadimage.h @@ -35,7 +35,6 @@ public slots: void loadImageToWidget(QString loadPath, QString save_path, QImage *img, QLabel *container,double scale, bool rotationFlag,QSize labSize); private: bool m_flag; - void loadAndSave(QString newLoadPath, QString loadPath); signals: void finished(QString, double, QImage); diff --git a/src/imageBaseOP/savefilebase.cpp b/src/imageBaseOP/savefilebase.cpp index d7fd601013a85b7f675c0eebc364ae09ffb15053..5e7527892bb6cb67e19ac820f2c0485b9a8a33d2 100644 --- a/src/imageBaseOP/savefilebase.cpp +++ b/src/imageBaseOP/savefilebase.cpp @@ -106,8 +106,6 @@ void SaveFileBase::saveToPdf(QImage *imgOP) QPixmap pixmap = QPixmap::fromImage(tmp); pdfPainter->drawPixmap(xCurrentP, yCurrentP, pixmap.width(), pixmap.height(), pixmap); - - pdfPainter->end(); delete pdfPainter; delete pdfWriter; @@ -115,6 +113,7 @@ void SaveFileBase::saveToPdf(QImage *imgOP) g_user_signal->exitWindowWithSaveFlag = false; m_pdfCount++; m_pdfName.append(m_fileName); + int num = g_sane_object->scanPageNumber; if(m_pdfCount == g_sane_object->scanPageNumber && g_sane_object->scanPageNumber != 1){ QFileInfo a = QFileInfo(m_fileName); @@ -139,7 +138,7 @@ void SaveFileBase::saveToPdf(QImage *imgOP) process->close(); } } - if(g_sane_object->scanPageNumber = 1){ + if(g_sane_object->scanPageNumber == 1){ m_pdfName.clear(); m_pdfCount = 0; } @@ -203,7 +202,7 @@ void SaveFileBase::saveAsTiff(QImage image, QString file_name) int i = 1; int count = 0; while(1){ - QString path = "/tmp/kylin-scanner/images/" + QFileInfo(save_name).completeBaseName() + "[" + QString::number(i) + "]" + + ".pnm"; + QString path = "/tmp/kylin-scanner/images/" + QFileInfo(save_name).completeBaseName() + "[" + QString::number(i) + "]" + ".pnm"; QFileInfo file(path); if(file.exists()){ i++; @@ -233,7 +232,7 @@ void SaveFileBase::saveAsTiff(QImage image, QString file_name) result = FreeImage_CloseMultiBitmap(out); } - if(result || g_sane_object->userInfo.pageNumber.compare(QApplication::tr("Single"), Qt::CaseInsensitive) == 0){ + if(result || (g_sane_object->userInfo.pageNumber.compare(QApplication::tr("Single"), Qt::CaseInsensitive) == 0 && g_sane_object->userInfo.type.compare(QApplication::tr("ADF Duplex"), Qt::CaseInsensitive) != 0)){ for(int j = 0; j < m_fileImages.length(); j++){ QString filename = m_fileImages.at(j); if(filename != save_name){ diff --git a/src/imageOp/imageoperationbeauty.cpp b/src/imageOp/imageoperationbeauty.cpp index d6f6d08e6041ca69616dbf813260dbb8bbccd6f5..30f31993257f4fb5a72f1055d3d16b5279bd36e0 100644 --- a/src/imageOp/imageoperationbeauty.cpp +++ b/src/imageOp/imageoperationbeauty.cpp @@ -36,14 +36,11 @@ void ImageOperationBeauty::ImageOP(){ void ImageOperationBeauty::beauty(const QImage inputImage) { - // 将图像转换为灰度图 - QImage grayImage = inputImage.convertToFormat(QImage::Format_Grayscale8); - // 创建输出图像 - QImage outputImage = grayImage; + QImage outputImage = inputImage; - int width = grayImage.width(); - int height = grayImage.height(); + int width = inputImage.width(); + int height = inputImage.height(); // 计算图像的平均亮度 int sum = 0; @@ -51,7 +48,7 @@ void ImageOperationBeauty::beauty(const QImage inputImage) { for (int x = 0; x < width; ++x) { - QRgb pixel = grayImage.pixel(x, y); + QRgb pixel = inputImage.pixel(x, y); sum += qGray(pixel); } } @@ -63,49 +60,59 @@ void ImageOperationBeauty::beauty(const QImage inputImage) for (int x = 1; x < width - 1; ++x) { // 获取中心像素值 - QRgb centerPixel = grayImage.pixel(x, y); - int centerGray = qGray(centerPixel); + QRgb centerPixel = inputImage.pixel(x, y); + int centerRed = qRed(centerPixel); + int centerGreen = qGreen(centerPixel); + int centerBlue = qBlue(centerPixel); - // 计算邻近像素的平均灰度值 + // 计算邻近像素的平均颜色值 sum = 0; for (int j = -1; j <= 1; ++j) { for (int i = -1; i <= 1; ++i) { - QRgb pixel = grayImage.pixel(x + i, y + j); + QRgb pixel = inputImage.pixel(x + i, y + j); sum += qGray(pixel); } } int averageGray = sum / 9; - // 计算高反差保留滤波后的像素值 - int newGray = qBound(0, centerGray + (centerGray - averageGray), 255); + // 计算高反差保留滤波后的颜色值 + int newRed = qBound(0, centerRed + (centerRed - averageGray), 255); + int newGreen = qBound(0, centerGreen + (centerGreen - averageGray), 255); + int newBlue = qBound(0, centerBlue + (centerBlue - averageGray), 255); // 根据平均亮度调整亮度 - int brightness = qBound(0, newGray + (newGray - averageBrightness) * 2, 255); + int brightness = qBound(0, (newRed + newGreen + newBlue) / 3 + ((newRed + newGreen + newBlue) / 3 - averageBrightness) * 2, 255); // 猜想补全模糊的字体内容 - if (centerGray < averageGray) + if (qGray(centerPixel) < averageGray) { // 补全模糊的字体内容 - brightness = qBound(0, centerGray + qAbs(centerGray - averageGray) * 2, 255); + brightness = qBound(0, (centerRed + centerGreen + centerBlue) / 3 + qAbs((centerRed + centerGreen + centerBlue) / 3 - averageGray) * 2, 255); } // USM锐化 float usmAmount = 0.8; // USM锐化的强度,可以调整此值 - int usmGray = centerGray + static_cast((centerGray - brightness) * usmAmount); - brightness = qBound(0, usmGray, 255); + int usmRed = centerRed + static_cast((centerRed - newRed) * usmAmount); + int usmGreen = centerGreen + static_cast((centerGreen - newGreen) * usmAmount); + int usmBlue = centerBlue + static_cast((centerBlue - newBlue) * usmAmount); + + // 亮度调整 + float brightnessAdjustment = 1.01; // 调整此值以改变亮度调整的强度 + int adjustedBrightness = qBound(0, static_cast(brightness * brightnessAdjustment), 255); - // 增强对比度 - float contrastAmount = 1.5; - brightness = qBound(0, static_cast((brightness -128) * contrastAmount) + 128, 255); + // 减小局部颜色变化 + float colorSmoothing = 0.01; // 调整此值以改变减小颜色变化的强度 + int finalRed = qBound(0, static_cast(usmRed + (adjustedBrightness - usmRed) * colorSmoothing), 255); + int finalGreen = qBound(0, static_cast(usmGreen + (adjustedBrightness - usmGreen) * colorSmoothing), 255); + int finalBlue = qBound(0, static_cast(usmBlue + (adjustedBrightness - usmBlue) * colorSmoothing), 255); // 更新像素值 - outputImage.setPixel(x, y, qRgb(brightness, brightness, brightness)); + outputImage.setPixel(x, y, qRgb(finalRed, finalGreen, finalBlue)); } } outputImage.save(ScanningPicture); } - diff --git a/src/include/common.h b/src/include/common.h index ac06523bc5781f9bbb5dd9ca50ae279396da7e34..0bf8961edf237f2e9dfec5016c6b11292ecff4dc 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -27,7 +27,7 @@ /******** Mainwidget ********/ #define MainWidgetWidth 960 #define MainWidgetHeight 677 -#define ApplicationName "Scanner" +#define ApplicationName "Scanner" /******** TitlebarWidget ********/ #define TitlebarLogoSize QSize(24,24) diff --git a/src/include/customlabel.cpp b/src/include/customlabel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48493eb5a5491a241fc1b0e6160e6b34c131ef52 --- /dev/null +++ b/src/include/customlabel.cpp @@ -0,0 +1,67 @@ +#include "customlabel.h" + +CustomLabel::CustomLabel(QWidget *parent) + : QLabel(parent){ + +} + +CustomLabel::CustomLabel(QString &text, QWidget *parent) + : QLabel(parent), m_fullText(text) +{ + +} + +void CustomLabel::setText(const QString &text) +{ + setFullText(text); +} + +void CustomLabel::setFullText(const QString &text) +{ + m_fullText = text; + update(); +} + +void CustomLabel::setTextLimitShrink(const QString &text, int width) +{ + this->setMinimumWidth(qMin(this->fontMetrics().width(text), width)); + setFullText(text); +} + +void CustomLabel::setTextLimitExpand(const QString &text) +{ + int textWidth = this->fontMetrics().width(text); + this->setMaximumWidth(textWidth); + setFullText(text); +} + +QString CustomLabel::fullText() const +{ + return m_fullText; +} + +void CustomLabel::paintEvent(QPaintEvent *event) +{ + QLabel::paintEvent(event); + elideText(); +} + +void CustomLabel::elideText() +{ + int margin = 32; + QFontMetrics fm = this->fontMetrics(); + int dif = fm.width(m_fullText) + margin - this->width() ; + if (dif > 0) { + QString showText = fm.elidedText(m_fullText, Qt::ElideRight, this->width() - margin); + QLabel::setText(showText); + if (showText != m_fullText) { + QString str = m_fullText; + this->setToolTip(str); + } else { + this->setToolTip(""); + } + } else { + QLabel::setText(m_fullText); + this->setToolTip(""); + } +} diff --git a/src/include/customlabel.h b/src/include/customlabel.h new file mode 100644 index 0000000000000000000000000000000000000000..e1d14de778ecd0faef07ce9e75a7a22131550c7e --- /dev/null +++ b/src/include/customlabel.h @@ -0,0 +1,26 @@ +#ifndef CUSTOMLABEL_H +#define CUSTOMLABEL_H + +#include + +class CustomLabel : public QLabel{ + Q_OBJECT +public: + explicit CustomLabel(QWidget *parent=0); + explicit CustomLabel(QString &text, QWidget *parent=0); + + void setText(const QString &text); + void setFullText(const QString &text); + void setTextLimitShrink(const QString &text, int width); + void setTextLimitExpand(const QString &text); + QString fullText() const; +protected: + void paintEvent(QPaintEvent *); + +private: + void elideText(); +private: + QString m_fullText; +}; + +#endif // CUSTOMLABEL_H diff --git a/src/main.cpp b/src/main.cpp index a9218ab542f04d532fd8cd1b8598165b97993421..e9caeade6aef7736c08561f3e0e3c77ab5d0a385 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,7 +17,6 @@ */ #include "singleapplication.h" #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include #include "windowmanage.hpp" #include "include/common.h" @@ -41,7 +41,6 @@ #include "mainwidget.h" #include "scandialog.h" #include "global.h" -#include "kabase/Qt/log.hpp" #define TRANS_PATH "/usr/share/kylin-scanner/translations" diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index e8218f1fafba6320866709fd9d72ed7ef060c9ab..b8dbecaf635accadcfd0d3bc29f4d84b2025da3a 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -17,6 +17,8 @@ */ #include "mainwidget.h" +#define cimg_use_jpeg + #include #include #include @@ -25,10 +27,9 @@ #include "Qt/windowmanage.hpp" #include #include -#include #include #include "usb.h" -#include "kabase/Qt/windowmanage.hpp" +#include int const MainWidget::EXIT_CODE_REBOOT = -123456789; @@ -145,7 +146,7 @@ void MainWidget::resizeDisplayWidget() } void MainWidget::fontSizeChange() -{ +{ float fontSize = kdk::GsettingMonitor::getSystemFontSize().toFloat(); KyInfo() << "fontSize = " << fontSize; } @@ -156,6 +157,7 @@ void MainWidget::transparencyChange() g_config_signal->m_transparency = transparencyValue * 255; this->update(); } + void MainWidget::warnMsg(QString msg) { QMessageBox *msgBox = new QMessageBox(); @@ -166,7 +168,9 @@ void MainWidget::warnMsg(QString msg) msgBox->setText(msg); msgBox->setIcon(QMessageBox::Warning); msgBox->setWindowTitle(tr("Scanner")); - msgBox->setStandardButtons(QMessageBox::Ok); + QPushButton *okBtn = new QPushButton(msgBox); + okBtn->setText(tr("Ok")); + msgBox->addButton(okBtn, QMessageBox::YesRole); msgBox->setContextMenuPolicy(Qt::NoContextMenu); QWidget *widget = nullptr; @@ -262,7 +266,6 @@ void MainWidget::keyPressEvent(QKeyEvent *event) case Qt::Key_Enter: case Qt::Key_Space: if(g_sane_object->cropFlag){ - emit GlobalUserSignal::getInstance()->cropOpSig(); }else{ if(event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter){ if(g_sane_object->getSaneHaveHandle()){ @@ -275,7 +278,6 @@ void MainWidget::keyPressEvent(QKeyEvent *event) case Qt::Key_Z: if (event->modifiers() == Qt::ControlModifier) { KyInfo() << "pressed key(ctrl+z): " << event->key(); - emit GlobalUserSignal::getInstance()->rollBackOperationSig(); } break; case Qt::Key_Escape: @@ -321,6 +323,21 @@ void MainWidget::showHelpDialog() } return; } + +void MainWidget::loadAndSave(QStringList loadPath) +{ + for(int i = 0; i < loadPath.length(); i++){ + QFileInfo loadPathInfo(loadPath[i]); + QString newLoadPath = loadPathInfo.absolutePath() + "/" + loadPathInfo.baseName() + ".jpg"; + cimg_library::CImg img(QString(loadPath[i]).toLocal8Bit().data()); + if(!QFile(newLoadPath).exists()){ + img.save_jpeg(newLoadPath.toLocal8Bit().data()); + }else{ + QFile(newLoadPath).remove(); + img.save_jpeg(newLoadPath.toLocal8Bit().data()); + } + } +} void MainWidget::dbusInhabitSlot(){ flag = kdk_set_inhibit_lockscreen("kylin-scanner" , "TestReason"); if (flag == 0) { @@ -453,7 +470,8 @@ void MainWidget::scanThreadFinishedSlot(int saneStatus) if (saneStatus != SANE_STATUS_GOOD) { if (saneStatus == SANE_STATUS_INVAL) { - warnMsg(tr("Invalid argument, please change arguments or switch other scanners.") + tr("error code:") + QString::number(saneStatus)); + warnMsg(tr("Invalid argument, please change arguments or switch other scanners.")); + qDebug() << "Invalid argument, please change arguments or switch other scanners. error code:" << QString::number(saneStatus); } else if (saneStatus == SANE_STATUS_EOF) { g_sane_object->haveScanSuccessImage = true; if(g_sane_object->loadFullScanFileNames.length() != 0){ @@ -475,6 +493,7 @@ void MainWidget::scanThreadFinishedSlot(int saneStatus) }else{ if(g_sane_object->loadFullScanFileNames.length() != 0){ g_sane_object->scanPageNumber = g_sane_object->saveFullScanFileNames.length(); + loadAndSave(g_sane_object->loadFullScanFileNames); g_user_signal->scanThreadFinishedImageLoad(g_sane_object->loadFullScanFileNames, g_sane_object->saveFullScanFileNames); ThumbnailWidget::scanPictureIsEmpty = false; } @@ -483,17 +502,39 @@ void MainWidget::scanThreadFinishedSlot(int saneStatus) } else if (saneStatus == SANE_STATUS_DEVICE_BUSY) { closeScanDialogSlot(); - warnMsg(tr("Device busy, please wait or switch other scanners.") + tr("error code:") + QString::number(saneStatus)); + warnMsg(tr("Device busy, please wait or switch other scanners.")); + qDebug() << "Device busy, please wait or switch other scanners. error code:" << QString::number(saneStatus); } else if(saneStatus == SANE_STATUS_NO_DOCS) { closeScanDialogSlot(); - warnMsg(tr("Document feeder out of documents, please place papers and scan again.") + tr("error code:") + QString::number(saneStatus)); + warnMsg(tr("Document feeder out of documents, please place papers and scan again.")); + qDebug() << "Document feeder out of documents, please place papers and scan again. error code:" << QString::number(saneStatus); } else if(saneStatus == SANE_STATUS_CANCELLED) { closeScanDialogSlot(); warnMsg(tr("Scan operation has been cancelled.")); + qDebug() << "Scan operation has been cancelled. error code:" << QString::number(saneStatus); cancelFlag = false; - } else { + } else if(saneStatus == SANE_STATUS_UNSUPPORTED){ + warnMsg(tr("Scan failed, operation is not supported.")); + qDebug() << "Scan failed, operation is not supported. error code:" << QString::number(saneStatus); + }else if(saneStatus == SANE_STATUS_JAMMED){ + warnMsg(tr("Scan failed, Document fedder jammed.")); + qDebug() << "Scan failed, Document fedder jammed. error code:" << QString::number(saneStatus); + }else if(saneStatus == SANE_STATUS_IO_ERROR){ + warnMsg(tr("Scan failed, Error during device I/O.")); + qDebug() << "Scan failed, Error during device I/O. error code:" << QString::number(saneStatus); + }else if(saneStatus == SANE_STATUS_NO_MEM){ + warnMsg(tr("Scan failed, Out of memory.")); + qDebug() << "Scan failed, Out of memory. error code:" << QString::number(saneStatus); + }else if(saneStatus == SANE_STATUS_ACCESS_DENIED){ + warnMsg(tr("Scan failed, Access to resource has been denied.")); + qDebug() << "Scan failed, Access to resource has been denied. error code:" << QString::number(saneStatus); + }else if(saneStatus == SANE_STATUS_COVER_OPEN){ + warnMsg(tr("Scan failed, Scanner cover is open.")); + qDebug() << "Scan failed, Scanner cover is open. error code:" << QString::number(saneStatus); + }else{ qDebug() << "met error! saneStatus:" << saneStatus; - warnMsg(tr("Scan failed, please check your scanner or switch other scanners. If you want to continue using the scanner, click Options, refresh the list to restart the device.") + tr("error code:") + QString::number(saneStatus)); + warnMsg(tr("Scan failed, please check your scanner or switch other scanners. If you want to continue using the scanner, click Options, refresh the list to restart the device.")); + qDebug() << "Scan failed, please check your scanner or switch other scanners. If you want to continue using the scanner, click Options, refresh the list to restart the device." << QString::number(saneStatus); } } else { g_sane_object->haveScanSuccessImage = true; @@ -514,6 +555,8 @@ void MainWidget::scanThreadFinishedSlot(int saneStatus) } }else{ g_sane_object->scanPageNumber = g_sane_object->saveFullScanFileNames.length(); + + loadAndSave(g_sane_object->loadFullScanFileNames); g_user_signal->scanThreadFinishedImageLoad(g_sane_object->loadFullScanFileNames, g_sane_object->saveFullScanFileNames); ThumbnailWidget::scanPictureIsEmpty = false; } @@ -534,8 +577,8 @@ void MainWidget::onPrepareForSleep(bool isSleep) } else //唤醒分支 { qDebug() << "唤醒!!!"; - // 提示用户 检测到用户手动休眠,请检测扫描仪状态,若未继续扫描,需手动点击取消或刷新列表恢复设备扫描功能 - QString msg = tr("Detected user manual hibernation. Please check the scanner status. If scanning does not continue, you need to manually click cancel or refresh the list to resume device scanning function."); + // 提示用户 检测到休眠/睡眠,请检测扫描仪状态,若未继续扫描,需手动点击取消或刷新列表恢复设备扫描功能 + QString msg = tr("Detected system hibernation/sleep. Please check the scanner status. If scanning does not continue, you need to manually click cancel or refresh the list to resume device scanning function."); g_user_signal->warnMsg(msg); } } diff --git a/src/mainwidget.h b/src/mainwidget.h index e48e1f7071ce65e195f5190c9b635a3ff581305c..8fa54d633ddaa1803f763bc6e87997aa20f323d7 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -118,6 +118,7 @@ public: void resizeTitleBar(); void resizeDisplayWidget(); + void fontSizeChange(); void transparencyChange(); @@ -169,6 +170,7 @@ private: void showHelpDialog(); + void loadAndSave(QStringList loadPath); public slots: void rotationChanged(bool isPCMode,int width,int height); void warnMsg(QString msg); diff --git a/src/newdevicelistpage.cpp b/src/newdevicelistpage.cpp index de8063c8b2ddd7b03475e8abba6addb8c6929d0a..f75b94b08cd09529a1e5f93790adc947494da18f 100644 --- a/src/newdevicelistpage.cpp +++ b/src/newdevicelistpage.cpp @@ -40,7 +40,7 @@ newDeviceListPage::newDeviceListPage(QList devInfoList, QWidg m_cancelButton(new QPushButton()), m_nextStepButton(new QPushButton()), m_selectedDeviceName(new QLabel()), - m_selectedDriverName(new QLabel()), + m_selectedDriverName(new CustomLabel()), m_cancelButton2(new QPushButton()), m_beforeButton(new QPushButton()), m_installButton(new QPushButton()), @@ -150,6 +150,20 @@ void newDeviceListPage::initConnect() { m_mainWidget->setCurrentIndex(0); this->setFixedSize(560, 420); + + QWidget *widget = nullptr; + QWidgetList widgetList = QApplication::allWidgets(); + for (int i=0; iobjectName() == "MainWindow") { + widget = widgetList.at(i); + } + } + if (widget) { + QRect rect = widget->geometry(); + int x = rect.x() + rect.width()/2 - this->width()/2; + int y = rect.y() + rect.height()/2 - this->height()/2; + this->move(x,y); + } }); connect(m_nextStepButton, &QPushButton::clicked, this, &newDeviceListPage::nextButtonClickSlot); connect(m_installButton, &QPushButton::clicked, this, &newDeviceListPage::installDriverSlot); @@ -204,7 +218,7 @@ void newDeviceListPage::nextButtonClickSlot() if(hasDriver) { QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerDriverCanAutoInstall))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerDriverCanAutoInstall))); buried_data.insert("action", "has driver, auto install"); buried_data.insert("function", "in newdevicelistpage.cpp function nextButtonClickSlot()"); @@ -217,17 +231,31 @@ void newDeviceListPage::nextButtonClickSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("DriverCanAutoInstall").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "driver_can_auto_install", const_cast("mainPage")); kdk_dia_data_free(node); // 找到了对应驱动 m_selectedDriverName->setText(driverName); m_mainWidget->setCurrentIndex(1); this->setFixedSize(425, 210); - }else - { + + QWidget *widget = nullptr; + QWidgetList widgetList = QApplication::allWidgets(); + for (int i=0; iobjectName() == "MainWindow") { + widget = widgetList.at(i); + } + } + if (widget) { + QRect rect = widget->geometry(); + int x = rect.x() + rect.width()/2 - this->width()/2; + int y = rect.y() + rect.height()/2 - this->height()/2; + this->move(x,y); + } + + }else { QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerNoDriver))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerNoDriver))); buried_data.insert("action", "no driver, manual install"); buried_data.insert("function", "in newdevicelistpage.cpp function nextButtonClickSlot()"); @@ -240,7 +268,7 @@ void newDeviceListPage::nextButtonClickSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("NoDriverDevice").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "NoDriverDevice", const_cast("mainPage")); kdk_dia_data_free(node); // 未找到对应驱动程序 @@ -332,7 +360,7 @@ void newDeviceListPage::showSuccessDialog() void newDeviceListPage::showFailDialog(QString err) { m_waittingDialog->close(); - qDebug() << "Install failed"; + qDebug() << "Install failed " << err; m_msg = new QMessageBox(); m_msg->setFixedSize(450, 210); diff --git a/src/newdevicelistpage.h b/src/newdevicelistpage.h index dc11c5eb8e33fd65a79e518a24d8c648f0eeed3e..c7ec30e16e108759f27deb049168cb178fec01aa 100644 --- a/src/newdevicelistpage.h +++ b/src/newdevicelistpage.h @@ -29,9 +29,7 @@ #include #include #include -#include #include -#include #include "nodevicewidget.h" #include "waittingdialog.h" @@ -42,6 +40,7 @@ #include "ukui_apt.h" #include "globalsignal.h" #include "deviceFinder.h" +#include "include/customlabel.h" class newDeviceListPage : public QDialog { @@ -73,7 +72,7 @@ private: // mainVlayout2 的内容 QLabel *m_selectedDeviceName = nullptr; - QLabel *m_selectedDriverName = nullptr; + CustomLabel *m_selectedDriverName = nullptr; QPushButton *m_cancelButton2 = nullptr; QPushButton *m_beforeButton = nullptr; QPushButton *m_installButton = nullptr; diff --git a/src/rectify.cpp b/src/rectify.cpp index e92f810f6ee11431c3256972d68a923e03038e0d..d7968cd274dae07b2833a94d104de0173fc3ad0a 100644 --- a/src/rectify.cpp +++ b/src/rectify.cpp @@ -15,23 +15,6 @@ * along with this program; if not, see #include + SaneObject * SaneObject::instance = new SaneObject; #ifdef __cplusplus @@ -27,13 +28,13 @@ extern "C" { #define STRIP_HEIGHT 256 #define A4BRY 297 // Some scanner device will less than 297 -typedef struct _Image { +typedef struct _ScanImage { uint8_t *data; int width; int height; int x; int y; -} Image; +} ScanImage; typedef struct _OptDescriptor { int numColorMode; @@ -90,7 +91,7 @@ static void writePnmHeader (SANE_Frame format, int width, int height, int depth, } } -static void *advance (Image *image) +static void *advance (ScanImage *image) { if (++image->x >= image->width) { image->x = 0; @@ -130,7 +131,7 @@ static SANE_Status onScanning(FILE *ofp) SANE_Byte min = 0xff, max = 0; SANE_Parameters parm; SANE_Status status; - Image image = { nullptr, 0, 0, 0, 0 }; + ScanImage image = { nullptr, 0, 0, 0, 0 }; SANE_Word total_bytes = 0; SANE_Int hang_over = -1; do { @@ -156,10 +157,10 @@ static SANE_Status onScanning(FILE *ofp) if (first_frame) { if (parm.lines >= 0) { - KyInfo() << "Image's size(pixels): " << parm.pixels_per_line << parm.lines + KyInfo() << "ScanImage's size(pixels): " << parm.pixels_per_line << parm.lines << "Bits/pixel: " << parm.depth * (SANE_FRAME_RGB == parm.format ? 3 : 1); } else { - KyInfo() << "Image's wide pixels: " << parm.pixels_per_line + KyInfo() << "ScanImage's wide pixels: " << parm.pixels_per_line << "Height for bits/pixel: " << parm.depth * (SANE_FRAME_RGB == parm.format ? 3 : 1); } @@ -416,6 +417,12 @@ void SaneObject::refreshListSlots() g_user_signal->warnMsg(msg); } +void converPnmToJpg(QString pnmPath, QString jpgPath) +{ + ImageConverter converter; + converter.convertImage(pnmPath, jpgPath); +} + SANE_Status doScan(const char *fileName) { SANE_Status status = SANE_STATUS_GOOD; @@ -549,7 +556,6 @@ static SANE_Status saneGetDevices(const SANE_Device ***device_list) if (status) { KyInfo() << "status = " << sane_strstatus(status); } - return status; } @@ -575,7 +581,8 @@ SANE_Status saneOpen(SANE_Device *device, SANE_Handle *sane_handle) /// status = Error during device I/O: can be this scanner connected by usb is error, /// so check usb connected. KyInfo() << "status = " << sane_strstatus(status); - QString message = QApplication::tr("Fail to open the scanner, error code ") + QString::number(status); + QString message = QApplication::tr("Fail to open the scanner") ; + qDebug() << "Fail to open the scanner, error code" << QString::number(status); QTimer::singleShot(1000, [=](){g_user_signal->warnMsg(message);}); }else{ KyInfo() << "Open scanner success"; @@ -1198,6 +1205,11 @@ SANE_Status setOptionSizesAll(SANE_Handle sane_handle, int type) return status; } +SANE_Status setOptionPaperSize(SANE_Handle device, char *str, int option_num){ + SANE_Status status = sane_control_option(device, option_num, SANE_ACTION_SET_VALUE, str, nullptr); + return status; +} + static void *guardsMalloc(size_t size) { unsigned char *ptr; @@ -1380,21 +1392,20 @@ static SANE_Status getOptionValue(SANE_Handle device, const char *option_name) }else if (!strcmp(option_name, SANE_NAME_SCAN_BR_X)) { g_optDesc.numSizeBrX = optnum; // Via br_x to decide scan sizes - int size_range = static_cast( SANE_UNFIX(opt->constraint.range->max) \ - - SANE_UNFIX(opt->constraint.range->min)); + int size_range = static_castSANE_UNFIX(opt->constraint.range->max); KyInfo() << "min = " << SANE_UNFIX(opt->constraint.range->min) << "max = " << SANE_UNFIX(opt->constraint.range->max) << "size_range = " << size_range; { - if (val_size >= 420) + if (size_range >= 420) sizes << "A2"; - if (val_size >= 297) + if (size_range >= 297) sizes << "A3"; - if (val_size >= 209) + if (size_range >= 209) sizes << "A4"; - if (val_size >= 148) + if (size_range >= 148) sizes << "A5"; - if (val_size >= 105) + if (size_range >= 105) sizes << "A6"; } g_sane_object->setSaneSizes(sizes); @@ -1442,7 +1453,11 @@ static SANE_Status getOptionValue(SANE_Handle device, const char *option_name) KyInfo() << "Default optnum = " << g_optDesc.numSource << "source = " << val_string_source << "constraint_type = " << opt->constraint_type; - } else { + } else if(!strcmp(option_name, "paper-size")){ + if(SANE_OPTION_IS_SETTABLE(opt->cap)){ + setOptionPaperSize(device, "user_def", optnum); + } + }else{ // Canon Lide 400 local connect error status = SANE_STATUS_INVAL; } @@ -1563,6 +1578,8 @@ static SANE_Status showAllSaneParameters(SANE_Handle device) return status; } + getOptionValue(device, "paper-size"); + // Default size coordination, top_left(x, y) getOptionValue(device, SANE_NAME_SCAN_TL_X); if (status != SANE_STATUS_GOOD) { diff --git a/src/saneobject.h b/src/saneobject.h index 0b3d126486ce30d06911340c35ecf31e133b4173..7751a5487f32cb5d8dfb1d5e7b135a9b15ad2348 100644 --- a/src/saneobject.h +++ b/src/saneobject.h @@ -39,6 +39,7 @@ #include #include #include +#include "imageBaseOP/imageconverter.h" #ifdef __cplusplus extern "C" { diff --git a/src/scansettingswidget.cpp b/src/scansettingswidget.cpp index 1a9985a64e30c209091d2bc455ba3274a642f3aa..6ce38dcabc0de0892b9d0b6bc1245335c1f57709 100644 --- a/src/scansettingswidget.cpp +++ b/src/scansettingswidget.cpp @@ -37,6 +37,8 @@ #include "newdevicelistpage.h" #include +#define KYLINSCANNER "org.kylin-scanner-data.settings" + ScanSettingsWidget::ScanSettingsWidget(QWidget *parent) : QWidget(parent), m_scanButton(new QPushButton()), @@ -76,6 +78,9 @@ ScanSettingsWidget::ScanSettingsWidget(QWidget *parent) : dialog(new SendMailDialog(this)) { m_themeData = new QGSettings(UKUI_THEME_GSETTING_PATH); + if(QGSettings::isSchemaInstalled(KYLINSCANNER)){ + m_data = new QGSettings(KYLINSCANNER); + } setupGui(); initConnect(); @@ -128,6 +133,7 @@ void ScanSettingsWidget::selectSaveDirectorySlot() KyInfo() << "The user could read and write " << selectedDir; currentSaveDirectory = selectedDir; + m_data->set("scannerpath", currentSaveDirectory); setSaveButtonLabelAttributes(m_saveDirectoryButtonLabel, currentSaveDirectory, ScanSettingsButtonElideWidth); } else { if (file.isWritable()) { @@ -215,28 +221,25 @@ void ScanSettingsWidget::pageNumberCurrentTextChangedSlot(QString text) g_sane_object->setSaneStatus(true); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerMultiPageScan))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerMultiPageScan))); buried_data.insert("action", "multipage scan"); buried_data.insert("function", "in scansettingswidget.cpp function pageNumberCurrentTextChangedSlot()"); - int cursor{0}; KCustomProperty property[buried_data.size()]; for (auto iter = buried_data.begin(); iter != buried_data.end(); iter++) { property[cursor].key = strdup(iter.key().toLocal8Bit().data()); property[cursor].value = strdup(iter.value().toLocal8Bit().data()); cursor++; - } - KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); + } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("MultiPageScan").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "multi_page_scan", const_cast("mainPage")); kdk_dia_data_free(node); - } else { g_sane_object->userInfo.pageNumber = tr("Single"); // m_saveNameEdit->setMaxLength(237); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSinglePageScan))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSinglePageScan))); buried_data.insert("action", "SinglePage scan"); buried_data.insert("function", "in scansettingswidget.cpp function pageNumberCurrentTextChangedSlot()"); @@ -249,9 +252,8 @@ void ScanSettingsWidget::pageNumberCurrentTextChangedSlot(QString text) } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("SinglePageScan").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "single_page_scan", const_cast("mainPage")); kdk_dia_data_free(node); -// free(&property); } } @@ -353,7 +355,7 @@ void ScanSettingsWidget::nameCurrentTextChangedSlot(QString text) void ScanSettingsWidget::sendMailButtonClickedSlot() { QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSendMail))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSendMail))); buried_data.insert("action", "Send Mail"); buried_data.insert("function", "in scansettingswidget.cpp function sendMailButtonClickedSlot()"); @@ -366,7 +368,7 @@ void ScanSettingsWidget::sendMailButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("SendMail").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "send_mail", const_cast("mainPage")); kdk_dia_data_free(node); int retDialog; @@ -376,6 +378,20 @@ void ScanSettingsWidget::sendMailButtonClickedSlot() if (! maillist) { NoMailDialog *dialog = new NoMailDialog(); + QWidget *widget = nullptr; + QWidgetList widgetList = QApplication::allWidgets(); + for (int i=0; iobjectName() == "MainWindow") { + widget = widgetList.at(i); + } + } + if (widget) { + QRect rect = widget->geometry(); + int x = rect.x() + rect.width()/2 - dialog->width()/2; + int y = rect.y() + rect.height()/2 - dialog->height()/2; + dialog->move(x,y); + } + retDialog = dialog->exec(); if (retDialog == QDialog::Accepted) { QProcess *process = new QProcess(); @@ -385,8 +401,6 @@ void ScanSettingsWidget::sendMailButtonClickedSlot() } else { KyInfo() << "Get mail client list success."; - SendMailDialog *dialog = new SendMailDialog(this); - dialog->setMailSelectComboboxItems(); dialog->exec(); @@ -397,9 +411,8 @@ void ScanSettingsWidget::sendMailButtonClickedSlot() void ScanSettingsWidget::saveAsButtonClickedSlot(bool exitApp) { - QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSaveAs))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerSaveAs))); buried_data.insert("action", "save in user designed path"); buried_data.insert("function", "in scansettingswidget.cpp function saveAsButtonClickedSlot()"); @@ -412,10 +425,9 @@ void ScanSettingsWidget::saveAsButtonClickedSlot(bool exitApp) } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("ScannerSaveAs").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "scanner_save_as", const_cast("mainPage")); kdk_dia_data_free(node); - QString filename = m_saveNameEdit->text(); QString fileFormat = m_formatComboBox->currentText(); QString filepath = currentSaveDirectory; @@ -446,7 +458,7 @@ void ScanSettingsWidget::saveAsButtonClickedSlot(bool exitApp) }else{ openFileName = filepath + "/" + filename; } - QString path = fileDialog.getSaveFileName(this,tr("Save As"),openFileName,filter,&fileType); + QString path = fileDialog.getSaveFileName(this, tr("Save As"), openFileName, filter, &fileType); fileType = fileType.right(fileType.length() - 1); int pos = path.lastIndexOf("/"); int length = path.length(); @@ -517,16 +529,16 @@ bool ScanSettingsWidget::showRunningDialog() QString format = m_formatComboBox->currentText(); QString filePath; if(g_sane_object->userInfo.pageNumber.compare(QApplication::tr("Multiple"), Qt::CaseInsensitive) == 0 || g_sane_object->userInfo.type.compare(QApplication::tr("ADF Duplex"), Qt::CaseInsensitive) == 0){ - if(format != "tiff"){ + if(format != "tiff" && format != "pdf"){ filePath = path + "/" + fileName + "[1]" + "." + format; }else{ - filePath = path + "/" + fileName + "." + "tiff"; + filePath = path + "/" + fileName + "." + format; } }else{ - if(format != "tiff"){ + if(format != "tiff" && format != "pdf"){ filePath = path + "/" + fileName + "." + format; }else{ - filePath = path + "/" + fileName + "." + "tiff"; + filePath = path + "/" + fileName + "." + format; } } QFileInfo file(filePath); @@ -610,8 +622,9 @@ void ScanSettingsWidget::showWaittingDialogSlot() m_waittingDialog = new WaittingDialog(widget); m_waittingDialog->show(); + QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerFindNoDriverDevice))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerFindNoDriverDevice))); buried_data.insert("action", "Show waitting dialog and make deviceFinder start work."); buried_data.insert("function", "in scansettingswidget.cpp function ShowWaittingDialogSlot()"); @@ -624,7 +637,7 @@ void ScanSettingsWidget::showWaittingDialogSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("FindNoDriverDevice").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "find_no_driver_device", const_cast("mainPage")); kdk_dia_data_free(node); m_devFinder = new deviceFinder(); diff --git a/src/scansettingswidget.h b/src/scansettingswidget.h index b53dd6763950b70e858479de27efd7c4a5d71ded..f9c3a2748131487cab42166132d933d6f44288b4 100644 --- a/src/scansettingswidget.h +++ b/src/scansettingswidget.h @@ -188,6 +188,7 @@ private: QVBoxLayout *m_mainVLayout = nullptr; QGSettings *m_themeData = nullptr; + QGSettings *m_data = nullptr; SendMailDialog *dialog = nullptr; deviceFinder *m_devFinder = nullptr; @@ -196,6 +197,7 @@ private: bool isDarkTheme(); bool showRunningDialog(); + private slots: void setScanIconDisable(); void showNewDeviceListPageSuccessSlot(); diff --git a/src/sendmail.cpp b/src/sendmail.cpp index 643b29a0b408d90133fd72f98207e0a5193b4646..3d4286f1e252634e1011e3ad0d996f6faae230e6 100644 --- a/src/sendmail.cpp +++ b/src/sendmail.cpp @@ -132,7 +132,6 @@ void NoMailDialog::initConnect() connect(m_themeData, &QGSettings::changed, this, &NoMailDialog::fontSizeChangedSlot); } - void NoMailDialog::themeChangedWhite() { QPalette pal(palette()); @@ -241,7 +240,7 @@ void SendMailDialog::initLayout() m_confirmButton->setText(tr("Confirm")); m_confirmButton->setToolTip(tr("Confirm")); m_confirmButton->setFocus(); - m_confirmButton->setShortcut( QKeySequence::InsertParagraphSeparator); + m_confirmButton->setShortcut(QKeySequence::InsertParagraphSeparator); m_confirmButton->setShortcut(Qt::Key_Enter); m_confirmButton->setShortcut(Qt::Key_Return); diff --git a/src/sendmail.h b/src/sendmail.h index 071c07fe06b59877453212b836239582790a7066..522226fe569c081c237d4b7f7fcbba8c7f8008b8 100644 --- a/src/sendmail.h +++ b/src/sendmail.h @@ -43,7 +43,6 @@ #include #include #include - #include "utils/xatom-helper.h" #include "globalsignal.h" #include "include/common.h" diff --git a/src/showimagewidget.cpp b/src/showimagewidget.cpp index e83f2d7ebade33d55ec432093dad899339b8f0b9..cbe28e3a0234a2a3aafb2b9d317fe58631665c9a 100644 --- a/src/showimagewidget.cpp +++ b/src/showimagewidget.cpp @@ -18,7 +18,6 @@ #include "showimagewidget.h" #include #include -#include #include #include "utils/copyoperation.h" #include "imageOp/imageoperationbeauty.h" @@ -942,7 +941,7 @@ void ShowImageWidget::cropSlot() *m_stackImage = m_normalImage->copy(); m_imageStack.push(*m_stackImage); - + g_user_signal->exitWindowWithSaveFlag = true; setCropPixmapScaled(*m_editImage, m_cropLabel); }else{ rollBackOperation(); @@ -1122,11 +1121,20 @@ void ShowImageWidget::showBeautyRunningDialog(QString text) { m_beautyRunningDialog = new RunningDialog(this, text); - QPoint globalPos = this->mapToGlobal(QPoint(0, 0)); - int m_x = (this->width() - m_beautyRunningDialog->width()) / 2; - int m_y = (this->height() - m_beautyRunningDialog->height()) / 2; + QWidget *widget = nullptr; + QWidgetList widgetList = QApplication::allWidgets(); + for (int i=0; iobjectName() == "MainWindow") { + widget = widgetList.at(i); + } + } + if (widget) { + QRect rect = widget->geometry(); + int x = rect.x() + rect.width()/2 - m_beautyRunningDialog->width()/2; + int y = rect.y() + rect.height()/2 - m_beautyRunningDialog->height()/2; + m_beautyRunningDialog->move(x,y); + } - m_beautyRunningDialog->move(globalPos.x() + m_x, globalPos.y() + m_y); m_beautyRunningDialog->disconnectCancelButton(); m_beautyRunningDialog->m_closeButtondisconnect(); @@ -1172,7 +1180,6 @@ void ShowImageWidget::beautyFinished(){ imageOp = nullptr; imageOpThread->quit(); qDebug() << "image operation complete!"; - emit g_user_signal->mutexUnlockSignal(); } void ShowImageWidget::beautyStopSlot() { diff --git a/src/showocrwidget.cpp b/src/showocrwidget.cpp index 2d15e2a910a8432e07713647dca12d8b8c5128ee..1d212d52cd35738ae9e918c7e9c67a684897331a 100644 --- a/src/showocrwidget.cpp +++ b/src/showocrwidget.cpp @@ -17,7 +17,6 @@ */ #include "showocrwidget.h" #include -#include #include #include diff --git a/src/thumbnailwidget.cpp b/src/thumbnailwidget.cpp index ce4188fd4e821ac12ac2e6110ca2a6187b9a61e0..06b2613e3e215565e9b4951e300ef754bc4bc5a9 100644 --- a/src/thumbnailwidget.cpp +++ b/src/thumbnailwidget.cpp @@ -17,10 +17,11 @@ */ #include "thumbnailwidget.h" #include -#include #include #include #include "include/theme.h" +#include +#include "imageBaseOP/imageconverter.h" int ThumbnailWidget::scanPictureCount = 0; bool ThumbnailWidget::scanPictureIsEmpty = true; @@ -86,6 +87,12 @@ bool ThumbnailWidget::isDarkTheme() } } +void ThumbnailWidget::converPnmToJpg(QString pnmPath, QString jpgPath) +{ + ImageConverter converter; + converter.convertImage(pnmPath, jpgPath); +} + void ThumbnailWidget::resizeEvent(QResizeEvent *event) { bool isPCMode = GlobalUserSignal::getInstance()->getCurrentMode(); @@ -127,10 +134,9 @@ void ThumbnailWidget::showNormalImageAfterScan(QString loadPath, QString savePat int rowcount = m_thumbnailItemModel->rowCount(); KyInfo() << "rowcount = " << rowcount << "scanFullName = " << scanFullName; + QString newScanFullName = QFileInfo(scanFullName).absolutePath() + "/" + QFileInfo(scanFullName).baseName() + ".jpg"; - cimg_library::CImg img(scanFullName.toLocal8Bit().data()); - img.save_jpeg(newScanFullName.toLocal8Bit().data()); QPixmap iconPix(newScanFullName); QPixmap fitpixmap = iconPix.scaled(QSize(40, 40), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); @@ -139,7 +145,7 @@ void ThumbnailWidget::showNormalImageAfterScan(QString loadPath, QString savePat ScanStandardItem *item = new ScanStandardItem(); item->setIcon(QIcon(fitpixmap)); item->setToolTip(tooltipName); - item->setPath(scanFullName); + item->setPath(newScanFullName); item->setRowCountLocation(rowcount); m_thumbnailItemModel->insertRow(rowcount, item); diff --git a/src/thumbnailwidget.h b/src/thumbnailwidget.h index c8ebc4bac0dfc6adc4bd730a8e14c72d5f0ea794..a0d146b939874311f3fb8a25cec69bb10f35d397 100644 --- a/src/thumbnailwidget.h +++ b/src/thumbnailwidget.h @@ -42,6 +42,7 @@ #include #include #include +#include class ScanStandardItem: public QStandardItem @@ -82,7 +83,7 @@ private: ThumbnailDelegate *m_thumbnailDelegate = nullptr; QStandardItemModel *m_thumbnailItemModel = nullptr; - + void converPnmToJpg(QString pnmPath, QString jpgPath); public slots: void showThumbnailIcon(); diff --git a/src/titlebar/titlebar.cpp b/src/titlebar/titlebar.cpp index 6be934d079980789af2fc5fede3e586ecb1c5b20..375cb6f3205421fd840e73735ccade64d27b69b7 100644 --- a/src/titlebar/titlebar.cpp +++ b/src/titlebar/titlebar.cpp @@ -21,7 +21,6 @@ #include #include #include -#include TitleBar::TitleBar(QWidget *parent) : QWidget(parent), @@ -35,6 +34,11 @@ TitleBar::TitleBar(QWidget *parent) : ui->m_logoBtn->setCheckable(false); ui->m_logoBtn->setStyleSheet("QPushButton{border:0px; border-radius:4px; background:transparent;}"); + ui->m_closeBtn->setAttribute(Qt::WA_AlwaysShowToolTips, true); + ui->m_maxBtn->setAttribute(Qt::WA_AlwaysShowToolTips, true); + ui->m_minBtn->setAttribute(Qt::WA_AlwaysShowToolTips, true); + ui->m_OptionBtn->setAttribute(Qt::WA_AlwaysShowToolTips, true); + setAutoFillBackground(true); setBackgroundRole(QPalette::Base); this->setWindowTitle("Scanner"); @@ -63,13 +67,13 @@ TitleBar::TitleBar(QWidget *parent) : } }); - m_menu->addAction(tr("Help"), this, [ = ]() { + m_menu->addAction(tr("Help"), this, [=]() { showHelpDialog(); });//, QKeySequence(Qt::Key_F1) m_menu->addAction(tr("About"), this, [=]() { using namespace kdk; - m_aboutWindow = new KAboutDialog(this,QIcon::fromTheme("kylin-scanner"),tr(appShowingName.toLocal8Bit()),tr("Version: ") + appVersion); + m_aboutWindow = new KAboutDialog(this, QIcon::fromTheme("kylin-scanner"), 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 " @@ -80,7 +84,7 @@ TitleBar::TitleBar(QWidget *parent) : m_aboutWindow->show(); }); - m_menu->addAction(tr("Exit"), [ = ]() { + m_menu->addAction(tr("Exit"), [=]() { KyInfo() << "window close."; if (g_user_signal->exitWindowWithSaveFlag) { int saveFlag = warnCloseWindow(); @@ -92,9 +96,7 @@ TitleBar::TitleBar(QWidget *parent) : g_user_signal->exitApplication(); } ); ui->m_OptionBtn->setMenu(m_menu); - bool isPCMode = GlobalUserSignal::getInstance()->getCurrentMode(); - rotateChangedSlot(isPCMode); -// connect(kdk::kabase::Gsettings::getPoint(), &kdk::GsettingMonitor::systemFontSizeChange, this, &TitleBar::fontSizeChanged); + connect(m_themeData, &QGSettings::changed, this, &TitleBar::fontSizeChanged); } @@ -102,27 +104,7 @@ TitleBar::~TitleBar() { delete ui; } -void TitleBar::rotateChangedSlot(bool isPCMode){ - if(isPCMode){ - this->setFixedHeight(47); - ui->m_logoBtn->setIconSize(QSize(24,24)); - ui->m_OptionBtn->setFixedSize(30,30); - ui->m_minBtn->setFixedSize(30,30); - ui->m_maxBtn->setFixedSize(30,30); - ui->m_closeBtn->setFixedSize(30,30); - ui->m_hLogoLayout->setContentsMargins(8,4,0,0); - ui->m_hBtnLayout->setContentsMargins(0,4,4,0); - }else{ - this->setFixedHeight(64); - ui->m_logoBtn->setIconSize(QSize(32,32)); - ui->m_OptionBtn->setFixedSize(48,48); - ui->m_minBtn->setFixedSize(48,48); - ui->m_maxBtn->setFixedSize(48,48); - ui->m_closeBtn->setFixedSize(48,48); - ui->m_hLogoLayout->setContentsMargins(16,4,0,0); - ui->m_hBtnLayout->setContentsMargins(0,4,8,0); - } -} + void TitleBar::mouseDoubleClickEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { @@ -155,18 +137,10 @@ void TitleBar::paintEvent(QPaintEvent *event) void TitleBar::updateMaxButtonStatus(bool isMax) { - deviceMode currentMode = m_mode.defaultModeCapture(); if (isMax) { - if(currentMode == PCMode){ - ui->m_maxBtn->show(); - ui->m_maxBtn->setIcon(QIcon::fromTheme("window-restore-symbolic")); - ui->m_maxBtn->setToolTip(tr("Restore")); - }else{ - ui->m_maxBtn->hide(); - } - + ui->m_maxBtn->setIcon(QIcon::fromTheme("window-restore-symbolic")); + ui->m_maxBtn->setToolTip(tr("Restore")); } else { - ui->m_maxBtn->show(); ui->m_maxBtn->setIcon(QIcon::fromTheme("window-maximize-symbolic")); ui->m_maxBtn->setToolTip(tr("Maximize")); } @@ -214,7 +188,7 @@ int TitleBar::warnCloseWindow() QMessageBox *msgBox = new QMessageBox(); msgBox->setModal(Qt::WindowModal); msgBox->setAttribute(Qt::WA_ShowModal, true); - connect(msgBox, &QMessageBox::accepted, msgBox, &QMessageBox::deleteLater); + connect(msgBox, &QMessageBox::finished, msgBox, &QMessageBox::deleteLater); msgBox->setText(tr("The current file is not saved. Do you want to save it?")); msgBox->setIcon(QMessageBox::Warning); msgBox->setWindowTitle(tr("Scanner")); diff --git a/src/titlebar/titlebar.h b/src/titlebar/titlebar.h index a560107e18f57c7224b63452d567573044862c23..4cbde795451c960d3972b0e7e5ecdd3e054bce96 100644 --- a/src/titlebar/titlebar.h +++ b/src/titlebar/titlebar.h @@ -33,7 +33,6 @@ #include // 主题sdk关于 #include -#include "../utils/HorizontalOrVerticalMode.h" #include "../saneobject.h" //#include "../globalsignal.h" @@ -77,10 +76,7 @@ public slots: int warnCloseWindow(); void fontSizeChanged(); - void rotateChangedSlot(bool isPCMode); - private: - HorizontalOrVerticalMode m_mode; Ui::TitleBar *ui; QMenu *m_menu = nullptr; kdk::KAboutDialog *m_aboutWindow = nullptr; // 关于界面 diff --git a/src/toolbarwidget.cpp b/src/toolbarwidget.cpp index de7ff1027c7f2fc70c3a91ea5d5d1b35f29bc252..99065726df087a7910cf74abf7a886fac7aef641 100644 --- a/src/toolbarwidget.cpp +++ b/src/toolbarwidget.cpp @@ -17,8 +17,8 @@ */ #include "toolbarwidget.h" #include -#include #include + #include "include/theme.h" #include #include @@ -255,15 +255,7 @@ void ToolBarWidget::initConnect() connect(g_user_signal, &GlobalUserSignal::toolbarPercentageChangedSignel, this, &ToolBarWidget::percentageChangedSlot); connect(m_beautyButton, &QPushButton::clicked, this, &ToolBarWidget::beautyButtonClickedSlot); - connect(m_rectifyButton, &QPushButton::clicked, [=](){ - m_mutex->lock(); - rectifyButtonClickedSlot(); - m_rectifyButton->setEnabled(false); - }); - connect(g_user_signal, &GlobalUserSignal::mutexUnlockSignal, [=](){ - m_mutex->unlock(); - m_rectifyButton->setEnabled(true); - }); + connect(m_rectifyButton, &QPushButton::clicked, this, &ToolBarWidget::rectifyButtonClickedSlot); connect(m_ocrButton, &QPushButton::clicked, this, &ToolBarWidget::ocrButtonClickedSlot); connect(m_cropButton, &QPushButton::clicked, this, &ToolBarWidget::cropButtonClickedSlot); connect(m_cropButton, &QPushButton::clicked, this, &ToolBarWidget::cropDoubleClickedSlot); @@ -431,7 +423,7 @@ void ToolBarWidget::beautyButtonClickedSlot() qDebug() << "continue!"; QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerOneClickBeautification))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerOneClickBeautification))); buried_data.insert("action", "beauty image"); buried_data.insert("function", "in toolbarwidget.cpp function beautyButtonClickedSlots()"); @@ -444,12 +436,13 @@ void ToolBarWidget::beautyButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("ClickBeautification").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "click_beautification", const_cast("mainPage")); kdk_dia_data_free(node); } void ToolBarWidget::rectifyButtonClickedSlot() { + m_rectifyButton->setEnabled(false); KyInfo() << "click rectify button."; if(g_sane_object->ocrFlag || g_sane_object->cropFlag){ qDebug() << "do nothing,exit rectify!"; @@ -457,9 +450,10 @@ void ToolBarWidget::rectifyButtonClickedSlot() } g_user_signal->exitWindowWithSaveFlag = true; g_user_signal->toolbarRectifyOperationStart(); + QTimer::singleShot(800, [=](){m_rectifyButton->setEnabled(true);}); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerRectification))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerRectification))); buried_data.insert("action", "image rectify"); buried_data.insert("function", "in toolbarwidget.cpp function rectifyButtonClickedSlot()"); @@ -472,7 +466,7 @@ void ToolBarWidget::rectifyButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("Rectification").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "rectification", const_cast("mainPage")); kdk_dia_data_free(node); } @@ -493,7 +487,7 @@ void ToolBarWidget::ocrButtonClickedSlot() }else{ QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerTextRecognition))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerTextRecognition))); buried_data.insert("action", "OCR"); buried_data.insert("function", "in toolbarwidget.cpp function ocrButtonClickedSlot()"); @@ -506,7 +500,7 @@ void ToolBarWidget::ocrButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("TextRecognition").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "text_recognition", const_cast("mainPage")); kdk_dia_data_free(node); ocrOtherIconState(false); @@ -528,7 +522,7 @@ void ToolBarWidget::cropButtonClickedSlot() g_user_signal->toolbarCropOperation(); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerCutting))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerCutting))); buried_data.insert("action", "image cutting"); buried_data.insert("function", "in toolbarwidget.cpp function cropButtonClickedSlot()"); @@ -541,7 +535,7 @@ void ToolBarWidget::cropButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("Cutting").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "cutting", const_cast("mainPage")); kdk_dia_data_free(node); } @@ -564,7 +558,7 @@ void ToolBarWidget::rotateButtonClickedSlot() g_user_signal->toolbarRotateOperation(); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerRotate))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerRotate))); buried_data.insert("action", "image rotate"); buried_data.insert("function", "in toolbarwidget.cpp function rotateButtonClickedSlot()"); @@ -577,7 +571,7 @@ void ToolBarWidget::rotateButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("Rotate").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "rotate", const_cast("mainPage")); kdk_dia_data_free(node); } @@ -594,7 +588,7 @@ void ToolBarWidget::mirrorButtonClickedSlot() g_user_signal->toolbarMirrorOperation(); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerMirror))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerMirror))); buried_data.insert("action", "image mirror"); buried_data.insert("function", "in toolbarwidget.cpp function mirrorButtonClickedSlot()"); @@ -607,7 +601,7 @@ void ToolBarWidget::mirrorButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("Mirror").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "mirror", const_cast("mainPage")); kdk_dia_data_free(node); } @@ -624,10 +618,11 @@ void ToolBarWidget::watermarkButtonClickedSlot() g_user_signal->toolbarWatermarkOperation(); QMap buried_data; - buried_data.insert("FunctionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerAddWatermark))); + buried_data.insert("functionName", QString::fromStdString(kabase::BuriedPoint::convertPTtoString(kabase::BuriedPoint::PT::KylinScannerAddWatermark))); buried_data.insert("action", "image add watermark"); buried_data.insert("function", "in toolbarwidget.cpp function watermarkButtonClickedSlot()"); + int cursor{0}; KCustomProperty property[buried_data.size()]; for (auto iter = buried_data.begin(); iter != buried_data.end(); iter++) { @@ -637,7 +632,7 @@ void ToolBarWidget::watermarkButtonClickedSlot() } KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP, KEVENT_CUSTOM); kdk_dia_append_custom_property(node, property, buried_data.size()); - kdk_dia_upload_default(node, QString("AddWatermark").toLocal8Bit().data(), QString("mainPage").toLocal8Bit().data()); + kdk_dia_upload_default(node, "add_watermark", const_cast("mainPage")); kdk_dia_data_free(node); }