Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54ffb992de |
No files matched your search
+15
-3
@@ -16,6 +16,16 @@ option(WITH_DESKTOP_ENTRY "Ask to install desktop entry on first startup" ON)
|
||||
option(WITH_UPDATER "Regularly check for new updates" ON)
|
||||
option(DEV_MODE "Checkout latest monero master on build" OFF)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(LINUX TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
set(FREEBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
set(OPENBSD TRUE)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFly")
|
||||
set(DRAGONFLY TRUE)
|
||||
endif()
|
||||
|
||||
if(DEV_MODE)
|
||||
# DEV_MODE checks out the monero submodule to master, which requires C++17.
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
@@ -403,9 +413,11 @@ add_linker_flag_if_supported(-Wl,-z,noexecstack noexecstack_SUPPORTED)
|
||||
if (noexecstack_SUPPORTED)
|
||||
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecstack")
|
||||
endif()
|
||||
add_linker_flag_if_supported(-Wl,-z,noexecheap noexecheap_SUPPORTED)
|
||||
if (noexecheap_SUPPORTED)
|
||||
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap")
|
||||
if (NOT FREEBSD)
|
||||
add_linker_flag_if_supported(-Wl,-z,noexecheap noexecheap_SUPPORTED)
|
||||
if (noexecheap_SUPPORTED)
|
||||
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# some windows linker bits
|
||||
|
||||
@@ -1430,7 +1430,7 @@ ApplicationWindow {
|
||||
|
||||
if (isTails) {
|
||||
oshelper.createDesktopEntry();
|
||||
} else if (isLinux) {
|
||||
} else if (isLinux || isFreeBSD) {
|
||||
confirmationDialog.title = qsTr("Desktop entry") + translationManager.emptyString;
|
||||
confirmationDialog.text = qsTr("Would you like to register Monero GUI Desktop entry?") + translationManager.emptyString;
|
||||
confirmationDialog.icon = StandardIcon.Question;
|
||||
@@ -1455,7 +1455,7 @@ ApplicationWindow {
|
||||
return "";
|
||||
}
|
||||
|
||||
property bool askDesktopShortcut: isLinux
|
||||
property bool askDesktopShortcut: isLinux || isFreeBSD
|
||||
property bool askStopLocalNode: true
|
||||
property string language: 'English (US)'
|
||||
property string language_wallet: 'English'
|
||||
|
||||
+15
-11
@@ -99,7 +99,7 @@
|
||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
|
||||
#elif defined(Q_OS_WIN)
|
||||
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
|
||||
#elif defined(Q_OS_LINUX)
|
||||
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
|
||||
Q_IMPORT_PLUGIN(QXcbGlxIntegrationPlugin);
|
||||
#endif
|
||||
@@ -153,6 +153,7 @@ bool isAndroid = false;
|
||||
bool isWindows = false;
|
||||
bool isMac = false;
|
||||
bool isLinux = false;
|
||||
bool isFreeBSD = false;
|
||||
bool isTails = false;
|
||||
bool isDesktop = false;
|
||||
bool isOpenGL = true;
|
||||
@@ -164,22 +165,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
// platform dependant settings
|
||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||
bool isDesktop = true;
|
||||
isDesktop = true;
|
||||
#elif defined(Q_OS_ANDROID)
|
||||
bool isAndroid = true;
|
||||
isAndroid = true;
|
||||
#elif defined(Q_OS_IOS)
|
||||
bool isIOS = true;
|
||||
isIOS = true;
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
bool isWindows = true;
|
||||
isWindows = true;
|
||||
#elif defined(Q_OS_LINUX)
|
||||
bool isLinux = true;
|
||||
bool isTails = TailsOS::detect();
|
||||
isLinux = true;
|
||||
isTails = TailsOS::detect();
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
isFreeBSD = true;
|
||||
#elif defined(Q_OS_MAC)
|
||||
bool isMac = true;
|
||||
isMac = true;
|
||||
#endif
|
||||
#if defined(__aarch64__)
|
||||
bool isARM = true;
|
||||
isARM = true;
|
||||
#endif
|
||||
|
||||
// detect low graphics mode (start-low-graphics-mode.bat)
|
||||
@@ -192,7 +195,7 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
// disable "QApplication: invalid style override passed" warning
|
||||
if (isDesktop) qputenv("QT_STYLE_OVERRIDE", "fusion");
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
// platform xcb by default
|
||||
if (isDesktop && qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) qputenv("QT_QPA_PLATFORM", "xcb");
|
||||
#endif
|
||||
@@ -263,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
moneroAccountsDir = QDir::toNativeSeparators(moneroAccountsDir);
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
if (isDesktop) app.setWindowIcon(QIcon(":/images/appicon.ico"));
|
||||
#endif
|
||||
|
||||
@@ -485,6 +488,7 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
|
||||
engine.rootContext()->setContextProperty("isWindows", isWindows);
|
||||
engine.rootContext()->setContextProperty("isMac", isMac);
|
||||
engine.rootContext()->setContextProperty("isLinux", isLinux);
|
||||
engine.rootContext()->setContextProperty("isFreeBSD", isFreeBSD);
|
||||
engine.rootContext()->setContextProperty("isIOS", isIOS);
|
||||
engine.rootContext()->setContextProperty("isAndroid", isAndroid);
|
||||
engine.rootContext()->setContextProperty("isOpenGL", isOpenGL);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <shlobj.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
#include "qt/utils.h"
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,7 @@ OSHelper::OSHelper(QObject *parent) : QObject(parent)
|
||||
|
||||
void OSHelper::createDesktopEntry() const
|
||||
{
|
||||
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
registerXdgMime();
|
||||
#endif
|
||||
}
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ QString getAccountName(){
|
||||
return accountName;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
QString xdgMime(){
|
||||
return QString(
|
||||
"[Desktop Entry]\n"
|
||||
@@ -115,7 +115,7 @@ void registerXdgMime(){
|
||||
// Register desktop entry
|
||||
// - MacOS handled via Info.plist
|
||||
// - Windows handled in the installer by rbrunner7
|
||||
// - Linux written to `QStandardPaths::ApplicationsLocation`
|
||||
// - Unix desktops written to `QStandardPaths::ApplicationsLocation`
|
||||
// - Tails written to persistent dotfiles
|
||||
QString mime = xdgMime();
|
||||
QString appPath = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ QByteArray fileGetContents(QString path);
|
||||
QByteArray fileOpen(QString path);
|
||||
bool fileWrite(QString path, QString data);
|
||||
QString getAccountName();
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID)
|
||||
QString xdgMime();
|
||||
void registerXdgMime();
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user