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(); }
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); }
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; }
public EventListener(MainWindow parent) { this.parent = parent; }