summaryrefslogtreecommitdiffstats
path: root/src/gui/Ephraim.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Ephraim.vala')
-rw-r--r--src/gui/Ephraim.vala24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gui/Ephraim.vala b/src/gui/Ephraim.vala
index 5130247..9d3083c 100644
--- a/src/gui/Ephraim.vala
+++ b/src/gui/Ephraim.vala
@@ -4,16 +4,15 @@ public class Ephraim {
Gtk.Builder builder = new Gtk.Builder();
try {
- builder.add_from_file("ephraim.glade");
+ builder.add_objects_from_file("ephraim.glade", {"MainWindow"});
} catch(Error e) {
return 1;
}
Roster roster = new Roster();
- CoreConnector coreconn = new CoreConnector(roster);
+ CoreConnector coreconn = new CoreConnector();
- if(!coreconn.start())
- return 1;
+ coreconn.update_contact.connect(roster.update_contact);
unowned Gtk.Window window = builder.get_object("MainWindow") as Gtk.Window;
window.hide.connect(Gtk.main_quit);
@@ -24,6 +23,23 @@ public class Ephraim {
unowned Gtk.TreeView rosterView = builder.get_object("Roster") as Gtk.TreeView;
rosterView.set_model(roster);
+ Gee.TreeMap<string, Conversation> conversations = new Gee.TreeMap<string, Conversation>();
+ unowned Gtk.Notebook conversationNotebook = builder.get_object("Conversations") as Gtk.Notebook;
+
+ coreconn.new_conversation.connect((jid) => {
+ Contact contact = roster.get_contact(jid);
+
+ if(contact != null) {
+ conversations[jid] = new Conversation(conversationNotebook, jid, contact.display_string);
+ }
+ else {
+ conversations[jid] = new Conversation(conversationNotebook, jid, null);
+ }
+ });
+
+ if(!coreconn.start())
+ return 1;
+
rosterView.query_tooltip.connect((x, y, keyboard_tip, tooltip) => {
Gtk.TreeModel model;
Gtk.TreeIter iter;