mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
main: Linux - fix missing askDesktopShortcut setting
This commit is contained in:
parent
ea1fee2f5f
commit
ae8394e5f8
17
main.qml
17
main.qml
@ -1335,7 +1335,21 @@ ApplicationWindow {
|
|||||||
|
|
||||||
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable) {
|
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable) {
|
||||||
persistentSettings.askDesktopShortcut = false;
|
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 "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool askDesktopShortcut: isLinux
|
||||||
property string language: 'English (US)'
|
property string language: 'English (US)'
|
||||||
property string language_wallet: 'English'
|
property string language_wallet: 'English'
|
||||||
property string locale: 'en_US'
|
property string locale: 'en_US'
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#include "TailsOS.h"
|
#include "TailsOS.h"
|
||||||
@ -89,17 +88,6 @@ QString getAccountName(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#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(){
|
QString xdgMime(){
|
||||||
return QString(
|
return QString(
|
||||||
"[Desktop Entry]\n"
|
"[Desktop Entry]\n"
|
||||||
@ -139,11 +127,8 @@ void registerXdgMime(){
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (askInstallDesktopEntry())
|
QDir().mkpath(QFileInfo(filePath).path());
|
||||||
{
|
fileWrite(filePath, mime);
|
||||||
QDir().mkpath(QFileInfo(filePath).path());
|
|
||||||
fileWrite(filePath, mime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user