~l-admin-3/evnc/automatic-cleanup-branch

« back to all changes in this revision

Viewing changes to src/Widgets/Notebook.vala

  • Committer: Marcus Wichelmann
  • Date: 2015-07-09 18:17:05 UTC
  • Revision ID: marcus.wichelmann@hotmail.de-20150709181705-aliu5vv3gvha1p0a
Automatic code cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
*/
18
18
 
19
19
namespace evnc.Widgets {
20
 
        public class Notebook : Granite.Widgets.DynamicNotebook {
21
 
                public signal void on_connection_message (Gtk.MessageType info_type, string info_message);
22
 
 
23
 
                public Notebook () {
24
 
                        this.allow_drag = true;
25
 
                        this.show_all ();
26
 
                        this.tab_removed.connect ((tab) => {
27
 
                                (tab as Widgets.VncConnection).display.close ();
28
 
                        });
29
 
                }
30
 
 
31
 
                public void add_connection (string host, string port, string user) {
32
 
                        var connection = new Widgets.VncConnection (host, port, user);
33
 
                        connection.display.vnc_auth_failure.connect (() => {
34
 
                                on_connection_message (Gtk.MessageType.ERROR, _("Authentification failed. Wrong username or password?"));
35
 
                        });
36
 
                        connection.display.vnc_auth_unsupported.connect (() => {
37
 
                                on_connection_message (Gtk.MessageType.ERROR, _("Authentification not supported!"));
38
 
                        });
39
 
                        connection.on_save_screenshot_exception.connect ((message) => {
40
 
                                on_connection_message (Gtk.MessageType.ERROR, message);
41
 
                        });
42
 
 
43
 
                        this.insert_tab (connection, -1 );
44
 
                        this.current = connection;
45
 
                }
46
 
        }
 
20
    public class Notebook : Granite.Widgets.DynamicNotebook {
 
21
        public signal void on_connection_message (Gtk.MessageType info_type, string info_message);
 
22
 
 
23
        public Notebook () {
 
24
            this.allow_drag = true;
 
25
            this.show_all ();
 
26
            this.tab_removed.connect ((tab) => {
 
27
                (tab as Widgets.VncConnection).display.close ();
 
28
            });
 
29
        }
 
30
 
 
31
        public void add_connection (string host, string port, string user) {
 
32
            var connection = new Widgets.VncConnection (host, port, user);
 
33
            connection.display.vnc_auth_failure.connect (() => {
 
34
                on_connection_message (Gtk.MessageType.ERROR, _ ("Authentification failed. Wrong username or password?"));
 
35
            });
 
36
            connection.display.vnc_auth_unsupported.connect (() => {
 
37
                on_connection_message (Gtk.MessageType.ERROR, _ ("Authentification not supported!"));
 
38
            });
 
39
            connection.on_save_screenshot_exception.connect ((message) => {
 
40
                on_connection_message (Gtk.MessageType.ERROR, message);
 
41
            });
 
42
 
 
43
            this.insert_tab (connection, -1 );
 
44
            this.current = connection;
 
45
        }
 
46
    }
47
47
}
 
 
b'\\ No newline at end of file'