mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Check GNotification option via base::options::lookup
This commit is contained in:
@@ -70,6 +70,37 @@ constexpr auto kSystemAlertDuration = crl::time(1000);
|
||||
constexpr auto kSystemAlertDuration = crl::time(0);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
base::options::toggle OptionCustomNotification({
|
||||
.id = kOptionCustomNotification,
|
||||
.name = "Force non-native notifications availability",
|
||||
.description = "Allow to disable native notifications"
|
||||
" even if custom notifications are broken on this platform",
|
||||
.scope = [] {
|
||||
return Platform::Notifications::Enforced();
|
||||
},
|
||||
});
|
||||
|
||||
base::options::toggle OptionGNotification({
|
||||
.id = kOptionGNotification,
|
||||
.name = "GNotification",
|
||||
.description = "Force enable GLib's GNotification."
|
||||
" When disabled, autodetect is used.",
|
||||
.scope = [] {
|
||||
#if __has_include(<gio/gio.hpp>)
|
||||
using namespace gi::repository;
|
||||
return bool(Gio::Application::get_default());
|
||||
#else // __has_include(<gio/gio.hpp>)
|
||||
return false;
|
||||
#endif // __has_include(<gio/gio.hpp>)
|
||||
},
|
||||
});
|
||||
|
||||
base::options::toggle HideReplyButtonOption({
|
||||
.id = kOptionHideReplyButton,
|
||||
.name = "Hide reply button",
|
||||
.description = "Hide reply button in notifications.",
|
||||
});
|
||||
|
||||
[[nodiscard]] QString PlaceholderReactionText() {
|
||||
static const auto result = QString::fromUtf8("\xf0\x9f\x92\xad");
|
||||
return result;
|
||||
@@ -140,41 +171,9 @@ constexpr auto kSystemAlertDuration = crl::time(0);
|
||||
} // namespace
|
||||
|
||||
const char kOptionCustomNotification[] = "custom-notification";
|
||||
|
||||
base::options::toggle OptionCustomNotification({
|
||||
.id = kOptionCustomNotification,
|
||||
.name = "Force non-native notifications availability",
|
||||
.description = "Allow to disable native notifications"
|
||||
" even if custom notifications are broken on this platform",
|
||||
.scope = [] {
|
||||
return Platform::Notifications::Enforced();
|
||||
},
|
||||
});
|
||||
|
||||
const char kOptionGNotification[] = "gnotification";
|
||||
const char kOptionHideReplyButton[] = "hide-reply-button";
|
||||
|
||||
base::options::toggle OptionGNotification({
|
||||
.id = kOptionGNotification,
|
||||
.name = "GNotification",
|
||||
.description = "Force enable GLib's GNotification."
|
||||
" When disabled, autodetect is used.",
|
||||
.scope = [] {
|
||||
#if __has_include(<gio/gio.hpp>)
|
||||
using namespace gi::repository;
|
||||
return bool(Gio::Application::get_default());
|
||||
#else // __has_include(<gio/gio.hpp>)
|
||||
return false;
|
||||
#endif // __has_include(<gio/gio.hpp>)
|
||||
},
|
||||
});
|
||||
|
||||
base::options::toggle HideReplyButtonOption({
|
||||
.id = kOptionHideReplyButton,
|
||||
.name = "Hide reply button",
|
||||
.description = "Hide reply button in notifications.",
|
||||
});
|
||||
|
||||
struct System::Waiter {
|
||||
NotificationInHistoryKey key;
|
||||
UserData *reactionOrVoteSender = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user