Show descriptions for disabled file dialog options
This commit is contained in:
parent
35008195e8
commit
e26085b627
9 changed files with 35 additions and 10 deletions
|
|
@ -2756,6 +2756,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
"ktg_settings_file_dialog_type" = "File dialog";
|
||||
"ktg_file_dialog_type_default" = "Default";
|
||||
"ktg_file_dialog_disabled_on_build" = "Disabled on build";
|
||||
"ktg_file_dialog_disabled_by_option" = "Disabled by option";
|
||||
|
||||
"ktg_settings_other" = "Other";
|
||||
"ktg_profile_copy_id" = "Copy ID";
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@
|
|||
"ktg_settings_gtk_integration": "GTK integration",
|
||||
"ktg_settings_file_dialog_type": "File dialog",
|
||||
"ktg_file_dialog_type_default": "Default",
|
||||
"ktg_file_dialog_disabled_on_build": "Disabled on build",
|
||||
"ktg_file_dialog_disabled_by_option": "Disabled by option",
|
||||
"ktg_settings_other": "Other",
|
||||
"ktg_profile_copy_id": "Copy ID",
|
||||
"ktg_profile_bot_id": "Bot ID",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@
|
|||
"ktg_settings_gtk_integration": "GTK-интеграция",
|
||||
"ktg_settings_file_dialog_type": "Файловый диалог",
|
||||
"ktg_file_dialog_type_default": "По умолчанию",
|
||||
"ktg_file_dialog_disabled_on_build": "Отключено при сборке",
|
||||
"ktg_file_dialog_disabled_by_option": "Отключено настройкой",
|
||||
"ktg_settings_other": "Прочие",
|
||||
"ktg_profile_copy_id": "Копировать ID",
|
||||
"ktg_profile_bot_id": "ID бота",
|
||||
|
|
|
|||
|
|
@ -477,6 +477,7 @@ void SetupKotatoSystem(
|
|||
int(cFileDialogType()),
|
||||
int(Platform::FileDialog::ImplementationType::Count),
|
||||
FileDialogTypeLabel,
|
||||
Platform::FileDialog::ImplementationTypeDescription,
|
||||
[=](int value) {
|
||||
cSetFileDialogType(Platform::FileDialog::ImplementationType(value));
|
||||
::Kotato::JsonSettings::Write();
|
||||
|
|
|
|||
|
|
@ -161,17 +161,30 @@ bool GetQt(
|
|||
|
||||
QString ImplementationTypeLabel(ImplementationType value) {
|
||||
switch (value) {
|
||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
case ImplementationType::XDP: return qsl("XDG Desktop Portal");
|
||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
case ImplementationType::GTK: return qsl("GTK");
|
||||
#endif // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
case ImplementationType::Qt: return qsl("Qt");
|
||||
}
|
||||
Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel.");
|
||||
}
|
||||
|
||||
QString ImplementationTypeDescription(ImplementationType value) {
|
||||
switch (value) {
|
||||
#ifdef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
case ImplementationType::XDP: return tr::ktg_file_dialog_disabled_on_build(tr::now);
|
||||
#endif // DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
#ifdef DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
case ImplementationType::GTK: return tr::ktg_file_dialog_disabled_on_build(tr::now);
|
||||
#else // DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
case ImplementationType::GTK:
|
||||
return GtkIntegration::Instance()
|
||||
? tr::ktg_file_dialog_disabled_by_option(tr::now)
|
||||
: QString();
|
||||
#endif // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool Get(
|
||||
QPointer<QWidget> parent,
|
||||
QStringList &files,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ namespace FileDialog {
|
|||
|
||||
enum class ImplementationType {
|
||||
Default,
|
||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
XDP,
|
||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
GTK,
|
||||
#endif // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
|
||||
Qt,
|
||||
Count,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ enum class ImplementationType {
|
|||
};
|
||||
|
||||
inline QString ImplementationTypeLabel(ImplementationType value) {
|
||||
Unexpected("Value in Platform::FileDialog::TypeLabel.");
|
||||
Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel.");
|
||||
}
|
||||
|
||||
inline QString ImplementationTypeDescription(ImplementationType value) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
inline void InitLastPath() {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ namespace FileDialog {
|
|||
enum class ImplementationType;
|
||||
|
||||
QString ImplementationTypeLabel(ImplementationType value);
|
||||
QString ImplementationTypeDescription(ImplementationType value);
|
||||
|
||||
void InitLastPath();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,11 @@ enum class ImplementationType {
|
|||
};
|
||||
|
||||
inline QString ImplementationTypeLabel(ImplementationType value) {
|
||||
Unexpected("Value in Platform::FileDialog::TypeLabel.");
|
||||
Unexpected("Value in Platform::FileDialog::ImplementationTypeLabel.");
|
||||
}
|
||||
|
||||
inline QString ImplementationTypeDescription(ImplementationType value) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace FileDialog
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue