Commit 16d840e1 authored by Andrew Lee's avatar Andrew Lee

Merging upstream version 0.9.0+20150806.

parent 8180839f
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
project(lxqt-globalkeys)
......@@ -11,64 +11,85 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Set default library installation path
set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Installation directory for libraries")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(lxqt REQUIRED QUIET)
include(${LXQT_USE_FILE})
include(LXQtTranslate)
include(LXQtCreatePkgConfigFile)
include(LXQtCompilerSettings NO_POLICY_SCOPE)
# Standard directories for installation
include(GNUInstallDirs)
include(GNUInstallDirs) # Standard directories for installation
include(CMakePackageConfigHelpers)
set(LXQT_GLOBALKEYS_LIBRARY_NAME lxqt-globalkeys)
set(LXQT_GLOBALKEYS_UI_LIBRARY_NAME lxqt-globalkeys-ui)
set(LXQT_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/cmake)
set(LXQT_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake")
#************************************************
# Build config.cmake files
#************************************************
#set(LXQT_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/lxqt)
#set(LXQT_TRANSLATIONS_DIR ${LXQT_SHARE_DIR}/translations)
include(cmake/FindInstallConfigPath.cmake)
set(LXQT_GLOBALKEYS_CMAKE_NAME ${LXQT_GLOBALKEYS_LIBRARY_NAME})
set(LXQT_GLOBALKEYS_UI_CMAKE_NAME ${LXQT_GLOBALKEYS_UI_LIBRARY_NAME})
set(LXQT_GLOBALKEYS_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/${LXQT_GLOBALKEYS_LIBRARY_NAME}")
configure_file(
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt_globalkeys-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config.cmake"
@ONLY
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config.cmake"
INSTALL_DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}"
)
set(LXQT_GLOBALKEYS_UI_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/${LXQT_GLOBALKEYS_UI_LIBRARY_NAME})
configure_file(
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt_globalkeys_ui-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config.cmake"
@ONLY
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config.cmake"
INSTALL_DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}"
)
#************************************************
# End of build config.cmake
#************************************************
#************************************************
# Generate config-version.cmake files
#************************************************
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config-version.cmake"
VERSION ${LXQT_VERSION}
COMPATIBILITY AnyNewerVersion
)
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config-version.cmake"
VERSION ${LXQT_VERSION}
COMPATIBILITY AnyNewerVersion
)
#************************************************
# End of generate config-version.cmake files
#************************************************
set(LXQT_GLOBALKEYS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(daemon)
add_subdirectory(config)
add_subdirectory(client)
add_subdirectory(ui)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config.cmake DESTINATION ${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME})
install(FILES cmake/lxqt_globalkeys_use.cmake DESTINATION ${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME})
install(FILES
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config.cmake"
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}-config-version.cmake"
DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config.cmake DESTINATION ${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME})
install(FILES cmake/lxqt_globalkeys_ui_use.cmake DESTINATION ${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME})
install(FILES
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config.cmake"
"${CMAKE_BINARY_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}-config-version.cmake"
DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_UI_CMAKE_NAME}"
)
# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
......
......@@ -5,15 +5,8 @@ set(QT_DBUS_PREFIX "org.qtproject")
set(${PROJECT_NAME}_HEADER_NAMESPACE "LXQtGlobalKeys")
include_directories(
${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set(${PROJECT_NAME}_PATH_TO_DAEMON "${LXQT_GLOBALKEYS_SOURCE_DIR}/daemon")
add_definitions(-DSHARED_EXPORT=Q_DECL_EXPORT)
set(${PROJECT_NAME}_SOURCES
client.cpp
action.cpp
......@@ -21,7 +14,7 @@ set(${PROJECT_NAME}_SOURCES
#
# WARNING: Changing stuff here implies changing this:
# install(FILES ${${PROJECT_NAME}_MAIN_HEADER} DESTINATION include/${PROJECT_NAME} COMPONENT development RENAME "lxqtglobalkeys.h")
# install(FILES ${${PROJECT_NAME}_MAIN_HEADER} DESTINATION include/${PROJECT_NAME} COMPONENT Devel RENAME "lxqtglobalkeys.h")
#
set(${PROJECT_NAME}_MAIN_HEADER
lxqt-globalkeys.h
......@@ -53,10 +46,10 @@ set(${PROJECT_NAME}_TRANSLATIONS
)
set(${PROJECT_NAME}_DBUS_ADAPTORS
${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.client.xml
"${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.client.xml"
)
set_source_files_properties(${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.client.xml PROPERTIES
set_source_files_properties("${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.client.xml" PROPERTIES
INCLUDE action_p.h
PARENT_CLASSNAME GlobalKeyShortcut::ActionImpl
BASENAME org.lxqt.global_key_shortcuts.client
......@@ -64,10 +57,10 @@ set_source_files_properties(${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_ke
)
set(${PROJECT_NAME}_DBUS_INTERFACES
${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.native.xml
"${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.native.xml"
)
set_source_files_properties(${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.native.xml PROPERTIES
set_source_files_properties("${${PROJECT_NAME}_PATH_TO_DAEMON}/org.lxqt.global_key_shortcuts.native.xml" PROPERTIES
BASENAME org.lxqt.global_key_shortcuts.native
)
......@@ -128,16 +121,15 @@ foreach(DBUS_INTERFACE ${${PROJECT_NAME}_DBUS_INTERFACES})
get_source_file_property(DBUS_INTERFACE_INCLUDE ${DBUS_INTERFACE} INCLUDE)
get_source_file_property(DBUS_INTERFACE_CLASSNAME ${DBUS_INTERFACE} CLASSNAME)
get_source_file_property(DBUS_INTERFACE_NO_NAMESPACE ${DBUS_INTERFACE} NO_NAMESPACE)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME} PROPERTIES
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}" PROPERTIES
INCLUDE ${DBUS_INTERFACE_INCLUDE}
CLASSNAME ${DBUS_INTERFACE_CLASSNAME}
NO_NAMESPACE ${DBUS_INTERFACE_NO_NAMESPACE}
)
qt5_add_dbus_interface(${PROJECT_NAME}_DBUS_INTERFACE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME} ${DBUS_INTERFACE_BASENAME})
qt5_add_dbus_interface(${PROJECT_NAME}_DBUS_INTERFACE_FILES "${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}" ${DBUS_INTERFACE_BASENAME})
endforeach()
qt5_add_resources(${PROJECT_NAME}_RESOURCE_FILES ${${PROJECT_NAME}_RESOURCES})
qt5_wrap_ui(${PROJECT_NAME}_FORM_FILES ${${PROJECT_NAME}_FORMS})
set(${PROJECT_NAME}_GENERATED_FILES
${${PROJECT_NAME}_FORM_FILES}
......@@ -153,13 +145,32 @@ set(${PROJECT_NAME}_ALL_FILES
${${PROJECT_NAME}_GENERATED_FILES}
)
set(${PROJECT_NAME}_PKG_CONFIG_REQUIRES "Qt5Widget, Qt5DBus")
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_ALL_FILES})
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::DBus)
target_link_libraries(${PROJECT_NAME}
PUBLIC
Qt5::Widgets
Qt5::DBus
)
set_target_properties(${PROJECT_NAME}
PROPERTIES
VERSION ${LXQT_VERSION}
SOVERSION ${LXQT_MAJOR_VERSION}
)
target_include_directories(${PROJECT_NAME}
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_GLOBALKEYS_LIBRARY_NAME}>"
)
target_include_directories(${PROJECT_NAME}
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/include>"
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/include/${PROJECT_NAME}>"
)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "SHARED_EXPORT=Q_DECL_EXPORT"
)
export(TARGETS ${PROJECT_NAME} FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
include(create_portable_headers)
......@@ -167,11 +178,75 @@ create_portable_headers(${PROJECT_NAME}_PORTABLE_HEADERS
NAMESPACE "${${PROJECT_NAME}_NAMESPACE}/"
FILENAMES ${${PROJECT_NAME}_PUBLIC_CLASSES}
)
install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT runtime)
install(FILES ${${PROJECT_NAME}_MAIN_HEADER} DESTINATION include/${PROJECT_NAME} COMPONENT development)
install(FILES ${${PROJECT_NAME}_MAIN_HEADER} DESTINATION include/${PROJECT_NAME} COMPONENT development RENAME "lxqtglobalkeys.h")
install(FILES ${${PROJECT_NAME}_PORTABLE_HEADERS} DESTINATION include/${PROJECT_NAME}/${${PROJECT_NAME}_HEADER_NAMESPACE} COMPONENT development)
install(FILES ${${PROJECT_NAME}_PUBLIC_HEADERS} DESTINATION include/${PROJECT_NAME} COMPONENT development)
include(create_pkgconfig_file)
create_pkgconfig_file(${PROJECT_NAME} "LXQt global key shortcuts client library")
# Copy public headers for intree building
foreach(h ${${PROJECT_NAME}_PUBLIC_HEADERS})
get_filename_component(bh ${h} NAME)
configure_file(${h} "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/${PROJECT_NAME}/${bh}" COPYONLY)
endforeach()
foreach(h ${${PROJECT_NAME}_PORTABLE_HEADERS})
get_filename_component(bh ${h} NAME)
configure_file(${h} "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/${PROJECT_NAME}/${${PROJECT_NAME}_HEADER_NAMESPACE}/${bh}" COPYONLY)
endforeach()
configure_file(
"${${PROJECT_NAME}_MAIN_HEADER}"
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/${PROJECT_NAME}/${${PROJECT_NAME}_MAIN_HEADER}"
COPYONLY
)
configure_file(
"${${PROJECT_NAME}_MAIN_HEADER}"
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/${PROJECT_NAME}/lxqtglobalkeys.h"
COPYONLY
)
install(TARGETS
${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
EXPORT ${PROJECT_NAME}-targets
COMPONENT Runtime
)
install(EXPORT
${PROJECT_NAME}-targets
DESTINATION "${LXQT_INSTALL_CMAKE_DIR}/${LXQT_GLOBALKEYS_CMAKE_NAME}"
COMPONENT Devel
)
install(FILES
${${PROJECT_NAME}_MAIN_HEADER}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
COMPONENT Devel
)
install(FILES
${${PROJECT_NAME}_MAIN_HEADER}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
COMPONENT Devel
RENAME "lxqtglobalkeys.h"
)
install(FILES
${${PROJECT_NAME}_PORTABLE_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${${PROJECT_NAME}_HEADER_NAMESPACE}"
COMPONENT Devel
)
install(FILES
${${PROJECT_NAME}_PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}"
COMPONENT Devel
)
lxqt_create_pkgconfig_file(
PACKAGE_NAME ${PROJECT_NAME}
DESCRIPTIVE_NAME ${PROJECT_NAME}
DESCRIPTION "LXQt global key shortcuts client library"
INCLUDEDIRS ${PROJECT_NAME}
LIBS ${PROJECT_NAME}
REQUIRES ${${PROJECT_NAME}_PKG_CONFIG_REQUIRES}
VERSION ${LXQT_VERSION}
INSTALL
)
......@@ -41,9 +41,11 @@ ActionImpl::ActionImpl(ClientImpl *client, Action *interface, const QString &pat
, mInterface(interface)
, mPath(path)
, mDescription(description)
, mRegistrationPending(false)
{
new OrgLxqtActionClientAdaptor(this);
connect(this, SIGNAL(emitRegistrationFinished()), mInterface, SIGNAL(registrationFinished()));
connect(this, SIGNAL(emitActivated()), mInterface, SIGNAL(activated()));
connect(this, SIGNAL(emitShortcutChanged(QString, QString)), mInterface, SIGNAL(shortcutChanged(QString, QString)));
}
......@@ -55,12 +57,18 @@ ActionImpl::~ActionImpl()
QString ActionImpl::changeShortcut(const QString &shortcut)
{
if (mRegistrationPending)
return mShortcut;
mShortcut = mClient->changeClientActionShortcut(mPath, shortcut);
return mShortcut;
}
bool ActionImpl::changeDescription(const QString &description)
{
if (mRegistrationPending)
return false;
bool result = mClient->modifyClientAction(mPath, description);
if (result)
{
......@@ -99,6 +107,19 @@ bool ActionImpl::isValid() const
return mValid;
}
void ActionImpl::setRegistrationPending(bool registrationPending)
{
mRegistrationPending = registrationPending;
if (!mRegistrationPending)
emit emitRegistrationFinished();
}
bool ActionImpl::isRegistrationPending() const
{
return mRegistrationPending;
}
void ActionImpl::activated()
{
emit emitActivated();
......
......@@ -62,8 +62,10 @@ public:
QString description() const;
bool isValid() const;
bool isRegistrationPending() const;
signals:
void registrationFinished();
void activated();
void shortcutChanged(const QString &oldShortcut, const QString &newShortcut);
......
......@@ -60,11 +60,15 @@ public:
void setValid(bool valid);
bool isValid() const;
void setRegistrationPending(bool registrationPending);
bool isRegistrationPending() const;
public slots:
void activated();
void shortcutChanged(const QString &oldShortcut, const QString &newShortcut);
signals:
void emitRegistrationFinished();
void emitActivated();
void emitShortcutChanged(const QString &oldShortcut, const QString &newShortcut);
......@@ -76,6 +80,7 @@ private:
QString mShortcut;
QString mDescription;
bool mValid;
bool mRegistrationPending;
};
}
......
......@@ -82,14 +82,11 @@ void ClientImpl::daemonAppeared(const QString &)
{
ActionImpl *globalActionImpl = I.value()->impl;
QDBusPendingReply<QString, qulonglong> reply = mProxy->addClientAction(globalActionImpl->shortcut(), QDBusObjectPath(globalActionImpl->path()), globalActionImpl->description());
reply.waitForFinished();
globalActionImpl->setValid(!reply.isError() && reply.argumentAt<1>());
if (globalActionImpl->isValid())
{
globalActionImpl->setShortcut(reply.argumentAt<0>());
}
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(mProxy->addClientAction(globalActionImpl->shortcut(), QDBusObjectPath(globalActionImpl->path()), globalActionImpl->description()));
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)), this, SLOT(registrationFinished(QDBusPendingCallWatcher *)));
mPendingRegistrationsActions[watcher] = globalActionImpl;
mPendingRegistrationsWatchers[globalActionImpl] = watcher;
globalActionImpl->setRegistrationPending(true);
}
mDaemonPresent = true;
emit emitDaemonAppeared();
......@@ -101,6 +98,29 @@ bool ClientImpl::isDaemonPresent() const
return mDaemonPresent;
}
void ClientImpl::registrationFinished(QDBusPendingCallWatcher *watcher)
{
QMap<QDBusPendingCallWatcher*, ActionImpl*>::Iterator I = mPendingRegistrationsActions.find(watcher);
if (I != mPendingRegistrationsActions.end())
{
ActionImpl *globalActionImpl = I.value();
QDBusPendingReply<QString, qulonglong> reply = *watcher;
globalActionImpl->setValid(!reply.isError() && reply.argumentAt<1>());
if (globalActionImpl->isValid())
{
globalActionImpl->setShortcut(reply.argumentAt<0>());
}
mPendingRegistrationsWatchers.remove(globalActionImpl);
mPendingRegistrationsActions.erase(I);
watcher->deleteLater();
globalActionImpl->setRegistrationPending(false);
}
}
Action *ClientImpl::addClientAction(const QString &shortcut, const QString &path, const QString &description, QObject *parent)
{
if (!QRegExp("(/[A-Za-z0-9_]+){2,}").exactMatch(path))
......@@ -125,13 +145,11 @@ Action *ClientImpl::addClientAction(const QString &shortcut, const QString &path
if (mDaemonPresent)
{
QDBusPendingReply<QString, qulonglong> reply = mProxy->addClientAction(shortcut, QDBusObjectPath(path), description);
reply.waitForFinished();
globalActionImpl->setValid(!reply.isError() && reply.argumentAt<1>());
if (globalActionImpl->isValid())
{
globalActionImpl->setShortcut(reply.argumentAt<0>());
}
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(mProxy->addClientAction(shortcut, QDBusObjectPath(path), description));
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)), this, SLOT(registrationFinished(QDBusPendingCallWatcher *)));
mPendingRegistrationsActions[watcher] = globalActionImpl;
mPendingRegistrationsWatchers[globalActionImpl] = watcher;
globalActionImpl->setRegistrationPending(true);
}
else
{
......@@ -204,6 +222,21 @@ bool ClientImpl::removeClientAction(const QString &path)
void ClientImpl::removeAction(ActionImpl *actionImpl)
{
if (actionImpl->isRegistrationPending())
{
QMap<ActionImpl*, QDBusPendingCallWatcher*>::Iterator I = mPendingRegistrationsWatchers.find(actionImpl);
if (I != mPendingRegistrationsWatchers.end())
{
QDBusPendingCallWatcher *watcher = I.value();
watcher->disconnect();
mPendingRegistrationsActions.remove(watcher);
mPendingRegistrationsWatchers.erase(I);
watcher->deleteLater();
}
}
QString path = actionImpl->path();
if (!mActions.contains(path))
{
......
......@@ -81,6 +81,7 @@ public slots:
void grabShortcutFinished(QDBusPendingCallWatcher *call);
void daemonDisappeared(const QString &);
void daemonAppeared(const QString &);
void registrationFinished(QDBusPendingCallWatcher *call);
signals:
void emitShortcutGrabbed(const QString &);
......@@ -98,6 +99,9 @@ private:
QMap<QString, Action*> mActions;
QDBusServiceWatcher *mServiceWatcher;
bool mDaemonPresent;
QMap<QDBusPendingCallWatcher*, ActionImpl*> mPendingRegistrationsActions;
QMap<ActionImpl*, QDBusPendingCallWatcher*> mPendingRegistrationsWatchers;
};
}
......
# XDG standards expects system-wide configuration files in the /etc/xdg/lxqt location.
# Unfortunately QSettings we are using internally can be overriden in the Qt compilation
# time to use different path for system-wide configs. (for example configure ... -sysconfdir /etc/settings ...)
# This path can be found calling Qt4's qmake:
# qmake -query QT_INSTALL_CONFIGURATION
#
if(NOT DEFINED LXQT_ETC_XDG_DIR)
if(NOT QT_QMAKE_EXECUTABLE)
message(FATAL_ERROR "LXQT_ETC_XDG_DIR: qmake not found or wrongly detected (inlude before qt configured?)")
endif()
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_CONFIGURATION
OUTPUT_VARIABLE LXQT_ETC_XDG_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "LXQT_ETC_XDG_DIR autodetected as '${LXQT_ETC_XDG_DIR}'")
message(STATUS "You can set it manually with -DLXQT_ETC_XDG_DIR=<value>")
message(STATUS "")
endif ()
#
# Write a pkg-config pc file for given "name" with "decription"
# Arguments:
# name: a library name (withoud "lib" prefix and "so" suffixes
# desc: a desription string
#
macro (create_pkgconfig_file name desc)
set(_pkgfname "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc")
#message(STATUS "${name}: writing pkgconfig file ${_pkgfname}")
file(WRITE "${_pkgfname}"
"# file generated by LXQt cmake build\n"
"prefix=${CMAKE_INSTALL_PREFIX}\n"
"libdir=\${prefix}/lib${LIB_SUFFIX}\n"
"includedir=\${prefix}/include\n"
"\n"
"Name: ${name}\n"
"Description: ${desc}\n"
"Version: ${LXQT_VERSION}\n"
"Libs: -L\${libdir} -l${name}\n"
"Cflags: -I\${includedir}\n"
"\n"
)
# FreeBSD loves to install files to different locations
# http://www.freebsd.org/doc/handbook/dirstructure.html
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
install(FILES ${_pkgfname} DESTINATION libdata/pkgconfig)
else()
install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig)
endif()
endmacro()
......@@ -3,41 +3,24 @@
# The module defines the following variables
# LXQT_GLOBALKEYS_FOUND - Set to TRUE if all of the above has been found
#
# LXQT_GLOBALKEYS_INCLUDE_DIR - The lxqt-globalkeys include directory
#
# LXQT_GLOBALKEYS_INCLUDE_DIRS - The lxqt-globalkeys include directory
#
# LXQT_GLOBALKEYS_LIBRARY_DIRS - The lxqt-globalkeys include directory
#
# LXQT_GLOBALKEYS_LIBRARIES - The libraries needed to use lxqt-globalkeys
#
# LXQT_GLOBALKEYS_USE_FILE - The variable LXQT_GLOBALKEYS_USE_FILE is set which is the path
# to a CMake file that can be included to compile lxqt-globalkeys
# applications and libraries. It sets up the compilation
# environment for include directories and populates a
# LXQT_GLOBALKEYS_LIBRARIES variable.
#
# LXQT_GLOBALKEYS_QT_LIBRARIES - The Qt libraries needed by lxqt-globalkeys
#
# Typical usage:
# find_package(lxqt-globalkeys)
# include(${LXQT_GLOBALKEYS_USE_FILE})
# add_executable(use-lxqt-globalkeys main.cpp)
# target_link_libraries(use-qtxdg ${LXQT_GLOBALKEYS_QT_LIBRARIES} ${LXQT_GLOBALKEYS_LIBRARIES})
# target_link_libraries(use-lxqt-globalkeys lxqt-globalkeys)
set(LXQT_GLOBALKEYS_INCLUDE_DIR @LXQT_GLOBALKEYS_INCLUDE_DIR@)
set(LXQT_GLOBALKEYS_LIBRARY @LXQT_GLOBALKEYS_LIBRARY_NAME@)
@PACKAGE_INIT@
set(LXQT_GLOBALKEYS_LIBRARIES "${LXQT_GLOBALKEYS_LIBRARY}")
set(LXQT_GLOBALKEYS_INCLUDE_DIRS "${LXQT_GLOBALKEYS_INCLUDE_DIR}")
set(LXQT_GLOBALKEYS_LIBRARY_DIRS @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
set(LXQT_GLOBALKEYS_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/lxqt_globalkeys_use.cmake")
set(LXQT_GLOBALKEYS_FOUND 1)
include(CMakeFindDependencyMacro)
set(LXQT_GLOBALKEYS_MAJOR_VERSION @LXQT_MAJOR_VERSION@)
set(LXQT_GLOBALKEYS_MINOR_VERSION @LXQT_MINOR_VERSION@)
set(LXQT_GLOBALKEYS_PATCH_VERSION @LXQT_PATCH_VERSION@)
set(LXQT_GLOBALKEYS_VERSION @LXQT_VERSION@)
mark_as_advanced(LXQT_GLOBALKEYS_LIBRARY LXQT_GLOBALKEYS_INCLUDE_DIR)
find_dependency(Qt5Widgets)
find_dependency(Qt5DBus)
if (CMAKE_VERSION VERSION_GREATER 2.8.12)
cmake_policy(SET CMP0024 OLD)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/lxqt-globalkeys-targets.cmake")
......@@ -3,41 +3,25 @@
# The module defines the following variables
# LXQT_GLOBALKEYS_UI_FOUND - Set to TRUE if all of the above has been found
#
# LXQT_GLOBALKEYS_UI_INCLUDE_DIR - The lxqt-globalkeys-ui include directory
#
# LXQT_GLOBALKEYS_UI_INCLUDE_DIRS - The lxqt-globalkeys-ui include directory
#
# LXQT_GLOBALKEYS_LIBRARY_DIRS - The lxqt-globalkeys include directory
#
# LXQT_GLOBALKEYS_UI_LIBRARIES - The libraries needed to use lxqt-globalkeys-ui
#
# LXQT_GLOBALKEYS_UI_USE_FILE - The variable LXQT_GLOBALKEYS_UI_USE_FILE is set which is the path
# to a CMake file that can be included to compile lxqt-globalkeys-ui
# applications and libraries. It sets up the compilation
# environment for include directories and populates a
# LXQT_GLOBALKEYS_UI_LIBRARIES variable.
#
# LXQT_GLOBALKEYS_UI_QT_LIBRARIES - The Qt libraries needed by lxqt-globalkeys-ui
#
# Typical usage:
# find_package(lxqt-globalkeys-ui)
# include(${LXQT_GLOBALKEYS_UI_USE_FILE})
# add_executable(use-lxqt-globalkeys-ui main.cpp)
# target_link_libraries(use-qtxdg ${LXQT_GLOBALKEYS_UI_QT_LIBRARIES} ${LXQT_GLOBALKEYS_UI_LIBRARIES})
# target_link_libraries(use-lxqt-globalkeys-ui lxqt-globalkeys-ui)
set(LXQT_GLOBALKEYS_UI_INCLUDE_DIR @LXQT_GLOBALKEYS_UI_INCLUDE_DIR@)
set(LXQT_GLOBALKEYS_UI_LIBRARY @LXQT_GLOBALKEYS_UI_LIBRARY_NAME@)
@PACKAGE_INIT@
set(LXQT_GLOBALKEYS_UI_LIBRARIES "${LXQT_GLOBALKEYS_UI_LIBRARY}")
set(LXQT_GLOBALKEYS_UI_INCLUDE_DIRS "${LXQT_GLOBALKEYS_UI_INCLUDE_DIR}")
set(LXQT_GLOBALKEYS_UI_LIBRARY_DIRS @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
set(LXQT_GLOBALKEYS_UI_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/lxqt_globalkeys_ui_use.cmake")
set(LXQT_GLOBALKEYS_UI_FOUND 1)
include(CMakeFindDependencyMacro)
set(LXQT_GLOBALKEYS_UI_MAJOR_VERSION @LXQT_MAJOR_VERSION@)
set(LXQT_GLOBALKEYS_UI_MINOR_VERSION @LXQT_MINOR_VERSION@)
set(LXQT_GLOBALKEYS_UI_PATCH_VERSION @LXQT_PATCH_VERSION@)
set(LXQT_GLOBALKEYS_UI_VERSION @LXQT_VERSION@)
mark_as_advanced(LXQT_GLOBALKEYS_UI_LIBRARY LXQT_GLOBALKEYS_UI_INCLUDE_DIR)
find_dependency(Qt5Widgets)
find_dependency(Qt5DBus)
find_dependency(lxqt-globalkeys)
if (CMAKE_VERSION VERSION_GREATER 2.8.12)
cmake_policy(SET CMP0024 OLD)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/lxqt-globalkeys-ui-targets.cmake")
include_directories(${LXQT_GLOBALKEYS_UI_INCLUDE_DIRS})
link_directories(${LXQT_GLOBALKEYS_UI_LIBRARY_DIRS})
include_directories(${LXQT_GLOBALKEYS_INCLUDE_DIRS})
link_directories(${LXQT_GLOBALKEYS_LIBRARY_DIRS})
......@@ -7,18 +7,8 @@ endif()
find_package(KF5WindowSystem REQUIRED QUIET)
set(QTX_INCLUDE_DIRS "")
set(QTX_LIBRARIES Qt5::Widgets Qt5::DBus)
set(QT_DBUS_PREFIX "org.qtproject")
include_directories(
"${PROJECT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
${QTX_INCLUDE_DIRS}
${LXQT_INCLUDE_DIRS}
)
set(${PROJECT_NAME}_PATH_TO_DAEMON "${LXQT_GLOBALKEYS_SOURCE_DIR}/daemon")
set(${PROJECT_NAME}_SOURCES
......@@ -94,23 +84,22 @@ foreach(DBUS_INTERFACE ${${PROJECT_NAME}_DBUS_INTERFACES})
get_filename_component(DBUS_INTERFACE_FILENAME ${DBUS_INTERFACE} NAME)
configure_file(
${DBUS_INTERFACE}
${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}
"${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}"
@ONLY
)
get_source_file_property(DBUS_INTERFACE_BASENAME ${DBUS_INTERFACE} BASENAME)
get_source_file_property(DBUS_INTERFACE_INCLUDE ${DBUS_INTERFACE} INCLUDE)
get_source_file_property(DBUS_INTERFACE_CLASSNAME ${DBUS_INTERFACE} CLASSNAME)
get_source_file_property(DBUS_INTERFACE_NO_NAMESPACE ${DBUS_INTERFACE} NO_NAMESPACE)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME} PROPERTIES
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}" PROPERTIES
INCLUDE ${DBUS_INTERFACE_INCLUDE}
CLASSNAME ${DBUS_INTERFACE_CLASSNAME}
NO_NAMESPACE ${DBUS_INTERFACE_NO_NAMESPACE}
)
qt5_add_dbus_interface(${PROJECT_NAME}_DBUS_INTERFACE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME} ${DBUS_INTERFACE_BASENAME})
qt5_add_dbus_interface(${PROJECT_NAME}_DBUS_INTERFACE_FILES "${CMAKE_CURRENT_BINARY_DIR}/${DBUS_INTERFACE_FILENAME}" ${DBUS_INTERFACE_BASENAME})
endforeach()
qt5_add_resources(${PROJECT_NAME}_RESOURCE_FILES ${${PROJECT_NAME}_RESOURCES})
qt5_wrap_ui(${PROJECT_NAME}_FORM_FILES ${${PROJECT_NAME}_FORMS})
# Translations **********************************
lxqt_translate_ts(${PROJECT_NAME}_QM_FILES
......@@ -145,7 +134,16 @@ set(${PROJECT_NAME}_ALL_FILES
)
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_ALL_FILES})
target_link_libraries(${PROJECT_NAME} KF5::WindowSystem ${QTX_LIBRARIES} ${LXQT_LIBRARIES})
target_link_libraries(${PROJECT_NAME} KF5::WindowSystem lxqt)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(FILES ${${PROJECT_NAME}_DESKTOP_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(TARGETS
${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT Runtime
)
install(FILES
${${PROJECT_NAME}_DESKTOP_FILES}
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
COMPONENT Runtime
)
# Translations
Name[hu]=LxQt gyorsbillentyűk
Comment[hu]=LXQt általános forróbillentyűinek beállítása
GenericName[hu]=LXQt gyorsbillentyűk beállítása
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="hu_HU">
<context>