Skip to content
Snippets Groups Projects
Commit f2ca4ba9 authored by gyan000's avatar gyan000
Browse files

Fix: contact list box not display by default

Fix: click on "send or view SMS" in quick list now display correctly the SMS tab.
parent 10914283
No related branches found
No related tags found
No related merge requests found
...@@ -117,13 +117,11 @@ namespace EOSConnect { ...@@ -117,13 +117,11 @@ namespace EOSConnect {
private async void init_sms_history_tab () { 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 (() => { 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"); main_window.main_stack.set_visible_child_name ("sms_history_view");
warning ("par ka");
}); });
this.add_action (simple_action); this.add_action (simple_action);
SMSStore.instance ().sms_handled.connect ( (sms) => { SMSStore.instance ().sms_handled.connect ( (sms) => {
...@@ -140,9 +138,6 @@ namespace EOSConnect { ...@@ -140,9 +138,6 @@ namespace EOSConnect {
SMSStore.instance ().refresh_contact_list (); SMSStore.instance ().refresh_contact_list ();
// sms_history_view.show_all ();
contacts_interface = new EContacts (); contacts_interface = new EContacts ();
contacts_interface.load_contacts (); contacts_interface.load_contacts ();
contacts_interface.contact_loaded.connect ((contact ) => { contacts_interface.contact_loaded.connect ((contact ) => {
...@@ -174,8 +169,8 @@ namespace EOSConnect { ...@@ -174,8 +169,8 @@ namespace EOSConnect {
} }
if (to_add == true) { if (to_add == true) {
launcher_entry.quicklist.child_append (new DeviceMenuitem.with_device ( launcher_entry.quicklist.child_append (
device_entry.value, sms_history_view)); new DeviceMenuitem.with_device (device_entry.value, main_window));
} }
// var device_menuitem = launcher_entry.quicklist.find_id (device_entry.value.device_num); // var device_menuitem = launcher_entry.quicklist.find_id (device_entry.value.device_num);
......
...@@ -22,17 +22,21 @@ namespace EOSConnect.Plugin.Widgets { ...@@ -22,17 +22,21 @@ namespace EOSConnect.Plugin.Widgets {
public class SMSContactListBox : Gtk.ListBox { public class SMSContactListBox : Gtk.ListBox {
private Gtk.Label _contacts_label; private Gtk.Label contacts_label;
construct { construct {
selection_mode = Gtk.SelectionMode.SINGLE; selection_mode = Gtk.SelectionMode.SINGLE;
set_header_func (update_headers); set_header_func (update_headers);
_contacts_label = new Gtk.Label (_("Contacts")); contacts_label = new Gtk.Label (_("Contacts"));
_contacts_label.get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL); contacts_label.get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL);
_contacts_label.halign = Gtk.Align.START; contacts_label.halign = Gtk.Align.START;
show_all (); show_all ();
// this.row_activated.connect ( (list_box_row) => {
// warning("par la");
// });
} }
public void update_selected_list_box_row () { public void update_selected_list_box_row () {
...@@ -43,7 +47,7 @@ namespace EOSConnect.Plugin.Widgets { ...@@ -43,7 +47,7 @@ namespace EOSConnect.Plugin.Widgets {
private void update_headers (Gtk.ListBoxRow row, Gtk.ListBoxRow? before = null) { private void update_headers (Gtk.ListBoxRow row, Gtk.ListBoxRow? before = null) {
if(before == null) { if(before == null) {
row.set_header (_contacts_label); row.set_header (contacts_label);
} }
} }
} }
......
...@@ -109,6 +109,8 @@ namespace EOSConnect.Plugin.Windows { ...@@ -109,6 +109,8 @@ namespace EOSConnect.Plugin.Windows {
sms_contact_list_box.select_row (sms_contact_list_box.get_row_at_index (0)); 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; 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) { public void update_message_ui_adding_sms (SMS sms) {
...@@ -125,15 +127,6 @@ namespace EOSConnect.Plugin.Windows { ...@@ -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) { private void add_sms_history_message_view (SMSContact sms_contact) {
if (stack.get_child_by_name (sms_contact.phone_number) == null) { if (stack.get_child_by_name (sms_contact.phone_number) == null) {
......
...@@ -28,20 +28,20 @@ namespace EOSConnect.Widgets { ...@@ -28,20 +28,20 @@ namespace EOSConnect.Widgets {
private const int SUB_MENU_SHARE_ID = 300; private const int SUB_MENU_SHARE_ID = 300;
private Device device; 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_battery;
private Dbusmenu.Menuitem sub_menu_item_telephony; private Dbusmenu.Menuitem sub_menu_item_telephony;
private Dbusmenu.Menuitem sub_menu_item_share; private Dbusmenu.Menuitem sub_menu_item_share;
construct { } construct { }
public DeviceMenuitem.with_device (Device device, SMSHistory sms_history_window) { public DeviceMenuitem.with_device (Device device, MainWindow main_window) {
Object ( Object (
id: device.device_num id: device.device_num
); );
this.device = device; this.device = device;
this.sms_history_window = sms_history_window; this.main_window = main_window;
property_set (Dbusmenu.MENUITEM_PROP_LABEL, device.custom_name); property_set (Dbusmenu.MENUITEM_PROP_LABEL, device.custom_name);
update_sub_menu_battery (); update_sub_menu_battery ();
update_sub_menu_telephony (); update_sub_menu_telephony ();
...@@ -81,8 +81,7 @@ namespace EOSConnect.Widgets { ...@@ -81,8 +81,7 @@ namespace EOSConnect.Widgets {
if (sub_menu_item_telephony == null) { if (sub_menu_item_telephony == null) {
sub_menu_item_telephony = new Dbusmenu.Menuitem.with_id (id + SUB_MENU_TELEPHONY_ID); sub_menu_item_telephony = new Dbusmenu.Menuitem.with_id (id + SUB_MENU_TELEPHONY_ID);
sub_menu_item_telephony.item_activated.connect (() => { sub_menu_item_telephony.item_activated.connect (() => {
main_window.main_stack.set_visible_child_name ("sms_history_view");
sms_history_window.open_sms_tab (device);
}); });
child_append (sub_menu_item_telephony); child_append (sub_menu_item_telephony);
} }
......
...@@ -108,8 +108,8 @@ namespace MConnect { ...@@ -108,8 +108,8 @@ namespace MConnect {
notification.set_body (notif_body); notification.set_body (notif_body);
if (event == "sms") { if (event == "sms") {
// Action defined in EOSConnect._init_sms_history_window () // Action defined in EOSConnect._init_sms_history_view ()
notification.set_default_action ("app.telephony-open-sms-window-reply"); notification.set_default_action ("app.telephony-open-sms-tab");
} }
if (set_notification_icon == true) { if (set_notification_icon == true) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment