Merge pull request #3260

ae8394e5 main: Linux - fix missing askDesktopShortcut setting (xiphon)
This commit is contained in:
Alexander Blair 2020-12-10 17:58:42 -08:00
commit 897946af13
No known key found for this signature in database
GPG key ID: C64552D877C32479
2 changed files with 18 additions and 18 deletions

View file

@ -1335,7 +1335,21 @@ ApplicationWindow {
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable) {
persistentSettings.askDesktopShortcut = false;
oshelper.createDesktopEntry();
if (isTails) {
oshelper.createDesktopEntry();
} else if (isLinux) {
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;
confirmationDialog.cancelText = qsTr("No") + translationManager.emptyString;
confirmationDialog.okText = qsTr("Yes") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = function() {
oshelper.createDesktopEntry();
};
confirmationDialog.onRejectedCallback = null;
confirmationDialog.open();
}
}
}
@ -1347,6 +1361,7 @@ ApplicationWindow {
return "";
}
property bool askDesktopShortcut: isLinux
property string language: 'English (US)'
property string language_wallet: 'English'
property string locale: 'en_US'

View file

@ -28,7 +28,6 @@
#include <QtCore>
#include <QCoreApplication>
#include <QMessageBox>
#include <QtGlobal>
#include "TailsOS.h"
@ -89,17 +88,6 @@ QString getAccountName(){
}
#ifdef Q_OS_LINUX
bool askInstallDesktopEntry()
{
QMessageBox msgBox(
QMessageBox::Question,
QObject::tr("Monero GUI"),
QObject::tr("Would you like to register Monero GUI Desktop entry?"),
QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
return msgBox.exec() == QMessageBox::Yes;
}
QString xdgMime(){
return QString(
"[Desktop Entry]\n"
@ -139,11 +127,8 @@ void registerXdgMime(){
}
else
{
if (askInstallDesktopEntry())
{
QDir().mkpath(QFileInfo(filePath).path());
fileWrite(filePath, mime);
}
QDir().mkpath(QFileInfo(filePath).path());
fileWrite(filePath, mime);
}
}
#endif