Linux + iPhone Continuity / iMessage / SMS
feat: contacts tab in UI
Zack Bartelb5fd5069ce93
diff --git a/po/POTFILES.in b/po/POTFILES.inindex bae1e52..c7cad6a 100644--- a/po/POTFILES.in+++ b/po/POTFILES.in@@ -8,6 +8,7 @@ src/core/src/bluetooth/profile_supervisor.cppsrc/core/src/net.cppsrc/daemon/main.cppsrc/daemon/notification.cpp+src/gtk/contacts_view.cppsrc/gtk/daemon_client.cppsrc/gtk/devices_view.cppsrc/gtk/main.cppdiff --git a/po/cs.po b/po/cs.poindex ef8774d..2a2ac3a 100644--- a/po/cs.po+++ b/po/cs.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Czech\n"@@ -909,6 +909,7 @@ msgid "Messages"msgstr "Zprávy"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Kontakty"@@ -1059,6 +1060,26 @@ msgstr "Odpovědět"msgid "Copy Code"msgstr "Kopírovat kód"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopírovat"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Zkopírováno do schránky."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Napsat zprávu"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Zatím žádné kontakty. Zkontrolujte spojení Bluetooth na stránce Zařízení."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Hledat kontakty"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Démon je offline"@@ -1595,10 +1616,18 @@ msgstr "Odeslat"msgid "Retry"msgstr "Zkusit znovu"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Zavřít na iPhonu"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nové oznámení"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone zavření nepřijal."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Zatím žádná oznámení."diff --git a/po/de.po b/po/de.poindex a67ccd0..e63be6f 100644--- a/po/de.po+++ b/po/de.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-22\n""Last-Translator: Tether project\n""Language-Team: German\n"@@ -930,6 +930,7 @@ msgid "Messages"msgstr "Nachrichten"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Kontakte"@@ -1084,6 +1085,26 @@ msgstr "Antworten"msgid "Copy Code"msgstr "Code kopieren"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopieren"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "In die Zwischenablage kopiert."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Nachricht schreiben"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Noch keine Kontakte. Prüfen Sie die Bluetooth-Verbindung auf der Seite Geräte."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Kontakte durchsuchen"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Daemon offline"@@ -1632,10 +1653,18 @@ msgstr "Senden"msgid "Retry"msgstr "Erneut versuchen"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Auf dem iPhone schließen"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Neue Mitteilung"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "Das iPhone hat das Schließen nicht angenommen."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Noch keine Mitteilungen."diff --git a/po/es.po b/po/es.poindex a6fab81..03147d0 100644--- a/po/es.po+++ b/po/es.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-22\n""Last-Translator: Tether project\n""Language-Team: Spanish\n"@@ -923,6 +923,7 @@ msgid "Messages"msgstr "Mensajes"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Contactos"@@ -1075,6 +1076,26 @@ msgstr "Responder"msgid "Copy Code"msgstr "Copiar código"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Copiar"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Copiado al portapapeles."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Enviar mensaje"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Aún no hay contactos. Comprueba el enlace Bluetooth en la página Dispositivos."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Buscar contactos"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Daemon desconectado"@@ -1618,10 +1639,18 @@ msgstr "Enviar"msgid "Retry"msgstr "Reintentar"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Descartar en el iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Notificación nueva"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "El iPhone no aceptó el descarte."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Aún no hay notificaciones."diff --git a/po/fr.po b/po/fr.poindex e0e58b1..9404a76 100644--- a/po/fr.po+++ b/po/fr.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-22\n""Last-Translator: Tether project\n""Language-Team: French\n"@@ -929,6 +929,7 @@ msgid "Messages"msgstr "Messages"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Contacts"@@ -1082,6 +1083,26 @@ msgstr "Répondre"msgid "Copy Code"msgstr "Copier le code"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Copier"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Copié dans le presse-papiers."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Envoyer un message"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Aucun contact pour l'instant. Vérifiez la liaison Bluetooth sur la page Appareils."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Rechercher des contacts"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Démon hors ligne"@@ -1625,10 +1646,18 @@ msgstr "Envoyer"msgid "Retry"msgstr "Réessayer"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Ignorer sur l'iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nouvelle notification"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "L'iPhone n'a pas accepté la suppression."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Aucune notification pour l'instant."diff --git a/po/it.po b/po/it.poindex 24acdf2..5061b82 100644--- a/po/it.po+++ b/po/it.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Italian\n"@@ -922,6 +922,7 @@ msgid "Messages"msgstr "Messaggi"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Contatti"@@ -1073,6 +1074,26 @@ msgstr "Rispondi"msgid "Copy Code"msgstr "Copia codice"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Copia"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Copiato negli appunti."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Invia messaggio"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Ancora nessun contatto. Controlla il collegamento Bluetooth nella pagina Dispositivi."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Cerca contatti"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Daemon offline"@@ -1618,10 +1639,18 @@ msgstr "Invia"msgid "Retry"msgstr "Riprova"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Ignora sull'iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nuova notifica"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "L'iPhone non ha accettato la rimozione."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Ancora nessuna notifica."diff --git a/po/ja.po b/po/ja.poindex 2786700..8cc66e9 100644--- a/po/ja.po+++ b/po/ja.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Japanese\n"@@ -896,6 +896,7 @@ msgid "Messages"msgstr "メッセージ"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "連絡先"@@ -1048,6 +1049,26 @@ msgstr "返信"msgid "Copy Code"msgstr "コードをコピー"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "コピー"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "クリップボードにコピーしました。"++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "メッセージを送信"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "まだ連絡先はありません。デバイスページで Bluetooth 接続を確認してください。"++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "連絡先を検索"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "デーモンはオフライン"@@ -1586,10 +1607,18 @@ msgstr "送信"msgid "Retry"msgstr "再試行"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "iPhone で消去"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "新しい通知"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone が消去を受け付けませんでした。"+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "まだ通知はありません。"diff --git a/po/ko.po b/po/ko.poindex 9e0356f..400b508 100644--- a/po/ko.po+++ b/po/ko.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Korean\n"@@ -886,6 +886,7 @@ msgid "Messages"msgstr "메시지"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "연락처"@@ -1036,6 +1037,26 @@ msgstr "답장"msgid "Copy Code"msgstr "코드 복사"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "복사"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "클립보드에 복사했습니다."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "메시지 보내기"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "아직 연락처가 없습니다. 기기 페이지에서 블루투스 연결을 확인하세요."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "연락처 검색"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "데몬 오프라인"@@ -1566,10 +1587,18 @@ msgstr "보내기"msgid "Retry"msgstr "다시 시도"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "iPhone에서 지우기"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "새 알림"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone이 지우기를 받아들이지 않았습니다."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "아직 알림이 없습니다."diff --git a/po/nl.po b/po/nl.poindex 65d2d0e..f5231ed 100644--- a/po/nl.po+++ b/po/nl.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Dutch\n"@@ -917,6 +917,7 @@ msgid "Messages"msgstr "Berichten"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Contacten"@@ -1069,6 +1070,26 @@ msgstr "Antwoorden"msgid "Copy Code"msgstr "Code kopiëren"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopiëren"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Naar het klembord gekopieerd."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Bericht sturen"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Nog geen contacten. Controleer de Bluetooth-verbinding op de pagina Apparaten."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Contacten doorzoeken"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Daemon offline"@@ -1608,10 +1629,18 @@ msgstr "Versturen"msgid "Retry"msgstr "Opnieuw proberen"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Sluiten op de iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nieuwe melding"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "De iPhone accepteerde het sluiten niet."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Nog geen meldingen."diff --git a/po/pl.po b/po/pl.poindex fa8ee93..b73a957 100644--- a/po/pl.po+++ b/po/pl.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Polish\n"@@ -919,6 +919,7 @@ msgid "Messages"msgstr "Wiadomości"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Kontakty"@@ -1070,6 +1071,26 @@ msgstr "Odpowiedz"msgid "Copy Code"msgstr "Kopiuj kod"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopiuj"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Skopiowano do schowka."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Wyślij wiadomość"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Nie ma jeszcze kontaktów. Sprawdź połączenie Bluetooth na stronie Urządzenia."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Szukaj kontaktów"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Demon offline"@@ -1610,10 +1631,18 @@ msgstr "Wyślij"msgid "Retry"msgstr "Ponów"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Zamknij na iPhonie"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nowe powiadomienie"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone nie przyjął zamknięcia."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Nie ma jeszcze powiadomień."diff --git a/po/pt_BR.po b/po/pt_BR.poindex c017886..2b39f9e 100644--- a/po/pt_BR.po+++ b/po/pt_BR.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Brazilian Portuguese\n"@@ -919,6 +919,7 @@ msgid "Messages"msgstr "Mensagens"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Contatos"@@ -1070,6 +1071,26 @@ msgstr "Responder"msgid "Copy Code"msgstr "Copiar código"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Copiar"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Copiado para a área de transferência."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Enviar mensagem"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Ainda não há contatos. Verifique a conexão Bluetooth na página Dispositivos."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Pesquisar contatos"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Daemon offline"@@ -1610,10 +1631,18 @@ msgstr "Enviar"msgid "Retry"msgstr "Tentar novamente"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Dispensar no iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Nova notificação"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "O iPhone não aceitou a dispensa."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Ainda não há notificações."diff --git a/po/ru.po b/po/ru.poindex f5ebd5a..7b76f70 100644--- a/po/ru.po+++ b/po/ru.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Russian\n"@@ -918,6 +918,7 @@ msgid "Messages"msgstr "Сообщения"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Контакты"@@ -1069,6 +1070,26 @@ msgstr "Ответить"msgid "Copy Code"msgstr "Скопировать код"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Копировать"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Скопировано в буфер обмена."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Написать сообщение"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Контактов пока нет. Проверьте связь по Bluetooth на странице «Устройства»."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Поиск контактов"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Демон не в сети"@@ -1610,10 +1631,18 @@ msgstr "Отправить"msgid "Retry"msgstr "Повторить"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Убрать на iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Новое уведомление"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone не принял удаление уведомления."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Уведомлений пока нет."diff --git a/po/sv.po b/po/sv.poindex b26c23b..d1b2883 100644--- a/po/sv.po+++ b/po/sv.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Swedish\n"@@ -906,6 +906,7 @@ msgid "Messages"msgstr "Meddelanden"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Kontakter"@@ -1056,6 +1057,26 @@ msgstr "Svara"msgid "Copy Code"msgstr "Kopiera kod"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopiera"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Kopierat till urklipp."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Skicka meddelande"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Inga kontakter ännu. Kontrollera Bluetooth-anslutningen på sidan Enheter."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Sök kontakter"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Demonen är offline"@@ -1595,10 +1616,18 @@ msgstr "Skicka"msgid "Retry"msgstr "Försök igen"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Stäng på iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Ny avisering"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone tog inte emot stängningen."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Inga aviseringar ännu."diff --git a/po/tether.pot b/po/tether.potindex 9e6221f..3330036 100644--- a/po/tether.pot+++ b/po/tether.pot@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether 0.2.23\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <[email protected]>\n"@@ -816,6 +816,7 @@ msgid "Messages"msgstr ""#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr ""@@ -950,6 +951,26 @@ msgstr ""msgid "Copy Code"msgstr ""+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr ""++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr ""++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr ""++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr ""++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr ""+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr ""@@ -1443,10 +1464,18 @@ msgstr ""msgid "Retry"msgstr ""+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr ""+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr ""+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr ""+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr ""diff --git a/po/tr.po b/po/tr.poindex ebaff94..1c8c238 100644--- a/po/tr.po+++ b/po/tr.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Turkish\n"@@ -905,6 +905,7 @@ msgid "Messages"msgstr "Mesajlar"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Kişiler"@@ -1055,6 +1056,26 @@ msgstr "Yanıtla"msgid "Copy Code"msgstr "Kodu kopyala"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Kopyala"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Panoya kopyalandı."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Mesaj gönder"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Henüz kişi yok. Aygıtlar sayfasındaki Bluetooth bağlantısını denetleyin."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Kişilerde ara"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Arka plan hizmeti çevrimdışı"@@ -1589,10 +1610,18 @@ msgstr "Gönder"msgid "Retry"msgstr "Yeniden dene"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "iPhone'da kapat"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Yeni bildirim"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone kapatmayı kabul etmedi."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Henüz bildirim yok."diff --git a/po/uk.po b/po/uk.poindex d46d5b1..ac4c82f 100644--- a/po/uk.po+++ b/po/uk.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Ukrainian\n"@@ -917,6 +917,7 @@ msgid "Messages"msgstr "Повідомлення"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "Контакти"@@ -1068,6 +1069,26 @@ msgstr "Відповісти"msgid "Copy Code"msgstr "Скопіювати код"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "Копіювати"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "Скопійовано до буфера обміну."++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "Написати повідомлення"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "Контактів поки немає. Перевірте зʼєднання Bluetooth на сторінці «Пристрої»."++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "Пошук контактів"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "Демон не в мережі"@@ -1609,10 +1630,18 @@ msgstr "Надіслати"msgid "Retry"msgstr "Повторити"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "Прибрати на iPhone"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "Нове сповіщення"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone не прийняв прибирання сповіщення."+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "Сповіщень поки немає."diff --git a/po/zh_CN.po b/po/zh_CN.poindex 7c6362e..9c36cc5 100644--- a/po/zh_CN.po+++ b/po/zh_CN.po@@ -8,7 +8,7 @@ msgid ""msgstr """Project-Id-Version: tether\n""Report-Msgid-Bugs-To: [email protected]\n"-"POT-Creation-Date: 2026-09-03 19:19-0700\n"+"POT-Creation-Date: 2026-09-03 19:48-0700\n""PO-Revision-Date: 2026-08-23\n""Last-Translator: Tether project\n""Language-Team: Simplified Chinese\n"@@ -863,6 +863,7 @@ msgid "Messages"msgstr "信息"#: src/core/src/bluetooth/profile_supervisor.cpp src/gtk/devices_view.cpp+#: src/gtk/main.cppmsgid "Contacts"msgstr "通讯录"@@ -1010,6 +1011,26 @@ msgstr "回复"msgid "Copy Code"msgstr "复制验证码"+#: src/gtk/contacts_view.cpp+msgid "Copy"+msgstr "复制"++#: src/gtk/contacts_view.cpp+msgid "Copied to the clipboard."+msgstr "已复制到剪贴板。"++#: src/gtk/contacts_view.cpp+msgid "Message"+msgstr "发送信息"++#: src/gtk/contacts_view.cpp+msgid "No contacts yet. Check the Bluetooth link on the Devices page."+msgstr "暂无联系人。请在“设备”页面检查蓝牙连接。"++#: src/gtk/contacts_view.cpp+msgid "Search contacts"+msgstr "搜索通讯录"+#: src/gtk/daemon_client.cppmsgid "Daemon Offline"msgstr "守护进程离线"@@ -1533,10 +1554,18 @@ msgstr "发送"msgid "Retry"msgstr "重试"+#: src/gtk/notifications_view.cpp+msgid "Dismiss on the iPhone"+msgstr "在 iPhone 上清除"+#: src/gtk/notifications_view.cppmsgid "New notification"msgstr "新通知"+#: src/gtk/notifications_view.cpp+msgid "The iPhone would not take the dismissal."+msgstr "iPhone 未接受此清除操作。"+#: src/gtk/notifications_view.cppmsgid "No notifications yet."msgstr "暂无通知。"diff --git a/src/gtk/CMakeLists.txt b/src/gtk/CMakeLists.txtindex 272784c..50bc827 100644--- a/src/gtk/CMakeLists.txt+++ b/src/gtk/CMakeLists.txt@@ -6,6 +6,7 @@ add_executable(tether-gtkui_util.cppprefs.cppmessage_format.cpp+ contacts_view.cppdaemon_client.cppdevices_view.cppmessages_view.cppdiff --git a/src/gtk/contacts_view.cpp b/src/gtk/contacts_view.cppnew file mode 100644index 0000000..a95f8d4--- /dev/null+++ b/src/gtk/contacts_view.cpp@@ -0,0 +1,254 @@+#include "contacts_view.hpp"+#include "daemon_client.hpp"+#include "ui_util.hpp"+#include <tether/i18n.hpp>++#include <cstring>+#include <string>++namespace tether::ui {++ namespace {++ struct ContactsState {+ GtkWidget* stack = nullptr;+ GtkWidget* status_label = nullptr;+ GtkWidget* list = nullptr;+ GtkWidget* search_entry = nullptr;+ std::string search_needle;+ std::string shown;+ bool visible = false;+ void (*open_thread)(const std::string&) = nullptr;+ };++ ContactsState g_contacts;++ constexpr int CONTACT_LIMIT = 5000;++ void request_contacts() {+ nlohmann::json j;+ j["command"] = "bt_list_contacts";+ j["limit"] = CONTACT_LIMIT;+ daemon_send(j);+ }++ gboolean contact_visible(GtkListBoxRow* row, gpointer) {+ if (g_contacts.search_needle.empty())+ return TRUE;+ const char* haystack = static_cast<const char*>(g_object_get_data(G_OBJECT(row), "search"));+ return haystack && std::strstr(haystack, g_contacts.search_needle.c_str()) != nullptr;+ }++ void on_search_changed(GtkSearchEntry* entry, gpointer) {+ g_contacts.search_needle = fold(gtk_entry_get_text(GTK_ENTRY(entry)));+ gtk_list_box_invalidate_filter(GTK_LIST_BOX(g_contacts.list));+ }++ // Addresses arrive namespaced the way thread keys are. The prefix is+ // what makes them sendable, so it is kept on the button and stripped+ // only for display.+ std::string display_address(const std::string& key) {+ const size_t colon = key.find(':');+ return colon == std::string::npos ? key : key.substr(colon + 1);+ }++ const char* stashed(GtkWidget* widget) {+ const char* value = static_cast<const char*>(g_object_get_data(G_OBJECT(widget), "address"));+ return value ? value : "";+ }++ GtkWidget*+ action_button(const char* icon_name, const std::string& address, const char* tooltip, GCallback on_click) {+ GtkWidget* button = gtk_button_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON);+ gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);+ gtk_widget_set_tooltip_text(button, tooltip);+ g_object_set_data_full(G_OBJECT(button), "address", g_strdup(address.c_str()), g_free);+ g_signal_connect(button, "clicked", on_click, nullptr);+ return button;+ }++ GtkWidget* build_address_row(const std::string& key) {+ const bool is_tel = key.rfind("tel:", 0) == 0;++ GtkWidget* box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);+ GtkWidget* icon = gtk_image_new_from_icon_name(is_tel ? "call-start-symbolic" : "mail-send-symbolic",+ GTK_ICON_SIZE_BUTTON);+ gtk_style_context_add_class(gtk_widget_get_style_context(icon), "muted");+ gtk_box_pack_start(GTK_BOX(box), icon, FALSE, FALSE, 0);++ GtkWidget* label = gtk_label_new(display_address(key).c_str());+ gtk_label_set_xalign(GTK_LABEL(label), 0.0);+ gtk_label_set_selectable(GTK_LABEL(label), TRUE);+ gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);+ gtk_label_set_max_width_chars(GTK_LABEL(label), 28);+ gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);++ gtk_box_pack_end(+ GTK_BOX(box),+ action_button(+ "edit-copy-symbolic", display_address(key), _("Copy"), G_CALLBACK(+[](GtkButton* button, gpointer) {+ gtk_clipboard_set_text(+ gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), stashed(GTK_WIDGET(button)), -1);+ set_status_main(_("Copied to the clipboard."));+ })),+ FALSE,+ FALSE,+ 0);++ GtkWidget* message = action_button(+ "mail-message-new-symbolic", key, _("Message"), G_CALLBACK(+[](GtkButton* button, gpointer) {+ if (g_contacts.open_thread)+ g_contacts.open_thread(stashed(GTK_WIDGET(button)));+ }));+ gtk_box_pack_end(GTK_BOX(box), message, FALSE, FALSE, 0);+ return box;+ }++ // Lazily built the first time a contact is opened.+ void on_expanded(GObject* expander, GParamSpec*, gpointer) {+ if (!gtk_expander_get_expanded(GTK_EXPANDER(expander)))+ return;+ const char* pending = static_cast<const char*>(g_object_get_data(expander, "addresses"));+ if (!pending)+ return;++ GtkWidget* box = gtk_bin_get_child(GTK_BIN(expander));+ std::string keys = pending;+ size_t start = 0;+ while (start <= keys.size()) {+ const size_t end = keys.find('\n', start);+ const std::string key = keys.substr(start, end - start);+ if (!key.empty())+ gtk_box_pack_start(GTK_BOX(box), build_address_row(key), FALSE, FALSE, 0);+ if (end == std::string::npos)+ break;+ start = end + 1;+ }+ g_object_set_data(expander, "addresses", nullptr);+ gtk_widget_show_all(box);+ }++ GtkWidget* build_row(const nlohmann::json& contact) {+ const std::string name = contact.value("name", "");++ GtkWidget* row = gtk_list_box_row_new();+ gtk_list_box_row_set_selectable(GTK_LIST_BOX_ROW(row), FALSE);+ gtk_list_box_row_set_activatable(GTK_LIST_BOX_ROW(row), FALSE);++ GtkWidget* expander = gtk_expander_new(nullptr);+ gtk_container_set_border_width(GTK_CONTAINER(expander), 10);++ GtkWidget* title = gtk_label_new(nullptr);+ gtk_label_set_xalign(GTK_LABEL(title), 0.0);+ gtk_label_set_ellipsize(GTK_LABEL(title), PANGO_ELLIPSIZE_END);+ gtk_label_set_max_width_chars(GTK_LABEL(title), 28);+ gtk_expander_set_label_widget(GTK_EXPANDER(expander), title);++ GtkWidget* addresses = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);+ gtk_widget_set_margin_top(addresses, 6);+ gtk_widget_set_margin_start(addresses, 18);++ std::string haystack = name;+ std::string first_address;+ std::string keys;+ if (contact.contains("addresses") && contact["addresses"].is_array()) {+ for (const auto& entry : contact["addresses"]) {+ if (!entry.is_string())+ continue;+ const std::string key = entry.get<std::string>();+ if (first_address.empty())+ first_address = display_address(key);+ haystack += " " + display_address(key);+ keys += key + "\n";+ }+ }++ set_markup(title, "<b>" + escape_markup(name.empty() ? first_address : name) + "</b>");+ g_object_set_data_full(G_OBJECT(row), "search", g_strdup(fold(haystack).c_str()), g_free);+ g_object_set_data_full(G_OBJECT(expander), "addresses", g_strdup(keys.c_str()), g_free);+ g_signal_connect(expander, "notify::expanded", G_CALLBACK(on_expanded), nullptr);++ gtk_container_add(GTK_CONTAINER(expander), addresses);+ gtk_container_add(GTK_CONTAINER(row), expander);+ return row;+ }++ void show_contacts(const nlohmann::json& event) {+ const std::string payload = event.contains("contacts") ? event["contacts"].dump() : "";+ if (payload == g_contacts.shown)+ return;+ g_contacts.shown = payload;++ clear_list_box(g_contacts.list);+ const bool empty = !event.contains("contacts") || event["contacts"].empty();+ if (!empty) {+ for (const auto& contact : event["contacts"])+ gtk_list_box_insert(GTK_LIST_BOX(g_contacts.list), build_row(contact), -1);+ }+ gtk_widget_show_all(g_contacts.list);+ gtk_stack_set_visible_child_name(GTK_STACK(g_contacts.stack), empty ? "status" : "list");+ }++ } // namespace++ void contacts_view_set_visible(bool visible) {+ g_contacts.visible = visible;+ if (!visible)+ return;+ request_contacts();+ gtk_widget_grab_focus(g_contacts.search_entry);+ }++ bool contacts_view_handle_event(const nlohmann::json& event) {+ if (event.value("command", "") == "bt_contacts")+ show_contacts(event);+ return false;+ }++ GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key)) {+ g_contacts.open_thread = open_thread;+ g_contacts.stack = gtk_stack_new();++ GtkWidget* status_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);+ gtk_widget_set_valign(status_box, GTK_ALIGN_CENTER);+ gtk_widget_set_halign(status_box, GTK_ALIGN_CENTER);+ gtk_box_pack_start(GTK_BOX(status_box),+ gtk_image_new_from_icon_name("avatar-default-symbolic", GTK_ICON_SIZE_DIALOG),+ FALSE,+ FALSE,+ 0);+ g_contacts.status_label = gtk_label_new(_("No contacts yet. Check the Bluetooth link on the Devices page."));+ gtk_label_set_line_wrap(GTK_LABEL(g_contacts.status_label), TRUE);+ gtk_label_set_justify(GTK_LABEL(g_contacts.status_label), GTK_JUSTIFY_CENTER);+ gtk_style_context_add_class(gtk_widget_get_style_context(g_contacts.status_label), "muted");+ gtk_box_pack_start(GTK_BOX(status_box), g_contacts.status_label, FALSE, FALSE, 0);+ gtk_stack_add_named(GTK_STACK(g_contacts.stack), status_box, "status");++ GtkWidget* list_side = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);++ g_contacts.search_entry = gtk_search_entry_new();+ gtk_entry_set_placeholder_text(GTK_ENTRY(g_contacts.search_entry), _("Search contacts"));+ gtk_widget_set_margin_top(g_contacts.search_entry, 8);+ gtk_widget_set_margin_start(g_contacts.search_entry, 8);+ gtk_widget_set_margin_end(g_contacts.search_entry, 8);+ g_signal_connect(g_contacts.search_entry, "search-changed", G_CALLBACK(on_search_changed), nullptr);+ g_signal_connect(g_contacts.search_entry,+ "stop-search",+ G_CALLBACK(+[](GtkSearchEntry* entry, gpointer) { gtk_entry_set_text(GTK_ENTRY(entry), ""); }),+ nullptr);+ gtk_box_pack_start(GTK_BOX(list_side), g_contacts.search_entry, FALSE, FALSE, 0);++ GtkWidget* scroll = gtk_scrolled_window_new(nullptr, nullptr);+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);+ g_contacts.list = gtk_list_box_new();+ gtk_list_box_set_selection_mode(GTK_LIST_BOX(g_contacts.list), GTK_SELECTION_NONE);+ gtk_list_box_set_filter_func(GTK_LIST_BOX(g_contacts.list), contact_visible, nullptr, nullptr);+ gtk_container_add(GTK_CONTAINER(scroll), g_contacts.list);+ gtk_box_pack_start(GTK_BOX(list_side), scroll, TRUE, TRUE, 0);+ gtk_stack_add_named(GTK_STACK(g_contacts.stack), list_side, "list");++ gtk_stack_set_visible_child_name(GTK_STACK(g_contacts.stack), "status");+ return g_contacts.stack;+ }++} // namespace tether::uidiff --git a/src/gtk/contacts_view.hpp b/src/gtk/contacts_view.hppnew file mode 100644index 0000000..2d00de6--- /dev/null+++ b/src/gtk/contacts_view.hpp@@ -0,0 +1,18 @@+#pragma once++#include <gtk/gtk.h>+#include <nlohmann/json.hpp>+#include <string>++namespace tether::ui {++ // The iPhone's address book, pulled over PBAP.+ GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key));++ // Returns true when the event belonged to this view.+ bool contacts_view_handle_event(const nlohmann::json& event);++ // Contacts are only pulled while the view is on screen.+ void contacts_view_set_visible(bool visible);++} // namespace tether::uidiff --git a/src/gtk/main.cpp b/src/gtk/main.cppindex 4c29648..697f33c 100644--- a/src/gtk/main.cpp+++ b/src/gtk/main.cpp@@ -1,3 +1,4 @@+#include "contacts_view.hpp"#include "daemon_client.hpp"#include "devices_view.hpp"#include "messages_view.hpp"@@ -49,6 +50,7 @@ namespace {messages_view_set_visible(view == "messages");notifications_view_set_visible(view == "notifications");+ contacts_view_set_visible(view == "contacts");}// The tray controls live here@@ -143,6 +145,7 @@ namespace {{"devices", "<Control>1", [] { show_view("devices"); }},{"messages", "<Control>2", [] { show_view("messages"); }},{"notifications", "<Control>3", [] { show_view("notifications"); }},+ {"contacts", "<Control>4", [] { show_view("contacts"); }},{"close","<Control>w",[] {@@ -210,6 +213,13 @@ namespace {gtk_stack_add_titled(GTK_STACK(stack), devices_view_new(), "devices", _("Devices"));gtk_stack_add_titled(GTK_STACK(stack), messages_view_new(), "messages", _("Messages"));gtk_stack_add_titled(GTK_STACK(stack), notifications_view_new(), "notifications", _("Notifications"));+ gtk_stack_add_titled(GTK_STACK(stack),+ contacts_view_new([](const std::string& thread_key) {+ show_view("messages");+ messages_view_open_thread(thread_key);+ }),+ "contacts",+ _("Contacts"));GtkWidget* switcher = gtk_stack_switcher_new();gtk_stack_switcher_set_stack(GTK_STACK_SWITCHER(switcher), GTK_STACK(stack));@@ -232,6 +242,8 @@ namespace {daemon_client_start([](const nlohmann::json& event) {if (devices_view_handle_event(event))return;+ if (contacts_view_handle_event(event))+ return;if (messages_view_handle_event(event))return;notifications_view_handle_event(event);@@ -260,7 +272,7 @@ int main(int argc, char** argv) {G_OPTION_ARG_NONE,_("Start hidden in the system tray"),nullptr);- for (const char* view : {"devices", "messages", "notifications"}) {+ for (const char* view : {"devices", "messages", "notifications", "contacts"}) {g_application_add_main_option(G_APPLICATION(app), view, 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, _("Open on this tab"), nullptr);}@@ -278,7 +290,7 @@ int main(int argc, char** argv) {GVariantDict* options = g_application_command_line_get_options_dict(cmdline);if (g_variant_dict_contains(options, "tray"))g_start_hidden = TRUE;- for (const char* view : {"devices", "messages", "notifications"}) {+ for (const char* view : {"devices", "messages", "notifications", "contacts"}) {if (g_variant_dict_contains(options, view))g_requested_view = view;}diff --git a/src/gtk/messages_view.cpp b/src/gtk/messages_view.cppindex 6c24473..340fe6f 100644--- a/src/gtk/messages_view.cpp+++ b/src/gtk/messages_view.cpp@@ -101,6 +101,8 @@ namespace tether::ui {GtkListStore* compose_model = nullptr;std::map<std::string, std::string> compose_names;std::string compose_requested_key;+ std::string compose_shown;+ std::string pending_new_thread;};MessagesState g_messages;@@ -119,12 +121,12 @@ namespace tether::ui {void clear_selection();void switch_thread(const std::string& key);void hide_send_error();- std::string fold(const std::string& text);// `offer_permissions` shows the button that re-solicits the iPhone's// Bluetooth toggles, which only helps when that is the actual problem.void set_banner(const std::string& text, bool offer_permissions = false);std::string composer_text();void leave_compose();+ void enter_compose();void on_recipient_changed(GtkEditable*, gpointer);gboolean focus_composer_idle(gpointer) {@@ -402,6 +404,25 @@ namespace tether::ui {gtk_list_box_invalidate_filter(GTK_LIST_BOX(g_messages.thread_list));}+ // One spelled several ways ("+15551234567", "5551234567"), daemon puts in one bucket.+ // The UI has to agree.+ bool same_thread(const std::string& a, const std::string& b) {+ if (a.empty() || b.empty())+ return a == b;+ return bluetooth::thread_bucket(a) == bluetooth::thread_bucket(b);+ }++ GtkWidget* find_thread_row(const std::string& thread_key) {+ for (int index = 0;; ++index) {+ GtkListBoxRow* row = gtk_list_box_get_row_at_index(GTK_LIST_BOX(g_messages.thread_list), index);+ if (!row)+ return nullptr;+ const char* key = static_cast<const char*>(g_object_get_data(G_OBJECT(row), "thread"));+ if (key && same_thread(key, thread_key))+ return GTK_WIDGET(row);+ }+ }+void show_threads(const nlohmann::json& event) {if (!event.contains("threads") || !event["threads"].is_array())return;@@ -428,17 +449,28 @@ namespace tether::ui {for (const auto& thread : event["threads"]) {GtkWidget* row = build_thread_row(thread);gtk_list_box_insert(GTK_LIST_BOX(g_messages.thread_list), row, -1);- if (thread.value("thread", "") == g_messages.selected_thread)+ if (same_thread(thread.value("thread", ""), g_messages.selected_thread))reselect = row;}gtk_widget_show_all(g_messages.thread_list);if (reselect) {+ g_messages.pending_new_thread.clear();gtk_list_box_select_row(GTK_LIST_BOX(g_messages.thread_list), GTK_LIST_BOX_ROW(reselect));if (!g_messages.composing)apply_row_selection(reselect);} else if (!g_messages.selected_thread.empty() && !g_messages.composing) {- clear_selection();+ bluetooth::Recipient recipient;+ std::string err;+ const bool wanted = same_thread(g_messages.pending_new_thread, g_messages.selected_thread) &&+ bluetooth::recipient_from_thread_key(g_messages.selected_thread, recipient, err);+ g_messages.pending_new_thread.clear();+ if (wanted) {+ enter_compose();+ gtk_entry_set_text(GTK_ENTRY(g_messages.compose_entry), recipient.address.c_str());+ } else {+ clear_selection();+ }}if (g_messages.thread_selected_handler)@@ -496,7 +528,7 @@ namespace tether::ui {}void show_messages(const nlohmann::json& event) {- if (event.value("thread", "") != g_messages.selected_thread)+ if (!same_thread(event.value("thread", ""), g_messages.selected_thread))return;static const nlohmann::json none = nlohmann::json::array();@@ -790,17 +822,6 @@ namespace tether::ui {update_composer_sensitivity();}- // Matches what GtkEntryCompletion does to the typed key before handing it- // to the match function, so the two are comparable.- std::string fold(const std::string& text) {- gchar* normalized = g_utf8_normalize(text.c_str(), -1, G_NORMALIZE_ALL);- gchar* folded = g_utf8_casefold(normalized ? normalized : text.c_str(), -1);- std::string out = folded ? folded : "";- g_free(normalized);- g_free(folded);- return out;- }-void request_contact_completion() {nlohmann::json j;j["command"] = "bt_list_contacts";@@ -809,6 +830,11 @@ namespace tether::ui {}void show_contact_completion(const nlohmann::json& event) {+ const std::string payload = event.contains("contacts") ? event["contacts"].dump() : "";+ if (payload == g_messages.compose_shown)+ return;+ g_messages.compose_shown = payload;+gtk_list_store_clear(g_messages.compose_model);g_messages.compose_names.clear();if (!event.contains("contacts") || !event["contacts"].is_array())@@ -1016,7 +1042,9 @@ namespace tether::ui {void messages_view_open_thread(const std::string& thread_key) {if (thread_key.empty())return;+leave_compose();+ g_messages.pending_new_thread = thread_key;switch_thread(thread_key);g_messages.selected_name.clear();g_messages.selected_repliable = false;@@ -1076,7 +1104,7 @@ namespace tether::ui {request_threads();if (!g_messages.visible)return true;- if (event.value("thread", "") == g_messages.selected_thread)+ if (same_thread(event.value("thread", ""), g_messages.selected_thread))request_messages(g_messages.selected_thread);return true;}diff --git a/src/gtk/notifications_view.cpp b/src/gtk/notifications_view.cppindex 749ba27..104755f 100644--- a/src/gtk/notifications_view.cpp+++ b/src/gtk/notifications_view.cpp@@ -44,6 +44,15 @@ namespace tether::ui {GTK_ICON_SIZE_LARGE_TOOLBAR);}+ void on_dismiss_clicked(GtkButton* button, gpointer) {+ nlohmann::json j;+ j["command"] = "bt_notification_action";+ j["uid"] = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(button), "uid"));+ j["action"] = "negative";+ daemon_send(j);+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);+ }+GtkWidget* build_row(const nlohmann::json& notification) {const std::string app = notification.value("app_name", notification.value("app_id", ""));const std::string title = notification.value("title", "");@@ -70,6 +79,16 @@ namespace tether::ui {gtk_style_context_add_class(gtk_widget_get_style_context(time_label), "muted");gtk_box_pack_start(GTK_BOX(header), time_label, FALSE, FALSE, 0);}++ if (notification.value("negative_action", false)) {+ GtkWidget* dismiss = gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_BUTTON);+ gtk_button_set_relief(GTK_BUTTON(dismiss), GTK_RELIEF_NONE);+ gtk_widget_set_tooltip_text(dismiss, _("Dismiss on the iPhone"));+ g_object_set_data(+ G_OBJECT(dismiss), "uid", GUINT_TO_POINTER(notification.value("uid", static_cast<uint32_t>(0))));+ g_signal_connect(dismiss, "clicked", G_CALLBACK(on_dismiss_clicked), nullptr);+ gtk_box_pack_start(GTK_BOX(header), dismiss, FALSE, FALSE, 0);+ }gtk_box_pack_start(GTK_BOX(box), header, FALSE, FALSE, 0);// With content mirroring off only the app is known, so the row says@@ -127,6 +146,11 @@ namespace tether::ui {show_notifications(event);return true;}+ if (command == "bt_notification_action_result") {+ if (!event.value("success", false))+ set_status_main(_("The iPhone would not take the dismissal."));+ return true;+ }if (command == "bt_notification" || command == "bt_notification_removed") {if (g_notifications.visible)request_notifications();diff --git a/src/gtk/ui_util.cpp b/src/gtk/ui_util.cppindex d09adb2..f10ec11 100644--- a/src/gtk/ui_util.cpp+++ b/src/gtk/ui_util.cpp@@ -110,6 +110,15 @@ namespace tether::ui {g_object_unref(provider);}+ std::string fold(const std::string& text) {+ gchar* normalized = g_utf8_normalize(text.c_str(), -1, G_NORMALIZE_ALL);+ gchar* folded = g_utf8_casefold(normalized ? normalized : text.c_str(), -1);+ std::string out = folded ? folded : "";+ g_free(normalized);+ g_free(folded);+ return out;+ }+std::string escape_markup(const std::string& text) {gchar* escaped = g_markup_escape_text(text.c_str(), -1);std::string result = escaped ? escaped : "";diff --git a/src/gtk/ui_util.hpp b/src/gtk/ui_util.hppindex 688ec58..2c53d3a 100644--- a/src/gtk/ui_util.hpp+++ b/src/gtk/ui_util.hpp@@ -5,12 +5,13 @@namespace tether::ui {- // Loads the application stylesheet. Every view already tags labels with- // "muted"; until this is installed nothing defines that class, so the tag- // has no effect at all.+ // Loads the application stylesheet.void install_style();std::string escape_markup(const std::string& text);++ // Normalized case- and accent-insensitive form of a string.+ std::string fold(const std::string& text);void set_markup(GtkWidget* label, const std::string& text);void set_text(GtkWidget* label, const std::string& text);void clear_list_box(GtkWidget* list_box);