Commit 28265261 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

Merge branch 'release/2.10.0'

parents f287903f d65f281f
# ChangeLog
## version 2.10.0 - 2019-05-17
- cmake refactoring
- fix interaction
- better handling of font setting
## version 2.9.2 - 2019-05-03
- do not move window when we are over a menu button
## version 2.9.1 - 2019-05-02
......
......@@ -23,8 +23,8 @@ project(dtkWidgets)
## ###################################################################
set(${PROJECT_NAME}_VERSION_MAJOR 2)
set(${PROJECT_NAME}_VERSION_MINOR 9)
set(${PROJECT_NAME}_VERSION_PATCH 2)
set(${PROJECT_NAME}_VERSION_MINOR 10)
set(${PROJECT_NAME}_VERSION_PATCH 0)
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
......@@ -72,21 +72,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(MSVC)
add_definitions("/wd4068")
endif(MSVC)
## ###################################################################
## Test setup
## ###################################################################
include(CTest)
enable_testing()
## ###################################################################
......@@ -99,28 +89,17 @@ include(GenerateExportHeader)
## Dependencies - external
## #################################################################
find_package(Qt5 REQUIRED COMPONENTS Core Gui WebSockets Widgets Xml Test)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets Xml Test)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(dtkCore REQUIRED)
find_package(dtkFonts REQUIRED)
find_package(dtkLog REQUIRED)
find_package(dtkThemes REQUIRED)
include_directories(${dtkCore_INCLUDE_DIRS})
include_directories(${dtkFonts_INCLUDE_DIRS})
include_directories(${dtkLog_INCLUDE_DIRS})
include_directories(${dtkThemes_INCLUDE_DIRS})
## #################################################################
## Dependencies - internal
## #################################################################
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkWidgets)
include_directories(${CMAKE_SOURCE_DIR}/tst)
include_directories(${CMAKE_SOURCE_DIR}/tst/dtkWidgets)
## ###################################################################
## Input
## ###################################################################
......@@ -130,26 +109,43 @@ add_subdirectory(tst)
add_subdirectory(exp)
## ###################################################################
## Exporting
## Export configuration
## ###################################################################
export(PACKAGE ${PROJECT_NAME})
include(CMakePackageConfigHelpers)
set(${PROJECT_NAME}_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for ${PROJECT_NAME}Config.cmake")
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src)
configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${${PROJECT_NAME}_CMAKE_INSTALL_DIR}"
PATH_VARS ${PROJECT_NAME}_INCLUDE_DIRS)
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${${PROJECT_NAME}_CMAKE_INSTALL_DIR}"
PATH_VARS ${PROJECT_NAME}_INCLUDE_DIRS)
configure_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.install.cmake.in
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake" @ONLY)
## ###################################################################
## Exporting
## ###################################################################
configure_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake.in
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
install(FILES
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(EXPORT layer-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
install(EXPORT ${PROJECT_NAME}Depends DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
export(PACKAGE ${PROJECT_NAME})
## ###################################################################
## Beautifying
......@@ -159,6 +155,8 @@ mark_as_advanced(${PROJECT_NAME}_VERSION_MAJOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_MINOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_BUILD)
mark_as_advanced(${PROJECT_NAME}_CMAKE_INSTALL_DIR)
mark_as_advanced(Qt5_DIR)
mark_as_advanced(Qt5Core_DIR)
mark_as_advanced(Qt5Gui_DIR)
......@@ -166,24 +164,16 @@ mark_as_advanced(Qt5OpenGL_DIR)
mark_as_advanced(Qt5Test_DIR)
mark_as_advanced(Qt5Widgets_DIR)
mark_as_advanced(dtkCore_DIR)
mark_as_advanced(dtkFonts_DIR)
mark_as_advanced(dtkLog_DIR)
mark_as_advanced(dtkThemes_DIR)
mark_as_advanced(CMAKE_AR)
mark_as_advanced(CMAKE_BUILD_TYPE)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)
mark_as_advanced(CMAKE_OSX_SYSROOT)
## ###################################################################
## Packaging
## ###################################################################
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")
include(CPack)
######################################################################
### CMakeLists.txt ends here
......@@ -12,12 +12,7 @@
##
### Code:
set(dtkWidgets_INCLUDE_DIRS
"@CMAKE_CURRENT_SOURCE_DIR@/src"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkWidgets"
"@CMAKE_CURRENT_BINARY_DIR@")
include("@CMAKE_BINARY_DIR@/dtkWidgetsDepends.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
######################################################################
### dtkWidgetsConfig.cmake.in ends here
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
set(dtkWidgets_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include"
"@CMAKE_INSTALL_PREFIX@/include/dtkWidgets")
include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtkWidgets/dtkWidgetsDepends.cmake")
######################################################################
### dtkWidgetsConfig.install.cmake.in ends here
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
set(PACKAGE_VERSION "@dtkWidgets_VERSION@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
######################################################################
### dtkWidgetsConfigVersion.cmake.in ends here
......@@ -34,6 +34,9 @@ add_executable(${PROJECT_NAME} MACOSX_BUNDLE
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} dtkCore)
target_link_libraries(${PROJECT_NAME} dtkFonts)
target_link_libraries(${PROJECT_NAME} dtkThemes)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
## ###################################################################
......
......@@ -17,6 +17,7 @@
#include <dtkCore>
#include <dtkFonts>
#include <dtkThemes>
#include <dtkWidgets>
// /////////////////////////////////////////////////////////////////////////////
......
......@@ -34,6 +34,7 @@ add_executable(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} dtkThemes)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
######################################################################
......
......@@ -34,8 +34,8 @@ add_executable(${PROJECT_NAME} MACOSX_BUNDLE
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} dtkThemes)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
target_link_libraries(${PROJECT_NAME} dtkCore)
## ###################################################################
## Bundle setup
......
......@@ -17,8 +17,8 @@ channels:
- dtk
dependencies:
- qt >=5.9.0
- dtk-core >=2.3.0
- dtk-fonts
- dtk-core >=2.4.0
- dtk-fonts >=2.1.0
- dtk-log
- dtk-themes
......
......@@ -38,15 +38,15 @@ requirements:
- {{ cdt('libxxf86vm') }} # [linux]
host:
- qt >=5.9.0
- dtk-core >=2.3.0
- dtk-fonts
- dtk-core >=2.4.0
- dtk-fonts >=2.1.0
- dtk-log
- dtk-themes
run:
- qt >=5.9.0
- dtk-core >=2.3.0
- dtk-fonts
- dtk-core >=2.4.0
- dtk-fonts >=2.1.0
- dtk-log
- dtk-themes
......
......@@ -12,21 +12,16 @@
##
### Code:
add_subdirectory(dtkWidgets)
## #################################################################
## Target definition
## #################################################################
set(DTKWIDGETS_TARGETS)
set(layer_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DTKWIDGETS_TARGETS ${DTKWIDGETS_TARGETS} dtkWidgets)
add_subdirectory(dtkWidgets)
## #################################################################
## Target export
## #################################################################
export(TARGETS ${DTKWIDGETS_TARGETS} FILE "${CMAKE_BINARY_DIR}/dtkWidgetsDepends.cmake")
export(EXPORT layer-targets
FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
######################################################################
### CMakeLists.txt ends here
......@@ -160,6 +160,24 @@ set(${PROJECT_NAME}_SOURCES
dtkWidgetsWorkspaceBar.cpp
dtkWidgetsWorkspaceStackBar.cpp)
## ###################################################################
## Config file
## ###################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config")
set(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS}
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h")
set(layer_BINARY_DIR "${PROJECT_BINARY_DIR}/..")
## #################################################################
## Build rules
## #################################################################
......@@ -168,16 +186,25 @@ add_library(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_HEADERS})
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::WebSockets)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} Qt5::Xml)
target_link_libraries(${PROJECT_NAME} dtkThemes)
target_link_libraries(${PROJECT_NAME} dtkThemesWidgets)
target_link_libraries(${PROJECT_NAME} dtkCore)
target_link_libraries(${PROJECT_NAME} dtkFonts)
target_link_libraries(${PROJECT_NAME} dtkLog)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Xml)
target_link_libraries(${PROJECT_NAME} PRIVATE dtkThemes)
target_link_libraries(${PROJECT_NAME} PRIVATE dtkLog)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Gui)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} PUBLIC dtkCore)
target_link_libraries(${PROJECT_NAME} PUBLIC dtkFonts)
target_link_libraries(${PROJECT_NAME} PUBLIC dtkThemesWidgets)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${layer_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<BUILD_INTERFACE:${layer_BINARY_DIR}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<INSTALL_INTERFACE:include>)
## #################################################################
## Target properties
......@@ -201,40 +228,21 @@ set(${PROJECT_NAME}_HEADERS
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Export.h")
## ###################################################################
## Config file
## ###################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config")
set(${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_HEADERS}
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h")
## ###################################################################
## Install rules - files
## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
COMPONENT widgets)
DESTINATION include/${PROJECT_NAME})
## ###################################################################
## Install rules - targets
## ###################################################################
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Depends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT widgets)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
######################################################################
### CMakeLists.txt ends here
......@@ -17,17 +17,133 @@
#include "dtkWidgetsMainWindow.h"
dtkApplication::dtkApplication(int& argc, char **argv): QApplication(argc, argv)
#include <dtkFonts>
#include <dtkLog>
#include <dtkThemes>
#include <QtCore>
#include <QtWidgets>
// /////////////////////////////////////////////////////////////////////////////
// dtkApplicationPrivate implementation
// /////////////////////////////////////////////////////////////////////////////
dtkWidgetsMainWindow *dtkApplicationPrivate::window = nullptr;
dtkApplicationPrivate::dtkApplicationPrivate(void) : settings(nullptr), parser(new QCommandLineParser), app(nullptr)
{
this->parser->setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
}
dtkApplicationPrivate::~dtkApplicationPrivate(void)
{
if (this->settings) {
delete this->settings;
this->settings = nullptr;
}
delete this->parser;
this->parser = nullptr;
}
void dtkApplicationPrivate::setApplication(QCoreApplication *q)
{
this->app = q;
}
void dtkApplicationPrivate::initialize(void)
{
QString verbosity = "info";
qputenv("QT_PLUGIN_PATH", "1");
qputenv("LC_ALL", "C");
QLocale::setDefault(QLocale::c());
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
setlocale(LC_NUMERIC, "C");
#endif
this->parser->addHelpOption();
this->parser->addVersionOption();
QCommandLineOption settingsOption("settings", "main settings file", "filename");
this->parser->addOption(settingsOption);
QCommandLineOption verboseOption("verbose", QCoreApplication::translate("main", "verbose plugin initialization"));
this->parser->addOption(verboseOption);
QCommandLineOption nonguiOption(QStringList() << "nw" << "no-window", QCoreApplication::translate("main", "non GUI application (no window)"));
this->parser->addOption(nonguiOption);
QCommandLineOption loglevelOption("loglevel", "log level used by dtkLog (default is info), available: trace|debug|info|warn|error|fatal", "level", verbosity);
this->parser->addOption(loglevelOption);
QCommandLineOption logfileOption("logfile", qPrintable(QString("log file used by dtkLog; default is: ").append(dtkLogPath(app))), "filename | console", dtkLogPath(app));
this->parser->addOption(logfileOption);
QCommandLineOption logfileMaxSizeOption("logfilemax", "log file max size (in MB); default is: 3072 (3GB)", "size");
this->parser->addOption(logfileMaxSizeOption);
QCommandLineOption themeOption("theme", "theme", "themename");
this->parser->addOption(themeOption);
this->parser->process(*(this->app));
if (this->parser->isSet(settingsOption))
this->settings = new QSettings(this->parser->value(settingsOption), QSettings::IniFormat);
else
this->settings = new QSettings(this->app->organizationName(), this->app->applicationName());
if (settings->contains("log_level")) {
dtkLogger::instance().setLevel(settings->value("log_level").toString());
} else {
if (this->parser->isSet(loglevelOption))
verbosity = this->parser->value(loglevelOption);
dtkLogger::instance().setLevel(verbosity);
}
qlonglong max_size = 1024L * 1024L * 1024L;
if (this->parser->isSet(logfileMaxSizeOption))
max_size = this->parser->value(logfileMaxSizeOption).toLongLong() * 1024 * 1024;
if (this->parser->isSet(logfileOption)) {
if (this->parser->value(logfileOption) == "console")
dtkLogger::instance().attachConsole();
else
dtkLogger::instance().attachFile(this->parser->value(logfileOption), max_size);
} else {
dtkLogger::instance().attachFile(dtkLogPath(this->app), max_size);
}
}
// ///////////////////////////////////////////////////////////////////
// dtkApplication implementation
// ///////////////////////////////////////////////////////////////////
dtkApplication::dtkApplication(int& argc, char **argv): QApplication(argc, argv), d(new dtkApplicationPrivate)
{
d = new dtkApplicationPrivate;
dtkFontSourceSansPro::instance()->initFontSourceSansPro();
d->setApplication(this);
this->setFont(dtkFontSourceSansPro::instance()->font(13));
}
dtkApplication::~dtkApplication(void)
{
delete d;
d = NULL;
d = nullptr;
}
void dtkApplication::initialize(void)
......
......@@ -14,14 +14,13 @@
#pragma once
#include <QtCore>
#include <QtWidgets>
#include <dtkWidgetsExport>
#include <dtkLog>
#include <dtkWidgetsExport.h>
#include <QtWidgets/QApplication>
class dtkWidgetsMainWindow;
class QCommandLineParser;
class QSettings;
class DTKWIDGETS_EXPORT dtkApplication : public QApplication
{
......@@ -29,8 +28,8 @@ public:
typedef void (*setup_t)(dtkApplication *);
public:
dtkApplication(int& argc, char **argv);
virtual ~dtkApplication(void);
dtkApplication(int& argc, char **argv);
~dtkApplication(void);
public:
virtual void initialize(void);
......
......@@ -14,22 +14,18 @@
#pragma once
#include <QtCore>
#include <QtWidgets>
#include <dtkWidgetsExport.h>
// /////////////////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////////////////
#include <dtkWidgetsExport>
class dtkWidgetsMainWindow;
class QCoreApplication;
class QSettings;
class QCommandLineParser;
// /////////////////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////////////////
class dtkApplicationPrivate
class DTKWIDGETS_EXPORT dtkApplicationPrivate
{
public:
dtkApplicationPrivate(void);
......@@ -50,107 +46,5 @@ public:
static dtkWidgetsMainWindow *window;
};
dtkWidgetsMainWindow *dtkApplicationPrivate::window = nullptr;
// /////////////////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////////////////
dtkApplicationPrivate::dtkApplicationPrivate(void) : settings(nullptr), parser(new QCommandLineParser), app(nullptr)
{
this->parser->setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
}
dtkApplicationPrivate::~dtkApplicationPrivate(void)
{
if (this->settings) {
delete this->settings;
this->settings = nullptr;
}
delete this->parser;
this->parser = nullptr;
}
void dtkApplicationPrivate::setApplication(QCoreApplication *q)
{
this->app = q;
}
void dtkApplicationPrivate::initialize(void)
{
QString verbosity = "info";
qputenv("QT_PLUGIN_PATH", "1");
qputenv("LC_ALL", "C");
QLocale::setDefault(QLocale::c());
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
setlocale(LC_NUMERIC, "C");
#endif
this->parser->addHelpOption();
this->parser->addVersionOption();
QCommandLineOption settingsOption("settings", "main settings file", "filename");
this->parser->addOption(settingsOption);
QCommandLineOption verboseOption("verbose", QCoreApplication::translate("main", "verbose plugin initialization"));
this->parser->addOption(verboseOption);
QCommandLineOption nonguiOption(QStringList() << "nw" << "no-window", QCoreApplication::translate("main", "non GUI application (no window)"));
this->parser->addOption(nonguiOption);
QCommandLineOption loglevelOption("loglevel", "log level used by dtkLog (default is info), available: trace|debug|info|warn|error|fatal", "level", verbosity);
this->parser->addOption(loglevelOption);
QCommandLineOption logfileOption("logfile", qPrintable(QString("log file used by dtkLog; default is: ").append(dtkLogPath(app))), "filename | console", dtkLogPath(app));
this->parser->addOption(logfileOption);