mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Toast: ensure all toasts have a title and a description for a more unified look.
This commit is contained in:
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Aktiviert"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Tastaturlayout geändert zu {layout}"
|
||||
"changed": "Tastaturlayout geändert zu {layout}",
|
||||
"title": "Tastatur"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Ko-fi-Seite in Ihrem Browser geöffnet"
|
||||
|
||||
+58
-57
@@ -2215,8 +2215,8 @@
|
||||
"settings": {
|
||||
"tooltip": "Plugin settings"
|
||||
},
|
||||
"settings-error-not-loaded": "Plugin not loaded",
|
||||
"settings-saved": "Plugin settings saved",
|
||||
"settings-error-not-loaded": "Plugin not loaded.",
|
||||
"settings-saved": "Plugin settings saved.",
|
||||
"source": {
|
||||
"custom": "Custom source",
|
||||
"official": "Official"
|
||||
@@ -2225,10 +2225,10 @@
|
||||
"add-custom": "Add custom repository",
|
||||
"add-dialog": {
|
||||
"description": "Add a GitHub repository as a plugin source.",
|
||||
"error": "Failed to add plugin source",
|
||||
"error": "Failed to add plugin source.",
|
||||
"name": "Repository name",
|
||||
"name-placeholder": "My Custom Plugins",
|
||||
"success": "Plugin source added successfully",
|
||||
"success": "Plugin source added successfully.",
|
||||
"title": "Add plugin source",
|
||||
"url": "Repository URL"
|
||||
},
|
||||
@@ -2250,9 +2250,9 @@
|
||||
"uninstalling": "Uninstalling {plugin}...",
|
||||
"update": "Update",
|
||||
"update-all": "Update All ({count})",
|
||||
"update-all-success": "All plugins updated successfully",
|
||||
"update-available": "{count} plugin update available",
|
||||
"update-available_plural": "{count} plugin updates available",
|
||||
"update-all-success": "All plugins updated successfully.",
|
||||
"update-available": "New plugin update available",
|
||||
"update-available_plural": "New plugin updates available ({count})",
|
||||
"update-error": "Failed to update plugin: {plugin}: {error}",
|
||||
"update-incompatible": "Requires Noctalia v{version} or higher",
|
||||
"update-success": "Updated {plugin} to v{version}",
|
||||
@@ -2680,8 +2680,8 @@
|
||||
},
|
||||
"toast": {
|
||||
"airplane-mode": {
|
||||
"disabled": "Disabled",
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled.",
|
||||
"enabled": "Enabled.",
|
||||
"title": "Airplane Mode"
|
||||
},
|
||||
"battery": {
|
||||
@@ -2689,20 +2689,20 @@
|
||||
"low-desc": "Battery is at {percent}%. Please connect the charger."
|
||||
},
|
||||
"bluetooth": {
|
||||
"confirm-code": "Confirm code {value} on the other device",
|
||||
"connect-failed": "Failed to connect to device",
|
||||
"disabled": "Disabled",
|
||||
"disconnect-failed": "Failed to disconnect from device",
|
||||
"discoverable-change-failed": "Failed to change discoverable state",
|
||||
"discoverable-disabled": "Discoverable disabled",
|
||||
"discoverable-enabled": "Discoverable enabled",
|
||||
"display-code": "Enter code {value} on the other device",
|
||||
"enabled": "Enabled",
|
||||
"forget-failed": "Failed to forget device",
|
||||
"pair-failed": "Failed to pair device",
|
||||
"passkey-required": "Passkey required by the device",
|
||||
"pincode-required": "PIN code required by the device",
|
||||
"state-change-failed": "Failed to change Bluetooth state"
|
||||
"confirm-code": "Confirm code {value} on the other device.",
|
||||
"connect-failed": "Failed to connect to device.",
|
||||
"disabled": "Disabled.",
|
||||
"disconnect-failed": "Failed to disconnect from device.",
|
||||
"discoverable-change-failed": "Failed to change discoverable state.",
|
||||
"discoverable-disabled": "Discoverable disabled.",
|
||||
"discoverable-enabled": "Discoverable enabled.",
|
||||
"display-code": "Enter code {value} on the other device.",
|
||||
"enabled": "Enabled.",
|
||||
"forget-failed": "Failed to forget device.",
|
||||
"pair-failed": "Failed to pair device.",
|
||||
"passkey-required": "Passkey required by the device.",
|
||||
"pincode-required": "PIN code required by the device.",
|
||||
"state-change-failed": "Failed to change Bluetooth state."
|
||||
},
|
||||
"clipboard": {
|
||||
"unavailable": "Clipboard history unavailable",
|
||||
@@ -2710,7 +2710,7 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Dark Mode",
|
||||
"enabled": "Enabled",
|
||||
"enabled": "Enabled.",
|
||||
"light-mode": "Light Mode"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
@@ -2720,78 +2720,79 @@
|
||||
"enabled-desc": "You'll find these notifications in your history."
|
||||
},
|
||||
"internet": {
|
||||
"limited": "Connected without internet"
|
||||
"limited": "Connected without internet."
|
||||
},
|
||||
"ipc": {
|
||||
"powerpanel-deprecated": "PowerPanel has been renamed to SessionMenu, this IPC call will be deprecated soon. Please use \"ipc call sessionMenu toggle\" instead.",
|
||||
"sidepanel-deprecated": "SidePanel has been renamed to ControlCenter, this IPC call will be deprecated soon. Please use \"ipc call controlCenter toggle\" instead."
|
||||
},
|
||||
"keep-awake": {
|
||||
"disabled": "Disabled",
|
||||
"enabled": "Enabled"
|
||||
"disabled": "Disabled.",
|
||||
"enabled": "Enabled."
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Keyboard layout changed to {layout}"
|
||||
"changed": "Keyboard layout changed to {layout}.",
|
||||
"title": "Keyboard"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Ko-fi page opened in your browser"
|
||||
"opened": "Ko-fi page opened in your browser."
|
||||
},
|
||||
"missing-control-center": {
|
||||
"description": "The control center widget has been removed from the bar. To access it from the bar again, you will need to re-add the widget. You can open it with right clicking on the bar too.",
|
||||
"label": "Last control center widget removed"
|
||||
},
|
||||
"night-light": {
|
||||
"disabled": "Disabled",
|
||||
"enabled": "Enabled",
|
||||
"forced": "Forced activation",
|
||||
"normal": "Normal mode",
|
||||
"not-installed": "wlsunset not installed"
|
||||
"disabled": "Disabled.",
|
||||
"enabled": "Enabled.",
|
||||
"forced": "Forced activation.",
|
||||
"normal": "Normal mode.",
|
||||
"not-installed": "wlsunset not installed."
|
||||
},
|
||||
"noctalia-performance": {
|
||||
"disabled": "Performance mode disabled",
|
||||
"enabled": "Performance mode enabled",
|
||||
"disabled": "Performance mode disabled.",
|
||||
"enabled": "Performance mode enabled.",
|
||||
"label": "Noctalia Performance"
|
||||
},
|
||||
"power-profile": {
|
||||
"changed": "Power profile changed",
|
||||
"changed": "Power profile changed.",
|
||||
"profile-name": "{profile}"
|
||||
},
|
||||
"recording": {
|
||||
"failed-general": "Recorder exited with an error",
|
||||
"failed-gpu": "gpu-screen-recorder exited unexpectedly",
|
||||
"failed-start": "Failed to start recording",
|
||||
"failed-general": "Recorder exited with an error.",
|
||||
"failed-gpu": "gpu-screen-recorder exited unexpectedly.",
|
||||
"failed-start": "Failed to start recording.",
|
||||
"no-portals": "Desktop portals not running",
|
||||
"no-portals-desc": "Start xdg-desktop-portal and a compositor portal (wlr/hyprland/gnome/kde).",
|
||||
"not-installed": "gpu-screen-recorder not installed",
|
||||
"not-installed-desc": "Please install gpu-screen-recorder to use screen recording features.",
|
||||
"saved": "Recording saved",
|
||||
"started": "Recording started",
|
||||
"saved": "Recording saved.",
|
||||
"started": "Recording started.",
|
||||
"stopping": "Stopping recording…"
|
||||
},
|
||||
"theming-processor-failed": {
|
||||
"desc-generic": "Encountered an error while processing templates",
|
||||
"desc-generic": "Encountered an error while processing templates.",
|
||||
"title-matugen": "Matugen templating processing failed",
|
||||
"title-predefined": "Predefined color cheme processing failed"
|
||||
"title-predefined": "Predefined color scheme processing failed"
|
||||
},
|
||||
"vpn": {
|
||||
"connected": "Connected to '{name}'",
|
||||
"disconnected": "Disconnected from '{name}'"
|
||||
"connected": "Connected to '{name}'.",
|
||||
"disconnected": "Disconnected from '{name}'."
|
||||
},
|
||||
"wallpaper-colors": {
|
||||
"disabled": "Wallpaper colors disabled",
|
||||
"enabled": "Wallpaper colors enabled",
|
||||
"disabled": "Wallpaper colors disabled.",
|
||||
"enabled": "Wallpaper colors enabled.",
|
||||
"label": "Wallpaper colors generation",
|
||||
"not-installed": "Matugen not installed — required for wallpaper color extraction"
|
||||
"not-installed": "Matugen not installed — required for wallpaper color extraction."
|
||||
},
|
||||
"wifi": {
|
||||
"connected": "Connected to '{ssid}'",
|
||||
"connection-failed": "Connection failed",
|
||||
"connection-timeout": "Connection timeout",
|
||||
"disabled": "Disabled",
|
||||
"disconnected": "Disconnected from '{ssid}'",
|
||||
"enabled": "Enabled",
|
||||
"incorrect-password": "Incorrect password",
|
||||
"network-not-found": "Network not found"
|
||||
"connected": "Connected to '{ssid}'.",
|
||||
"connection-failed": "Connection failed.",
|
||||
"connection-timeout": "Connection timeout.",
|
||||
"disabled": "Disabled.",
|
||||
"disconnected": "Disconnected from '{ssid}'.",
|
||||
"enabled": "Enabled.",
|
||||
"incorrect-password": "Incorrect password.",
|
||||
"network-not-found": "Network not found."
|
||||
}
|
||||
},
|
||||
"tooltips": {
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Activado"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Distribución de teclado cambiada a {layout}"
|
||||
"changed": "Distribución de teclado cambiada a {layout}",
|
||||
"title": "Teclado"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Página de Ko-fi abierta en tu navegador"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Activé"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Disposition du clavier changée vers {layout}"
|
||||
"changed": "Disposition du clavier changée vers {layout}",
|
||||
"title": "Clavier"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Page Ko-fi ouverte dans votre navigateur"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Bekapcsolva"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Billentyűzetkiosztás megváltozott: {layout}"
|
||||
"changed": "Billentyűzetkiosztás megváltozott: {layout}",
|
||||
"title": "Billentyűzet"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "A Ko-fi oldal megnyílt a böngészőjében"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "有効"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "キーボードレイアウトを {layout} に変更しました"
|
||||
"changed": "キーボードレイアウトを {layout} に変更しました",
|
||||
"title": "キーボード"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "ブラウザで Ko-fi ページを開きました"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Çalakkirî"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Şêwaza kilîtdankê bo {layout} hat guhertin"
|
||||
"changed": "Şêwaza kilîtdankê bo {layout} hat guhertin",
|
||||
"title": "Klavyeya"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Rûpela Ko-fi di geroka te de vebû."
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "\"Wakker houden\" ingeschakeld"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Toetsenbordindeling gewijzigd naar {layout}"
|
||||
"changed": "Toetsenbordindeling gewijzigd naar {layout}",
|
||||
"title": "Toetsenbord"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Ko-fi-pagina geopend in je browser"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Włączone"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Układ klawiatury zmieniony na {layout}"
|
||||
"changed": "Układ klawiatury zmieniony na {layout}",
|
||||
"title": "Klawiatura"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Strona Ko-fi otwarta w przeglądarce"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Ativado"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Layout de teclado alterado para {layout}"
|
||||
"changed": "Layout de teclado alterado para {layout}",
|
||||
"title": "Teclado"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Página do Ko-fi aberta no seu navegador"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Включен"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Раскладка клавиатуры изменена на {layout}"
|
||||
"changed": "Раскладка клавиатуры изменена на {layout}",
|
||||
"title": "Клавиатура"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Страница Ko-fi открыта в вашем браузере"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Etkin"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Klavye düzeni {layout} olarak değiştirildi"
|
||||
"changed": "Klavye düzeni {layout} olarak değiştirildi",
|
||||
"title": "Klavye"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Ko-fi sayfası tarayıcınızda açıldı"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "Увімкнено"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "Розкладка клавіатури змінена на {layout}"
|
||||
"changed": "Розкладка клавіатури змінена на {layout}",
|
||||
"title": "Клавіатура"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Сторінка Ko-fi відкрита у вашому браузері"
|
||||
|
||||
@@ -2731,7 +2731,8 @@
|
||||
"enabled": "已启用"
|
||||
},
|
||||
"keyboard-layout": {
|
||||
"changed": "键盘布局已更改为 {layout}"
|
||||
"changed": "键盘布局已更改为 {layout}",
|
||||
"title": "键盘"
|
||||
},
|
||||
"kofi": {
|
||||
"opened": "Ko-fi 页面已在您的浏览器中打开"
|
||||
|
||||
@@ -528,7 +528,7 @@ SmartPanel {
|
||||
GridLayout {
|
||||
id: largeButtonsGrid
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
columns: Settings.data.sessionMenu.largeButtonsLayout === "single-row" ? powerOptions.length : Math.min(3, Math.ceil(Math.sqrt(powerOptions.length)))
|
||||
columns: Settings.data.sessionMenu.largeButtonsLayout === "single-row" ? powerOptions.length : Math.min(3, Math.ceil(Math.sqrt(powerOptions.length)))
|
||||
rowSpacing: Style.marginXL
|
||||
columnSpacing: Style.marginXL
|
||||
width: columns * 200 * Style.uiScaleRatio + (columns - 1) * Style.marginXL
|
||||
|
||||
@@ -61,7 +61,7 @@ ColumnLayout {
|
||||
function updateNext() {
|
||||
if (currentIndex >= pluginIds.length) {
|
||||
isUpdating = false;
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.update-all-success"));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.update-all-success"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,15 +271,15 @@ ColumnLayout {
|
||||
rootRef.updatingPlugins = updates2;
|
||||
|
||||
if (success) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.update-success", {
|
||||
"plugin": pname,
|
||||
"version": pversion
|
||||
}));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.update-success", {
|
||||
"plugin": pname,
|
||||
"version": pversion
|
||||
}));
|
||||
} else {
|
||||
ToastService.showError(I18n.tr("settings.plugins.update-error", {
|
||||
"plugin": pname,
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.update-error", {
|
||||
"plugin": pname,
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -387,7 +387,7 @@ ColumnLayout {
|
||||
onToggled: function (checked) {
|
||||
PluginRegistry.setSourceEnabled(modelData.url, checked);
|
||||
PluginService.refreshAvailablePlugins();
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.refresh.refreshing"));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.refresh.refreshing"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -459,7 +459,7 @@ ColumnLayout {
|
||||
onClicked: {
|
||||
PluginService.refreshAvailablePlugins();
|
||||
checkUpdatesTimer.restart();
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.refresh.refreshing"));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.refresh.refreshing"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -742,13 +742,13 @@ ColumnLayout {
|
||||
enabled: sourceNameInput.text.length > 0 && sourceUrlInput.text.length > 0
|
||||
onClicked: {
|
||||
if (PluginRegistry.addPluginSource(sourceNameInput.text, sourceUrlInput.text)) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.sources.add-dialog.success"));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.sources.add-dialog.success"));
|
||||
PluginService.refreshAvailablePlugins();
|
||||
addSourceDialog.close();
|
||||
sourceNameInput.text = "";
|
||||
sourceUrlInput.text = "";
|
||||
} else {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.sources.add-dialog.error"));
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.sources.add-dialog.error"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -843,21 +843,21 @@ ColumnLayout {
|
||||
// ------------------------------
|
||||
|
||||
function installPlugin(pluginMetadata) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.installing", {
|
||||
"plugin": pluginMetadata.name
|
||||
}));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.installing", {
|
||||
"plugin": pluginMetadata.name
|
||||
}));
|
||||
|
||||
PluginService.installPlugin(pluginMetadata, false, function (success, error, registeredKey) {
|
||||
if (success) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.install-success", {
|
||||
"plugin": pluginMetadata.name
|
||||
}));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.install-success", {
|
||||
"plugin": pluginMetadata.name
|
||||
}));
|
||||
// Auto-enable the plugin after installation (use registered key which may be composite)
|
||||
PluginService.enablePlugin(registeredKey);
|
||||
} else {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.install-error", {
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.install-error", {
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -866,19 +866,19 @@ ColumnLayout {
|
||||
var manifest = PluginRegistry.getPluginManifest(pluginId);
|
||||
var pluginName = manifest?.name || pluginId;
|
||||
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.uninstalling", {
|
||||
"plugin": pluginName
|
||||
}));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.uninstalling", {
|
||||
"plugin": pluginName
|
||||
}));
|
||||
|
||||
PluginService.uninstallPlugin(pluginId, function (success, error) {
|
||||
if (success) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.uninstall-success", {
|
||||
"plugin": pluginName
|
||||
}));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.uninstall-success", {
|
||||
"plugin": pluginName
|
||||
}));
|
||||
} else {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.uninstall-error", {
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.uninstall-error", {
|
||||
"error": error || "Unknown error"
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import qs.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string message: ""
|
||||
property string title: ""
|
||||
property string description: ""
|
||||
property string icon: ""
|
||||
property string type: "notice"
|
||||
@@ -146,7 +146,7 @@ Item {
|
||||
|
||||
NText {
|
||||
Layout.fillWidth: true
|
||||
text: root.message
|
||||
text: root.title
|
||||
color: Color.mOnSurface
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Style.fontWeightBold
|
||||
@@ -168,6 +168,12 @@ Item {
|
||||
text: root.actionLabel
|
||||
visible: root.actionLabel.length > 0 && root.actionCallback !== null
|
||||
Layout.topMargin: Style.marginXS
|
||||
fontSize: Style.fontSizeS
|
||||
backgroundColor: Color.mPrimary
|
||||
textColor: hovered ? Color.mOnHover : Color.mOnPrimary
|
||||
hoverColor: Color.mHover
|
||||
outlined: false
|
||||
implicitHeight: 24
|
||||
onClicked: {
|
||||
if (root.actionCallback) {
|
||||
root.actionCallback();
|
||||
@@ -178,13 +184,13 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function show(msg, desc, msgIcon, msgType, msgDuration, msgActionLabel, msgActionCallback) {
|
||||
function show(msgTitle, msgDescription, msgIcon, msgType, msgDuration, msgActionLabel, msgActionCallback) {
|
||||
// Stop all timers first
|
||||
hideTimer.stop();
|
||||
hideAnimation.stop();
|
||||
|
||||
message = msg;
|
||||
description = desc || "";
|
||||
title = msgTitle;
|
||||
description = msgDescription || "";
|
||||
icon = msgIcon || "";
|
||||
type = msgType || "notice";
|
||||
duration = msgDuration || 3000;
|
||||
@@ -192,7 +198,7 @@ Item {
|
||||
actionCallback = msgActionCallback || null;
|
||||
|
||||
visible = true;
|
||||
opacity = 1;
|
||||
opacity = 1.0;
|
||||
scale = 1.0;
|
||||
|
||||
hideTimer.restart();
|
||||
|
||||
@@ -20,9 +20,9 @@ Item {
|
||||
Connections {
|
||||
target: ToastService
|
||||
|
||||
function onNotify(message, description, icon, type, duration, actionLabel, actionCallback) {
|
||||
function onNotify(title, description, icon, type, duration, actionLabel, actionCallback) {
|
||||
root.enqueueToast({
|
||||
"message": message,
|
||||
"title": title,
|
||||
"description": description,
|
||||
"icon": icon,
|
||||
"type": type,
|
||||
@@ -45,7 +45,7 @@ Item {
|
||||
function enqueueToast(toastData) {
|
||||
// Safe logging - fix the substring bug
|
||||
var descPreview = (toastData.description || "").substring(0, 100).replace(/\n/g, " ");
|
||||
Logger.d("ToastScreen", "Queuing", toastData.type, ":", toastData.message, descPreview);
|
||||
Logger.d("ToastScreen", "Queuing", toastData.type, ":", toastData.title, descPreview);
|
||||
|
||||
// Bounded queue to prevent unbounded memory growth
|
||||
if (messageQueue.length >= maxQueueSize) {
|
||||
@@ -123,7 +123,7 @@ Item {
|
||||
onStatusChanged: {
|
||||
// When loader becomes ready, show the pending toast
|
||||
if (status === Loader.Ready && pendingToast !== null) {
|
||||
item.showToast(pendingToast.message, pendingToast.description, pendingToast.icon, pendingToast.type, pendingToast.duration, pendingToast.actionLabel, pendingToast.actionCallback);
|
||||
item.showToast(pendingToast.title, pendingToast.description, pendingToast.icon, pendingToast.type, pendingToast.duration, pendingToast.actionLabel, pendingToast.actionCallback);
|
||||
pendingToast = null;
|
||||
}
|
||||
}
|
||||
@@ -217,8 +217,8 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function showToast(message, description, icon, type, duration, actionLabel, actionCallback) {
|
||||
toastItem.show(message, description, icon, type, duration, actionLabel, actionCallback);
|
||||
function showToast(title, description, icon, type, duration, actionLabel, actionCallback) {
|
||||
toastItem.show(title, description, icon, type, duration, actionLabel, actionCallback);
|
||||
}
|
||||
|
||||
function hideToast() {
|
||||
|
||||
@@ -61,7 +61,7 @@ Singleton {
|
||||
const message = I18n.tr("toast.keyboard-layout.changed", {
|
||||
"layout": currentLayout.toUpperCase()
|
||||
});
|
||||
ToastService.showNotice(message, "", "", 2000);
|
||||
ToastService.showNotice(I18n.tr("toast.keyboard-layout.title"), message, "", 2000);
|
||||
}
|
||||
Logger.d("KeyboardLayout", "Layout changed from", previousLayout, "to", currentLayout);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ Singleton {
|
||||
var collision = checkPluginCollision(pluginMetadata);
|
||||
if (collision.collision) {
|
||||
Logger.w("PluginService", "Plugin collision detected:", collision.message);
|
||||
ToastService.showError(collision.message);
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), collision.message);
|
||||
if (callback)
|
||||
callback(false, collision.message);
|
||||
return;
|
||||
@@ -1144,27 +1144,27 @@ Singleton {
|
||||
|
||||
if (updateCount > 0) {
|
||||
Logger.i("PluginService", updateCount, "plugin update(s) available");
|
||||
ToastService.showNotice(I18n.trp("settings.plugins.update-available", updateCount, "{count} plugin update available", "{count} plugin updates available", {
|
||||
"count": updateCount
|
||||
}), "", "plugin", 5000, I18n.tr("settings.plugins.open-plugins-tab"), function () {
|
||||
// Open settings panel to Plugins tab on the screen where the cursor is
|
||||
if (root.screenDetector) {
|
||||
root.screenDetector.withCurrentScreen(function (screen) {
|
||||
var panel = PanelService.getPanel("settingsPanel", screen);
|
||||
if (panel) {
|
||||
panel.requestedTab = SettingsPanel.Tab.Plugins;
|
||||
panel.open();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Fallback to primary screen if screen detector is not available
|
||||
var panel = PanelService.getPanel("settingsPanel", Quickshell.screens[0]);
|
||||
if (panel) {
|
||||
panel.requestedTab = SettingsPanel.Tab.Plugins;
|
||||
panel.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.trp("settings.plugins.update-available", updateCount, "{count} plugin update available", "{count} plugin updates available", {
|
||||
"count": updateCount
|
||||
}), "plugin", 5000, I18n.tr("settings.plugins.open-plugins-tab"), function () {
|
||||
// Open settings panel to Plugins tab on the screen where the cursor is
|
||||
if (root.screenDetector) {
|
||||
root.screenDetector.withCurrentScreen(function (screen) {
|
||||
var panel = PanelService.getPanel("settingsPanel", screen);
|
||||
if (panel) {
|
||||
panel.requestedTab = SettingsPanel.Tab.Plugins;
|
||||
panel.open();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Fallback to primary screen if screen detector is not available
|
||||
var panel = PanelService.getPanel("settingsPanel", Quickshell.screens[0]);
|
||||
if (panel) {
|
||||
panel.requestedTab = SettingsPanel.Tab.Plugins;
|
||||
panel.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Logger.i("PluginService", "All plugins are up to date");
|
||||
}
|
||||
@@ -1534,9 +1534,9 @@ Singleton {
|
||||
|
||||
// Show toast notification
|
||||
var pluginName = manifest.name || pluginId;
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.hot-reloaded", {
|
||||
"name": pluginName
|
||||
}), "");
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.hot-reloaded", {
|
||||
"name": pluginName
|
||||
}));
|
||||
|
||||
Logger.i("PluginService", "Hot reload complete for plugin:", pluginId);
|
||||
});
|
||||
|
||||
@@ -9,18 +9,18 @@ Singleton {
|
||||
// Simple signal-based notification system
|
||||
// actionLabel: optional label for clickable action link
|
||||
// actionCallback: optional function to call when action is clicked
|
||||
signal notify(string message, string description, string icon, string type, int duration, string actionLabel, var actionCallback)
|
||||
signal notify(string title, string description, string icon, string type, int duration, string actionLabel, var actionCallback)
|
||||
|
||||
// Convenience methods
|
||||
function showNotice(message, description = "", icon = "", duration = 3000, actionLabel = "", actionCallback = null) {
|
||||
notify(message, description, icon, "notice", duration, actionLabel, actionCallback);
|
||||
function showNotice(title, description = "", icon = "", duration = 3000, actionLabel = "", actionCallback = null) {
|
||||
notify(title, description, icon, "notice", duration, actionLabel, actionCallback);
|
||||
}
|
||||
|
||||
function showWarning(message, description = "", duration = 4000, actionLabel = "", actionCallback = null) {
|
||||
notify(message, description, "", "warning", duration, actionLabel, actionCallback);
|
||||
function showWarning(title, description = "", duration = 4000, actionLabel = "", actionCallback = null) {
|
||||
notify(title, description, "", "warning", duration, actionLabel, actionCallback);
|
||||
}
|
||||
|
||||
function showError(message, description = "", duration = 6000, actionLabel = "", actionCallback = null) {
|
||||
notify(message, description, "", "error", duration, actionLabel, actionCallback);
|
||||
function showError(title, description = "", duration = 6000, actionLabel = "", actionCallback = null) {
|
||||
notify(title, description, "", "error", duration, actionLabel, actionCallback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ Popup {
|
||||
settingsLoader.item.saveSettings();
|
||||
root.close();
|
||||
if (root.showToastOnSave) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.settings-saved"));
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.settings-saved"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ Popup {
|
||||
if (!currentPluginApi) {
|
||||
Logger.e("NPluginSettingsPopup", "Cannot open settings: plugin not loaded:", pluginManifest.id);
|
||||
if (showToastOnSave) {
|
||||
ToastService.showNotice(I18n.tr("settings.plugins.settings-error-not-loaded"));
|
||||
ToastService.showError(I18n.tr("settings.plugins.title"), I18n.tr("settings.plugins.settings-error-not-loaded"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user