From ef5cbdbb79095dc44d25865597f8fe38e817c5d7 Mon Sep 17 00:00:00 2001 From: Bajoja Date: Thu, 1 Dec 2016 18:44:47 +0000 Subject: [PATCH] Mark some forget string to be translated --- po/indicator-kdeconnect.pot | 4 +- po/pt_PT.po | 4 +- po/ru_RU.po | 4 +- src/Device.vala | 106 ++++++++++++++++----------------- src/KDEConnectManager.vala | 26 ++++---- src/contractor/Contractor.vala | 11 +++- 6 files changed, 83 insertions(+), 72 deletions(-) diff --git a/po/indicator-kdeconnect.pot b/po/indicator-kdeconnect.pot index ea454d0..2dcc6a9 100644 --- a/po/indicator-kdeconnect.pot +++ b/po/indicator-kdeconnect.pot @@ -71,7 +71,7 @@ msgstr "" msgid "cannot connect to KDE Connect DBus service" msgstr "" -#: src/Device.vala:575 +#: src/Device.vala:524 msgid "Encryption information not found" msgstr "" @@ -139,6 +139,6 @@ msgstr "" msgid "Send" msgstr "" -#: src/contractor/Contractor.vala:81 +#: src/contractor/Contractor.vala:84 msgid "File not found" msgstr "" diff --git a/po/pt_PT.po b/po/pt_PT.po index 105f864..7f085ad 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -94,7 +94,7 @@ msgstr "Desfrute!" msgid "cannot connect to KDE Connect DBus service" msgstr "Não foi possível connectar ao serviço DBus do KDE Connect" -#: src/Device.vala:575 +#: src/Device.vala:524 msgid "Encryption information not found" msgstr "Informações de encriptação não encontrada" @@ -162,6 +162,6 @@ msgstr "Enviar para" msgid "Send" msgstr "Enviar" -#: src/contractor/Contractor.vala:81 +#: src/contractor/Contractor.vala:84 msgid "File not found" msgstr "Ficheiro não encontrado" diff --git a/po/ru_RU.po b/po/ru_RU.po index e213d13..7c130a1 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -97,7 +97,7 @@ msgstr "Наслаждайтесь!" msgid "cannot connect to KDE Connect DBus service" msgstr "невозможно подключиться к сервису KDE Connect DBus" -#: src/Device.vala:575 +#: src/Device.vala:524 msgid "Encryption information not found" msgstr "Информация о шифровании не найдена" @@ -165,6 +165,6 @@ msgstr "Отавить в" msgid "Send" msgstr "Отправить" -#: src/contractor/Contractor.vala:81 +#: src/contractor/Contractor.vala:84 msgid "File not found" msgstr "Файл не найден" diff --git a/src/Device.vala b/src/Device.vala index 481f19e..db99ff9 100644 --- a/src/Device.vala +++ b/src/Device.vala @@ -469,57 +469,6 @@ namespace KDEConnectIndicator { } } - public void int32_signal_cb (DBusConnection con, string sender, string object, - string interface, string signal_name, Variant parameter) { - int param = (int)parameter.get_child_value (0).get_int32 (); - switch (signal_name) { - case "chargeChanged" : - charge_changed ((int)param); - break; - } - } - - public void void_signal_cb (DBusConnection con, string sender, string object, - string interface, string signal_name, Variant parameter) { - switch (signal_name) { - case "pluginsChanged" : - plugins_changed (); - break; - case "reachableStatusChanged" : - reachable_status_changed (); - break; - case "mounted" : - mounted (); - break; - case "unmounted" : - unmounted (); - break; - } - } - - public void boolean_signal_cb (DBusConnection con, string sender, string object, - string interface, string signal_name, Variant parameter) { - bool param = parameter.get_child_value (0).get_boolean (); - switch (signal_name) { - case "stateChanged" : - state_changed (param); - break; - case "trustedChanged" : - trusted_changed (param); - break; - } - } - - public void string_signal_cb (DBusConnection con, string sender, string object, - string interface, string signal_name, Variant parameter) { - string param = parameter.get_child_value (0).get_string (); - switch (signal_name) { - case "pairingError" : - pairing_error (param); - break; - } - } - private bool open_file (string path) { var file = File.new_for_path (path); try { @@ -532,7 +481,7 @@ namespace KDEConnectIndicator { } return false; } - + public void find_my_phone (){ try{ conn.call_sync ( @@ -566,7 +515,7 @@ namespace KDEConnectIndicator { -1, null ); - + Variant i = return_variant.get_child_value (0); return _encryption_info = i.dup_string (); } catch (Error e) { @@ -575,6 +524,57 @@ namespace KDEConnectIndicator { return _encryption_info = _("Encryption information not found"); } } + + public void int32_signal_cb (DBusConnection con, string sender, string object, + string interface, string signal_name, Variant parameter) { + int param = (int)parameter.get_child_value (0).get_int32 (); + switch (signal_name) { + case "chargeChanged" : + charge_changed ((int)param); + break; + } + } + + public void void_signal_cb (DBusConnection con, string sender, string object, + string interface, string signal_name, Variant parameter) { + switch (signal_name) { + case "pluginsChanged" : + plugins_changed (); + break; + case "reachableStatusChanged" : + reachable_status_changed (); + break; + case "mounted" : + mounted (); + break; + case "unmounted" : + unmounted (); + break; + } + } + + public void boolean_signal_cb (DBusConnection con, string sender, string object, + string interface, string signal_name, Variant parameter) { + bool param = parameter.get_child_value (0).get_boolean (); + switch (signal_name) { + case "stateChanged" : + state_changed (param); + break; + case "trustedChanged" : + trusted_changed (param); + break; + } + } + + public void string_signal_cb (DBusConnection con, string sender, string object, + string interface, string signal_name, Variant parameter) { + string param = parameter.get_child_value (0).get_string (); + switch (signal_name) { + case "pairingError" : + pairing_error (param); + break; + } + } public signal void charge_changed (int charge); public signal void pairing_error (string error); diff --git a/src/KDEConnectManager.vala b/src/KDEConnectManager.vala index c063f58..26984f8 100644 --- a/src/KDEConnectManager.vala +++ b/src/KDEConnectManager.vala @@ -112,12 +112,12 @@ namespace KDEConnectIndicator { } private void show_no_service_daemon () { - var msg = new Gtk.MessageDialog ( - null, Gtk.DialogFlags.MODAL, - Gtk.MessageType.WARNING, - Gtk.ButtonsType.OK, - "cannot connect to KDE Connect DBus service" - ); + var msg = new Gtk.MessageDialog (null, + Gtk.DialogFlags.MODAL, + Gtk.MessageType.WARNING, + Gtk.ButtonsType.OK, + _("cannot connect to KDE Connect DBus service")); + msg.response.connect(()=>{ msg.destroy(); GLib.Application.get_default ().quit_mainloop (); @@ -129,12 +129,18 @@ namespace KDEConnectIndicator { private void run_kdeconnect_binary () { //TODO: path depends from operating system, for now this will be the way to find it - string std_out; - try{ - Process.spawn_sync (null, new string[]{"grep", "Exec", "/etc/xdg/autostart/kdeconnectd.desktop"}, - null, SpawnFlags.SEARCH_PATH, null, out std_out, null, null); + Process.spawn_sync (null, + new string[]{"grep", + "Exec", + "/etc/xdg/autostart/kdeconnectd.desktop"}, + null, + SpawnFlags.SEARCH_PATH, + null, + out std_out, + null, + null); } catch (Error e){ message (e.message); } diff --git a/src/contractor/Contractor.vala b/src/contractor/Contractor.vala index 3fe83b5..e199ca8 100644 --- a/src/contractor/Contractor.vala +++ b/src/contractor/Contractor.vala @@ -76,9 +76,13 @@ namespace KDEConnectIndicator { if (f.get_path() != null // null path means its remote file && !f.query_exists ()) { message ("file doesnt exist"); - var msd = new Gtk.MessageDialog (null, Gtk.DialogFlags.MODAL, - Gtk.MessageType.WARNING, Gtk.ButtonsType.OK, - _("File not found")); + + var msd = new Gtk.MessageDialog (null, + Gtk.DialogFlags.MODAL, + Gtk.MessageType.WARNING, + Gtk.ButtonsType.OK, + _("File not found")); + msd.destroy.connect (Gtk.main_quit); msd.show (); msd.run (); @@ -114,6 +118,7 @@ namespace KDEConnectIndicator { } catch (Error e) { message (e.message); } + list_store = new Gtk.ListStore (1,typeof(string)); var device_list = new SList (); foreach (string id in id_list) {