mirror of https://github.com/procxx/kepka.git
Add Platform::AutostartSupported
This commit is contained in:
parent
413ddf285e
commit
e098922a4b
|
@ -174,6 +174,10 @@ void Application::run() {
|
||||||
psNewVersion();
|
psNewVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cAutoStart() && !Platform::AutostartSupported()) {
|
||||||
|
cSetAutoStart(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (cLaunchMode() == LaunchModeAutoStart && !cAutoStart()) {
|
if (cLaunchMode() == LaunchModeAutoStart && !cAutoStart()) {
|
||||||
psAutoStart(false, true);
|
psAutoStart(false, true);
|
||||||
App::quit();
|
App::quit();
|
||||||
|
|
|
@ -516,6 +516,13 @@ std::optional<crl::time> LastUserInputTime() {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AutostartSupported() {
|
||||||
|
// snap sandbox doesn't allow creating files in folders with names started with a dot
|
||||||
|
// and doesn't provide any api to add an app to autostart
|
||||||
|
// thus, autostart isn't supported in snap
|
||||||
|
return !InSnap();
|
||||||
|
}
|
||||||
|
|
||||||
void FallbackFontConfigCheckBegin() {
|
void FallbackFontConfigCheckBegin() {
|
||||||
if (!CheckFontConfigCrash()) {
|
if (!CheckFontConfigCrash()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -262,6 +262,10 @@ void IgnoreApplicationActivationRightNow() {
|
||||||
objc_ignoreApplicationActivationRightNow();
|
objc_ignoreApplicationActivationRightNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AutostartSupported() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
void psNewVersion() {
|
void psNewVersion() {
|
||||||
|
|
|
@ -40,6 +40,7 @@ bool OpenSystemSettings(SystemSettingsType type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IgnoreApplicationActivationRightNow();
|
void IgnoreApplicationActivationRightNow();
|
||||||
|
bool AutostartSupported();
|
||||||
|
|
||||||
namespace ThirdParty {
|
namespace ThirdParty {
|
||||||
|
|
||||||
|
|
|
@ -381,6 +381,10 @@ std::optional<crl::time> LastUserInputTime() {
|
||||||
return LastTrackedWhen;
|
return LastTrackedWhen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AutostartSupported() {
|
||||||
|
return !IsWindowsStoreBuild();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -404,8 +404,7 @@ void SetupTrayContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
}, taskbar->lifetime());
|
}, taskbar->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef OS_WIN_STORE
|
if (Platform::AutostartSupported()) {
|
||||||
if (Platform::IsWindows() || Platform::IsLinux()) {
|
|
||||||
const auto minimizedToggled = [] {
|
const auto minimizedToggled = [] {
|
||||||
return cStartMinimized() && !Global::LocalPasscode();
|
return cStartMinimized() && !Global::LocalPasscode();
|
||||||
};
|
};
|
||||||
|
@ -454,6 +453,7 @@ void SetupTrayContent(not_null<Ui::VerticalLayout*> container) {
|
||||||
}, minimized->lifetime());
|
}, minimized->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef OS_WIN_STORE
|
||||||
if (Platform::IsWindows()) {
|
if (Platform::IsWindows()) {
|
||||||
const auto sendto = addCheckbox(
|
const auto sendto = addCheckbox(
|
||||||
tr::lng_settings_add_sendto(tr::now),
|
tr::lng_settings_add_sendto(tr::now),
|
||||||
|
|
Loading…
Reference in New Issue