예제 #1
0
        public void init()
        {
            /* Make Our Connection!*/
            Glade.XML gxml = new Glade.XML (SupportFileLoader.locateGameFile("gpremacy_gui/gpremacy_gui.glade"), "GameSetup", null);
            gxml.Autoconnect (this);

            GameSetup.Modal = true;
            GameSetup.TransientFor = MainWindow;

            GameSetup.DeleteEvent += on_GameSetup_delete_event;
            GameSetupSingleStart.Clicked += on_GameSetupSingleStart_clicked;
            GameSetupConnectButton.Clicked += on_GameSetupConnectButton_clicked;
            GameSetupMultiStart.Clicked += on_GameSetupMultiStart_clicked;

            GameSetupRadioClient.Toggled += on_MultiRadio_changed;
            GameSetupRadioServer.Toggled += on_MultiRadio_changed;

            GameSetupPortLabel.Text += "(normally " + Game.DefaultPort.ToString();

            GameSetupMultiStart.Sensitive = false;

            populatePlayers(GameSetupSingleCountryTable);
            populatePlayers(GameSetupCountryTable);
            /* Turn off the AI buttons */
            setSensitiveAIButtons(GameSetupCountryTable, false);

            on_MultiRadio_changed(null, null); /* Fake event */

            // Create a timer that waits one second, then invokes every second.
            UpdateStatusTimer = new Timer(new TimerCallback(updateStatus), null, 1000, 1000);
            UpdateStatusTimer.ToString(); // Shut UP, you damn warning!

            GameSetupEntryIP.Text = "192.168.1.150";
        }