diff --git a/src/EOSConnect/EOSConnect.vala b/src/EOSConnect/EOSConnect.vala index c9f0bd96d975289ab136497648d0088853b027fe..d19a55b3c38878b5c520918ed6fc8e10c2711bf7 100644 --- a/src/EOSConnect/EOSConnect.vala +++ b/src/EOSConnect/EOSConnect.vala @@ -117,13 +117,11 @@ namespace EOSConnect { private async void init_sms_history_tab () { - SimpleAction simple_action = new SimpleAction ("telephony-open-sms-window-reply", null); + SimpleAction simple_action = new SimpleAction ("telephony-open-sms-tab", null); simple_action.activate.connect (() => { - // sms_history_view.open_sms_window_reply (); - // sms_history_view.show_all (); main_window.main_stack.set_visible_child_name ("sms_history_view"); - warning ("par ka"); }); + this.add_action (simple_action); SMSStore.instance ().sms_handled.connect ( (sms) => { @@ -140,9 +138,6 @@ namespace EOSConnect { SMSStore.instance ().refresh_contact_list (); - - // sms_history_view.show_all (); - contacts_interface = new EContacts (); contacts_interface.load_contacts (); contacts_interface.contact_loaded.connect ((contact ) => { @@ -174,8 +169,8 @@ namespace EOSConnect { } if (to_add == true) { - launcher_entry.quicklist.child_append (new DeviceMenuitem.with_device ( - device_entry.value, sms_history_view)); + launcher_entry.quicklist.child_append ( + new DeviceMenuitem.with_device (device_entry.value, main_window)); } // var device_menuitem = launcher_entry.quicklist.find_id (device_entry.value.device_num); diff --git a/src/EOSConnect/Plugin/Widgets/SMSContactListBox.vala b/src/EOSConnect/Plugin/Widgets/SMSContactListBox.vala index 16b5ff00df164575830b40d8f8631c4473e351e8..80d735d9f411478b4730fe7728239c1c374c5bbe 100644 --- a/src/EOSConnect/Plugin/Widgets/SMSContactListBox.vala +++ b/src/EOSConnect/Plugin/Widgets/SMSContactListBox.vala @@ -22,17 +22,21 @@ namespace EOSConnect.Plugin.Widgets { public class SMSContactListBox : Gtk.ListBox { - private Gtk.Label _contacts_label; + private Gtk.Label contacts_label; construct { selection_mode = Gtk.SelectionMode.SINGLE; set_header_func (update_headers); - _contacts_label = new Gtk.Label (_("Contacts")); - _contacts_label.get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL); - _contacts_label.halign = Gtk.Align.START; + contacts_label = new Gtk.Label (_("Contacts")); + contacts_label.get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL); + contacts_label.halign = Gtk.Align.START; show_all (); + + // this.row_activated.connect ( (list_box_row) => { + // warning("par la"); + // }); } public void update_selected_list_box_row () { @@ -43,7 +47,7 @@ namespace EOSConnect.Plugin.Widgets { private void update_headers (Gtk.ListBoxRow row, Gtk.ListBoxRow? before = null) { if(before == null) { - row.set_header (_contacts_label); + row.set_header (contacts_label); } } } diff --git a/src/EOSConnect/Plugin/Windows/SMSHistory.vala b/src/EOSConnect/Plugin/Windows/SMSHistory.vala index f63a9d87998c43e84e397698cb4f0771d7d4c986..cd14eb71a73252dee9d213c2046b9e38958d1700 100644 --- a/src/EOSConnect/Plugin/Windows/SMSHistory.vala +++ b/src/EOSConnect/Plugin/Windows/SMSHistory.vala @@ -109,6 +109,8 @@ namespace EOSConnect.Plugin.Windows { sms_contact_list_box.select_row (sms_contact_list_box.get_row_at_index (0)); latest_contact_selected = ((Widgets.SMSContactListBoxRow)sms_contact_list_box.get_row_at_index (0)).sms_contact.phone_number; } + + show_all (); } public void update_message_ui_adding_sms (SMS sms) { @@ -125,15 +127,6 @@ namespace EOSConnect.Plugin.Windows { }); } - public void open_sms_tab (Device device) { - show_all (); - } - - public void open_sms_window_reply () { - print ("\n\nopen_sms_window_reply ()\n\n"); - show_all (); - } - private void add_sms_history_message_view (SMSContact sms_contact) { if (stack.get_child_by_name (sms_contact.phone_number) == null) { diff --git a/src/EOSConnect/Widgets/DeviceMenuitem.vala b/src/EOSConnect/Widgets/DeviceMenuitem.vala index f15172d065b0d3a52ea0e79034f2d155f1028514..a75b21dc1f14000e8dfd5c69ef2574eb7d9528f4 100644 --- a/src/EOSConnect/Widgets/DeviceMenuitem.vala +++ b/src/EOSConnect/Widgets/DeviceMenuitem.vala @@ -28,20 +28,20 @@ namespace EOSConnect.Widgets { private const int SUB_MENU_SHARE_ID = 300; private Device device; - private SMSHistory sms_history_window; + private MainWindow main_window; private Dbusmenu.Menuitem sub_menu_item_battery; private Dbusmenu.Menuitem sub_menu_item_telephony; private Dbusmenu.Menuitem sub_menu_item_share; construct { } - public DeviceMenuitem.with_device (Device device, SMSHistory sms_history_window) { + public DeviceMenuitem.with_device (Device device, MainWindow main_window) { Object ( id: device.device_num ); this.device = device; - this.sms_history_window = sms_history_window; + this.main_window = main_window; property_set (Dbusmenu.MENUITEM_PROP_LABEL, device.custom_name); update_sub_menu_battery (); update_sub_menu_telephony (); @@ -81,8 +81,7 @@ namespace EOSConnect.Widgets { if (sub_menu_item_telephony == null) { sub_menu_item_telephony = new Dbusmenu.Menuitem.with_id (id + SUB_MENU_TELEPHONY_ID); sub_menu_item_telephony.item_activated.connect (() => { - - sms_history_window.open_sms_tab (device); + main_window.main_stack.set_visible_child_name ("sms_history_view"); }); child_append (sub_menu_item_telephony); } diff --git a/src/MConnect/TelephonyHandler.vala b/src/MConnect/TelephonyHandler.vala index 75470a6c39010bb4f526f768cc4b30790a239f72..f073ee0fb0ed57bcc1c5e37260c1bc5e84aa60ed 100644 --- a/src/MConnect/TelephonyHandler.vala +++ b/src/MConnect/TelephonyHandler.vala @@ -108,8 +108,8 @@ namespace MConnect { notification.set_body (notif_body); if (event == "sms") { - // Action defined in EOSConnect._init_sms_history_window () - notification.set_default_action ("app.telephony-open-sms-window-reply"); + // Action defined in EOSConnect._init_sms_history_view () + notification.set_default_action ("app.telephony-open-sms-tab"); } if (set_notification_icon == true) {