예제 #1
0
파일: Main.cs 프로젝트: sciaopin/bang-sharp
        public static void Main(string[] args)
        {
            if(!GLib.Thread.Supported)
                GLib.Thread.Init();

            Gdk.Threads.Init();

            Gdk.Threads.Enter();
            Application.Init();
            Catalog.Init("bang-sharp-client", "Locale");
            Utils.OpenClientChannel();
            MainWindow win = new MainWindow();
            win.Show();
            Application.Run();
            Gdk.Threads.Leave();
        }
예제 #2
0
        public PreferencesDialog(MainWindow parent)
        {
            TransientFor = parent;

            this.Build();

            autoHideSWWhilePlayingCheckbox.TooltipMarkup = Catalog.GetString("If checked, the Session Window automatically hides when the game starts and shows when the game ends.");
            animDelayEntry.TooltipMarkup = Catalog.GetString("Minimum time between rendering of frames of the game board. Decreasing this value may get you higher FPS, but it may also increase the CPU utilisation.");
            animDurationEntry.TooltipMarkup = Catalog.GetString("The default duration of animation (card movement, etc).");
            requestTimeoutEntry.TooltipMarkup = Catalog.GetString("The amount of time to wait for the server to return a response.");

            autoHideSWWhilePlayingCheckbox.Active = Config.Instance.GetBoolean("Client.AutoHideSWWhilePlaying", true);
            animDelayEntry.Value = Config.Instance.GetInteger("Client.AnimDelay", 100);
            animDurationEntry.Value = Config.Instance.GetInteger("Client.DefaultAnimDuration", 1000);
            requestTimeoutEntry.Value = Config.Instance.GetInteger("Client.RequestTimeout", 30000);
        }
예제 #3
0
        public ServerListWindow(MainWindow parent)
            : base(Gtk.WindowType.Toplevel)
        {
            TransientFor = parent;

            this.Build();
            this.connectButton.TooltipMarkup = Catalog.GetString("Connects to the selected server");
            this.addServerButton.TooltipMarkup = Catalog.GetString("Adds new server entry to the list");
            this.removeServerButton.TooltipMarkup = Catalog.GetString("Removes the selected entry from the list");

            serverStore = new Gtk.NodeStore(typeof(ServerNode));
            serverNodes = new List<ServerNode>();

            List<string> addresses = Config.Instance.GetStringList("ServerList.Addresses");
            List<int> ports = Config.Instance.GetIntegerList("ServerList.Ports");
            int count = Math.Min(addresses.Count, ports.Count);
            for(int i = 0; i < count; i++)
            {
                ServerNode node = new ServerNode(addresses[i], ports[i]);
                serverStore.AddNode(node);
                serverNodes.Add(node);
            }

            serverList.NodeStore = serverStore;

            Gtk.CellRendererText addressRenderer = new Gtk.CellRendererText();
            addressRenderer.Editable = true;
            addressRenderer.Edited += OnAddressEdited;
            Gtk.CellRendererText portRenderer = new Gtk.CellRendererText();
            portRenderer.Editable = true;
            portRenderer.Edited += OnPortEdited;
            serverList.AppendColumn(Catalog.GetString("Address"), addressRenderer, "text", 0);
            serverList.AppendColumn(Catalog.GetString("Port"), portRenderer, "text", 1);

            serverList.ShowExpanders = false;

            serverList.NodeSelection.Changed += OnServerSelectionChanged;
        }
예제 #4
0
 public EventListener(MainWindow parent)
 {
     this.parent = parent;
 }