Merge lp:~larryprice/libertine-scope/libertine-store-search into lp:libertine-scope
- libertine-store-search
- Merge into devel
Status: | Needs review | ||||||||
---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~larryprice/libertine-scope/libertine-store-search | ||||||||
Merge into: | lp:libertine-scope | ||||||||
Diff against target: |
6037 lines (+4404/-376) 77 files modified
CMakeLists.txt (+7/-0) data/CMakeLists.txt (+11/-17) data/com.canonical.libertine.ContainerManager.service (+3/-0) data/store.svg (+77/-0) debian/control (+18/-2) debian/libertine-scope.install (+4/-0) debian/libertined.install (+8/-0) debian/rules (+2/-2) lib/CMakeLists.txt (+1/-0) lib/libertine-scope/CMakeLists.txt (+19/-0) lib/libertine-scope/action.cpp (+49/-0) lib/libertine-scope/action.h (+46/-0) lib/libertine-scope/i18n.h (+59/-0) lib/libertine-scope/package.cpp (+54/-0) lib/libertine-scope/package.h (+56/-0) lib/libertine-scope/preview.cpp (+283/-0) lib/libertine-scope/preview.h (+93/-0) lib/libertine-scope/service_manager.cpp (+103/-0) lib/libertine-scope/service_manager.h (+51/-0) manifest.json.in (+1/-1) po/en_AU.po (+86/-6) po/en_GB.po (+86/-6) po/es.po (+94/-8) po/fi.po (+86/-6) po/fr.po (+86/-6) po/gl.po (+86/-6) po/hu.po (+92/-6) po/libertine-scope.pot (+84/-5) po/ms.po (+86/-6) po/pt.po (+86/-6) po/uk.po (+86/-6) scope/CMakeLists.txt (+1/-1) scope/apps/CMakeLists.txt (+6/-6) scope/apps/action.cpp (+16/-23) scope/apps/action.h (+10/-10) scope/apps/applauncher.cpp (+8/-10) scope/apps/applauncher.h (+6/-2) scope/apps/config.h.in (+2/-0) scope/apps/libertine.cpp (+1/-0) scope/apps/localization.h (+0/-31) scope/apps/preview.cpp (+34/-54) scope/apps/preview.h (+21/-16) scope/apps/query.cpp (+93/-33) scope/apps/query.h (+4/-1) scope/apps/scope.cpp (+11/-16) scope/store/CMakeLists.txt (+50/-0) scope/store/entry_point.cpp (+42/-0) scope/store/libertine-scope.ubuntu_libertine-store.ini.in.in (+10/-0) scope/store/query.cpp (+149/-0) scope/store/query.h (+70/-0) scope/store/scope.cpp (+75/-0) scope/store/scope.h (+77/-0) service/CMakeLists.txt (+9/-0) service/libertine_service/appstream.py (+80/-0) service/libertine_service/apt.py (+106/-0) service/libertine_service/container.py (+68/-0) service/libertine_service/dbus.py (+184/-0) service/libertine_service/tasks.py (+149/-0) service/libertined (+89/-0) tests/CMakeLists.txt (+7/-0) tests/lib/CMakeLists.txt (+1/-0) tests/lib/libertine-scope/CMakeLists.txt (+24/-0) tests/lib/libertine-scope/mock_service_manager.h (+49/-0) tests/lib/libertine-scope/test_action.cpp (+70/-0) tests/lib/libertine-scope/test_package.cpp (+108/-0) tests/lib/libertine-scope/test_preview.cpp (+292/-0) tests/scope/CMakeLists.txt (+2/-0) tests/scope/apps/CMakeLists.txt (+9/-8) tests/scope/apps/fake_container.cpp (+1/-1) tests/scope/apps/fake_libertine.cpp (+2/-2) tests/scope/apps/scopefixture.h (+3/-3) tests/scope/apps/test_action.cpp (+47/-12) tests/scope/apps/test_preview.cpp (+254/-37) tests/scope/apps/test_query.cpp (+64/-17) tests/scope/apps/test_scope.cpp (+4/-4) tests/scope/store/CMakeLists.txt (+23/-0) tests/scope/store/test_query.cpp (+170/-0) |
||||||||
To merge this branch: | bzr merge lp:~larryprice/libertine-scope/libertine-store-search | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Libertine CI Bot | continuous-integration | Approve | |
Brandon Schaefer (community) | Approve | ||
Christopher Townsend | Approve | ||
Review via email: mp+300596@code.launchpad.net |
Commit message
Create libertine service and store scope with simple search.
Description of the change
Create libertine service and store scope with simple search.
DBus service written in python is called libertined. All it currently does is react to a "search" request with a query string. The libertine-store scope is just an entity which calls into the service to get results for its own search.
Neither of these new tools are in a position to be published.
- 77. By Larry Price
-
removing merge cruft
- 78. By Larry Price
-
removing commented code from test
Libertine CI Bot (libertine-ci-bot) wrote : | # |
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:78
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 79. By Larry Price
-
there is no price
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:79
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 80. By Larry Price
-
merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:80
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 81. By Larry Price
-
Merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:81
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 82. By Larry Price
-
Moving new test files
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:82
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:82
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
A couple of initial comments:
Need to add the python dependencies in the control file.
Also, inline comment.
- 83. By Larry Price
-
adding deps to control file
- 84. By Larry Price
-
More updates to rules, control, and fixing store install dir
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:84
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 85. By Larry Price
-
add python3-dev and fix libertine service install
- 86. By Larry Price
-
getting python to install correctly
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:86
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 87. By Larry Price
-
Fixing python install script
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:87
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Some quick comments as I'm playing with this.
1. The search should accept terms that have a space in them such as "Tux Racer" (without quotes). Folks will want to search for actual program names. We agreed this would be fixed in a follow-on MP.
2. The search histories are shared between the Desktop Apps scope and Find XApps scope. They should be separate.
3. Need to change the name to something like "Find Desktop Apps" for naming consistency.
I'll add more comments as I go:)
- 88. By Larry Price
-
Merge
- 89. By Larry Price
-
Retitle to 'Find Desktop Apps'
- 90. By Larry Price
-
remove commented out header
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:90
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:90
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 91. By Larry Price
-
Merge
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:91
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 92. By Larry Price
-
undo slibdeps change
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:92
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 93. By Larry Price
-
Installing dbus service to hopefully start as needed
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:93
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 94. By Larry Price
-
Debian install file for libertine-scope
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:94
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 95. By Larry Price
-
Fixing sigterm handling and python3-dev deps
- 96. By Larry Price
-
deleting recursive log
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:95
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:96
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Just to capture what we've discussed thus far on IRC:
1. No results are returned the first time a search is done.
2. libertined crashes when sending it SIGTERM. (fixed)
3. python3-dev needs to be moved to Build-Depends. (fixed)
4. get_categories() should return an empty list.
- 97. By Larry Price
-
no fun, work, or pink here
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:97
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 98. By Larry Price
-
Removing invalid isValid() call
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:98
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Christopher Townsend (townsend) wrote : | # |
Ok, I think I'm good with, but I'd like a second set of eyes on the code. Brandon is going to review as well.
Brandon Schaefer (brandontschaefer) wrote : | # |
looks good to me (3 random inlines more or less comments/question noting really)
Larry Price (larryprice) wrote : | # |
responding to inlines - thanks, guys!
Stephen M. Webb (bregma) wrote : | # |
Couple of inline comments. I have not built and tested this MP.
Larry Price (larryprice) wrote : | # |
inlines - just about to push minor fixes
- 99. By Larry Price
-
Fixing i18n pluralizer
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:99
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 100. By Larry Price
-
Manipulate string such that there is no visible null character
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:100
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:100
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 101. By Larry Price
-
Create Preview pane with base information
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:101
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 102. By Larry Price
-
Add AppStream backend for libertine service
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:102
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 103. By Larry Price
-
Add link to Store in Apps Scope
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:103
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:103
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 104. By Larry Price
-
Install/remove functionality
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:104
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 105. By Larry Price
-
Implement progress update architecture
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:105
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 106. By Larry Price
-
Open apps from Store, commonize scope codes
Libertine CI Bot (libertine-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:106
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 107. By Larry Price
-
Removing URL_DISPATCHER
- 108. By Larry Price
-
Merge with lp:libertine-scope
Libertine CI Bot (libertine-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:108
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Larry Price (larryprice) wrote : | # |
For this series, I need to split up the dbus service and the scope. The dbus service will potentially be used by the snap store, while the scope portions will potentially be dropped. A bit blurry so far, so this branch does not need to be thrown out quite yet.
Unmerged revisions
- 108. By Larry Price
-
Merge with lp:libertine-scope
- 107. By Larry Price
-
Removing URL_DISPATCHER
- 106. By Larry Price
-
Open apps from Store, commonize scope codes
- 105. By Larry Price
-
Implement progress update architecture
- 104. By Larry Price
-
Install/remove functionality
- 103. By Larry Price
-
Add link to Store in Apps Scope
- 102. By Larry Price
-
Add AppStream backend for libertine service
- 101. By Larry Price
-
Create Preview pane with base information
- 100. By Larry Price
-
Manipulate string such that there is no visible null character
- 99. By Larry Price
-
Fixing i18n pluralizer
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-08-01 13:24:26 +0000 | |||
3 | +++ CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
4 | @@ -29,15 +29,20 @@ | |||
5 | 29 | find_package(PkgConfig REQUIRED) | 29 | find_package(PkgConfig REQUIRED) |
6 | 30 | find_package(Intltool) | 30 | find_package(Intltool) |
7 | 31 | find_package(Qt5Core REQUIRED) | 31 | find_package(Qt5Core REQUIRED) |
8 | 32 | find_package(Qt5DBus REQUIRED) | ||
9 | 32 | find_program(INTLTOOL_MERGE intltool-merge) | 33 | find_program(INTLTOOL_MERGE intltool-merge) |
10 | 33 | 34 | ||
11 | 34 | # useful variables | 35 | # useful variables |
12 | 35 | set(APPS_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes/libertine-scope/) | 36 | set(APPS_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes/libertine-scope/) |
13 | 36 | set(APPS_DATA_DIR ${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes/libertine-scope/) | 37 | set(APPS_DATA_DIR ${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes/libertine-scope/) |
14 | 38 | set(STORE_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes/libertine-scope/) | ||
15 | 37 | set(SCOPE_NAME "libertine-scope") | 39 | set(SCOPE_NAME "libertine-scope") |
16 | 38 | set(SCOPE_DISPLAY_NAME "Desktop Apps") | 40 | set(SCOPE_DISPLAY_NAME "Desktop Apps") |
17 | 39 | set(PACKAGE_NAME "libertine-scope.ubuntu") | 41 | set(PACKAGE_NAME "libertine-scope.ubuntu") |
18 | 40 | set(FULLY_QUALIFIED_NAME "${PACKAGE_NAME}_${SCOPE_NAME}") | 42 | set(FULLY_QUALIFIED_NAME "${PACKAGE_NAME}_${SCOPE_NAME}") |
19 | 43 | set(STORE_SCOPE_NAME "libertine-store") | ||
20 | 44 | set(STORE_PACKAGE_NAME "libertine-scope.ubuntu_${STORE_SCOPE_NAME}") | ||
21 | 45 | set(SCOPE_LIB_NAME "libertine-scope") | ||
22 | 41 | option(CLICK_MODE "Installs to a contained location" off) | 46 | option(CLICK_MODE "Installs to a contained location" off) |
23 | 42 | 47 | ||
24 | 43 | add_definitions(-DSCOPE_NAME="${SCOPE_NAME}") | 48 | add_definitions(-DSCOPE_NAME="${SCOPE_NAME}") |
25 | @@ -88,7 +93,9 @@ | |||
26 | 88 | endif() | 93 | endif() |
27 | 89 | 94 | ||
28 | 90 | # Add our main directories | 95 | # Add our main directories |
29 | 96 | add_subdirectory(lib) | ||
30 | 91 | add_subdirectory(scope) | 97 | add_subdirectory(scope) |
31 | 98 | add_subdirectory(service) | ||
32 | 92 | add_subdirectory(data) | 99 | add_subdirectory(data) |
33 | 93 | add_subdirectory(po) | 100 | add_subdirectory(po) |
34 | 94 | 101 | ||
35 | 95 | 102 | ||
36 | === modified file 'data/CMakeLists.txt' | |||
37 | --- data/CMakeLists.txt 2016-07-19 17:56:58 +0000 | |||
38 | +++ data/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
39 | @@ -1,17 +1,11 @@ | |||
57 | 1 | # Put the ini files in the build directory next to the scope | 1 | # Copy data files into apps scope dir for dev |
58 | 2 | # .so file so that the test tools can find them. | 2 | file(COPY store.svg blacklist DESTINATION ${CMAKE_BINARY_DIR}/scope/apps/) |
59 | 3 | 3 | ||
60 | 4 | # Install the scope images | 4 | install(FILES apps.png apps.svg |
61 | 5 | install( | 5 | DESTINATION ${APPS_DATA_DIR}) |
62 | 6 | FILES | 6 | |
63 | 7 | "apps.png" | 7 | install(FILES blacklist store.svg |
64 | 8 | DESTINATION | 8 | DESTINATION ${SCOPE_INSTALL_DIR}) |
65 | 9 | ${APPS_DATA_DIR} | 9 | |
66 | 10 | ) | 10 | install(FILES com.canonical.libertine.ContainerManager.service |
67 | 11 | 11 | DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services) | |
51 | 12 | install( | ||
52 | 13 | FILES | ||
53 | 14 | "blacklist" | ||
54 | 15 | DESTINATION | ||
55 | 16 | ${SCOPE_INSTALL_DIR} | ||
56 | 17 | ) | ||
68 | 18 | 12 | ||
69 | === added file 'data/com.canonical.libertine.ContainerManager.service' | |||
70 | --- data/com.canonical.libertine.ContainerManager.service 1970-01-01 00:00:00 +0000 | |||
71 | +++ data/com.canonical.libertine.ContainerManager.service 2016-09-23 14:36:26 +0000 | |||
72 | @@ -0,0 +1,3 @@ | |||
73 | 1 | [D-BUS Service] | ||
74 | 2 | Name=com.canonical.libertine.ContainerManager | ||
75 | 3 | Exec=/usr/bin/libertined | ||
76 | 0 | 4 | ||
77 | === added file 'data/store.svg' | |||
78 | --- data/store.svg 1970-01-01 00:00:00 +0000 | |||
79 | +++ data/store.svg 2016-09-23 14:36:26 +0000 | |||
80 | @@ -0,0 +1,77 @@ | |||
81 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
82 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
83 | 3 | |||
84 | 4 | <svg | ||
85 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
86 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
87 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
88 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
89 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
90 | 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
91 | 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
92 | 12 | width="351.27005mm" | ||
93 | 13 | height="433.59958mm" | ||
94 | 14 | viewBox="0 0 1244.6577 1536.3765" | ||
95 | 15 | id="svg3637" | ||
96 | 16 | version="1.1" | ||
97 | 17 | inkscape:version="0.91 r13725" | ||
98 | 18 | sodipodi:docname="store.svg"> | ||
99 | 19 | <defs | ||
100 | 20 | id="defs3639" /> | ||
101 | 21 | <sodipodi:namedview | ||
102 | 22 | id="base" | ||
103 | 23 | pagecolor="#00ffff" | ||
104 | 24 | bordercolor="#666666" | ||
105 | 25 | borderopacity="1.0" | ||
106 | 26 | inkscape:pageopacity="0" | ||
107 | 27 | inkscape:pageshadow="2" | ||
108 | 28 | inkscape:zoom="0.24748737" | ||
109 | 29 | inkscape:cx="-563.75562" | ||
110 | 30 | inkscape:cy="519.26806" | ||
111 | 31 | inkscape:document-units="px" | ||
112 | 32 | inkscape:current-layer="layer1" | ||
113 | 33 | showgrid="false" | ||
114 | 34 | inkscape:window-width="1920" | ||
115 | 35 | inkscape:window-height="1056" | ||
116 | 36 | inkscape:window-x="1920" | ||
117 | 37 | inkscape:window-y="24" | ||
118 | 38 | inkscape:window-maximized="1" | ||
119 | 39 | fit-margin-left="118.5" | ||
120 | 40 | fit-margin-right="118.5" | ||
121 | 41 | fit-margin-top="120" | ||
122 | 42 | fit-margin-bottom="180" /> | ||
123 | 43 | <metadata | ||
124 | 44 | id="metadata3642"> | ||
125 | 45 | <rdf:RDF> | ||
126 | 46 | <cc:Work | ||
127 | 47 | rdf:about=""> | ||
128 | 48 | <dc:format>image/svg+xml</dc:format> | ||
129 | 49 | <dc:type | ||
130 | 50 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
131 | 51 | <dc:title></dc:title> | ||
132 | 52 | </cc:Work> | ||
133 | 53 | </rdf:RDF> | ||
134 | 54 | </metadata> | ||
135 | 55 | <g | ||
136 | 56 | inkscape:label="Layer 1" | ||
137 | 57 | inkscape:groupmode="layer" | ||
138 | 58 | id="layer1" | ||
139 | 59 | transform="translate(-388.21849,836.02937)"> | ||
140 | 60 | <g | ||
141 | 61 | id="g3343" | ||
142 | 62 | transform="matrix(0.74113597,0,0,0.78153068,321.48718,23.928691)"> | ||
143 | 63 | <path | ||
144 | 64 | transform="translate(229.97523,-735.66029)" | ||
145 | 65 | inkscape:connector-curvature="0" | ||
146 | 66 | id="path3734" | ||
147 | 67 | d="m 435.93411,771.50865 c 5.13251,-7.46428 23.15091,-32.85714 40.04089,-56.42857 16.88998,-23.57143 36.65936,-51.21428 43.93196,-61.42857 7.2726,-10.21428 21.97523,-30.46508 32.67251,-45.00177 10.69727,-14.53669 27.61176,-38.11043 37.58774,-52.38611 9.97598,-14.27566 24.24529,-34.14652 31.70958,-44.15743 7.46428,-10.01089 13.57143,-19.48897 13.57143,-21.06235 0,-2.71828 -17.5498,-29.26911 -81.37207,-123.10662 -15.49738,-22.78572 -40.3902,-59.42858 -55.31738,-81.42858 -14.92718,-22 -35.00329,-51.57142 -44.61358,-65.71428 -9.6103,-14.14286 -19.70681,-29.25 -22.4367,-33.57143 l -4.96343,-7.85714 65.44846,0 65.44845,0 33.90313,50.17117 c 18.64671,27.59414 35.20443,52.34414 36.79492,55 4.96144,8.28476 14.04967,21.90535 15.61363,23.40026 5.56962,5.32368 80.066,120.17946 80.066,123.44281 0,2.24606 -7.49798,14.28313 -16.66215,26.74904 -31.75367,43.19412 -68.03182,92.82957 -153.20253,209.6104 l -85.57896,117.3406 -20.98687,0 -20.98687,0 9.33184,-13.57143 z" | ||
148 | 68 | style="fill:#ffffff" /> | ||
149 | 69 | <path | ||
150 | 70 | transform="translate(229.97523,-735.66029)" | ||
151 | 71 | inkscape:connector-curvature="0" | ||
152 | 72 | id="path3736" | ||
153 | 73 | d="m 831.21335,770.08008 c -5.66053,-8.25 -20.06228,-29.14285 -32.00388,-46.42857 -11.9416,-17.28571 -38.73039,-56.5 -59.53064,-87.14286 -20.80026,-30.64285 -44.68152,-65.72971 -53.06948,-77.97082 -13.98989,-20.41635 -14.92937,-22.77866 -11.36275,-28.57143 2.13845,-3.47317 18.80864,-26.80949 37.04485,-51.85846 18.23622,-25.04895 38.94248,-53.61705 46.01391,-63.48466 7.07143,-9.86761 23.78571,-33.00848 37.14286,-51.42417 13.35714,-18.41568 28.87474,-39.99043 34.48356,-47.9439 5.60881,-7.95346 26.18024,-36.33887 45.71429,-63.07868 19.53404,-26.73982 39.227,-54.06125 43.76215,-60.71429 l 8.24572,-12.09644 22.55911,0 22.55911,0 -8.89011,12.14285 c -12.05808,16.46994 -89.78558,123.80437 -110.17606,152.14286 -16.77918,23.31954 -41.38224,57.29953 -74.11675,102.36479 l -18.32072,25.22193 59.10118,87.6352 c 32.50564,48.19937 70.71004,104.99237 84.89866,126.20665 14.18861,21.21429 26.78352,39 27.98867,39.5238 1.20515,0.52383 2.19119,1.99846 2.19119,3.277 0,1.27855 8.43058,14.6714 18.73463,29.76192 l 18.73462,27.43728 -65.70612,0 -65.70611,0 -10.29189,-15 z" | ||
154 | 74 | style="fill:#ffffff" /> | ||
155 | 75 | </g> | ||
156 | 76 | </g> | ||
157 | 77 | </svg> | ||
158 | 0 | 78 | ||
159 | === modified file 'debian/control' | |||
160 | --- debian/control 2016-07-13 17:26:54 +0000 | |||
161 | +++ debian/control 2016-09-23 14:36:26 +0000 | |||
162 | @@ -10,11 +10,12 @@ | |||
163 | 10 | google-mock, | 10 | google-mock, |
164 | 11 | intltool, | 11 | intltool, |
165 | 12 | libunity-scopes-dev (>= 1.0.0), | 12 | libunity-scopes-dev (>= 1.0.0), |
166 | 13 | liburl-dispatcher1-dev, | ||
167 | 14 | libubuntu-app-launch2-dev, | 13 | libubuntu-app-launch2-dev, |
168 | 15 | liblibertine-dev, | 14 | liblibertine-dev, |
169 | 16 | pkg-config, | 15 | pkg-config, |
171 | 17 | qtbase5-dev | 16 | qtbase5-dev, |
172 | 17 | libqt5dbus5 (>= 5.4.1), | ||
173 | 18 | python3-dev | ||
174 | 18 | Standards-Version: 3.9.6 | 19 | Standards-Version: 3.9.6 |
175 | 19 | Homepage: https://launchpad.net/libertine-scope | 20 | Homepage: https://launchpad.net/libertine-scope |
176 | 20 | Vcs-Bzr: https://code.launchpad.net/~libertine-team/libertine-scope/devel | 21 | Vcs-Bzr: https://code.launchpad.net/~libertine-team/libertine-scope/devel |
177 | @@ -23,6 +24,7 @@ | |||
178 | 23 | Package: libertine-scope | 24 | Package: libertine-scope |
179 | 24 | Architecture: any | 25 | Architecture: any |
180 | 25 | Depends: libertine-tools, | 26 | Depends: libertine-tools, |
181 | 27 | libertined, | ||
182 | 26 | ${misc:Depends}, | 28 | ${misc:Depends}, |
183 | 27 | ${shlibs:Depends} | 29 | ${shlibs:Depends} |
184 | 28 | Description: Libertine packages scope for Unity | 30 | Description: Libertine packages scope for Unity |
185 | @@ -31,3 +33,17 @@ | |||
186 | 31 | still waiting to be ported natively to Unity. | 33 | still waiting to be ported natively to Unity. |
187 | 32 | . | 34 | . |
188 | 33 | This package provides the Libertine scope itself. | 35 | This package provides the Libertine scope itself. |
189 | 36 | |||
190 | 37 | Package: libertined | ||
191 | 38 | Architecture: any | ||
192 | 39 | Depends: python3-libertine, | ||
193 | 40 | python3-apt (>= 0.9.3), | ||
194 | 41 | python3-dbus (>= 1.2.0), | ||
195 | 42 | appstream, | ||
196 | 43 | gir1.2-appstream, | ||
197 | 44 | ${python3:Depends} | ||
198 | 45 | Description: Libertine packages scope for Unity | ||
199 | 46 | The libertined package provides the d-bus service for finding and | ||
200 | 47 | maintaining deb-packaged X11-based legacy software. | ||
201 | 48 | . | ||
202 | 49 | This package provides the libertined service. | ||
203 | 34 | 50 | ||
204 | === added file 'debian/libertine-scope.install' | |||
205 | --- debian/libertine-scope.install 1970-01-01 00:00:00 +0000 | |||
206 | +++ debian/libertine-scope.install 2016-09-23 14:36:26 +0000 | |||
207 | @@ -0,0 +1,4 @@ | |||
208 | 1 | usr/lib/*/unity-scopes/* | ||
209 | 2 | usr/share/unity/scopes/libertine-scope/*png | ||
210 | 3 | usr/share/unity/scopes/libertine-scope/*svg | ||
211 | 4 | usr/share/locale/*/LC_MESSAGES/libertine-scope.mo | ||
212 | 0 | 5 | ||
213 | === added file 'debian/libertined.install' | |||
214 | --- debian/libertined.install 1970-01-01 00:00:00 +0000 | |||
215 | +++ debian/libertined.install 2016-09-23 14:36:26 +0000 | |||
216 | @@ -0,0 +1,8 @@ | |||
217 | 1 | usr/share/dbus-1/services/com.canonical.libertine.ContainerManager.service | ||
218 | 2 | usr/bin/libertined | ||
219 | 3 | usr/lib/python*/*/libertine_service/__init__.py | ||
220 | 4 | usr/lib/python*/*/libertine_service/appstream.py | ||
221 | 5 | usr/lib/python*/*/libertine_service/apt.py | ||
222 | 6 | usr/lib/python*/*/libertine_service/container.py | ||
223 | 7 | usr/lib/python*/*/libertine_service/dbus.py | ||
224 | 8 | usr/lib/python*/*/libertine_service/tasks.py | ||
225 | 0 | 9 | ||
226 | === modified file 'debian/rules' | |||
227 | --- debian/rules 2016-06-28 17:15:54 +0000 | |||
228 | +++ debian/rules 2016-09-23 14:36:26 +0000 | |||
229 | @@ -1,7 +1,7 @@ | |||
231 | 1 | #!/usr/bin/make -f | 1 | #!/usr/bin/make -f |
232 | 2 | 2 | ||
233 | 3 | %: | 3 | %: |
235 | 4 | dh $@ | 4 | dh $@ --with python3 |
236 | 5 | 5 | ||
237 | 6 | override_dh_auto_build: | 6 | override_dh_auto_build: |
238 | 7 | dh_auto_build -- all translations | 7 | dh_auto_build -- all translations |
239 | 8 | 8 | ||
240 | === added directory 'lib' | |||
241 | === added file 'lib/CMakeLists.txt' | |||
242 | --- lib/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
243 | +++ lib/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
244 | @@ -0,0 +1,1 @@ | |||
245 | 1 | add_subdirectory(libertine-scope) | ||
246 | 0 | 2 | ||
247 | === added directory 'lib/libertine-scope' | |||
248 | === added file 'lib/libertine-scope/CMakeLists.txt' | |||
249 | --- lib/libertine-scope/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
250 | +++ lib/libertine-scope/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
251 | @@ -0,0 +1,19 @@ | |||
252 | 1 | SET (CMAKE_INCLUDE_CURRENT_DIR ON) | ||
253 | 2 | SET (CMAKE_AUTOMOC ON) | ||
254 | 3 | |||
255 | 4 | add_library(${SCOPE_LIB_NAME} STATIC | ||
256 | 5 | preview.cpp | ||
257 | 6 | service_manager.cpp | ||
258 | 7 | package.cpp | ||
259 | 8 | action.cpp | ||
260 | 9 | ) | ||
261 | 10 | |||
262 | 11 | include_directories( | ||
263 | 12 | ${CMAKE_SOURCE_DIR}/lib | ||
264 | 13 | ) | ||
265 | 14 | |||
266 | 15 | target_link_libraries (${SCOPE_LIB_NAME} | ||
267 | 16 | ${SCOPE_LDFLAGS} | ||
268 | 17 | Qt5::Core | ||
269 | 18 | Qt5::DBus | ||
270 | 19 | ) | ||
271 | 0 | 20 | ||
272 | === added file 'lib/libertine-scope/action.cpp' | |||
273 | --- lib/libertine-scope/action.cpp 1970-01-01 00:00:00 +0000 | |||
274 | +++ lib/libertine-scope/action.cpp 2016-09-23 14:36:26 +0000 | |||
275 | @@ -0,0 +1,49 @@ | |||
276 | 1 | /* | ||
277 | 2 | * Copyright (C) 2016 Canonical Ltd | ||
278 | 3 | * | ||
279 | 4 | * This program is free software: you can redistribute it and/or modify | ||
280 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
281 | 6 | * published by the Free Software Foundation. | ||
282 | 7 | * | ||
283 | 8 | * This program is distributed in the hope that it will be useful, | ||
284 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
285 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
286 | 11 | * GNU General Public License for more details. | ||
287 | 12 | * | ||
288 | 13 | * You should have received a copy of the GNU General Public License | ||
289 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
290 | 15 | */ | ||
291 | 16 | #include "libertine-scope/action.h" | ||
292 | 17 | |||
293 | 18 | #include "libertine-scope/service_manager.h" | ||
294 | 19 | |||
295 | 20 | |||
296 | 21 | libertine::scope::Action:: | ||
297 | 22 | Action(unity::scopes::Result const& result, | ||
298 | 23 | unity::scopes::ActionMetadata const& metadata, | ||
299 | 24 | std::string const& action_id, | ||
300 | 25 | std::shared_ptr<ServiceManager> const& service_manager) | ||
301 | 26 | : ActivationQueryBase(result, metadata) | ||
302 | 27 | , action_id_(action_id) | ||
303 | 28 | , service_(service_manager) | ||
304 | 29 | { } | ||
305 | 30 | |||
306 | 31 | |||
307 | 32 | unity::scopes::ActivationResponse libertine::scope::Action:: | ||
308 | 33 | activate() | ||
309 | 34 | { | ||
310 | 35 | if (action_id_ == "open") | ||
311 | 36 | { | ||
312 | 37 | return unity::scopes::ActivationResponse(unity::scopes::ActivationResponse::Status::NotHandled); | ||
313 | 38 | } | ||
314 | 39 | |||
315 | 40 | if (action_id_ == "install") | ||
316 | 41 | { | ||
317 | 42 | service_->install(QString::fromStdString(result()["id"].get_string())); | ||
318 | 43 | } | ||
319 | 44 | else if (action_id_ == "remove") | ||
320 | 45 | { | ||
321 | 46 | service_->remove(QString::fromStdString(result()["id"].get_string())); | ||
322 | 47 | } | ||
323 | 48 | return unity::scopes::ActivationResponse(unity::scopes::ActivationResponse::Status::ShowPreview); | ||
324 | 49 | } | ||
325 | 0 | 50 | ||
326 | === added file 'lib/libertine-scope/action.h' | |||
327 | --- lib/libertine-scope/action.h 1970-01-01 00:00:00 +0000 | |||
328 | +++ lib/libertine-scope/action.h 2016-09-23 14:36:26 +0000 | |||
329 | @@ -0,0 +1,46 @@ | |||
330 | 1 | /* | ||
331 | 2 | * Copyright (C) 2016 Canonical Ltd | ||
332 | 3 | * | ||
333 | 4 | * This program is free software: you can redistribute it and/or modify | ||
334 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
335 | 6 | * published by the Free Software Foundation. | ||
336 | 7 | * | ||
337 | 8 | * This program is distributed in the hope that it will be useful, | ||
338 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
339 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
340 | 11 | * GNU General Public License for more details. | ||
341 | 12 | * | ||
342 | 13 | * You should have received a copy of the GNU General Public License | ||
343 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
344 | 15 | */ | ||
345 | 16 | |||
346 | 17 | #pragma once | ||
347 | 18 | |||
348 | 19 | #include <unity/scopes/ActivationQueryBase.h> | ||
349 | 20 | |||
350 | 21 | |||
351 | 22 | namespace libertine | ||
352 | 23 | { | ||
353 | 24 | namespace scope | ||
354 | 25 | { | ||
355 | 26 | |||
356 | 27 | class ServiceManager; | ||
357 | 28 | |||
358 | 29 | class Action : public unity::scopes::ActivationQueryBase | ||
359 | 30 | { | ||
360 | 31 | public: | ||
361 | 32 | explicit Action(unity::scopes::Result const& result, | ||
362 | 33 | unity::scopes::ActionMetadata const& metadata, | ||
363 | 34 | std::string const& action_id, | ||
364 | 35 | std::shared_ptr<ServiceManager> const& service_manager); | ||
365 | 36 | |||
366 | 37 | virtual ~Action() = default; | ||
367 | 38 | |||
368 | 39 | virtual unity::scopes::ActivationResponse activate() override; | ||
369 | 40 | |||
370 | 41 | private: | ||
371 | 42 | std::string action_id_; | ||
372 | 43 | std::shared_ptr<ServiceManager> service_; | ||
373 | 44 | }; | ||
374 | 45 | } // namespace libertine | ||
375 | 46 | } // namespace scope | ||
376 | 0 | 47 | ||
377 | === added file 'lib/libertine-scope/i18n.h' | |||
378 | --- lib/libertine-scope/i18n.h 1970-01-01 00:00:00 +0000 | |||
379 | +++ lib/libertine-scope/i18n.h 2016-09-23 14:36:26 +0000 | |||
380 | @@ -0,0 +1,59 @@ | |||
381 | 1 | /** | ||
382 | 2 | * @file lib/libertine-scope/i18n.h | ||
383 | 3 | * @brief Internationalization helpers. | ||
384 | 4 | */ | ||
385 | 5 | /* | ||
386 | 6 | * Copyright 2016 Canonical Ltd. | ||
387 | 7 | * | ||
388 | 8 | * This program is free software: you can redistribute it and/or modify it under | ||
389 | 9 | * the terms of the GNU General Public License, version 3, as published by the | ||
390 | 10 | * Free Software Foundation. | ||
391 | 11 | * | ||
392 | 12 | * This program is distributed in the hope that it will be useful, | ||
393 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
394 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
395 | 15 | * GNU General Public License for more details. | ||
396 | 16 | * | ||
397 | 17 | * You should have received a copy of the GNU General Public License | ||
398 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
399 | 19 | */ | ||
400 | 20 | #pragma once | ||
401 | 21 | |||
402 | 22 | #include <libintl.h> | ||
403 | 23 | #include <string> | ||
404 | 24 | |||
405 | 25 | |||
406 | 26 | /** | ||
407 | 27 | * Translates a simple string. | ||
408 | 28 | * @param[in] msgid The string to be translated. | ||
409 | 29 | * @returns the translated string. | ||
410 | 30 | */ | ||
411 | 31 | inline std::string | ||
412 | 32 | _(char const* msgid) | ||
413 | 33 | { | ||
414 | 34 | return dgettext(GETTEXT_PACKAGE, msgid); | ||
415 | 35 | } | ||
416 | 36 | |||
417 | 37 | |||
418 | 38 | /** | ||
419 | 39 | * Translates a single/plural string pair. | ||
420 | 40 | * @param[in] msgid1 The string to be tranlated (single form). | ||
421 | 41 | * @param[in] msgid2 The string to be translated (plural form). | ||
422 | 42 | * @param[in] n The number of items referenced in the string. | ||
423 | 43 | * | ||
424 | 44 | * @returns the translated string, either singular or plural forms depending on | ||
425 | 45 | * @p n. | ||
426 | 46 | */ | ||
427 | 47 | inline std::string | ||
428 | 48 | _(char const* msgid1, char const* msgid2, unsigned long int n) | ||
429 | 49 | { | ||
430 | 50 | auto fmt = dngettext(GETTEXT_PACKAGE, msgid1, msgid2, n); | ||
431 | 51 | auto sz = std::snprintf(nullptr, 0, fmt, n); | ||
432 | 52 | std::string buf; | ||
433 | 53 | if (sz > 0) | ||
434 | 54 | { | ||
435 | 55 | buf.resize(sz); | ||
436 | 56 | std::snprintf(&buf[0], sz+1, fmt, n); | ||
437 | 57 | } | ||
438 | 58 | return buf; | ||
439 | 59 | } | ||
440 | 0 | 60 | ||
441 | === added file 'lib/libertine-scope/package.cpp' | |||
442 | --- lib/libertine-scope/package.cpp 1970-01-01 00:00:00 +0000 | |||
443 | +++ lib/libertine-scope/package.cpp 2016-09-23 14:36:26 +0000 | |||
444 | @@ -0,0 +1,54 @@ | |||
445 | 1 | /* | ||
446 | 2 | * Copyright 2016 Canonical Ltd. | ||
447 | 3 | * | ||
448 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
449 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
450 | 6 | * Free Software Foundation. | ||
451 | 7 | * | ||
452 | 8 | * This program is distributed in the hope that it will be useful, | ||
453 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
454 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
455 | 11 | * GNU General Public License for more details. | ||
456 | 12 | * | ||
457 | 13 | * You should have received a copy of the GNU General Public License | ||
458 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
459 | 15 | */ | ||
460 | 16 | #include "libertine-scope/package.h" | ||
461 | 17 | |||
462 | 18 | |||
463 | 19 | libertine::scope::Package libertine::scope::Package:: | ||
464 | 20 | from_map(QVariantMap const& pkgMap) | ||
465 | 21 | { | ||
466 | 22 | Package pkg; | ||
467 | 23 | pkg.name = pkgMap["name"].toString().toStdString(); | ||
468 | 24 | pkg.summary = pkgMap["summary"].toString().toStdString(); | ||
469 | 25 | pkg.description = pkgMap["description"].toString().toStdString(); | ||
470 | 26 | pkg.icon = pkgMap["icon"].toString().toStdString(); | ||
471 | 27 | pkg.publisher = pkgMap["publisher"].toString().toStdString(); | ||
472 | 28 | pkg.website = pkgMap["website"].toString().toStdString(); | ||
473 | 29 | pkg.license = pkgMap["license"].toString().toStdString(); | ||
474 | 30 | pkg.id = pkgMap["id"].toString().toStdString(); | ||
475 | 31 | pkg.status = pkgMap["status"].toString().toStdString(); | ||
476 | 32 | pkg.progress = pkgMap["progress_id"].toString().toStdString(); | ||
477 | 33 | |||
478 | 34 | for (auto const& screenshot: pkgMap["screenshots"].toStringList()) | ||
479 | 35 | { | ||
480 | 36 | pkg.screenshots.push_back(screenshot.toStdString()); | ||
481 | 37 | } | ||
482 | 38 | |||
483 | 39 | return pkg; | ||
484 | 40 | } | ||
485 | 41 | |||
486 | 42 | |||
487 | 43 | QList<libertine::scope::Package> libertine::scope::Package:: | ||
488 | 44 | from_map(QList<QVariantMap> const& pkgMap) | ||
489 | 45 | { | ||
490 | 46 | QList<Package> pkgs; | ||
491 | 47 | |||
492 | 48 | for (auto const& pkg: pkgMap) | ||
493 | 49 | { | ||
494 | 50 | pkgs << Package::from_map(pkg); | ||
495 | 51 | } | ||
496 | 52 | |||
497 | 53 | return pkgs; | ||
498 | 54 | } | ||
499 | 0 | 55 | ||
500 | === added file 'lib/libertine-scope/package.h' | |||
501 | --- lib/libertine-scope/package.h 1970-01-01 00:00:00 +0000 | |||
502 | +++ lib/libertine-scope/package.h 2016-09-23 14:36:26 +0000 | |||
503 | @@ -0,0 +1,56 @@ | |||
504 | 1 | /* | ||
505 | 2 | * Copyright 2016 Canonical Ltd. | ||
506 | 3 | * | ||
507 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
508 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
509 | 6 | * Free Software Foundation. | ||
510 | 7 | * | ||
511 | 8 | * This program is distributed in the hope that it will be useful, | ||
512 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
513 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
514 | 11 | * GNU General Public License for more details. | ||
515 | 12 | * | ||
516 | 13 | * You should have received a copy of the GNU General Public License | ||
517 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
518 | 15 | */ | ||
519 | 16 | #pragma once | ||
520 | 17 | |||
521 | 18 | |||
522 | 19 | #include <QList> | ||
523 | 20 | #include <QVariant> | ||
524 | 21 | |||
525 | 22 | |||
526 | 23 | namespace libertine | ||
527 | 24 | { | ||
528 | 25 | namespace scope | ||
529 | 26 | { | ||
530 | 27 | |||
531 | 28 | |||
532 | 29 | class Package | ||
533 | 30 | { | ||
534 | 31 | public: | ||
535 | 32 | explicit Package() = default; | ||
536 | 33 | virtual ~Package() = default; | ||
537 | 34 | |||
538 | 35 | static Package from_map(QVariantMap const&); | ||
539 | 36 | static QList<Package> from_map(QList<QVariantMap> const&); | ||
540 | 37 | |||
541 | 38 | |||
542 | 39 | std::string id; | ||
543 | 40 | std::string name; | ||
544 | 41 | std::string summary; | ||
545 | 42 | std::string status; | ||
546 | 43 | |||
547 | 44 | std::string description; | ||
548 | 45 | std::string icon; | ||
549 | 46 | std::string publisher; | ||
550 | 47 | std::string website; | ||
551 | 48 | std::string license; | ||
552 | 49 | std::string progress; | ||
553 | 50 | |||
554 | 51 | std::vector<std::string> screenshots; | ||
555 | 52 | }; | ||
556 | 53 | |||
557 | 54 | |||
558 | 55 | } // Store | ||
559 | 56 | } // Libertine | ||
560 | 0 | 57 | ||
561 | === added file 'lib/libertine-scope/preview.cpp' | |||
562 | --- lib/libertine-scope/preview.cpp 1970-01-01 00:00:00 +0000 | |||
563 | +++ lib/libertine-scope/preview.cpp 2016-09-23 14:36:26 +0000 | |||
564 | @@ -0,0 +1,283 @@ | |||
565 | 1 | /* | ||
566 | 2 | * Copyright 2016 Canonical Ltd. | ||
567 | 3 | * | ||
568 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
569 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
570 | 6 | * Free Software Foundation. | ||
571 | 7 | * | ||
572 | 8 | * This program is distributed in the hope that it will be useful, | ||
573 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
574 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
575 | 11 | * GNU General Public License for more details. | ||
576 | 12 | * | ||
577 | 13 | * You should have received a copy of the GNU General Public License | ||
578 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
579 | 15 | */ | ||
580 | 16 | #include "libertine-scope/preview.h" | ||
581 | 17 | |||
582 | 18 | |||
583 | 19 | #include "libertine-scope/i18n.h" | ||
584 | 20 | #include "libertine-scope/service_manager.h" | ||
585 | 21 | #include <future> | ||
586 | 22 | #include <QDebug> | ||
587 | 23 | #include <unity/UnityExceptions.h> | ||
588 | 24 | #include <unity/scopes/ColumnLayout.h> | ||
589 | 25 | #include <unity/scopes/PreviewReply.h> | ||
590 | 26 | #include <unity/scopes/Variant.h> | ||
591 | 27 | #include <unity/scopes/VariantBuilder.h> | ||
592 | 28 | #include <unity/scopes/ActionMetadata.h> | ||
593 | 29 | #include <unity/scopes/Result.h> | ||
594 | 30 | |||
595 | 31 | |||
596 | 32 | namespace usc = unity::scopes; | ||
597 | 33 | |||
598 | 34 | |||
599 | 35 | namespace | ||
600 | 36 | { | ||
601 | 37 | static auto constexpr HEADER_ID = "hdr"; | ||
602 | 38 | static auto constexpr ACTIONS_ID = "actions"; | ||
603 | 39 | static auto constexpr METADATA_ID = "other_metadata"; | ||
604 | 40 | static auto constexpr SUMMARY_ID = "summary"; | ||
605 | 41 | static auto constexpr SCREENSHOTS_ID = "screenshots"; | ||
606 | 42 | static auto const SUMMARY_TITLE = _("Info"); | ||
607 | 43 | static auto const ACTION_INSTALL = _("Install"); | ||
608 | 44 | static auto const ACTION_REMOVE = _("Remove"); | ||
609 | 45 | static auto const ACTION_NOOP_REMOVING = _("Removing..."); | ||
610 | 46 | static auto const ACTION_NOOP_INSTALLING = _("Installing..."); | ||
611 | 47 | static auto const ACTION_OPEN = _("Open"); | ||
612 | 48 | static auto const METADATA_PUBLISHER = _("Publisher/Creator"); | ||
613 | 49 | static auto const METADATA_WEBSITE = _("Website"); | ||
614 | 50 | static auto const METADATA_LICENSE = _("License"); | ||
615 | 51 | |||
616 | 52 | |||
617 | 53 | static usc::PreviewWidget | ||
618 | 54 | metadataWidgets(libertine::scope::Package const& app) | ||
619 | 55 | { | ||
620 | 56 | usc::PreviewWidget widget(METADATA_ID, "table"); | ||
621 | 57 | usc::VariantArray values; | ||
622 | 58 | if (!app.publisher.empty()) | ||
623 | 59 | { | ||
624 | 60 | values.push_back(usc::Variant{usc::VariantArray{usc::Variant{METADATA_PUBLISHER}, usc::Variant{app.publisher}}}); | ||
625 | 61 | } | ||
626 | 62 | if (!app.website.empty()) | ||
627 | 63 | { | ||
628 | 64 | values.push_back(usc::Variant{usc::VariantArray{usc::Variant{METADATA_WEBSITE}, usc::Variant{app.website}}}); | ||
629 | 65 | } | ||
630 | 66 | if (!app.license.empty()) | ||
631 | 67 | { | ||
632 | 68 | values.push_back(usc::Variant{usc::VariantArray{usc::Variant{METADATA_LICENSE}, usc::Variant{app.license}}}); | ||
633 | 69 | } | ||
634 | 70 | |||
635 | 71 | widget.add_attribute_value("values", usc::Variant(values)); | ||
636 | 72 | return widget; | ||
637 | 73 | } | ||
638 | 74 | |||
639 | 75 | |||
640 | 76 | static usc::PreviewWidget | ||
641 | 77 | screenshotWidgets(libertine::scope::Package const& app) | ||
642 | 78 | { | ||
643 | 79 | usc::PreviewWidget gallery(SCREENSHOTS_ID, "gallery"); | ||
644 | 80 | usc::VariantArray arr; | ||
645 | 81 | for (auto const& screenshot: app.screenshots) | ||
646 | 82 | { | ||
647 | 83 | arr.push_back(usc::Variant(screenshot)); | ||
648 | 84 | } | ||
649 | 85 | gallery.add_attribute_value("sources", usc::Variant(arr)); | ||
650 | 86 | return gallery; | ||
651 | 87 | } | ||
652 | 88 | } | ||
653 | 89 | |||
654 | 90 | |||
655 | 91 | std::chrono::milliseconds libertine::scope::Preview:: | ||
656 | 92 | update_progress_after = std::chrono::milliseconds(500); | ||
657 | 93 | |||
658 | 94 | |||
659 | 95 | libertine::scope::Preview:: | ||
660 | 96 | Preview(usc::Result const& result, | ||
661 | 97 | usc::ActionMetadata const& metadata, | ||
662 | 98 | std::shared_ptr<ServiceManager> const& service) | ||
663 | 99 | : PreviewQueryBase(result, metadata) | ||
664 | 100 | , service_(service) | ||
665 | 101 | , thread_() | ||
666 | 102 | { | ||
667 | 103 | } | ||
668 | 104 | |||
669 | 105 | |||
670 | 106 | libertine::scope::Preview:: | ||
671 | 107 | ~Preview() | ||
672 | 108 | { | ||
673 | 109 | if (thread_ != nullptr) | ||
674 | 110 | { | ||
675 | 111 | thread_->join(); | ||
676 | 112 | } | ||
677 | 113 | } | ||
678 | 114 | |||
679 | 115 | |||
680 | 116 | void libertine::scope::Preview:: | ||
681 | 117 | cancelled() | ||
682 | 118 | { | ||
683 | 119 | } | ||
684 | 120 | |||
685 | 121 | |||
686 | 122 | void libertine::scope::Preview:: | ||
687 | 123 | createSingleColumnLayout(Package const& app) | ||
688 | 124 | { | ||
689 | 125 | oneColumn.column.push_back(HEADER_ID); | ||
690 | 126 | oneColumn.column.push_back(ACTIONS_ID); | ||
691 | 127 | oneColumn.column.push_back(METADATA_ID); | ||
692 | 128 | if (!app.screenshots.empty()) | ||
693 | 129 | { | ||
694 | 130 | oneColumn.column.push_back(SCREENSHOTS_ID); | ||
695 | 131 | } | ||
696 | 132 | oneColumn.column.push_back(SUMMARY_ID); | ||
697 | 133 | } | ||
698 | 134 | |||
699 | 135 | |||
700 | 136 | void libertine::scope::Preview:: | ||
701 | 137 | createDualColumnLayout(Package const& app) | ||
702 | 138 | { | ||
703 | 139 | twoColumns.column1.push_back(HEADER_ID); | ||
704 | 140 | twoColumns.column1.push_back(ACTIONS_ID); | ||
705 | 141 | twoColumns.column1.push_back(SUMMARY_ID); | ||
706 | 142 | twoColumns.column2.push_back(METADATA_ID); | ||
707 | 143 | if (!app.screenshots.empty()) | ||
708 | 144 | { | ||
709 | 145 | twoColumns.column2.push_back(SCREENSHOTS_ID); | ||
710 | 146 | } | ||
711 | 147 | } | ||
712 | 148 | |||
713 | 149 | |||
714 | 150 | void libertine::scope::Preview:: | ||
715 | 151 | run(usc::PreviewReplyProxy const& reply) | ||
716 | 152 | { | ||
717 | 153 | auto app = service_->app_info(QString::fromStdString(result()["id"].get_string())); | ||
718 | 154 | auto widgets = createWidgets(app); | ||
719 | 155 | |||
720 | 156 | createSingleColumnLayout(app); | ||
721 | 157 | createDualColumnLayout(app); | ||
722 | 158 | |||
723 | 159 | registerLayouts(reply); | ||
724 | 160 | reply->push(widgets); | ||
725 | 161 | |||
726 | 162 | // update the progress bar asynchronously | ||
727 | 163 | // if an operation is in progress | ||
728 | 164 | if (app.status == "installing" || app.status == "removing") { | ||
729 | 165 | thread_.reset(new std::thread([=](){ | ||
730 | 166 | std::this_thread::sleep_for(update_progress_after); | ||
731 | 167 | service_->update_progress(QString::fromStdString(app.id)); | ||
732 | 168 | })); | ||
733 | 169 | } | ||
734 | 170 | } | ||
735 | 171 | |||
736 | 172 | |||
737 | 173 | usc::PreviewWidgetList libertine::scope::Preview:: | ||
738 | 174 | createWidgets(libertine::scope::Package const& app) const | ||
739 | 175 | { | ||
740 | 176 | auto widgets = headerWidgets(app); | ||
741 | 177 | widgets.push_back(buttonWidgets(app)); | ||
742 | 178 | widgets.push_back(metadataWidgets(app)); | ||
743 | 179 | if (!app.screenshots.empty()) | ||
744 | 180 | { | ||
745 | 181 | widgets.push_back(screenshotWidgets(app)); | ||
746 | 182 | } | ||
747 | 183 | widgets.push_back(descriptionWidgets(app)); | ||
748 | 184 | |||
749 | 185 | return widgets; | ||
750 | 186 | } | ||
751 | 187 | |||
752 | 188 | |||
753 | 189 | usc::PreviewWidgetList libertine::scope::Preview:: | ||
754 | 190 | headerWidgets(libertine::scope::Package const& app) const | ||
755 | 191 | { | ||
756 | 192 | usc::PreviewWidget header(HEADER_ID, "header"); | ||
757 | 193 | header.add_attribute_value("title", usc::Variant(app.name.empty() ? result().title() : app.name)); | ||
758 | 194 | header.add_attribute_value("subtitle", usc::Variant(app.summary)); | ||
759 | 195 | header.add_attribute_value("mascot", usc::Variant(app.icon.empty() ? result().art() : app.icon)); | ||
760 | 196 | header.add_attribute_value("fallback", usc::Variant("image://theme/placeholder-app-icon")); | ||
761 | 197 | |||
762 | 198 | usc::PreviewWidgetList widgets; | ||
763 | 199 | widgets.push_back(header); | ||
764 | 200 | |||
765 | 201 | qDebug() << "Pushed widgets for package:" << QString::fromStdString(app.name); | ||
766 | 202 | return widgets; | ||
767 | 203 | } | ||
768 | 204 | |||
769 | 205 | |||
770 | 206 | usc::PreviewWidget libertine::scope::Preview:: | ||
771 | 207 | buttonWidgets(libertine::scope::Package const& package) const | ||
772 | 208 | { | ||
773 | 209 | if (package.status == "installing" || package.status == "removing") | ||
774 | 210 | { | ||
775 | 211 | usc::PreviewWidget progress(ACTIONS_ID, "progress"); | ||
776 | 212 | usc::VariantMap tuple; | ||
777 | 213 | tuple["dbus-name"] = "com.canonical.libertine.ContainerManager"; | ||
778 | 214 | tuple["dbus-object"] = std::string("/Progress/") + package.progress; | ||
779 | 215 | progress.add_attribute_value("source", usc::Variant(tuple)); | ||
780 | 216 | return progress; | ||
781 | 217 | } | ||
782 | 218 | |||
783 | 219 | usc::VariantBuilder builder; | ||
784 | 220 | if (package.status == "installed") | ||
785 | 221 | { | ||
786 | 222 | builder.add_tuple( | ||
787 | 223 | { | ||
788 | 224 | {"id", usc::Variant("remove")}, | ||
789 | 225 | {"label", usc::Variant(ACTION_REMOVE)}, | ||
790 | 226 | }); | ||
791 | 227 | builder.add_tuple( | ||
792 | 228 | { | ||
793 | 229 | {"id", usc::Variant("open")}, | ||
794 | 230 | {"label", usc::Variant(ACTION_OPEN)}, | ||
795 | 231 | }); | ||
796 | 232 | } | ||
797 | 233 | else | ||
798 | 234 | { | ||
799 | 235 | builder.add_tuple( | ||
800 | 236 | { | ||
801 | 237 | {"id", usc::Variant("install")}, | ||
802 | 238 | {"label", usc::Variant(ACTION_INSTALL)}, | ||
803 | 239 | }); | ||
804 | 240 | } | ||
805 | 241 | |||
806 | 242 | usc::PreviewWidget buttons(ACTIONS_ID, "actions"); | ||
807 | 243 | buttons.add_attribute_value("actions", builder.end()); | ||
808 | 244 | return buttons; | ||
809 | 245 | } | ||
810 | 246 | |||
811 | 247 | |||
812 | 248 | usc::PreviewWidget libertine::scope::Preview:: | ||
813 | 249 | descriptionWidgets(libertine::scope::Package const& app) const | ||
814 | 250 | { | ||
815 | 251 | usc::PreviewWidget summary(SUMMARY_ID, "text"); | ||
816 | 252 | summary.add_attribute_value("title", usc::Variant(SUMMARY_TITLE)); | ||
817 | 253 | if (app.description.empty() && result().contains("description")) | ||
818 | 254 | { | ||
819 | 255 | summary.add_attribute_value("text", usc::Variant(result()["description"].get_string())); | ||
820 | 256 | } | ||
821 | 257 | else | ||
822 | 258 | { | ||
823 | 259 | summary.add_attribute_value("text", usc::Variant(app.description)); | ||
824 | 260 | } | ||
825 | 261 | return summary; | ||
826 | 262 | } | ||
827 | 263 | |||
828 | 264 | |||
829 | 265 | void libertine::scope::Preview:: | ||
830 | 266 | registerLayouts(unity::scopes::PreviewReplyProxy const& reply) | ||
831 | 267 | { | ||
832 | 268 | usc::ColumnLayout layout1col(1); | ||
833 | 269 | layout1col.add_column(oneColumn.column); | ||
834 | 270 | |||
835 | 271 | usc::ColumnLayout layout2col(2); | ||
836 | 272 | layout2col.add_column(twoColumns.column1); | ||
837 | 273 | layout2col.add_column(twoColumns.column2); | ||
838 | 274 | |||
839 | 275 | try | ||
840 | 276 | { | ||
841 | 277 | reply->register_layout({layout1col, layout2col}); | ||
842 | 278 | } | ||
843 | 279 | catch (unity::LogicException const& e) | ||
844 | 280 | { | ||
845 | 281 | qWarning() << "Failed to register layout:" << QString::fromStdString(e.what()); | ||
846 | 282 | } | ||
847 | 283 | } | ||
848 | 0 | 284 | ||
849 | === added file 'lib/libertine-scope/preview.h' | |||
850 | --- lib/libertine-scope/preview.h 1970-01-01 00:00:00 +0000 | |||
851 | +++ lib/libertine-scope/preview.h 2016-09-23 14:36:26 +0000 | |||
852 | @@ -0,0 +1,93 @@ | |||
853 | 1 | /* | ||
854 | 2 | * Copyright 2016 Canonical Ltd. | ||
855 | 3 | * | ||
856 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
857 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
858 | 6 | * Free Software Foundation. | ||
859 | 7 | * | ||
860 | 8 | * This program is distributed in the hope that it will be useful, | ||
861 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
862 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
863 | 11 | * GNU General Public License for more details. | ||
864 | 12 | * | ||
865 | 13 | * You should have received a copy of the GNU General Public License | ||
866 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
867 | 15 | */ | ||
868 | 16 | #pragma once | ||
869 | 17 | |||
870 | 18 | #include <chrono> | ||
871 | 19 | #include <unity/scopes/PreviewQueryBase.h> | ||
872 | 20 | #include <unity/scopes/PreviewWidget.h> | ||
873 | 21 | |||
874 | 22 | |||
875 | 23 | namespace std | ||
876 | 24 | { | ||
877 | 25 | class thread; | ||
878 | 26 | } | ||
879 | 27 | |||
880 | 28 | namespace libertine | ||
881 | 29 | { | ||
882 | 30 | namespace scope | ||
883 | 31 | { | ||
884 | 32 | |||
885 | 33 | |||
886 | 34 | class ServiceManager; | ||
887 | 35 | class Package; | ||
888 | 36 | |||
889 | 37 | |||
890 | 38 | class Preview | ||
891 | 39 | : public unity::scopes::PreviewQueryBase | ||
892 | 40 | { | ||
893 | 41 | public: | ||
894 | 42 | explicit Preview(unity::scopes::Result const& result, | ||
895 | 43 | unity::scopes::ActionMetadata const& metadata, | ||
896 | 44 | std::shared_ptr<ServiceManager> const& service); | ||
897 | 45 | |||
898 | 46 | virtual ~Preview(); | ||
899 | 47 | |||
900 | 48 | virtual void | ||
901 | 49 | cancelled() override; | ||
902 | 50 | |||
903 | 51 | virtual void | ||
904 | 52 | run(unity::scopes::PreviewReplyProxy const& reply) override; | ||
905 | 53 | |||
906 | 54 | static | ||
907 | 55 | std::chrono::milliseconds update_progress_after; | ||
908 | 56 | |||
909 | 57 | protected: | ||
910 | 58 | virtual unity::scopes::PreviewWidget | ||
911 | 59 | buttonWidgets(libertine::scope::Package const& package) const; | ||
912 | 60 | |||
913 | 61 | private: | ||
914 | 62 | unity::scopes::PreviewWidgetList | ||
915 | 63 | createWidgets(libertine::scope::Package const& app) const; | ||
916 | 64 | |||
917 | 65 | unity::scopes::PreviewWidgetList | ||
918 | 66 | headerWidgets(libertine::scope::Package const& app) const; | ||
919 | 67 | |||
920 | 68 | unity::scopes::PreviewWidget | ||
921 | 69 | descriptionWidgets(libertine::scope::Package const& app) const; | ||
922 | 70 | |||
923 | 71 | void | ||
924 | 72 | registerLayouts(unity::scopes::PreviewReplyProxy const& reply); | ||
925 | 73 | |||
926 | 74 | void | ||
927 | 75 | createSingleColumnLayout(Package const& app); | ||
928 | 76 | |||
929 | 77 | void | ||
930 | 78 | createDualColumnLayout(Package const& app); | ||
931 | 79 | |||
932 | 80 | struct { | ||
933 | 81 | std::vector<std::string> column; | ||
934 | 82 | } oneColumn; | ||
935 | 83 | |||
936 | 84 | struct { | ||
937 | 85 | std::vector<std::string> column1; | ||
938 | 86 | std::vector<std::string> column2; | ||
939 | 87 | } twoColumns; | ||
940 | 88 | |||
941 | 89 | std::shared_ptr<ServiceManager> service_; | ||
942 | 90 | std::unique_ptr<std::thread> thread_; | ||
943 | 91 | }; | ||
944 | 92 | } // namespace scope | ||
945 | 93 | } // namespace libertine | ||
946 | 0 | 94 | ||
947 | === added file 'lib/libertine-scope/service_manager.cpp' | |||
948 | --- lib/libertine-scope/service_manager.cpp 1970-01-01 00:00:00 +0000 | |||
949 | +++ lib/libertine-scope/service_manager.cpp 2016-09-23 14:36:26 +0000 | |||
950 | @@ -0,0 +1,103 @@ | |||
951 | 1 | /* | ||
952 | 2 | * Copyright 2016 Canonical Ltd. | ||
953 | 3 | * | ||
954 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
955 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
956 | 6 | * Free Software Foundation. | ||
957 | 7 | * | ||
958 | 8 | * This program is distributed in the hope that it will be useful, | ||
959 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
960 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
961 | 11 | * GNU General Public License for more details. | ||
962 | 12 | * | ||
963 | 13 | * You should have received a copy of the GNU General Public License | ||
964 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
965 | 15 | */ | ||
966 | 16 | #include "libertine-scope/service_manager.h" | ||
967 | 17 | |||
968 | 18 | #include <QtDBus> | ||
969 | 19 | #include <QDebug> | ||
970 | 20 | #include <QDBusMetaType> | ||
971 | 21 | |||
972 | 22 | namespace | ||
973 | 23 | { | ||
974 | 24 | constexpr auto SEARCH_CACHE_METHOD = "search"; | ||
975 | 25 | constexpr auto APP_INFO_METHOD = "app_info"; | ||
976 | 26 | constexpr auto INSTALL_METHOD = "install"; | ||
977 | 27 | constexpr auto REMOVE_METHOD = "remove"; | ||
978 | 28 | constexpr auto UPDATE_PROGRESS_METHOD = "update_progress"; | ||
979 | 29 | constexpr auto LIBERTINE_SERVICE_DESTINATION = "com.canonical.libertine.ContainerManager"; | ||
980 | 30 | constexpr auto LIBERTINE_SERVICE_INTERFACE = "com.canonical.libertine.ContainerManager"; | ||
981 | 31 | constexpr auto LIBERTINE_SERVICE_OBJECT = "/Manager"; | ||
982 | 32 | } | ||
983 | 33 | |||
984 | 34 | |||
985 | 35 | libertine::scope::ServiceManager:: | ||
986 | 36 | ServiceManager() | ||
987 | 37 | { | ||
988 | 38 | qDBusRegisterMetaType<QList<QVariantMap > >(); | ||
989 | 39 | } | ||
990 | 40 | |||
991 | 41 | |||
992 | 42 | void libertine::scope::ServiceManager:: | ||
993 | 43 | install(QString const& package_name) const | ||
994 | 44 | { | ||
995 | 45 | call<qlonglong>(INSTALL_METHOD, QVariant(package_name)); | ||
996 | 46 | } | ||
997 | 47 | |||
998 | 48 | |||
999 | 49 | void libertine::scope::ServiceManager:: | ||
1000 | 50 | remove(QString const& package_name) const | ||
1001 | 51 | { | ||
1002 | 52 | call<qlonglong>(REMOVE_METHOD, QVariant(package_name)); | ||
1003 | 53 | } | ||
1004 | 54 | |||
1005 | 55 | |||
1006 | 56 | libertine::scope::Package libertine::scope::ServiceManager:: | ||
1007 | 57 | app_info(const QString &app_id) const | ||
1008 | 58 | { | ||
1009 | 59 | return Package::from_map(call<QVariantMap >(APP_INFO_METHOD, QVariant(app_id))); | ||
1010 | 60 | } | ||
1011 | 61 | |||
1012 | 62 | |||
1013 | 63 | void libertine::scope::ServiceManager:: | ||
1014 | 64 | update_progress(QString const& package_name) const | ||
1015 | 65 | { | ||
1016 | 66 | call<bool>(UPDATE_PROGRESS_METHOD, QVariant(package_name)); | ||
1017 | 67 | } | ||
1018 | 68 | |||
1019 | 69 | |||
1020 | 70 | QList<libertine::scope::Package> libertine::scope::ServiceManager:: | ||
1021 | 71 | search_cache(const QString &query) const | ||
1022 | 72 | { | ||
1023 | 73 | return Package::from_map(call<QList<QVariantMap > >(SEARCH_CACHE_METHOD, QVariant(query))); | ||
1024 | 74 | } | ||
1025 | 75 | |||
1026 | 76 | |||
1027 | 77 | template<class T> | ||
1028 | 78 | T libertine::scope::ServiceManager:: | ||
1029 | 79 | call(QString const& method, QVariant const& arg1) const | ||
1030 | 80 | { | ||
1031 | 81 | if (!valid()) | ||
1032 | 82 | { | ||
1033 | 83 | qCritical() << "Cannot connect to D-Bus session bus."; | ||
1034 | 84 | return T{}; | ||
1035 | 85 | } | ||
1036 | 86 | |||
1037 | 87 | QDBusInterface iface(LIBERTINE_SERVICE_DESTINATION, LIBERTINE_SERVICE_OBJECT, LIBERTINE_SERVICE_INTERFACE, QDBusConnection::sessionBus()); | ||
1038 | 88 | QDBusReply<T> response = iface.call(method, arg1); | ||
1039 | 89 | if (response.isValid()) | ||
1040 | 90 | { | ||
1041 | 91 | return response.value(); | ||
1042 | 92 | } | ||
1043 | 93 | |||
1044 | 94 | qCritical() << "Call to " << method << " failed:" << qPrintable(response.error().message()); | ||
1045 | 95 | return T{}; | ||
1046 | 96 | } | ||
1047 | 97 | |||
1048 | 98 | |||
1049 | 99 | bool libertine::scope::ServiceManager:: | ||
1050 | 100 | valid() const | ||
1051 | 101 | { | ||
1052 | 102 | return QDBusConnection::sessionBus().isConnected(); | ||
1053 | 103 | } | ||
1054 | 0 | 104 | ||
1055 | === added file 'lib/libertine-scope/service_manager.h' | |||
1056 | --- lib/libertine-scope/service_manager.h 1970-01-01 00:00:00 +0000 | |||
1057 | +++ lib/libertine-scope/service_manager.h 2016-09-23 14:36:26 +0000 | |||
1058 | @@ -0,0 +1,51 @@ | |||
1059 | 1 | /* | ||
1060 | 2 | * Copyright 2016 Canonical Ltd. | ||
1061 | 3 | * | ||
1062 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1063 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
1064 | 6 | * Free Software Foundation. | ||
1065 | 7 | * | ||
1066 | 8 | * This program is distributed in the hope that it will be useful, | ||
1067 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1068 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1069 | 11 | * GNU General Public License for more details. | ||
1070 | 12 | * | ||
1071 | 13 | * You should have received a copy of the GNU General Public License | ||
1072 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1073 | 15 | */ | ||
1074 | 16 | #pragma once | ||
1075 | 17 | |||
1076 | 18 | #include "libertine-scope/package.h" | ||
1077 | 19 | |||
1078 | 20 | #include <QString> | ||
1079 | 21 | #include <QVariant> | ||
1080 | 22 | |||
1081 | 23 | |||
1082 | 24 | namespace libertine | ||
1083 | 25 | { | ||
1084 | 26 | namespace scope | ||
1085 | 27 | { | ||
1086 | 28 | |||
1087 | 29 | |||
1088 | 30 | class ServiceManager | ||
1089 | 31 | { | ||
1090 | 32 | public: | ||
1091 | 33 | explicit ServiceManager(); | ||
1092 | 34 | virtual ~ServiceManager() = default; | ||
1093 | 35 | |||
1094 | 36 | virtual QList<Package> search_cache(QString const& query) const; | ||
1095 | 37 | virtual Package app_info(QString const& app_id) const; | ||
1096 | 38 | virtual void install(QString const& package_name) const; | ||
1097 | 39 | virtual void remove(QString const& package_name) const; | ||
1098 | 40 | virtual void update_progress(QString const& package_name) const; | ||
1099 | 41 | |||
1100 | 42 | private: | ||
1101 | 43 | bool valid() const; | ||
1102 | 44 | |||
1103 | 45 | template<class T> | ||
1104 | 46 | T call(QString const& method, QVariant const& = QVariant()) const; | ||
1105 | 47 | }; | ||
1106 | 48 | |||
1107 | 49 | |||
1108 | 50 | } // namespace libertine | ||
1109 | 51 | } // namespace scope | ||
1110 | 0 | 52 | ||
1111 | === modified file 'manifest.json.in' | |||
1112 | --- manifest.json.in 2016-07-15 19:52:28 +0000 | |||
1113 | +++ manifest.json.in 2016-09-23 14:36:26 +0000 | |||
1114 | @@ -1,7 +1,7 @@ | |||
1115 | 1 | { | 1 | { |
1116 | 2 | "architecture": "@CLICK_ARCH@", | 2 | "architecture": "@CLICK_ARCH@", |
1117 | 3 | "description": "A Unity scope that surfaces Legacy apps from a Libertine container", | 3 | "description": "A Unity scope that surfaces Legacy apps from a Libertine container", |
1119 | 4 | "framework": "ubuntu-sdk-15.04.3", | 4 | "framework": "ubuntu-sdk-15.04.5", |
1120 | 5 | "hooks": { | 5 | "hooks": { |
1121 | 6 | "libertine-scope": { | 6 | "libertine-scope": { |
1122 | 7 | "apparmor": "@SCOPE_NAME@.apparmor", | 7 | "apparmor": "@SCOPE_NAME@.apparmor", |
1123 | 8 | 8 | ||
1124 | === modified file 'po/en_AU.po' | |||
1125 | --- po/en_AU.po 2016-08-25 06:10:07 +0000 | |||
1126 | +++ po/en_AU.po 2016-09-23 14:36:26 +0000 | |||
1127 | @@ -6,11 +6,12 @@ | |||
1128 | 6 | msgid "" | 6 | msgid "" |
1129 | 7 | msgstr "" | 7 | msgstr "" |
1130 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1133 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1134 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1135 | 11 | "PO-Revision-Date: 2016-05-21 11:19+0000\n" | 11 | "PO-Revision-Date: 2016-05-21 11:19+0000\n" |
1136 | 12 | "Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n" | 12 | "Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n" |
1137 | 13 | "Language-Team: English (Australia) <en_AU@li.org>\n" | 13 | "Language-Team: English (Australia) <en_AU@li.org>\n" |
1138 | 14 | "Language: \n" | ||
1139 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1140 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1141 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1142 | @@ -30,14 +31,77 @@ | |||
1143 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
1144 | 31 | msgstr "" | 32 | msgstr "" |
1145 | 32 | 33 | ||
1146 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1147 | 35 | msgid "X Apps" | ||
1148 | 36 | msgstr "" | ||
1149 | 37 | |||
1150 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1151 | 39 | msgid "Hidden X Apps" | ||
1152 | 40 | msgstr "" | ||
1153 | 41 | |||
1154 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1155 | 43 | msgid "Exclude Apps: " | ||
1156 | 44 | msgstr "" | ||
1157 | 45 | |||
1158 | 46 | #. anonymous namespace | ||
1159 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1160 | 48 | msgid "" | ||
1161 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
1162 | 50 | msgstr "" | ||
1163 | 51 | |||
1164 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1165 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1166 | 54 | msgstr "" | ||
1167 | 55 | |||
1168 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1169 | 57 | msgid "Info" | ||
1170 | 58 | msgstr "" | ||
1171 | 59 | |||
1172 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1173 | 61 | msgid "Install" | ||
1174 | 62 | msgstr "" | ||
1175 | 63 | |||
1176 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1177 | 65 | msgid "Remove" | ||
1178 | 66 | msgstr "" | ||
1179 | 67 | |||
1180 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1181 | 69 | msgid "Removing..." | ||
1182 | 70 | msgstr "" | ||
1183 | 71 | |||
1184 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1185 | 73 | msgid "Installing..." | ||
1186 | 74 | msgstr "" | ||
1187 | 75 | |||
1188 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1189 | 77 | msgid "Open" | ||
1190 | 78 | msgstr "" | ||
1191 | 79 | |||
1192 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1193 | 81 | msgid "Publisher/Creator" | ||
1194 | 82 | msgstr "" | ||
1195 | 83 | |||
1196 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1197 | 85 | msgid "Website" | ||
1198 | 86 | msgstr "" | ||
1199 | 87 | |||
1200 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1201 | 89 | msgid "License" | ||
1202 | 90 | msgstr "" | ||
1203 | 91 | |||
1204 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1205 | 93 | #: ../scope/apps/preview.cpp:55 | ||
1206 | 94 | msgid "Show" | ||
1207 | 95 | msgstr "" | ||
1208 | 96 | |||
1209 | 97 | #: ../scope/apps/preview.cpp:62 | ||
1210 | 98 | msgid "Hide" | ||
1211 | 99 | msgstr "" | ||
1212 | 100 | |||
1213 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
1214 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
1215 | 35 | msgstr "" | 103 | msgstr "" |
1216 | 36 | 104 | ||
1217 | 37 | #: ../scope/apps/query.cpp:43 | ||
1218 | 38 | msgid "Exclude Apps: " | ||
1219 | 39 | msgstr "" | ||
1220 | 40 | |||
1221 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
1222 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
1223 | 43 | msgid "" | 107 | msgid "" |
1224 | @@ -50,3 +114,19 @@ | |||
1225 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
1226 | 51 | "department." | 115 | "department." |
1227 | 52 | msgstr "" | 116 | msgstr "" |
1228 | 117 | |||
1229 | 118 | #: ../scope/store/query.cpp:68 | ||
1230 | 119 | msgid "%1 result found" | ||
1231 | 120 | msgstr "" | ||
1232 | 121 | |||
1233 | 122 | #: ../scope/store/query.cpp:69 | ||
1234 | 123 | msgid "%1 results found" | ||
1235 | 124 | msgstr "" | ||
1236 | 125 | |||
1237 | 126 | #: ../scope/store/query.cpp:74 | ||
1238 | 127 | msgid "Use the searchbar to find software." | ||
1239 | 128 | msgstr "" | ||
1240 | 129 | |||
1241 | 130 | #: ../scope/store/query.cpp:75 | ||
1242 | 131 | msgid "No results found." | ||
1243 | 132 | msgstr "" | ||
1244 | 53 | 133 | ||
1245 | === modified file 'po/en_GB.po' | |||
1246 | --- po/en_GB.po 2016-08-25 06:10:07 +0000 | |||
1247 | +++ po/en_GB.po 2016-09-23 14:36:26 +0000 | |||
1248 | @@ -6,11 +6,12 @@ | |||
1249 | 6 | msgid "" | 6 | msgid "" |
1250 | 7 | msgstr "" | 7 | msgstr "" |
1251 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1254 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1255 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1256 | 11 | "PO-Revision-Date: 2016-05-20 16:47+0000\n" | 11 | "PO-Revision-Date: 2016-05-20 16:47+0000\n" |
1257 | 12 | "Last-Translator: Andi Chandler <Unknown>\n" | 12 | "Last-Translator: Andi Chandler <Unknown>\n" |
1258 | 13 | "Language-Team: English (United Kingdom) <en_GB@li.org>\n" | 13 | "Language-Team: English (United Kingdom) <en_GB@li.org>\n" |
1259 | 14 | "Language: \n" | ||
1260 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1261 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1262 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1263 | @@ -30,14 +31,77 @@ | |||
1264 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
1265 | 31 | msgstr "" | 32 | msgstr "" |
1266 | 32 | 33 | ||
1267 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1268 | 35 | msgid "X Apps" | ||
1269 | 36 | msgstr "" | ||
1270 | 37 | |||
1271 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1272 | 39 | msgid "Hidden X Apps" | ||
1273 | 40 | msgstr "" | ||
1274 | 41 | |||
1275 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1276 | 43 | msgid "Exclude Apps: " | ||
1277 | 44 | msgstr "" | ||
1278 | 45 | |||
1279 | 46 | #. anonymous namespace | ||
1280 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1281 | 48 | msgid "" | ||
1282 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
1283 | 50 | msgstr "" | ||
1284 | 51 | |||
1285 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1286 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1287 | 54 | msgstr "" | ||
1288 | 55 | |||
1289 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1290 | 57 | msgid "Info" | ||
1291 | 58 | msgstr "" | ||
1292 | 59 | |||
1293 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1294 | 61 | msgid "Install" | ||
1295 | 62 | msgstr "" | ||
1296 | 63 | |||
1297 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1298 | 65 | msgid "Remove" | ||
1299 | 66 | msgstr "" | ||
1300 | 67 | |||
1301 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1302 | 69 | msgid "Removing..." | ||
1303 | 70 | msgstr "" | ||
1304 | 71 | |||
1305 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1306 | 73 | msgid "Installing..." | ||
1307 | 74 | msgstr "" | ||
1308 | 75 | |||
1309 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1310 | 77 | msgid "Open" | ||
1311 | 78 | msgstr "" | ||
1312 | 79 | |||
1313 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1314 | 81 | msgid "Publisher/Creator" | ||
1315 | 82 | msgstr "" | ||
1316 | 83 | |||
1317 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1318 | 85 | msgid "Website" | ||
1319 | 86 | msgstr "" | ||
1320 | 87 | |||
1321 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1322 | 89 | msgid "License" | ||
1323 | 90 | msgstr "" | ||
1324 | 91 | |||
1325 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1326 | 93 | #: ../scope/apps/preview.cpp:55 | ||
1327 | 94 | msgid "Show" | ||
1328 | 95 | msgstr "" | ||
1329 | 96 | |||
1330 | 97 | #: ../scope/apps/preview.cpp:62 | ||
1331 | 98 | msgid "Hide" | ||
1332 | 99 | msgstr "" | ||
1333 | 100 | |||
1334 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
1335 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
1336 | 35 | msgstr "" | 103 | msgstr "" |
1337 | 36 | 104 | ||
1338 | 37 | #: ../scope/apps/query.cpp:43 | ||
1339 | 38 | msgid "Exclude Apps: " | ||
1340 | 39 | msgstr "" | ||
1341 | 40 | |||
1342 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
1343 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
1344 | 43 | msgid "" | 107 | msgid "" |
1345 | @@ -50,3 +114,19 @@ | |||
1346 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
1347 | 51 | "department." | 115 | "department." |
1348 | 52 | msgstr "" | 116 | msgstr "" |
1349 | 117 | |||
1350 | 118 | #: ../scope/store/query.cpp:68 | ||
1351 | 119 | msgid "%1 result found" | ||
1352 | 120 | msgstr "" | ||
1353 | 121 | |||
1354 | 122 | #: ../scope/store/query.cpp:69 | ||
1355 | 123 | msgid "%1 results found" | ||
1356 | 124 | msgstr "" | ||
1357 | 125 | |||
1358 | 126 | #: ../scope/store/query.cpp:74 | ||
1359 | 127 | msgid "Use the searchbar to find software." | ||
1360 | 128 | msgstr "" | ||
1361 | 129 | |||
1362 | 130 | #: ../scope/store/query.cpp:75 | ||
1363 | 131 | msgid "No results found." | ||
1364 | 132 | msgstr "" | ||
1365 | 53 | 133 | ||
1366 | === modified file 'po/es.po' | |||
1367 | --- po/es.po 2016-08-25 06:10:07 +0000 | |||
1368 | +++ po/es.po 2016-09-23 14:36:26 +0000 | |||
1369 | @@ -6,11 +6,12 @@ | |||
1370 | 6 | msgid "" | 6 | msgid "" |
1371 | 7 | msgstr "" | 7 | msgstr "" |
1372 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1375 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1376 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1377 | 11 | "PO-Revision-Date: 2016-07-26 14:22+0000\n" | 11 | "PO-Revision-Date: 2016-07-26 14:22+0000\n" |
1378 | 12 | "Last-Translator: VÃctor R. Ruiz <Unknown>\n" | 12 | "Last-Translator: VÃctor R. Ruiz <Unknown>\n" |
1379 | 13 | "Language-Team: Spanish <es@li.org>\n" | 13 | "Language-Team: Spanish <es@li.org>\n" |
1380 | 14 | "Language: es\n" | ||
1381 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1382 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1383 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1384 | @@ -24,21 +25,90 @@ | |||
1385 | 24 | 25 | ||
1386 | 25 | #: ../scope/apps/libertine-scope.ubuntu_libertine-scope.ini.in.in.h:2 | 26 | #: ../scope/apps/libertine-scope.ubuntu_libertine-scope.ini.in.in.h:2 |
1387 | 26 | msgid "Surface and launch DEB-packaged X11-based applications." | 27 | msgid "Surface and launch DEB-packaged X11-based applications." |
1390 | 27 | msgstr "" | 28 | msgstr "Mostrar y ejecutar aplicaciones basadas en X11 y empaquetadas en DEB." |
1389 | 28 | "Mostrar y ejecutar aplicaciones basadas en X11 y empaquetadas en DEB." | ||
1391 | 29 | 29 | ||
1392 | 30 | #: ../scope/apps/libertine-scope.ubuntu_libertine-scope.ini.in.in.h:3 | 30 | #: ../scope/apps/libertine-scope.ubuntu_libertine-scope.ini.in.in.h:3 |
1393 | 31 | msgid "Search apps" | 31 | msgid "Search apps" |
1394 | 32 | msgstr "Buscar aplis" | 32 | msgstr "Buscar aplis" |
1395 | 33 | 33 | ||
1396 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1397 | 35 | msgid "X Apps" | ||
1398 | 36 | msgstr "" | ||
1399 | 37 | |||
1400 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1401 | 39 | #, fuzzy | ||
1402 | 40 | msgid "Hidden X Apps" | ||
1403 | 41 | msgstr "Aplis de escritorio ocultas" | ||
1404 | 42 | |||
1405 | 43 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1406 | 44 | msgid "Exclude Apps: " | ||
1407 | 45 | msgstr "Excluir aplis: " | ||
1408 | 46 | |||
1409 | 47 | #. anonymous namespace | ||
1410 | 48 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1411 | 49 | #, fuzzy | ||
1412 | 50 | msgid "" | ||
1413 | 51 | "No XApps available. Install new applications with the Libertine Manager." | ||
1414 | 52 | msgstr "" | ||
1415 | 53 | "No hay aplicaciones disponibles. Instale las nuevas aplicaciones con el " | ||
1416 | 54 | "gestor de Libertine." | ||
1417 | 55 | |||
1418 | 56 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1419 | 57 | #, fuzzy | ||
1420 | 58 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1421 | 59 | msgstr "" | ||
1422 | 60 | "Todas las aplicaciones están ocultas. Reinice los filtros o revise el " | ||
1423 | 61 | "departamento Aplis de escritorio ocultas." | ||
1424 | 62 | |||
1425 | 63 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1426 | 64 | msgid "Info" | ||
1427 | 65 | msgstr "" | ||
1428 | 66 | |||
1429 | 67 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1430 | 68 | msgid "Install" | ||
1431 | 69 | msgstr "" | ||
1432 | 70 | |||
1433 | 71 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1434 | 72 | msgid "Remove" | ||
1435 | 73 | msgstr "" | ||
1436 | 74 | |||
1437 | 75 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1438 | 76 | msgid "Removing..." | ||
1439 | 77 | msgstr "" | ||
1440 | 78 | |||
1441 | 79 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1442 | 80 | msgid "Installing..." | ||
1443 | 81 | msgstr "" | ||
1444 | 82 | |||
1445 | 83 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1446 | 84 | msgid "Open" | ||
1447 | 85 | msgstr "" | ||
1448 | 86 | |||
1449 | 87 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1450 | 88 | msgid "Publisher/Creator" | ||
1451 | 89 | msgstr "" | ||
1452 | 90 | |||
1453 | 91 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1454 | 92 | msgid "Website" | ||
1455 | 93 | msgstr "" | ||
1456 | 94 | |||
1457 | 95 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1458 | 96 | msgid "License" | ||
1459 | 97 | msgstr "" | ||
1460 | 98 | |||
1461 | 99 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1462 | 100 | #: ../scope/apps/preview.cpp:55 | ||
1463 | 101 | msgid "Show" | ||
1464 | 102 | msgstr "" | ||
1465 | 103 | |||
1466 | 104 | #: ../scope/apps/preview.cpp:62 | ||
1467 | 105 | msgid "Hide" | ||
1468 | 106 | msgstr "" | ||
1469 | 107 | |||
1470 | 34 | #: ../scope/apps/query.cpp:39 | 108 | #: ../scope/apps/query.cpp:39 |
1471 | 35 | msgid "Hidden Desktop Apps" | 109 | msgid "Hidden Desktop Apps" |
1472 | 36 | msgstr "Aplis de escritorio ocultas" | 110 | msgstr "Aplis de escritorio ocultas" |
1473 | 37 | 111 | ||
1474 | 38 | #: ../scope/apps/query.cpp:43 | ||
1475 | 39 | msgid "Exclude Apps: " | ||
1476 | 40 | msgstr "Excluir aplis: " | ||
1477 | 41 | |||
1478 | 42 | #. anonymous namespace | 112 | #. anonymous namespace |
1479 | 43 | #: ../scope/apps/query.cpp:113 | 113 | #: ../scope/apps/query.cpp:113 |
1480 | 44 | msgid "" | 114 | msgid "" |
1481 | @@ -55,3 +125,19 @@ | |||
1482 | 55 | msgstr "" | 125 | msgstr "" |
1483 | 56 | "Todas las aplicaciones están ocultas. Reinice los filtros o revise el " | 126 | "Todas las aplicaciones están ocultas. Reinice los filtros o revise el " |
1484 | 57 | "departamento Aplis de escritorio ocultas." | 127 | "departamento Aplis de escritorio ocultas." |
1485 | 128 | |||
1486 | 129 | #: ../scope/store/query.cpp:68 | ||
1487 | 130 | msgid "%1 result found" | ||
1488 | 131 | msgstr "" | ||
1489 | 132 | |||
1490 | 133 | #: ../scope/store/query.cpp:69 | ||
1491 | 134 | msgid "%1 results found" | ||
1492 | 135 | msgstr "" | ||
1493 | 136 | |||
1494 | 137 | #: ../scope/store/query.cpp:74 | ||
1495 | 138 | msgid "Use the searchbar to find software." | ||
1496 | 139 | msgstr "" | ||
1497 | 140 | |||
1498 | 141 | #: ../scope/store/query.cpp:75 | ||
1499 | 142 | msgid "No results found." | ||
1500 | 143 | msgstr "" | ||
1501 | 58 | 144 | ||
1502 | === modified file 'po/fi.po' | |||
1503 | --- po/fi.po 2016-08-25 06:10:07 +0000 | |||
1504 | +++ po/fi.po 2016-09-23 14:36:26 +0000 | |||
1505 | @@ -6,11 +6,12 @@ | |||
1506 | 6 | msgid "" | 6 | msgid "" |
1507 | 7 | msgstr "" | 7 | msgstr "" |
1508 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1511 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1512 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1513 | 11 | "PO-Revision-Date: 2016-05-30 07:34+0000\n" | 11 | "PO-Revision-Date: 2016-05-30 07:34+0000\n" |
1514 | 12 | "Last-Translator: Jiri Grönroos <Unknown>\n" | 12 | "Last-Translator: Jiri Grönroos <Unknown>\n" |
1515 | 13 | "Language-Team: Finnish <fi@li.org>\n" | 13 | "Language-Team: Finnish <fi@li.org>\n" |
1516 | 14 | "Language: fi\n" | ||
1517 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1518 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1519 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1520 | @@ -30,14 +31,77 @@ | |||
1521 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
1522 | 31 | msgstr "" | 32 | msgstr "" |
1523 | 32 | 33 | ||
1524 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1525 | 35 | msgid "X Apps" | ||
1526 | 36 | msgstr "" | ||
1527 | 37 | |||
1528 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1529 | 39 | msgid "Hidden X Apps" | ||
1530 | 40 | msgstr "" | ||
1531 | 41 | |||
1532 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1533 | 43 | msgid "Exclude Apps: " | ||
1534 | 44 | msgstr "" | ||
1535 | 45 | |||
1536 | 46 | #. anonymous namespace | ||
1537 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1538 | 48 | msgid "" | ||
1539 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
1540 | 50 | msgstr "" | ||
1541 | 51 | |||
1542 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1543 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1544 | 54 | msgstr "" | ||
1545 | 55 | |||
1546 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1547 | 57 | msgid "Info" | ||
1548 | 58 | msgstr "" | ||
1549 | 59 | |||
1550 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1551 | 61 | msgid "Install" | ||
1552 | 62 | msgstr "" | ||
1553 | 63 | |||
1554 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1555 | 65 | msgid "Remove" | ||
1556 | 66 | msgstr "" | ||
1557 | 67 | |||
1558 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1559 | 69 | msgid "Removing..." | ||
1560 | 70 | msgstr "" | ||
1561 | 71 | |||
1562 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1563 | 73 | msgid "Installing..." | ||
1564 | 74 | msgstr "" | ||
1565 | 75 | |||
1566 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1567 | 77 | msgid "Open" | ||
1568 | 78 | msgstr "" | ||
1569 | 79 | |||
1570 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1571 | 81 | msgid "Publisher/Creator" | ||
1572 | 82 | msgstr "" | ||
1573 | 83 | |||
1574 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1575 | 85 | msgid "Website" | ||
1576 | 86 | msgstr "" | ||
1577 | 87 | |||
1578 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1579 | 89 | msgid "License" | ||
1580 | 90 | msgstr "" | ||
1581 | 91 | |||
1582 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1583 | 93 | #: ../scope/apps/preview.cpp:55 | ||
1584 | 94 | msgid "Show" | ||
1585 | 95 | msgstr "" | ||
1586 | 96 | |||
1587 | 97 | #: ../scope/apps/preview.cpp:62 | ||
1588 | 98 | msgid "Hide" | ||
1589 | 99 | msgstr "" | ||
1590 | 100 | |||
1591 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
1592 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
1593 | 35 | msgstr "" | 103 | msgstr "" |
1594 | 36 | 104 | ||
1595 | 37 | #: ../scope/apps/query.cpp:43 | ||
1596 | 38 | msgid "Exclude Apps: " | ||
1597 | 39 | msgstr "" | ||
1598 | 40 | |||
1599 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
1600 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
1601 | 43 | msgid "" | 107 | msgid "" |
1602 | @@ -50,3 +114,19 @@ | |||
1603 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
1604 | 51 | "department." | 115 | "department." |
1605 | 52 | msgstr "" | 116 | msgstr "" |
1606 | 117 | |||
1607 | 118 | #: ../scope/store/query.cpp:68 | ||
1608 | 119 | msgid "%1 result found" | ||
1609 | 120 | msgstr "" | ||
1610 | 121 | |||
1611 | 122 | #: ../scope/store/query.cpp:69 | ||
1612 | 123 | msgid "%1 results found" | ||
1613 | 124 | msgstr "" | ||
1614 | 125 | |||
1615 | 126 | #: ../scope/store/query.cpp:74 | ||
1616 | 127 | msgid "Use the searchbar to find software." | ||
1617 | 128 | msgstr "" | ||
1618 | 129 | |||
1619 | 130 | #: ../scope/store/query.cpp:75 | ||
1620 | 131 | msgid "No results found." | ||
1621 | 132 | msgstr "" | ||
1622 | 53 | 133 | ||
1623 | === modified file 'po/fr.po' | |||
1624 | --- po/fr.po 2016-08-25 06:10:07 +0000 | |||
1625 | +++ po/fr.po 2016-09-23 14:36:26 +0000 | |||
1626 | @@ -6,11 +6,12 @@ | |||
1627 | 6 | msgid "" | 6 | msgid "" |
1628 | 7 | msgstr "" | 7 | msgstr "" |
1629 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1632 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1633 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1634 | 11 | "PO-Revision-Date: 2016-05-21 12:23+0000\n" | 11 | "PO-Revision-Date: 2016-05-21 12:23+0000\n" |
1635 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1636 | 13 | "Language-Team: French <fr@li.org>\n" | 13 | "Language-Team: French <fr@li.org>\n" |
1637 | 14 | "Language: fr\n" | ||
1638 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1639 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1640 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1641 | @@ -30,14 +31,77 @@ | |||
1642 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
1643 | 31 | msgstr "" | 32 | msgstr "" |
1644 | 32 | 33 | ||
1645 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1646 | 35 | msgid "X Apps" | ||
1647 | 36 | msgstr "" | ||
1648 | 37 | |||
1649 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1650 | 39 | msgid "Hidden X Apps" | ||
1651 | 40 | msgstr "" | ||
1652 | 41 | |||
1653 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1654 | 43 | msgid "Exclude Apps: " | ||
1655 | 44 | msgstr "" | ||
1656 | 45 | |||
1657 | 46 | #. anonymous namespace | ||
1658 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1659 | 48 | msgid "" | ||
1660 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
1661 | 50 | msgstr "" | ||
1662 | 51 | |||
1663 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1664 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1665 | 54 | msgstr "" | ||
1666 | 55 | |||
1667 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1668 | 57 | msgid "Info" | ||
1669 | 58 | msgstr "" | ||
1670 | 59 | |||
1671 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1672 | 61 | msgid "Install" | ||
1673 | 62 | msgstr "" | ||
1674 | 63 | |||
1675 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1676 | 65 | msgid "Remove" | ||
1677 | 66 | msgstr "" | ||
1678 | 67 | |||
1679 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1680 | 69 | msgid "Removing..." | ||
1681 | 70 | msgstr "" | ||
1682 | 71 | |||
1683 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1684 | 73 | msgid "Installing..." | ||
1685 | 74 | msgstr "" | ||
1686 | 75 | |||
1687 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1688 | 77 | msgid "Open" | ||
1689 | 78 | msgstr "" | ||
1690 | 79 | |||
1691 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1692 | 81 | msgid "Publisher/Creator" | ||
1693 | 82 | msgstr "" | ||
1694 | 83 | |||
1695 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1696 | 85 | msgid "Website" | ||
1697 | 86 | msgstr "" | ||
1698 | 87 | |||
1699 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1700 | 89 | msgid "License" | ||
1701 | 90 | msgstr "" | ||
1702 | 91 | |||
1703 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1704 | 93 | #: ../scope/apps/preview.cpp:55 | ||
1705 | 94 | msgid "Show" | ||
1706 | 95 | msgstr "" | ||
1707 | 96 | |||
1708 | 97 | #: ../scope/apps/preview.cpp:62 | ||
1709 | 98 | msgid "Hide" | ||
1710 | 99 | msgstr "" | ||
1711 | 100 | |||
1712 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
1713 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
1714 | 35 | msgstr "" | 103 | msgstr "" |
1715 | 36 | 104 | ||
1716 | 37 | #: ../scope/apps/query.cpp:43 | ||
1717 | 38 | msgid "Exclude Apps: " | ||
1718 | 39 | msgstr "" | ||
1719 | 40 | |||
1720 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
1721 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
1722 | 43 | msgid "" | 107 | msgid "" |
1723 | @@ -50,3 +114,19 @@ | |||
1724 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
1725 | 51 | "department." | 115 | "department." |
1726 | 52 | msgstr "" | 116 | msgstr "" |
1727 | 117 | |||
1728 | 118 | #: ../scope/store/query.cpp:68 | ||
1729 | 119 | msgid "%1 result found" | ||
1730 | 120 | msgstr "" | ||
1731 | 121 | |||
1732 | 122 | #: ../scope/store/query.cpp:69 | ||
1733 | 123 | msgid "%1 results found" | ||
1734 | 124 | msgstr "" | ||
1735 | 125 | |||
1736 | 126 | #: ../scope/store/query.cpp:74 | ||
1737 | 127 | msgid "Use the searchbar to find software." | ||
1738 | 128 | msgstr "" | ||
1739 | 129 | |||
1740 | 130 | #: ../scope/store/query.cpp:75 | ||
1741 | 131 | msgid "No results found." | ||
1742 | 132 | msgstr "" | ||
1743 | 53 | 133 | ||
1744 | === modified file 'po/gl.po' | |||
1745 | --- po/gl.po 2016-08-25 06:10:07 +0000 | |||
1746 | +++ po/gl.po 2016-09-23 14:36:26 +0000 | |||
1747 | @@ -6,11 +6,12 @@ | |||
1748 | 6 | msgid "" | 6 | msgid "" |
1749 | 7 | msgstr "" | 7 | msgstr "" |
1750 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1753 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1754 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1755 | 11 | "PO-Revision-Date: 2016-07-30 18:36+0000\n" | 11 | "PO-Revision-Date: 2016-07-30 18:36+0000\n" |
1756 | 12 | "Last-Translator: Marcos Lans <Unknown>\n" | 12 | "Last-Translator: Marcos Lans <Unknown>\n" |
1757 | 13 | "Language-Team: Galician <gl@li.org>\n" | 13 | "Language-Team: Galician <gl@li.org>\n" |
1758 | 14 | "Language: gl\n" | ||
1759 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1760 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1761 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1762 | @@ -31,14 +32,77 @@ | |||
1763 | 31 | msgid "Search apps" | 32 | msgid "Search apps" |
1764 | 32 | msgstr "Buscar nos aplicativos" | 33 | msgstr "Buscar nos aplicativos" |
1765 | 33 | 34 | ||
1766 | 35 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1767 | 36 | msgid "X Apps" | ||
1768 | 37 | msgstr "" | ||
1769 | 38 | |||
1770 | 39 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1771 | 40 | msgid "Hidden X Apps" | ||
1772 | 41 | msgstr "" | ||
1773 | 42 | |||
1774 | 43 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1775 | 44 | msgid "Exclude Apps: " | ||
1776 | 45 | msgstr "ExcluÃr aplicativos: " | ||
1777 | 46 | |||
1778 | 47 | #. anonymous namespace | ||
1779 | 48 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1780 | 49 | msgid "" | ||
1781 | 50 | "No XApps available. Install new applications with the Libertine Manager." | ||
1782 | 51 | msgstr "" | ||
1783 | 52 | |||
1784 | 53 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1785 | 54 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1786 | 55 | msgstr "" | ||
1787 | 56 | |||
1788 | 57 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1789 | 58 | msgid "Info" | ||
1790 | 59 | msgstr "" | ||
1791 | 60 | |||
1792 | 61 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1793 | 62 | msgid "Install" | ||
1794 | 63 | msgstr "" | ||
1795 | 64 | |||
1796 | 65 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1797 | 66 | msgid "Remove" | ||
1798 | 67 | msgstr "" | ||
1799 | 68 | |||
1800 | 69 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1801 | 70 | msgid "Removing..." | ||
1802 | 71 | msgstr "" | ||
1803 | 72 | |||
1804 | 73 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1805 | 74 | msgid "Installing..." | ||
1806 | 75 | msgstr "" | ||
1807 | 76 | |||
1808 | 77 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1809 | 78 | msgid "Open" | ||
1810 | 79 | msgstr "" | ||
1811 | 80 | |||
1812 | 81 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1813 | 82 | msgid "Publisher/Creator" | ||
1814 | 83 | msgstr "" | ||
1815 | 84 | |||
1816 | 85 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1817 | 86 | msgid "Website" | ||
1818 | 87 | msgstr "" | ||
1819 | 88 | |||
1820 | 89 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1821 | 90 | msgid "License" | ||
1822 | 91 | msgstr "" | ||
1823 | 92 | |||
1824 | 93 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1825 | 94 | #: ../scope/apps/preview.cpp:55 | ||
1826 | 95 | msgid "Show" | ||
1827 | 96 | msgstr "" | ||
1828 | 97 | |||
1829 | 98 | #: ../scope/apps/preview.cpp:62 | ||
1830 | 99 | msgid "Hide" | ||
1831 | 100 | msgstr "" | ||
1832 | 101 | |||
1833 | 34 | #: ../scope/apps/query.cpp:39 | 102 | #: ../scope/apps/query.cpp:39 |
1834 | 35 | msgid "Hidden Desktop Apps" | 103 | msgid "Hidden Desktop Apps" |
1835 | 36 | msgstr "Aplicativos de escritorio ocultos" | 104 | msgstr "Aplicativos de escritorio ocultos" |
1836 | 37 | 105 | ||
1837 | 38 | #: ../scope/apps/query.cpp:43 | ||
1838 | 39 | msgid "Exclude Apps: " | ||
1839 | 40 | msgstr "ExcluÃr aplicativos: " | ||
1840 | 41 | |||
1841 | 42 | #. anonymous namespace | 106 | #. anonymous namespace |
1842 | 43 | #: ../scope/apps/query.cpp:113 | 107 | #: ../scope/apps/query.cpp:113 |
1843 | 44 | msgid "" | 108 | msgid "" |
1844 | @@ -55,3 +119,19 @@ | |||
1845 | 55 | msgstr "" | 119 | msgstr "" |
1846 | 56 | "Todos os aplicativos ocultos. Restabeleza os filtros ou comprobe o apartado " | 120 | "Todos os aplicativos ocultos. Restabeleza os filtros ou comprobe o apartado " |
1847 | 57 | "de aplicativos de escritorio ocultos." | 121 | "de aplicativos de escritorio ocultos." |
1848 | 122 | |||
1849 | 123 | #: ../scope/store/query.cpp:68 | ||
1850 | 124 | msgid "%1 result found" | ||
1851 | 125 | msgstr "" | ||
1852 | 126 | |||
1853 | 127 | #: ../scope/store/query.cpp:69 | ||
1854 | 128 | msgid "%1 results found" | ||
1855 | 129 | msgstr "" | ||
1856 | 130 | |||
1857 | 131 | #: ../scope/store/query.cpp:74 | ||
1858 | 132 | msgid "Use the searchbar to find software." | ||
1859 | 133 | msgstr "" | ||
1860 | 134 | |||
1861 | 135 | #: ../scope/store/query.cpp:75 | ||
1862 | 136 | msgid "No results found." | ||
1863 | 137 | msgstr "" | ||
1864 | 58 | 138 | ||
1865 | === modified file 'po/hu.po' | |||
1866 | --- po/hu.po 2016-08-25 06:10:07 +0000 | |||
1867 | +++ po/hu.po 2016-09-23 14:36:26 +0000 | |||
1868 | @@ -6,11 +6,12 @@ | |||
1869 | 6 | msgid "" | 6 | msgid "" |
1870 | 7 | msgstr "" | 7 | msgstr "" |
1871 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
1874 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
1875 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
1876 | 11 | "PO-Revision-Date: 2016-07-21 20:40+0000\n" | 11 | "PO-Revision-Date: 2016-07-21 20:40+0000\n" |
1877 | 12 | "Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n" | 12 | "Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n" |
1878 | 13 | "Language-Team: Hungarian <hu@li.org>\n" | 13 | "Language-Team: Hungarian <hu@li.org>\n" |
1879 | 14 | "Language: hu\n" | ||
1880 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
1881 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
1882 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
1883 | @@ -30,14 +31,83 @@ | |||
1884 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
1885 | 31 | msgstr "Alkalmazások keresése" | 32 | msgstr "Alkalmazások keresése" |
1886 | 32 | 33 | ||
1887 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
1888 | 35 | msgid "X Apps" | ||
1889 | 36 | msgstr "" | ||
1890 | 37 | |||
1891 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
1892 | 39 | #, fuzzy | ||
1893 | 40 | msgid "Hidden X Apps" | ||
1894 | 41 | msgstr "Rejtett asztali alkalmazások" | ||
1895 | 42 | |||
1896 | 43 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
1897 | 44 | msgid "Exclude Apps: " | ||
1898 | 45 | msgstr "Alkalmazáskivételek: " | ||
1899 | 46 | |||
1900 | 47 | #. anonymous namespace | ||
1901 | 48 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
1902 | 49 | #, fuzzy | ||
1903 | 50 | msgid "" | ||
1904 | 51 | "No XApps available. Install new applications with the Libertine Manager." | ||
1905 | 52 | msgstr "" | ||
1906 | 53 | "Nincs elérhetÅ‘ alkalmazás. TelepÃtsen újakat a Libertine-kezelÅ‘ segÃtségével." | ||
1907 | 54 | |||
1908 | 55 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
1909 | 56 | #, fuzzy | ||
1910 | 57 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
1911 | 58 | msgstr "" | ||
1912 | 59 | "Minden alkalmazás rejtett. Törölje a szűrőt vagy váltson a rejtett asztali " | ||
1913 | 60 | "alkalmazásokra." | ||
1914 | 61 | |||
1915 | 62 | #: ../lib/libertine-scope/preview.cpp:40 | ||
1916 | 63 | msgid "Info" | ||
1917 | 64 | msgstr "" | ||
1918 | 65 | |||
1919 | 66 | #: ../lib/libertine-scope/preview.cpp:41 | ||
1920 | 67 | msgid "Install" | ||
1921 | 68 | msgstr "" | ||
1922 | 69 | |||
1923 | 70 | #: ../lib/libertine-scope/preview.cpp:42 | ||
1924 | 71 | msgid "Remove" | ||
1925 | 72 | msgstr "" | ||
1926 | 73 | |||
1927 | 74 | #: ../lib/libertine-scope/preview.cpp:43 | ||
1928 | 75 | msgid "Removing..." | ||
1929 | 76 | msgstr "" | ||
1930 | 77 | |||
1931 | 78 | #: ../lib/libertine-scope/preview.cpp:44 | ||
1932 | 79 | msgid "Installing..." | ||
1933 | 80 | msgstr "" | ||
1934 | 81 | |||
1935 | 82 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
1936 | 83 | msgid "Open" | ||
1937 | 84 | msgstr "" | ||
1938 | 85 | |||
1939 | 86 | #: ../lib/libertine-scope/preview.cpp:46 | ||
1940 | 87 | msgid "Publisher/Creator" | ||
1941 | 88 | msgstr "" | ||
1942 | 89 | |||
1943 | 90 | #: ../lib/libertine-scope/preview.cpp:47 | ||
1944 | 91 | msgid "Website" | ||
1945 | 92 | msgstr "" | ||
1946 | 93 | |||
1947 | 94 | #: ../lib/libertine-scope/preview.cpp:48 | ||
1948 | 95 | msgid "License" | ||
1949 | 96 | msgstr "" | ||
1950 | 97 | |||
1951 | 98 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
1952 | 99 | #: ../scope/apps/preview.cpp:55 | ||
1953 | 100 | msgid "Show" | ||
1954 | 101 | msgstr "" | ||
1955 | 102 | |||
1956 | 103 | #: ../scope/apps/preview.cpp:62 | ||
1957 | 104 | msgid "Hide" | ||
1958 | 105 | msgstr "" | ||
1959 | 106 | |||
1960 | 33 | #: ../scope/apps/query.cpp:39 | 107 | #: ../scope/apps/query.cpp:39 |
1961 | 34 | msgid "Hidden Desktop Apps" | 108 | msgid "Hidden Desktop Apps" |
1962 | 35 | msgstr "Rejtett asztali alkalmazások" | 109 | msgstr "Rejtett asztali alkalmazások" |
1963 | 36 | 110 | ||
1964 | 37 | #: ../scope/apps/query.cpp:43 | ||
1965 | 38 | msgid "Exclude Apps: " | ||
1966 | 39 | msgstr "Alkalmazáskivételek: " | ||
1967 | 40 | |||
1968 | 41 | #. anonymous namespace | 111 | #. anonymous namespace |
1969 | 42 | #: ../scope/apps/query.cpp:113 | 112 | #: ../scope/apps/query.cpp:113 |
1970 | 43 | msgid "" | 113 | msgid "" |
1971 | @@ -53,3 +123,19 @@ | |||
1972 | 53 | msgstr "" | 123 | msgstr "" |
1973 | 54 | "Minden alkalmazás rejtett. Törölje a szűrőt vagy váltson a rejtett asztali " | 124 | "Minden alkalmazás rejtett. Törölje a szűrőt vagy váltson a rejtett asztali " |
1974 | 55 | "alkalmazásokra." | 125 | "alkalmazásokra." |
1975 | 126 | |||
1976 | 127 | #: ../scope/store/query.cpp:68 | ||
1977 | 128 | msgid "%1 result found" | ||
1978 | 129 | msgstr "" | ||
1979 | 130 | |||
1980 | 131 | #: ../scope/store/query.cpp:69 | ||
1981 | 132 | msgid "%1 results found" | ||
1982 | 133 | msgstr "" | ||
1983 | 134 | |||
1984 | 135 | #: ../scope/store/query.cpp:74 | ||
1985 | 136 | msgid "Use the searchbar to find software." | ||
1986 | 137 | msgstr "" | ||
1987 | 138 | |||
1988 | 139 | #: ../scope/store/query.cpp:75 | ||
1989 | 140 | msgid "No results found." | ||
1990 | 141 | msgstr "" | ||
1991 | 56 | 142 | ||
1992 | === modified file 'po/libertine-scope.pot' | |||
1993 | --- po/libertine-scope.pot 2016-07-20 16:39:17 +0000 | |||
1994 | +++ po/libertine-scope.pot 2016-09-23 14:36:26 +0000 | |||
1995 | @@ -8,7 +8,7 @@ | |||
1996 | 8 | msgstr "" | 8 | msgstr "" |
1997 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
1998 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
2000 | 11 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 11 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
2001 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
2002 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
2003 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
2004 | @@ -30,14 +30,77 @@ | |||
2005 | 30 | msgid "Search apps" | 30 | msgid "Search apps" |
2006 | 31 | msgstr "" | 31 | msgstr "" |
2007 | 32 | 32 | ||
2008 | 33 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
2009 | 34 | msgid "X Apps" | ||
2010 | 35 | msgstr "" | ||
2011 | 36 | |||
2012 | 37 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
2013 | 38 | msgid "Hidden X Apps" | ||
2014 | 39 | msgstr "" | ||
2015 | 40 | |||
2016 | 41 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
2017 | 42 | msgid "Exclude Apps: " | ||
2018 | 43 | msgstr "" | ||
2019 | 44 | |||
2020 | 45 | #. anonymous namespace | ||
2021 | 46 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
2022 | 47 | msgid "" | ||
2023 | 48 | "No XApps available. Install new applications with the Libertine Manager." | ||
2024 | 49 | msgstr "" | ||
2025 | 50 | |||
2026 | 51 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
2027 | 52 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
2028 | 53 | msgstr "" | ||
2029 | 54 | |||
2030 | 55 | #: ../lib/libertine-scope/preview.cpp:40 | ||
2031 | 56 | msgid "Info" | ||
2032 | 57 | msgstr "" | ||
2033 | 58 | |||
2034 | 59 | #: ../lib/libertine-scope/preview.cpp:41 | ||
2035 | 60 | msgid "Install" | ||
2036 | 61 | msgstr "" | ||
2037 | 62 | |||
2038 | 63 | #: ../lib/libertine-scope/preview.cpp:42 | ||
2039 | 64 | msgid "Remove" | ||
2040 | 65 | msgstr "" | ||
2041 | 66 | |||
2042 | 67 | #: ../lib/libertine-scope/preview.cpp:43 | ||
2043 | 68 | msgid "Removing..." | ||
2044 | 69 | msgstr "" | ||
2045 | 70 | |||
2046 | 71 | #: ../lib/libertine-scope/preview.cpp:44 | ||
2047 | 72 | msgid "Installing..." | ||
2048 | 73 | msgstr "" | ||
2049 | 74 | |||
2050 | 75 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
2051 | 76 | msgid "Open" | ||
2052 | 77 | msgstr "" | ||
2053 | 78 | |||
2054 | 79 | #: ../lib/libertine-scope/preview.cpp:46 | ||
2055 | 80 | msgid "Publisher/Creator" | ||
2056 | 81 | msgstr "" | ||
2057 | 82 | |||
2058 | 83 | #: ../lib/libertine-scope/preview.cpp:47 | ||
2059 | 84 | msgid "Website" | ||
2060 | 85 | msgstr "" | ||
2061 | 86 | |||
2062 | 87 | #: ../lib/libertine-scope/preview.cpp:48 | ||
2063 | 88 | msgid "License" | ||
2064 | 89 | msgstr "" | ||
2065 | 90 | |||
2066 | 91 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
2067 | 92 | #: ../scope/apps/preview.cpp:55 | ||
2068 | 93 | msgid "Show" | ||
2069 | 94 | msgstr "" | ||
2070 | 95 | |||
2071 | 96 | #: ../scope/apps/preview.cpp:62 | ||
2072 | 97 | msgid "Hide" | ||
2073 | 98 | msgstr "" | ||
2074 | 99 | |||
2075 | 33 | #: ../scope/apps/query.cpp:39 | 100 | #: ../scope/apps/query.cpp:39 |
2076 | 34 | msgid "Hidden Desktop Apps" | 101 | msgid "Hidden Desktop Apps" |
2077 | 35 | msgstr "" | 102 | msgstr "" |
2078 | 36 | 103 | ||
2079 | 37 | #: ../scope/apps/query.cpp:43 | ||
2080 | 38 | msgid "Exclude Apps: " | ||
2081 | 39 | msgstr "" | ||
2082 | 40 | |||
2083 | 41 | #. anonymous namespace | 104 | #. anonymous namespace |
2084 | 42 | #: ../scope/apps/query.cpp:113 | 105 | #: ../scope/apps/query.cpp:113 |
2085 | 43 | msgid "" | 106 | msgid "" |
2086 | @@ -50,3 +113,19 @@ | |||
2087 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 113 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
2088 | 51 | "department." | 114 | "department." |
2089 | 52 | msgstr "" | 115 | msgstr "" |
2090 | 116 | |||
2091 | 117 | #: ../scope/store/query.cpp:68 | ||
2092 | 118 | msgid "%1 result found" | ||
2093 | 119 | msgstr "" | ||
2094 | 120 | |||
2095 | 121 | #: ../scope/store/query.cpp:69 | ||
2096 | 122 | msgid "%1 results found" | ||
2097 | 123 | msgstr "" | ||
2098 | 124 | |||
2099 | 125 | #: ../scope/store/query.cpp:74 | ||
2100 | 126 | msgid "Use the searchbar to find software." | ||
2101 | 127 | msgstr "" | ||
2102 | 128 | |||
2103 | 129 | #: ../scope/store/query.cpp:75 | ||
2104 | 130 | msgid "No results found." | ||
2105 | 131 | msgstr "" | ||
2106 | 53 | 132 | ||
2107 | === modified file 'po/ms.po' | |||
2108 | --- po/ms.po 2016-08-25 06:10:07 +0000 | |||
2109 | +++ po/ms.po 2016-09-23 14:36:26 +0000 | |||
2110 | @@ -6,11 +6,12 @@ | |||
2111 | 6 | msgid "" | 6 | msgid "" |
2112 | 7 | msgstr "" | 7 | msgstr "" |
2113 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
2116 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
2117 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
2118 | 11 | "PO-Revision-Date: 2016-05-22 00:24+0000\n" | 11 | "PO-Revision-Date: 2016-05-22 00:24+0000\n" |
2119 | 12 | "Last-Translator: abuyop <Unknown>\n" | 12 | "Last-Translator: abuyop <Unknown>\n" |
2120 | 13 | "Language-Team: Malay <ms@li.org>\n" | 13 | "Language-Team: Malay <ms@li.org>\n" |
2121 | 14 | "Language: ms\n" | ||
2122 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
2123 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
2124 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
2125 | @@ -30,14 +31,77 @@ | |||
2126 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
2127 | 31 | msgstr "" | 32 | msgstr "" |
2128 | 32 | 33 | ||
2129 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
2130 | 35 | msgid "X Apps" | ||
2131 | 36 | msgstr "" | ||
2132 | 37 | |||
2133 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
2134 | 39 | msgid "Hidden X Apps" | ||
2135 | 40 | msgstr "" | ||
2136 | 41 | |||
2137 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
2138 | 43 | msgid "Exclude Apps: " | ||
2139 | 44 | msgstr "" | ||
2140 | 45 | |||
2141 | 46 | #. anonymous namespace | ||
2142 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
2143 | 48 | msgid "" | ||
2144 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
2145 | 50 | msgstr "" | ||
2146 | 51 | |||
2147 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
2148 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
2149 | 54 | msgstr "" | ||
2150 | 55 | |||
2151 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
2152 | 57 | msgid "Info" | ||
2153 | 58 | msgstr "" | ||
2154 | 59 | |||
2155 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
2156 | 61 | msgid "Install" | ||
2157 | 62 | msgstr "" | ||
2158 | 63 | |||
2159 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
2160 | 65 | msgid "Remove" | ||
2161 | 66 | msgstr "" | ||
2162 | 67 | |||
2163 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
2164 | 69 | msgid "Removing..." | ||
2165 | 70 | msgstr "" | ||
2166 | 71 | |||
2167 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
2168 | 73 | msgid "Installing..." | ||
2169 | 74 | msgstr "" | ||
2170 | 75 | |||
2171 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
2172 | 77 | msgid "Open" | ||
2173 | 78 | msgstr "" | ||
2174 | 79 | |||
2175 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
2176 | 81 | msgid "Publisher/Creator" | ||
2177 | 82 | msgstr "" | ||
2178 | 83 | |||
2179 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
2180 | 85 | msgid "Website" | ||
2181 | 86 | msgstr "" | ||
2182 | 87 | |||
2183 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
2184 | 89 | msgid "License" | ||
2185 | 90 | msgstr "" | ||
2186 | 91 | |||
2187 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
2188 | 93 | #: ../scope/apps/preview.cpp:55 | ||
2189 | 94 | msgid "Show" | ||
2190 | 95 | msgstr "" | ||
2191 | 96 | |||
2192 | 97 | #: ../scope/apps/preview.cpp:62 | ||
2193 | 98 | msgid "Hide" | ||
2194 | 99 | msgstr "" | ||
2195 | 100 | |||
2196 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
2197 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
2198 | 35 | msgstr "" | 103 | msgstr "" |
2199 | 36 | 104 | ||
2200 | 37 | #: ../scope/apps/query.cpp:43 | ||
2201 | 38 | msgid "Exclude Apps: " | ||
2202 | 39 | msgstr "" | ||
2203 | 40 | |||
2204 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
2205 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
2206 | 43 | msgid "" | 107 | msgid "" |
2207 | @@ -50,3 +114,19 @@ | |||
2208 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
2209 | 51 | "department." | 115 | "department." |
2210 | 52 | msgstr "" | 116 | msgstr "" |
2211 | 117 | |||
2212 | 118 | #: ../scope/store/query.cpp:68 | ||
2213 | 119 | msgid "%1 result found" | ||
2214 | 120 | msgstr "" | ||
2215 | 121 | |||
2216 | 122 | #: ../scope/store/query.cpp:69 | ||
2217 | 123 | msgid "%1 results found" | ||
2218 | 124 | msgstr "" | ||
2219 | 125 | |||
2220 | 126 | #: ../scope/store/query.cpp:74 | ||
2221 | 127 | msgid "Use the searchbar to find software." | ||
2222 | 128 | msgstr "" | ||
2223 | 129 | |||
2224 | 130 | #: ../scope/store/query.cpp:75 | ||
2225 | 131 | msgid "No results found." | ||
2226 | 132 | msgstr "" | ||
2227 | 53 | 133 | ||
2228 | === modified file 'po/pt.po' | |||
2229 | --- po/pt.po 2016-08-25 06:10:07 +0000 | |||
2230 | +++ po/pt.po 2016-09-23 14:36:26 +0000 | |||
2231 | @@ -6,11 +6,12 @@ | |||
2232 | 6 | msgid "" | 6 | msgid "" |
2233 | 7 | msgstr "" | 7 | msgstr "" |
2234 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
2237 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
2238 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
2239 | 11 | "PO-Revision-Date: 2016-05-20 16:05+0000\n" | 11 | "PO-Revision-Date: 2016-05-20 16:05+0000\n" |
2240 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
2241 | 13 | "Language-Team: Portuguese <pt@li.org>\n" | 13 | "Language-Team: Portuguese <pt@li.org>\n" |
2242 | 14 | "Language: pt\n" | ||
2243 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
2244 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
2245 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
2246 | @@ -30,14 +31,77 @@ | |||
2247 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
2248 | 31 | msgstr "" | 32 | msgstr "" |
2249 | 32 | 33 | ||
2250 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
2251 | 35 | msgid "X Apps" | ||
2252 | 36 | msgstr "" | ||
2253 | 37 | |||
2254 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
2255 | 39 | msgid "Hidden X Apps" | ||
2256 | 40 | msgstr "" | ||
2257 | 41 | |||
2258 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
2259 | 43 | msgid "Exclude Apps: " | ||
2260 | 44 | msgstr "" | ||
2261 | 45 | |||
2262 | 46 | #. anonymous namespace | ||
2263 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
2264 | 48 | msgid "" | ||
2265 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
2266 | 50 | msgstr "" | ||
2267 | 51 | |||
2268 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
2269 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
2270 | 54 | msgstr "" | ||
2271 | 55 | |||
2272 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
2273 | 57 | msgid "Info" | ||
2274 | 58 | msgstr "" | ||
2275 | 59 | |||
2276 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
2277 | 61 | msgid "Install" | ||
2278 | 62 | msgstr "" | ||
2279 | 63 | |||
2280 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
2281 | 65 | msgid "Remove" | ||
2282 | 66 | msgstr "" | ||
2283 | 67 | |||
2284 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
2285 | 69 | msgid "Removing..." | ||
2286 | 70 | msgstr "" | ||
2287 | 71 | |||
2288 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
2289 | 73 | msgid "Installing..." | ||
2290 | 74 | msgstr "" | ||
2291 | 75 | |||
2292 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
2293 | 77 | msgid "Open" | ||
2294 | 78 | msgstr "" | ||
2295 | 79 | |||
2296 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
2297 | 81 | msgid "Publisher/Creator" | ||
2298 | 82 | msgstr "" | ||
2299 | 83 | |||
2300 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
2301 | 85 | msgid "Website" | ||
2302 | 86 | msgstr "" | ||
2303 | 87 | |||
2304 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
2305 | 89 | msgid "License" | ||
2306 | 90 | msgstr "" | ||
2307 | 91 | |||
2308 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
2309 | 93 | #: ../scope/apps/preview.cpp:55 | ||
2310 | 94 | msgid "Show" | ||
2311 | 95 | msgstr "" | ||
2312 | 96 | |||
2313 | 97 | #: ../scope/apps/preview.cpp:62 | ||
2314 | 98 | msgid "Hide" | ||
2315 | 99 | msgstr "" | ||
2316 | 100 | |||
2317 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
2318 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
2319 | 35 | msgstr "" | 103 | msgstr "" |
2320 | 36 | 104 | ||
2321 | 37 | #: ../scope/apps/query.cpp:43 | ||
2322 | 38 | msgid "Exclude Apps: " | ||
2323 | 39 | msgstr "" | ||
2324 | 40 | |||
2325 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
2326 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
2327 | 43 | msgid "" | 107 | msgid "" |
2328 | @@ -50,3 +114,19 @@ | |||
2329 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
2330 | 51 | "department." | 115 | "department." |
2331 | 52 | msgstr "" | 116 | msgstr "" |
2332 | 117 | |||
2333 | 118 | #: ../scope/store/query.cpp:68 | ||
2334 | 119 | msgid "%1 result found" | ||
2335 | 120 | msgstr "" | ||
2336 | 121 | |||
2337 | 122 | #: ../scope/store/query.cpp:69 | ||
2338 | 123 | msgid "%1 results found" | ||
2339 | 124 | msgstr "" | ||
2340 | 125 | |||
2341 | 126 | #: ../scope/store/query.cpp:74 | ||
2342 | 127 | msgid "Use the searchbar to find software." | ||
2343 | 128 | msgstr "" | ||
2344 | 129 | |||
2345 | 130 | #: ../scope/store/query.cpp:75 | ||
2346 | 131 | msgid "No results found." | ||
2347 | 132 | msgstr "" | ||
2348 | 53 | 133 | ||
2349 | === modified file 'po/uk.po' | |||
2350 | --- po/uk.po 2016-08-25 06:10:07 +0000 | |||
2351 | +++ po/uk.po 2016-09-23 14:36:26 +0000 | |||
2352 | @@ -6,11 +6,12 @@ | |||
2353 | 6 | msgid "" | 6 | msgid "" |
2354 | 7 | msgstr "" | 7 | msgstr "" |
2355 | 8 | "Project-Id-Version: libertine-scope\n" | 8 | "Project-Id-Version: libertine-scope\n" |
2358 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
2359 | 10 | "POT-Creation-Date: 2016-07-20 12:38-0400\n" | 10 | "POT-Creation-Date: 2016-08-26 14:45-0400\n" |
2360 | 11 | "PO-Revision-Date: 2016-05-20 15:56+0000\n" | 11 | "PO-Revision-Date: 2016-05-20 15:56+0000\n" |
2361 | 12 | "Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n" | 12 | "Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n" |
2362 | 13 | "Language-Team: Ukrainian <uk@li.org>\n" | 13 | "Language-Team: Ukrainian <uk@li.org>\n" |
2363 | 14 | "Language: uk\n" | ||
2364 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
2365 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
2366 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
2367 | @@ -30,14 +31,77 @@ | |||
2368 | 30 | msgid "Search apps" | 31 | msgid "Search apps" |
2369 | 31 | msgstr "" | 32 | msgstr "" |
2370 | 32 | 33 | ||
2371 | 34 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:38 | ||
2372 | 35 | msgid "X Apps" | ||
2373 | 36 | msgstr "" | ||
2374 | 37 | |||
2375 | 38 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:39 | ||
2376 | 39 | msgid "Hidden X Apps" | ||
2377 | 40 | msgstr "" | ||
2378 | 41 | |||
2379 | 42 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:43 ../scope/apps/query.cpp:43 | ||
2380 | 43 | msgid "Exclude Apps: " | ||
2381 | 44 | msgstr "" | ||
2382 | 45 | |||
2383 | 46 | #. anonymous namespace | ||
2384 | 47 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:113 | ||
2385 | 48 | msgid "" | ||
2386 | 49 | "No XApps available. Install new applications with the Libertine Manager." | ||
2387 | 50 | msgstr "" | ||
2388 | 51 | |||
2389 | 52 | #: ../.bzr/cobzr/store/scope/apps/query.cpp:114 | ||
2390 | 53 | msgid "All XApps hidden. Reset filters or check the Hidden XApps department." | ||
2391 | 54 | msgstr "" | ||
2392 | 55 | |||
2393 | 56 | #: ../lib/libertine-scope/preview.cpp:40 | ||
2394 | 57 | msgid "Info" | ||
2395 | 58 | msgstr "" | ||
2396 | 59 | |||
2397 | 60 | #: ../lib/libertine-scope/preview.cpp:41 | ||
2398 | 61 | msgid "Install" | ||
2399 | 62 | msgstr "" | ||
2400 | 63 | |||
2401 | 64 | #: ../lib/libertine-scope/preview.cpp:42 | ||
2402 | 65 | msgid "Remove" | ||
2403 | 66 | msgstr "" | ||
2404 | 67 | |||
2405 | 68 | #: ../lib/libertine-scope/preview.cpp:43 | ||
2406 | 69 | msgid "Removing..." | ||
2407 | 70 | msgstr "" | ||
2408 | 71 | |||
2409 | 72 | #: ../lib/libertine-scope/preview.cpp:44 | ||
2410 | 73 | msgid "Installing..." | ||
2411 | 74 | msgstr "" | ||
2412 | 75 | |||
2413 | 76 | #: ../lib/libertine-scope/preview.cpp:45 ../scope/apps/preview.cpp:47 | ||
2414 | 77 | msgid "Open" | ||
2415 | 78 | msgstr "" | ||
2416 | 79 | |||
2417 | 80 | #: ../lib/libertine-scope/preview.cpp:46 | ||
2418 | 81 | msgid "Publisher/Creator" | ||
2419 | 82 | msgstr "" | ||
2420 | 83 | |||
2421 | 84 | #: ../lib/libertine-scope/preview.cpp:47 | ||
2422 | 85 | msgid "Website" | ||
2423 | 86 | msgstr "" | ||
2424 | 87 | |||
2425 | 88 | #: ../lib/libertine-scope/preview.cpp:48 | ||
2426 | 89 | msgid "License" | ||
2427 | 90 | msgstr "" | ||
2428 | 91 | |||
2429 | 92 | #. Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | ||
2430 | 93 | #: ../scope/apps/preview.cpp:55 | ||
2431 | 94 | msgid "Show" | ||
2432 | 95 | msgstr "" | ||
2433 | 96 | |||
2434 | 97 | #: ../scope/apps/preview.cpp:62 | ||
2435 | 98 | msgid "Hide" | ||
2436 | 99 | msgstr "" | ||
2437 | 100 | |||
2438 | 33 | #: ../scope/apps/query.cpp:39 | 101 | #: ../scope/apps/query.cpp:39 |
2439 | 34 | msgid "Hidden Desktop Apps" | 102 | msgid "Hidden Desktop Apps" |
2440 | 35 | msgstr "" | 103 | msgstr "" |
2441 | 36 | 104 | ||
2442 | 37 | #: ../scope/apps/query.cpp:43 | ||
2443 | 38 | msgid "Exclude Apps: " | ||
2444 | 39 | msgstr "" | ||
2445 | 40 | |||
2446 | 41 | #. anonymous namespace | 105 | #. anonymous namespace |
2447 | 42 | #: ../scope/apps/query.cpp:113 | 106 | #: ../scope/apps/query.cpp:113 |
2448 | 43 | msgid "" | 107 | msgid "" |
2449 | @@ -50,3 +114,19 @@ | |||
2450 | 50 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " | 114 | "All applications hidden. Reset filters or check the Hidden Desktop Apps " |
2451 | 51 | "department." | 115 | "department." |
2452 | 52 | msgstr "" | 116 | msgstr "" |
2453 | 117 | |||
2454 | 118 | #: ../scope/store/query.cpp:68 | ||
2455 | 119 | msgid "%1 result found" | ||
2456 | 120 | msgstr "" | ||
2457 | 121 | |||
2458 | 122 | #: ../scope/store/query.cpp:69 | ||
2459 | 123 | msgid "%1 results found" | ||
2460 | 124 | msgstr "" | ||
2461 | 125 | |||
2462 | 126 | #: ../scope/store/query.cpp:74 | ||
2463 | 127 | msgid "Use the searchbar to find software." | ||
2464 | 128 | msgstr "" | ||
2465 | 129 | |||
2466 | 130 | #: ../scope/store/query.cpp:75 | ||
2467 | 131 | msgid "No results found." | ||
2468 | 132 | msgstr "" | ||
2469 | 53 | 133 | ||
2470 | === modified file 'scope/CMakeLists.txt' | |||
2471 | --- scope/CMakeLists.txt 2016-07-12 18:26:07 +0000 | |||
2472 | +++ scope/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
2473 | @@ -1,2 +1,2 @@ | |||
2474 | 1 | # add_subdirectory(libertine-store) | ||
2475 | 2 | add_subdirectory(apps) | 1 | add_subdirectory(apps) |
2476 | 2 | add_subdirectory(store) | ||
2477 | 3 | 3 | ||
2478 | === modified file 'scope/apps/CMakeLists.txt' | |||
2479 | --- scope/apps/CMakeLists.txt 2016-07-21 14:10:23 +0000 | |||
2480 | +++ scope/apps/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
2481 | @@ -1,8 +1,6 @@ | |||
2482 | 1 | set (CMAKE_INCLUDE_CURRENT_DIR ON) | 1 | set (CMAKE_INCLUDE_CURRENT_DIR ON) |
2483 | 2 | set (CMAKE_AUTOMOC ON) | 2 | set (CMAKE_AUTOMOC ON) |
2484 | 3 | 3 | ||
2485 | 4 | pkg_check_modules(URL_DISPATCHER REQUIRED url-dispatcher-1) | ||
2486 | 5 | |||
2487 | 6 | # Find all the sources | 4 | # Find all the sources |
2488 | 7 | file(GLOB_RECURSE SCOPE_SOURCES | 5 | file(GLOB_RECURSE SCOPE_SOURCES |
2489 | 8 | "*.cpp" | 6 | "*.cpp" |
2490 | @@ -13,14 +11,16 @@ | |||
2491 | 13 | ${SCOPE_SOURCES} | 11 | ${SCOPE_SOURCES} |
2492 | 14 | ) | 12 | ) |
2493 | 15 | 13 | ||
2494 | 16 | include_directories(${URL_DISPATCHER_INCLUDE_DIRS}) | ||
2495 | 17 | |||
2496 | 18 | target_link_libraries(apps | 14 | target_link_libraries(apps |
2497 | 15 | ${SCOPE_LIB_NAME} | ||
2498 | 19 | ${SCOPE_LDFLAGS} | 16 | ${SCOPE_LDFLAGS} |
2499 | 17 | ${LIBERTINE_LDFLAGS} | ||
2500 | 20 | ${UAL_LDFLAGS} | 18 | ${UAL_LDFLAGS} |
2501 | 21 | ${LIBERTINE_LDFLAGS} | ||
2502 | 22 | Qt5::Core | 19 | Qt5::Core |
2504 | 23 | ${URL_DISPATCHER_LIBRARIES} | 20 | ) |
2505 | 21 | |||
2506 | 22 | include_directories( | ||
2507 | 23 | ${CMAKE_SOURCE_DIR}/lib | ||
2508 | 24 | ) | 24 | ) |
2509 | 25 | 25 | ||
2510 | 26 | configure_file( | 26 | configure_file( |
2511 | 27 | 27 | ||
2512 | === modified file 'scope/apps/action.cpp' | |||
2513 | --- scope/apps/action.cpp 2016-07-29 13:21:34 +0000 | |||
2514 | +++ scope/apps/action.cpp 2016-09-23 14:36:26 +0000 | |||
2515 | @@ -21,50 +21,42 @@ | |||
2516 | 21 | #include "scope/apps/hidden_apps.h" | 21 | #include "scope/apps/hidden_apps.h" |
2517 | 22 | #include <unity/scopes/ActivationResponse.h> | 22 | #include <unity/scopes/ActivationResponse.h> |
2518 | 23 | #include <unity/scopes/CannedQuery.h> | 23 | #include <unity/scopes/CannedQuery.h> |
2519 | 24 | #include <url-dispatcher.h> | ||
2520 | 25 | #include <QString> | 24 | #include <QString> |
2521 | 26 | #include <QFile> | 25 | #include <QFile> |
2522 | 27 | #include <QTextStream> | 26 | #include <QTextStream> |
2523 | 28 | 27 | ||
2524 | 29 | namespace usc = unity::scopes; | ||
2525 | 30 | |||
2526 | 31 | 28 | ||
2527 | 32 | namespace | 29 | namespace |
2528 | 33 | { | 30 | { |
2531 | 34 | static usc::ActivationResponse | 31 | static unity::scopes::ActivationResponse |
2532 | 35 | sendToResults(usc::FilterState const& filter_state) | 32 | sendToResults(unity::scopes::FilterState const& filter_state) |
2533 | 36 | { | 33 | { |
2535 | 37 | usc::CannedQuery query(FULLY_QUALIFIED_APPS_SCOPE); | 34 | unity::scopes::CannedQuery query(FULLY_QUALIFIED_APPS_SCOPE); |
2536 | 38 | query.set_filter_state(filter_state); | 35 | query.set_filter_state(filter_state); |
2538 | 39 | return usc::ActivationResponse(query); | 36 | return unity::scopes::ActivationResponse(query); |
2539 | 40 | } | 37 | } |
2540 | 41 | } | 38 | } |
2541 | 42 | 39 | ||
2542 | 43 | 40 | ||
2543 | 44 | Action:: | 41 | Action:: |
2551 | 45 | Action(unity::scopes::Result const& result, | 42 | Action(unity::scopes::Result const& result, |
2552 | 46 | unity::scopes::ActionMetadata const& metadata, | 43 | unity::scopes::ActionMetadata const& metadata, |
2553 | 47 | std::string const& action_id, | 44 | std::string const& action_id, |
2554 | 48 | Action::OpenUriAction open_action, | 45 | std::shared_ptr<libertine::scope::ServiceManager> const& service, |
2555 | 49 | std::shared_ptr<HiddenApps> hidden, | 46 | std::shared_ptr<HiddenApps> const& hidden, |
2556 | 50 | unity::scopes::FilterState const& filter_state) | 47 | unity::scopes::FilterState const& filter_state) |
2557 | 51 | : usc::ActivationQueryBase(result, metadata) | 48 | : libertine::scope::Action(result, metadata, action_id, service) |
2558 | 52 | , action_id_(action_id) | 49 | , action_id_(action_id) |
2559 | 53 | , open_action_(open_action) | ||
2560 | 54 | , hidden_(hidden) | 50 | , hidden_(hidden) |
2561 | 55 | , filter_state_(filter_state) | 51 | , filter_state_(filter_state) |
2562 | 56 | { | 52 | { |
2563 | 57 | } | 53 | } |
2564 | 58 | 54 | ||
2565 | 59 | 55 | ||
2568 | 60 | usc::ActivationResponse | 56 | unity::scopes::ActivationResponse Action:: |
2569 | 61 | Action::activate() | 57 | activate() |
2570 | 62 | { | 58 | { |
2576 | 63 | if (action_id_ == "open") | 59 | if (action_id_ == "hide") |
2572 | 64 | { | ||
2573 | 65 | open_action_(result().uri()); | ||
2574 | 66 | } | ||
2575 | 67 | else if (action_id_ == "hide") | ||
2577 | 68 | { | 60 | { |
2578 | 69 | hidden_->add(QString::fromStdString(result()["app_id"].get_string())); | 61 | hidden_->add(QString::fromStdString(result()["app_id"].get_string())); |
2579 | 70 | return sendToResults(filter_state_); | 62 | return sendToResults(filter_state_); |
2580 | @@ -74,5 +66,6 @@ | |||
2581 | 74 | hidden_->remove(QString::fromStdString(result()["app_id"].get_string())); | 66 | hidden_->remove(QString::fromStdString(result()["app_id"].get_string())); |
2582 | 75 | return sendToResults(filter_state_); | 67 | return sendToResults(filter_state_); |
2583 | 76 | } | 68 | } |
2585 | 77 | return usc::ActivationResponse(usc::ActivationResponse::Status::NotHandled); | 69 | |
2586 | 70 | return libertine::scope::Action::activate(); | ||
2587 | 78 | } | 71 | } |
2588 | 79 | 72 | ||
2589 | === modified file 'scope/apps/action.h' | |||
2590 | --- scope/apps/action.h 2016-07-28 20:12:03 +0000 | |||
2591 | +++ scope/apps/action.h 2016-09-23 14:36:26 +0000 | |||
2592 | @@ -19,6 +19,7 @@ | |||
2593 | 19 | #define SCOPE_ACTION_H_ | 19 | #define SCOPE_ACTION_H_ |
2594 | 20 | 20 | ||
2595 | 21 | 21 | ||
2596 | 22 | #include <libertine-scope/action.h> | ||
2597 | 22 | #include <unity/scopes/ActionMetadata.h> | 23 | #include <unity/scopes/ActionMetadata.h> |
2598 | 23 | #include <unity/scopes/ActivationQueryBase.h> | 24 | #include <unity/scopes/ActivationQueryBase.h> |
2599 | 24 | #include <unity/scopes/ActivationResponse.h> | 25 | #include <unity/scopes/ActivationResponse.h> |
2600 | @@ -27,16 +28,16 @@ | |||
2601 | 27 | 28 | ||
2602 | 28 | class HiddenApps; | 29 | class HiddenApps; |
2603 | 29 | 30 | ||
2605 | 30 | class Action : public unity::scopes::ActivationQueryBase { | 31 | class Action : public libertine::scope::Action |
2606 | 32 | { | ||
2607 | 31 | public: | 33 | public: |
2616 | 32 | typedef std::function<void(std::string const&)> OpenUriAction; | 34 | explicit |
2617 | 33 | 35 | Action(unity::scopes::Result const& result, | |
2618 | 34 | explicit Action(unity::scopes::Result const& result, | 36 | unity::scopes::ActionMetadata const& metadata, |
2619 | 35 | unity::scopes::ActionMetadata const& metadata, | 37 | std::string const& action_id, |
2620 | 36 | std::string const& action_id, | 38 | std::shared_ptr<libertine::scope::ServiceManager> const& service, |
2621 | 37 | OpenUriAction open_action, | 39 | std::shared_ptr<HiddenApps> const& hidden, |
2622 | 38 | std::shared_ptr<HiddenApps> hidden, | 40 | unity::scopes::FilterState const& filterState); |
2615 | 39 | unity::scopes::FilterState const& filterState); | ||
2623 | 40 | 41 | ||
2624 | 41 | virtual ~Action() = default; | 42 | virtual ~Action() = default; |
2625 | 42 | virtual unity::scopes::ActivationResponse activate() override; | 43 | virtual unity::scopes::ActivationResponse activate() override; |
2626 | @@ -44,7 +45,6 @@ | |||
2627 | 44 | private: | 45 | private: |
2628 | 45 | std::string action_id_; | 46 | std::string action_id_; |
2629 | 46 | std::string cache_dir_; | 47 | std::string cache_dir_; |
2630 | 47 | OpenUriAction open_action_; | ||
2631 | 48 | std::shared_ptr<HiddenApps> hidden_; | 48 | std::shared_ptr<HiddenApps> hidden_; |
2632 | 49 | unity::scopes::FilterState filter_state_; | 49 | unity::scopes::FilterState filter_state_; |
2633 | 50 | }; | 50 | }; |
2634 | 51 | 51 | ||
2635 | === modified file 'scope/apps/applauncher.cpp' | |||
2636 | --- scope/apps/applauncher.cpp 2016-07-12 18:26:07 +0000 | |||
2637 | +++ scope/apps/applauncher.cpp 2016-09-23 14:36:26 +0000 | |||
2638 | @@ -26,20 +26,11 @@ | |||
2639 | 26 | name_ = app->info()->name().value(); | 26 | name_ = app->info()->name().value(); |
2640 | 27 | icon_ = app->info()->iconPath().value(); | 27 | icon_ = app->info()->iconPath().value(); |
2641 | 28 | description_ = app->info()->description().value(); | 28 | description_ = app->info()->description().value(); |
2642 | 29 | id_ = appId.appname.value() + ".desktop"; | ||
2643 | 29 | uri_ = "appid://" + container_id + "/" + appId.appname.value() + "/0.0"; | 30 | uri_ = "appid://" + container_id + "/" + appId.appname.value() + "/0.0"; |
2644 | 30 | } | 31 | } |
2645 | 31 | 32 | ||
2646 | 32 | 33 | ||
2647 | 33 | AppLauncher:: | ||
2648 | 34 | AppLauncher() { /* empty */ } | ||
2649 | 35 | |||
2650 | 36 | |||
2651 | 37 | AppLauncher:: | ||
2652 | 38 | ~AppLauncher() | ||
2653 | 39 | { | ||
2654 | 40 | } | ||
2655 | 41 | |||
2656 | 42 | |||
2657 | 43 | std::string AppLauncher:: | 34 | std::string AppLauncher:: |
2658 | 44 | name() const | 35 | name() const |
2659 | 45 | { | 36 | { |
2660 | @@ -67,3 +58,10 @@ | |||
2661 | 67 | return uri_; | 58 | return uri_; |
2662 | 68 | } | 59 | } |
2663 | 69 | 60 | ||
2664 | 61 | |||
2665 | 62 | std::string AppLauncher:: | ||
2666 | 63 | id() const | ||
2667 | 64 | { | ||
2668 | 65 | return id_; | ||
2669 | 66 | } | ||
2670 | 67 | |||
2671 | 70 | 68 | ||
2672 | === modified file 'scope/apps/applauncher.h' | |||
2673 | --- scope/apps/applauncher.h 2016-05-03 13:25:14 +0000 | |||
2674 | +++ scope/apps/applauncher.h 2016-09-23 14:36:26 +0000 | |||
2675 | @@ -33,7 +33,7 @@ | |||
2676 | 33 | AppLauncher(const std::string& app_id, const std::string& container_name); | 33 | AppLauncher(const std::string& app_id, const std::string& container_name); |
2677 | 34 | 34 | ||
2678 | 35 | virtual | 35 | virtual |
2680 | 36 | ~AppLauncher(); | 36 | ~AppLauncher() = default; |
2681 | 37 | 37 | ||
2682 | 38 | virtual std::string | 38 | virtual std::string |
2683 | 39 | name() const; | 39 | name() const; |
2684 | @@ -47,14 +47,18 @@ | |||
2685 | 47 | virtual std::string | 47 | virtual std::string |
2686 | 48 | uri() const; | 48 | uri() const; |
2687 | 49 | 49 | ||
2688 | 50 | virtual std::string | ||
2689 | 51 | id() const; | ||
2690 | 52 | |||
2691 | 50 | protected: | 53 | protected: |
2692 | 51 | explicit | 54 | explicit |
2694 | 52 | AppLauncher(); | 55 | AppLauncher() = default; |
2695 | 53 | 56 | ||
2696 | 54 | std::string name_; | 57 | std::string name_; |
2697 | 55 | std::string icon_; | 58 | std::string icon_; |
2698 | 56 | std::string uri_; | 59 | std::string uri_; |
2699 | 57 | std::string description_; | 60 | std::string description_; |
2700 | 61 | std::string id_; | ||
2701 | 58 | }; | 62 | }; |
2702 | 59 | 63 | ||
2703 | 60 | #endif /* LIBERTINE_SCOPE_APPLAUNCHER_H */ | 64 | #endif /* LIBERTINE_SCOPE_APPLAUNCHER_H */ |
2704 | 61 | 65 | ||
2705 | === modified file 'scope/apps/config.h.in' | |||
2706 | --- scope/apps/config.h.in 2016-07-29 13:21:34 +0000 | |||
2707 | +++ scope/apps/config.h.in 2016-09-23 14:36:26 +0000 | |||
2708 | @@ -17,7 +17,9 @@ | |||
2709 | 17 | #define LIBERTINE_SCOPE_CONFIG_H_ | 17 | #define LIBERTINE_SCOPE_CONFIG_H_ |
2710 | 18 | 18 | ||
2711 | 19 | const std::string FULLY_QUALIFIED_APPS_SCOPE = "@FULLY_QUALIFIED_NAME@"; | 19 | const std::string FULLY_QUALIFIED_APPS_SCOPE = "@FULLY_QUALIFIED_NAME@"; |
2712 | 20 | const std::string STORE_SCOPE_FULL_NAME = "@STORE_PACKAGE_NAME@"; | ||
2713 | 20 | const std::string ROOT_DEPT_ID = "root_dept"; | 21 | const std::string ROOT_DEPT_ID = "root_dept"; |
2714 | 21 | const std::string HIDDEN_DEPT_ID = "hidden_dept"; | 22 | const std::string HIDDEN_DEPT_ID = "hidden_dept"; |
2715 | 23 | const std::string DATA_DIR = "@APPS_DATA_DIR@"; | ||
2716 | 22 | 24 | ||
2717 | 23 | #endif // LIBERTINE_SCOPE_CONFIG_H_ | 25 | #endif // LIBERTINE_SCOPE_CONFIG_H_ |
2718 | 24 | 26 | ||
2719 | === modified file 'scope/apps/libertine.cpp' | |||
2720 | --- scope/apps/libertine.cpp 2016-07-28 14:04:27 +0000 | |||
2721 | +++ scope/apps/libertine.cpp 2016-09-23 14:36:26 +0000 | |||
2722 | @@ -19,6 +19,7 @@ | |||
2723 | 19 | #include <liblibertine/libertine.h> | 19 | #include <liblibertine/libertine.h> |
2724 | 20 | #include <glib.h> | 20 | #include <glib.h> |
2725 | 21 | 21 | ||
2726 | 22 | |||
2727 | 22 | namespace | 23 | namespace |
2728 | 23 | { | 24 | { |
2729 | 24 | 25 | ||
2730 | 25 | 26 | ||
2731 | === removed file 'scope/apps/localization.h' | |||
2732 | --- scope/apps/localization.h 2015-12-29 21:50:58 +0000 | |||
2733 | +++ scope/apps/localization.h 1970-01-01 00:00:00 +0000 | |||
2734 | @@ -1,31 +0,0 @@ | |||
2735 | 1 | #ifndef LOCALIZATION_H_ | ||
2736 | 2 | #define LOCALIZATION_H_ | ||
2737 | 3 | |||
2738 | 4 | #include <libintl.h> | ||
2739 | 5 | #include <string> | ||
2740 | 6 | |||
2741 | 7 | |||
2742 | 8 | inline char* | ||
2743 | 9 | _(const char *__msgid) | ||
2744 | 10 | { | ||
2745 | 11 | return dgettext(GETTEXT_PACKAGE, __msgid); | ||
2746 | 12 | } | ||
2747 | 13 | |||
2748 | 14 | |||
2749 | 15 | inline std::string | ||
2750 | 16 | _(char const*__msgid1, char const*__msgid2, unsigned long int __n) | ||
2751 | 17 | { | ||
2752 | 18 | char buffer [256]; | ||
2753 | 19 | if (snprintf(buffer, 256, dngettext(GETTEXT_PACKAGE, __msgid1, __msgid2, __n), __n ) >= 0) | ||
2754 | 20 | { | ||
2755 | 21 | return buffer; | ||
2756 | 22 | } | ||
2757 | 23 | else | ||
2758 | 24 | { | ||
2759 | 25 | return std::string(); | ||
2760 | 26 | } | ||
2761 | 27 | } | ||
2762 | 28 | |||
2763 | 29 | #endif // LOCALIZATION_H_ | ||
2764 | 30 | |||
2765 | 31 | |||
2766 | 32 | 0 | ||
2767 | === modified file 'scope/apps/preview.cpp' | |||
2768 | --- scope/apps/preview.cpp 2016-07-12 18:26:07 +0000 | |||
2769 | +++ scope/apps/preview.cpp 2016-09-23 14:36:26 +0000 | |||
2770 | @@ -13,9 +13,11 @@ | |||
2771 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
2772 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2773 | 15 | */ | 15 | */ |
2774 | 16 | |||
2775 | 17 | #include "scope/apps/preview.h" | 16 | #include "scope/apps/preview.h" |
2776 | 17 | |||
2777 | 18 | #include "scope/apps/config.h" | 18 | #include "scope/apps/config.h" |
2778 | 19 | #include "scope/apps/hidden_apps.h" | ||
2779 | 20 | #include <libertine-scope/i18n.h> | ||
2780 | 19 | #include <unity/scopes/PreviewReply.h> | 21 | #include <unity/scopes/PreviewReply.h> |
2781 | 20 | #include <unity/scopes/Variant.h> | 22 | #include <unity/scopes/Variant.h> |
2782 | 21 | #include <unity/scopes/VariantBuilder.h> | 23 | #include <unity/scopes/VariantBuilder.h> |
2783 | @@ -24,64 +26,42 @@ | |||
2784 | 24 | 26 | ||
2785 | 25 | namespace usc = unity::scopes; | 27 | namespace usc = unity::scopes; |
2786 | 26 | 28 | ||
2816 | 27 | Preview:: | 29 | |
2817 | 28 | Preview(usc::Result const& result, | 30 | Preview:: |
2818 | 29 | usc::ActionMetadata const& metadata) | 31 | Preview(usc::Result const& result, |
2819 | 30 | : PreviewQueryBase(result, metadata) | 32 | usc::ActionMetadata const& metadata, |
2820 | 31 | { | 33 | std::shared_ptr<libertine::scope::ServiceManager> const& service, |
2821 | 32 | } | 34 | std::shared_ptr<HiddenApps> const& hidden) |
2822 | 33 | 35 | : libertine::scope::Preview(result, metadata, service) | |
2823 | 34 | 36 | , hidden_(hidden) | |
2824 | 35 | Preview:: | 37 | { |
2825 | 36 | ~Preview() | 38 | } |
2826 | 37 | { | 39 | |
2827 | 38 | } | 40 | |
2828 | 39 | 41 | unity::scopes::PreviewWidget Preview::buttonWidgets(libertine::scope::Package const&) const | |
2829 | 40 | 42 | { | |
2830 | 41 | void Preview:: | 43 | usc::PreviewWidget buttons("actions", "actions"); |
2802 | 42 | cancelled() | ||
2803 | 43 | { | ||
2804 | 44 | } | ||
2805 | 45 | |||
2806 | 46 | |||
2807 | 47 | void Preview:: | ||
2808 | 48 | run(usc::PreviewReplyProxy const& reply) | ||
2809 | 49 | { | ||
2810 | 50 | usc::PreviewWidget header("hdr", "header"); | ||
2811 | 51 | header.add_attribute_mapping("title", "title"); | ||
2812 | 52 | header.add_attribute_mapping("mascot", "art"); | ||
2813 | 53 | header.add_attribute_value("fallback", usc::Variant("image://theme/placeholder-app-icon")); | ||
2814 | 54 | |||
2815 | 55 | usc::PreviewWidget buttons("buttons", "actions"); | ||
2831 | 56 | usc::VariantBuilder vb; | 44 | usc::VariantBuilder vb; |
2832 | 57 | vb.add_tuple({ | 45 | vb.add_tuple({ |
2833 | 58 | {"id", usc::Variant("open")}, | 46 | {"id", usc::Variant("open")}, |
2835 | 59 | {"label", usc::Variant("Open")}, | 47 | {"label", usc::Variant(_("Open"))} |
2836 | 60 | }); | 48 | }); |
2837 | 61 | 49 | ||
2855 | 62 | if (result().contains("department_id")) | 50 | if (hidden_->app_is_hidden(QString::fromStdString(result()["app_id"].get_string()))) |
2856 | 63 | { | 51 | { |
2857 | 64 | if (result()["department_id"].get_string() == ROOT_DEPT_ID) | 52 | vb.add_tuple({ |
2858 | 65 | { | 53 | {"id", usc::Variant("show")}, |
2859 | 66 | vb.add_tuple({ | 54 | //Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide |
2860 | 67 | {"id", usc::Variant("hide")}, | 55 | {"label", usc::Variant(_("Show"))}, |
2861 | 68 | {"label", usc::Variant("Hide")}, | 56 | }); |
2862 | 69 | }); | 57 | } |
2863 | 70 | } | 58 | else |
2864 | 71 | else | 59 | { |
2865 | 72 | { | 60 | vb.add_tuple({ |
2866 | 73 | vb.add_tuple({ | 61 | {"id", usc::Variant("hide")}, |
2867 | 74 | {"id", usc::Variant("show")}, | 62 | {"label", usc::Variant(_("Hide"))}, |
2868 | 75 | //Translators: Users tap "Show" button to remove an app from the hidden list of apps: so the meaning is to undo a hide | 63 | }); |
2852 | 76 | {"label", usc::Variant("Show")}, | ||
2853 | 77 | }); | ||
2854 | 78 | } | ||
2869 | 79 | } | 64 | } |
2870 | 80 | buttons.add_attribute_value("actions", vb.end()); | 65 | buttons.add_attribute_value("actions", vb.end()); |
2877 | 81 | 66 | return buttons; | |
2872 | 82 | usc::PreviewWidget desc("desc", "text"); | ||
2873 | 83 | desc.add_attribute_mapping("text", "description"); | ||
2874 | 84 | |||
2875 | 85 | usc::PreviewWidgetList widgets{ header, desc, buttons }; | ||
2876 | 86 | reply->push(widgets); | ||
2878 | 87 | } | 67 | } |
2879 | 88 | 68 | ||
2880 | === modified file 'scope/apps/preview.h' | |||
2881 | --- scope/apps/preview.h 2016-06-10 15:11:56 +0000 | |||
2882 | +++ scope/apps/preview.h 2016-09-23 14:36:26 +0000 | |||
2883 | @@ -13,26 +13,31 @@ | |||
2884 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
2885 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2886 | 15 | */ | 15 | */ |
2890 | 16 | #ifndef LIBERTINE_SCOPE_PREVIEW_H | 16 | #pragma once |
2891 | 17 | #define LIBERTINE_SCOPE_PREVIEW_H | 17 | |
2892 | 18 | 18 | ||
2893 | 19 | #include <libertine-scope/preview.h> | ||
2894 | 19 | #include <unity/scopes/PreviewQueryBase.h> | 20 | #include <unity/scopes/PreviewQueryBase.h> |
2895 | 20 | 21 | ||
2896 | 22 | class HiddenApps; | ||
2897 | 23 | |||
2898 | 21 | 24 | ||
2899 | 22 | class Preview | 25 | class Preview |
2901 | 23 | : public unity::scopes::PreviewQueryBase | 26 | : public libertine::scope::Preview |
2902 | 24 | { | 27 | { |
2903 | 25 | public: | 28 | public: |
2914 | 26 | Preview(unity::scopes::Result const& result, | 29 | explicit |
2915 | 27 | unity::scopes::ActionMetadata const& metadata); | 30 | Preview(unity::scopes::Result const& result, |
2916 | 28 | 31 | unity::scopes::ActionMetadata const& metadata, | |
2917 | 29 | virtual ~Preview(); | 32 | std::shared_ptr<libertine::scope::ServiceManager> const& service, |
2918 | 30 | 33 | std::shared_ptr<HiddenApps> const& hidden); | |
2919 | 31 | void | 34 | |
2920 | 32 | cancelled() override; | 35 | virtual ~Preview() = default; |
2921 | 33 | 36 | ||
2922 | 34 | void | 37 | protected: |
2923 | 35 | run(unity::scopes::PreviewReplyProxy const& reply) override; | 38 | virtual unity::scopes::PreviewWidget |
2924 | 39 | buttonWidgets(const libertine::scope::Package &package) const override; | ||
2925 | 40 | |||
2926 | 41 | private: | ||
2927 | 42 | std::shared_ptr<HiddenApps> hidden_; | ||
2928 | 36 | }; | 43 | }; |
2929 | 37 | |||
2930 | 38 | #endif /* LIBERTINE_SCOPE_PREVIEW_H */ | ||
2931 | 39 | 44 | ||
2932 | === modified file 'scope/apps/query.cpp' | |||
2933 | --- scope/apps/query.cpp 2016-07-28 14:04:27 +0000 | |||
2934 | +++ scope/apps/query.cpp 2016-09-23 14:36:26 +0000 | |||
2935 | @@ -17,7 +17,7 @@ | |||
2936 | 17 | #include "scope/apps/query.h" | 17 | #include "scope/apps/query.h" |
2937 | 18 | #include "scope/apps/container.h" | 18 | #include "scope/apps/container.h" |
2938 | 19 | #include "scope/apps/config.h" | 19 | #include "scope/apps/config.h" |
2940 | 20 | #include "scope/apps/localization.h" | 20 | #include <libertine-scope/i18n.h> |
2941 | 21 | #include <unity/scopes/CategorisedResult.h> | 21 | #include <unity/scopes/CategorisedResult.h> |
2942 | 22 | #include <unity/scopes/CategoryRenderer.h> | 22 | #include <unity/scopes/CategoryRenderer.h> |
2943 | 23 | #include <unity/scopes/QueryBase.h> | 23 | #include <unity/scopes/QueryBase.h> |
2944 | @@ -31,8 +31,10 @@ | |||
2945 | 31 | #include <QFile> | 31 | #include <QFile> |
2946 | 32 | #include <QTextStream> | 32 | #include <QTextStream> |
2947 | 33 | 33 | ||
2948 | 34 | |||
2949 | 34 | namespace usc = unity::scopes; | 35 | namespace usc = unity::scopes; |
2950 | 35 | 36 | ||
2951 | 37 | |||
2952 | 36 | namespace | 38 | namespace |
2953 | 37 | { | 39 | { |
2954 | 38 | static const auto ROOT_DEPT_TITLE = _("Desktop Apps"); | 40 | static const auto ROOT_DEPT_TITLE = _("Desktop Apps"); |
2955 | @@ -41,6 +43,8 @@ | |||
2956 | 41 | static const auto APP_ID_FIELD = "app_id"; | 43 | static const auto APP_ID_FIELD = "app_id"; |
2957 | 42 | static const auto DEPARTMENT_ID_FIELD = "department_id"; | 44 | static const auto DEPARTMENT_ID_FIELD = "department_id"; |
2958 | 43 | static const auto EXCLUDED_APPS_FILTER_TITLE = _("Exclude Apps: "); | 45 | static const auto EXCLUDED_APPS_FILTER_TITLE = _("Exclude Apps: "); |
2959 | 46 | static const auto SEARCH_STORE_HINT = _("Search for '%s' in the store"); | ||
2960 | 47 | static const auto SEARCH_STORE_CATEGORY_TITLE = _("Get more apps from the store"); | ||
2961 | 44 | 48 | ||
2962 | 45 | struct AppInfo | 49 | struct AppInfo |
2963 | 46 | { | 50 | { |
2964 | @@ -107,23 +111,45 @@ | |||
2965 | 107 | } | 111 | } |
2966 | 108 | } | 112 | } |
2967 | 109 | )"; | 113 | )"; |
2968 | 114 | |||
2969 | 115 | |||
2970 | 116 | static const auto CATEGORY_STORE = R"( | ||
2971 | 117 | { | ||
2972 | 118 | "schema-version": 1, | ||
2973 | 119 | "template": { | ||
2974 | 120 | "category-layout": "grid", | ||
2975 | 121 | "overlay": true, | ||
2976 | 122 | "card-background": "color:///#E95420" | ||
2977 | 123 | }, | ||
2978 | 124 | "components": { | ||
2979 | 125 | "title": "title", | ||
2980 | 126 | "art": { | ||
2981 | 127 | "aspect-ratio": 0.55, | ||
2982 | 128 | "field": "art" | ||
2983 | 129 | }, | ||
2984 | 130 | "overlay-color": "overlay-color" | ||
2985 | 131 | } | ||
2986 | 132 | } | ||
2987 | 133 | )"; | ||
2988 | 110 | } // anonymous namespace | 134 | } // anonymous namespace |
2989 | 111 | 135 | ||
2990 | 112 | 136 | ||
2993 | 113 | std::string const Query::NO_RESULTS_HINT = _("No applications available. Install new applications with the Libertine Manager."); | 137 | std::string const Query::NO_RESULTS_HINT = _("No applications available in this department."); |
2994 | 114 | std::string const Query::ALL_RESULTS_FILTERED_HINT = _("All applications hidden. Reset filters or check the Hidden Desktop Apps department."); | 138 | std::string const Query::ALL_RESULTS_FILTERED_HINT = _("All applications filtered. Reset filters or clear department."); |
2995 | 115 | 139 | ||
2996 | 116 | 140 | ||
2997 | 117 | Query:: | 141 | Query:: |
3001 | 118 | Query(usc::CannedQuery const& query, | 142 | Query(usc::CannedQuery const& query, |
3002 | 119 | usc::SearchMetadata const& metadata, | 143 | usc::SearchMetadata const& metadata, |
3003 | 120 | Libertine::Factory const& libertine_factory, | 144 | Libertine::Factory const& libertine_factory, |
3004 | 121 | std::shared_ptr<HiddenApps> hidden, | 145 | std::shared_ptr<HiddenApps> hidden, |
3006 | 122 | std::shared_ptr<Blacklist> blacklist) | 146 | std::shared_ptr<Blacklist> blacklist, |
3007 | 147 | std::string const& data_directory) | ||
3008 | 123 | : usc::SearchQueryBase(query, metadata) | 148 | : usc::SearchQueryBase(query, metadata) |
3009 | 124 | , libertine_factory_(libertine_factory) | 149 | , libertine_factory_(libertine_factory) |
3010 | 125 | , hidden_(hidden) | 150 | , hidden_(hidden) |
3011 | 126 | , blacklist_(blacklist) | 151 | , blacklist_(blacklist) |
3012 | 152 | , data_directory_(data_directory) | ||
3013 | 127 | { | 153 | { |
3014 | 128 | } | 154 | } |
3015 | 129 | 155 | ||
3016 | @@ -201,6 +227,35 @@ | |||
3017 | 201 | 227 | ||
3018 | 202 | 228 | ||
3019 | 203 | void Query:: | 229 | void Query:: |
3020 | 230 | add_store_link(usc::SearchReplyProxy const& reply) const | ||
3021 | 231 | { | ||
3022 | 232 | const auto querystr = query().query_string(); | ||
3023 | 233 | auto cat_title = SEARCH_STORE_CATEGORY_TITLE; | ||
3024 | 234 | |||
3025 | 235 | if (!querystr.empty()) | ||
3026 | 236 | { | ||
3027 | 237 | char tmp[512]; | ||
3028 | 238 | if (snprintf(tmp, sizeof(tmp), SEARCH_STORE_HINT.c_str(), querystr.c_str()) > 0) | ||
3029 | 239 | { | ||
3030 | 240 | cat_title = tmp; | ||
3031 | 241 | } | ||
3032 | 242 | } | ||
3033 | 243 | |||
3034 | 244 | usc::CategoryRenderer rdr(CATEGORY_STORE); | ||
3035 | 245 | auto cat = reply->register_category("hint", cat_title, "", rdr); | ||
3036 | 246 | |||
3037 | 247 | const unity::scopes::CannedQuery store_scope(STORE_SCOPE_FULL_NAME, querystr, ""); | ||
3038 | 248 | |||
3039 | 249 | usc::CategorisedResult res(cat); | ||
3040 | 250 | res.set_title(_("Install X Apps")); | ||
3041 | 251 | res.set_art(data_directory_ + "/store.svg"); | ||
3042 | 252 | res.set_uri(store_scope.to_uri()); | ||
3043 | 253 | res["overlay-color"] = "transparent"; | ||
3044 | 254 | reply->push(res); | ||
3045 | 255 | } | ||
3046 | 256 | |||
3047 | 257 | |||
3048 | 258 | void Query:: | ||
3049 | 204 | run(usc::SearchReplyProxy const& reply) | 259 | run(usc::SearchReplyProxy const& reply) |
3050 | 205 | { | 260 | { |
3051 | 206 | if (!hidden_->empty()) | 261 | if (!hidden_->empty()) |
3052 | @@ -219,7 +274,8 @@ | |||
3053 | 219 | 274 | ||
3054 | 220 | QRegExp search_query(QString::fromStdString(query().query_string()), Qt::CaseInsensitive); | 275 | QRegExp search_query(QString::fromStdString(query().query_string()), Qt::CaseInsensitive); |
3055 | 221 | bool has_no_apps = true, | 276 | bool has_no_apps = true, |
3057 | 222 | all_filtered = true; | 277 | all_filtered = true, |
3058 | 278 | is_hidden_dept = query().department_id() == HIDDEN_DEPT_ID; | ||
3059 | 223 | 279 | ||
3060 | 224 | for (auto const& container: libertine->get_container_list()) | 280 | for (auto const& container: libertine->get_container_list()) |
3061 | 225 | { | 281 | { |
3062 | @@ -230,44 +286,41 @@ | |||
3063 | 230 | 286 | ||
3064 | 231 | for (auto const& app: container->app_launchers()) | 287 | for (auto const& app: container->app_launchers()) |
3065 | 232 | { | 288 | { |
3066 | 289 | auto app_info = parse_app_info(app.uri()); | ||
3067 | 290 | |||
3068 | 291 | // ignore blacklisted apps | ||
3069 | 292 | if (blacklist_->app_is_blacklisted(app_info.app_id, container->id())) | ||
3070 | 293 | { | ||
3071 | 294 | continue; | ||
3072 | 295 | } | ||
3073 | 296 | |||
3074 | 297 | // ignore hidden apps unless in hidden dept | ||
3075 | 298 | if ((!is_hidden_dept && hidden_->app_is_hidden(app_info.key)) || | ||
3076 | 299 | (is_hidden_dept && !hidden_->app_is_hidden(app_info.key))) | ||
3077 | 300 | { | ||
3078 | 301 | continue; | ||
3079 | 302 | } | ||
3080 | 303 | |||
3081 | 233 | has_no_apps = false; | 304 | has_no_apps = false; |
3082 | 305 | |||
3083 | 234 | if (!(search_query.isEmpty() || QString::fromStdString(app.name()).contains(search_query))) | 306 | if (!(search_query.isEmpty() || QString::fromStdString(app.name()).contains(search_query))) |
3084 | 235 | { | 307 | { |
3085 | 236 | continue; | 308 | continue; |
3086 | 237 | } | 309 | } |
3087 | 238 | 310 | ||
3088 | 239 | auto app_info = parse_app_info(app.uri()); | ||
3089 | 240 | |||
3090 | 241 | if (blacklist_->app_is_blacklisted(app_info.app_id, container->id())) | ||
3091 | 242 | { | ||
3092 | 243 | continue; | ||
3093 | 244 | } | ||
3094 | 245 | |||
3095 | 246 | if (excludes_by_filter.contains(app_info.key)) | 311 | if (excludes_by_filter.contains(app_info.key)) |
3096 | 247 | { | 312 | { |
3097 | 248 | continue; | 313 | continue; |
3098 | 249 | } | 314 | } |
3099 | 250 | 315 | ||
3100 | 251 | // ignore hidden apps in root department | ||
3101 | 252 | if (query().department_id().empty() || query().department_id() == ROOT_DEPT_ID) | ||
3102 | 253 | { | ||
3103 | 254 | if (hidden_->app_is_hidden(app_info.key)) | ||
3104 | 255 | { | ||
3105 | 256 | continue; | ||
3106 | 257 | } | ||
3107 | 258 | } | ||
3108 | 259 | else if (!hidden_->app_is_hidden(app_info.key)) | ||
3109 | 260 | { | ||
3110 | 261 | continue; | ||
3111 | 262 | } | ||
3112 | 263 | |||
3113 | 264 | usc::CategorisedResult result(category); | 316 | usc::CategorisedResult result(category); |
3114 | 265 | result.set_title(app.name()); | 317 | result.set_title(app.name()); |
3115 | 266 | result.set_art(app.icon()); | 318 | result.set_art(app.icon()); |
3116 | 267 | result.set_uri(app.uri()); | 319 | result.set_uri(app.uri()); |
3117 | 268 | result[DESCRIPTION_FIELD] = app.description(); | 320 | result[DESCRIPTION_FIELD] = app.description(); |
3118 | 269 | result[APP_ID_FIELD] = app_info.key.toStdString(); | 321 | result[APP_ID_FIELD] = app_info.key.toStdString(); |
3120 | 270 | result[DEPARTMENT_ID_FIELD] = (query().department_id().empty() || query().department_id() == ROOT_DEPT_ID) ? ROOT_DEPT_ID : HIDDEN_DEPT_ID; | 322 | result["id"] = app.id(); |
3121 | 323 | result[DEPARTMENT_ID_FIELD] = is_hidden_dept ? HIDDEN_DEPT_ID : ROOT_DEPT_ID; | ||
3122 | 271 | 324 | ||
3123 | 272 | if (!reply->push(result)) | 325 | if (!reply->push(result)) |
3124 | 273 | { | 326 | { |
3125 | @@ -278,12 +331,19 @@ | |||
3126 | 278 | } | 331 | } |
3127 | 279 | } | 332 | } |
3128 | 280 | 333 | ||
3130 | 281 | if (has_no_apps) | 334 | if (is_hidden_dept) |
3131 | 282 | { | 335 | { |
3133 | 283 | show_hint(reply, NO_RESULTS_HINT); | 336 | if (has_no_apps) |
3134 | 337 | { | ||
3135 | 338 | show_hint(reply, NO_RESULTS_HINT); | ||
3136 | 339 | } | ||
3137 | 340 | else if (all_filtered) | ||
3138 | 341 | { | ||
3139 | 342 | show_hint(reply, ALL_RESULTS_FILTERED_HINT); | ||
3140 | 343 | } | ||
3141 | 284 | } | 344 | } |
3143 | 285 | else if (all_filtered) | 345 | else |
3144 | 286 | { | 346 | { |
3146 | 287 | show_hint(reply, ALL_RESULTS_FILTERED_HINT); | 347 | add_store_link(reply); |
3147 | 288 | } | 348 | } |
3148 | 289 | } | 349 | } |
3149 | 290 | 350 | ||
3150 | === modified file 'scope/apps/query.h' | |||
3151 | --- scope/apps/query.h 2016-07-28 14:04:27 +0000 | |||
3152 | +++ scope/apps/query.h 2016-09-23 14:36:26 +0000 | |||
3153 | @@ -35,7 +35,8 @@ | |||
3154 | 35 | unity::scopes::SearchMetadata const& metadata, | 35 | unity::scopes::SearchMetadata const& metadata, |
3155 | 36 | Libertine::Factory const& libertine_factory, | 36 | Libertine::Factory const& libertine_factory, |
3156 | 37 | std::shared_ptr<HiddenApps> hidden_apps, | 37 | std::shared_ptr<HiddenApps> hidden_apps, |
3158 | 38 | std::shared_ptr<Blacklist> blacklist); | 38 | std::shared_ptr<Blacklist> blacklist, |
3159 | 39 | std::string const& data_directory); | ||
3160 | 39 | 40 | ||
3161 | 40 | ~Query() = default; | 41 | ~Query() = default; |
3162 | 41 | 42 | ||
3163 | @@ -53,10 +54,12 @@ | |||
3164 | 53 | QStringList make_filters(unity::scopes::SearchReplyProxy const& reply, Libertine::UPtr libertine) const; | 54 | QStringList make_filters(unity::scopes::SearchReplyProxy const& reply, Libertine::UPtr libertine) const; |
3165 | 54 | void show_hint(unity::scopes::SearchReplyProxy const& reply, std::string const& reason) const; | 55 | void show_hint(unity::scopes::SearchReplyProxy const& reply, std::string const& reason) const; |
3166 | 55 | void parse_blacklist(const std::string& data_dir); | 56 | void parse_blacklist(const std::string& data_dir); |
3167 | 57 | void add_store_link(unity::scopes::SearchReplyProxy const& reply) const; | ||
3168 | 56 | 58 | ||
3169 | 57 | Libertine::Factory libertine_factory_; | 59 | Libertine::Factory libertine_factory_; |
3170 | 58 | std::shared_ptr<HiddenApps> hidden_; | 60 | std::shared_ptr<HiddenApps> hidden_; |
3171 | 59 | std::shared_ptr<Blacklist> blacklist_; | 61 | std::shared_ptr<Blacklist> blacklist_; |
3172 | 62 | const std::string data_directory_; | ||
3173 | 60 | }; | 63 | }; |
3174 | 61 | 64 | ||
3175 | 62 | #endif // LIBERTINE_SCOPE_QUERY_H_ | 65 | #endif // LIBERTINE_SCOPE_QUERY_H_ |
3176 | 63 | 66 | ||
3177 | === modified file 'scope/apps/scope.cpp' | |||
3178 | --- scope/apps/scope.cpp 2016-07-29 13:21:34 +0000 | |||
3179 | +++ scope/apps/scope.cpp 2016-09-23 14:36:26 +0000 | |||
3180 | @@ -18,27 +18,18 @@ | |||
3181 | 18 | #include "scope/apps/preview.h" | 18 | #include "scope/apps/preview.h" |
3182 | 19 | #include "scope/apps/query.h" | 19 | #include "scope/apps/query.h" |
3183 | 20 | #include "scope/apps/action.h" | 20 | #include "scope/apps/action.h" |
3185 | 21 | #include "scope/apps/localization.h" | 21 | #include <libertine-scope/i18n.h> |
3186 | 22 | #include <libertine-scope/action.h> | ||
3187 | 23 | #include <libertine-scope/preview.h> | ||
3188 | 24 | #include <libertine-scope/service_manager.h> | ||
3189 | 22 | #include <sstream> | 25 | #include <sstream> |
3190 | 23 | #include <url-dispatcher.h> | ||
3191 | 24 | #include <QFile> | 26 | #include <QFile> |
3192 | 25 | #include <QTextStream> | 27 | #include <QTextStream> |
3193 | 26 | #include <QString> | 28 | #include <QString> |
3194 | 27 | 29 | ||
3195 | 28 | |||
3196 | 29 | namespace usc = unity::scopes; | 30 | namespace usc = unity::scopes; |
3197 | 30 | 31 | ||
3198 | 31 | 32 | ||
3199 | 32 | namespace | ||
3200 | 33 | { | ||
3201 | 34 | static void | ||
3202 | 35 | open_application(std::string const& app_uri) | ||
3203 | 36 | { | ||
3204 | 37 | url_dispatch_send(app_uri.c_str(), NULL, NULL); | ||
3205 | 38 | } | ||
3206 | 39 | } | ||
3207 | 40 | |||
3208 | 41 | |||
3209 | 42 | Scope:: | 33 | Scope:: |
3210 | 43 | Scope(Libertine::Factory const& libertine_factory) | 34 | Scope(Libertine::Factory const& libertine_factory) |
3211 | 44 | : libertine_factory_(libertine_factory) | 35 | : libertine_factory_(libertine_factory) |
3212 | @@ -71,7 +62,8 @@ | |||
3213 | 71 | metadata, | 62 | metadata, |
3214 | 72 | libertine_factory_, | 63 | libertine_factory_, |
3215 | 73 | std::make_shared<HiddenApps>(cache_directory()), | 64 | std::make_shared<HiddenApps>(cache_directory()), |
3217 | 74 | std::make_shared<Blacklist>(scope_directory()))); | 65 | std::make_shared<Blacklist>(scope_directory()), |
3218 | 66 | scope_directory())); | ||
3219 | 75 | } | 67 | } |
3220 | 76 | 68 | ||
3221 | 77 | 69 | ||
3222 | @@ -79,7 +71,10 @@ | |||
3223 | 79 | preview(usc::Result const& result, | 71 | preview(usc::Result const& result, |
3224 | 80 | usc::ActionMetadata const& metadata) | 72 | usc::ActionMetadata const& metadata) |
3225 | 81 | { | 73 | { |
3227 | 82 | return usc::PreviewQueryBase::UPtr(new Preview(result, metadata)); | 74 | return usc::PreviewQueryBase::UPtr(new Preview(result, |
3228 | 75 | metadata, | ||
3229 | 76 | std::make_shared<libertine::scope::ServiceManager>(), | ||
3230 | 77 | std::make_shared<HiddenApps>(cache_directory()))); | ||
3231 | 83 | } | 78 | } |
3232 | 84 | 79 | ||
3233 | 85 | 80 | ||
3234 | @@ -92,7 +87,7 @@ | |||
3235 | 92 | return usc::ActivationQueryBase::UPtr(new Action(result, | 87 | return usc::ActivationQueryBase::UPtr(new Action(result, |
3236 | 93 | metadata, | 88 | metadata, |
3237 | 94 | action_id, | 89 | action_id, |
3239 | 95 | open_application, | 90 | std::make_shared<libertine::scope::ServiceManager>(), |
3240 | 96 | std::make_shared<HiddenApps>(cache_directory()), | 91 | std::make_shared<HiddenApps>(cache_directory()), |
3241 | 97 | filter_state_)); | 92 | filter_state_)); |
3242 | 98 | } | 93 | } |
3243 | 99 | 94 | ||
3244 | === added directory 'scope/store' | |||
3245 | === added file 'scope/store/CMakeLists.txt' | |||
3246 | --- scope/store/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
3247 | +++ scope/store/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
3248 | @@ -0,0 +1,50 @@ | |||
3249 | 1 | set (CMAKE_INCLUDE_CURRENT_DIR ON) | ||
3250 | 2 | set (CMAKE_AUTOMOC ON) | ||
3251 | 3 | |||
3252 | 4 | set(STORE_SCOPE_TARGET store) | ||
3253 | 5 | |||
3254 | 6 | # Find all the sources | ||
3255 | 7 | file(GLOB_RECURSE STORE_SCOPE_SOURCES | ||
3256 | 8 | "*.cpp" | ||
3257 | 9 | "*.h" | ||
3258 | 10 | ) | ||
3259 | 11 | |||
3260 | 12 | add_library(${STORE_SCOPE_TARGET} SHARED | ||
3261 | 13 | ${STORE_SCOPE_SOURCES} | ||
3262 | 14 | ) | ||
3263 | 15 | |||
3264 | 16 | target_link_libraries(${STORE_SCOPE_TARGET} | ||
3265 | 17 | ${SCOPE_LIB_NAME} | ||
3266 | 18 | ${SCOPE_LDFLAGS} | ||
3267 | 19 | ${LIBERTINE_LDFLAGS} | ||
3268 | 20 | Qt5::Core | ||
3269 | 21 | ) | ||
3270 | 22 | |||
3271 | 23 | include_directories( | ||
3272 | 24 | ${CMAKE_SOURCE_DIR}/lib | ||
3273 | 25 | ) | ||
3274 | 26 | |||
3275 | 27 | set_target_properties(store | ||
3276 | 28 | PROPERTIES | ||
3277 | 29 | OUTPUT_NAME ${STORE_PACKAGE_NAME} | ||
3278 | 30 | ) | ||
3279 | 31 | |||
3280 | 32 | install(TARGETS ${STORE_SCOPE_TARGET} | ||
3281 | 33 | LIBRARY DESTINATION "${STORE_LIB_DIR}" | ||
3282 | 34 | ) | ||
3283 | 35 | |||
3284 | 36 | set(STORE_INI_TARGET ${STORE_PACKAGE_NAME}.ini) | ||
3285 | 37 | configure_file( | ||
3286 | 38 | ${STORE_INI_TARGET}.in.in | ||
3287 | 39 | ${STORE_INI_TARGET}.in | ||
3288 | 40 | ) | ||
3289 | 41 | |||
3290 | 42 | add_custom_target(${STORE_INI_TARGET} ALL | ||
3291 | 43 | COMMENT "Merging translations into ${STORE_INI_TARGET}" | ||
3292 | 44 | COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${STORE_INI_TARGET}.in ${STORE_INI_TARGET} >/dev/null | ||
3293 | 45 | ) | ||
3294 | 46 | |||
3295 | 47 | install( | ||
3296 | 48 | FILES "${CMAKE_CURRENT_BINARY_DIR}/${STORE_INI_TARGET}" | ||
3297 | 49 | DESTINATION "${STORE_LIB_DIR}" | ||
3298 | 50 | ) | ||
3299 | 0 | 51 | ||
3300 | === added file 'scope/store/entry_point.cpp' | |||
3301 | --- scope/store/entry_point.cpp 1970-01-01 00:00:00 +0000 | |||
3302 | +++ scope/store/entry_point.cpp 2016-09-23 14:36:26 +0000 | |||
3303 | @@ -0,0 +1,42 @@ | |||
3304 | 1 | /** | ||
3305 | 2 | * @file store/entry_point.cpp | ||
3306 | 3 | * @brief The scope entry point. | ||
3307 | 4 | */ | ||
3308 | 5 | /* | ||
3309 | 6 | * Copyright 2016 Canonical Ltd. | ||
3310 | 7 | * | ||
3311 | 8 | * This program is free software: you can redistribute it and/or modify it under | ||
3312 | 9 | * the terms of the GNU General Public License, version 3, as published by the | ||
3313 | 10 | * Free Software Foundation. | ||
3314 | 11 | * | ||
3315 | 12 | * This program is distributed in the hope that it will be useful, | ||
3316 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3317 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3318 | 15 | * GNU General Public License for more details. | ||
3319 | 16 | * | ||
3320 | 17 | * You should have received a copy of the GNU General Public License | ||
3321 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3322 | 19 | */ | ||
3323 | 20 | #include "scope/store/scope.h" | ||
3324 | 21 | #include <unity/scopes/ScopeBase.h> | ||
3325 | 22 | |||
3326 | 23 | #define EXPORT __attribute__((visibility ("default"))) | ||
3327 | 24 | |||
3328 | 25 | // These functions define the entry points for the scope plugin | ||
3329 | 26 | extern "C" | ||
3330 | 27 | { | ||
3331 | 28 | |||
3332 | 29 | EXPORT unity::scopes::ScopeBase* | ||
3333 | 30 | UNITY_SCOPE_CREATE_FUNCTION() | ||
3334 | 31 | { | ||
3335 | 32 | return new libertine::scope::Scope(); | ||
3336 | 33 | } | ||
3337 | 34 | |||
3338 | 35 | |||
3339 | 36 | EXPORT void | ||
3340 | 37 | UNITY_SCOPE_DESTROY_FUNCTION(unity::scopes::ScopeBase* scope) | ||
3341 | 38 | { | ||
3342 | 39 | delete scope; | ||
3343 | 40 | } | ||
3344 | 41 | |||
3345 | 42 | } | ||
3346 | 0 | 43 | ||
3347 | === added file 'scope/store/libertine-scope.ubuntu_libertine-store.ini.in.in' | |||
3348 | --- scope/store/libertine-scope.ubuntu_libertine-store.ini.in.in 1970-01-01 00:00:00 +0000 | |||
3349 | +++ scope/store/libertine-scope.ubuntu_libertine-store.ini.in.in 2016-09-23 14:36:26 +0000 | |||
3350 | @@ -0,0 +1,10 @@ | |||
3351 | 1 | [ScopeConfig] | ||
3352 | 2 | _DisplayName=Find Desktop Apps | ||
3353 | 3 | _Description=Search for XApps to install. | ||
3354 | 4 | Author=The Canonical Libertine Team <libertine-team@lists.launchpad.net> | ||
3355 | 5 | Icon=@APPS_DATA_DIR@/apps.png | ||
3356 | 6 | _SearchHint=Search apps | ||
3357 | 7 | Keywords=apps | ||
3358 | 8 | |||
3359 | 9 | [Appearance] | ||
3360 | 10 | LogoOverlayColor=#ffffffff | ||
3361 | 0 | 11 | ||
3362 | === added file 'scope/store/query.cpp' | |||
3363 | --- scope/store/query.cpp 1970-01-01 00:00:00 +0000 | |||
3364 | +++ scope/store/query.cpp 2016-09-23 14:36:26 +0000 | |||
3365 | @@ -0,0 +1,149 @@ | |||
3366 | 1 | /* | ||
3367 | 2 | * Copyright 2016 Canonical Ltd. | ||
3368 | 3 | * | ||
3369 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
3370 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
3371 | 6 | * Free Software Foundation. | ||
3372 | 7 | * | ||
3373 | 8 | * This program is distributed in the hope that it will be useful, | ||
3374 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3375 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3376 | 11 | * GNU General Public License for more details. | ||
3377 | 12 | * | ||
3378 | 13 | * You should have received a copy of the GNU General Public License | ||
3379 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3380 | 15 | */ | ||
3381 | 16 | #include "scope/store/query.h" | ||
3382 | 17 | |||
3383 | 18 | #include <libertine-scope/service_manager.h> | ||
3384 | 19 | #include <libertine-scope/i18n.h> | ||
3385 | 20 | #include <unity/scopes/SearchReply.h> | ||
3386 | 21 | #include <unity/scopes/CategoryRenderer.h> | ||
3387 | 22 | #include <unity/scopes/VariantBuilder.h> | ||
3388 | 23 | #include <QtDBus> | ||
3389 | 24 | #include <QDebug> | ||
3390 | 25 | |||
3391 | 26 | namespace usc = unity::scopes; | ||
3392 | 27 | |||
3393 | 28 | namespace | ||
3394 | 29 | { | ||
3395 | 30 | static constexpr auto CATEGORY_APPS_DISPLAY = R"( | ||
3396 | 31 | { | ||
3397 | 32 | "schema-version" : 1, | ||
3398 | 33 | "template" : { | ||
3399 | 34 | "category-layout" : "grid", | ||
3400 | 35 | "card-layout" : "horizontal", | ||
3401 | 36 | "collapsed-rows": 0, | ||
3402 | 37 | "card-size": "large" | ||
3403 | 38 | }, | ||
3404 | 39 | "components" : { | ||
3405 | 40 | "title" : "title", | ||
3406 | 41 | "art" : { | ||
3407 | 42 | "field": "art", | ||
3408 | 43 | "aspect-ratio": 1.13, | ||
3409 | 44 | "fallback": "image://theme/placeholder-app-icon" | ||
3410 | 45 | }, | ||
3411 | 46 | "subtitle": "subtitle", | ||
3412 | 47 | "attributes": { "field": "attributes", "max-count": 3 } | ||
3413 | 48 | } | ||
3414 | 49 | } | ||
3415 | 50 | )"; | ||
3416 | 51 | |||
3417 | 52 | |||
3418 | 53 | static constexpr auto CATEGORY_HINT = R"( | ||
3419 | 54 | { | ||
3420 | 55 | "schema-version": 1, | ||
3421 | 56 | "template": { | ||
3422 | 57 | "category-layout": "grid", | ||
3423 | 58 | "card-size": "large", | ||
3424 | 59 | "card-layout": "horizontal" | ||
3425 | 60 | }, | ||
3426 | 61 | "components": { | ||
3427 | 62 | "title": "title" | ||
3428 | 63 | } | ||
3429 | 64 | } | ||
3430 | 65 | )"; | ||
3431 | 66 | |||
3432 | 67 | |||
3433 | 68 | static auto const SINGLE_RESULT_FOUND = _("%1 result found"); | ||
3434 | 69 | static auto const MULTIPLE_RESULTS_FOUND = _("%1 results found"); | ||
3435 | 70 | static QString const APPID_URI_FORMAT = "appid://palatine/%1/0.0"; | ||
3436 | 71 | } | ||
3437 | 72 | |||
3438 | 73 | |||
3439 | 74 | std::string const libertine::scope::Query::USE_SEARCH_HINT = _("Use the searchbar to find software."); | ||
3440 | 75 | std::string const libertine::scope::Query::NO_SEARCH_RESULTS_HINT = _("No results found."); | ||
3441 | 76 | |||
3442 | 77 | |||
3443 | 78 | libertine::scope::Query:: | ||
3444 | 79 | Query(usc::CannedQuery const& query, | ||
3445 | 80 | usc::SearchMetadata const& metadata, | ||
3446 | 81 | std::shared_ptr<ServiceManager> const& service) | ||
3447 | 82 | : usc::SearchQueryBase(query, metadata) | ||
3448 | 83 | , service_(service) | ||
3449 | 84 | { | ||
3450 | 85 | } | ||
3451 | 86 | |||
3452 | 87 | |||
3453 | 88 | void libertine::scope::Query:: | ||
3454 | 89 | cancelled() | ||
3455 | 90 | { | ||
3456 | 91 | } | ||
3457 | 92 | |||
3458 | 93 | |||
3459 | 94 | void libertine::scope::Query:: | ||
3460 | 95 | show_hint(usc::SearchReplyProxy const& reply, | ||
3461 | 96 | std::string const& reason) const | ||
3462 | 97 | { | ||
3463 | 98 | auto hint_category = reply->register_category("hint", "", "", usc::CategoryRenderer(CATEGORY_HINT)); | ||
3464 | 99 | usc::CategorisedResult res(hint_category); | ||
3465 | 100 | res.set_uri(usc::CannedQuery(query()).to_uri()); | ||
3466 | 101 | res.set_title(reason); | ||
3467 | 102 | reply->push(res); | ||
3468 | 103 | } | ||
3469 | 104 | |||
3470 | 105 | |||
3471 | 106 | void libertine::scope::Query:: | ||
3472 | 107 | run_search(usc::SearchReplyProxy const& reply) const | ||
3473 | 108 | { | ||
3474 | 109 | auto results = service_->search_cache(QString::fromStdString(query().query_string())); | ||
3475 | 110 | if (results.empty()) | ||
3476 | 111 | { | ||
3477 | 112 | show_hint(reply, NO_SEARCH_RESULTS_HINT); | ||
3478 | 113 | return; | ||
3479 | 114 | } | ||
3480 | 115 | |||
3481 | 116 | auto category = reply->register_category("aptcache", | ||
3482 | 117 | _("%u result found", "%u results found", results.size()), | ||
3483 | 118 | "Application", | ||
3484 | 119 | usc::CategoryRenderer(CATEGORY_APPS_DISPLAY)); | ||
3485 | 120 | auto self_uri = usc::CannedQuery(query()).to_uri(); | ||
3486 | 121 | for (auto const& result: results) | ||
3487 | 122 | { | ||
3488 | 123 | usc::CategorisedResult cr(category); | ||
3489 | 124 | cr.set_title(result.name); | ||
3490 | 125 | cr["subtitle"] = result.summary; | ||
3491 | 126 | cr["id"] = result.id; | ||
3492 | 127 | cr.set_art(result.icon); | ||
3493 | 128 | cr.set_uri(APPID_URI_FORMAT.arg(QString::fromStdString(result.id).remove(".desktop")).toStdString()); | ||
3494 | 129 | |||
3495 | 130 | if (!reply->push(cr)) | ||
3496 | 131 | { | ||
3497 | 132 | qCritical() << "Error while adding result " << QString::fromStdString(result.name); | ||
3498 | 133 | return; | ||
3499 | 134 | } | ||
3500 | 135 | } | ||
3501 | 136 | } | ||
3502 | 137 | |||
3503 | 138 | |||
3504 | 139 | void libertine::scope::Query:: | ||
3505 | 140 | run(usc::SearchReplyProxy const& reply) | ||
3506 | 141 | { | ||
3507 | 142 | if (!query().query_string().empty()) | ||
3508 | 143 | { | ||
3509 | 144 | run_search(reply); | ||
3510 | 145 | return; | ||
3511 | 146 | } | ||
3512 | 147 | |||
3513 | 148 | show_hint(reply, USE_SEARCH_HINT); | ||
3514 | 149 | } | ||
3515 | 0 | 150 | ||
3516 | === added file 'scope/store/query.h' | |||
3517 | --- scope/store/query.h 1970-01-01 00:00:00 +0000 | |||
3518 | +++ scope/store/query.h 2016-09-23 14:36:26 +0000 | |||
3519 | @@ -0,0 +1,70 @@ | |||
3520 | 1 | /* | ||
3521 | 2 | * Copyright 2016 Canonical Ltd. | ||
3522 | 3 | * | ||
3523 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
3524 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
3525 | 6 | * Free Software Foundation. | ||
3526 | 7 | * | ||
3527 | 8 | * This program is distributed in the hope that it will be useful, | ||
3528 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3529 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3530 | 11 | * GNU General Public License for more details. | ||
3531 | 12 | * | ||
3532 | 13 | * You should have received a copy of the GNU General Public License | ||
3533 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3534 | 15 | */ | ||
3535 | 16 | #ifndef LIBERTINE_STORE_QUERY_H_ | ||
3536 | 17 | #define LIBERTINE_STORE_QUERY_H_ | ||
3537 | 18 | |||
3538 | 19 | |||
3539 | 20 | #include <unity/scopes/ReplyProxyFwd.h> | ||
3540 | 21 | #include <unity/scopes/SearchQueryBase.h> | ||
3541 | 22 | |||
3542 | 23 | class QStringList; | ||
3543 | 24 | |||
3544 | 25 | |||
3545 | 26 | namespace libertine | ||
3546 | 27 | { | ||
3547 | 28 | namespace scope | ||
3548 | 29 | { | ||
3549 | 30 | |||
3550 | 31 | class ServiceManager; | ||
3551 | 32 | |||
3552 | 33 | /** | ||
3553 | 34 | * Engine to run a specific store query. | ||
3554 | 35 | */ | ||
3555 | 36 | class Query | ||
3556 | 37 | : public unity::scopes::SearchQueryBase | ||
3557 | 38 | { | ||
3558 | 39 | public: | ||
3559 | 40 | explicit Query(unity::scopes::CannedQuery const& query, | ||
3560 | 41 | unity::scopes::SearchMetadata const& metadata, | ||
3561 | 42 | std::shared_ptr<ServiceManager> const& service); | ||
3562 | 43 | |||
3563 | 44 | ~Query() = default; | ||
3564 | 45 | |||
3565 | 46 | virtual void | ||
3566 | 47 | cancelled() override; | ||
3567 | 48 | |||
3568 | 49 | virtual void | ||
3569 | 50 | run(unity::scopes::SearchReplyProxy const& reply) override; | ||
3570 | 51 | |||
3571 | 52 | static std::string const USE_SEARCH_HINT; | ||
3572 | 53 | static std::string const NO_SEARCH_RESULTS_HINT; | ||
3573 | 54 | |||
3574 | 55 | private: | ||
3575 | 56 | void | ||
3576 | 57 | show_hint(unity::scopes::SearchReplyProxy const& reply, | ||
3577 | 58 | std::string const& reason) const; | ||
3578 | 59 | void | ||
3579 | 60 | run_search(unity::scopes::SearchReplyProxy const& reply) const; | ||
3580 | 61 | |||
3581 | 62 | std::shared_ptr<ServiceManager> service_; | ||
3582 | 63 | }; | ||
3583 | 64 | |||
3584 | 65 | } // namespace scope | ||
3585 | 66 | } // namespace libertine | ||
3586 | 67 | |||
3587 | 68 | #endif // LIBERTINE_STORE_QUERY_H_ | ||
3588 | 69 | |||
3589 | 70 | |||
3590 | 0 | 71 | ||
3591 | === added file 'scope/store/scope.cpp' | |||
3592 | --- scope/store/scope.cpp 1970-01-01 00:00:00 +0000 | |||
3593 | +++ scope/store/scope.cpp 2016-09-23 14:36:26 +0000 | |||
3594 | @@ -0,0 +1,75 @@ | |||
3595 | 1 | /** | ||
3596 | 2 | * @file libertine_store/scope.cpp | ||
3597 | 3 | * @brief The implementation of the Libertine Store scope class. | ||
3598 | 4 | */ | ||
3599 | 5 | /* | ||
3600 | 6 | * Copyright 2016 Canonical Ltd. | ||
3601 | 7 | * | ||
3602 | 8 | * This program is free software: you can redistribute it and/or modify it under | ||
3603 | 9 | * the terms of the GNU General Public License, version 3, as published by the | ||
3604 | 10 | * Free Software Foundation. | ||
3605 | 11 | * | ||
3606 | 12 | * This program is distributed in the hope that it will be useful, | ||
3607 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3608 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3609 | 15 | * GNU General Public License for more details. | ||
3610 | 16 | * | ||
3611 | 17 | * You should have received a copy of the GNU General Public License | ||
3612 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3613 | 19 | */ | ||
3614 | 20 | #include "scope/store/scope.h" | ||
3615 | 21 | |||
3616 | 22 | #include "scope/store/query.h" | ||
3617 | 23 | #include <libertine-scope/action.h> | ||
3618 | 24 | #include <libertine-scope/i18n.h> | ||
3619 | 25 | #include <libertine-scope/preview.h> | ||
3620 | 26 | #include <libertine-scope/service_manager.h> | ||
3621 | 27 | |||
3622 | 28 | |||
3623 | 29 | namespace usc = unity::scopes; | ||
3624 | 30 | |||
3625 | 31 | |||
3626 | 32 | libertine::scope::Scope:: | ||
3627 | 33 | Scope() | ||
3628 | 34 | : service_(std::make_shared<ServiceManager>()) | ||
3629 | 35 | { } | ||
3630 | 36 | |||
3631 | 37 | |||
3632 | 38 | void libertine::scope::Scope:: | ||
3633 | 39 | start(std::string const&) | ||
3634 | 40 | { | ||
3635 | 41 | setlocale(LC_ALL, ""); | ||
3636 | 42 | std::string translation_directory = ScopeBase::scope_directory() | ||
3637 | 43 | + "/../share/locale/"; | ||
3638 | 44 | bindtextdomain(GETTEXT_PACKAGE, translation_directory.c_str()); | ||
3639 | 45 | } | ||
3640 | 46 | |||
3641 | 47 | |||
3642 | 48 | usc::SearchQueryBase::UPtr libertine::scope::Scope:: | ||
3643 | 49 | search(usc::CannedQuery const& query, | ||
3644 | 50 | usc::SearchMetadata const& metadata) | ||
3645 | 51 | { | ||
3646 | 52 | return usc::SearchQueryBase::UPtr(new Query(query, metadata, service_)); | ||
3647 | 53 | } | ||
3648 | 54 | |||
3649 | 55 | |||
3650 | 56 | usc::PreviewQueryBase::UPtr libertine::scope::Scope:: | ||
3651 | 57 | preview(usc::Result const& result, | ||
3652 | 58 | usc::ActionMetadata const& metadata) | ||
3653 | 59 | { | ||
3654 | 60 | return usc::PreviewQueryBase::UPtr(new Preview(result, metadata, service_)); | ||
3655 | 61 | } | ||
3656 | 62 | |||
3657 | 63 | |||
3658 | 64 | usc::ActivationQueryBase::UPtr libertine::scope::Scope:: | ||
3659 | 65 | perform_action(usc::Result const& result, | ||
3660 | 66 | usc::ActionMetadata const& metadata, | ||
3661 | 67 | std::string const& /* widget_id */, | ||
3662 | 68 | std::string const& action_id) | ||
3663 | 69 | { | ||
3664 | 70 | return usc::ActivationQueryBase::UPtr(new Action(result, | ||
3665 | 71 | metadata, | ||
3666 | 72 | action_id, | ||
3667 | 73 | service_)); | ||
3668 | 74 | } | ||
3669 | 75 | |||
3670 | 0 | 76 | ||
3671 | === added file 'scope/store/scope.h' | |||
3672 | --- scope/store/scope.h 1970-01-01 00:00:00 +0000 | |||
3673 | +++ scope/store/scope.h 2016-09-23 14:36:26 +0000 | |||
3674 | @@ -0,0 +1,77 @@ | |||
3675 | 1 | /** | ||
3676 | 2 | * @file libertine_store/scope.h | ||
3677 | 3 | * @brief The internal interface for the Libertine Store scope class. | ||
3678 | 4 | */ | ||
3679 | 5 | /* | ||
3680 | 6 | * Copyright 2016 Canonical Ltd. | ||
3681 | 7 | * | ||
3682 | 8 | * This program is free software: you can redistribute it and/or modify it under | ||
3683 | 9 | * the terms of the GNU General Public License, version 3, as published by the | ||
3684 | 10 | * Free Software Foundation. | ||
3685 | 11 | * | ||
3686 | 12 | * This program is distributed in the hope that it will be useful, | ||
3687 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3688 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3689 | 15 | * GNU General Public License for more details. | ||
3690 | 16 | * | ||
3691 | 17 | * You should have received a copy of the GNU General Public License | ||
3692 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3693 | 19 | */ | ||
3694 | 20 | #ifndef LIBERTINE_STORE_SCOPE_H_ | ||
3695 | 21 | #define LIBERTINE_STORE_SCOPE_H_ | ||
3696 | 22 | |||
3697 | 23 | #include <unity/scopes/ScopeBase.h> | ||
3698 | 24 | |||
3699 | 25 | namespace libertine | ||
3700 | 26 | { | ||
3701 | 27 | namespace scope | ||
3702 | 28 | { | ||
3703 | 29 | |||
3704 | 30 | class ServiceManager; | ||
3705 | 31 | |||
3706 | 32 | |||
3707 | 33 | class Scope | ||
3708 | 34 | : public unity::scopes::ScopeBase | ||
3709 | 35 | { | ||
3710 | 36 | public: | ||
3711 | 37 | explicit Scope(); | ||
3712 | 38 | virtual ~Scope() = default; | ||
3713 | 39 | |||
3714 | 40 | /** | ||
3715 | 41 | * Initializes the scope instance. | ||
3716 | 42 | */ | ||
3717 | 43 | virtual void | ||
3718 | 44 | start(std::string const&) override; | ||
3719 | 45 | |||
3720 | 46 | /** | ||
3721 | 47 | * Called each time a new query is requested | ||
3722 | 48 | */ | ||
3723 | 49 | virtual unity::scopes::SearchQueryBase::UPtr | ||
3724 | 50 | search(unity::scopes::CannedQuery const& query, | ||
3725 | 51 | unity::scopes::SearchMetadata const& metadata) override; | ||
3726 | 52 | |||
3727 | 53 | /** | ||
3728 | 54 | * Gets an application preview. | ||
3729 | 55 | */ | ||
3730 | 56 | virtual unity::scopes::PreviewQueryBase::UPtr | ||
3731 | 57 | preview(unity::scopes::Result const& result, | ||
3732 | 58 | unity::scopes::ActionMetadata const& metadata) override; | ||
3733 | 59 | |||
3734 | 60 | /** | ||
3735 | 61 | * Gets an application preview. | ||
3736 | 62 | */ | ||
3737 | 63 | virtual unity::scopes::ActivationQueryBase::UPtr | ||
3738 | 64 | perform_action(unity::scopes::Result const& result, | ||
3739 | 65 | unity::scopes::ActionMetadata const& metadata, | ||
3740 | 66 | std::string const& widget_id, | ||
3741 | 67 | std::string const& action_id) override; | ||
3742 | 68 | |||
3743 | 69 | private: | ||
3744 | 70 | std::shared_ptr<ServiceManager> service_; | ||
3745 | 71 | }; | ||
3746 | 72 | |||
3747 | 73 | |||
3748 | 74 | } // namespace scope | ||
3749 | 75 | } // namespace libertine | ||
3750 | 76 | |||
3751 | 77 | #endif /* LIBERTINE_STORE_SCOPE_H_ */ | ||
3752 | 0 | 78 | ||
3753 | === added directory 'service' | |||
3754 | === added file 'service/CMakeLists.txt' | |||
3755 | --- service/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
3756 | +++ service/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
3757 | @@ -0,0 +1,9 @@ | |||
3758 | 1 | # Figure out where the host distro stores its Python3 packages. | ||
3759 | 2 | execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" | ||
3760 | 3 | OUTPUT_VARIABLE python_site_packages | ||
3761 | 4 | OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
3762 | 5 | |||
3763 | 6 | install(DIRECTORY libertine_service | ||
3764 | 7 | DESTINATION ${python_site_packages}) | ||
3765 | 8 | install(PROGRAMS libertined | ||
3766 | 9 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
3767 | 0 | 10 | ||
3768 | === added directory 'service/libertine_service' | |||
3769 | === added file 'service/libertine_service/__init__.py' | |||
3770 | === added file 'service/libertine_service/appstream.py' | |||
3771 | --- service/libertine_service/appstream.py 1970-01-01 00:00:00 +0000 | |||
3772 | +++ service/libertine_service/appstream.py 2016-09-23 14:36:26 +0000 | |||
3773 | @@ -0,0 +1,80 @@ | |||
3774 | 1 | # Copyright 2016 Canonical Ltd. | ||
3775 | 2 | # | ||
3776 | 3 | # This program is free software: you can redistribute it and/or modify | ||
3777 | 4 | # it under the terms of the GNU General Public License as published by | ||
3778 | 5 | # the Free Software Foundation; version 3 of the License. | ||
3779 | 6 | # | ||
3780 | 7 | # This program is distributed in the hope that it will be useful, | ||
3781 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3782 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3783 | 10 | # GNU General Public License for more details. | ||
3784 | 11 | # | ||
3785 | 12 | # You should have received a copy of the GNU General Public License | ||
3786 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3787 | 14 | |||
3788 | 15 | import gi | ||
3789 | 16 | gi.require_version('AppStream', '1.0') | ||
3790 | 17 | from gi.repository import AppStream | ||
3791 | 18 | |||
3792 | 19 | |||
3793 | 20 | def xstr(s): | ||
3794 | 21 | """Converts anything to a string""" | ||
3795 | 22 | return str(s or "") | ||
3796 | 23 | |||
3797 | 24 | |||
3798 | 25 | class AppStreamCache(object): | ||
3799 | 26 | """AppStreamCache""" | ||
3800 | 27 | def __init__(self, config): | ||
3801 | 28 | super(AppStreamCache, self).__init__() | ||
3802 | 29 | self.config = config | ||
3803 | 30 | self.pool = AppStream.Pool() | ||
3804 | 31 | self.pool.load() | ||
3805 | 32 | |||
3806 | 33 | def search(self, query): | ||
3807 | 34 | packages = [] | ||
3808 | 35 | for component in self.pool.search(query): | ||
3809 | 36 | if component.is_valid(): | ||
3810 | 37 | package = {} | ||
3811 | 38 | package["name"] = xstr(component.get_name()) | ||
3812 | 39 | package["id"] = xstr(component.get_id()) | ||
3813 | 40 | package["summary"] = xstr(component.get_summary()) | ||
3814 | 41 | package["uri"] = xstr(component.get_url(AppStream.UrlKind.HOMEPAGE)) | ||
3815 | 42 | |||
3816 | 43 | if len(component.get_icons()) > 0: | ||
3817 | 44 | package["icon"] = xstr(self._get_largest_icon(component.get_icons()).get_filename()) | ||
3818 | 45 | packages.append(package) | ||
3819 | 46 | |||
3820 | 47 | return packages[::-1] | ||
3821 | 48 | |||
3822 | 49 | def app_info(self, app_id): | ||
3823 | 50 | apps = self.pool.get_components_by_id(app_id) | ||
3824 | 51 | app_data = {} | ||
3825 | 52 | if len(apps) == 1 and apps[0].is_valid(): | ||
3826 | 53 | app = apps[0] | ||
3827 | 54 | app_data["name"] = xstr(app.get_name()) | ||
3828 | 55 | app_data["id"] = xstr(app.get_id()) | ||
3829 | 56 | app_data["summary"] = xstr(app.get_summary()) | ||
3830 | 57 | app_data["website"] = xstr(app.get_url(AppStream.UrlKind.HOMEPAGE)) | ||
3831 | 58 | app_data["license"] = xstr(app.get_project_license()) | ||
3832 | 59 | app_data['package'] = ' '.join(app.get_pkgnames()) | ||
3833 | 60 | for screenshot in app.get_screenshots(): | ||
3834 | 61 | if screenshot.is_valid() and screenshot.get_kind() is AppStream.ScreenshotKind.EXTRA: | ||
3835 | 62 | largest = self._get_largest_icon(screenshot.get_images()) | ||
3836 | 63 | if largest is not None: | ||
3837 | 64 | if "screenshots" not in app_data: | ||
3838 | 65 | app_data["screenshots"] = [] | ||
3839 | 66 | app_data["screenshots"].append(largest.get_url()) | ||
3840 | 67 | |||
3841 | 68 | app_data["description"] = xstr(app.get_description()) | ||
3842 | 69 | |||
3843 | 70 | if len(app.get_icons()) > 0: | ||
3844 | 71 | app_data["icon"] = xstr(self._get_largest_icon(app.get_icons()).get_filename()) | ||
3845 | 72 | |||
3846 | 73 | return app_data | ||
3847 | 74 | |||
3848 | 75 | def _get_largest_icon(self, images): | ||
3849 | 76 | largest = None | ||
3850 | 77 | for icon in images: | ||
3851 | 78 | if largest is None or icon.get_width() > largest.get_width(): | ||
3852 | 79 | largest = icon | ||
3853 | 80 | return largest | ||
3854 | 0 | 81 | ||
3855 | === added file 'service/libertine_service/apt.py' | |||
3856 | --- service/libertine_service/apt.py 1970-01-01 00:00:00 +0000 | |||
3857 | +++ service/libertine_service/apt.py 2016-09-23 14:36:26 +0000 | |||
3858 | @@ -0,0 +1,106 @@ | |||
3859 | 1 | # Copyright 2016 Canonical Ltd. | ||
3860 | 2 | # | ||
3861 | 3 | # This program is free software: you can redistribute it and/or modify | ||
3862 | 4 | # it under the terms of the GNU General Public License as published by | ||
3863 | 5 | # the Free Software Foundation; version 3 of the License. | ||
3864 | 6 | # | ||
3865 | 7 | # This program is distributed in the hope that it will be useful, | ||
3866 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3867 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3868 | 10 | # GNU General Public License for more details. | ||
3869 | 11 | # | ||
3870 | 12 | # You should have received a copy of the GNU General Public License | ||
3871 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3872 | 14 | |||
3873 | 15 | import apt | ||
3874 | 16 | import glob | ||
3875 | 17 | import os | ||
3876 | 18 | import re | ||
3877 | 19 | |||
3878 | 20 | def _use_system_gpg(): | ||
3879 | 21 | """ Configures APT to use the system-wide GPG store. Always.""" | ||
3880 | 22 | for key in 'Dir::Etc::Trusted', 'Dir::Etc::TrustedParts': | ||
3881 | 23 | apt.apt_pkg.config.set(key, apt.apt_pkg.config.find_file(key)) | ||
3882 | 24 | |||
3883 | 25 | |||
3884 | 26 | def _get_system_sources_list(): | ||
3885 | 27 | """Concatenates all the system apt/sources.list files into a single text buffer.""" | ||
3886 | 28 | sources_path = os.path.join('/etc', 'apt') | ||
3887 | 29 | sources_list = glob.glob(os.path.join(sources_path, 'sources.list.d', '*.list')) | ||
3888 | 30 | sources_list.append(os.path.join(sources_path, 'sources.list')) | ||
3889 | 31 | sources = '' | ||
3890 | 32 | for source in sources_list: | ||
3891 | 33 | with open(source) as f: | ||
3892 | 34 | sources += f.read() | ||
3893 | 35 | return sources | ||
3894 | 36 | |||
3895 | 37 | |||
3896 | 38 | def _write_local_sources_list(rootdir): | ||
3897 | 39 | """ Writes out a user-local sources.list file by copying all the systemwide ones. """ | ||
3898 | 40 | sources = _get_system_sources_list() | ||
3899 | 41 | sources_path = os.path.join(rootdir, 'etc', 'apt') | ||
3900 | 42 | os.makedirs(sources_path, exist_ok=True) | ||
3901 | 43 | srcfile = os.path.join(sources_path, 'sources.list') | ||
3902 | 44 | with open(srcfile, 'w') as f: | ||
3903 | 45 | f.write(sources) | ||
3904 | 46 | return srcfile | ||
3905 | 47 | |||
3906 | 48 | |||
3907 | 49 | def _get_local_apt_cache(): | ||
3908 | 50 | """ Gets a user-local APT cache. """ | ||
3909 | 51 | rootdir = os.path.join('/tmp', '.cache', 'libertine', 'apt') | ||
3910 | 52 | srcfile = _write_local_sources_list(rootdir) | ||
3911 | 53 | |||
3912 | 54 | apt_cache = apt.Cache(rootdir=rootdir, memonly=True) | ||
3913 | 55 | apt.apt_pkg.config.clear("APT::Update::Post-Invoke-Success") | ||
3914 | 56 | apt_cache.update(sources_list=srcfile) | ||
3915 | 57 | apt_cache.open() | ||
3916 | 58 | |||
3917 | 59 | return apt_cache | ||
3918 | 60 | |||
3919 | 61 | |||
3920 | 62 | def _get_apt_cache(config): | ||
3921 | 63 | """ Factory function to get the APT cache obejct. """ | ||
3922 | 64 | _use_system_gpg() | ||
3923 | 65 | if config.use_local_cache: | ||
3924 | 66 | return _get_local_apt_cache() | ||
3925 | 67 | else: | ||
3926 | 68 | return apt.Cache() | ||
3927 | 69 | |||
3928 | 70 | class AptCache(object): | ||
3929 | 71 | """docstring for AptCache""" | ||
3930 | 72 | def __init__(self, config): | ||
3931 | 73 | super(AptCache, self).__init__() | ||
3932 | 74 | self.config = config | ||
3933 | 75 | |||
3934 | 76 | def search(self, query): | ||
3935 | 77 | apps = [] | ||
3936 | 78 | |||
3937 | 79 | cache = _get_apt_cache(self.config) | ||
3938 | 80 | pkg_keys = [key for key in cache.keys() if re.match(query, key)] | ||
3939 | 81 | for key in pkg_keys: | ||
3940 | 82 | app = {} | ||
3941 | 83 | app["name"] = cache[key].name | ||
3942 | 84 | app["id"] = cache[key].name | ||
3943 | 85 | app["package"] = cache[key].name | ||
3944 | 86 | if len(cache[key].versions) > 0: | ||
3945 | 87 | app["summary"] = cache[key].versions[0].summary | ||
3946 | 88 | app["website"] = cache[key].versions[0].homepage | ||
3947 | 89 | apps.append(app) | ||
3948 | 90 | return apps | ||
3949 | 91 | |||
3950 | 92 | def app_info(self, app_id): | ||
3951 | 93 | app_data = {} | ||
3952 | 94 | cache = _get_apt_cache(self.config) | ||
3953 | 95 | if app_id in cache: | ||
3954 | 96 | app = cache[app_id] | ||
3955 | 97 | app_data["name"] = app.name | ||
3956 | 98 | app_data["id"] = app.name | ||
3957 | 99 | app_data["package"] = app.name | ||
3958 | 100 | if len(app.versions) > 0: | ||
3959 | 101 | app_data["summary"] = app.versions[0].summary | ||
3960 | 102 | app_data["website"] = app.versions[0].homepage | ||
3961 | 103 | app_data["description"] = app.versions[0].description | ||
3962 | 104 | app_data["package"] = app.name | ||
3963 | 105 | |||
3964 | 106 | return app_data | ||
3965 | 0 | 107 | ||
3966 | === added file 'service/libertine_service/container.py' | |||
3967 | --- service/libertine_service/container.py 1970-01-01 00:00:00 +0000 | |||
3968 | +++ service/libertine_service/container.py 2016-09-23 14:36:26 +0000 | |||
3969 | @@ -0,0 +1,68 @@ | |||
3970 | 1 | # Copyright 2016 Canonical Ltd. | ||
3971 | 2 | # | ||
3972 | 3 | # This program is free software: you can redistribute it and/or modify | ||
3973 | 4 | # it under the terms of the GNU General Public License as published by | ||
3974 | 5 | # the Free Software Foundation; version 3 of the License. | ||
3975 | 6 | # | ||
3976 | 7 | # This program is distributed in the hope that it will be useful, | ||
3977 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3978 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3979 | 10 | # GNU General Public License for more details. | ||
3980 | 11 | # | ||
3981 | 12 | # You should have received a copy of the GNU General Public License | ||
3982 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3983 | 14 | |||
3984 | 15 | from threading import Lock | ||
3985 | 16 | from libertine import ContainersConfig | ||
3986 | 17 | from libertine_service import tasks | ||
3987 | 18 | |||
3988 | 19 | |||
3989 | 20 | class SafeContainersConfig(object): | ||
3990 | 21 | def __init__(self): | ||
3991 | 22 | self.lock = Lock() | ||
3992 | 23 | self.config = ContainersConfig.ContainersConfig() | ||
3993 | 24 | def __getattr__(self, name): | ||
3994 | 25 | config_method = getattr(self.config, name) | ||
3995 | 26 | if config_method is not None: | ||
3996 | 27 | def _method(*args, **kwargs): | ||
3997 | 28 | with self.lock: | ||
3998 | 29 | return config_method(*args) | ||
3999 | 30 | return _method | ||
4000 | 31 | |||
4001 | 32 | |||
4002 | 33 | class Container(object): | ||
4003 | 34 | def __init__(self, log): | ||
4004 | 35 | self.log = log | ||
4005 | 36 | self.libertine_config = SafeContainersConfig() | ||
4006 | 37 | self.lock = Lock() | ||
4007 | 38 | |||
4008 | 39 | def install(self, package_name, container_id, progress): | ||
4009 | 40 | self.libertine_config.refresh_database() | ||
4010 | 41 | if not self._container_exists(container_id): | ||
4011 | 42 | self.log.debug("Container does not exist, queuing create operation") | ||
4012 | 43 | create = tasks.CreateTask(container_id, self.libertine_config, self.lock, self.log) | ||
4013 | 44 | create.start() | ||
4014 | 45 | |||
4015 | 46 | task = tasks.InstallTask(package_name, container_id, self.libertine_config, progress, self.lock, self.log) | ||
4016 | 47 | return task.start() | ||
4017 | 48 | |||
4018 | 49 | def remove(self, package_name, container_id, progress): | ||
4019 | 50 | self.libertine_config.refresh_database() | ||
4020 | 51 | if not self._container_exists(container_id): | ||
4021 | 52 | self.log.debug("Container does not exist, queuing create operation") | ||
4022 | 53 | create = tasks.CreateTask(container_id, self.libertine_config, self.lock, self.log) | ||
4023 | 54 | create.start() | ||
4024 | 55 | |||
4025 | 56 | task = tasks.RemoveTask(package_name, container_id, self.libertine_config, progress, self.lock, self.log) | ||
4026 | 57 | return task.start() | ||
4027 | 58 | |||
4028 | 59 | def status(self, package_name, container_id): | ||
4029 | 60 | self.log.debug("Checking status of package '%s'" % package_name) | ||
4030 | 61 | self.libertine_config.refresh_database() | ||
4031 | 62 | if not self._container_exists(container_id): | ||
4032 | 63 | return '' | ||
4033 | 64 | return self.libertine_config.get_package_install_status(container_id, package_name) or '' | ||
4034 | 65 | |||
4035 | 66 | def _container_exists(self, container_id): | ||
4036 | 67 | self.log.debug("Checking if container '%s' exists" % container_id) | ||
4037 | 68 | return self.libertine_config.container_exists(container_id) | ||
4038 | 0 | 69 | ||
4039 | === added file 'service/libertine_service/dbus.py' | |||
4040 | --- service/libertine_service/dbus.py 1970-01-01 00:00:00 +0000 | |||
4041 | +++ service/libertine_service/dbus.py 2016-09-23 14:36:26 +0000 | |||
4042 | @@ -0,0 +1,184 @@ | |||
4043 | 1 | # Copyright 2016 Canonical Ltd. | ||
4044 | 2 | # | ||
4045 | 3 | # This program is free software: you can redistribute it and/or modify | ||
4046 | 4 | # it under the terms of the GNU General Public License as published by | ||
4047 | 5 | # the Free Software Foundation; version 3 of the License. | ||
4048 | 6 | # | ||
4049 | 7 | # This program is distributed in the hope that it will be useful, | ||
4050 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4051 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4052 | 10 | # GNU General Public License for more details. | ||
4053 | 11 | # | ||
4054 | 12 | # You should have received a copy of the GNU General Public License | ||
4055 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4056 | 14 | |||
4057 | 15 | import dbus | ||
4058 | 16 | import dbus.service | ||
4059 | 17 | import logging | ||
4060 | 18 | from libertine_service import apt | ||
4061 | 19 | from libertine_service import appstream | ||
4062 | 20 | from libertine_service import container | ||
4063 | 21 | from dbus.mainloop.glib import DBusGMainLoop | ||
4064 | 22 | from time import time | ||
4065 | 23 | |||
4066 | 24 | |||
4067 | 25 | LIBERTINE_SERVICE_NAME = "com.canonical.libertine.ContainerManager" | ||
4068 | 26 | LIBERTINE_STORE_INTERFACE = LIBERTINE_SERVICE_NAME | ||
4069 | 27 | DOWNLOAD_INTERFACE = "com.canonical.applications.Download" | ||
4070 | 28 | LIBERTINE_STORE_PATH = "/Manager" | ||
4071 | 29 | CONTAINER_ID = "palatine" | ||
4072 | 30 | |||
4073 | 31 | log = logging.getLogger("Libertine") | ||
4074 | 32 | |||
4075 | 33 | |||
4076 | 34 | class Progress(dbus.service.Object): | ||
4077 | 35 | def __init__(self, connection): | ||
4078 | 36 | log.debug("creating a Progress object") | ||
4079 | 37 | self._id = hex(int(time()*10000000))[2:] | ||
4080 | 38 | self._finished = False | ||
4081 | 39 | self.current_progress = (dbus.UInt64(0), dbus.UInt64(0)) | ||
4082 | 40 | dbus.service.Object.__init__(self, conn=connection, object_path=("/Progress/%s" % self._id)) | ||
4083 | 41 | |||
4084 | 42 | def emit_progress(self): | ||
4085 | 43 | self.progress(self.current_progress[0], self.current_progress[1]) | ||
4086 | 44 | |||
4087 | 45 | @property | ||
4088 | 46 | def id(self): | ||
4089 | 47 | return self._id | ||
4090 | 48 | |||
4091 | 49 | @property | ||
4092 | 50 | def done(self): | ||
4093 | 51 | return self._finished | ||
4094 | 52 | |||
4095 | 53 | @dbus.service.signal(DOWNLOAD_INTERFACE) | ||
4096 | 54 | def finished(self, path): | ||
4097 | 55 | log.debug("emit finished('%s')" % path) | ||
4098 | 56 | self._finished = True | ||
4099 | 57 | |||
4100 | 58 | @dbus.service.signal(DOWNLOAD_INTERFACE) | ||
4101 | 59 | def progress(self, received, total): | ||
4102 | 60 | log.debug("emit progress(%d, %d)" % (received, total)) | ||
4103 | 61 | self.current_progress = (received, total) | ||
4104 | 62 | |||
4105 | 63 | |||
4106 | 64 | class Service(dbus.service.Object): | ||
4107 | 65 | |||
4108 | 66 | def __init__(self, config): | ||
4109 | 67 | log.debug("creating service") | ||
4110 | 68 | DBusGMainLoop(set_as_default=True) | ||
4111 | 69 | try: | ||
4112 | 70 | bus_name = dbus.service.BusName(LIBERTINE_SERVICE_NAME, | ||
4113 | 71 | bus=dbus.SessionBus(), | ||
4114 | 72 | do_not_queue=True) | ||
4115 | 73 | except dbus.exceptions.NameExistsException: | ||
4116 | 74 | log.warning("service is already running") | ||
4117 | 75 | raise | ||
4118 | 76 | |||
4119 | 77 | try: | ||
4120 | 78 | self.cache = appstream.AppStreamCache(config) | ||
4121 | 79 | except: | ||
4122 | 80 | log.warning("AppStream backend unavailable, falling back to Apt backend.") | ||
4123 | 81 | self.cache = apt.AptCache(config) | ||
4124 | 82 | |||
4125 | 83 | self.container = container.Container(log) | ||
4126 | 84 | self.progress = {} | ||
4127 | 85 | |||
4128 | 86 | super().__init__(bus_name, LIBERTINE_STORE_PATH) | ||
4129 | 87 | |||
4130 | 88 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4131 | 89 | out_signature='as') | ||
4132 | 90 | def get_categories(self): | ||
4133 | 91 | log.debug("get_categories() called") | ||
4134 | 92 | return [] | ||
4135 | 93 | |||
4136 | 94 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4137 | 95 | out_signature='as') | ||
4138 | 96 | def get_featured(self): | ||
4139 | 97 | log.debug("get_featured() called") | ||
4140 | 98 | return [] | ||
4141 | 99 | |||
4142 | 100 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4143 | 101 | out_signature='as') | ||
4144 | 102 | def get_popular(self): | ||
4145 | 103 | log.debug("get_popular() called") | ||
4146 | 104 | return [] | ||
4147 | 105 | |||
4148 | 106 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4149 | 107 | in_signature='s', | ||
4150 | 108 | out_signature='aa{sv}') | ||
4151 | 109 | def search(self, search_string): | ||
4152 | 110 | log.debug("search('{}') called".format(search_string)) | ||
4153 | 111 | return self.cache.search(search_string) | ||
4154 | 112 | |||
4155 | 113 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4156 | 114 | in_signature='s', | ||
4157 | 115 | out_signature='a{sv}') | ||
4158 | 116 | def app_info(self, app_id): | ||
4159 | 117 | log.debug("app_info('{}') called".format(app_id)) | ||
4160 | 118 | app = self.cache.app_info(app_id) | ||
4161 | 119 | if 'package' in app: | ||
4162 | 120 | app['status'] = self.container.status(app['package'], CONTAINER_ID) | ||
4163 | 121 | if app['id'] in self.progress: | ||
4164 | 122 | app['progress_id'] = self.progress[app['id']].id | ||
4165 | 123 | |||
4166 | 124 | return app | ||
4167 | 125 | |||
4168 | 126 | @dbus.service.signal(LIBERTINE_STORE_INTERFACE, | ||
4169 | 127 | signature='su') | ||
4170 | 128 | def updating(self, target, percent): | ||
4171 | 129 | log.debug("emit updating('{}', {})".format(target, percent)) | ||
4172 | 130 | |||
4173 | 131 | # Packaging | ||
4174 | 132 | |||
4175 | 133 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4176 | 134 | in_signature='s', | ||
4177 | 135 | out_signature='x') | ||
4178 | 136 | def install(self, app_id): | ||
4179 | 137 | log.debug("install('%s')" % app_id) | ||
4180 | 138 | package = self.cache.app_info(app_id) | ||
4181 | 139 | if 'package' in package: | ||
4182 | 140 | return self.container.install(package['package'], CONTAINER_ID, self.find_or_create_package_progress(app_id)) | ||
4183 | 141 | |||
4184 | 142 | return 0 | ||
4185 | 143 | |||
4186 | 144 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4187 | 145 | in_signature='s', | ||
4188 | 146 | out_signature='x') | ||
4189 | 147 | def remove(self, app_id): | ||
4190 | 148 | log.debug("remove('%s')" % app_id) | ||
4191 | 149 | package = self.cache.app_info(app_id) | ||
4192 | 150 | if 'package' in package: | ||
4193 | 151 | return self.container.remove(package['package'], CONTAINER_ID, self.find_or_create_package_progress(app_id)) | ||
4194 | 152 | |||
4195 | 153 | return 0 | ||
4196 | 154 | |||
4197 | 155 | @dbus.service.method(LIBERTINE_STORE_INTERFACE, | ||
4198 | 156 | in_signature='s', | ||
4199 | 157 | out_signature='b') | ||
4200 | 158 | def update_progress(self, app_id): | ||
4201 | 159 | log.debug("update_progress('%s')" % app_id) | ||
4202 | 160 | self.cleanup_progress() | ||
4203 | 161 | if app_id in self.progress: | ||
4204 | 162 | self.progress[app_id].emit_progress() | ||
4205 | 163 | return True | ||
4206 | 164 | return False | ||
4207 | 165 | |||
4208 | 166 | def find_or_create_package_progress(self, app_id): | ||
4209 | 167 | self.cleanup_progress() | ||
4210 | 168 | |||
4211 | 169 | if app_id in self.progress: | ||
4212 | 170 | progress = self.progress[app_id] | ||
4213 | 171 | else: | ||
4214 | 172 | progress = Progress(self.connection) | ||
4215 | 173 | self.progress[app_id] = progress | ||
4216 | 174 | |||
4217 | 175 | return progress | ||
4218 | 176 | |||
4219 | 177 | def cleanup_progress(self): | ||
4220 | 178 | updated_progress_list = {} | ||
4221 | 179 | for key in self.progress.keys(): | ||
4222 | 180 | if self.progress[key].done: | ||
4223 | 181 | self.progress[key].remove_from_connection() | ||
4224 | 182 | else: | ||
4225 | 183 | updated_progress_list[key] = self.progress[key] | ||
4226 | 184 | self.progress = updated_progress_list | ||
4227 | 0 | 185 | ||
4228 | === added file 'service/libertine_service/tasks.py' | |||
4229 | --- service/libertine_service/tasks.py 1970-01-01 00:00:00 +0000 | |||
4230 | +++ service/libertine_service/tasks.py 2016-09-23 14:36:26 +0000 | |||
4231 | @@ -0,0 +1,149 @@ | |||
4232 | 1 | # Copyright 2016 Canonical Ltd. | ||
4233 | 2 | # | ||
4234 | 3 | # This program is free software: you can redistribute it and/or modify | ||
4235 | 4 | # it under the terms of the GNU General Public License as published by | ||
4236 | 5 | # the Free Software Foundation; version 3 of the License. | ||
4237 | 6 | # | ||
4238 | 7 | # This program is distributed in the hope that it will be useful, | ||
4239 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4240 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4241 | 10 | # GNU General Public License for more details. | ||
4242 | 11 | # | ||
4243 | 12 | # You should have received a copy of the GNU General Public License | ||
4244 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4245 | 14 | |||
4246 | 15 | from subprocess import Popen, PIPE | ||
4247 | 16 | from threading import Thread | ||
4248 | 17 | from abc import ABCMeta, abstractmethod | ||
4249 | 18 | from libertine import LibertineContainer, HostInfo, utils | ||
4250 | 19 | from dbus import UInt64 | ||
4251 | 20 | |||
4252 | 21 | |||
4253 | 22 | class LibertineTask(metaclass=ABCMeta): | ||
4254 | 23 | """ | ||
4255 | 24 | Abstract class for performing long-running, synchronous operations on a | ||
4256 | 25 | Libertine container. Child classes must implement _run, which will execute | ||
4257 | 26 | in a separate thread. Override _before to run commands synchronously; if | ||
4258 | 27 | _before returns False, _run will not be executed. | ||
4259 | 28 | """ | ||
4260 | 29 | def __init__(self, lock, log): | ||
4261 | 30 | self.lock = lock | ||
4262 | 31 | self.log = log | ||
4263 | 32 | |||
4264 | 33 | def start(self): | ||
4265 | 34 | if self._before(): | ||
4266 | 35 | thread = Thread(target=self.run) | ||
4267 | 36 | thread.start() | ||
4268 | 37 | return thread.ident | ||
4269 | 38 | else: | ||
4270 | 39 | return 0 | ||
4271 | 40 | |||
4272 | 41 | def run(self): | ||
4273 | 42 | with self.lock: | ||
4274 | 43 | self._run() | ||
4275 | 44 | |||
4276 | 45 | @abstractmethod | ||
4277 | 46 | def _run(self): | ||
4278 | 47 | pass | ||
4279 | 48 | |||
4280 | 49 | def _before(self): | ||
4281 | 50 | return True | ||
4282 | 51 | |||
4283 | 52 | |||
4284 | 53 | class ProgressTask(LibertineTask): | ||
4285 | 54 | def __init__(self, package_name, container_id, config, progress, lock, log): | ||
4286 | 55 | super().__init__(lock, log) | ||
4287 | 56 | self.package = package_name | ||
4288 | 57 | self.container = container_id | ||
4289 | 58 | self.config = config | ||
4290 | 59 | self.progress = progress | ||
4291 | 60 | self.current_progress = 0 | ||
4292 | 61 | |||
4293 | 62 | def _progress(self): | ||
4294 | 63 | self.current_progress += 1 | ||
4295 | 64 | self.progress.progress(UInt64(self.current_progress), UInt64(self.current_progress+1)) | ||
4296 | 65 | |||
4297 | 66 | |||
4298 | 67 | class InstallTask(ProgressTask): | ||
4299 | 68 | def __init__(self, package_name, container_id, config, progress, lock, log): | ||
4300 | 69 | super().__init__(package_name, container_id, config, progress, lock, log) | ||
4301 | 70 | |||
4302 | 71 | def _run(self): | ||
4303 | 72 | self.log.debug("Installing package '%s'" % self.package) | ||
4304 | 73 | self._progress() | ||
4305 | 74 | container = LibertineContainer(self.container, self.config) | ||
4306 | 75 | if container.install_package(self.package): | ||
4307 | 76 | self._progress() | ||
4308 | 77 | self.config.update_package_install_status(self.container, self.package, "installed") | ||
4309 | 78 | utils.refresh_libertine_scope() | ||
4310 | 79 | else: | ||
4311 | 80 | self.log.warning("Package installation failed for '%s'" % self.package) | ||
4312 | 81 | self.config.delete_package(self.container, self.package) | ||
4313 | 82 | self.progress.finished(self.package) | ||
4314 | 83 | |||
4315 | 84 | def _before(self): | ||
4316 | 85 | self.log.debug("InstallTask::_before") | ||
4317 | 86 | self._progress() | ||
4318 | 87 | self.config.add_new_package(self.container, self.package) | ||
4319 | 88 | self.config.update_package_install_status(self.container, self.package, "installing") | ||
4320 | 89 | self._progress() | ||
4321 | 90 | return True | ||
4322 | 91 | |||
4323 | 92 | |||
4324 | 93 | class RemoveTask(ProgressTask): | ||
4325 | 94 | def __init__(self, package_name, container_id, config, progress, lock, log): | ||
4326 | 95 | super().__init__(package_name, container_id, config, progress, lock, log) | ||
4327 | 96 | self.fallback = "installed" | ||
4328 | 97 | |||
4329 | 98 | def _run(self): | ||
4330 | 99 | self.log.debug("Removing package '%s'" % self.package) | ||
4331 | 100 | self._progress() | ||
4332 | 101 | container = LibertineContainer(self.container, self.config) | ||
4333 | 102 | if container.remove_package(self.package): | ||
4334 | 103 | self._progress() | ||
4335 | 104 | self.config.delete_package(self.container, self.package) | ||
4336 | 105 | utils.refresh_libertine_scope() | ||
4337 | 106 | else: | ||
4338 | 107 | self.log.warning("Package removal failed for '%s'" % self.package) | ||
4339 | 108 | self.config.update_package_install_status(self.container, self.package, self.fallback) | ||
4340 | 109 | self.progress.finished(self.package) | ||
4341 | 110 | |||
4342 | 111 | def _before(self): | ||
4343 | 112 | self.log.debug("RemoveTask::_before") | ||
4344 | 113 | self._progress() | ||
4345 | 114 | if self.config.package_exists(self.container, self.package): | ||
4346 | 115 | self.fallback = self.config.get_package_install_status(self.container, self.package) | ||
4347 | 116 | self.config.update_package_install_status(self.container, self.package, "removing") | ||
4348 | 117 | self._progress() | ||
4349 | 118 | return True | ||
4350 | 119 | else: | ||
4351 | 120 | self.log.debug("Package '%s' already exists, skipping install" % self.package) | ||
4352 | 121 | return False | ||
4353 | 122 | |||
4354 | 123 | |||
4355 | 124 | class CreateTask(LibertineTask): | ||
4356 | 125 | def __init__(self, container_id, config, lock, log): | ||
4357 | 126 | super().__init__(lock, log) | ||
4358 | 127 | self.container = container_id | ||
4359 | 128 | self.config = config | ||
4360 | 129 | |||
4361 | 130 | def _run(self): | ||
4362 | 131 | self.log.debug("Creating container '%s'" % self.container) | ||
4363 | 132 | container = LibertineContainer(self.container, self.config) | ||
4364 | 133 | if not container.create_libertine_container(password=''): | ||
4365 | 134 | self.log.debug("Creating container '%s' failed" % self.container) | ||
4366 | 135 | self.config.delete_container(self.container) | ||
4367 | 136 | return | ||
4368 | 137 | self.config.update_container_install_status(self.container, "ready") | ||
4369 | 138 | |||
4370 | 139 | def _before(self): | ||
4371 | 140 | self.log.debug("CreateTask::_before") | ||
4372 | 141 | if self.config.container_exists(self.container): | ||
4373 | 142 | return False | ||
4374 | 143 | |||
4375 | 144 | info = HostInfo.HostInfo() | ||
4376 | 145 | |||
4377 | 146 | self.config.add_new_container(self.container, 'User Applications', info.select_container_type_by_kernel(), | ||
4378 | 147 | info.get_host_distro_release()) | ||
4379 | 148 | self.config.update_container_install_status(self.container, 'installing') | ||
4380 | 149 | return True | ||
4381 | 0 | 150 | ||
4382 | === added file 'service/libertined' | |||
4383 | --- service/libertined 1970-01-01 00:00:00 +0000 | |||
4384 | +++ service/libertined 2016-09-23 14:36:26 +0000 | |||
4385 | @@ -0,0 +1,89 @@ | |||
4386 | 1 | #!/usr/bin/python3 | ||
4387 | 2 | # -*- coding: utf-8 -*- | ||
4388 | 3 | |||
4389 | 4 | # Copyright 2016 Canonical Ltd. | ||
4390 | 5 | # | ||
4391 | 6 | # This program is free software: you can redistribute it and/or modify | ||
4392 | 7 | # it under the terms of the GNU General Public License as published by | ||
4393 | 8 | # the Free Software Foundation; version 3 of the License. | ||
4394 | 9 | # | ||
4395 | 10 | # This program is distributed in the hope that it will be useful, | ||
4396 | 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4397 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4398 | 13 | # GNU General Public License for more details. | ||
4399 | 14 | # | ||
4400 | 15 | # You should have received a copy of the GNU General Public License | ||
4401 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4402 | 17 | |||
4403 | 18 | import argparse | ||
4404 | 19 | import logging | ||
4405 | 20 | import signal | ||
4406 | 21 | import sys | ||
4407 | 22 | from gi.repository import GLib, GObject | ||
4408 | 23 | from libertine_service import dbus | ||
4409 | 24 | |||
4410 | 25 | |||
4411 | 26 | log = logging.getLogger("Libertine") | ||
4412 | 27 | |||
4413 | 28 | |||
4414 | 29 | class Config(object): | ||
4415 | 30 | |||
4416 | 31 | def __init__(self): | ||
4417 | 32 | self._arg_parser = argparse.ArgumentParser(description=u'Libertine Store service') | ||
4418 | 33 | self._arg_parser.add_argument(u'-d', u"--debug", | ||
4419 | 34 | action='store_true', | ||
4420 | 35 | default=False, | ||
4421 | 36 | help=u"enable internal debugging output") | ||
4422 | 37 | self._arg_parser.add_argument(u'-l', u"--use-local-cache", | ||
4423 | 38 | action='store_true', | ||
4424 | 39 | default=False, | ||
4425 | 40 | help=u"use local cache instead of system cache") | ||
4426 | 41 | args = self._arg_parser.parse_args(namespace=Config) | ||
4427 | 42 | |||
4428 | 43 | |||
4429 | 44 | def configure_logging(config): | ||
4430 | 45 | if config.debug: | ||
4431 | 46 | log.setLevel(logging.DEBUG) | ||
4432 | 47 | else: | ||
4433 | 48 | log.setLevel(logging.INFO) | ||
4434 | 49 | lch = logging.StreamHandler(sys.stdout) | ||
4435 | 50 | lfm = logging.Formatter('%(asctime)s %(name)s [%(levelname)s] %(message)s') | ||
4436 | 51 | lch.setFormatter(lfm) | ||
4437 | 52 | log.addHandler(lch) | ||
4438 | 53 | |||
4439 | 54 | |||
4440 | 55 | class Loop(object): | ||
4441 | 56 | def __init__(self): | ||
4442 | 57 | GLib.unix_signal_add(GLib.PRIORITY_HIGH, | ||
4443 | 58 | signal.SIGTERM, | ||
4444 | 59 | self.sigterm, | ||
4445 | 60 | None) | ||
4446 | 61 | self.loop = GLib.MainLoop() | ||
4447 | 62 | |||
4448 | 63 | def sigterm(self, code): | ||
4449 | 64 | log.info("terminate ('%s') signal received" % code) | ||
4450 | 65 | self.shutdown() | ||
4451 | 66 | |||
4452 | 67 | def shutdown(self): | ||
4453 | 68 | log.info("shutting service down") | ||
4454 | 69 | self.loop.quit() | ||
4455 | 70 | |||
4456 | 71 | def run(self): | ||
4457 | 72 | log.info("entering main loop") | ||
4458 | 73 | self.loop.run() | ||
4459 | 74 | |||
4460 | 75 | def main(): | ||
4461 | 76 | config = Config() | ||
4462 | 77 | configure_logging(config) | ||
4463 | 78 | service = dbus.Service(config=config) | ||
4464 | 79 | loop = Loop() | ||
4465 | 80 | |||
4466 | 81 | try: | ||
4467 | 82 | loop.run() | ||
4468 | 83 | except KeyboardInterrupt: | ||
4469 | 84 | log.debug("keyboard interrupt received") | ||
4470 | 85 | loop.shutdown() | ||
4471 | 86 | |||
4472 | 87 | |||
4473 | 88 | if __name__ == '__main__': | ||
4474 | 89 | main() | ||
4475 | 0 | 90 | ||
4476 | === added file 'tests/CMakeLists.txt' | |||
4477 | --- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
4478 | +++ tests/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
4479 | @@ -0,0 +1,7 @@ | |||
4480 | 1 | # Build with system gmock and its embedded gtest -- the horror of hardcoding | ||
4481 | 2 | set(GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") | ||
4482 | 3 | set(GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory") | ||
4483 | 4 | add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock") | ||
4484 | 5 | |||
4485 | 6 | add_subdirectory(scope) | ||
4486 | 7 | add_subdirectory(lib) | ||
4487 | 0 | 8 | ||
4488 | === added directory 'tests/lib' | |||
4489 | === added file 'tests/lib/CMakeLists.txt' | |||
4490 | --- tests/lib/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
4491 | +++ tests/lib/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
4492 | @@ -0,0 +1,1 @@ | |||
4493 | 1 | add_subdirectory(libertine-scope) | ||
4494 | 0 | 2 | ||
4495 | === added directory 'tests/lib/libertine-scope' | |||
4496 | === added file 'tests/lib/libertine-scope/CMakeLists.txt' | |||
4497 | --- tests/lib/libertine-scope/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
4498 | +++ tests/lib/libertine-scope/CMakeLists.txt 2016-09-23 14:36:26 +0000 | |||
4499 | @@ -0,0 +1,24 @@ | |||
4500 | 1 | function(create_test test_name) | ||
4501 | 2 | add_executable(${test_name}_exe | ||
4502 | 3 | mock_service_manager.h | ||
4503 | 4 | ${test_name}.cpp | ||
4504 | 5 | ) | ||
4505 | 6 | |||
4506 | 7 | include_directories(${test_name}_exe | ||
4507 | 8 | ${CMAKE_SOURCE_DIR}/lib | ||
4508 | 9 | ) | ||
4509 | 10 | |||
4510 | 11 | target_link_libraries(${test_name}_exe | ||
4511 | 12 | ${SCOPE_LIB_NAME} | ||
4512 | 13 | Qt5::Core | ||
4513 | 14 | Qt5::DBus | ||
4514 | 15 | gmock | ||
4515 | 16 | gmock_main | ||
4516 | 17 | ) | ||
4517 | 18 | |||
4518 | 19 | add_test(${test_name} ${test_name}_exe) | ||
4519 | 20 | endfunction(create_test) | ||
4520 | 21 | |||
4521 | 22 | create_test(test_preview) | ||
4522 | 23 | create_test(test_package) | ||
4523 | 24 | create_test(test_action) | ||
4524 | 0 | 25 | ||
4525 | === added file 'tests/lib/libertine-scope/mock_service_manager.h' | |||
4526 | --- tests/lib/libertine-scope/mock_service_manager.h 1970-01-01 00:00:00 +0000 | |||
4527 | +++ tests/lib/libertine-scope/mock_service_manager.h 2016-09-23 14:36:26 +0000 | |||
4528 | @@ -0,0 +1,49 @@ | |||
4529 | 1 | /* | ||
4530 | 2 | * Copyright 2016 Canonical Ltd. | ||
4531 | 3 | * | ||
4532 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
4533 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
4534 | 6 | * Free Software Foundation. | ||
4535 | 7 | * | ||
4536 | 8 | * This program is distributed in the hope that it will be useful, | ||
4537 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4538 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4539 | 11 | * GNU General Public License for more details. | ||
4540 | 12 | * | ||
4541 | 13 | * You should have received a copy of the GNU General Public License | ||
4542 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4543 | 15 | */ | ||
4544 | 16 | |||
4545 | 17 | #ifndef _MOCK_SERVICE_MANAGER_H | ||
4546 | 18 | #define _MOCK_SERVICE_MANAGER_H | ||
4547 | 19 | |||
4548 | 20 | #include "libertine-scope/service_manager.h" | ||
4549 | 21 | #include <gmock/gmock.h> | ||
4550 | 22 | |||
4551 | 23 | |||
4552 | 24 | namespace libertine | ||
4553 | 25 | { | ||
4554 | 26 | namespace scope | ||
4555 | 27 | { | ||
4556 | 28 | |||
4557 | 29 | |||
4558 | 30 | class MockServiceManager : public ServiceManager | ||
4559 | 31 | { | ||
4560 | 32 | public: | ||
4561 | 33 | MockServiceManager() | ||
4562 | 34 | : ServiceManager() | ||
4563 | 35 | { | ||
4564 | 36 | } | ||
4565 | 37 | |||
4566 | 38 | MOCK_CONST_METHOD1(search_cache, QList<Package>(QString const&)); | ||
4567 | 39 | MOCK_CONST_METHOD1(app_info, Package(QString const&)); | ||
4568 | 40 | MOCK_CONST_METHOD1(update_progress, void(QString const&)); | ||
4569 | 41 | MOCK_CONST_METHOD1(install, void(QString const&)); | ||
4570 | 42 | MOCK_CONST_METHOD1(remove, void(QString const&)); | ||
4571 | 43 | }; | ||
4572 | 44 | |||
4573 | 45 | |||
4574 | 46 | } // namesapce Store | ||
4575 | 47 | } // namesapce Libertine | ||
4576 | 48 | |||
4577 | 49 | #endif // _MOCK_SERVICE_MANAGER_H | ||
4578 | 0 | 50 | ||
4579 | === added file 'tests/lib/libertine-scope/test_action.cpp' | |||
4580 | --- tests/lib/libertine-scope/test_action.cpp 1970-01-01 00:00:00 +0000 | |||
4581 | +++ tests/lib/libertine-scope/test_action.cpp 2016-09-23 14:36:26 +0000 | |||
4582 | @@ -0,0 +1,70 @@ | |||
4583 | 1 | /* | ||
4584 | 2 | * Copyright 2016 Canonical Ltd. | ||
4585 | 3 | * | ||
4586 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
4587 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
4588 | 6 | * Free Software Foundation. | ||
4589 | 7 | * | ||
4590 | 8 | * This program is distributed in the hope that it will be useful, | ||
4591 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4592 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4593 | 11 | * GNU General Public License for more details. | ||
4594 | 12 | * | ||
4595 | 13 | * You should have received a copy of the GNU General Public License | ||
4596 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4597 | 15 | */ | ||
4598 | 16 | #include "libertine-scope/action.h" | ||
4599 | 17 | |||
4600 | 18 | #include "tests/lib/libertine-scope/mock_service_manager.h" | ||
4601 | 19 | #include <unity/scopes/ActionMetadata.h> | ||
4602 | 20 | #include <unity/scopes/testing/Result.h> | ||
4603 | 21 | #include <gmock/gmock.h> | ||
4604 | 22 | |||
4605 | 23 | |||
4606 | 24 | namespace | ||
4607 | 25 | { | ||
4608 | 26 | TEST(StoreActionTest, CallsInstallOnServiceManager) | ||
4609 | 27 | { | ||
4610 | 28 | unity::scopes::testing::Result result; | ||
4611 | 29 | result["id"] = "vim-common"; | ||
4612 | 30 | unity::scopes::ActionMetadata metadata("en_US", "phone"); | ||
4613 | 31 | auto service = std::make_shared<testing::NiceMock<libertine::scope::MockServiceManager> >(); | ||
4614 | 32 | |||
4615 | 33 | libertine::scope::Action action(result, metadata, "install", service); | ||
4616 | 34 | |||
4617 | 35 | EXPECT_CALL(*service, install(QString("vim-common"))); | ||
4618 | 36 | |||
4619 | 37 | auto response = action.activate(); | ||
4620 | 38 | EXPECT_EQ(unity::scopes::ActivationResponse::Status::ShowPreview, response.status()); | ||
4621 | 39 | } | ||
4622 | 40 | |||
4623 | 41 | |||
4624 | 42 | TEST(StoreActionTest, CallsRemoveOnServiceManager) | ||
4625 | 43 | { | ||
4626 | 44 | unity::scopes::testing::Result result; | ||
4627 | 45 | result["id"] = "gedit"; | ||
4628 | 46 | unity::scopes::ActionMetadata metadata("en_US", "phone"); | ||
4629 | 47 | auto service = std::make_shared<testing::NiceMock<libertine::scope::MockServiceManager> >(); | ||
4630 | 48 | |||
4631 | 49 | libertine::scope::Action action(result, metadata, "remove", service); | ||
4632 | 50 | |||
4633 | 51 | EXPECT_CALL(*service, remove(QString("gedit"))); | ||
4634 | 52 | |||
4635 | 53 | auto response = action.activate(); | ||
4636 | 54 | EXPECT_EQ(unity::scopes::ActivationResponse::Status::ShowPreview, response.status()); | ||
4637 | 55 | } | ||
4638 | 56 | |||
4639 | 57 | |||
4640 | 58 | TEST(StoreActionTest, OpenAllowsDefaultHandlerToRun) | ||
4641 | 59 | { | ||
4642 | 60 | unity::scopes::testing::Result result; | ||
4643 | 61 | result["id"] = "gedit"; | ||
4644 | 62 | unity::scopes::ActionMetadata metadata("en_US", "phone"); | ||
4645 | 63 | auto service = std::make_shared<testing::NiceMock<libertine::scope::MockServiceManager> >(); | ||
4646 | 64 | |||
4647 | 65 | libertine::scope::Action action(result, metadata, "open", service); | ||
4648 | 66 | |||
4649 | 67 | auto response = action.activate(); | ||
4650 | 68 | EXPECT_EQ(unity::scopes::ActivationResponse::Status::NotHandled, response.status()); | ||
4651 | 69 | } | ||
4652 | 70 | } | ||
4653 | 0 | 71 | ||
4654 | === added file 'tests/lib/libertine-scope/test_package.cpp' | |||
4655 | --- tests/lib/libertine-scope/test_package.cpp 1970-01-01 00:00:00 +0000 | |||
4656 | +++ tests/lib/libertine-scope/test_package.cpp 2016-09-23 14:36:26 +0000 | |||
4657 | @@ -0,0 +1,108 @@ | |||
4658 | 1 | /* | ||
4659 | 2 | * Copyright 2016 Canonical Ltd. | ||
4660 | 3 | * | ||
4661 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
4662 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
4663 | 6 | * Free Software Foundation. | ||
4664 | 7 | * | ||
4665 | 8 | * This program is distributed in the hope that it will be useful, | ||
4666 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4667 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4668 | 11 | * GNU General Public License for more details. | ||
4669 | 12 | * | ||
4670 | 13 | * You should have received a copy of the GNU General Public License | ||
4671 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4672 | 15 | */ | ||
4673 | 16 | #include "libertine-scope/package.h" | ||
4674 | 17 | |||
4675 | 18 | #include <gmock/gmock.h> | ||
4676 | 19 | |||
4677 | 20 | |||
4678 | 21 | namespace | ||
4679 | 22 | { | ||
4680 | 23 | using namespace libertine::scope; | ||
4681 | 24 | |||
4682 | 25 | |||
4683 | 26 | static QVariantMap | ||
4684 | 27 | attribute_map(QString const& name, QString const& summary, QString const& description, | ||
4685 | 28 | QString const& icon, QString const& publisher, QString const& website, | ||
4686 | 29 | QString const& license, QString const& id, QString const& status, QStringList screenshots) | ||
4687 | 30 | { | ||
4688 | 31 | QVariantMap attributes; | ||
4689 | 32 | attributes["name"] = name; | ||
4690 | 33 | attributes["summary"] = summary; | ||
4691 | 34 | attributes["description"] = description; | ||
4692 | 35 | attributes["icon"] = icon; | ||
4693 | 36 | attributes["publisher"] = publisher; | ||
4694 | 37 | attributes["website"] = website; | ||
4695 | 38 | attributes["license"] = license; | ||
4696 | 39 | attributes["id"] = id; | ||
4697 | 40 | attributes["status"] = status; | ||
4698 | 41 | attributes["screenshots"] = screenshots; | ||
4699 | 42 | return attributes; | ||
4700 | 43 | } | ||
4701 | 44 | |||
4702 | 45 | |||
4703 | 46 | static void | ||
4704 | 47 | package_matches_attributes(Package actual, std::string const& name, std::string const& summary, | ||
4705 | 48 | std::string const& description, std::string const& icon, std::string const& publisher, | ||
4706 | 49 | std::string const& website, std::string const& license, std::string const& id, | ||
4707 | 50 | std::string const& status, QStringList screenshots) | ||
4708 | 51 | { | ||
4709 | 52 | EXPECT_EQ(name, actual.name); | ||
4710 | 53 | EXPECT_EQ(summary, actual.summary); | ||
4711 | 54 | EXPECT_EQ(description, actual.description); | ||
4712 | 55 | EXPECT_EQ(icon, actual.icon); | ||
4713 | 56 | EXPECT_EQ(publisher, actual.publisher); | ||
4714 | 57 | EXPECT_EQ(website, actual.website); | ||
4715 | 58 | EXPECT_EQ(license, actual.license); | ||
4716 | 59 | EXPECT_EQ(id, actual.id); | ||
4717 | 60 | EXPECT_EQ(status, actual.status); | ||
4718 | 61 | |||
4719 | 62 | ASSERT_EQ(actual.screenshots.size(), screenshots.size()); | ||
4720 | 63 | for (auto i = 0u; i < actual.screenshots.size(); ++i) | ||
4721 | 64 | { | ||
4722 | 65 | EXPECT_EQ(screenshots[i], QString::fromStdString(actual.screenshots[i])); | ||
4723 | 66 | } | ||
4724 | 67 | } | ||
4725 | 68 | |||
4726 | 69 | |||
4727 | 70 | TEST(PackageTest, FromMapCreatesSinglePackage) | ||
4728 | 71 | { | ||
4729 | 72 | QStringList screenshots{"file:///some/image.png", "file:///some/other/image.jpg"}; | ||
4730 | 73 | auto attributeMap = attribute_map("Harry", "The Philosopher's Stone", | ||
4731 | 74 | "Boy with head injury seeks magic rock", | ||
4732 | 75 | "harry.png", "JK", "pottermore.com", "Private", | ||
4733 | 76 | "com.pottermore.harry", "finished", screenshots); | ||
4734 | 77 | auto package = Package::from_map(attributeMap); | ||
4735 | 78 | package_matches_attributes(package, "Harry", "The Philosopher's Stone", | ||
4736 | 79 | "Boy with head injury seeks magic rock", | ||
4737 | 80 | "harry.png", "JK", "pottermore.com", "Private", | ||
4738 | 81 | "com.pottermore.harry", "finished", screenshots); | ||
4739 | 82 | } | ||
4740 | 83 | |||
4741 | 84 | |||
4742 | 85 | TEST(PackageTest, FromMapCreatesListOfPackages) | ||
4743 | 86 | { | ||
4744 | 87 | QStringList screenshots{"file:///some/image.png", "file:///some/other/image.jpg"}; | ||
4745 | 88 | auto attributePkg1Map = attribute_map("Harry", "The Philosopher's Stone", | ||
4746 | 89 | "Boy with head injury seeks magic rock", | ||
4747 | 90 | "harry.png", "JK", "pottermore.com", "Private", | ||
4748 | 91 | "com.pottermore.harry", "finished", screenshots); | ||
4749 | 92 | QStringList screenshots2{"file://imageFor2.png"}; | ||
4750 | 93 | auto attributePkg2Map = attribute_map("Dune", "Classic science fiction", | ||
4751 | 94 | "The spice must flow", "worms.png", | ||
4752 | 95 | "Herbert", "dunebook.net", "Other", | ||
4753 | 96 | "net.dunebook.dune", "spicey", screenshots2); | ||
4754 | 97 | auto packages = Package::from_map(QList<QVariantMap>{attributePkg1Map, attributePkg2Map}); | ||
4755 | 98 | ASSERT_EQ(2, packages.size()); | ||
4756 | 99 | package_matches_attributes(packages[0], "Harry", "The Philosopher's Stone", | ||
4757 | 100 | "Boy with head injury seeks magic rock", | ||
4758 | 101 | "harry.png", "JK", "pottermore.com", "Private", | ||
4759 | 102 | "com.pottermore.harry", "finished", screenshots); | ||
4760 | 103 | package_matches_attributes(packages[1], "Dune", "Classic science fiction", | ||
4761 | 104 | "The spice must flow", "worms.png", | ||
4762 | 105 | "Herbert", "dunebook.net", "Other", | ||
4763 | 106 | "net.dunebook.dune", "spicey", screenshots2); | ||
4764 | 107 | } | ||
4765 | 108 | } | ||
4766 | 0 | 109 | ||
4767 | === added file 'tests/lib/libertine-scope/test_preview.cpp' | |||
4768 | --- tests/lib/libertine-scope/test_preview.cpp 1970-01-01 00:00:00 +0000 | |||
4769 | +++ tests/lib/libertine-scope/test_preview.cpp 2016-09-23 14:36:26 +0000 | |||
4770 | @@ -0,0 +1,292 @@ | |||
4771 | 1 | /* | ||
4772 | 2 | * Copyright 2016 Canonical Ltd. | ||
4773 | 3 | * | ||
4774 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
4775 | 5 | * the terms of the GNU General Public License, version 3, as published by the | ||
4776 | 6 | * Free Software Foundation. | ||
4777 | 7 | * | ||
4778 | 8 | * This program is distributed in the hope that it will be useful, | ||
4779 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4780 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4781 | 11 | * GNU General Public License for more details. | ||
4782 | 12 | * | ||
4783 | 13 | * You should have received a copy of the GNU General Public License | ||
4784 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4785 | 15 | */ | ||
4786 | 16 | #include "libertine-scope/preview.h" | ||
4787 | 17 | #include "tests/lib/libertine-scope/mock_service_manager.h" | ||
4788 | 18 | |||
4789 | 19 | #include <unity/scopes/ActionMetadata.h> | ||
4790 | 20 | #include <unity/scopes/PreviewWidget.h> | ||
4791 | 21 | #include <unity/scopes/testing/MockPreviewReply.h> | ||
4792 | 22 | #include <unity/scopes/testing/Result.h> | ||
4793 | 23 | #include <gtest/gtest.h> | ||
4794 | 24 | #include <gmock/gmock.h> | ||
4795 | 25 | |||
4796 | 26 | namespace | ||
4797 | 27 | { | ||
4798 | 28 | using namespace libertine::scope; | ||
4799 | 29 | |||
4800 | 30 | |||
4801 | 31 | static void | ||
4802 | 32 | verifyHeader(Package const& package, unity::scopes::PreviewWidget const& header) | ||
4803 | 33 | { | ||
4804 | 34 | EXPECT_EQ("hdr", header.id()); | ||
4805 | 35 | EXPECT_EQ("header", header.widget_type()); | ||
4806 | 36 | |||
4807 | 37 | EXPECT_EQ(package.name, header.attribute_values()["title"].get_string()); | ||
4808 | 38 | EXPECT_EQ(package.summary, header.attribute_values()["subtitle"].get_string()); | ||
4809 | 39 | EXPECT_EQ(package.icon, header.attribute_values()["mascot"].get_string()); | ||
4810 | 40 | } | ||
4811 | 41 | |||
4812 | 42 | |||
4813 | 43 | static void | ||
4814 | 44 | verifyButtons(unity::scopes::PreviewWidget const& buttons) | ||
4815 | 45 | { | ||
4816 | 46 | EXPECT_EQ("actions", buttons.id()); | ||
4817 | 47 | EXPECT_EQ("actions", buttons.widget_type()); | ||
4818 | 48 | auto buttons_actions = buttons.attribute_values()["actions"].get_array(); | ||
4819 | 49 | ASSERT_EQ(1, buttons_actions.size()); | ||
4820 | 50 | EXPECT_EQ("install", buttons_actions[0].get_dict()["id"].get_string()); | ||
4821 | 51 | EXPECT_EQ("Install", buttons_actions[0].get_dict()["label"].get_string()); | ||
4822 | 52 | } | ||
4823 | 53 | |||
4824 | 54 | static void | ||
4825 | 55 | verifyInProgressButtons(unity::scopes::PreviewWidget const& buttons, std::string const& progress_id) | ||
4826 | 56 | { | ||
4827 | 57 | EXPECT_EQ("actions", buttons.id()); | ||
4828 | 58 | EXPECT_EQ("progress", buttons.widget_type()); | ||
4829 | 59 | auto source = buttons.attribute_values()["source"].get_dict(); | ||
4830 | 60 | EXPECT_EQ("com.canonical.libertine.ContainerManager", source["dbus-name"].get_string()); | ||
4831 | 61 | EXPECT_EQ(std::string("/Progress/") + progress_id, source["dbus-object"].get_string()); | ||
4832 | 62 | } | ||
4833 | 63 | |||
4834 | 64 | |||
4835 | 65 | static void | ||
4836 | 66 | verifyInstalledButtons(unity::scopes::PreviewWidget const& buttons) | ||
4837 | 67 | { | ||
4838 | 68 | EXPECT_EQ("actions", buttons.id()); | ||
4839 | 69 | EXPECT_EQ("actions", buttons.widget_type()); | ||
4840 | 70 | auto buttons_actions = buttons.attribute_values()["actions"].get_array(); | ||
4841 | 71 | ASSERT_EQ(2, buttons_actions.size()); | ||
4842 | 72 | EXPECT_EQ("remove", buttons_actions[0].get_dict()["id"].get_string()); | ||
4843 | 73 | EXPECT_EQ("Remove", buttons_actions[0].get_dict()["label"].get_string()); | ||
4844 | 74 | EXPECT_EQ("open", buttons_actions[1].get_dict()["id"].get_string()); | ||
4845 | 75 | EXPECT_EQ("Open", buttons_actions[1].get_dict()["label"].get_string()); | ||
4846 | 76 | } | ||
4847 | 77 | |||
4848 | 78 | |||
4849 | 79 | static void | ||
4850 | 80 | verifyMetadata(Package const& package, unity::scopes::PreviewWidget const& props) | ||
4851 | 81 | { | ||
4852 | 82 | EXPECT_EQ("other_metadata", props.id()); | ||
4853 | 83 | EXPECT_EQ("table", props.widget_type()); | ||
4854 | 84 | |||
4855 | 85 | auto propValues = props.attribute_values()["values"].get_array(); | ||
4856 | 86 | ASSERT_EQ(3, propValues.size()); | ||
4857 | 87 | ASSERT_EQ(2, propValues[0].get_array().size()); | ||
4858 | 88 | EXPECT_EQ("Publisher/Creator", propValues[0].get_array()[0].get_string()); | ||
4859 | 89 | EXPECT_EQ(package.publisher, propValues[0].get_array()[1].get_string()); | ||
4860 | 90 | ASSERT_EQ(2, propValues[1].get_array().size()); | ||
4861 | 91 | EXPECT_EQ("Website", propValues[1].get_array()[0].get_string()); | ||
4862 | 92 | EXPECT_EQ(package.website, propValues[1].get_array()[1].get_string()); | ||
4863 | 93 | ASSERT_EQ(2, propValues[2].get_array().size()); | ||
4864 | 94 | EXPECT_EQ("License", propValues[2].get_array()[0].get_string()); | ||
4865 | 95 | EXPECT_EQ(package.license, propValues[2].get_array()[1].get_string()); | ||
4866 | 96 | } | ||
4867 | 97 | |||
4868 | 98 | |||
4869 | 99 | static void | ||
4870 | 100 | verifyDescription(Package const& package, unity::scopes::PreviewWidget const& description) | ||
4871 | 101 | { | ||
4872 | 102 | EXPECT_EQ("summary", description.id()); | ||
4873 | 103 | EXPECT_EQ("text", description.widget_type()); | ||
4874 | 104 | EXPECT_EQ("Info", description.attribute_values()["title"].get_string()); | ||
4875 | 105 | EXPECT_EQ(package.description, description.attribute_values()["text"].get_string()); | ||
4876 | 106 | } | ||
4877 | 107 | |||
4878 | 108 | |||
4879 | 109 | static void | ||
4880 | 110 | verifyScreenshots(Package const& package, unity::scopes::PreviewWidget const& screenshots) | ||
4881 | 111 | { | ||
4882 | 112 | EXPECT_EQ("screenshots", screenshots.id()); | ||
4883 | 113 | EXPECT_EQ("gallery", screenshots.widget_type()); | ||
4884 | 114 | |||
4885 | 115 | auto sources = screenshots.attribute_values()["sources"].get_array(); | ||
4886 | 116 | ASSERT_EQ(package.screenshots.size(), sources.size()); | ||
4887 | 117 | |||
4888 | 118 | for (auto i = 0u; i < package.screenshots.size(); ++i) | ||
4889 | 119 | { | ||
4890 | 120 | EXPECT_EQ(package.screenshots[i], sources[i].get_string()); | ||
4891 | 121 | } | ||
4892 | 122 | |||
4893 | 123 | } | ||
4894 | 124 | |||
4895 | 125 | |||
4896 | 126 | static Package | ||
4897 | 127 | basePackage() | ||
4898 | 128 | { | ||
4899 | 129 | Package package; | ||
4900 | 130 | package.name = "vim"; | ||
4901 | 131 | package.summary = "classic text editor"; | ||
4902 | 132 | package.description = "this or emacs"; | ||
4903 | 133 | package.icon = "file:///test/file.png"; | ||
4904 | 134 | package.publisher = "Woody Boyd"; | ||
4905 | 135 | package.website = "http://canonical.com/"; | ||
4906 | 136 | package.license = "GPLv8+"; | ||
4907 | 137 | package.id = "vim.desktop"; | ||
4908 | 138 | package.status = ""; | ||
4909 | 139 | return package; | ||
4910 | 140 | } | ||
4911 | 141 | |||
4912 | 142 | |||
4913 | 143 | class StorePreviewTest : public testing::Test | ||
4914 | 144 | { | ||
4915 | 145 | protected: | ||
4916 | 146 | StorePreviewTest() | ||
4917 | 147 | : testing::Test() | ||
4918 | 148 | , result() | ||
4919 | 149 | , metadata("en_US", "phone") | ||
4920 | 150 | , list(new unity::scopes::PreviewWidgetList()) | ||
4921 | 151 | , reply() | ||
4922 | 152 | , proxy(&reply, [](unity::scopes::PreviewReply*) {}) | ||
4923 | 153 | , service(new testing::NiceMock<MockServiceManager>()) | ||
4924 | 154 | { | ||
4925 | 155 | } | ||
4926 | 156 | |||
4927 | 157 | virtual void | ||
4928 | 158 | SetUp() | ||
4929 | 159 | { | ||
4930 | 160 | EXPECT_CALL(reply, push(testing::_)).WillOnce(testing::SaveArg<0>(list.get())); | ||
4931 | 161 | Preview::update_progress_after = std::chrono::milliseconds(0); | ||
4932 | 162 | } | ||
4933 | 163 | |||
4934 | 164 | void usePackage(Package const& package) | ||
4935 | 165 | { | ||
4936 | 166 | result["id"] = unity::scopes::Variant(package.id); | ||
4937 | 167 | EXPECT_CALL(*service, app_info(QString::fromStdString(package.id))).WillOnce(testing::Return(package)); | ||
4938 | 168 | } | ||
4939 | 169 | |||
4940 | 170 | unity::scopes::testing::Result result; | ||
4941 | 171 | unity::scopes::ActionMetadata metadata; | ||
4942 | 172 | std::unique_ptr<unity::scopes::PreviewWidgetList> list; | ||
4943 | 173 | testing::NiceMock<unity::scopes::testing::MockPreviewReply> reply; | ||
4944 | 174 | unity::scopes::PreviewReplyProxy proxy; | ||
4945 | 175 | std::shared_ptr<testing::NiceMock<MockServiceManager> > service; | ||
4946 | 176 | }; | ||
4947 | 177 | |||
4948 | 178 | |||
4949 | 179 | TEST_F(StorePreviewTest, ShowsDetailedInformationForPackage) | ||
4950 | 180 | { | ||
4951 | 181 | auto package = basePackage(); | ||
4952 | 182 | usePackage(package); | ||
4953 | 183 | |||
4954 | 184 | Preview preview(result, metadata, service); | ||
4955 | 185 | preview.run(proxy); | ||
4956 | 186 | |||
4957 | 187 | ASSERT_NE(nullptr, list); | ||
4958 | 188 | ASSERT_EQ(4, list->size()); | ||
4959 | 189 | |||
4960 | 190 | verifyHeader(package, list->front()); | ||
4961 | 191 | list->pop_front(); | ||
4962 | 192 | verifyButtons(list->front()); | ||
4963 | 193 | list->pop_front(); | ||
4964 | 194 | verifyMetadata(package, list->front()); | ||
4965 | 195 | list->pop_front(); | ||
4966 | 196 | verifyDescription(package, list->front()); | ||
4967 | 197 | } | ||
4968 | 198 | |||
4969 | 199 | |||
4970 | 200 | TEST_F(StorePreviewTest, ShowsScreenshotsWhenAvailable) | ||
4971 | 201 | { | ||
4972 | 202 | auto package = basePackage(); | ||
4973 | 203 | package.screenshots = std::vector<std::string>{"file:///some/string/uri.png", "file:///some/other/string/uri.jpg"}; | ||
4974 | 204 | usePackage(package); | ||
4975 | 205 | |||
4976 | 206 | Preview preview(result, metadata, service); | ||
4977 | 207 | preview.run(proxy); | ||
4978 | 208 | |||
4979 | 209 | ASSERT_NE(nullptr, list); | ||
4980 | 210 | ASSERT_EQ(5, list->size()); | ||
4981 | 211 | |||
4982 | 212 | verifyHeader(package, list->front()); | ||
4983 | 213 | list->pop_front(); | ||
4984 | 214 | verifyButtons(list->front()); | ||
4985 | 215 | list->pop_front(); | ||
4986 | 216 | verifyMetadata(package, list->front()); | ||
4987 | 217 | list->pop_front(); | ||
4988 | 218 | verifyScreenshots(package, list->front()); | ||
4989 | 219 | list->pop_front(); | ||
4990 | 220 | verifyDescription(package, list->front()); | ||
4991 | 221 | } | ||
4992 | 222 | |||
4993 | 223 | |||
4994 | 224 | TEST_F(StorePreviewTest, ShowsRemoveAndOpenButtonsWhenInstalled) | ||
4995 | 225 | { | ||
4996 | 226 | auto package = basePackage(); | ||
4997 | 227 | package.status = "installed"; | ||
4998 | 228 | usePackage(package); | ||
4999 | 229 | |||
5000 | 230 | Preview preview(result, metadata, service); |
PASSED: Continuous integration, rev:76 /jenkins. canonical. com/libertine/ job/lp- libertine- scope-ci/ 47/ /jenkins. canonical. com/libertine/ job/build/ 191 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= vivid+overlay, testname= default/ 151 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= xenial+ overlay, testname= default/ 151 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=amd64, release= yakkety, testname= default/ 151 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= vivid+overlay, testname= default/ 151 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= xenial+ overlay, testname= default/ 151 /jenkins. canonical. com/libertine/ job/test- 0-autopkgtest/ label=i386, release= yakkety, testname= default/ 151 /jenkins. canonical. com/libertine/ job/lp- generic- update- mp/148/ console /jenkins. canonical. com/libertine/ job/build- 0-fetch/ 194 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= vivid+overlay/ 179 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= xenial+ overlay/ 179 /jenkins. canonical. com/libertine/ job/build- 1-sourcepkg/ release= yakkety/ 179 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= vivid+overlay/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= vivid+overlay/ 172/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= xenial+ overlay/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= xenial+ overlay/ 172/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= yakkety/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=amd64, release= yakkety/ 172/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= vivid+overlay/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= vivid+overlay/ 172/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= xenial+ overlay/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= xenial+ overlay/ 172/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= yakkety/ 172 /jenkins. canonical. com/libertine/ job/build- 2-binpkg/ arch=i386, release= yakkety/ 172/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/libertine/ job/lp- libertine- scope-ci/ 47/rebuild
https:/