mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
Linux : Generate linphone.desktop file to ~/.local/share/applications from menu.
This commit is contained in:
parent
f20d299beb
commit
8260b104e5
20 changed files with 212 additions and 12 deletions
|
|
@ -2056,6 +2056,11 @@ Klikněte zde: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Nahrávky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2081,6 +2086,11 @@ Klikněte zde: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Nahrávky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Klik her: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Klik her: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Klicken Sie hier: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Aufzeichnungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Klicken Sie hier: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Aufzeichnungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Click here: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Recordings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation>Export %1.desktop file to applications</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Click here: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Recordings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation>Export %1.desktop file to applications</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Haga clic aquí: <a href="%1">%1 </a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Haga clic aquí: <a href="%1">%1 </a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Enregistrements</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Enregistrements</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2033,6 +2033,11 @@ Kattintson ide: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2058,6 +2063,11 @@ Kattintson ide: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Clicca: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Clicca: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2033,6 +2033,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>録音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2058,6 +2063,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>録音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2055,6 +2055,11 @@ Spustelėkite čia: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2080,6 +2085,11 @@ Spustelėkite čia: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Clique aqui: <a href="%1">%1 </a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Gravações</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Clique aqui: <a href="%1">%1 </a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Gravações</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2055,6 +2055,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Записи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2080,6 +2085,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation>Записи</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,11 @@ Klicka här: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2069,6 +2074,11 @@ Klicka här: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2033,6 +2033,11 @@ Buraya tıklayın: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2058,6 +2063,11 @@ Buraya tıklayın: <a href="%1">%1</a>
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2055,6 +2055,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2080,6 +2085,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -2033,6 +2033,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2058,6 +2063,11 @@
|
|||
<extracomment>'Recordings' : Label for the recordings menu.</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>exportDesktopFile</source>
|
||||
<extracomment>'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageAccounts</name>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ using namespace std;
|
|||
namespace {
|
||||
#ifdef Q_OS_LINUX
|
||||
const QString AutoStartDirectory(QDir::homePath().append(QStringLiteral("/.config/autostart/")));
|
||||
const QString ApplicationsDirectory(QDir::homePath().append(QStringLiteral("/.local/share/applications/")));
|
||||
#elif defined(Q_OS_MACOS)
|
||||
const QString OsascriptExecutable(QStringLiteral("osascript"));
|
||||
#else
|
||||
|
|
@ -464,6 +465,7 @@ void App::initContentApp () {
|
|||
mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider());
|
||||
|
||||
mEngine->rootContext()->setContextProperty("applicationName", APPLICATION_NAME);
|
||||
mEngine->rootContext()->setContextProperty("executableName", EXECUTABLE_NAME);
|
||||
|
||||
#ifdef APPLICATION_URL
|
||||
mEngine->rootContext()->setContextProperty("applicationUrl", APPLICATION_URL);
|
||||
|
|
@ -997,23 +999,37 @@ void App::setAutoStart (bool enabled) {
|
|||
}
|
||||
|
||||
const QString confPath(AutoStartDirectory + EXECUTABLE_NAME ".desktop");
|
||||
if(generateDesktopFile(confPath, !enabled)) {
|
||||
mAutoStart = enabled;
|
||||
emit autoStartChanged(enabled);
|
||||
}
|
||||
}
|
||||
void App::exportDesktopFile(){
|
||||
QDir dir(ApplicationsDirectory);
|
||||
if (!dir.exists() && !dir.mkpath(ApplicationsDirectory)) {
|
||||
qWarning() << QStringLiteral("Unable to build applications dir path: `%1`.").arg(ApplicationsDirectory);
|
||||
return;
|
||||
}
|
||||
|
||||
const QString confPath(ApplicationsDirectory + EXECUTABLE_NAME ".desktop");
|
||||
if(generateDesktopFile(confPath, true))
|
||||
generateDesktopFile(confPath, false);
|
||||
}
|
||||
bool App::generateDesktopFile(const QString& confPath, bool remove){
|
||||
qInfo() << QStringLiteral("Updating `%1`...").arg(confPath);
|
||||
QFile file(confPath);
|
||||
|
||||
if (!enabled) {
|
||||
if (remove) {
|
||||
if (file.exists() && !file.remove()) {
|
||||
qWarning() << QLatin1String("Unable to remove autostart file: `" EXECUTABLE_NAME ".desktop`.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
mAutoStart = enabled;
|
||||
emit autoStartChanged(enabled);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!file.open(QFile::WriteOnly)) {
|
||||
qWarning() << "Unable to open autostart file: `" EXECUTABLE_NAME ".desktop`.";
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const QString binPath(applicationFilePath());
|
||||
|
|
@ -1044,11 +1060,10 @@ void App::setAutoStart (bool enabled) {
|
|||
"Exec=" + exec + " --iconified\n"
|
||||
"Terminal=false\n"
|
||||
"Categories=Network;Telephony;\n"
|
||||
"MimeType=x-scheme-handler/sip-" EXECUTABLE_NAME ";x-scheme-handler/sip;x-scheme-handler/sips-" EXECUTABLE_NAME ";x-scheme-handler/sips;x-scheme-handler/tel;x-scheme-handler/callto;\n"
|
||||
"MimeType=x-scheme-handler/sip-" EXECUTABLE_NAME ";x-scheme-handler/sip;x-scheme-handler/sips-" EXECUTABLE_NAME ";x-scheme-handler/sips;x-scheme-handler/tel;x-scheme-handler/callto;x-scheme-handler/" EXECUTABLE_NAME "-config;\n"
|
||||
"X-PulseAudio-Properties=media.role=phone\n"
|
||||
);
|
||||
|
||||
mAutoStart = enabled;
|
||||
emit autoStartChanged(enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
#elif defined(Q_OS_MACOS)
|
||||
|
|
@ -1208,3 +1223,11 @@ bool App::isPdfAvailable(){
|
|||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool App::isLinux(){
|
||||
#ifdef Q_OS_LINUX
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,11 @@ public:
|
|||
|
||||
// Check module availability when no dependencies are needed (else use SettingsModel)
|
||||
Q_INVOKABLE static bool isPdfAvailable();
|
||||
Q_INVOKABLE static bool isLinux();
|
||||
#ifdef Q_OS_LINUX
|
||||
Q_INVOKABLE void exportDesktopFile();
|
||||
bool generateDesktopFile(const QString& confPath, bool remove);
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
void stateChanged(Qt::ApplicationState);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,13 @@ Item {
|
|||
onTriggered: App.checkForUpdates(true)
|
||||
}
|
||||
|
||||
MenuItem{
|
||||
visible: App.isLinux()
|
||||
//: 'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)
|
||||
text: qsTr('exportDesktopFile').arg(executableName)
|
||||
onTriggered: App.exportDesktopFile()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: qsTr('about')
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,12 @@ MenuBar {
|
|||
role: MenuItem.ApplicationSpecificRole
|
||||
onTriggered: App.checkForUpdates(true)
|
||||
}
|
||||
|
||||
MenuItem{
|
||||
visible: App.isLinux()
|
||||
//: 'Export %1.desktop file to applications' : Label menu to export the %1.desktop file to the ~/.local/share/applications/ folder on Linux (%1 is the exectuable name)
|
||||
text: qsTr('exportDesktopFile').arg(executableName)
|
||||
onTriggered: App.exportDesktopFile()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr('about')
|
||||
role: MenuItem.AboutRole
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue