~julien-spautz/cable/new-folder-layout

« back to all changes in this revision

Viewing changes to src/Widgets/Window.vala

  • Committer: Julien Spautz
  • Date: 2013-09-23 16:09:58 UTC
  • mfrom: (137.2.9 pm)
  • Revision ID: spautz.julien@gmail.com-20130923160958-xp2xk4525213cz5c
Implemented basic private messaging capabilities:

- Open private chat by double-cklicking a user name
- Close a private chat in the same way you close a channel
- Automatically open new private chat when a /msg has been received
- Do not allow to start a private chat with yourself

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    /**
113
113
     * Get the currently selected channel.
114
114
     */
115
 
    public View.Channel? current_channel {
116
 
        get { return server_list.selected as View.Channel; }
117
 
        set { server_list.selected = value as Widgets.Channel; }
 
115
    public View.Chat? current_chat {
 
116
        get { return server_list.selected as View.Chat; }
 
117
        set { server_list.selected = value as Widgets.Chat; }
118
118
    }
119
119
 
120
120
    //public signal void edit_identity ();
126
126
 
127
127
        server_list.item_selected.connect ((item) => {
128
128
            if (item != null) {
129
 
                display_widget = (current_channel as Widgets.Channel).room;
130
 
                selected (current_channel);
 
129
                display_widget = (current_chat as Widgets.Chat).room;
 
130
                selected (current_chat);
131
131
            }
132
132
        });
133
133