Compare commits
No commits in common. 'ubuntu/plucky' and 'ubuntu/bionic' have entirely different histories.
ubuntu/plu
...
ubuntu/bio
@ -0,0 +1,10 @@
|
||||
Upstream Authors:
|
||||
LXQt team: http://lxqt.org
|
||||
Razor team: http://razor-qt.org
|
||||
|
||||
Copyright:
|
||||
Copyright (c) 2010-2012 Razor team
|
||||
Copyright (c) 2012-2017 LXQt team
|
||||
|
||||
License: LGPL-2.1+
|
||||
The full text of the licenses can be found in the 'COPYING' file.
|
@ -0,0 +1,258 @@
|
||||
|
||||
lxqt-runner-0.12.0 / 2017-10-21
|
||||
===============================
|
||||
|
||||
* Set patch version
|
||||
* Don't export github templates
|
||||
* Update CMakeLists.txt
|
||||
* Fixed typo in Lithuanian
|
||||
* Drops Qt5Core_VERSION_STRING
|
||||
* set Qt::AA_UseHighDpiPixmaps to true
|
||||
* Fix pedantic warning
|
||||
* ui: Add option to show particular count of items
|
||||
* runner: Make usage of history configurable
|
||||
* commanditemmodel: Remove unused methods
|
||||
* Added QCommandLineParser and basic cli interface to lxqt-runner
|
||||
* Added LXQT_RUNNER_PATCH_VERSION
|
||||
* Fixes a FTBFS in superbuild mode
|
||||
* Added merged autostart to CMakeLists.txt
|
||||
* Updated *_da.desktop files and removed *_da_DK.desktop files
|
||||
* Update desktop entries and Replace fr_FR by fr
|
||||
* Update Greek translation (el) Remove country variant from language code
|
||||
* CMake: Adds Runtime and Devel install COMPONENTs
|
||||
* Coding style changes
|
||||
* Updates the build system to use the Targets infrastructure
|
||||
* Drops hardcoded /etc/xdg paths
|
||||
* Updated german translation, replaced Qt4 by Qt in all xsession/translations
|
||||
* Updates translations infrastructure
|
||||
* Update the required minimum cmake version
|
||||
* remove dead template lines switch OnlyShowIn from Razor -> LXQt stringchanges LxQt -> LXQt
|
||||
* Support lxqt-session and add necessary xdg autostart desktop entry files.
|
||||
* Bump year
|
||||
|
||||
0.11.1 / 2017-01-01
|
||||
===================
|
||||
|
||||
* Release 0.11.1: Update changelog
|
||||
* MathItem: Honor system locale (#52)
|
||||
* Use the new MenuCache configuration CMake module
|
||||
* Fixes FTBFS when libmenu-cache was installed to non-standard location
|
||||
* Remove cpack (#49)
|
||||
* - Fix endif placement when test for MATH library.
|
||||
|
||||
0.11.0 / 2016-09-24
|
||||
===================
|
||||
|
||||
* Release 0.11.0: Add changelog
|
||||
* Add README.md
|
||||
* Math: Enhance evaluation logic
|
||||
* Math: Use libmuparser for math evaluation
|
||||
* runner: Follow virtual desktop switching
|
||||
* Properly hide the runner when it loses focus
|
||||
* runner: Sort history items by relevance
|
||||
* build: Use external translations (#41)
|
||||
* ts-files removal (#40)
|
||||
* Use QString() instead of ""
|
||||
* Fix layout and focus to get history items right
|
||||
* Bump year
|
||||
* main: Add activation by running second instance
|
||||
* Italian translation update
|
||||
* dialog: Default icons
|
||||
* dialog: Fill background
|
||||
* upd: lxqt-runner_hu.ts
|
||||
* Update lxqt-runner_it.ts
|
||||
|
||||
0.10.0 / 2015-10-31
|
||||
===================
|
||||
|
||||
* Fix license file
|
||||
* Update translations
|
||||
* providers: don't show custom command/binary in case existing application (.desktop) is shown
|
||||
* providers: internal functions as static & which moved to the beginning for using it below
|
||||
* Updated german translation, made common for all regions.
|
||||
* Removed country variant _IT
|
||||
* Rename LxQt to LXQt everywhere
|
||||
* Remove country variant from language code
|
||||
* some license fixes
|
||||
* Handles CMake policy CMP0063
|
||||
* lxqt-runner: search case insensitive in items for each provider
|
||||
* lxqt-runner: correct space(s) according to conding standard
|
||||
* Use the LXQtCompilerSettings CMake module
|
||||
* Removes no added value, noisy debug message
|
||||
* Fixes Action button missing (menu) icon
|
||||
* Adds Runtime install COMPONENT
|
||||
* Coding style changes and cleanups
|
||||
* Use GNUInstallDirs
|
||||
* Removes unneeded include_directories() entries.
|
||||
* Reworks WITHOUT_MENU_CACHE option. Renames to USE_MENU_CACHE
|
||||
* Reworks RUNNER_MATH option
|
||||
* Reworks Virtual Box options and associated stuff
|
||||
* Use CMAKE_AUTOUIC, drop qt5_wrap_ui()
|
||||
* Update the build system to use the Targets infrastructure
|
||||
* Remove trailing whitespaces
|
||||
* Fix naming and links
|
||||
* Hide on shortcut trigger if it's active
|
||||
* Avoid hiding the dialog on opening the menu
|
||||
* Remove the provider for power actions
|
||||
* fallback for executing scripts w/o #!
|
||||
* rempove KF5/ prefix from include as done in lxde/liblxqt/pull/36
|
||||
|
||||
0.9.0 / 2015-01-29
|
||||
==================
|
||||
|
||||
* Sets the command list to use alternating row colors
|
||||
* Portuguese update
|
||||
* - Unify naming for a unique lxqt. No more suffixes
|
||||
* Drop XdgDesktopFileCache::getFile()
|
||||
* Add tab-completion
|
||||
* uniform coding style
|
||||
* Hide on loosing focus
|
||||
* Update lxqt-runner_pl_PL.ts
|
||||
* Fixes lxde/lxqt#347. HtmlDelegate on runner's list.
|
||||
* Makes the UPDATE_TRANSLATIONS option actually work.
|
||||
* Cleans up CMakeLists.txt a little bit
|
||||
* Uses the new liblxqt modules to handle translations
|
||||
* Moves lxqt_runner_sr_BA.ts to the translations dir.
|
||||
* Adds an UPDATE_TRANSLATIONS option
|
||||
* Use the LXQtranslate module to handle translations
|
||||
* Update Russian translation
|
||||
* Fixes dialog type, alt+tab won't focus it
|
||||
* Fix QDesktopWidget::availableGeometry() vs KWindowSystem::workArea() bug
|
||||
* CMakeLists cleanups
|
||||
* Fixes lxde/lxde-qt#311, FTBFS
|
||||
* Port lxqt-runner to KWindowSystem. Purge Qt 4.
|
||||
* Add Ctrl-p and Ctrl-n movement shortcuts.
|
||||
* Trim input text. Fixes lxde/lxde-qt#139
|
||||
|
||||
0.8.0 / 2014-10-08
|
||||
==================
|
||||
|
||||
* Adapt to the translation infrastructure
|
||||
* Use QWindow::windowHandle()->winId() to replace QWidget::winId() due to a bug of Qt5.
|
||||
* Initial Qt5 support.
|
||||
* Use new LXQt header files.
|
||||
* Assorted string polishing
|
||||
* cmake option to build without menu-cache even if it is installed
|
||||
* Update dialog.cpp
|
||||
|
||||
0.7.0 / 2014-05-07
|
||||
==================
|
||||
|
||||
* Update COPYING
|
||||
|
||||
0.6.99 / 2014-05-01
|
||||
===================
|
||||
|
||||
* Update man page
|
||||
* Update AUTHORS
|
||||
* LxQt Power Management -> Power Management
|
||||
* Add CPack rules for creating tarball
|
||||
* Update the app icons properly after the xdg menu is reloaded.
|
||||
* Proper encoding of command arguments
|
||||
* Removed CMAKE_SOURCE_DIR usage from CMakeLists.txt
|
||||
* Fix renaming bugs, replacing lxqt-qt with lxde-qt
|
||||
* Finish the crazy razor=>lxqt renaming tasks.
|
||||
* Convert utf8 strings to utf16 properly while using libmenu-cache.
|
||||
* Optionally support libmenu-cache so we can load installed appS from a cache quickly.
|
||||
* Rename razor to lxqt in some strings.
|
||||
* Make use of the latest liblxqt & liblxqt-globalkeys. * Rename to lxqt-runnder.
|
||||
* Add COPYING and AUTHORS
|
||||
* compile fix: do not include private qt header files
|
||||
* razor-runner scripting
|
||||
* X-RAZOR changed to Razor in desktop files
|
||||
* Experimental submenu added to shortcut selector button
|
||||
* Global shortcuts client library added and all support for it refactored and fixed.
|
||||
* fix "shorcut" typo
|
||||
* ignored duplicate entries in the HistoryProvider
|
||||
* Some debug prints removed. Timeout for Systray to load increased to 1 minute. Module crash detection improved.
|
||||
* preliminary manpages primary for razorqt and usefully in venenux
|
||||
* Translations updated
|
||||
* first part of fixes based on Coverity Scan (code static analysis)
|
||||
* Delete bad en_GB translations
|
||||
* Update translations
|
||||
* runner: Always select the command first and don't match directories
|
||||
* Translations updated
|
||||
* Removed line num from TS files.
|
||||
* Translations
|
||||
* Updated .ts.src files
|
||||
* Extra explaination on compile flags
|
||||
* indent fixes
|
||||
* Optional runtime VBoxHeadless support
|
||||
* Fix for Issue #290 Fails to build on BSD
|
||||
* Removed translate.sh from razor-runner
|
||||
* New translation infrastructure
|
||||
* Ts.src files updated.
|
||||
* Language name zh_CN.GB2312 braked cmake process.
|
||||
* Translations updated
|
||||
* typo fixes
|
||||
* Razor-runner: history provider didn't expand env variables.
|
||||
* Fixed a history in the razor-runner.
|
||||
* lock screen for runner too
|
||||
* fixed #267 Add logout/lock screen actions to razor runner
|
||||
* Move configure button to the left of close
|
||||
* implemented #267 Add logout/lock screen actions to razor runner
|
||||
* Don't display any VM on empty regex ; adding author header for previously added vbox provider
|
||||
* GUI for change razor theme.
|
||||
* fixed #63 Razor launcher should access history on arrow up/down
|
||||
* Improvements in the razor-runner Added a customommand provider.
|
||||
* Set window titles for use with WM's like fvwm
|
||||
* Typos in code. Thanks Aaron Lewis. * In razor-runner , providers item: title() was typed as tile() * For RazorSettings class , settingsChanged() was typed as settigsChanged()
|
||||
* Garbage in the code.
|
||||
* Preloading menu in the razor-runner.
|
||||
* Fix QRC_FILE definition
|
||||
* Fix the header path
|
||||
* Implemention of Virtualbox Runner
|
||||
* Implemention of VirtualBox runner
|
||||
* Transifex desktop: sr_BA.ts should be a local
|
||||
* Transifex desktop: local translations
|
||||
* Transifex desktop: Translations pulled
|
||||
* Update Tradidtional Chinese Translations
|
||||
* RazorApplication class implemented; all modules ported to this class
|
||||
* Translations update
|
||||
* Added support for the online translation service. www.transifex.net
|
||||
* Serbian translation files
|
||||
* Greek translation by iosifidis
|
||||
* Razor-runner not activated in kwin.
|
||||
* Razor-runner not activated in kwin.
|
||||
* Added danish translations
|
||||
* Russian translation
|
||||
* fix #169: italian translation
|
||||
* Relicense panel & runner
|
||||
* Set icon theme before instantiating CommandItemModel
|
||||
* Fix gmail.ru -> gmail.com
|
||||
* Keep all parts of the theme in one place. Fix in the cmake.
|
||||
* Keep all parts of the theme in one place
|
||||
* SVK translation finalized
|
||||
* Close Issue #120
|
||||
* License audit
|
||||
* Add Chinese(simplified) translation files.
|
||||
* Add Slovak (sk) translation
|
||||
* Czech translations (cs_CZ)
|
||||
* huge refactoring of the libraries build organization
|
||||
* Closes #64 Razor launcher should focus on alt+f2
|
||||
* RazorRunner: IconThemeChanged handler for razor-runner.
|
||||
* Fix: Wrong actualSize for icons from /usr/pixmaps.
|
||||
* GPL->LGPL where I'm the author
|
||||
* Translation for standard buttons in the razor-runner
|
||||
* Reducing lib dependency in cmake files.
|
||||
* Fix: Desktop Menu Specification category must be X-RAZOR.
|
||||
* Polish translation. Closes #46
|
||||
* potential fix (workaround) from #40: XdgMenu does not display environment related items
|
||||
* homepage updated + auto replacement script
|
||||
* Micro fix in razorqt-runner
|
||||
* XDG-files are splitted into qtxdg library.
|
||||
* History mode in razor-runner.
|
||||
* Fixed #23: Sorting razor-runner command list.
|
||||
* Translation
|
||||
* Mathematics support in razor-runner.
|
||||
* Razor-runner refactoring - Providers classes.
|
||||
* Small sorted fix.
|
||||
* Fixed selection color in listview.
|
||||
* Polish translation
|
||||
* fix for build (includes)
|
||||
* Closes #22
|
||||
* Closes #21
|
||||
* Disabled tests the global shortcut registration result.
|
||||
* "math mode" for razor-runner (expression ends with '=')
|
||||
* check for global shortcut duplicity (open cfg if it's in conflict)
|
||||
* Razor-runner program
|
@ -0,0 +1,158 @@
|
||||
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
||||
|
||||
project(lxqt-runner)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(REQUIRED_MENUCACHE_VERSION "0.3.3")
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
||||
option(USE_MENU_CACHE "Use libmenu-cache from LXDE to generate the app menu" ON)
|
||||
option(RUNNER_MATH "Math operations support" ON)
|
||||
option(RUNNER_VBOX "Virtual Box support" ON)
|
||||
cmake_dependent_option(RUNNER_VBOX_HEADLESS
|
||||
"Use headless mode instead of default window" OFF
|
||||
"RUNNER_VBOX" OFF
|
||||
)
|
||||
|
||||
find_package(KF5WindowSystem REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
find_package(lxqt REQUIRED)
|
||||
find_package(lxqt-globalkeys REQUIRED)
|
||||
find_package(lxqt-globalkeys-ui REQUIRED)
|
||||
message(STATUS "Building with Qt${Qt5Core_VERSION}")
|
||||
|
||||
include(LXQtCompilerSettings NO_POLICY_SCOPE)
|
||||
|
||||
# Patch Version
|
||||
set(LXQT_RUNNER_PATCH_VERSION 0)
|
||||
set(LXQT_RUNNER_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_RUNNER_PATCH_VERSION})
|
||||
add_definitions("-DLXQT_RUNNER_VERSION=\"${LXQT_RUNNER_VERSION}\"")
|
||||
|
||||
set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml)
|
||||
|
||||
if (USE_MENU_CACHE OR RUNNER_MATH)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
endif ()
|
||||
|
||||
if (USE_MENU_CACHE)
|
||||
# optionally use libmenu-cache from lxde to generate the application menu
|
||||
find_package(MenuCache "${REQUIRED_MENUCACHE_VERSION}" REQUIRED)
|
||||
endif()
|
||||
|
||||
if (RUNNER_MATH)
|
||||
pkg_check_modules(MUPARSER REQUIRED muparser)
|
||||
endif ()
|
||||
|
||||
set(lxqt-runner_H_FILES
|
||||
dialog.h
|
||||
commanditemmodel.h
|
||||
widgets.h
|
||||
providers.h
|
||||
yamlparser.h
|
||||
configuredialog/configuredialog.h
|
||||
)
|
||||
|
||||
set(lxqt-runner_CPP_FILES
|
||||
main.cpp
|
||||
dialog.cpp
|
||||
commanditemmodel.cpp
|
||||
widgets.cpp
|
||||
providers.cpp
|
||||
yamlparser.cpp
|
||||
configuredialog/configuredialog.cpp
|
||||
)
|
||||
|
||||
set(lxqt-runner_UI_FILES
|
||||
dialog.ui
|
||||
configuredialog/configuredialog.ui
|
||||
)
|
||||
|
||||
set(QRC_FILES
|
||||
|
||||
)
|
||||
|
||||
set(lxqt-runner_LIBRARIES
|
||||
lxqt
|
||||
lxqt-globalkeys
|
||||
lxqt-globalkeys-ui
|
||||
${MENUCACHE_LIBRARIES}
|
||||
${QTX_LIBRARIES}
|
||||
${MUPARSER_LDFLAGS}
|
||||
)
|
||||
|
||||
include(LXQtTranslate)
|
||||
|
||||
lxqt_translate_ts(lxqt-runner_QM_FILES
|
||||
UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
|
||||
SOURCES
|
||||
${lxqt-runner_H_FILES}
|
||||
${lxqt-runner_CPP_FILES}
|
||||
${lxqt-runner_UI_FILES}
|
||||
INSTALL_DIR
|
||||
"${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}"
|
||||
PULL_TRANSLATIONS
|
||||
${PULL_TRANSLATIONS}
|
||||
CLEAN_TRANSLATIONS
|
||||
${CLEAN_TRANSLATIONS}
|
||||
TRANSLATIONS_REPO
|
||||
${TRANSLATIONS_REPO}
|
||||
TRANSLATIONS_REFSPEC
|
||||
${TRANSLATIONS_REFSPEC}
|
||||
)
|
||||
|
||||
lxqt_app_translation_loader(lxqt-runner_QM_LOADER ${PROJECT_NAME})
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
if (RUNNER_VBOX)
|
||||
list(APPEND QRC_FILES virtualbox-icons.qrc)
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
${lxqt-runner_CPP_FILES}
|
||||
${lxqt-runner_QRC_SOURCES}
|
||||
${lxqt-runner_QM_FILES}
|
||||
${lxqt-runner_QM_LOADER}
|
||||
)
|
||||
|
||||
if (RUNNER_MATH)
|
||||
lxqt_enable_target_exceptions("${PROJECT_NAME}" PRIVATE)
|
||||
endif ()
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE "$<$<BOOL:${MENUCACHE_FOUND}>:${MENUCACHE_INCLUDE_DIRS}>"
|
||||
PRIVATE "$<$<BOOL:${MUPARSER_FOUND}>:${MUPARSER_INCLUDE_DIRS}>"
|
||||
)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE "$<$<BOOL:${RUNNER_MATH}>:MATH_ENABLED>"
|
||||
PRIVATE "$<$<BOOL:${RUNNER_VBOX}>:VBOX_ENABLED>"
|
||||
PRIVATE "$<$<BOOL:${RUNNER_VBOX_HEADLESS}>:VBOX_HEADLESS_ENABLED>"
|
||||
PRIVATE "$<$<BOOL:${MENUCACHE_FOUND}>:HAVE_MENU_CACHE=1>"
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
${lxqt-runner_LIBRARIES}
|
||||
KF5::WindowSystem
|
||||
)
|
||||
|
||||
install(TARGETS
|
||||
${PROJECT_NAME}
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
COMPONENT Runtime
|
||||
)
|
||||
|
||||
# merged from lxqt-common
|
||||
add_subdirectory(autostart)
|
@ -0,0 +1,458 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
@ -0,0 +1,34 @@
|
||||
# lxqt-runner
|
||||
|
||||
## Overview
|
||||
|
||||
lxqt-runner provides a GUI that comes up on the desktop and allows for launching applications or shutting down the system.
|
||||
|
||||
![lxqt-runner](lxqt-runner.png)
|
||||
|
||||
Technically it consists of a single binary `lxqt-runner`. The binary is run in a daemon-like manner as so-called LXQt Module and brings up the GUI when a configured keyboard shortcut is hit.
|
||||
|
||||
## Installation
|
||||
|
||||
### Compiling source code
|
||||
|
||||
Runtime dependencies are muparser, KWindowSystem, menu-cache and [lxqt-globalkeys](https://github.com/lxde/lxqt-globalkeys).
|
||||
Additional build dependencies are CMake and optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information.
|
||||
|
||||
Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems.
|
||||
|
||||
To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual.
|
||||
|
||||
### Binary packages
|
||||
|
||||
Official binary packages are provided by all major Linux distributions like Arch Linux, Debian (as of Debian stretch only), Fedora and openSUSE. Just use your package manager to search for string `lxqt-runner`.
|
||||
|
||||
## Configuration, Usage
|
||||
|
||||
Launching binary `lxqt-runner` as LXQt Module can be adjusted from section "Basic Settings" in configuration dialogue "LXQt Session Settings" (binary `lxqt-config-session`) of [lxqt-session](https://github.com/lxde/lxqt-session).
|
||||
|
||||
The keyboard shortcut to launch the GUI can be configured in "Global Actions Manager" (binary `lxqt-config-globalkeyshortcuts`) of [lxqt-globalkeys](https://github.com/lxde/lxqt-globalkeys).
|
||||
|
||||
The GUI comes with a configuration dialogue to customize settings like the position where it's displayed. It's accessible from a menu that's in turn opened by an icon left of the one to close the GUI, "arrow down" in screenshot above.
|
||||
|
||||
To launch an application corresponding strings need to be filed in the form, next a selection can be made from a list presenting matches. Items to shut down or restart the system and so on are provided by the menu featuring the configuration dialogue as well.
|
@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
||||
|
||||
file(GLOB DESKTOP_FILES_IN *.desktop.in)
|
||||
|
||||
# Translations **********************************
|
||||
lxqt_translate_desktop(DESKTOP_FILES
|
||||
SOURCES
|
||||
${DESKTOP_FILES_IN}
|
||||
)
|
||||
add_custom_target(lxq_runner_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
|
||||
#************************************************
|
||||
|
||||
install(FILES
|
||||
${DESKTOP_FILES}
|
||||
DESTINATION "${LXQT_ETC_XDG_DIR}/autostart"
|
||||
COMPONENT Runtime
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Runner
|
||||
TryExec=lxqt-runner
|
||||
Exec=lxqt-runner
|
||||
OnlyShowIn=LXQt;
|
||||
X-LXQt-Module=true
|
||||
|
||||
#TRANSLATIONS_DIR=translations
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ar]=المُطْلِق
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[cs]=Spouštěč
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[cs_CZ]=Spouštěč
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[da]=Programstarter
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[de]=Anwendungsstarter
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[el]=Εκτελεστής
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[eo]=Rulilo
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[es]=Lanzador
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[es_VE]=Ejecutor
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[eu]=Abiarazlea
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[fi]=Käynnistin
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[fr]=Lanceur
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[hu]=Indító
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[it_IT]=Runner
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ja]=ランナー
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[lt]=Paleidiklis
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[nl]=Starter
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pl_PL]=Runner
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pt]=Runner
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pt_BR]=Executor
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ru]=бегунок
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ru_RU]=Запускалка программ
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[sl]=Zaganjalnik
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[th_TH]=กล่องป้อนคำสั่ง
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[uk]=Запускач
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[zh_CN]=启动器
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[zh_TW]=快速執行
|
@ -0,0 +1,463 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "commanditemmodel.h"
|
||||
#include <LXQt/Settings>
|
||||
#include <XdgIcon>
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandItemModel::CommandItemModel(bool useHistory, QObject *parent) :
|
||||
QSortFilterProxyModel(parent),
|
||||
mSourceModel(new CommandSourceItemModel(useHistory, this)),
|
||||
mOnlyHistory(false),
|
||||
mShowHistoryFirst(true)
|
||||
{
|
||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
setSourceModel(mSourceModel);
|
||||
sort(0);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandItemModel::~CommandItemModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CommandItemModel::isOutDated() const
|
||||
{
|
||||
return mSourceModel->isOutDated();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
const CommandProviderItem *CommandItemModel::command(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
|
||||
QModelIndex ind = mapToSource(index);
|
||||
|
||||
return mSourceModel->command(ind);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CommandItemModel::clearHistory()
|
||||
{
|
||||
mSourceModel->clearHistory();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CommandItemModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
QRegExp re(filterRegExp());
|
||||
|
||||
if (re.isEmpty() && !mOnlyHistory)
|
||||
return false;
|
||||
|
||||
const CommandProviderItem *item = mSourceModel->command(sourceRow);
|
||||
|
||||
if (!item)
|
||||
return false;
|
||||
|
||||
bool accept = item->compare(re);
|
||||
if (accept)
|
||||
{
|
||||
//check if CustomCommand can be filtered out (equivalent app link is shown)
|
||||
const CustomCommandItem * cust_i = qobject_cast<const CustomCommandItem *>(item);
|
||||
if (nullptr != cust_i)
|
||||
{
|
||||
for (int i = mSourceModel->rowCount(sourceParent); 0 <= i; --i)
|
||||
{
|
||||
const AppLinkItem * app_i = qobject_cast<const AppLinkItem *>(mSourceModel->command(i));
|
||||
if (nullptr != app_i && cust_i->exec() == app_i->exec() && app_i->compare(re))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return accept;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CommandItemModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
if (left == mSourceModel->customCommandIndex())
|
||||
return true;
|
||||
|
||||
if (right == mSourceModel->customCommandIndex())
|
||||
return false;
|
||||
|
||||
if (mOnlyHistory)
|
||||
return left.row() < right.row();
|
||||
|
||||
HistoryItem const * i_left = dynamic_cast<HistoryItem const *>(mSourceModel->command(left));
|
||||
HistoryItem const * i_right = dynamic_cast<HistoryItem const *>(mSourceModel->command(right));
|
||||
if (nullptr != i_left && nullptr == i_right)
|
||||
return mShowHistoryFirst;
|
||||
if (nullptr == i_left && nullptr != i_right)
|
||||
return !mShowHistoryFirst;
|
||||
if (nullptr != i_left && nullptr != i_right)
|
||||
{
|
||||
QRegExp re(filterRegExp());
|
||||
//Note: -1 should not be returned if the item passed the filter previously
|
||||
const int pos_left = re.indexIn(i_left->command());
|
||||
const int pos_right = re.indexIn(i_right->command());
|
||||
Q_ASSERT(-1 != pos_left && -1 != pos_right);
|
||||
return pos_left < pos_right
|
||||
|| (pos_left == pos_right && QSortFilterProxyModel::lessThan(left, right));
|
||||
}
|
||||
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
int CommandItemModel::itemType(const QModelIndex &index) const
|
||||
{
|
||||
if (index.row() == mSourceModel->customCommandIndex().row())
|
||||
return 1;
|
||||
else if (index.row() < mSourceModel->externalProviderStartIndex().row())
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
QModelIndex CommandItemModel::appropriateItem(const QString &pattern) const
|
||||
{
|
||||
QModelIndex res;
|
||||
unsigned int rank = 0;
|
||||
|
||||
int cnt = rowCount();
|
||||
|
||||
for (int i=0; i<cnt; ++i)
|
||||
{
|
||||
QModelIndex ind = index(i,0);
|
||||
QModelIndex srcIndex = mapToSource(ind);
|
||||
if (srcIndex == mSourceModel->customCommandIndex())
|
||||
return ind;
|
||||
|
||||
const CommandProviderItem *item = mSourceModel->command(srcIndex);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
unsigned int r = item->rank(pattern);
|
||||
if (r > rank)
|
||||
{
|
||||
res = ind;
|
||||
rank = r;
|
||||
}
|
||||
|
||||
if (rank >= MAX_RANK)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!res.isValid())
|
||||
res = index(0, 0);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CommandItemModel::showHistoryFirst(bool first/* = true*/)
|
||||
{
|
||||
mShowHistoryFirst = first;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CommandItemModel::rebuild()
|
||||
{
|
||||
mSourceModel->rebuild();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandSourceItemModel::CommandSourceItemModel(bool useHistory, QObject *parent) :
|
||||
QAbstractListModel(parent),
|
||||
mHistoryProvider(nullptr)
|
||||
{
|
||||
mCustomCommandProvider = new CustomCommandProvider;
|
||||
mProviders.append(mCustomCommandProvider);
|
||||
rebuild();
|
||||
mCustomCommandIndex = index(0, 0);
|
||||
|
||||
if (useHistory)
|
||||
{
|
||||
mHistoryProvider = new HistoryProvider();
|
||||
mProviders.append(mHistoryProvider);
|
||||
mCustomCommandProvider->setHistoryProvider(mHistoryProvider);
|
||||
}
|
||||
|
||||
mProviders.append(new AppLinkProvider());
|
||||
#ifdef MATH_ENABLED
|
||||
mProviders.append(new MathProvider());
|
||||
#endif
|
||||
#ifdef VBOX_ENABLED
|
||||
mProviders.append(new VirtualBoxProvider());
|
||||
#endif
|
||||
|
||||
rebuild();
|
||||
mExternalProviderStartIndex = index(rowCount(), 0);
|
||||
|
||||
LXQt::Settings settings("lxqt-runner");
|
||||
int numExternalProviders = settings.beginReadArray("external providers");
|
||||
for (int i = 0; i < numExternalProviders; i++)
|
||||
{
|
||||
settings.setArrayIndex(i);
|
||||
qDebug() << "Adding external provider:" << settings.value("name") << settings.value("executable");
|
||||
ExternalProvider* externalProvider = new ExternalProvider(settings.value("name").toString(),
|
||||
settings.value("executable").toString());
|
||||
mProviders.append(externalProvider);
|
||||
mExternalProviders.append(externalProvider);
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
foreach(CommandProvider* provider, mProviders)
|
||||
{
|
||||
connect(provider, SIGNAL(changed()), this, SIGNAL(layoutChanged()));
|
||||
connect(provider, SIGNAL(aboutToBeChanged()), this, SIGNAL(layoutAboutToBeChanged()));
|
||||
}
|
||||
|
||||
rebuild();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandSourceItemModel::~CommandSourceItemModel()
|
||||
{
|
||||
qDeleteAll(mProviders);
|
||||
mHistoryProvider = 0;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
int CommandSourceItemModel::rowCount(const QModelIndex& /*parent*/) const
|
||||
{
|
||||
int ret=0;
|
||||
foreach(CommandProvider* provider, mProviders)
|
||||
ret += provider->count();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
QVariant CommandSourceItemModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (index.row() >= rowCount())
|
||||
return QVariant();
|
||||
|
||||
const CommandProviderItem *item = command(index);
|
||||
if (!item)
|
||||
return QVariant();
|
||||
|
||||
switch (role)
|
||||
{
|
||||
case Qt::DisplayRole:
|
||||
return QString("<b>%1</b><br>\n%2\n").arg(item->title(), item->comment());
|
||||
|
||||
case Qt::DecorationRole:
|
||||
return item->icon();
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return item->toolTip();
|
||||
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CommandSourceItemModel::isOutDated() const
|
||||
{
|
||||
QListIterator<CommandProvider*> i(mProviders);
|
||||
while (i.hasNext())
|
||||
{
|
||||
if (i.next()->isOutDated())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CommandSourceItemModel::rebuild()
|
||||
{
|
||||
emit layoutAboutToBeChanged();
|
||||
// FIXME: is this implementation correct?
|
||||
QListIterator<CommandProvider*> i(mProviders);
|
||||
while (i.hasNext())
|
||||
{
|
||||
CommandProvider *p = i.next();
|
||||
if (p->isOutDated())
|
||||
p->rebuild();
|
||||
}
|
||||
emit layoutChanged();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CommandSourceItemModel::clearHistory()
|
||||
{
|
||||
if (mHistoryProvider)
|
||||
{
|
||||
beginResetModel();
|
||||
mHistoryProvider->clearHistory();
|
||||
endResetModel();
|
||||
} else
|
||||
{
|
||||
QScopedPointer<HistoryProvider> history_p{new HistoryProvider};
|
||||
history_p->clearHistory();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
const CommandProviderItem *CommandSourceItemModel::command(int row) const
|
||||
{
|
||||
int n = row;
|
||||
QListIterator<CommandProvider*> i(mProviders);
|
||||
while (i.hasNext())
|
||||
{
|
||||
CommandProvider *p = i.next();
|
||||
if (n < p->count())
|
||||
return p->at(n);
|
||||
else
|
||||
n -=p->count();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
const CommandProviderItem *CommandSourceItemModel::command(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
|
||||
return command(index.row());
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
|
||||
***********************************************/
|
||||
void CommandSourceItemModel::setCommand(const QString& command)
|
||||
{
|
||||
mCustomCommandProvider->setCommand(command);
|
||||
foreach (ExternalProvider* externalProvider, mExternalProviders)
|
||||
{
|
||||
externalProvider->setSearchTerm(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
|
||||
***********************************************/
|
||||
void CommandSourceItemModel::setUseHistory(bool useHistory)
|
||||
{
|
||||
const bool now_using_history = mHistoryProvider != nullptr;
|
||||
if (now_using_history == useHistory)
|
||||
return;
|
||||
beginResetModel();
|
||||
if (now_using_history)
|
||||
{
|
||||
mProviders.removeAll(mHistoryProvider);
|
||||
mCustomCommandProvider->setHistoryProvider(nullptr);
|
||||
delete mHistoryProvider;
|
||||
mHistoryProvider = nullptr;
|
||||
} else
|
||||
{
|
||||
mHistoryProvider = new HistoryProvider;
|
||||
mProviders.append(mHistoryProvider);
|
||||
mCustomCommandProvider->setHistoryProvider(mHistoryProvider);
|
||||
connect(mHistoryProvider, SIGNAL(changed()), this, SIGNAL(layoutChanged()));
|
||||
connect(mHistoryProvider, SIGNAL(aboutToBeChanged()), this, SIGNAL(layoutAboutToBeChanged()));
|
||||
}
|
||||
endResetModel();
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#ifndef COMMANDITEMMODEL_H
|
||||
#define COMMANDITEMMODEL_H
|
||||
|
||||
#include <providers.h>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QAbstractListModel>
|
||||
#include <QVariant>
|
||||
|
||||
|
||||
class CommandSourceItemModel: public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CommandSourceItemModel(bool useHistory, QObject *parent = 0);
|
||||
virtual ~CommandSourceItemModel();
|
||||
|
||||
int rowCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
|
||||
|
||||
bool isOutDated() const;
|
||||
const CommandProviderItem *command(const QModelIndex &index) const;
|
||||
const CommandProviderItem *command(int row) const;
|
||||
|
||||
QString command() const { return mCustomCommandProvider->command(); }
|
||||
void setCommand(const QString &command);
|
||||
|
||||
QPersistentModelIndex customCommandIndex() const { return mCustomCommandIndex; }
|
||||
QPersistentModelIndex externalProviderStartIndex() const { return mExternalProviderStartIndex; }
|
||||
|
||||
/*! Flag if the history should be shown/stored
|
||||
*/
|
||||
void setUseHistory(bool useHistory);
|
||||
public slots:
|
||||
void rebuild();
|
||||
void clearHistory();
|
||||
|
||||
private:
|
||||
QList<CommandProvider*> mProviders;
|
||||
HistoryProvider *mHistoryProvider;
|
||||
CustomCommandProvider *mCustomCommandProvider;
|
||||
QPersistentModelIndex mCustomCommandIndex;
|
||||
QList<ExternalProvider*> mExternalProviders;
|
||||
QPersistentModelIndex mExternalProviderStartIndex;
|
||||
};
|
||||
|
||||
|
||||
class CommandItemModel: public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CommandItemModel(bool useHistory, QObject *parent = 0);
|
||||
virtual ~CommandItemModel();
|
||||
|
||||
bool isOutDated() const;
|
||||
const CommandProviderItem *command(const QModelIndex &index) const;
|
||||
|
||||
QModelIndex appropriateItem(const QString &pattern) const;
|
||||
|
||||
bool isShowOnlyHistory() const { return mOnlyHistory; }
|
||||
void showOnlyHistory(bool onlyHistory) { mOnlyHistory = onlyHistory; }
|
||||
|
||||
void showHistoryFirst(bool first = true);
|
||||
|
||||
/*! Flag if the history should be shown/stored
|
||||
*/
|
||||
inline void setUseHistory(bool useHistory) { mSourceModel->setUseHistory(useHistory); }
|
||||
|
||||
QString command() const { return mSourceModel->command(); }
|
||||
void setCommand(const QString &command) { mSourceModel->setCommand(command); }
|
||||
|
||||
public slots:
|
||||
void rebuild();
|
||||
void clearHistory();
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
||||
private:
|
||||
int itemType(const QModelIndex &index) const;
|
||||
CommandSourceItemModel *mSourceModel;
|
||||
bool mOnlyHistory;
|
||||
bool mShowHistoryFirst; //!< flag for history items to be shown first/last
|
||||
};
|
||||
|
||||
#endif // COMMANDITEMMODEL_H
|
@ -0,0 +1,165 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#include "configuredialog.h"
|
||||
#include "ui_configuredialog.h"
|
||||
|
||||
#include <LXQt/Settings>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDesktopWidget>
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QKeySequence>
|
||||
#include <QPushButton>
|
||||
#include <QCloseEvent>
|
||||
#include <QAction>
|
||||
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
ConfigureDialog::ConfigureDialog(QSettings *settings, const QString &defaultShortcut, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigureDialog),
|
||||
mSettings(settings),
|
||||
mOldSettings(new LXQt::SettingsCache(settings)),
|
||||
mDefaultShortcut(defaultShortcut)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(resetSettings()));
|
||||
|
||||
// Position .................................
|
||||
ui->positionCbx->addItem(tr("Top edge of the screen"), QVariant(ConfigureDialog::PositionTop));
|
||||
ui->positionCbx->addItem(tr("Center of the screen"), QVariant(ConfigureDialog::PositionCenter));
|
||||
connect(ui->positionCbx, SIGNAL(currentIndexChanged(int)), this, SLOT(positionCbxChanged(int)));
|
||||
|
||||
// Monitor ..................................
|
||||
QDesktopWidget *desktop = qApp->desktop();
|
||||
|
||||
ui->monitorCbx->addItem(tr("Focused screen"), QVariant(-1));
|
||||
|
||||
int monCnt = desktop->screenCount();
|
||||
for (int i = 0; i < monCnt; ++i)
|
||||
ui->monitorCbx->addItem(tr("Always on screen %1").arg(i + 1), QVariant(i));
|
||||
|
||||
ui->monitorCbx->setEnabled(monCnt > 1);
|
||||
connect(ui->monitorCbx, SIGNAL(currentIndexChanged(int)), this, SLOT(monitorCbxChanged(int)));
|
||||
|
||||
|
||||
// Shortcut .................................
|
||||
connect(ui->shortcutEd, SIGNAL(shortcutGrabbed(QString)), this, SLOT(shortcutChanged(QString)));
|
||||
|
||||
connect(ui->shortcutEd->addMenuAction(tr("Reset")), SIGNAL(triggered()), this, SLOT(shortcutReset()));
|
||||
|
||||
settingsChanged();
|
||||
|
||||
connect(ui->historyUseCb, &QAbstractButton::toggled, [this] (bool checked) { mSettings->setValue("dialog/history_use", checked); });
|
||||
connect(ui->historyFirstCb, &QAbstractButton::toggled, [this] (bool checked) { mSettings->setValue("dialog/history_first", checked); });
|
||||
connect(ui->listShownItemsSB, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this] (int i) { mSettings->setValue("dialog/list_shown_items", i); });
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::settingsChanged()
|
||||
{
|
||||
if (mSettings->value("dialog/show_on_top", true).toBool())
|
||||
ui->positionCbx->setCurrentIndex(0);
|
||||
else
|
||||
ui->positionCbx->setCurrentIndex(1);
|
||||
|
||||
ui->monitorCbx->setCurrentIndex(mSettings->value("dialog/monitor", -1).toInt() + 1);
|
||||
ui->shortcutEd->setText(mSettings->value("dialog/shortcut", "Alt+F2").toString());
|
||||
const bool history_use = mSettings->value("dialog/history_use", true).toBool();
|
||||
ui->historyUseCb->setChecked(history_use);
|
||||
ui->historyFirstCb->setChecked(mSettings->value("dialog/history_first", true).toBool());
|
||||
ui->historyFirstCb->setEnabled(history_use);
|
||||
ui->listShownItemsSB->setValue(mSettings->value("dialog/list_shown_items", 4).toInt());
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
ConfigureDialog::~ConfigureDialog()
|
||||
{
|
||||
delete mOldSettings;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::shortcutChanged(const QString &text)
|
||||
{
|
||||
ui->shortcutEd->setText(text);
|
||||
mSettings->setValue("dialog/shortcut", text);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::shortcutReset()
|
||||
{
|
||||
shortcutChanged(mDefaultShortcut);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::positionCbxChanged(int index)
|
||||
{
|
||||
mSettings->setValue("dialog/show_on_top", index == 0);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::monitorCbxChanged(int index)
|
||||
{
|
||||
mSettings->setValue("dialog/monitor", index - 1);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void ConfigureDialog::resetSettings()
|
||||
{
|
||||
mOldSettings->loadToSettings();
|
||||
ui->shortcutEd->clear();
|
||||
settingsChanged();
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#ifndef CONFIGUREDIALOG_H
|
||||
#define CONFIGUREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureDialog;
|
||||
}
|
||||
|
||||
class QSettings;
|
||||
|
||||
namespace LXQt {
|
||||
class SettingsCache;
|
||||
}
|
||||
|
||||
class ConfigureDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Position {
|
||||
PositionTop,
|
||||
PositionCenter
|
||||
};
|
||||
|
||||
|
||||
explicit ConfigureDialog(QSettings *settings, const QString &defaultShortcut, QWidget *parent = 0);
|
||||
~ConfigureDialog();
|
||||
|
||||
protected:
|
||||
// void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
Ui::ConfigureDialog *ui;
|
||||
QSettings *mSettings;
|
||||
LXQt::SettingsCache *mOldSettings;
|
||||
QString mDefaultShortcut;
|
||||
|
||||
private slots:
|
||||
void shortcutChanged(const QString &text);
|
||||
void shortcutReset();
|
||||
void settingsChanged();
|
||||
void positionCbxChanged(int index);
|
||||
void monitorCbxChanged(int index);
|
||||
void resetSettings();
|
||||
};
|
||||
|
||||
#endif // CONFIGUREDIALOG_H
|
@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureDialog</class>
|
||||
<widget class="QDialog" name="ConfigureDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>312</width>
|
||||
<height>278</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Runner Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Appearance</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Positioning:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="positionCbx"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Show on:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="monitorCbx"/>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="historyFirstCb">
|
||||
<property name="text">
|
||||
<string>Show history first</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="historyUseCb">
|
||||
<property name="text">
|
||||
<string>Store/show history</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="toolTip">
|
||||
<string><b>Note</b>: The size of top-level widgets are constrained to 2/3 of the desktop's height and width.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show list with:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="listShownItemsSB">
|
||||
<property name="suffix">
|
||||
<string> item(s)</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Shortcut:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="ShortcutSelector" name="shortcutEd">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>81</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>38</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Reset</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ShortcutSelector</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header location="global">LXQtGlobalKeysUi/ShortcutSelector</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ConfigureDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ConfigureDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>historyUseCb</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>historyFirstCb</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>155</x>
|
||||
<y>114</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>155</x>
|
||||
<y>143</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -0,0 +1 @@
|
||||
10
|
@ -1,6 +0,0 @@
|
||||
[DEFAULT]
|
||||
debian-branch = debian/sid
|
||||
upstream-branch = upstream/latest
|
||||
pristine-tar = True
|
||||
compression = xz
|
||||
|
@ -1 +0,0 @@
|
||||
usr/share/lxqt/translations/lxqt-runner
|
@ -1,2 +0,0 @@
|
||||
etc/xdg/autostart/lxqt-runner.desktop
|
||||
usr/bin/lxqt-runner
|
@ -1 +1 @@
|
||||
usr/share/man/man1/lxqt-runner.1
|
||||
man/lxqt-runner.1
|
||||
|
@ -0,0 +1,43 @@
|
||||
Description: AppLinkItem: Make genericName searchable
|
||||
Author: Palo Kisa <palo.kisa@gmail.com>
|
||||
Origin: backport
|
||||
Bug: https://github.com/lxde/lxqt/issues/1278
|
||||
Applied-Upstream: commit:c47a674
|
||||
Last-Update: 2018-02-05
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
-set(REQUIRED_MENUCACHE_VERSION "0.3.3")
|
||||
+set(REQUIRED_MENUCACHE_VERSION "1.1.0")
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(GNUInstallDirs)
|
||||
--- a/providers.cpp
|
||||
+++ b/providers.cpp
|
||||
@@ -192,8 +192,8 @@ AppLinkItem::AppLinkItem(MenuCacheApp* a
|
||||
MenuCacheItem* item = MENU_CACHE_ITEM(app);
|
||||
mIconName = QString::fromUtf8(menu_cache_item_get_icon(item));
|
||||
mTitle = QString::fromUtf8(menu_cache_item_get_name(item));
|
||||
- mComment = QString::fromUtf8(menu_cache_item_get_comment(item));
|
||||
- mToolTip = mComment;
|
||||
+ mComment = QString::fromUtf8(menu_cache_app_get_generic_name(app));
|
||||
+ mToolTip = QString::fromUtf8(menu_cache_item_get_comment(item));
|
||||
mCommand = menu_cache_app_get_exec(app);
|
||||
mProgram = QFileInfo(mCommand).baseName().section(" ", 0, 0);
|
||||
char* path = menu_cache_item_get_file_path(MENU_CACHE_ITEM(app));
|
||||
@@ -271,8 +271,10 @@ bool AppLinkItem::compare(const QRegExp
|
||||
if (regExp.isEmpty())
|
||||
return false;
|
||||
|
||||
- return mProgram.contains(regExp) ||
|
||||
- mTitle.contains(regExp) ;
|
||||
+ return mProgram.contains(regExp)
|
||||
+ || mTitle.contains(regExp)
|
||||
+ || mComment.contains(regExp)
|
||||
+ || mToolTip.contains(regExp);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
# Ubuntu-specific patches
|
||||
make-genericName-searchable.patch
|
@ -1 +1,2 @@
|
||||
tar-ignore=.gitignore
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
Name: lxqt-runner
|
||||
Bug-Database: https://github.com/lxqt/lxqt-runner/issues
|
||||
Bug-Submit: https://github.com/lxqt/lxqt-runner/issues/new
|
||||
Changelog: https://github.com/lxqt/lxqt-runner/blob/master/CHANGELOG
|
||||
Repository: https://github.com/lxqt/lxqt-runner
|
||||
Repository-Browse: https://github.com/lxqt/lxqt-runner
|
@ -1,52 +1,50 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
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
|
||||
sw==
|
||||
=gSIv
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
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
|
||||
=h7ww
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
@ -1,5 +1,3 @@
|
||||
version=4
|
||||
opts="searchmode=plain, \
|
||||
pgpsigurlmangle=s/$/.asc/, \
|
||||
uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
|
||||
https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz
|
||||
opts="pgpsigurlmangle=s/$/.asc/" \
|
||||
https://github.com/lxde/lxqt-runner/releases .*/lxqt-runner-([\d\.]+).tar.xz
|
||||
|
@ -0,0 +1,492 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
* Petr Vanek <petr@scribus.info>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#include "dialog.h"
|
||||
#include "ui_dialog.h"
|
||||
#include "widgets.h"
|
||||
#include "commanditemmodel.h"
|
||||
#include "configuredialog/configuredialog.h"
|
||||
|
||||
#include <LXQt/Settings>
|
||||
#include <LXQt/HtmlDelegate>
|
||||
#include <XdgIcon>
|
||||
#include <LXQt/PowerManager>
|
||||
#include <LXQt/ScreenSaver>
|
||||
#include <LXQtGlobalKeys/Action>
|
||||
#include <LXQtGlobalKeys/Client>
|
||||
#include <QDebug>
|
||||
#include <QCloseEvent>
|
||||
#include <QDesktopWidget>
|
||||
#include <QProcess>
|
||||
#include <QLineEdit>
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
#include <QWindow>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include <KWindowSystem/KWindowSystem>
|
||||
|
||||
#define DEFAULT_SHORTCUT "Alt+F2"
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
Dialog::Dialog(QWidget *parent) :
|
||||
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint),
|
||||
ui(new Ui::Dialog),
|
||||
mSettings(new LXQt::Settings("lxqt-runner", this)),
|
||||
mGlobalShortcut(0),
|
||||
mLockCascadeChanges(false),
|
||||
mDesktopChanged(false),
|
||||
mConfigureDialog(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("LXQt Runner");
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
connect(LXQt::Settings::globalSettings(), SIGNAL(iconThemeChanged()), this, SLOT(update()));
|
||||
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
|
||||
connect(mSettings, SIGNAL(settingsChanged()), this, SLOT(applySettings()));
|
||||
|
||||
ui->commandEd->installEventFilter(this);
|
||||
|
||||
connect(ui->commandEd, SIGNAL(textChanged(QString)), this, SLOT(setFilter(QString)));
|
||||
connect(ui->commandEd, SIGNAL(returnPressed()), this, SLOT(runCommand()));
|
||||
|
||||
mCommandItemModel = new CommandItemModel(mSettings->value("dialog/history_use", true).toBool(), this);
|
||||
ui->commandList->installEventFilter(this);
|
||||
ui->commandList->setModel(mCommandItemModel);
|
||||
ui->commandList->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
connect(ui->commandList, SIGNAL(clicked(QModelIndex)), this, SLOT(runCommand()));
|
||||
setFilter(QString());
|
||||
dataChanged();
|
||||
|
||||
ui->commandList->setItemDelegate(new LXQt::HtmlDelegate(QSize(32, 32), ui->commandList));
|
||||
|
||||
// Popup menu ...............................
|
||||
QAction *a = new QAction(XdgIcon::fromTheme("configure"), tr("Configure"), this);
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(showConfigDialog()));
|
||||
addAction(a);
|
||||
|
||||
a = new QAction(XdgIcon::fromTheme("edit-clear-history"), tr("Clear History"), this);
|
||||
connect(a, SIGNAL(triggered()), mCommandItemModel, SLOT(clearHistory()));
|
||||
addAction(a);
|
||||
|
||||
mPowerManager = new LXQt::PowerManager(this);
|
||||
addActions(mPowerManager->availableActions());
|
||||
mScreenSaver = new LXQt::ScreenSaver(this);
|
||||
addActions(mScreenSaver->availableActions());
|
||||
|
||||
setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
|
||||
QMenu *menu = new QMenu(this);
|
||||
menu->addActions(actions());
|
||||
ui->actionButton->setMenu(menu);
|
||||
// End of popup menu ........................
|
||||
|
||||
applySettings();
|
||||
|
||||
connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), SLOT(realign()));
|
||||
connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(realign()));
|
||||
connect(mGlobalShortcut, SIGNAL(activated()), this, SLOT(showHide()));
|
||||
connect(mGlobalShortcut, SIGNAL(shortcutChanged(QString,QString)), this, SLOT(shortcutChanged(QString,QString)));
|
||||
connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId)));
|
||||
connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged, this, &Dialog::onCurrentDesktopChanged);
|
||||
|
||||
resize(mSettings->value("dialog/width", 400).toInt(), size().height());
|
||||
|
||||
// TEST
|
||||
connect(mCommandItemModel, SIGNAL(layoutChanged()), this, SLOT(dataChanged()));
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
Dialog::~Dialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
hide();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
QSize Dialog::sizeHint() const
|
||||
{
|
||||
QSize size = QDialog::sizeHint();
|
||||
size.setWidth(this->size().width());
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
mSettings->setValue("dialog/width", size().width());
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool Dialog::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::KeyPress)
|
||||
{
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
|
||||
if (object == ui->commandEd)
|
||||
return editKeyPressEvent(keyEvent);
|
||||
|
||||
if (object == ui->commandList)
|
||||
return listKeyPressEvent(keyEvent);
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(object, event);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
eventFilter for ui->commandEd
|
||||
************************************************/
|
||||
bool Dialog::editKeyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_N:
|
||||
if (event->modifiers().testFlag(Qt::ControlModifier))
|
||||
{
|
||||
QKeyEvent ev(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier);
|
||||
editKeyPressEvent(&ev);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case Qt::Key_P:
|
||||
if (event->modifiers().testFlag(Qt::ControlModifier))
|
||||
{
|
||||
QKeyEvent ev(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier);
|
||||
editKeyPressEvent(&ev);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case Qt::Key_Up:
|
||||
case Qt::Key_PageUp:
|
||||
if (ui->commandEd->text().isEmpty() &&
|
||||
ui->commandList->isVisible() &&
|
||||
ui->commandList->currentIndex().row() == 0
|
||||
)
|
||||
{
|
||||
setFilter(QString(), false);
|
||||
return true;
|
||||
}
|
||||
qApp->sendEvent(ui->commandList, event);
|
||||
return true;
|
||||
|
||||
case Qt::Key_Down:
|
||||
case Qt::Key_PageDown:
|
||||
if (ui->commandEd->text().isEmpty() &&
|
||||
ui->commandList->isHidden()
|
||||
)
|
||||
{
|
||||
setFilter(QString(), true);
|
||||
|
||||
// set focus to the list so that it highlights the first item correctly,
|
||||
// and then set it back to the textfield, where it belongs
|
||||
ui->commandList->setFocus();
|
||||
ui->commandEd->setFocus();
|
||||
return true;
|
||||
}
|
||||
qApp->sendEvent(ui->commandList, event);
|
||||
return true;
|
||||
|
||||
case Qt::Key_Tab:
|
||||
const CommandProviderItem *command = mCommandItemModel->command(ui->commandList->currentIndex());
|
||||
if (command)
|
||||
ui->commandEd->setText(command->title());
|
||||
return true;
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(ui->commandList, event);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
eventFilter for ui->commandList
|
||||
************************************************/
|
||||
bool Dialog::listKeyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_Up:
|
||||
case Qt::Key_PageUp:
|
||||
if (ui->commandList->currentIndex().row() == 0)
|
||||
{
|
||||
ui->commandEd->setFocus();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_Left:
|
||||
case Qt::Key_Right:
|
||||
ui->commandEd->setFocus();
|
||||
qApp->sendEvent(ui->commandEd, event);
|
||||
return true;
|
||||
|
||||
default:
|
||||
// Alphabetical or number key ...........
|
||||
if (!event->text().isEmpty())
|
||||
{
|
||||
ui->commandEd->setFocus();
|
||||
qApp->sendEvent(ui->commandEd, event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(ui->commandEd, event);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::showHide()
|
||||
{
|
||||
// Using KWindowSystem to detect the active window since
|
||||
// QWidget::isActiveWindow is not working reliably.
|
||||
if (isVisible() && (KWindowSystem::activeWindow() == winId()))
|
||||
{
|
||||
hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
realign();
|
||||
show();
|
||||
KWindowSystem::forceActiveWindow(winId());
|
||||
ui->commandEd->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::realign()
|
||||
{
|
||||
QRect desktop;
|
||||
|
||||
int screen = mMonitor;
|
||||
if (mMonitor < 0 || mMonitor > QApplication::desktop()->screenCount() - 1)
|
||||
screen = QApplication::desktop()->screenNumber(QCursor::pos());
|
||||
|
||||
desktop = QApplication::desktop()->availableGeometry(screen).intersected(KWindowSystem::workArea(screen));
|
||||
|
||||
QRect rect = this->geometry();
|
||||
rect.moveCenter(desktop.center());
|
||||
|
||||
if (mShowOnTop)
|
||||
rect.moveTop(desktop.top());
|
||||
else
|
||||
rect.moveTop(desktop.center().y() - ui->panel->sizeHint().height());
|
||||
|
||||
setGeometry(rect);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::applySettings()
|
||||
{
|
||||
if (mLockCascadeChanges)
|
||||
return;
|
||||
|
||||
// Shortcut .................................
|
||||
QString shortcut = mSettings->value("dialog/shortcut", DEFAULT_SHORTCUT).toString();
|
||||
if (shortcut.isEmpty())
|
||||
shortcut = DEFAULT_SHORTCUT;
|
||||
|
||||
if (!mGlobalShortcut)
|
||||
mGlobalShortcut = GlobalKeyShortcut::Client::instance()->addAction(shortcut, "/runner/show_hide_dialog", tr("Show/hide runner dialog"), this);
|
||||
else if (mGlobalShortcut->shortcut() != shortcut)
|
||||
mGlobalShortcut->changeShortcut(shortcut);
|
||||
|
||||
mShowOnTop = mSettings->value("dialog/show_on_top", true).toBool();
|
||||
|
||||
mMonitor = mSettings->value("dialog/monitor", -1).toInt();
|
||||
|
||||
mCommandItemModel->setUseHistory(mSettings->value("dialog/history_use", true).toBool());
|
||||
mCommandItemModel->showHistoryFirst(mSettings->value("dialog/history_first", true).toBool());
|
||||
ui->commandList->setShownCount(mSettings->value("dialog/list_shown_items", 4).toInt());
|
||||
|
||||
realign();
|
||||
mSettings->sync();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::shortcutChanged(const QString &/*oldShortcut*/, const QString &newShortcut)
|
||||
{
|
||||
if (!newShortcut.isEmpty())
|
||||
{
|
||||
mLockCascadeChanges = true;
|
||||
|
||||
mSettings->setValue("dialog/shortcut", newShortcut);
|
||||
mSettings->sync();
|
||||
|
||||
mLockCascadeChanges = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::onActiveWindowChanged(WId id)
|
||||
{
|
||||
if (isVisible() && 0 != id && id != winId())
|
||||
{
|
||||
if (mDesktopChanged)
|
||||
{
|
||||
mDesktopChanged = false;
|
||||
KWindowSystem::forceActiveWindow(winId());
|
||||
} else
|
||||
{
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::onCurrentDesktopChanged(int screen)
|
||||
{
|
||||
if (isVisible())
|
||||
{
|
||||
KWindowSystem::setOnDesktop(winId(), screen);
|
||||
KWindowSystem::forceActiveWindow(winId());
|
||||
//Note: workaround for changing desktop while runner is shown
|
||||
// The KWindowSystem::forceActiveWindow may fail to correctly activate runner if there
|
||||
// are any other windows on the new desktop (probably because of the sequence while WM
|
||||
// changes the virtual desktop (change desktop and activate any of the windows on it))
|
||||
mDesktopChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::setFilter(const QString &text, bool onlyHistory)
|
||||
{
|
||||
if (mCommandItemModel->isOutDated())
|
||||
mCommandItemModel->rebuild();
|
||||
|
||||
QString trimmedText = text.simplified();
|
||||
mCommandItemModel->setCommand(trimmedText);
|
||||
mCommandItemModel->showOnlyHistory(onlyHistory);
|
||||
mCommandItemModel->setFilterRegExp(trimmedText);
|
||||
mCommandItemModel->invalidate();
|
||||
|
||||
// tidy up layout and select first item
|
||||
ui->commandList->doItemsLayout();
|
||||
ui->commandList->setCurrentIndex(mCommandItemModel->index(0, 0));
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::dataChanged()
|
||||
{
|
||||
if (mCommandItemModel->rowCount())
|
||||
{
|
||||
ui->commandList->setCurrentIndex(mCommandItemModel->appropriateItem(mCommandItemModel->command()));
|
||||
ui->commandList->scrollTo(ui->commandList->currentIndex());
|
||||
ui->commandList->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->commandList->hide();
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::runCommand()
|
||||
{
|
||||
bool res =false;
|
||||
const CommandProviderItem *command = mCommandItemModel->command(ui->commandList->currentIndex());
|
||||
|
||||
if (command)
|
||||
res = command->run();
|
||||
|
||||
if (res)
|
||||
{
|
||||
hide();
|
||||
ui->commandEd->clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void Dialog::showConfigDialog()
|
||||
{
|
||||
if (!mConfigureDialog)
|
||||
mConfigureDialog = new ConfigureDialog(mSettings, DEFAULT_SHORTCUT, this);
|
||||
mConfigureDialog->exec();
|
||||
}
|
||||
|
||||
#undef DEFAULT_SHORTCUT
|
@ -0,0 +1,99 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#ifndef DIALOG_H
|
||||
#define DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class Dialog;
|
||||
}
|
||||
|
||||
namespace LXQt {
|
||||
class Settings;
|
||||
class PowerManager;
|
||||
class ScreenSaver;
|
||||
}
|
||||
|
||||
class CommandListView;
|
||||
class CommandItemModel;
|
||||
class ConfigureDialog;
|
||||
|
||||
namespace GlobalKeyShortcut
|
||||
{
|
||||
class Action;
|
||||
}
|
||||
|
||||
|
||||
class Dialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Dialog(QWidget *parent = 0);
|
||||
~Dialog();
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
bool editKeyPressEvent(QKeyEvent *event);
|
||||
bool listKeyPressEvent(QKeyEvent *event);
|
||||
|
||||
private:
|
||||
Ui::Dialog *ui;
|
||||
LXQt::Settings *mSettings;
|
||||
GlobalKeyShortcut::Action *mGlobalShortcut;
|
||||
CommandItemModel *mCommandItemModel;
|
||||
bool mShowOnTop;
|
||||
int mMonitor;
|
||||
LXQt::PowerManager *mPowerManager;
|
||||
LXQt::ScreenSaver *mScreenSaver;
|
||||
|
||||
bool mLockCascadeChanges;
|
||||
bool mDesktopChanged; //!< \note flag for changing desktop & activation workaround
|
||||
|
||||
ConfigureDialog *mConfigureDialog;
|
||||
|
||||
private slots:
|
||||
void realign();
|
||||
void applySettings();
|
||||
void showHide();
|
||||
void setFilter(const QString &text, bool onlyHistory=false);
|
||||
void dataChanged();
|
||||
void runCommand();
|
||||
void showConfigDialog();
|
||||
void shortcutChanged(const QString &oldShortcut, const QString &newShortcut);
|
||||
void onActiveWindowChanged(WId id);
|
||||
void onCurrentDesktopChanged(int desktop);
|
||||
};
|
||||
|
||||
#endif // DIALOG_H
|
||||
|
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>342</width>
|
||||
<height>236</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Application launcher </string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="panel">
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="HorizSizeGrip" name="leftSizer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeHorCursor</cursorShape>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="commandEd"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="actionButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-down"/>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::NoArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="closeButton">
|
||||
<property name="text">
|
||||
<string notr="true">X</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="window-close"/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="HorizSizeGrip" name="rightSizer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>3</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeHorCursor</cursorShape>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="accessibleDescription">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyListView" name="commandList">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>HorizSizeGrip</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>widgets.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>MyListView</class>
|
||||
<extends>QListView</extends>
|
||||
<header>mylistview.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>closeButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,58 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#include <LXQt/SingleApplication>
|
||||
|
||||
#include <QCommandLineParser>
|
||||
|
||||
#include "dialog.h"
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
LXQt::SingleApplication a(argc, argv);
|
||||
a.setQuitOnLastWindowClosed(false);
|
||||
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QStringLiteral("LXQt Runner"));
|
||||
const QString VERINFO = QStringLiteral(LXQT_RUNNER_VERSION
|
||||
"\nliblxqt " LXQT_VERSION
|
||||
"\nQt " QT_VERSION_STR);
|
||||
a.setApplicationVersion(VERINFO);
|
||||
parser.addVersionOption();
|
||||
parser.addHelpOption();
|
||||
parser.process(a);
|
||||
|
||||
QWidget hiddenPreviewParent{0, Qt::Tool};
|
||||
Dialog d(&hiddenPreviewParent);
|
||||
a.setActivationWindow(&d);
|
||||
|
||||
return a.exec();
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
.TH lxqt-runner "1" "September 2012" "LXQt\ 0.7.0" "LXQt\ Module"
|
||||
.SH NAME
|
||||
lxqt-runner \- Application runner module of \fBLXQt\fR, the Lightweight Desktop Environment
|
||||
.SH SYNOPSIS
|
||||
.B lxqt-runner
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
This module will allow you to launch an application by typing Alt+F2 its pressed on the keyboard.
|
||||
.P
|
||||
The \fBLXQt modules\fR are desktop independent tools,
|
||||
and operate as daemons for the local user for desktop specific operations.
|
||||
.P
|
||||
\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt
|
||||
technologies, ships several core desktop components, all of which are optional:
|
||||
.P
|
||||
* Panel
|
||||
* Desktop
|
||||
* Application launcher \fI(this)\fR
|
||||
* Settings center
|
||||
* Session handler
|
||||
* Polkit handler
|
||||
* Display manager handler
|
||||
.P
|
||||
These components perform similar actions to those available in other desktop
|
||||
environments, and their names are self-descriptive. They are usually not launched
|
||||
by hand but automatically, when choosing a \fBLXQt\fR session in the Display
|
||||
Manager.
|
||||
.SH BEHAVIOR
|
||||
As you type, suggestions will appear. Once you see the application you wish to run you can navigate
|
||||
to it using the mouse or arrow keys on your keyboard. Pressing enter or clicking it will launch
|
||||
the application. The activation key can be changed using the window manager or shortcut daemon
|
||||
such as \fBlxqt-globalkeyshortcuts\fR.
|
||||
.SH AUTOSTART
|
||||
This module only shows at \fBLXQt\fR desktop environment, but you can use in others desktops, by
|
||||
setting an configuring into session startup.
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to https://github.com/lxde/lxqt/issues
|
||||
.SH "SEE ALSO"
|
||||
\fBLXQt\fR it has been tailored for users who value simplicity, speed, and
|
||||
an intuitive interface, also intended for less powerful machines. See also:
|
||||
.\" any module must refers to session app, for more info on start it
|
||||
.P
|
||||
\fBlxqt-session.1\fR LXQt for manage LXQt complete environment
|
||||
.P
|
||||
\fBlxqt-config-session.1\fR LXQt application for config modules on desktop
|
||||
.P
|
||||
.SH AUTHOR
|
||||
This manual page was created by \fBPICCORO Lenz McKAY\fR \fI<mckaygerhard@gmail.com>\fR
|
||||
for \fBLXQt\fR project and VENENUX GNU/Linux but can be used by others.
|
@ -0,0 +1,65 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXQt - a lightweight, Qt based, desktop toolset
|
||||
* http://lxqt.org
|
||||
*
|
||||
* Copyright: 2017 LXQt team
|
||||
* Authors:
|
||||
* Palo Kisa <palo.kisa@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
#if !defined(mylistview_h)
|
||||
#define mylistview_h
|
||||
|
||||
#include <QListView>
|
||||
#include <QDebug>
|
||||
|
||||
class MyListView : public QListView
|
||||
{
|
||||
public:
|
||||
using QListView::QListView;
|
||||
|
||||
inline void setShownCount(int shownCount)
|
||||
{
|
||||
mShownCount = shownCount;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual QSize viewportSizeHint() const override
|
||||
{
|
||||
QAbstractItemModel * m = model();
|
||||
if (m == nullptr)
|
||||
return QSize{};
|
||||
|
||||
QSize s{0, 0};
|
||||
for (int i = 0, i_e = qMin(mShownCount, model()->rowCount(QModelIndex{})); i != i_e; ++i)
|
||||
{
|
||||
const QSize s_i = sizeHintForIndex(m->index(i, 0, QModelIndex{}));
|
||||
s.rwidth() = qMax(s.width(), s_i.width());
|
||||
s.rheight() += s_i.height();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private:
|
||||
int mShownCount = 4;
|
||||
};
|
||||
|
||||
#endif // mylistview_h
|
@ -0,0 +1,999 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2013 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
* Aaron Lewis <the.warl0ck.1989@gmail.com>
|
||||
* Petr Vanek <petr@scribus.info>
|
||||
* Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#include "providers.h"
|
||||
#include "yamlparser.h"
|
||||
#include <XdgIcon>
|
||||
#include <XdgDesktopFile>
|
||||
#include <XdgMenu>
|
||||
#include <XmlHelper>
|
||||
#include <XdgDirs>
|
||||
|
||||
#include <QProcess>
|
||||
#include <QtAlgorithms>
|
||||
#include <QFileInfo>
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
#include <QApplication>
|
||||
#include <QAction>
|
||||
#include <LXQt/PowerManager>
|
||||
#include <LXQt/ScreenSaver>
|
||||
#include "providers.h"
|
||||
#include <LXQtGlobalKeys/Action>
|
||||
#include <wordexp.h>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#define MAX_HISTORY 100
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
static QString expandCommand(const QString &command, QStringList *arguments=0)
|
||||
{
|
||||
QString program;
|
||||
wordexp_t words;
|
||||
|
||||
if (wordexp(command.toLocal8Bit().data(), &words, 0) != 0)
|
||||
return QString();
|
||||
|
||||
char **w;
|
||||
w = words.we_wordv;
|
||||
program = QString::fromLocal8Bit(w[0]);
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
for (size_t i = 1; i < words.we_wordc; i++)
|
||||
*arguments << QString::fromLocal8Bit(w[i]);
|
||||
}
|
||||
|
||||
wordfree(&words);
|
||||
return program;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
static QString which(const QString &progName)
|
||||
{
|
||||
if (progName.isEmpty())
|
||||
return QString();
|
||||
|
||||
if (progName.startsWith(QDir::separator()))
|
||||
{
|
||||
QFileInfo fileInfo(progName);
|
||||
if (fileInfo.isExecutable() && fileInfo.isFile())
|
||||
return fileInfo.absoluteFilePath();
|
||||
}
|
||||
|
||||
const QStringList dirs = QString(getenv("PATH")).split(":");
|
||||
|
||||
foreach (const QString &dir, dirs)
|
||||
{
|
||||
QFileInfo fileInfo(QDir(dir), progName);
|
||||
if (fileInfo.isExecutable() && fileInfo.isFile())
|
||||
return fileInfo.absoluteFilePath();
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
static bool startProcess(QString command)
|
||||
{
|
||||
QStringList args;
|
||||
QString program = expandCommand(command, &args);
|
||||
if (program.isEmpty())
|
||||
return false;
|
||||
if (QProcess::startDetached(program, args))
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
//fallback for executable script with no #!
|
||||
//trying as in system(2)
|
||||
args.prepend(program);
|
||||
args.prepend(QStringLiteral("-c"));
|
||||
return QProcess::startDetached(QStringLiteral("/bin/sh"), args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
unsigned int CommandProviderItem::stringRank(const QString str, const QString pattern) const
|
||||
{
|
||||
int n = str.indexOf(pattern, 0, Qt::CaseInsensitive);
|
||||
if (n<0)
|
||||
return 0;
|
||||
|
||||
return MAX_RANK - ((str.length() - pattern.length()) + n * 5);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandProvider::CommandProvider():
|
||||
QObject(),
|
||||
QList<CommandProviderItem*>()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CommandProvider::~CommandProvider()
|
||||
{
|
||||
// qDebug() << "*****************************************";
|
||||
// qDebug() << hex << this;
|
||||
// qDebug() << "DESTROY";
|
||||
qDeleteAll(*this);
|
||||
// qDebug() << "*****************************************";
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
AppLinkItem::AppLinkItem(const QDomElement &element):
|
||||
CommandProviderItem()
|
||||
{
|
||||
mIconName = element.attribute("icon");
|
||||
mTitle = element.attribute("title");
|
||||
mComment = element.attribute("genericName");
|
||||
mToolTip = element.attribute("comment");
|
||||
mCommand = element.attribute("exec");
|
||||
mProgram = QFileInfo(element.attribute("exec")).baseName().section(" ", 0, 0);
|
||||
mDesktopFile = element.attribute("desktopFile");
|
||||
initExec();
|
||||
QMetaObject::invokeMethod(this, "updateIcon", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
AppLinkItem::AppLinkItem(MenuCacheApp* app):
|
||||
CommandProviderItem()
|
||||
{
|
||||
MenuCacheItem* item = MENU_CACHE_ITEM(app);
|
||||
mIconName = QString::fromUtf8(menu_cache_item_get_icon(item));
|
||||
mTitle = QString::fromUtf8(menu_cache_item_get_name(item));
|
||||
mComment = QString::fromUtf8(menu_cache_item_get_comment(item));
|
||||
mToolTip = mComment;
|
||||
mCommand = menu_cache_app_get_exec(app);
|
||||
mProgram = QFileInfo(mCommand).baseName().section(" ", 0, 0);
|
||||
char* path = menu_cache_item_get_file_path(MENU_CACHE_ITEM(app));
|
||||
mDesktopFile = QString::fromLocal8Bit(path);
|
||||
g_free(path);
|
||||
initExec();
|
||||
QMetaObject::invokeMethod(this, "updateIcon", Qt::QueuedConnection);
|
||||
// qDebug() << "FOUND: " << mIconName << ", " << mCommand;
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void AppLinkItem::updateIcon()
|
||||
{
|
||||
// qDebug() << "*****************************************";
|
||||
// qDebug() << hex << this;
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
if (mIcon.isNull())
|
||||
mIcon = XdgIcon::fromTheme(mIconName);
|
||||
// qDebug() << "*****************************************";
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void AppLinkItem::operator=(const AppLinkItem &other)
|
||||
{
|
||||
mTitle = other.title();
|
||||
mComment = other.comment();
|
||||
mToolTip = other.toolTip();
|
||||
|
||||
mCommand = other.mCommand;
|
||||
mProgram = other.mProgram;
|
||||
mDesktopFile = other.mDesktopFile;
|
||||
mExec = other.mExec;
|
||||
|
||||
mIconName = other.mIconName;
|
||||
mIcon = other.icon();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
unsigned int AppLinkItem::rank(const QString &pattern) const
|
||||
{
|
||||
unsigned int result = qMax(stringRank(mProgram, pattern),
|
||||
stringRank(mTitle, pattern)
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool AppLinkItem::run() const
|
||||
{
|
||||
XdgDesktopFile desktop;
|
||||
if (desktop.load(mDesktopFile))
|
||||
return desktop.startDetached();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool AppLinkItem::compare(const QRegExp ®Exp) const
|
||||
{
|
||||
if (regExp.isEmpty())
|
||||
return false;
|
||||
|
||||
return mProgram.contains(regExp) ||
|
||||
mTitle.contains(regExp) ;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void AppLinkItem::initExec()
|
||||
{
|
||||
static const QRegExp split_re{QStringLiteral("\\s")};
|
||||
XdgDesktopFile desktop;
|
||||
if (desktop.load(mDesktopFile))
|
||||
{
|
||||
QStringList cmd = desktop.value(QStringLiteral("Exec")).toString().split(split_re);
|
||||
if (0 < cmd.size())
|
||||
mExec = which(expandCommand(cmd[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
AppLinkProvider::AppLinkProvider():
|
||||
CommandProvider()
|
||||
{
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
menu_cache_init(0);
|
||||
mMenuCache = menu_cache_lookup(XdgMenu::getMenuFileName().toLocal8Bit());
|
||||
if(mMenuCache)
|
||||
mMenuCacheNotify = menu_cache_add_reload_notify(mMenuCache, (MenuCacheReloadNotify)menuCacheReloadNotify, this);
|
||||
else
|
||||
mMenuCacheNotify = 0;
|
||||
#else
|
||||
mXdgMenu = new XdgMenu();
|
||||
mXdgMenu->setEnvironments(QStringList() << "X-LXQT" << "LXQt");
|
||||
connect(mXdgMenu, SIGNAL(changed()), this, SLOT(update()));
|
||||
mXdgMenu->read(XdgMenu::getMenuFileName());
|
||||
update();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
AppLinkProvider::~AppLinkProvider()
|
||||
{
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
if(mMenuCache)
|
||||
{
|
||||
menu_cache_remove_reload_notify(mMenuCache, mMenuCacheNotify);
|
||||
menu_cache_unref(mMenuCache);
|
||||
}
|
||||
#else
|
||||
delete mXdgMenu;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
|
||||
void AppLinkProvider::menuCacheReloadNotify(MenuCache* cache, gpointer user_data)
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
reinterpret_cast<AppLinkProvider*>(user_data)->update();
|
||||
}
|
||||
|
||||
#else // without menu-cache, use libqtxdg
|
||||
|
||||
void doUpdate(const QDomElement &xml, QHash<QString, AppLinkItem*> &items)
|
||||
{
|
||||
DomElementIterator it(xml, QString());
|
||||
while (it.hasNext())
|
||||
{
|
||||
QDomElement e = it.next();
|
||||
|
||||
// Build submenu ........................
|
||||
if (e.tagName() == "Menu")
|
||||
doUpdate(e, items);
|
||||
|
||||
//Build application link ................
|
||||
else if (e.tagName() == "AppLink")
|
||||
{
|
||||
AppLinkItem *item = new AppLinkItem(e);
|
||||
delete items[item->command()]; // delete previous item;
|
||||
items.insert(item->command(), item);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void AppLinkProvider::update()
|
||||
{
|
||||
emit aboutToBeChanged();
|
||||
QHash<QString, AppLinkItem*> newItems;
|
||||
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
// libmenu-cache is available, use it to get cached app list
|
||||
GSList* apps = menu_cache_list_all_apps(mMenuCache);
|
||||
for(GSList* l = apps; l; l = l->next)
|
||||
{
|
||||
MenuCacheApp* app = MENU_CACHE_APP(l->data);
|
||||
AppLinkItem *item = new AppLinkItem(app);
|
||||
AppLinkItem *prevItem = newItems[item->command()];
|
||||
if(prevItem)
|
||||
delete prevItem; // delete previous item;
|
||||
newItems.insert(item->command(), item);
|
||||
menu_cache_item_unref(MENU_CACHE_ITEM(app));
|
||||
}
|
||||
g_slist_free(apps);
|
||||
#else
|
||||
// use libqtxdg XdgMenu to get installed apps
|
||||
doUpdate(mXdgMenu->xml().documentElement(), newItems);
|
||||
#endif
|
||||
{
|
||||
QMutableListIterator<CommandProviderItem*> i(*this);
|
||||
while (i.hasNext()) {
|
||||
AppLinkItem *item = static_cast<AppLinkItem*>(i.next());
|
||||
AppLinkItem *newItem = newItems.take(item->command());
|
||||
if (newItem)
|
||||
{
|
||||
*(item) = *newItem; // Copy by value, not pointer!
|
||||
// After the item is copied, the original "updateIcon" call queued
|
||||
// on the newItem object is never called since the object iss going to
|
||||
// be deleted. Hence we need to call it on the copied item manually.
|
||||
// Otherwise the copied item will have no icon.
|
||||
// FIXME: this is a dirty hack and it should be made cleaner later.
|
||||
if(item->icon().isNull())
|
||||
QMetaObject::invokeMethod(item, "updateIcon", Qt::QueuedConnection);
|
||||
delete newItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
i.remove();
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QHashIterator<QString, AppLinkItem*> i(newItems);
|
||||
while (i.hasNext())
|
||||
{
|
||||
append(i.next().value());
|
||||
}
|
||||
}
|
||||
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
HistoryItem::HistoryItem(const QString &command):
|
||||
CommandProviderItem()
|
||||
{
|
||||
mIcon = XdgIcon::defaultApplicationIcon();
|
||||
mTitle = command;
|
||||
mComment = QObject::tr("History");
|
||||
mCommand = command;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool HistoryItem::run() const
|
||||
{
|
||||
return startProcess(mCommand);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool HistoryItem::compare(const QRegExp ®Exp) const
|
||||
{
|
||||
return mCommand.contains(regExp);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
unsigned int HistoryItem::rank(const QString &pattern) const
|
||||
{
|
||||
return stringRank(mCommand, pattern);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
HistoryProvider::HistoryProvider():
|
||||
CommandProvider()
|
||||
{
|
||||
QString fileName = (XdgDirs::cacheHome() + "/lxqt-runner.history");
|
||||
mHistoryFile = new QSettings(fileName, QSettings::IniFormat);
|
||||
mHistoryFile->beginGroup("commands");
|
||||
for (uint i=0; i<MAX_HISTORY; ++i)
|
||||
{
|
||||
QString key = QString("%1").arg(i, 3, 10, QChar('0'));
|
||||
if (mHistoryFile->contains(key))
|
||||
{
|
||||
HistoryItem *item = new HistoryItem(mHistoryFile->value(key).toString());
|
||||
append(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
HistoryProvider::~HistoryProvider()
|
||||
{
|
||||
delete mHistoryFile;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void HistoryProvider::AddCommand(const QString &command)
|
||||
{
|
||||
bool commandExists = false;
|
||||
for (int i=0; !commandExists && i<length(); ++i)
|
||||
{
|
||||
if (command == static_cast<HistoryItem*>(at(i))->command())
|
||||
{
|
||||
move(i, 0);
|
||||
commandExists = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!commandExists)
|
||||
{
|
||||
HistoryItem *item = new HistoryItem(command);
|
||||
insert(0, item);
|
||||
}
|
||||
|
||||
mHistoryFile->clear();
|
||||
for (int i=0; i<qMin(length(), MAX_HISTORY); ++i)
|
||||
{
|
||||
QString key = QString("%1").arg(i, 3, 10, QChar('0'));
|
||||
mHistoryFile->setValue(key, static_cast<HistoryItem*>(at(i))->command());
|
||||
}
|
||||
}
|
||||
|
||||
void HistoryProvider::clearHistory()
|
||||
{
|
||||
clear();
|
||||
mHistoryFile->clear();
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CustomCommandItem::CustomCommandItem(CustomCommandProvider *provider):
|
||||
CommandProviderItem(),
|
||||
mProvider(provider)
|
||||
{
|
||||
mIcon = XdgIcon::fromTheme("utilities-terminal");
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
void CustomCommandItem::setCommand(const QString &command)
|
||||
{
|
||||
mCommand = command;
|
||||
mTitle = mCommand;
|
||||
|
||||
mExec = which(expandCommand(command));
|
||||
|
||||
if (!mExec.isEmpty())
|
||||
mComment = QString("%1 %2").arg(mExec, command.section(' ', 1));
|
||||
else
|
||||
mComment = QString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CustomCommandItem::run() const
|
||||
{
|
||||
bool ret = startProcess(mCommand);
|
||||
if (ret && mProvider->historyProvider())
|
||||
mProvider->historyProvider()->AddCommand(mCommand);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool CustomCommandItem::compare(const QRegExp ®Exp) const
|
||||
{
|
||||
return !mComment.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
unsigned int CustomCommandItem::rank(const QString &pattern) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
CustomCommandProvider::CustomCommandProvider():
|
||||
CommandProvider(),
|
||||
mHistoryProvider(0)
|
||||
{
|
||||
mItem = new CustomCommandItem(this);
|
||||
append(mItem);
|
||||
}
|
||||
|
||||
#ifdef VBOX_ENABLED
|
||||
VirtualBoxItem::VirtualBoxItem(const QString & MachineName , const QIcon & Icon):
|
||||
CommandProviderItem()
|
||||
{
|
||||
mTitle = MachineName;
|
||||
mIcon = Icon;
|
||||
}
|
||||
|
||||
void VirtualBoxItem::setRDEPort(const QString & portNum)
|
||||
{
|
||||
m_rdePortNum = portNum;
|
||||
}
|
||||
|
||||
bool VirtualBoxItem::run() const
|
||||
{
|
||||
QStringList arguments;
|
||||
#ifdef VBOX_HEADLESS_ENABLED
|
||||
arguments << "-startvm" << title();
|
||||
return QProcess::startDetached ("VBoxHeadless" , arguments);
|
||||
#else
|
||||
arguments << "startvm" << title();
|
||||
return QProcess::startDetached ("VBoxManage" , arguments);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
bool VirtualBoxItem::compare(const QRegExp ®Exp) const
|
||||
{
|
||||
return (! regExp.isEmpty() && -1 != regExp.indexIn (title ()));
|
||||
}
|
||||
|
||||
unsigned int VirtualBoxItem::rank(const QString &pattern) const
|
||||
{
|
||||
return stringRank(mTitle, pattern);
|
||||
}
|
||||
|
||||
inline QString homeDir() {
|
||||
return QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
}
|
||||
|
||||
///////
|
||||
VirtualBoxProvider::VirtualBoxProvider():
|
||||
virtualBoxConfig ( homeDir() + "/.VirtualBox/VirtualBox.xml")
|
||||
{
|
||||
fp.setFileName (virtualBoxConfig);
|
||||
|
||||
static const char *kOSTypeIcons [][2] =
|
||||
{
|
||||
{"Other", ":/vbox-icons/os_other.png"},
|
||||
{"DOS", ":/vbox-icons/os_dos.png"},
|
||||
{"Netware", ":/vbox-icons/os_netware.png"},
|
||||
{"L4", ":/vbox-icons/os_l4.png"},
|
||||
{"Windows31", ":/vbox-icons/os_win31.png"},
|
||||
{"Windows95", ":/vbox-icons/os_win95.png"},
|
||||
{"Windows98", ":/vbox-icons/os_win98.png"},
|
||||
{"WindowsMe", ":/vbox-icons/os_winme.png"},
|
||||
{"WindowsNT4", ":/vbox-icons/os_winnt4.png"},
|
||||
{"Windows2000", ":/vbox-icons/os_win2k.png"},
|
||||
{"WindowsXP", ":/vbox-icons/os_winxp.png"},
|
||||
{"WindowsXP_64", ":/vbox-icons/os_winxp_64.png"},
|
||||
{"Windows2003", ":/vbox-icons/os_win2k3.png"},
|
||||
{"Windows2003_64", ":/vbox-icons/os_win2k3_64.png"},
|
||||
{"WindowsVista", ":/vbox-icons/os_winvista.png"},
|
||||
{"WindowsVista_64", ":/vbox-icons/os_winvista_64.png"},
|
||||
{"Windows2008", ":/vbox-icons/os_win2k8.png"},
|
||||
{"Windows2008_64", ":/vbox-icons/os_win2k8_64.png"},
|
||||
{"Windows7", ":/vbox-icons/os_win7.png"},
|
||||
{"Windows7_64", ":/vbox-icons/os_win7_64.png"},
|
||||
{"WindowsNT", ":/vbox-icons/os_win_other.png"},
|
||||
{"OS2Warp3", ":/vbox-icons/os_os2warp3.png"},
|
||||
{"OS2Warp4", ":/vbox-icons/os_os2warp4.png"},
|
||||
{"OS2Warp45", ":/vbox-icons/os_os2warp45.png"},
|
||||
{"OS2eCS", ":/vbox-icons/os_os2ecs.png"},
|
||||
{"OS2", ":/vbox-icons/os_os2_other.png"},
|
||||
{"Linux22", ":/vbox-icons/os_linux22.png"},
|
||||
{"Linux24", ":/vbox-icons/os_linux24.png"},
|
||||
{"Linux24_64", ":/vbox-icons/os_linux24_64.png"},
|
||||
{"Linux26", ":/vbox-icons/os_linux26.png"},
|
||||
{"Linux26_64", ":/vbox-icons/os_linux26_64.png"},
|
||||
{"ArchLinux", ":/vbox-icons/os_archlinux.png"},
|
||||
{"ArchLinux_64", ":/vbox-icons/os_archlinux_64.png"},
|
||||
{"Debian", ":/vbox-icons/os_debian.png"},
|
||||
{"Debian_64", ":/vbox-icons/os_debian_64.png"},
|
||||
{"OpenSUSE", ":/vbox-icons/os_opensuse.png"},
|
||||
{"OpenSUSE_64", ":/vbox-icons/os_opensuse_64.png"},
|
||||
{"Fedora", ":/vbox-icons/os_fedora.png"},
|
||||
{"Fedora_64", ":/vbox-icons/os_fedora_64.png"},
|
||||
{"Gentoo", ":/vbox-icons/os_gentoo.png"},
|
||||
{"Gentoo_64", ":/vbox-icons/os_gentoo_64.png"},
|
||||
{"Mandriva", ":/vbox-icons/os_mandriva.png"},
|
||||
{"Mandriva_64", ":/vbox-icons/os_mandriva_64.png"},
|
||||
{"RedHat", ":/vbox-icons/os_redhat.png"},
|
||||
{"RedHat_64", ":/vbox-icons/os_redhat_64.png"},
|
||||
{"Ubuntu", ":/vbox-icons/os_ubuntu.png"},
|
||||
{"Ubuntu_64", ":/vbox-icons/os_ubuntu_64.png"},
|
||||
{"Xandros", ":/vbox-icons/os_xandros.png"},
|
||||
{"Xandros_64", ":/vbox-icons/os_xandros_64.png"},
|
||||
{"Linux", ":/vbox-icons/os_linux_other.png"},
|
||||
{"FreeBSD", ":/vbox-icons/os_freebsd.png"},
|
||||
{"FreeBSD_64", ":/vbox-icons/os_freebsd_64.png"},
|
||||
{"OpenBSD", ":/vbox-icons/os_openbsd.png"},
|
||||
{"OpenBSD_64", ":/vbox-icons/os_openbsd_64.png"},
|
||||
{"NetBSD", ":/vbox-icons/os_netbsd.png"},
|
||||
{"NetBSD_64", ":/vbox-icons/os_netbsd_64.png"},
|
||||
{"Solaris", ":/vbox-icons/os_solaris.png"},
|
||||
{"Solaris_64", ":/vbox-icons/os_solaris_64.png"},
|
||||
{"OpenSolaris", ":/vbox-icons/os_opensolaris.png"},
|
||||
{"OpenSolaris_64", ":/vbox-icons/os_opensolaris_64.png"},
|
||||
{"QNX", ":/vbox-icons/os_qnx.png"},
|
||||
};
|
||||
|
||||
for (size_t n = 0; n < sizeof (kOSTypeIcons) / sizeof(kOSTypeIcons[0]); ++ n)
|
||||
{
|
||||
osIcons.insert (kOSTypeIcons [n][0], (kOSTypeIcons [n][1]));
|
||||
}
|
||||
}
|
||||
|
||||
void VirtualBoxProvider::rebuild()
|
||||
{
|
||||
QDomDocument d;
|
||||
if ( !d.setContent( &fp ) )
|
||||
{
|
||||
qDebug() << "Unable to parse: " << fp.fileName();
|
||||
return;
|
||||
}
|
||||
|
||||
QDomNodeList _dnlist = d.elementsByTagName( "MachineEntry" );
|
||||
for ( int i = 0; i < _dnlist.count(); i++ )
|
||||
{
|
||||
const QDomNode & node = _dnlist.at( i );
|
||||
const QString & ref = node.toElement().attribute( "src" );
|
||||
if ( ref.isEmpty() )
|
||||
{
|
||||
qDebug() << "MachineEntry with no src attribute";
|
||||
continue;
|
||||
}
|
||||
|
||||
QFile m( ref );
|
||||
|
||||
QDomDocument mspec;
|
||||
if ( !mspec.setContent( &m ) )
|
||||
{
|
||||
qDebug() << "Could not parse machine file " << m.fileName();
|
||||
continue;
|
||||
}
|
||||
|
||||
QDomNodeList _mlist = mspec.elementsByTagName( "Machine" );
|
||||
for ( int j = 0; j < _mlist.count(); j++ )
|
||||
{
|
||||
QDomNode mnode = _mlist.at( j );
|
||||
|
||||
QString type = mnode.toElement().attribute( "OSType" );
|
||||
VirtualBoxItem *virtualBoxItem = new VirtualBoxItem
|
||||
(
|
||||
mnode.toElement().attribute( "name" ) ,
|
||||
QIcon ( osIcons.value (type , ":/vbox-icons/os_other.png") )
|
||||
);
|
||||
|
||||
const QDomNodeList & rdeportConfig = mnode.toElement().elementsByTagName("VRDEProperties");
|
||||
if ( ! rdeportConfig.isEmpty() )
|
||||
{
|
||||
QDomNode portNode = rdeportConfig.at(0).firstChild();
|
||||
virtualBoxItem->setRDEPort( portNode.toElement().attribute("value") );
|
||||
}
|
||||
|
||||
append ( virtualBoxItem );
|
||||
}
|
||||
}
|
||||
|
||||
timeStamp = QDateTime::currentDateTime();
|
||||
|
||||
}
|
||||
|
||||
bool VirtualBoxProvider::isOutDated() const
|
||||
{
|
||||
return fp.exists() && ( timeStamp < QFileInfo ( virtualBoxConfig ).lastModified () );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MATH_ENABLED
|
||||
#include <muParser.h>
|
||||
|
||||
class MathItem::Parser : public mu::Parser
|
||||
{
|
||||
public:
|
||||
static void initLocale()
|
||||
{
|
||||
try
|
||||
{
|
||||
// use the system's locale instead of the "C"
|
||||
s_locale = std::locale{""};
|
||||
} catch (const std::runtime_error & e)
|
||||
{
|
||||
qWarning().noquote() << "Unable to set locale for Math, " << e.what();
|
||||
}
|
||||
}
|
||||
};
|
||||
static void muParserInitLocale()
|
||||
{
|
||||
MathItem::Parser::initLocale();
|
||||
}
|
||||
Q_COREAPP_STARTUP_FUNCTION(muParserInitLocale)
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
MathItem::MathItem():
|
||||
CommandProviderItem(),
|
||||
mParser{new Parser}
|
||||
{
|
||||
mToolTip =QObject::tr("Mathematics");
|
||||
mIcon = XdgIcon::fromTheme("accessories-calculator");
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
MathItem::~MathItem()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool MathItem::run() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
bool MathItem::compare(const QRegExp ®Exp) const
|
||||
{
|
||||
QString s = regExp.pattern().trimmed();
|
||||
|
||||
bool is_math = false;
|
||||
if (s.startsWith('='))
|
||||
{
|
||||
is_math = true;
|
||||
s.remove(0, 1);
|
||||
}
|
||||
if (s.endsWith("="))
|
||||
{
|
||||
is_math = true;
|
||||
s.chop(1);
|
||||
}
|
||||
|
||||
if (is_math)
|
||||
{
|
||||
if (s != mCachedInput)
|
||||
{
|
||||
MathItem * self = const_cast<MathItem*>(this);
|
||||
mCachedInput = s;
|
||||
self->mTitle.clear();
|
||||
|
||||
//try to compute anything suitable
|
||||
for (int attempts = 20; 0 < attempts && 0 < s.size(); s.chop(1), --attempts)
|
||||
{
|
||||
try
|
||||
{
|
||||
mParser->SetExpr(s.toStdString());
|
||||
self->mTitle = s + "=" + QLocale::system().toString(mParser->Eval());
|
||||
break;
|
||||
} catch (const mu::Parser::exception_type & e)
|
||||
{
|
||||
//don't do anything, return false -> no result will be showed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !mTitle.isEmpty();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
unsigned int MathItem::rank(const QString &pattern) const
|
||||
{
|
||||
return stringRank(mTitle, pattern);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
************************************************/
|
||||
MathProvider::MathProvider()
|
||||
{
|
||||
append(new MathItem());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ExternalProviderItem::ExternalProviderItem()
|
||||
{
|
||||
}
|
||||
|
||||
bool ExternalProviderItem::setData(QMap<QString,QString> & data)
|
||||
{
|
||||
if (! (data.contains("title") && data.contains("command")))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
mTitle = data["title"];
|
||||
mComment = data["comment"];
|
||||
mToolTip = data["tooltip"];
|
||||
mCommand = data["command"];
|
||||
if (data.contains("icon"))
|
||||
mIcon = XdgIcon::fromTheme(data["icon"]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool ExternalProviderItem::run() const
|
||||
{
|
||||
return startProcess(mCommand);
|
||||
}
|
||||
|
||||
unsigned int ExternalProviderItem::rank(const QString& pattern) const
|
||||
{
|
||||
return stringRank(title(), pattern);
|
||||
}
|
||||
|
||||
ExternalProvider::ExternalProvider(const QString name, const QString externalProgram) :
|
||||
CommandProvider(), mName(name)
|
||||
{
|
||||
mExternalProcess = new QProcess(this);
|
||||
mYamlParser = new YamlParser();
|
||||
connect(mYamlParser, SIGNAL(newListOfMaps(QList<QMap<QString, QString> >)),
|
||||
this, SLOT(newListOfMaps(QList<QMap<QString, QString> >)));
|
||||
|
||||
connect(mExternalProcess, SIGNAL(readyRead()), this, SLOT(readFromProcess()));
|
||||
mExternalProcess->start(externalProgram);
|
||||
}
|
||||
|
||||
void ExternalProvider::setSearchTerm(const QString searchTerm)
|
||||
{
|
||||
mExternalProcess->write(searchTerm.toUtf8());
|
||||
mExternalProcess->write(QString("\n").toUtf8());
|
||||
}
|
||||
|
||||
void ExternalProvider::newListOfMaps(QList<QMap<QString,QString> > maps)
|
||||
{
|
||||
emit aboutToBeChanged();
|
||||
|
||||
qDeleteAll(*this);
|
||||
clear();
|
||||
|
||||
QMap<QString, QString> map;
|
||||
foreach(map, maps)
|
||||
{
|
||||
ExternalProviderItem *item = new ExternalProviderItem();
|
||||
if (item->setData(map))
|
||||
this->append(item);
|
||||
else
|
||||
delete item;
|
||||
}
|
||||
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ExternalProvider::readFromProcess()
|
||||
{
|
||||
char ch;
|
||||
while (mExternalProcess->getChar(&ch))
|
||||
{
|
||||
if (ch == '\n')
|
||||
{
|
||||
QString textLine = QString::fromLocal8Bit(mBuffer);
|
||||
mYamlParser->consumeLine(textLine);
|
||||
mBuffer.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
mBuffer.append(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,356 @@
|
||||
/* BEGIN_COMMON_COPYRIGHT_HEADER
|
||||
* (c)LGPL2+
|
||||
*
|
||||
* LXDE-Qt - a lightweight, Qt based, desktop toolset
|
||||
* http://razor-qt.org
|
||||
*
|
||||
* Copyright: 2010-2011 Razor team
|
||||
* Authors:
|
||||
* Alexander Sokoloff <sokoloff.a@gmail.com>
|
||||
* Petr Vanek <petr@scribus.info>
|
||||
*
|
||||
* This program or library is free software; you can redistribute it
|
||||
* and/or modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
* END_COMMON_COPYRIGHT_HEADER */
|
||||
|
||||
|
||||
#ifndef PROVIDERS_H
|
||||
#define PROVIDERS_H
|
||||
|
||||
#include <QList>
|
||||
#include <QRegExp>
|
||||
#include <QDomElement>
|
||||
#include <QString>
|
||||
#include <QIcon>
|
||||
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
#include <menu-cache.h>
|
||||
#endif
|
||||
|
||||
#define MAX_RANK 0xFFFF
|
||||
|
||||
/*! The CommandProviderItem class provides an item for use with CommandProvider.
|
||||
Items usually contain title, comment, toolTip and icon.
|
||||
*/
|
||||
class CommandProviderItem: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CommandProviderItem(): QObject() {}
|
||||
virtual ~CommandProviderItem() {}
|
||||
|
||||
virtual bool run() const = 0;
|
||||
virtual bool compare(const QRegExp ®Exp) const = 0;
|
||||
|
||||
/// Returns the item's icon.
|
||||
QIcon icon() const { return mIcon; }
|
||||
|
||||
/// Returns the item's title.
|
||||
QString title() const { return mTitle; }
|
||||
|
||||
/// Returns the item's comment.
|
||||
QString comment() const { return mComment; }
|
||||
|
||||
/// Returns the item's tooltip.
|
||||
QString toolTip() const { return mToolTip; }
|
||||
|
||||
/*! The result of this function is used when searching for a apropriate item.
|
||||
The item with the highest rank will be highlighted.
|
||||
0 - not suitable.
|
||||
MAX_RANK - an exact match.
|
||||
In the most cases you can yse something like:
|
||||
return stringRank(mTitle, pattern);
|
||||
*/
|
||||
virtual unsigned int rank(const QString &pattern) const = 0;
|
||||
|
||||
protected:
|
||||
/// Helper function for the CommandProviderItem::rank
|
||||
unsigned int stringRank(const QString str, const QString pattern) const;
|
||||
QIcon mIcon;
|
||||
QString mTitle;
|
||||
QString mComment;
|
||||
QString mToolTip;
|
||||
};
|
||||
|
||||
|
||||
/*! The CommandProvider class provides task for the lxqt-runner.
|
||||
*/
|
||||
class CommandProvider: public QObject, public QList<CommandProviderItem*>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CommandProvider();
|
||||
virtual ~CommandProvider();
|
||||
|
||||
virtual void rebuild() {}
|
||||
virtual bool isOutDated() const { return false; }
|
||||
|
||||
signals:
|
||||
void aboutToBeChanged();
|
||||
void changed();
|
||||
};
|
||||
|
||||
|
||||
/************************************************
|
||||
* Application desktop files
|
||||
************************************************/
|
||||
|
||||
class AppLinkItem: public CommandProviderItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AppLinkItem(const QDomElement &element);
|
||||
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
AppLinkItem(MenuCacheApp* app);
|
||||
#endif
|
||||
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const;
|
||||
QString command() const { return mCommand; }
|
||||
QString exec() const { return mExec; }
|
||||
|
||||
void operator=(const AppLinkItem &other);
|
||||
|
||||
virtual unsigned int rank(const QString &pattern) const;
|
||||
private slots:
|
||||
void updateIcon();
|
||||
private:
|
||||
void initExec();
|
||||
private:
|
||||
QString mDesktopFile;
|
||||
QString mIconName;
|
||||
QString mCommand;
|
||||
QString mExec; //!< the expanded executable (full path) from desktop file Exec key
|
||||
QString mProgram;
|
||||
};
|
||||
|
||||
|
||||
class XdgMenu;
|
||||
class AppLinkProvider: public CommandProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AppLinkProvider();
|
||||
virtual ~AppLinkProvider();
|
||||
|
||||
private slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
#ifdef HAVE_MENU_CACHE
|
||||
MenuCache* mMenuCache;
|
||||
MenuCacheNotifyId mMenuCacheNotify;
|
||||
static void menuCacheReloadNotify(MenuCache* cache, gpointer user_data);
|
||||
#else
|
||||
XdgMenu *mXdgMenu;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/************************************************
|
||||
* History
|
||||
************************************************/
|
||||
|
||||
class HistoryItem: public CommandProviderItem
|
||||
{
|
||||
public:
|
||||
HistoryItem(const QString &command);
|
||||
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const;
|
||||
|
||||
QString command() const { return mCommand; }
|
||||
virtual unsigned int rank(const QString &pattern) const;
|
||||
|
||||
private:
|
||||
QString mCommand;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class QSettings;
|
||||
class HistoryProvider: public CommandProvider
|
||||
{
|
||||
public:
|
||||
HistoryProvider();
|
||||
virtual ~HistoryProvider();
|
||||
|
||||
void AddCommand(const QString &command);
|
||||
void clearHistory();
|
||||
|
||||
private:
|
||||
QSettings *mHistoryFile;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/************************************************
|
||||
* Custom command
|
||||
************************************************/
|
||||
class CustomCommandProvider;
|
||||
|
||||
class CustomCommandItem: public CommandProviderItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomCommandItem(CustomCommandProvider *provider);
|
||||
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const;
|
||||
|
||||
QString command() const { return mCommand; }
|
||||
void setCommand(const QString &command);
|
||||
QString exec() const { return mExec; }
|
||||
|
||||
virtual unsigned int rank(const QString &pattern) const;
|
||||
private:
|
||||
QString mCommand;
|
||||
QString mExec; //!< the expanded executable (full path)
|
||||
CustomCommandProvider *mProvider;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class QSettings;
|
||||
class CustomCommandProvider: public CommandProvider
|
||||
{
|
||||
public:
|
||||
CustomCommandProvider();
|
||||
|
||||
QString command() const { return mItem->command(); }
|
||||
void setCommand(const QString &command) { mItem->setCommand(command); }
|
||||
|
||||
HistoryProvider* historyProvider() const { return mHistoryProvider; }
|
||||
void setHistoryProvider(HistoryProvider *historyProvider) { mHistoryProvider = historyProvider; }
|
||||
|
||||
private:
|
||||
CustomCommandItem *mItem;
|
||||
HistoryProvider *mHistoryProvider;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef MATH_ENABLED
|
||||
/************************************************
|
||||
* Mathematics
|
||||
************************************************/
|
||||
class MathItem: public CommandProviderItem
|
||||
{
|
||||
public:
|
||||
class Parser;
|
||||
public:
|
||||
MathItem();
|
||||
~MathItem();
|
||||
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const;
|
||||
virtual unsigned int rank(const QString &pattern) const;
|
||||
private:
|
||||
QScopedPointer<Parser> mParser;
|
||||
mutable QString mCachedInput;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class MathProvider: public CommandProvider
|
||||
{
|
||||
public:
|
||||
MathProvider();
|
||||
//virtual ~MathProvider();
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef VBOX_ENABLED
|
||||
#include <QDateTime>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileInfo>
|
||||
#include <QMap>
|
||||
|
||||
class VirtualBoxItem: public CommandProviderItem
|
||||
{
|
||||
public:
|
||||
VirtualBoxItem(const QString & MachineName , const QIcon & Icon);
|
||||
|
||||
void setRDEPort (const QString & portNum);
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const;
|
||||
virtual unsigned int rank(const QString &pattern) const;
|
||||
private:
|
||||
QString m_rdePortNum;
|
||||
};
|
||||
|
||||
class VirtualBoxProvider: public CommandProvider
|
||||
{
|
||||
public:
|
||||
VirtualBoxProvider ();
|
||||
void rebuild();
|
||||
bool isOutDated() const;
|
||||
|
||||
private:
|
||||
QFile fp;
|
||||
QMap<QString,QString> osIcons;
|
||||
QString virtualBoxConfig;
|
||||
QDateTime timeStamp;
|
||||
};
|
||||
#endif
|
||||
|
||||
class ExternalProviderItem: public CommandProviderItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ExternalProviderItem();
|
||||
|
||||
bool setData(QMap<QString, QString> & data);
|
||||
|
||||
bool run() const;
|
||||
bool compare(const QRegExp ®Exp) const {return true;} // We leave the decision to the external process
|
||||
unsigned int rank(const QString &pattern) const;
|
||||
|
||||
QString mCommand;
|
||||
};
|
||||
|
||||
class QProcess;
|
||||
class YamlParser;
|
||||
class ExternalProvider: public CommandProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ExternalProvider(const QString name, const QString externalProgram);
|
||||
|
||||
void setSearchTerm(const QString searchTerm);
|
||||
|
||||
signals:
|
||||
void dataChanged();
|
||||
|
||||
private slots:
|
||||
void readFromProcess();
|
||||
void newListOfMaps(QList<QMap<QString, QString> > maps);
|
||||
|
||||
private:
|
||||
QString mName;
|
||||
QProcess *mExternalProcess;
|
||||
QTextStream *mDataToProcess;
|
||||
YamlParser *mYamlParser;
|
||||
|
||||
QByteArray mBuffer;
|
||||
};
|
||||
|
||||
|
||||
#endif // PROVIDERS_H
|
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.2 KiB |