diff --git a/po/POTFILES.in b/po/POTFILES.in index 36105ef3e8..4a7c43899d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -65,10 +65,13 @@ src/plugins/sftp/sftp.plugin.desktop.in src/plugins/sftp/valent-sftp-plugin.c src/plugins/sftp/valent-sftp-preferences.ui src/plugins/share/share.plugin.desktop.in +src/plugins/share/valent-share-dialog.c +src/plugins/share/valent-share-dialog.ui +src/plugins/share/valent-share-dialog-row.c +src/plugins/share/valent-share-dialog-row.ui src/plugins/share/valent-share-plugin.c src/plugins/share/valent-share-preferences.c src/plugins/share/valent-share-preferences.ui -src/plugins/share/valent-share-target-chooser.ui src/plugins/share/valent-share-text-dialog.c src/plugins/share/valent-share-text-dialog.ui src/plugins/sms/sms.plugin.desktop.in diff --git a/po/en.po b/po/en.po index 1570e8b8a7..1d0114a7d3 100644 --- a/po/en.po +++ b/po/en.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2022-03-28 11:21-0700\n" "Last-Translator: Andy Holmes \n" "Language-Team: English \n" @@ -18,6 +18,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "" @@ -43,19 +56,6 @@ msgstr "" msgid "Whether the plugin is enabled or not." msgstr "" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -162,7 +162,7 @@ msgid "Request Pairing" msgstr "" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "" @@ -298,6 +298,18 @@ msgstr "" msgid "No Actions" msgstr "" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 msgid "Application" msgstr "" @@ -347,7 +359,7 @@ msgid "Desktop Integration" msgstr "" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "" @@ -357,7 +369,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -369,7 +381,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -381,7 +393,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -393,7 +405,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -405,7 +417,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -417,7 +429,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -429,7 +441,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -441,7 +453,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -476,7 +488,8 @@ msgid "Main Menu" msgstr "" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "" @@ -488,11 +501,15 @@ msgstr "" msgid "List of available and known devices" msgstr "" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +msgid "Share…" +msgstr "" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "" @@ -567,6 +584,14 @@ msgstr "" msgid "Notify when the remote battery is low" msgstr "" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +msgid "Connect devices over Bluetooth" +msgstr "" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "" @@ -697,6 +722,14 @@ msgstr "" msgid "Found" msgstr "" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +msgid "Integration with GNOME" +msgstr "" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "" @@ -748,7 +781,6 @@ msgstr "" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "" @@ -960,6 +992,63 @@ msgstr "" msgid "Direct file, link and text sharing" msgstr "" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, c-format +msgid "%u files" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:41 +msgid "Select files, enter a link or paste text" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:50 +msgid "Pick Files" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +msgid "Share with multiple devices" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1046,15 +1135,10 @@ msgstr[0] "" msgstr[1] "" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "" @@ -1070,22 +1154,6 @@ msgstr "" msgid "Where received files are stored" msgstr "" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" diff --git a/po/es.po b/po/es.po index d9344033d8..d036cdb74d 100644 --- a/po/es.po +++ b/po/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2023-11-09 18:24+0100\n" "Last-Translator: HDavo \n" "Language-Team: Spanish - Spain <>\n" @@ -20,6 +20,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Gtranslator 45.3\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "Valent" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "Conecta, controla y sincroniza tus dispositivos" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "Emparejado" @@ -45,19 +58,6 @@ msgstr "Estado de la Extensión" msgid "Whether the plugin is enabled or not." msgstr "Si la extensión está activada o no" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "Valent" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "Conecta, controla y sincroniza tus dispositivos" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -171,7 +171,7 @@ msgid "Request Pairing" msgstr "Solicitar Emparejamiento" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "Preferencias" @@ -307,6 +307,18 @@ msgstr "Aleatorio" msgid "No Actions" msgstr "Sin Acciones" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 msgid "Application" msgstr "Aplicación" @@ -356,7 +368,7 @@ msgid "Desktop Integration" msgstr "Integración con Escritorio" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "--:--" @@ -366,7 +378,7 @@ msgstr "--:--" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -378,7 +390,7 @@ msgstr "%d:%02d:%02d" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -390,7 +402,7 @@ msgstr "%d:%02d:%02d.%03d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -402,7 +414,7 @@ msgstr "-%d:%02d:%02d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -414,7 +426,7 @@ msgstr "-%d:%02d:%02d.%03d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -426,7 +438,7 @@ msgstr "-%d:%02d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -438,7 +450,7 @@ msgstr "-%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -450,7 +462,7 @@ msgstr "%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -485,7 +497,8 @@ msgid "Main Menu" msgstr "Menú Principal" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "Dispositivos" @@ -497,11 +510,16 @@ msgstr "Buscando dispositivos…" msgid "List of available and known devices" msgstr "Lista de dispositivos conocidos y disponibles" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "Compartir" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "Acerca de Valent" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "Cerrar" @@ -576,6 +594,15 @@ msgstr "Notificación de Batería Baja" msgid "Notify when the remote battery is low" msgstr "Avisar si la batería del dispositivo se está agotando" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "Conectar dispositivos a través de LAN" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "Sincronizar portapapeles entre dispositivos" @@ -706,6 +733,15 @@ msgstr "Hacer Sonar" msgid "Found" msgstr "Encontrado" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "Integración con GTK4" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -757,7 +793,6 @@ msgstr "Notificación" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "_Cancelar" @@ -969,6 +1004,66 @@ msgstr "Compartiendo" msgid "Direct file, link and text sharing" msgstr "Intercambio directo de archivos, enlaces y textos" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "Archivos" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "Compartir" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "Comparte archivos, enlaces y texto" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "Archivos Locales" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "Compartir contactos con un dispositivo remoto" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "Buscando…" + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "_Compartir" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1055,15 +1150,10 @@ msgstr[0] "Enviar un archivo a %1$s" msgstr[1] "Enviar %2$d archivos a %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "Compartir Archivos" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "Compartir" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "Enviar Archivos" @@ -1079,22 +1169,6 @@ msgstr "Directorio de descargas" msgid "Where received files are stored" msgstr "Donde se almacenan los archivos recibidos" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "_Compartir" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "Elige un dispositivo con el que compartir los archivos seleccionados." - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "Buscando…" - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "Usar siempre este dispositivo" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" @@ -1323,3 +1397,10 @@ msgstr "Portals" #: src/plugins/xdp/xdp.plugin.desktop.in:8 msgid "Integration with desktop portals" msgstr "Integración con desktop portals" + +#~ msgid "Choose a device to share the selected files with." +#~ msgstr "" +#~ "Elige un dispositivo con el que compartir los archivos seleccionados." + +#~ msgid "Always use this device" +#~ msgstr "Usar siempre este dispositivo" diff --git a/po/fr.po b/po/fr.po index 8b931a724e..0781b24a68 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2023-03-04 17:28+0100\n" "Last-Translator: Valérie Roux \n" "Language-Team: French \n" @@ -20,6 +20,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "X-Generator: Gtranslator 42.0\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "Valent" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "Connectez, contrôlez et synchronisez vos appareils" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "Lié" @@ -45,19 +58,6 @@ msgstr "État de l'extension" msgid "Whether the plugin is enabled or not." msgstr "Si l'extension est activée ou non" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "Valent" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "Connectez, contrôlez et synchronisez vos appareils" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -173,7 +173,7 @@ msgid "Request Pairing" msgstr "Demande de liaison" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "Paramètres" @@ -316,6 +316,18 @@ msgstr "Aléatoire" msgid "No Actions" msgstr "Aucune action" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 #, fuzzy msgid "Application" @@ -366,7 +378,7 @@ msgid "Desktop Integration" msgstr "Intégration bureau" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "--:--" @@ -376,7 +388,7 @@ msgstr "--:--" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -388,7 +400,7 @@ msgstr "%d:%02d:%02d" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -400,7 +412,7 @@ msgstr "%d:%02d:%02d.%03d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -412,7 +424,7 @@ msgstr "-%d:%02d:%02d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -424,7 +436,7 @@ msgstr "-%d:%02d:%02d.%03d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -436,7 +448,7 @@ msgstr "-%d:%02d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -448,7 +460,7 @@ msgstr "-%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -460,7 +472,7 @@ msgstr "%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -497,7 +509,8 @@ msgid "Main Menu" msgstr "Nom de l'appareil" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "Appareils" @@ -509,11 +522,16 @@ msgstr "Recherche d'appareils" msgid "List of available and known devices" msgstr "" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "Partager" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "À propos de Valent" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "Quitter" @@ -590,6 +608,15 @@ msgstr "Notification de batterie faible" msgid "Notify when the remote battery is low" msgstr "Avertir lorsque la batterie est faible" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "Connecter des appareils LAN" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 #, fuzzy msgid "Sync the clipboard between devices" @@ -733,6 +760,15 @@ msgstr "Sonner" msgid "Found" msgstr "Trouvé" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "Intégration avec GTK4" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -784,7 +820,6 @@ msgstr "Notification" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "Annuler" @@ -1018,6 +1053,66 @@ msgstr "Partager" msgid "Direct file, link and text sharing" msgstr "Partagez des fichiers, des liens et du texte" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "Tous les fichiers" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "Partager" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "Partagez des fichiers, des liens et du texte" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "Système de fichiers local" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "Prendre une photo avec l'appareil distant" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "Recherche..." + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "Partager" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1104,15 +1199,10 @@ msgstr[0] "Un fichier envoyé vers %1$s" msgstr[1] "%2$d fichiers envoyés vers %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "Partager des fichiers" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "Partager" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "Envoyer des fichiers" @@ -1128,22 +1218,6 @@ msgstr "Dossier de téléchargement" msgid "Where received files are stored" msgstr "Où les fichiers entrants sont stockés" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "Partager" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "Choisissez un appareil auquel partager les fichiers seléctionnés." - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "Recherche..." - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "Toujours utiliser cet appareil" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" @@ -1377,5 +1451,11 @@ msgstr "Portails" msgid "Integration with desktop portals" msgstr "Intégration avec les portails de bureau" +#~ msgid "Choose a device to share the selected files with." +#~ msgstr "Choisissez un appareil auquel partager les fichiers seléctionnés." + +#~ msgid "Always use this device" +#~ msgstr "Toujours utiliser cet appareil" + #~ msgid "Applications" #~ msgstr "Applications" diff --git a/po/it.po b/po/it.po index 19a9289033..edf513212b 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2024-03-21 03:05+0100\n" "Last-Translator: Gianni Lerro \n" "Language-Team: Italian <>\n" @@ -18,6 +18,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Gtranslator 45.3\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "Valent" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "Connetti, controlla e sincronizza i dispositivi" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "Accoppiato" @@ -43,19 +56,6 @@ msgstr "Stato del plugin" msgid "Whether the plugin is enabled or not." msgstr "Se il plugin è abilitato o meno." -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "Valent" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "Connetti, controlla e sincronizza i dispositivi" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -169,7 +169,7 @@ msgid "Request Pairing" msgstr "Richiesta di abbinamento" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "Preferenze" @@ -305,6 +305,18 @@ msgstr "Casuale" msgid "No Actions" msgstr "Nessuna azione" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 msgid "Application" msgstr "Applicazione" @@ -354,7 +366,7 @@ msgid "Desktop Integration" msgstr "Integrazione desktop" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "--:--" @@ -364,7 +376,7 @@ msgstr "--:--" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -376,7 +388,7 @@ msgstr "%d:%02d:%02d" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -388,7 +400,7 @@ msgstr "%d:%02d:%02d.%03d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -400,7 +412,7 @@ msgstr "-%d:%02d:%02d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -412,7 +424,7 @@ msgstr "-%d:%02d:%02d.%03d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -424,7 +436,7 @@ msgstr "-%d:%02d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -436,7 +448,7 @@ msgstr "-%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -448,7 +460,7 @@ msgstr "%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -483,7 +495,8 @@ msgid "Main Menu" msgstr "Menu principale" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "Dispositivi" @@ -495,11 +508,16 @@ msgstr "Ricerca dispositivi…" msgid "List of available and known devices" msgstr "Elenco dei dispositivi disponibili e conosciuti" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "Condivisione" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "Informazioni su Valent" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "Esci" @@ -574,6 +592,15 @@ msgstr "Notifica di batteria scarica" msgid "Notify when the remote battery is low" msgstr "Notifica quando la batteria remota è scarica" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "Connetti i dispositivi tramite LAN" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "Sincronizza gli appunti tra dispositivi" @@ -704,6 +731,15 @@ msgstr "Squillo" msgid "Found" msgstr "Trovato" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "Integrazione con GTK4" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -755,7 +791,6 @@ msgstr "Notifica" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "_Cancella" @@ -967,6 +1002,66 @@ msgstr "Condivisione" msgid "Direct file, link and text sharing" msgstr "Condivisione diretta di file, collegamenti e testo" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "Salva" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "Condivisione" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "Condividi file, collegamenti e testo" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "File locali" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "Condividi i contatti con il dispositivo remoto" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "Ricerca…" + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "_Condivisione" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1053,15 +1148,10 @@ msgstr[0] "Inviato un file a %1$s" msgstr[1] "Inviati %2$d file a %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "Condivisione file" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "Condivisione" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "Invia file" @@ -1077,22 +1167,6 @@ msgstr "Cartella dei download" msgid "Where received files are stored" msgstr "Dove vengono archiviati i file ricevuti" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "_Condivisione" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "Scegli un dispositivo con cui condividere i file selezionati." - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "Ricerca…" - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "Usa sempre questo dispositivo" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" @@ -1321,3 +1395,9 @@ msgstr "Portals" #: src/plugins/xdp/xdp.plugin.desktop.in:8 msgid "Integration with desktop portals" msgstr "Integrazione con desktop portals" + +#~ msgid "Choose a device to share the selected files with." +#~ msgstr "Scegli un dispositivo con cui condividere i file selezionati." + +#~ msgid "Always use this device" +#~ msgstr "Usa sempre questo dispositivo" diff --git a/po/nl.po b/po/nl.po index 447613a1df..526600e3e0 100644 --- a/po/nl.po +++ b/po/nl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2022-09-12 19:59+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch\n" @@ -17,6 +17,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 3.1.1\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "Valent" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "Verbind met, beheer en synchroniseer tussen apparaten" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "Gekoppeld" @@ -42,19 +55,6 @@ msgstr "Plug-instatus" msgid "Whether the plugin is enabled or not." msgstr "Of de plug-in is ingeschakeld." -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "Valent" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "Verbind met, beheer en synchroniseer tussen apparaten" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -168,7 +168,7 @@ msgid "Request Pairing" msgstr "Koppelverzoek versturen" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "Voorkeuren" @@ -310,6 +310,18 @@ msgstr "" msgid "No Actions" msgstr "Er zijn geen acties." +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 #, fuzzy msgid "Application" @@ -360,7 +372,7 @@ msgid "Desktop Integration" msgstr "Bureaubladintegratie" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "" @@ -370,7 +382,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -382,7 +394,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -394,7 +406,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -406,7 +418,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -418,7 +430,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -430,7 +442,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -442,7 +454,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -454,7 +466,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -491,7 +503,8 @@ msgid "Main Menu" msgstr "Apparaatnaam" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "Apparaten" @@ -503,11 +516,16 @@ msgstr "Bezig met zoeken naar apparaten…" msgid "List of available and known devices" msgstr "" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "Delen" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "Over Valent" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "Afsluiten" @@ -584,6 +602,15 @@ msgstr "Laag accuniveau" msgid "Notify when the remote battery is low" msgstr "Toon een melding als de accu bijna leeg is." +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "Verbind met apparaten via lan" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 #, fuzzy msgid "Sync the clipboard between devices" @@ -727,6 +754,15 @@ msgstr "Bellen" msgid "Found" msgstr "Gevonden" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "Integratie met GTK4" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -778,7 +814,6 @@ msgstr "Melding" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "_Annuleren" @@ -1013,6 +1048,68 @@ msgstr "Delen" msgid "Direct file, link and text sharing" msgstr "Deel bestanden, links en tekst" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "Alle bestanden" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "Delen" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "Deel bestanden, links en tekst" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "Lokaal bestandssysteem" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "Maak een foto met het externe apparaat" + +#: src/plugins/share/valent-share-dialog.ui:192 +#, fuzzy +msgid "Searching…" +msgstr "Bezig met zoeken naar apparaten…" + +#: src/plugins/share/valent-share-dialog.ui:215 +#, fuzzy +msgid "_Share" +msgstr "Delen" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1099,15 +1196,10 @@ msgstr[0] "Eén bestand verstuurd naar %1$s" msgstr[1] "%2$d bestanden verstuurd naar %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "Bestanden delen" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "Delen" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "Bestanden versturen" @@ -1123,24 +1215,6 @@ msgstr "Downloadmap" msgid "Where received files are stored" msgstr "Waar ontvangen bestanden dienen te worden opgeslagen" -#: src/plugins/share/valent-share-target-chooser.ui:29 -#, fuzzy -msgid "_Share" -msgstr "Delen" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:86 -#, fuzzy -msgid "Searching…" -msgstr "Bezig met zoeken naar apparaten…" - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" diff --git a/po/pt_BR.po b/po/pt_BR.po index 2b087623d7..ca093644d0 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2023-10-29 00:44-0300\n" "Last-Translator: Victor L. Pavan \n" "Language-Team: Brazilian Portuguese \n" @@ -20,6 +20,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "X-Generator: Gtranslator 45.3\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "Valent" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "Se conecte, controle e sincronize dispositivos" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "Pareado" @@ -45,19 +58,6 @@ msgstr "Estado do Plugin" msgid "Whether the plugin is enabled or not." msgstr "Se o plugin está habilitado ou não" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "Valent" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "Se conecte, controle e sincronize dispositivos" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -172,7 +172,7 @@ msgid "Request Pairing" msgstr "Requisitar Pareamento" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "Preferências" @@ -308,6 +308,18 @@ msgstr "Embaralhar" msgid "No Actions" msgstr "Nenhuma Ação" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 msgid "Application" msgstr "Aplicativo" @@ -357,7 +369,7 @@ msgid "Desktop Integration" msgstr "Integração com a Área de Trabalho" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "--:--" @@ -367,7 +379,7 @@ msgstr "--:--" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -379,7 +391,7 @@ msgstr "%d:%02d:%02d" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -391,7 +403,7 @@ msgstr "%d:%02d:%02d.%03d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -403,7 +415,7 @@ msgstr "-%d:%02d:%02d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -415,7 +427,7 @@ msgstr "-%d:%02d:%02d.%03d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -427,7 +439,7 @@ msgstr "-%d:%02d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -439,7 +451,7 @@ msgstr "-%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -451,7 +463,7 @@ msgstr "%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -486,7 +498,8 @@ msgid "Main Menu" msgstr "Menu Principal" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "Dispositivos" @@ -498,11 +511,16 @@ msgstr "Procurando dispositivos..." msgid "List of available and known devices" msgstr "Lista de dispositivos disponiveis ou lembrados" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "Compartilhar" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "Sobre o Valent" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "Sair" @@ -577,6 +595,15 @@ msgstr "Notificação de Bateria Fraca" msgid "Notify when the remote battery is low" msgstr "Notificar quando a bateria estiver fraca" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "Conectar dispositivos via LAN" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "Sincronizar a área de transferência entre os dispositivos" @@ -707,6 +734,15 @@ msgstr "Tocar" msgid "Found" msgstr "Encontrado" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "Integração com GTK4" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -758,7 +794,6 @@ msgstr "Notificação" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "_Cancelar" @@ -970,6 +1005,66 @@ msgstr "Compartilhamento" msgid "Direct file, link and text sharing" msgstr "Compartilhamento direto de arquivos, links e texto" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "Arquivos" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "Compartilhar" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "Compartilhe arquivos, links e texto" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "Arquivos Locais" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "Compartilhar contatos com o dispositivo remoto" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "Procurando..." + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "_Compartilhar" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1056,15 +1151,10 @@ msgstr[0] "Arquivo enviado para %1$s" msgstr[1] "%2$d arquivos enviados para %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "Arquivos Compartilhados" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "Compartilhar" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "Enviar Arquivos" @@ -1080,22 +1170,6 @@ msgstr "Pasta de Download" msgid "Where received files are stored" msgstr "Onde os arquivos recebidos são salvos" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "_Compartilhar" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "Escolha um dispositivo para compartilhar os arquivos." - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "Procurando..." - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "Sempre usar este dispositivo" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" @@ -1324,3 +1398,9 @@ msgstr "Portais" #: src/plugins/xdp/xdp.plugin.desktop.in:8 msgid "Integration with desktop portals" msgstr "Integração com portais da área de trabalho" + +#~ msgid "Choose a device to share the selected files with." +#~ msgstr "Escolha um dispositivo para compartilhar os arquivos." + +#~ msgid "Always use this device" +#~ msgstr "Sempre usar este dispositivo" diff --git a/po/valent.pot b/po/valent.pot index 150c955b80..385166eba0 100644 --- a/po/valent.pot +++ b/po/valent.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "" @@ -43,19 +56,6 @@ msgstr "" msgid "Whether the plugin is enabled or not." msgstr "" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -162,7 +162,7 @@ msgid "Request Pairing" msgstr "" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "" @@ -298,6 +298,18 @@ msgstr "" msgid "No Actions" msgstr "" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 msgid "Application" msgstr "" @@ -347,7 +359,7 @@ msgid "Desktop Integration" msgstr "" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "" @@ -357,7 +369,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -369,7 +381,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -381,7 +393,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -393,7 +405,7 @@ msgstr "" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -405,7 +417,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -417,7 +429,7 @@ msgstr "" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -429,7 +441,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -441,7 +453,7 @@ msgstr "" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -476,7 +488,8 @@ msgid "Main Menu" msgstr "" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "" @@ -488,11 +501,15 @@ msgstr "" msgid "List of available and known devices" msgstr "" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +msgid "Share…" +msgstr "" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "" @@ -567,6 +584,14 @@ msgstr "" msgid "Notify when the remote battery is low" msgstr "" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +msgid "Connect devices over Bluetooth" +msgstr "" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "" @@ -697,6 +722,14 @@ msgstr "" msgid "Found" msgstr "" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +msgid "Integration with GNOME" +msgstr "" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "" @@ -748,7 +781,6 @@ msgstr "" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "" @@ -960,6 +992,63 @@ msgstr "" msgid "Direct file, link and text sharing" msgstr "" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, c-format +msgid "%u files" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:41 +msgid "Select files, enter a link or paste text" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:50 +msgid "Pick Files" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +msgid "Share with multiple devices" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1046,15 +1135,10 @@ msgstr[0] "" msgstr[1] "" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "" @@ -1070,22 +1154,6 @@ msgstr "" msgid "Where received files are stored" msgstr "" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" diff --git a/po/zh_CN.po b/po/zh_CN.po index 932f2e2e9b..8b1be0f10f 100755 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: valent\n" "Report-Msgid-Bugs-To: https://github.com/andyholmes/valent/issues\n" -"POT-Creation-Date: 2024-04-09 22:12-0700\n" +"POT-Creation-Date: 2024-04-14 00:27-0700\n" "PO-Revision-Date: 2023-07-03 19:05+0800\n" "Last-Translator: sky96111 \n" "Language-Team: Chinese Simplified\n" @@ -18,6 +18,19 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.3.2\n" +#: data/ca.andyholmes.Valent.desktop.in.in:3 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 +#: src/libvalent/ui/valent-preferences-dialog.ui:11 +#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 +#: src/libvalent/ui/valent-window.ui:45 +msgid "Valent" +msgstr "" + +#: data/ca.andyholmes.Valent.desktop.in.in:4 +#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 +msgid "Connect, control and sync devices" +msgstr "连接、控制和同步设备" + #: data/gsettings/ca.andyholmes.Valent.Device.gschema.xml:10 msgid "Paired" msgstr "已配对" @@ -43,19 +56,6 @@ msgstr "插件状态" msgid "Whether the plugin is enabled or not." msgstr "插件是否已启用。" -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:11 -#: data/ca.andyholmes.Valent.desktop.in.in:3 -#: src/libvalent/ui/valent-preferences-dialog.ui:11 -#: src/libvalent/ui/valent-window.c:295 src/libvalent/ui/valent-window.ui:8 -#: src/libvalent/ui/valent-window.ui:45 -msgid "Valent" -msgstr "" - -#: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:12 -#: data/ca.andyholmes.Valent.desktop.in.in:4 -msgid "Connect, control and sync devices" -msgstr "连接、控制和同步设备" - #: data/metainfo/ca.andyholmes.Valent.metainfo.xml.in.in:15 msgid "" "Securely connect your devices to open files and links where you need them, " @@ -165,7 +165,7 @@ msgid "Request Pairing" msgstr "请求配对" #: src/libvalent/ui/valent-device-page.ui:250 -#: src/libvalent/ui/valent-window.ui:134 +#: src/libvalent/ui/valent-window.ui:139 msgid "Preferences" msgstr "首选项" @@ -304,6 +304,18 @@ msgstr "随机" msgid "No Actions" msgstr "无动作" +#: src/libvalent/ui/valent-plugin-row.ui:79 +msgid "Authors" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:112 +msgid "Version" +msgstr "" + +#: src/libvalent/ui/valent-plugin-row.ui:143 +msgid "Website" +msgstr "" + #: src/libvalent/ui/valent-preferences-dialog.c:380 #, fuzzy msgid "Application" @@ -354,7 +366,7 @@ msgid "Desktop Integration" msgstr "桌面集成" #. translators: Unknown time -#: src/libvalent/ui/valent-time-helpers.c:49 +#: src/libvalent/ui/valent-time-helpers.c:51 msgid "--:--" msgstr "" @@ -364,7 +376,7 @@ msgstr "" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:85 +#: src/libvalent/ui/valent-time-helpers.c:87 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d" @@ -376,7 +388,7 @@ msgstr "%d:%02d:%02d" #. * the separator that your locale uses or use "%Id" instead #. * of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:93 +#: src/libvalent/ui/valent-time-helpers.c:95 #, c-format msgctxt "long time format" msgid "%d:%02d:%02d.%03d" @@ -388,7 +400,7 @@ msgstr "%d:%02d:%02d.%03d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:103 +#: src/libvalent/ui/valent-time-helpers.c:105 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d" @@ -400,7 +412,7 @@ msgstr "-%d:%02d:%02d" #. * change ":" to the separator that your locale uses or use #. * "%Id" instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:111 +#: src/libvalent/ui/valent-time-helpers.c:113 #, c-format msgctxt "long time format" msgid "-%d:%02d:%02d.%03d" @@ -412,7 +424,7 @@ msgstr "-%d:%02d:%02d.%03d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:124 +#: src/libvalent/ui/valent-time-helpers.c:126 #, c-format msgctxt "short time format" msgid "-%d:%02d" @@ -424,7 +436,7 @@ msgstr "-%d:%02d" #. * ":" to the separator that your locale uses or use "%Id" #. * instead of "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:132 +#: src/libvalent/ui/valent-time-helpers.c:134 #, c-format msgctxt "short time format" msgid "-%d:%02d.%03d" @@ -436,7 +448,7 @@ msgstr "-%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:143 +#: src/libvalent/ui/valent-time-helpers.c:145 #, c-format msgctxt "short time format" msgid "%d:%02d.%03d" @@ -448,7 +460,7 @@ msgstr "%d:%02d.%03d" #. * separator that your locale uses or use "%Id" instead of #. * "%d" if your locale uses localized digits. #. -#: src/libvalent/ui/valent-time-helpers.c:152 +#: src/libvalent/ui/valent-time-helpers.c:154 #, c-format msgctxt "short time format" msgid "%d:%02d" @@ -484,7 +496,8 @@ msgid "Main Menu" msgstr "主菜单" #: src/libvalent/ui/valent-window.ui:86 src/libvalent/ui/valent-window.ui:101 -#: src/plugins/share/valent-share-target-chooser.ui:68 +#: src/plugins/share/valent-share-dialog.ui:161 +#: src/plugins/share/valent-share-dialog.ui:178 msgid "Devices" msgstr "设备" @@ -496,11 +509,16 @@ msgstr "正在搜索设备…" msgid "List of available and known devices" msgstr "" -#: src/libvalent/ui/valent-window.ui:138 +#: src/libvalent/ui/valent-window.ui:132 +#, fuzzy +msgid "Share…" +msgstr "发送" + +#: src/libvalent/ui/valent-window.ui:143 msgid "About Valent" msgstr "关于" -#: src/libvalent/ui/valent-window.ui:144 +#: src/libvalent/ui/valent-window.ui:149 msgid "Quit" msgstr "退出" @@ -575,6 +593,15 @@ msgstr "低电量通知" msgid "Notify when the remote battery is low" msgstr "远程设备电量不足时通知" +#: src/plugins/bluez/bluez.plugin.desktop.in:7 +msgid "Bluez" +msgstr "" + +#: src/plugins/bluez/bluez.plugin.desktop.in:8 +#, fuzzy +msgid "Connect devices over Bluetooth" +msgstr "通过局域网连接设备" + #: src/plugins/clipboard/clipboard.plugin.desktop.in:8 msgid "Sync the clipboard between devices" msgstr "在设备间同步剪贴板" @@ -705,6 +732,15 @@ msgstr "响铃" msgid "Found" msgstr "已发现" +#: src/plugins/gnome/gnome.plugin.desktop.in:7 +msgid "GNOME" +msgstr "" + +#: src/plugins/gnome/gnome.plugin.desktop.in:8 +#, fuzzy +msgid "Integration with GNOME" +msgstr "GTK4集成" + #: src/plugins/gtk/gtk.plugin.desktop.in:7 msgid "GTK" msgstr "GTK" @@ -756,7 +792,6 @@ msgstr "通知" #: src/plugins/notification/valent-notification-dialog.ui:19 #: src/plugins/runcommand/valent-runcommand-editor.ui:17 -#: src/plugins/share/valent-share-target-chooser.ui:22 msgid "_Cancel" msgstr "" @@ -969,6 +1004,66 @@ msgstr "共享" msgid "Direct file, link and text sharing" msgstr "直接分享文件、链接和文本" +#: src/plugins/share/valent-share-dialog.c:108 +#, c-format +msgid "Size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:122 +#, c-format +msgid "Total size: %s" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:253 +#, c-format +msgid "%u files and links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.c:255 +#, fuzzy, c-format +msgid "%u files" +msgstr "文件" + +#: src/plugins/share/valent-share-dialog.c:257 +#, c-format +msgid "%u links" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:8 +#: src/plugins/share/valent-share-dialog.ui:29 +#: src/plugins/share/valent-share-dialog.ui:40 +#: src/plugins/share/valent-share-dialog.ui:112 +#: src/plugins/share/valent-share-plugin.c:672 +msgid "Share" +msgstr "发送" + +#: src/plugins/share/valent-share-dialog.ui:41 +#, fuzzy +msgid "Select files, enter a link or paste text" +msgstr "分享文件、链接和文本" + +#: src/plugins/share/valent-share-dialog.ui:50 +#, fuzzy +msgid "Pick Files" +msgstr "本地文件" + +#: src/plugins/share/valent-share-dialog.ui:75 +msgid "Enter URL" +msgstr "" + +#: src/plugins/share/valent-share-dialog.ui:165 +#, fuzzy +msgid "Share with multiple devices" +msgstr "与远程设备共享联系人" + +#: src/plugins/share/valent-share-dialog.ui:192 +msgid "Searching…" +msgstr "搜索中..." + +#: src/plugins/share/valent-share-dialog.ui:215 +msgid "_Share" +msgstr "" + #: src/plugins/share/valent-share-plugin.c:106 #: src/plugins/share/valent-share-plugin.c:471 msgid "Transferring Files" @@ -1051,15 +1146,10 @@ msgid_plural "Sent %2$d files to %1$s" msgstr[0] "已发送 %2$d 文件到 %1$s" #: src/plugins/share/valent-share-plugin.c:671 -#: src/plugins/share/valent-share-target-chooser.ui:8 msgid "Share Files" msgstr "共享文件" -#: src/plugins/share/valent-share-plugin.c:672 -msgid "Share" -msgstr "发送" - -#: src/plugins/share/valent-share-plugin.c:1251 +#: src/plugins/share/valent-share-plugin.c:1250 msgid "Send Files" msgstr "发送文件" @@ -1075,22 +1165,6 @@ msgstr "下载目录" msgid "Where received files are stored" msgstr "收到的文件储存位置" -#: src/plugins/share/valent-share-target-chooser.ui:29 -msgid "_Share" -msgstr "" - -#: src/plugins/share/valent-share-target-chooser.ui:58 -msgid "Choose a device to share the selected files with." -msgstr "选择一个设备来分享所选文件。" - -#: src/plugins/share/valent-share-target-chooser.ui:86 -msgid "Searching…" -msgstr "搜索中..." - -#: src/plugins/share/valent-share-target-chooser.ui:128 -msgid "Always use this device" -msgstr "始终使用这个装置" - #: src/plugins/share/valent-share-text-dialog.c:98 #: src/plugins/share/valent-share-text-dialog.ui:54 msgid "Save" @@ -1319,5 +1393,11 @@ msgstr "桌面环境" msgid "Integration with desktop portals" msgstr "与桌面环境集成" +#~ msgid "Choose a device to share the selected files with." +#~ msgstr "选择一个设备来分享所选文件。" + +#~ msgid "Always use this device" +#~ msgstr "始终使用这个装置" + #~ msgid "Applications" #~ msgstr "应用" diff --git a/src/libvalent/ui/valent-window.ui b/src/libvalent/ui/valent-window.ui index 3c4d95fcf7..bcfba4a2fb 100644 --- a/src/libvalent/ui/valent-window.ui +++ b/src/libvalent/ui/valent-window.ui @@ -128,6 +128,11 @@ Media Remote app.media-remote + + Share… + app.share-dialog + action-disabled +
diff --git a/src/plugins/share/data/share-file-symbolic.svg b/src/plugins/share/data/share-file-symbolic.svg new file mode 100644 index 0000000000..201457c428 --- /dev/null +++ b/src/plugins/share/data/share-file-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/plugins/share/data/share-link-symbolic.svg b/src/plugins/share/data/share-link-symbolic.svg new file mode 100644 index 0000000000..1d5fefea3c --- /dev/null +++ b/src/plugins/share/data/share-link-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/plugins/share/data/share-symbolic.svg b/src/plugins/share/data/share-symbolic.svg new file mode 100644 index 0000000000..08551f53c8 --- /dev/null +++ b/src/plugins/share/data/share-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/plugins/share/meson.build b/src/plugins/share/meson.build index 569a3a5523..482a01fcd5 100644 --- a/src/plugins/share/meson.build +++ b/src/plugins/share/meson.build @@ -9,11 +9,12 @@ plugin_share_deps = [ # Sources plugin_share_sources = files([ 'share-plugin.c', + 'valent-share-dialog.c', + 'valent-share-dialog-row.c', 'valent-share-download.c', 'valent-share-plugin.c', 'valent-share-preferences.c', 'valent-share-target.c', - 'valent-share-target-chooser.c', 'valent-share-text-dialog.c', 'valent-share-upload.c', ]) diff --git a/src/plugins/share/share.gresource.xml b/src/plugins/share/share.gresource.xml index 72856749c1..8c7ccf3f5e 100644 --- a/src/plugins/share/share.gresource.xml +++ b/src/plugins/share/share.gresource.xml @@ -6,12 +6,16 @@ share.plugin + valent-share-dialog.ui + valent-share-dialog-row.ui valent-share-preferences.ui - valent-share-target-chooser.ui valent-share-text-dialog.ui data/document-send-symbolic.svg + data/share-file-symbolic.svg + data/share-link-symbolic.svg + data/share-symbolic.svg data/valent-share-plugin-symbolic.svg diff --git a/src/plugins/share/valent-share-dialog-row.c b/src/plugins/share/valent-share-dialog-row.c new file mode 100644 index 0000000000..d2bf183ee3 --- /dev/null +++ b/src/plugins/share/valent-share-dialog-row.c @@ -0,0 +1,348 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-FileCopyrightText: Andy Holmes + +#define G_LOG_DOMAIN "valent-share-dialog-row" + +#include "config.h" + +#include +#include +#include + +#include "valent-share-dialog-row.h" + + +struct _ValentShareDialogRow +{ + GtkListBoxRow parent_instance; + + ValentDevice *device; + AdwAnimation *animation; + unsigned int selected : 1; + unsigned int selection_mode : 1; + + /* template */ + GtkRevealer *revealer; + GtkCheckButton *selected_button; + GtkImage *icon_image; + GtkLabel *name_label; + GtkImage *next_image; +}; + +G_DEFINE_FINAL_TYPE (ValentShareDialogRow, valent_share_dialog_row, GTK_TYPE_LIST_BOX_ROW) + + +enum { + PROP_0, + PROP_DEVICE, + PROP_SELECTED, + PROP_SELECTION_MODE, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES] = { NULL, }; + + +static void +on_selection_enable (ValentShareDialogRow *self) +{ + GtkRoot *root = NULL; + + if (self->selection_mode) + return; + + if ((root = gtk_widget_get_root (GTK_WIDGET (self))) == NULL) + return; + + g_object_set (root, "selection-mode", TRUE, NULL); + valent_share_dialog_row_set_selected (self, TRUE); +} + +static void +on_selection_disable (ValentShareDialogRow *self) +{ + if (!gtk_revealer_get_child_revealed (self->revealer)) + valent_share_dialog_row_set_selected (self, FALSE); +} + +/* + * ValentShareDialogRow + */ +static void +valent_share_dialog_row_set_device (ValentShareDialogRow *self, + ValentDevice *device) +{ + g_assert (VALENT_IS_SHARE_DIALOG_ROW (self)); + g_assert (device == NULL || VALENT_IS_DEVICE (device)); + + if (!g_set_object (&self->device, device)) + return; + + g_object_bind_property (device, "icon-name", + self->icon_image, "icon-name", + G_BINDING_SYNC_CREATE); + g_object_bind_property (device, "name", + self->name_label, "label", + G_BINDING_SYNC_CREATE); + + g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEVICE]); +} + +/* + * GObject + */ +static void +valent_share_dialog_row_dispose (GObject *object) +{ + ValentShareDialogRow *self = VALENT_SHARE_DIALOG_ROW (object); + + if (self->animation != NULL) + { + adw_animation_skip (self->animation); + g_clear_object (&self->animation); + } + + g_clear_object (&self->device); + gtk_widget_dispose_template (GTK_WIDGET (self), VALENT_TYPE_SHARE_DIALOG_ROW); + + G_OBJECT_CLASS (valent_share_dialog_row_parent_class)->dispose (object); +} + +static void +valent_share_dialog_row_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ValentShareDialogRow *self = VALENT_SHARE_DIALOG_ROW (object); + + switch (prop_id) + { + case PROP_DEVICE: + g_value_set_object (value, self->device); + break; + + case PROP_SELECTED: + g_value_set_boolean (value, self->selected); + break; + + case PROP_SELECTION_MODE: + g_value_set_boolean (value, self->selection_mode); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +valent_share_dialog_row_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ValentShareDialogRow *self = VALENT_SHARE_DIALOG_ROW (object); + + switch (prop_id) + { + case PROP_DEVICE: + valent_share_dialog_row_set_device (self, g_value_get_object (value)); + break; + + case PROP_SELECTED: + valent_share_dialog_row_set_selected (self, g_value_get_boolean (value)); + break; + + case PROP_SELECTION_MODE: + valent_share_dialog_row_set_selection_mode (self, g_value_get_boolean (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +valent_share_dialog_row_class_init (ValentShareDialogRowClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->dispose = valent_share_dialog_row_dispose; + object_class->get_property = valent_share_dialog_row_get_property; + object_class->set_property = valent_share_dialog_row_set_property; + + /** + * ValentShareDialogRow:device: (getter get_device) + * + * The [class@Valent.Device] this row displays. + */ + properties [PROP_DEVICE] = + g_param_spec_object ("device", NULL, NULL, + VALENT_TYPE_DEVICE, + (G_PARAM_READWRITE | + G_PARAM_EXPLICIT_NOTIFY | + G_PARAM_STATIC_STRINGS)); + + /** + * ValentShareDialogRow:selected: (getter get_selected) (setter set_selected) + * + * Whether the row is selected. + */ + properties [PROP_SELECTED] = + g_param_spec_boolean ("selected", NULL, NULL, + FALSE, + (G_PARAM_READWRITE | + G_PARAM_EXPLICIT_NOTIFY | + G_PARAM_STATIC_STRINGS)); + + /** + * ValentShareDialogRow:selection-mode: (getter get_selection_mode) (setter set_selection_mode) + * + * Whether the row is in selection mode. + */ + properties [PROP_SELECTION_MODE] = + g_param_spec_boolean ("selection-mode", NULL, NULL, + FALSE, + (G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_EXPLICIT_NOTIFY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); + + gtk_widget_class_set_template_from_resource (widget_class, "/plugins/share/valent-share-dialog-row.ui"); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialogRow, revealer); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialogRow, selected_button); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialogRow, icon_image); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialogRow, name_label); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialogRow, next_image); + gtk_widget_class_bind_template_callback (widget_class, on_selection_enable); + gtk_widget_class_bind_template_callback (widget_class, on_selection_disable); +} + +static void +valent_share_dialog_row_init (ValentShareDialogRow *self) +{ + AdwAnimationTarget *target = NULL; + + gtk_widget_init_template (GTK_WIDGET (self)); + + target = adw_property_animation_target_new (G_OBJECT (self->next_image), + "opacity"); + self->animation = adw_timed_animation_new (GTK_WIDGET (self), + 0.0, 1.0, 250, + target); +} + +/** + * valent_share_dialog_row_get_device: (set-property device) + * @row: a `ValentShareDialogRow` + * + * Get the device. + * + * Returns: (transfer none) (nullable): a `ValentDevice` + */ +ValentDevice * +valent_share_dialog_row_get_device (ValentShareDialogRow *row) +{ + g_return_val_if_fail (VALENT_IS_SHARE_DIALOG_ROW (row), NULL); + + return row->device; +} + +/** + * valent_share_dialog_row_get_selected: (get-property selected) + * @row: a `ValentShareDialogRow` + * + * Get whether the row is selected. + * + * Returns: %TRUE if the row is selected, or %FALSE if not + */ +gboolean +valent_share_dialog_row_get_selected (ValentShareDialogRow *row) +{ + g_return_val_if_fail (VALENT_IS_SHARE_DIALOG_ROW (row), FALSE); + + return row->selected; +} + +/** + * valent_share_dialog_row_set_selected: (set-property selected) + * @row: a `ValentShareDialogRow` + * @selected: whether to select the row + * + * Set whether the row is selected. + */ +void +valent_share_dialog_row_set_selected (ValentShareDialogRow *row, + gboolean selected) +{ + g_return_if_fail (VALENT_IS_SHARE_DIALOG_ROW (row)); + + selected = !!selected; + if (row->selected == selected) + return; + + gtk_accessible_update_state (GTK_ACCESSIBLE (row), + GTK_ACCESSIBLE_STATE_SELECTED, selected, + -1); + + row->selected = selected; + g_object_notify_by_pspec (G_OBJECT (row), properties [PROP_SELECTED]); +} + +/** + * valent_share_dialog_row_get_selection_mode: + * @row: a `ValentShareDialogRow` + * + * Get whether selection mode is enabled. + * + * Returns: %TRUE if selection mode is enabled, or %FALSE if not + */ +gboolean +valent_share_dialog_row_get_selection_mode (ValentShareDialogRow *row) +{ + g_return_val_if_fail (VALENT_IS_SHARE_DIALOG_ROW (row), FALSE); + + return row->selection_mode; +} + +/** + * valent_share_dialog_row_set_selection_mode: (set-property selection-mode) + * @row: a `ValentShareDialogRow` + * @selection_mode: whether to select the row + * + * Set whether selection mode is enabled. + */ +void +valent_share_dialog_row_set_selection_mode (ValentShareDialogRow *row, + gboolean selection_mode) +{ + g_return_if_fail (VALENT_IS_SHARE_DIALOG_ROW (row)); + + selection_mode = !!selection_mode; + if (row->selection_mode == selection_mode) + return; + + if (selection_mode) + { + gtk_accessible_update_state (GTK_ACCESSIBLE (row), + GTK_ACCESSIBLE_STATE_SELECTED, FALSE, + -1); + } + else + { + gtk_accessible_reset_state (GTK_ACCESSIBLE (row), + GTK_ACCESSIBLE_STATE_SELECTED); + } + + adw_animation_skip (row->animation); + adw_timed_animation_set_reverse (ADW_TIMED_ANIMATION (row->animation), + selection_mode); + adw_animation_play (row->animation); + + row->selection_mode = selection_mode; + g_object_notify_by_pspec (G_OBJECT (row), properties [PROP_SELECTION_MODE]); +} + diff --git a/src/plugins/share/valent-share-dialog-row.h b/src/plugins/share/valent-share-dialog-row.h new file mode 100644 index 0000000000..43d8f73c4c --- /dev/null +++ b/src/plugins/share/valent-share-dialog-row.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-FileCopyrightText: Andy Holmes + +#pragma once + +#include + +G_BEGIN_DECLS + +#define VALENT_TYPE_SHARE_DIALOG_ROW (valent_share_dialog_row_get_type()) + +G_DECLARE_FINAL_TYPE (ValentShareDialogRow, valent_share_dialog_row, VALENT, SHARE_DIALOG_ROW, GtkListBoxRow) + +ValentDevice * valent_share_dialog_row_get_device (ValentShareDialogRow *row); +gboolean valent_share_dialog_row_get_selected (ValentShareDialogRow *row); +void valent_share_dialog_row_set_selected (ValentShareDialogRow *row, + gboolean selected); +gboolean valent_share_dialog_row_get_selection_mode (ValentShareDialogRow *row); +void valent_share_dialog_row_set_selection_mode (ValentShareDialogRow *row, + gboolean selection_mode); + +G_END_DECLS diff --git a/src/plugins/share/valent-share-dialog-row.ui b/src/plugins/share/valent-share-dialog-row.ui new file mode 100644 index 0000000000..68c27c09b5 --- /dev/null +++ b/src/plugins/share/valent-share-dialog-row.ui @@ -0,0 +1,100 @@ + + + + + + + + diff --git a/src/plugins/share/valent-share-dialog.c b/src/plugins/share/valent-share-dialog.c new file mode 100644 index 0000000000..4eb1f55603 --- /dev/null +++ b/src/plugins/share/valent-share-dialog.c @@ -0,0 +1,859 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-FileCopyrightText: Andy Holmes + +#define G_LOG_DOMAIN "valent-share-target-chooser" + +#include "config.h" + +#include +#include +#include +#include + +#include "valent-share-dialog.h" +#include "valent-share-dialog-row.h" + + +struct _ValentShareDialog +{ + AdwWindow parent_instance; + + ValentDeviceManager *manager; + GListModel *files; + unsigned int refresh_id; + unsigned int selection_mode : 1; + + GPtrArray *rows; + GCancellable *cancellable; + guint64 total_size; + unsigned int n_files; + unsigned int n_links; + + /* template */ + AdwNavigationView *view; + AdwActionRow *single_row; + GtkImage *single_icon; + AdwExpanderRow *multiple_row; + GtkImage *multiple_icon; + GtkListBox *device_list; + AdwEntryRow *uri_entry; +}; + +G_DEFINE_FINAL_TYPE (ValentShareDialog, valent_share_dialog, ADW_TYPE_WINDOW) + +enum { + PROP_0, + PROP_FILES, + PROP_SELECTION_MODE, + N_PROPERTIES +}; + +static GParamSpec *properties[N_PROPERTIES] = { NULL, }; + +static void valent_share_dialog_set_files (ValentShareDialog *self, + GListModel *files); +static void valent_share_dialog_share (ValentShareDialog *self, + ValentShareDialogRow *row); + + +/* + * Summary + */ +typedef struct +{ + ValentShareDialog *self; + GtkWidget *row; + GtkImage *icon; +} EntryData; + +static void +g_file_query_info_cb (GFile *file, + GAsyncResult *result, + gpointer user_data) +{ + g_autofree EntryData *data = (EntryData *)user_data; + GIcon *icon = NULL; + g_autoptr (GFileInfo) info = NULL; + g_autoptr (GError) error = NULL; + g_autofree char *size_str = NULL; + g_autofree char *size_label = NULL; + gsize size = 0; + + if ((info = g_file_query_info_finish (file, result, &error)) == NULL) + { + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + return; + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + { + gtk_widget_add_css_class (GTK_WIDGET (data->row), "error"); + } + + return; + } + + if ((icon = g_file_info_get_icon (info)) != NULL) + { + gtk_image_set_from_gicon (data->icon, icon); + gtk_widget_add_css_class (GTK_WIDGET (data->icon), "lowres-icon"); + } + else + { + gtk_image_set_from_icon_name (data->icon, "share-file-symbolic"); + gtk_widget_remove_css_class (GTK_WIDGET (data->icon), "lowres-icon"); + } + + size = g_file_info_get_size (info); + size_str = g_format_size (size); + size_label = g_strdup_printf (_("Size: %s"), size_str); + g_object_set (data->row, "subtitle", size_label, NULL); + + if (data->self->n_files > 1) + { + g_autofree char *total_str = NULL; + g_autofree char *total_label = NULL; + + if ((G_MAXUINT64 - data->self->total_size) < size) + data->self->total_size = G_MAXUINT64; + else + data->self->total_size += size; + + total_str = g_format_size (data->self->total_size); + total_label = g_strdup_printf (_("Total size: %s"), total_str); + g_object_set (data->self->multiple_row, "subtitle", total_label, NULL); + } +} + +static void +valent_share_dialog_add_entry (ValentShareDialog *self, + GFile *file, + GCancellable *cancellable) +{ + g_autofree char *title = NULL; + const char *icon_name = NULL; + gboolean is_file = FALSE; + GtkWidget *row; + GtkWidget *icon; + + is_file = g_file_has_uri_scheme (file, "file"); + + if (is_file) + { + self->n_files += 1; + title = g_file_get_basename (file); + icon_name = "share-file-symbolic"; + } + else + { + g_autofree char *uri = NULL; + + uri = g_file_get_uri (file); + + self->n_links += 1; + title = g_strdup_printf ("%s", uri, uri); + icon_name = "share-link-symbolic"; + } + + row = g_object_new (ADW_TYPE_ACTION_ROW, + "title", title, + "title-lines", 1, + NULL); + icon = g_object_new (GTK_TYPE_IMAGE, + "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION, + "icon-name", icon_name, + NULL); + adw_action_row_add_prefix (ADW_ACTION_ROW (row), icon); + adw_expander_row_add_row (self->multiple_row, row); + g_ptr_array_add (self->rows, row); + + if (is_file) + { + EntryData *data = NULL; + + data = g_new0 (EntryData, 1); + data->self = self; + data->row = (GtkWidget *)row; + data->icon = (GtkImage *)icon; + + g_file_query_info_async (file, + G_FILE_ATTRIBUTE_STANDARD_SIZE"," + G_FILE_ATTRIBUTE_STANDARD_ICON, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT_IDLE, + cancellable, + (GAsyncReadyCallback)g_file_query_info_cb, + g_steal_pointer (&data)); + } +} + +static void +valent_share_dialog_reset (ValentShareDialog *self) +{ + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + g_cancellable_cancel (self->cancellable); + g_clear_object (&self->cancellable); + self->cancellable = g_cancellable_new (); + self->n_files = 0; + self->n_links = 0; + self->total_size = 0; + + g_object_set (self->single_row, + "title", NULL, + "subtitle", NULL, + NULL); + g_object_set (self->multiple_row, + "title", NULL, + "subtitle", NULL, + NULL); + gtk_editable_set_text (GTK_EDITABLE (self->uri_entry), ""); + + if (self->rows != NULL) + { + for (unsigned int i = 0; i < self->rows->len; i++) + { + adw_expander_row_remove (self->multiple_row, + g_ptr_array_index (self->rows, i)); + } + g_clear_pointer (&self->rows, g_ptr_array_unref); + } +} + +static void +on_files_changed (GListModel *list, + unsigned int position, + unsigned int removed, + unsigned int added, + ValentShareDialog *self) +{ + unsigned int n_items = 0; + + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + valent_share_dialog_reset (self); + + if (self->files != NULL) + n_items = g_list_model_get_n_items (self->files); + + if (n_items > 1) + { + g_autofree char *title = NULL; + + self->rows = g_ptr_array_sized_new (n_items); + + for (unsigned int i = 0; i < n_items; i++) + { + g_autoptr (GFile) file = NULL; + + file = g_list_model_get_item (self->files, i); + valent_share_dialog_add_entry (self, file, self->cancellable); + } + + if (self->n_files > 0 && self->n_links > 0) + title = g_strdup_printf (_("%u files and links"), n_items); + else if (self->n_files > 0) + title = g_strdup_printf (_("%u files"), n_items); + else if (self->n_links > 0) + title = g_strdup_printf (_("%u links"), n_items); + + g_object_set (self->multiple_row, + "title", title, + "visible", TRUE, + NULL); + } + else if (n_items > 0) + { + g_autofree char *title = NULL; + g_autoptr (GFile) entry = NULL; + const char *icon_name = NULL; + + entry = g_list_model_get_item (self->files, 0); + + if (g_file_has_uri_scheme (entry, "file")) + { + EntryData *data; + + data = g_new0 (EntryData, 1); + data->self = self; + data->row = (GtkWidget *)self->single_row; + data->icon = self->single_icon; + + g_file_query_info_async (entry, + G_FILE_ATTRIBUTE_STANDARD_SIZE"," + G_FILE_ATTRIBUTE_STANDARD_ICON, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT_IDLE, + self->cancellable, + (GAsyncReadyCallback)g_file_query_info_cb, + g_steal_pointer (&data)); + + title = g_file_get_basename (entry); + icon_name = "share-symbolic"; + } + else + { + g_autofree char *uri = NULL; + + uri = g_file_get_uri (entry); + + title = g_strdup_printf ("%s", uri, uri); + icon_name = "share-link-symbolic"; + } + + g_object_set (self->single_row, + "title", title, + "visible", TRUE, + NULL); + gtk_image_set_from_icon_name (self->single_icon, icon_name); + gtk_widget_remove_css_class (GTK_WIDGET (self->single_icon), "lowres-icon"); + } +} + +/* + * Devices + */ +static void +on_action_added (GActionGroup *action_group, + const char *action_name, + GtkWidget *widget) +{ + gboolean visible = FALSE; + + if (g_action_group_get_action_enabled (action_group, action_name)) + visible = TRUE; + + gtk_widget_set_visible (widget, visible); +} + +static void +on_action_removed (GActionGroup *action_group, + const char *action_name, + GtkWidget *widget) +{ + gtk_widget_set_visible (widget, FALSE); +} + +static void +on_action_enabled_changed (GActionGroup *action_group, + const char *action_name, + gboolean enabled, + GtkWidget *widget) +{ + gtk_widget_set_visible (widget, enabled); +} + +static void +on_device_activated (GtkListBox *box, + ValentShareDialogRow *row, + ValentShareDialog *self) +{ + g_assert (GTK_IS_LIST_BOX (box)); + g_assert (VALENT_IS_SHARE_DIALOG_ROW (row)); + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + if (self->selection_mode) + { + gboolean selected; + + selected = valent_share_dialog_row_get_selected (row); + valent_share_dialog_row_set_selected (row, !selected); + } + else + { + valent_share_dialog_share (self, row); + } +} + +static void +on_selected_changed (ValentShareDialog *self) +{ + GtkWidget *child; + gboolean enabled = FALSE; + + if (!self->selection_mode) + { + gtk_widget_action_set_enabled (GTK_WIDGET (self), + "chooser.share", + enabled); + return; + } + + for (child = gtk_widget_get_first_child (GTK_WIDGET (self->device_list)); + child != NULL; + child = gtk_widget_get_next_sibling (child)) + { + if (!VALENT_IS_SHARE_DIALOG_ROW (child)) + continue; + + if (valent_share_dialog_row_get_selected (VALENT_SHARE_DIALOG_ROW (child))) + { + enabled = TRUE; + break; + } + } + + gtk_widget_action_set_enabled (GTK_WIDGET (self), "chooser.share", enabled); +} + +static GtkWidget * +valent_share_dialog_create_row (gpointer item, + gpointer user_data) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (user_data); + ValentDevice *device = VALENT_DEVICE (item); + GtkWidget *row; + + g_assert (VALENT_IS_DEVICE (device)); + + row = g_object_new (VALENT_TYPE_SHARE_DIALOG_ROW, + "device", device, + "selection-mode", self->selection_mode, + NULL); + g_object_bind_property (self, "selection-mode", + row, "selection-mode", + G_BINDING_SYNC_CREATE); + g_signal_connect_object (row, + "notify::selected", + G_CALLBACK (on_selected_changed), + self, G_CONNECT_SWAPPED); + g_signal_connect_object (device, + "action-added::share.uris", + G_CALLBACK (on_action_added), + row, 0); + g_signal_connect_object (device, + "action-removed::share.uris", + G_CALLBACK (on_action_removed), + row, 0); + g_signal_connect_object (device, + "action-enabled-changed::share.uris", + G_CALLBACK (on_action_enabled_changed), + row, 0); + on_action_added (G_ACTION_GROUP (device), "share.uris", row); + + return row; +} + +static void +on_items_changed (GListModel *list, + unsigned int position, + unsigned int removed, + unsigned int added, + ValentShareDialog *self) +{ + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + while (removed--) + { + GtkListBoxRow *row; + + row = gtk_list_box_get_row_at_index (self->device_list, position); + gtk_list_box_remove (self->device_list, GTK_WIDGET (row)); + } + + for (unsigned int i = 0; i < added; i++) + { + g_autoptr (GObject) item = NULL; + g_autoptr (GtkWidget) widget = NULL; + + item = g_list_model_get_item (list, position + i); + widget = valent_share_dialog_create_row (item, self); + + if (g_object_is_floating (widget)) + g_object_ref_sink (widget); + + gtk_list_box_insert (self->device_list, widget, position + i); + } + + on_selected_changed (self); +} + +static gboolean +valent_share_dialog_refresh (gpointer data) +{ + ValentDeviceManager *manager = VALENT_DEVICE_MANAGER (data); + + g_assert (VALENT_IS_DEVICE_MANAGER (manager)); + + valent_device_manager_refresh (manager); + + return G_SOURCE_CONTINUE; +} + +/* + * URI Selector + */ +static void +on_uri_activated (GtkEditable *editable, + ValentShareDialog *self) +{ + const char *text = NULL; + + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + text = gtk_editable_get_text (editable); + if (text == NULL || *text == '\0') + return; + + if (!gtk_widget_has_css_class (GTK_WIDGET (self->uri_entry), "error")) + { + g_autoptr (GListStore) files = NULL; + g_autoptr (GFile) file = NULL; + + file = g_file_new_for_uri (text); + files = g_list_store_new (G_TYPE_FILE); + g_list_store_append (files, file); + + valent_share_dialog_set_files (self, G_LIST_MODEL (files)); + } +} + +static void +on_uri_changed (GtkEditable *editable, + ValentShareDialog *self) +{ + const char *text = NULL; + const char *scheme = NULL; + + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + text = gtk_editable_get_text (editable); + if (text == NULL || *text == '\0') + { + gtk_widget_remove_css_class (GTK_WIDGET (self->uri_entry), "error"); + gtk_accessible_reset_state (GTK_ACCESSIBLE (self->uri_entry), + GTK_ACCESSIBLE_STATE_INVALID); + return; + } + + scheme = g_uri_peek_scheme (text); + if (scheme != NULL && !g_str_equal (scheme, "file")) + { + gtk_widget_remove_css_class (GTK_WIDGET (self->uri_entry), "error"); + gtk_accessible_reset_state (GTK_ACCESSIBLE (self->uri_entry), + GTK_ACCESSIBLE_STATE_INVALID); + } + else + { + gtk_widget_add_css_class (GTK_WIDGET (self->uri_entry), "error"); + gtk_accessible_update_state (GTK_ACCESSIBLE (self->uri_entry), + GTK_ACCESSIBLE_STATE_INVALID, TRUE, + -1); + } +} + +/* + * GAction + */ +static void +gtk_file_dialog_open_multiple_cb (GtkFileDialog *dialog, + GAsyncResult *result, + ValentShareDialog *self) +{ + g_autoptr (GListModel) files = NULL; + g_autoptr (GError) error = NULL; + + files = gtk_file_dialog_open_multiple_finish (dialog, result, &error); + + if (files == NULL) + { + if (!g_error_matches (error, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED) && + !g_error_matches (error, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED)) + g_warning ("%s(): %s", G_STRFUNC, error->message); + + return; + } + + valent_share_dialog_set_files (self, files); +} + +static void +chooser_select_files_action (GtkWidget *widget, + const char *action_name, + GVariant *parameter) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (widget); + g_autoptr (GtkFileDialog) dialog = NULL; + + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + dialog = gtk_file_dialog_new (); + gtk_file_dialog_open_multiple (dialog, + GTK_WINDOW (self), + NULL, + (GAsyncReadyCallback)gtk_file_dialog_open_multiple_cb, + self); +} + +static void +chooser_share_action (GtkWidget *widget, + const char *action_name, + GVariant *parameter) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (widget); + GtkWidget *child; + + for (child = gtk_widget_get_first_child (GTK_WIDGET (self->device_list)); + child != NULL; + child = gtk_widget_get_next_sibling (child)) + { + if (!VALENT_IS_SHARE_DIALOG_ROW (child)) + continue; + + if (!valent_share_dialog_row_get_selected (VALENT_SHARE_DIALOG_ROW (child))) + continue; + + valent_share_dialog_share (self, VALENT_SHARE_DIALOG_ROW (child)); + } +} + +/* + * ValentShareDialog + */ +static void +valent_share_dialog_set_files (ValentShareDialog *self, + GListModel *files) +{ + unsigned int n_items = 0; + + g_assert (VALENT_IS_SHARE_DIALOG (self)); + g_assert (files == NULL || G_IS_LIST_MODEL (files)); + + if (!g_set_object (&self->files, files)) + return; + + valent_share_dialog_reset (self); + + if (self->files != NULL) + { + n_items = g_list_model_get_n_items (files); + g_signal_connect_object (self->files, + "items-changed", + G_CALLBACK (on_files_changed), + self, + G_CONNECT_DEFAULT); + on_files_changed (self->files, + 0, + self->n_links + self->n_files, + n_items, + self); + } + + if (n_items > 0) + adw_navigation_view_push_by_tag (self->view, "device"); + else + adw_navigation_view_pop (self->view); + + g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_FILES]); +} + +static void +valent_share_dialog_set_selection_mode (ValentShareDialog *self, + gboolean selection_mode) +{ + g_assert (VALENT_IS_SHARE_DIALOG (self)); + + selection_mode = !!selection_mode; + if (self->selection_mode == selection_mode) + return; + + gtk_list_box_set_selection_mode (self->device_list, + selection_mode + ? GTK_SELECTION_MULTIPLE + : GTK_SELECTION_NONE); + + self->selection_mode = selection_mode; + g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SELECTION_MODE]); +} + +static void +valent_share_dialog_share (ValentShareDialog *self, + ValentShareDialogRow *row) +{ + ValentDevice *device = NULL; + GVariantBuilder builder; + unsigned int n_files = 0; + + g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); + n_files = g_list_model_get_n_items (self->files); + + for (unsigned int i = 0; i < n_files; i++) + { + g_autoptr (GFile) file = g_list_model_get_item (self->files, i); + GVariant *uri = g_variant_new_take_string (g_file_get_uri (file)); + + g_variant_builder_add_value (&builder, uri); + } + + device = valent_share_dialog_row_get_device (row); + g_action_group_activate_action (G_ACTION_GROUP (device), + "share.uris", + g_variant_builder_end (&builder)); + + gtk_window_close (GTK_WINDOW (self)); +} + +/* + * GObject + */ +static void +valent_share_dialog_constructed (GObject *object) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (object); + + self->manager = valent_device_manager_get_default (); + g_signal_connect_object (self->manager, + "items-changed", + G_CALLBACK (on_items_changed), + self, 0); + on_items_changed (G_LIST_MODEL (self->manager), + 0, + 0, + g_list_model_get_n_items (G_LIST_MODEL (self->manager)), + self); + + /* Broadcast every 5 seconds to re-connect devices that may have gone idle */ + valent_device_manager_refresh (self->manager); + self->refresh_id = g_timeout_add_seconds_full (G_PRIORITY_LOW, + 5, + valent_share_dialog_refresh, + g_object_ref (self->manager), + g_object_unref); + + G_OBJECT_CLASS (valent_share_dialog_parent_class)->constructed (object); +} + +static void +valent_share_dialog_dispose (GObject *object) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (object); + + g_clear_handle_id (&self->refresh_id, g_source_remove); + + if (self->manager != NULL) + { + g_signal_handlers_disconnect_by_data (self->manager, self); + self->manager = NULL; + } + + if (self->cancellable != NULL) + { + g_cancellable_cancel (self->cancellable); + g_clear_object (&self->cancellable); + } + + g_clear_object (&self->files); + g_clear_pointer (&self->rows, g_ptr_array_unref); + + gtk_widget_dispose_template (GTK_WIDGET (object), + VALENT_TYPE_SHARE_DIALOG); + + G_OBJECT_CLASS (valent_share_dialog_parent_class)->dispose (object); +} + +static void +valent_share_dialog_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (object); + + switch (prop_id) + { + case PROP_FILES: + g_value_set_object (value, self->files); + break; + + case PROP_SELECTION_MODE: + g_value_set_boolean (value, self->selection_mode); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +valent_share_dialog_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ValentShareDialog *self = VALENT_SHARE_DIALOG (object); + + switch (prop_id) + { + case PROP_FILES: + valent_share_dialog_set_files (self, g_value_get_object (value)); + break; + + case PROP_SELECTION_MODE: + valent_share_dialog_set_selection_mode (self, g_value_get_boolean (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +valent_share_dialog_class_init (ValentShareDialogClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->constructed = valent_share_dialog_constructed; + object_class->dispose = valent_share_dialog_dispose; + object_class->get_property = valent_share_dialog_get_property; + object_class->set_property = valent_share_dialog_set_property; + + gtk_widget_class_set_template_from_resource (widget_class, "/plugins/share/valent-share-dialog.ui"); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, view); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, device_list); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, single_row); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, single_icon); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, multiple_row); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, multiple_icon); + gtk_widget_class_bind_template_child (widget_class, ValentShareDialog, uri_entry); + gtk_widget_class_bind_template_callback (widget_class, on_device_activated); + gtk_widget_class_bind_template_callback (widget_class, on_uri_activated); + gtk_widget_class_bind_template_callback (widget_class, on_uri_changed); + + gtk_widget_class_install_action (widget_class, "chooser.share", NULL, chooser_share_action); + gtk_widget_class_install_action (widget_class, "chooser.select-files", NULL, chooser_select_files_action); + + /** + * ValentShareDialog:files: + * + * The URIs to share. + */ + properties [PROP_FILES] = + g_param_spec_object ("files", NULL, NULL, + G_TYPE_LIST_MODEL, + (G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_EXPLICIT_NOTIFY | + G_PARAM_STATIC_STRINGS)); + + /** + * ValentShareDialog:selection-mode: + * + * Whether multiple devices can be selected. + */ + properties [PROP_SELECTION_MODE] = + g_param_spec_boolean ("selection-mode", NULL, NULL, + FALSE, + (G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_EXPLICIT_NOTIFY | + G_PARAM_STATIC_STRINGS)); + + g_object_class_install_properties (object_class, N_PROPERTIES, properties); +} + +static void +valent_share_dialog_init (ValentShareDialog *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} + diff --git a/src/plugins/share/valent-share-dialog.h b/src/plugins/share/valent-share-dialog.h new file mode 100644 index 0000000000..f092252985 --- /dev/null +++ b/src/plugins/share/valent-share-dialog.h @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-FileCopyrightText: Andy Holmes + +#pragma once + +#include + +G_BEGIN_DECLS + +#define VALENT_TYPE_SHARE_DIALOG (valent_share_dialog_get_type()) + +G_DECLARE_FINAL_TYPE (ValentShareDialog, valent_share_dialog, VALENT, SHARE_DIALOG, AdwWindow) + +G_END_DECLS + diff --git a/src/plugins/share/valent-share-dialog.ui b/src/plugins/share/valent-share-dialog.ui new file mode 100644 index 0000000000..36b6ed3cbe --- /dev/null +++ b/src/plugins/share/valent-share-dialog.ui @@ -0,0 +1,231 @@ + + + + + + + + diff --git a/src/plugins/share/valent-share-target-chooser.c b/src/plugins/share/valent-share-target-chooser.c deleted file mode 100644 index 9e03f28100..0000000000 --- a/src/plugins/share/valent-share-target-chooser.c +++ /dev/null @@ -1,414 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Andy Holmes - -#define G_LOG_DOMAIN "valent-share-target-chooser" - -#include "config.h" - -#include -#include -#include -#include - -#include "valent-share-target-chooser.h" - - -struct _ValentShareTargetChooser -{ - GtkWindow parent_instance; - - ValentDeviceManager *manager; - GListModel *files; - unsigned int refresh_id; - - /* template */ - GtkListBox *device_list; -}; - -G_DEFINE_FINAL_TYPE (ValentShareTargetChooser, valent_share_target_chooser, GTK_TYPE_WINDOW) - -enum { - PROP_0, - PROP_FILES, - N_PROPERTIES -}; - -static GParamSpec *properties[N_PROPERTIES] = { NULL, }; - - -static void -on_action_added (GActionGroup *action_group, - const char *action_name, - GtkWidget *widget) -{ - gboolean visible = FALSE; - - if (g_action_group_get_action_enabled (action_group, action_name)) - visible = TRUE; - - gtk_widget_set_visible (widget, visible); -} - -static void -on_action_removed (GActionGroup *action_group, - const char *action_name, - GtkWidget *widget) -{ - gtk_widget_set_visible (widget, FALSE); -} - -static void -on_action_enabled_changed (GActionGroup *action_group, - const char *action_name, - gboolean enabled, - GtkWidget *widget) -{ - gtk_widget_set_visible (widget, enabled); -} - -static GtkWidget * -valent_share_target_chooser_create_row (gpointer item, - gpointer user_data) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (user_data); - ValentDevice *device = VALENT_DEVICE (item); - GtkWidget *row; - GtkWidget *icon; - - g_assert (VALENT_IS_DEVICE (device)); - - row = g_object_new (ADW_TYPE_ACTION_ROW, - "activatable", TRUE, - "selectable", FALSE, - NULL); - icon = g_object_new (GTK_TYPE_IMAGE, - "icon-size", GTK_ICON_SIZE_NORMAL, - NULL); - adw_action_row_add_prefix (ADW_ACTION_ROW (row), icon); - - g_object_bind_property (self->device_list, "activate-on-single-click", - row, "selectable", - G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); - g_object_bind_property (device, "icon-name", - icon, "icon-name", - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - g_object_bind_property (device, "name", - row, "title", - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - g_object_set_data_full (G_OBJECT (row), - "device", - g_object_ref (device), - g_object_unref); - - g_signal_connect_object (device, - "action-added::share.uris", - G_CALLBACK (on_action_added), - row, 0); - g_signal_connect_object (device, - "action-removed::share.uris", - G_CALLBACK (on_action_removed), - row, 0); - g_signal_connect_object (device, - "action-enabled-changed::share.uris", - G_CALLBACK (on_action_enabled_changed), - row, 0); - on_action_added (G_ACTION_GROUP (device), "share.uris", row); - - return row; -} - -static void -on_items_changed (GListModel *list, - unsigned int position, - unsigned int removed, - unsigned int added, - ValentShareTargetChooser *self) -{ - g_assert (VALENT_IS_SHARE_TARGET_CHOOSER (self)); - - while (removed--) - { - GtkListBoxRow *row; - - row = gtk_list_box_get_row_at_index (self->device_list, position); - gtk_list_box_remove (self->device_list, GTK_WIDGET (row)); - } - - for (unsigned int i = 0; i < added; i++) - { - g_autoptr (GObject) item = NULL; - g_autoptr (GtkWidget) widget = NULL; - - item = g_list_model_get_item (list, position + i); - widget = valent_share_target_chooser_create_row (item, self); - - if (g_object_is_floating (widget)) - g_object_ref_sink (widget); - - gtk_list_box_insert (self->device_list, widget, position + i); - } -} - -static void -on_row_activated (GtkListBox *box, - GtkListBoxRow *row, - ValentShareTargetChooser *self) -{ - ValentDevice *device = NULL; - GVariantBuilder builder; - unsigned int n_files = 0; - - g_assert (GTK_IS_LIST_BOX (box)); - g_assert (GTK_IS_LIST_BOX_ROW (row)); - g_assert (VALENT_IS_SHARE_TARGET_CHOOSER (self)); - - g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); - n_files = g_list_model_get_n_items (self->files); - - for (unsigned int i = 0; i < n_files; i++) - { - g_autoptr (GFile) file = g_list_model_get_item (self->files, i); - GVariant *uri = g_variant_new_take_string (g_file_get_uri (file)); - - g_variant_builder_add_value (&builder, uri); - } - - device = g_object_get_data (G_OBJECT (row), "device"); - g_action_group_activate_action (G_ACTION_GROUP (device), - "share.uris", - g_variant_builder_end (&builder)); - - gtk_window_close (GTK_WINDOW (self)); -} - -static void -on_selected_rows_changed (GtkListBox *box, - ValentShareTargetChooser *self) -{ - g_autoptr (GList) rows = NULL; - unsigned int n_rows = 0; - unsigned int n_files = 0; - - g_assert (GTK_IS_LIST_BOX (box)); - g_assert (VALENT_IS_SHARE_TARGET_CHOOSER (self)); - - if ((rows = gtk_list_box_get_selected_rows (box)) != NULL) - n_rows = g_list_length (rows); - - if (self->files != NULL) - n_files = g_list_model_get_n_items (self->files); - - gtk_widget_action_set_enabled (GTK_WIDGET (self), "chooser.open", - (n_rows > 0 && n_files == 1)); - gtk_widget_action_set_enabled (GTK_WIDGET (self), "chooser.share", - (n_rows > 0 && n_files >= 1)); -} - -static gboolean -valent_share_target_chooser_refresh (gpointer data) -{ - ValentDeviceManager *manager = VALENT_DEVICE_MANAGER (data); - - g_assert (VALENT_IS_DEVICE_MANAGER (manager)); - - valent_device_manager_refresh (manager); - - return G_SOURCE_CONTINUE; -} - -/* - * GAction - */ -static void -chooser_cancel_action (GtkWidget *widget, - const char *action_name, - GVariant *parameter) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (widget); - - g_assert (VALENT_IS_SHARE_TARGET_CHOOSER (self)); - - gtk_window_destroy (GTK_WINDOW (self)); -} - -static void -chooser_open_action (GtkWidget *widget, - const char *action_name, - GVariant *parameter) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (widget); - GtkListBoxRow *row; - ValentDevice *device = NULL; - g_autoptr (GFile) file = NULL; - GVariant *target = NULL; - - g_assert (VALENT_IS_SHARE_TARGET_CHOOSER (self)); - - if ((row = gtk_list_box_get_selected_row (self->device_list)) == NULL || - g_list_model_get_n_items (self->files) == 0) - return; - - device = g_object_get_data (G_OBJECT (row), "device"); - file = g_list_model_get_item (self->files, 0); - target = g_variant_new_take_string (g_file_get_uri (file)); - - g_action_group_activate_action (G_ACTION_GROUP (device), "share.open", target); - - gtk_window_close (GTK_WINDOW (self)); -} - -static void -chooser_share_action (GtkWidget *widget, - const char *action_name, - GVariant *parameter) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (widget); - GtkListBoxRow *row; - - row = gtk_list_box_get_selected_row (self->device_list); - on_row_activated (self->device_list, row, self); -} - -/* - * GObject - */ -static void -valent_share_target_chooser_constructed (GObject *object) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (object); - - g_assert (G_IS_LIST_MODEL (self->files)); - - self->manager = valent_device_manager_get_default (); - g_signal_connect_object (self->manager, - "items-changed", - G_CALLBACK (on_items_changed), - self, 0); - on_items_changed (G_LIST_MODEL (self->manager), - 0, - 0, - g_list_model_get_n_items (G_LIST_MODEL (self->manager)), - self); - on_selected_rows_changed (self->device_list, self); - - /* Broadcast every 5 seconds to re-connect devices that may have gone idle */ - valent_device_manager_refresh (self->manager); - self->refresh_id = g_timeout_add_seconds_full (G_PRIORITY_LOW, - 5, - valent_share_target_chooser_refresh, - g_object_ref (self->manager), - g_object_unref); - - G_OBJECT_CLASS (valent_share_target_chooser_parent_class)->constructed (object); -} - -static void -valent_share_target_chooser_dispose (GObject *object) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (object); - - g_clear_handle_id (&self->refresh_id, g_source_remove); - - if (self->manager != NULL) - { - g_signal_handlers_disconnect_by_data (self->manager, self); - self->manager = NULL; - } - - gtk_widget_dispose_template (GTK_WIDGET (object), - VALENT_TYPE_SHARE_TARGET_CHOOSER); - - G_OBJECT_CLASS (valent_share_target_chooser_parent_class)->dispose (object); -} - -static void -valent_share_target_chooser_finalize (GObject *object) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (object); - - g_clear_object (&self->files); - - G_OBJECT_CLASS (valent_share_target_chooser_parent_class)->finalize (object); -} - -static void -valent_share_target_chooser_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (object); - - switch (prop_id) - { - case PROP_FILES: - g_value_set_object (value, self->files); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -valent_share_target_chooser_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ValentShareTargetChooser *self = VALENT_SHARE_TARGET_CHOOSER (object); - - switch (prop_id) - { - case PROP_FILES: - self->files = g_value_dup_object (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -valent_share_target_chooser_class_init (ValentShareTargetChooserClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - - object_class->constructed = valent_share_target_chooser_constructed; - object_class->dispose = valent_share_target_chooser_dispose; - object_class->finalize = valent_share_target_chooser_finalize; - object_class->get_property = valent_share_target_chooser_get_property; - object_class->set_property = valent_share_target_chooser_set_property; - - gtk_widget_class_set_template_from_resource (widget_class, "/plugins/share/valent-share-target-chooser.ui"); - gtk_widget_class_bind_template_child (widget_class, ValentShareTargetChooser, device_list); - gtk_widget_class_bind_template_callback (widget_class, on_row_activated); - gtk_widget_class_bind_template_callback (widget_class, on_selected_rows_changed); - - gtk_widget_class_install_action (widget_class, "chooser.cancel", NULL, chooser_cancel_action); - gtk_widget_class_install_action (widget_class, "chooser.open", NULL, chooser_open_action); - gtk_widget_class_install_action (widget_class, "chooser.share", NULL, chooser_share_action); - - /** - * ValentShareTargetChooser:files: - * - * The URIs to pass to the selected [class@Valent.Device]. - */ - properties [PROP_FILES] = - g_param_spec_object ("files", NULL, NULL, - G_TYPE_LIST_MODEL, - (G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_EXPLICIT_NOTIFY | - G_PARAM_STATIC_STRINGS)); - - g_object_class_install_properties (object_class, N_PROPERTIES, properties); -} - -static void -valent_share_target_chooser_init (ValentShareTargetChooser *self) -{ - gtk_widget_init_template (GTK_WIDGET (self)); -} - diff --git a/src/plugins/share/valent-share-target-chooser.h b/src/plugins/share/valent-share-target-chooser.h deleted file mode 100644 index 566510f208..0000000000 --- a/src/plugins/share/valent-share-target-chooser.h +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Andy Holmes - -#pragma once - -#include - -G_BEGIN_DECLS - -#define VALENT_TYPE_SHARE_TARGET_CHOOSER (valent_share_target_chooser_get_type()) - -G_DECLARE_FINAL_TYPE (ValentShareTargetChooser, valent_share_target_chooser, VALENT, SHARE_TARGET_CHOOSER, GtkWindow) - -G_END_DECLS - diff --git a/src/plugins/share/valent-share-target-chooser.ui b/src/plugins/share/valent-share-target-chooser.ui deleted file mode 100644 index c4ab7bbdbe..0000000000 --- a/src/plugins/share/valent-share-target-chooser.ui +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - diff --git a/src/plugins/share/valent-share-target.c b/src/plugins/share/valent-share-target.c index c15c479cea..8f82a00961 100644 --- a/src/plugins/share/valent-share-target.c +++ b/src/plugins/share/valent-share-target.c @@ -7,8 +7,8 @@ #include #include +#include "valent-share-dialog.h" #include "valent-share-target.h" -#include "valent-share-target-chooser.h" struct _ValentShareTarget @@ -38,6 +38,47 @@ on_destroy (GtkWindow *window, g_ptr_array_steal_index (self->windows, index); } +static void +valent_share_target_present (ValentShareTarget *self, + GListModel *files) +{ + GtkWindow *window = NULL; + + g_assert (VALENT_IS_SHARE_TARGET (self)); + g_assert (files == NULL || G_IS_LIST_MODEL (files)); + + window = g_object_new (VALENT_TYPE_SHARE_DIALOG, + "files", files, + NULL); + g_signal_connect_object (G_OBJECT (window), + "destroy", + G_CALLBACK (on_destroy), + self, + G_CONNECT_DEFAULT); + g_ptr_array_add (self->windows, window); + + gtk_window_present (window); +} + +/* + * GActions + */ +static inline void +share_dialog_action (GSimpleAction *action, + GVariant *parameters, + gpointer user_data) +{ + ValentShareTarget *self = VALENT_SHARE_TARGET (user_data); + + g_assert (VALENT_IS_SHARE_TARGET (self)); + + valent_share_target_present (self, NULL); +} + +static const GActionEntry app_actions[] = { + { "share-dialog", share_dialog_action, NULL, NULL, NULL }, +}; + /* * ValentApplicationPlugin */ @@ -48,30 +89,16 @@ valent_share_target_open (ValentApplicationPlugin *plugin, const char *hint) { ValentShareTarget *self = VALENT_SHARE_TARGET (plugin); - g_autoptr (GListStore) list = NULL; - GtkWindow *window = NULL; + g_autoptr (GListStore) files_list = NULL; g_assert (VALENT_IS_SHARE_TARGET (plugin)); g_assert (files != NULL); g_assert (n_files > 0); g_assert (hint != NULL); - list = g_list_store_new (G_TYPE_FILE); - - for (int i = 0; i < n_files; i++) - g_list_store_append (list, files[i]); - - window = g_object_new (VALENT_TYPE_SHARE_TARGET_CHOOSER, - "files", list, - NULL); - - g_signal_connect_object (G_OBJECT (window), - "destroy", - G_CALLBACK (on_destroy), - self, 0); - g_ptr_array_add (self->windows, window); - - gtk_window_present (window); + files_list = g_list_store_new (G_TYPE_FILE); + g_list_store_splice (files_list, 0, 0, (gpointer *)files, n_files); + valent_share_target_present (self, G_LIST_MODEL (files_list)); return TRUE; } @@ -83,6 +110,12 @@ static void valent_share_target_destroy (ValentObject *object) { ValentShareTarget *self = VALENT_SHARE_TARGET (object); + GApplication *application = NULL; + + application = valent_extension_get_object (VALENT_EXTENSION (self)); + + for (size_t i = 0; i < G_N_ELEMENTS (app_actions); i++) + g_action_map_remove_action (G_ACTION_MAP (application), app_actions[i].name); g_clear_pointer (&self->windows, g_ptr_array_unref); @@ -92,12 +125,30 @@ valent_share_target_destroy (ValentObject *object) /* * GObject */ +static void +valent_share_target_constructed (GObject *object) +{ + ValentShareTarget *self = VALENT_SHARE_TARGET (object); + GApplication *application = NULL; + + G_OBJECT_CLASS (valent_share_target_parent_class)->constructed (object); + + application = valent_extension_get_object (VALENT_EXTENSION (self)); + g_action_map_add_action_entries (G_ACTION_MAP (application), + app_actions, + G_N_ELEMENTS (app_actions), + self); +} + static void valent_share_target_class_init (ValentShareTargetClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); ValentObjectClass *vobject_class = VALENT_OBJECT_CLASS (klass); ValentApplicationPluginClass *plugin_class = VALENT_APPLICATION_PLUGIN_CLASS (klass); + object_class->constructed = valent_share_target_constructed; + vobject_class->destroy = valent_share_target_destroy; plugin_class->open = valent_share_target_open; diff --git a/tests/extra/cppcheck.cfg b/tests/extra/cppcheck.cfg index b3f778a580..e8ffbe342e 100644 --- a/tests/extra/cppcheck.cfg +++ b/tests/extra/cppcheck.cfg @@ -3,9 +3,7 @@ - - @@ -13,4 +11,19 @@ + + + + + + false + + + + false + + + + false + diff --git a/tests/extra/cspell-valent.txt b/tests/extra/cspell-valent.txt index 0fa466c70f..a2de3d5059 100644 --- a/tests/extra/cspell-valent.txt +++ b/tests/extra/cspell-valent.txt @@ -35,6 +35,9 @@ unpairing ssav iiibiiay +# CSS classes +lowres + # src/plugins/bluez muxed muxer diff --git a/tests/plugins/share/meson.build b/tests/plugins/share/meson.build index 9e7d3754d4..d465d69c60 100644 --- a/tests/plugins/share/meson.build +++ b/tests/plugins/share/meson.build @@ -8,11 +8,11 @@ plugin_share_test_deps = [ ] plugin_runcommand_tests = [ + 'test-share-dialog', 'test-share-download', 'test-share-plugin', 'test-share-preferences', 'test-share-target', - 'test-share-target-chooser', 'test-share-text-dialog', 'test-share-upload', ] diff --git a/tests/plugins/share/test-share-target-chooser.c b/tests/plugins/share/test-share-dialog.c similarity index 84% rename from tests/plugins/share/test-share-target-chooser.c rename to tests/plugins/share/test-share-dialog.c index 72532042bb..78e17ab216 100644 --- a/tests/plugins/share/test-share-target-chooser.c +++ b/tests/plugins/share/test-share-dialog.c @@ -6,11 +6,11 @@ #include "valent-mock-channel.h" #include "valent-mock-channel-service.h" -#include "valent-share-target-chooser.h" +#include "valent-share-dialog.h" static void -test_share_target_chooser (void) +test_share_dialog (void) { GtkWindow *window = NULL; ValentChannelService *service = NULL; @@ -26,13 +26,13 @@ test_share_target_chooser (void) VALENT_TEST_CHECK ("Window can be constructed"); manager = valent_device_manager_get_default (); - window = g_object_new (VALENT_TYPE_SHARE_TARGET_CHOOSER, - "files", files, + window = g_object_new (VALENT_TYPE_SHARE_DIALOG, + "files", files, NULL); g_object_add_weak_pointer (G_OBJECT (window), (gpointer)&window); g_object_get (window, - "files", &files_out, + "files", &files_out, NULL); g_assert_true (files == files_out); @@ -64,8 +64,8 @@ main (int argc, { valent_test_ui_init (&argc, &argv, NULL); - g_test_add_func ("/plugins/share/target-chooser", - test_share_target_chooser); + g_test_add_func ("/plugins/share/dialog", + test_share_dialog); return g_test_run (); }