diff options
author | JTL <jtl999@users.noreply.github.com> | 2018-12-29 02:32:25 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2018-12-29 02:32:25 +0300 |
commit | dd5665c6563f6185532c4dc76896f4220fd3c8e3 (patch) | |
tree | cae25393140d0d64db268daafefb518a0288afc7 /src | |
parent | b1ff346f6311936a342397eaaca262a6f08e19c7 (diff) |
Multiple macOS fixes and include keepassxc-cli in DMG (#2165)
* Fixes including keepassxc-cli when building KeePassXC dmg on Mac.
resolves #1697
* Fix Qt search path and Properties display on macOS
* Simplify packaging POST_BUILD fixups
* Various fixes to get cli to run on macos
* Correct cli tests on macOS
* Several macOS related GUI test fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/CMakeLists.txt | 38 | ||||
-rw-r--r-- | src/cli/keepassxc-cli.cpp | 4 | ||||
-rw-r--r-- | src/core/Bootstrap.cpp | 17 | ||||
-rw-r--r-- | src/core/Bootstrap.h | 1 | ||||
-rw-r--r-- | src/core/Translator.cpp | 3 | ||||
-rw-r--r-- | src/gui/EditWidgetProperties.ui | 3 | ||||
-rw-r--r-- | src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui | 2 | ||||
-rw-r--r-- | src/gui/widgets/PopupHelpWidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/wizard/NewDatabaseWizard.cpp | 1 | ||||
-rwxr-xr-x | src/proxy/CMakeLists.txt | 11 |
10 files changed, 65 insertions, 19 deletions
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index 43a22407c..4c52e6b7e 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -47,6 +47,44 @@ install(TARGETS keepassxc-cli BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime) +if(APPLE AND WITH_APP_BUNDLE) + add_custom_command(TARGET keepassxc-cli + POST_BUILD + COMMAND ${CMAKE_INSTALL_NAME_TOOL} + -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore + "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore" + -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui + "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" + -change /usr/local/opt/qt/lib/QtMacExtras.framework/Versions/5/QtMacExtras + "@executable_path/../Frameworks/QtMacExtras.framework/Versions/5/QtMacExtras" + -change /usr/local/opt/qt/lib/QtConcurrent.framework/Versions/5/QtConcurrent + "@executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent" + -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore + "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore" + -change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork + "@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork" + -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets + "@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets" + -change /usr/local/opt/qt/lib/QtSvg.framework/Versions/5/QtSvg + "@executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg" + -change /usr/local/opt/libgcrypt/lib/libgcrypt.20.dylib + "@executable_path/../Frameworks/libgcrypt.20.dylib" + -change /usr/local/opt/argon2/lib/libargon2.1.dylib + "@executable_path/../Frameworks/libargon2.1.dylib" + -change /usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib + "@executable_path/../Frameworks/libgpg-error.0.dylib" + -change /usr/local/opt/libsodium/lib/libsodium.23.dylib + "@executable_path/../Frameworks/libsodium.23.dylib" + -change /usr/local/opt/qrencode/lib/libqrencode.4.dylib + "@executable_path/../Frameworks/libqrencode.4.dylib" + -change /usr/local/opt/libyubikey/lib/libyubikey.0.dylib + "@executable_path/../Frameworks/libyubikey.0.dylib" + -change /usr/local/opt/ykpers/lib/libykpers-1.1.dylib + "@executable_path/../Frameworks/libykpers-1.1.dylib" + keepassxc-cli + COMMENT "Changing linking of keepassxc-cli") +endif() + if(APPLE OR UNIX) install(FILES keepassxc-cli.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) execute_process(COMMAND mandb -q) diff --git a/src/cli/keepassxc-cli.cpp b/src/cli/keepassxc-cli.cpp index a2399e741..b9e3853f2 100644 --- a/src/cli/keepassxc-cli.cpp +++ b/src/cli/keepassxc-cli.cpp @@ -42,9 +42,7 @@ int main(int argc, char** argv) QCoreApplication app(argc, argv); QCoreApplication::setApplicationVersion(KEEPASSXC_VERSION); -#ifdef QT_NO_DEBUG - Bootstrap::bootstrapApplication(); -#endif + Bootstrap::bootstrap(); TextStream out(stdout); QStringList arguments; diff --git a/src/core/Bootstrap.cpp b/src/core/Bootstrap.cpp index cfef7db7b..10dd9b2d8 100644 --- a/src/core/Bootstrap.cpp +++ b/src/core/Bootstrap.cpp @@ -62,11 +62,10 @@ namespace Bootstrap } /** - * Perform early application bootstrapping such as setting up search paths, - * configuration OS security properties, and loading translators. - * A QApplication object has to be instantiated before calling this function. + * Perform early application bootstrapping that does not rely on a QApplication + * being present. */ - void bootstrapApplication() + void bootstrap() { #ifdef QT_NO_DEBUG disableCoreDumps(); @@ -74,6 +73,16 @@ namespace Bootstrap setupSearchPaths(); applyEarlyQNetworkAccessManagerWorkaround(); Translator::installTranslators(); + } + + /** + * Perform early application bootstrapping such as setting up search paths, + * configuration OS security properties, and loading translators. + * A QApplication object has to be instantiated before calling this function. + */ + void bootstrapApplication() + { + bootstrap(); MessageBox::initializeButtonDefs(); #ifdef Q_OS_MACOS diff --git a/src/core/Bootstrap.h b/src/core/Bootstrap.h index 95158fb8c..de1a4d836 100644 --- a/src/core/Bootstrap.h +++ b/src/core/Bootstrap.h @@ -22,6 +22,7 @@ namespace Bootstrap { + void bootstrap(); void bootstrapApplication(); void restoreMainWindowState(MainWindow& mainWindow); void disableCoreDumps(); diff --git a/src/core/Translator.cpp b/src/core/Translator.cpp index 595dadfa1..f64a7a44c 100644 --- a/src/core/Translator.cpp +++ b/src/core/Translator.cpp @@ -47,7 +47,8 @@ void Translator::installTranslators() #ifdef QT_DEBUG QString("%1/share/translations").arg(KEEPASSX_BINARY_DIR), #endif - filePath()->dataPath("translations")}; + filePath()->dataPath("translations") + }; bool translationsLoaded = false; for (const QString& path : paths) { diff --git a/src/gui/EditWidgetProperties.ui b/src/gui/EditWidgetProperties.ui index f97562661..fb8ed5030 100644 --- a/src/gui/EditWidgetProperties.ui +++ b/src/gui/EditWidgetProperties.ui @@ -28,6 +28,9 @@ </property> <item> <layout class="QFormLayout" name="formLayout_2"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> <item row="1" column="0"> <widget class="QLabel" name="labelCreated"> <property name="text"> diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui index dfd814bdc..b9bbf433b 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui +++ b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.ui @@ -108,7 +108,7 @@ </property> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QGroupBox" name="groupBox"> + <widget class="QGroupBox" name="groupBox_3"> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> <widget class="QTableView" name="customDataTable"> diff --git a/src/gui/widgets/PopupHelpWidget.cpp b/src/gui/widgets/PopupHelpWidget.cpp index 45e19e81e..269c31c5b 100644 --- a/src/gui/widgets/PopupHelpWidget.cpp +++ b/src/gui/widgets/PopupHelpWidget.cpp @@ -30,7 +30,11 @@ PopupHelpWidget::PopupHelpWidget(QWidget* parent) { Q_ASSERT(parent); +#ifdef Q_OS_MACOS + setWindowFlags(Qt::FramelessWindowHint | Qt::Drawer); +#else setWindowFlags(Qt::FramelessWindowHint | Qt::Tool); +#endif hide(); m_appWindow->installEventFilter(this); diff --git a/src/gui/wizard/NewDatabaseWizard.cpp b/src/gui/wizard/NewDatabaseWizard.cpp index be5277ac5..5174fcacc 100644 --- a/src/gui/wizard/NewDatabaseWizard.cpp +++ b/src/gui/wizard/NewDatabaseWizard.cpp @@ -34,6 +34,7 @@ NewDatabaseWizard::NewDatabaseWizard(QWidget* parent) { setWizardStyle(QWizard::MacStyle); setOption(QWizard::WizardOption::HaveHelpButton, false); + setOption(QWizard::WizardOption::NoDefaultButton, false); // Needed for macOS // clang-format off m_pages << new NewDatabaseWizardPageMetaData() diff --git a/src/proxy/CMakeLists.txt b/src/proxy/CMakeLists.txt index 4972043b5..6839c9a22 100755 --- a/src/proxy/CMakeLists.txt +++ b/src/proxy/CMakeLists.txt @@ -32,14 +32,6 @@ if(WITH_XC_BROWSER) RUNTIME DESTINATION ${PROXY_INSTALL_DIR} COMPONENT Runtime) if(APPLE AND WITH_APP_BUNDLE) - set(PROXY_BINARY_DIR "${CMAKE_BINARY_DIR}/src/proxy/keepassxc-proxy") - set(PROXY_APP_DIR "KeePassXC.app/Contents/MacOS/keepassxc-proxy") - add_custom_command(TARGET keepassxc-proxy - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROXY_BINARY_DIR} ${PROXY_APP_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src - COMMENT "Copying keepassxc-proxy inside the application") - add_custom_command(TARGET keepassxc-proxy POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} @@ -51,8 +43,7 @@ if(WITH_XC_BROWSER) "@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork" -change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork "@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork" - ${PROXY_APP_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src + keepassxc-proxy COMMENT "Changing linking of keepassxc-proxy") endif() if(MINGW) |