Beispiel #1
0
                public override void Destroy ()
                {
#if ENABLE_AVAHI
                        if (browser != null) {
                                browser.Dispose ();
                                browser.HostFound -= OnHostFound;
                                browser.HostRemoved -= OnHostRemoved;
                                browser = null;
                        }
#endif 
                        base.Destroy ();
                }
Beispiel #2
0
                public AddHostDialog (Gtk.Window parent) : base (null, parent, DialogFlags.DestroyWithParent)
                {
                        Glade.XML gxml = new Glade.XML (null, "settings.glade", "add_host_dialog", null);
                        gxml.Autoconnect (this);
                        Raw = add_host_dialog.Handle;
                        
                        this.TransientFor = parent;

                        mdns_radio_button.Toggled += new EventHandler (OnRadioButtonToggled);
                        
                        // load the image to use for each node
                        unlocked_icon = Gtk.IconTheme.Default.LoadIcon ("gnome-fs-network", 
                                                                        48, (IconLookupFlags) 0);
                        locked_icon = Gtk.IconTheme.Default.LoadIcon ("gtk-dialog-authentication", 
                                                                      48, (IconLookupFlags) 0);
                        
                        CreateStore ();
                        icon_view.Model = store;
                        icon_view.TextColumn = COL_NAME;
                        icon_view.PixbufColumn = COL_PIXBUF;
                        icon_view.ColumnSpacing = 24;
                        icon_view.ItemActivated += new ItemActivatedHandler (OnItemActivated);
                        icon_view.GrabFocus ();

                        this.ShowAll ();

#if ENABLE_AVAHI
                        try {
                                browser = new AvahiBrowser ();
                                browser.HostFound += new AvahiEventHandler (OnHostFound);
                                browser.HostRemoved += new AvahiEventHandler (OnHostRemoved);
                                browser.Start ();
                        } catch (Exception e) {
                                //Console.Error.WriteLine ("Avahi Daemon must be unavailable. Hiding MDns stuff.");
                                static_radio_button.Toggle ();                                
                                icon_view.Visible = false;
                                mdns_radio_button.Visible = false;
                                static_radio_button.Visible = false;
                        }
#else
                                icon_view.Visible = false;
                                mdns_radio_button.Visible = false;
#endif  

			// FIXME Password for remote host is not yet implemented
			password_entry.Sensitive = false;
                }