[iagno] Added new game screen to select game mode and computer player level.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno] Added new game screen to select game mode and computer player level.
- Date: Wed, 24 Sep 2014 13:45:21 +0000 (UTC)
commit 32cb5165af8d0f5d1aea09addaf1f6d40dc2e680
Author: amishas157 <amishas157 gmail com>
Date: Wed Sep 24 02:58:54 2014 +0530
Added new game screen to select game mode and computer player level.
https://bugzilla.gnome.org/show_bug.cgi?id=664976
data/iagno-preferences.ui | 105 ------------
data/iagno.ui | 399 +++++++++++++++++++++++++++++++++++----------
src/iagno.vala | 158 +++++++++++++-----
3 files changed, 424 insertions(+), 238 deletions(-)
---
diff --git a/data/iagno-preferences.ui b/data/iagno-preferences.ui
index 5d217d1..799be9e 100644
--- a/data/iagno-preferences.ui
+++ b/data/iagno-preferences.ui
@@ -10,71 +10,6 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="label" translatable="yes">Game mode:</property>
- <property name="valign">center</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="width">1</property>
- <property name="height">1</property>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="mode-combo">
- <property name="visible">True</property>
- <property name="model">liststore-mode</property>
- <property name="id-column">1</property>
- <child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="width">1</property>
- <property name="height">1</property>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Computer:</property>
- <property name="valign">center</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="width">1</property>
- <property name="height">1</property>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="level-combo">
- <property name="visible">True</property>
- <property name="model">liststore-level</property>
- <child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="width">1</property>
- <property name="height">1</property>
- <property name="left-attach">1</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Tile set:</property>
<property name="use-underline">True</property>
<property name="valign">center</property>
@@ -121,46 +56,6 @@
</packing>
</child>
</object>
- <object class="GtkListStore" id="liststore-mode">
- <columns>
- <column type="gchararray"/>
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Play first (Dark)</col>
- <col id="1">first</col>
- </row>
- <row>
- <col id="0" translatable="yes">Play second (Light)</col>
- <col id="1">second</col>
- </row>
- <row>
- <col id="0" translatable="yes">Two players</col>
- <col id="1">two-players</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="liststore-level">
- <columns>
- <column type="gchararray"/>
- <column type="gint"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Level one</col>
- <col id="1">1</col>
- </row>
- <row>
- <col id="0" translatable="yes">Level two</col>
- <col id="1">2</col>
- </row>
- <row>
- <col id="0" translatable="yes">Level three</col>
- <col id="1">3</col>
- </row>
- </data>
- </object>
<object class="GtkListStore" id="liststore-theme">
<columns>
<column type="gchararray"/>
diff --git a/data/iagno.ui b/data/iagno.ui
index 9c73c1c..35cfa98 100644
--- a/data/iagno.ui
+++ b/data/iagno.ui
@@ -11,7 +11,7 @@
<property name="show_close_button">True</property>
<property name="title" translatable="yes">Iagno</property>
<child>
- <object class="GtkButton">
+ <object class="GtkButton" id="undo_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="valign">center</property>
@@ -31,133 +31,356 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkButton" id="back_button">
+ <property name="visible">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="tooltip-text" translatable="yes">Go back to the current game</property>
+ <property name="use_underline">True</property>
+ <property name="action-name">app.back</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="back_image">
+ <property name="icon_name">go-previous-symbolic</property>
+ <property name="visible">True</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
<child>
- <object class="GtkAspectFrame">
+ <object class="GtkStack" id="main_stack">
<property name="visible">True</property>
- <property name="shadow-type">GTK_SHADOW_NONE</property>
- <property name="obey-child">false</property>
- <property name="ratio">1.4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
+ <property name="homogeneous">True</property>
<child>
- <object class="GtkBox" id="game-box">
+ <object class="GtkBox" id="start-box">
+ <property name="orientation">vertical</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="homogeneous">True</property>
+ <property name="margin">0</property>
<property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="spacing">25</property>
+ <property name="width-request">350</property>
+ <property name="height-request">350</property>
<child>
- <placeholder/>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Game mode:</property>
+ <property name="valign">center</property>
+ <property name="halign">start</property>
+ </object>
</child>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="game-mode-box">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkGrid">
+ <object class="GtkRadioButton" id="play_dark">
<property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">Play _Dark</property>
<property name="halign">center</property>
- <property name="column-spacing">12</property>
- <property name="row-spacing">18</property>
- <property name="margin-end">12</property>
- <child>
- <object class="GtkImage" id="mark-icon-dark">
- <property name="resource">/org/gnome/iagno/images/mark.svg</property>
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage">
- <property name="resource">/org/gnome/iagno/images/dark.svg</property>
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="dark-score-label">
- <property name="visible">True</property>
- <property name="label">00</property>
- </object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="mark-icon-light">
- <property name="resource">/org/gnome/iagno/images/mark.svg</property>
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage">
- <property name="resource">/org/gnome/iagno/images/light.svg</property>
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="light-score-label">
- <property name="visible">True</property>
- <property name="label">00</property>
- </object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
+ <property name="valign">center</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
</object>
<packing>
- <property name="pack-type">start</property>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">6</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkButton">
+ <object class="GtkRadioButton" id="play_light">
<property name="visible">True</property>
<property name="use_underline">True</property>
- <property name="label" translatable="yes">_Start Over</property>
+ <property name="label" translatable="yes">Play _Light</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="action-name">app.new-game</property>
- <property name="tooltip-text" translatable="yes">Start a new game</property>
<property name="width-request">120</property>
<property name="height-request">60</property>
+ <property name="group">play_dark</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
</object>
<packing>
- <property name="pack-type">end</property>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="padding">0</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="two_players">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Two Players</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ <property name="group">play_dark</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Computer Player:</property>
+ <property name="valign">center</property>
+ <property name="halign">start</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="level-box">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkRadioButton" id="easy">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Easy</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkRadioButton" id="medium">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Medium</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ <property name="group">easy</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hard">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Hard</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ <property name="group">easy</property>
+ <property name="draw-indicator">False</property>
+ <style>
+ <class name="button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_Start Game</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="action-name">app.start-game</property>
+ <property name="tooltip-text" translatable="yes">Start a game</property>
+ <property name="width-request">222</property>
+ <property name="height-request">60</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
</object>
<packing>
<property name="pack-type">end</property>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
<property name="padding">0</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="name">start-box</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAspectFrame" id="frame">
+ <property name="visible">True</property>
+ <property name="shadow-type">GTK_SHADOW_NONE</property>
+ <property name="obey-child">false</property>
+ <property name="ratio">1.4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <child>
+ <object class="GtkBox" id="game-box">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">25</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <property name="column-spacing">12</property>
+ <property name="row-spacing">18</property>
+ <property name="margin-end">12</property>
+ <child>
+ <object class="GtkImage" id="mark-icon-dark">
+ <property name="resource">/org/gnome/iagno/images/mark.svg</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage">
+ <property name="resource">/org/gnome/iagno/images/dark.svg</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="dark-score-label">
+ <property name="visible">True</property>
+ <property name="label">00</property>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="mark-icon-light">
+ <property name="resource">/org/gnome/iagno/images/mark.svg</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage">
+ <property name="resource">/org/gnome/iagno/images/light.svg</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="light-score-label">
+ <property name="visible">True</property>
+ <property name="label">00</property>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">start</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">_New Game</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="action-name">app.new-game</property>
+ <property name="tooltip-text" translatable="yes">Start a new game</property>
+ <property name="width-request">120</property>
+ <property name="height-request">60</property>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">0</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">frame</property>
+ </packing>
</child>
</object>
</child>
diff --git a/src/iagno.vala b/src/iagno.vala
index 758c70c..c158dee 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -35,6 +35,20 @@ public class Iagno : Gtk.Application
private Gtk.Label dark_score_label;
private Gtk.Label light_score_label;
private Gtk.Dialog propbox;
+ private Gtk.Stack main_stack;
+ private Gtk.Box game_box;
+
+ private Gtk.Button back_button;
+ private Gtk.Button undo_button;
+ private Gtk.RadioButton play_dark_button;
+ private Gtk.RadioButton play_light_button;
+ private Gtk.RadioButton two_players_button;
+ private Gtk.RadioButton easy_button;
+ private Gtk.RadioButton medium_button;
+ private Gtk.RadioButton hard_button;
+
+ private SimpleAction back_action;
+
/* Computer player (if there is one) */
private ComputerPlayer? computer = null;
@@ -62,8 +76,10 @@ public class Iagno : Gtk.Application
private const GLib.ActionEntry app_actions[] =
{
{"new-game", new_game_cb},
+ {"start-game", start_game_cb},
{"undo-move", undo_move_cb},
{"preferences", preferences_cb},
+ {"back", back_cb},
{"help", help_cb},
{"about", about_cb},
{"quit", quit_cb}
@@ -159,16 +175,73 @@ public class Iagno : Gtk.Application
view.halign = Gtk.Align.FILL;
view.show ();
- var game_box = builder.get_object ("game-box") as Gtk.Box;
- game_box.pack_start (view, true, true, 0);
+ game_box = builder.get_object ("game-box") as Gtk.Box;
+ game_box.pack_start (view);
headerbar = builder.get_object ("headerbar") as Gtk.HeaderBar;
light_score_label = builder.get_object ("light-score-label") as Gtk.Label;
dark_score_label = builder.get_object ("dark-score-label") as Gtk.Label;
mark_icon_dark = builder.get_object ("mark-icon-dark") as Gtk.Image;
mark_icon_light = builder.get_object ("mark-icon-light") as Gtk.Image;
+ main_stack = builder.get_object ("main_stack") as Gtk.Stack;
+ back_button = builder.get_object ("back_button") as Gtk.Button;
+ undo_button = builder.get_object ("undo_button") as Gtk.Button;
+ play_dark_button = builder.get_object ("play_dark") as Gtk.RadioButton;
+ play_light_button = builder.get_object ("play_light") as Gtk.RadioButton;
+ two_players_button = builder.get_object ("two_players") as Gtk.RadioButton;
+ play_dark_button.toggled.connect (play_dark_button_toggled_cb);
+ play_light_button.toggled.connect (play_light_button_toggled_cb);
+ two_players_button.toggled.connect (two_players_button_toggled_cb);
+ easy_button = builder.get_object ("easy") as Gtk.RadioButton;
+ medium_button = builder.get_object ("medium") as Gtk.RadioButton;
+ hard_button = builder.get_object ("hard") as Gtk.RadioButton;
+ easy_button.toggled.connect (easy_button_toggled_cb);
+ medium_button.toggled.connect (medium_button_toggled_cb);
+ hard_button.toggled.connect (hard_button_toggled_cb);
+
+ play_dark_button.set_active (true);
+ easy_button.set_active (true);
+
+ back_action = (SimpleAction) lookup_action ("back");
+
+ var level_box = builder.get_object ("level-box") as Gtk.Box;
- start_game ();
+ settings.changed["play-as"].connect (() => {
+ var mode = settings.get_string ("play-as");
+ level_box.sensitive = (mode == "two-players") ? false : true;
+ });
+
+ show_new_game_screen ();
+ }
+
+ private void play_light_button_toggled_cb ()
+ {
+ settings.set_string ("play-as", "second");
+ }
+
+ private void play_dark_button_toggled_cb ()
+ {
+ settings.set_string ("play-as", "first");
+ }
+
+ private void two_players_button_toggled_cb ()
+ {
+ settings.set_string ("play-as", "two-players");
+ }
+
+ private void easy_button_toggled_cb ()
+ {
+ settings.set_int ("computer-level", 1);
+ }
+
+ private void medium_button_toggled_cb ()
+ {
+ settings.set_int ("computer-level", 2);
+ }
+
+ private void hard_button_toggled_cb ()
+ {
+ settings.set_int ("computer-level", 3);
}
protected override void activate ()
@@ -211,11 +284,40 @@ public class Iagno : Gtk.Application
window.destroy ();
}
- private void new_game_cb ()
+ private void start_game_cb ()
{
+ back_button.visible = false;
start_game ();
}
+ private void back_cb ()
+ {
+ show_game_board ();
+ back_action.set_enabled (false);
+ }
+
+ private void show_game_board ()
+ {
+ main_stack.set_visible_child_name ("frame");
+ back_button.visible = false;
+ undo_button.visible = true;
+ }
+
+ private void show_new_game_screen ()
+ {
+ main_stack.set_visible_child_name ("start-box");
+ back_button.sensitive = game != null;
+ back_button.visible = true;
+ undo_button.visible = false;
+ back_action.set_enabled (true);
+ }
+
+ private void new_game_cb ()
+ {
+ show_new_game_screen ();
+ headerbar.set_subtitle (null);
+ }
+
private void start_game ()
{
if (game != null)
@@ -224,10 +326,17 @@ public class Iagno : Gtk.Application
if (computer != null)
computer.cancel_move ();
+ if (view != null)
+ game_box.remove (view);
+
+ show_game_board ();
+
game = new Game (size);
game.move.connect (game_move_cb);
game.complete.connect (game_complete_cb);
view.game = game;
+ view.show ();
+ game_box.pack_start (view);
var mode = settings.get_string ("play-as");
if (mode == "two-players")
@@ -253,9 +362,6 @@ public class Iagno : Gtk.Application
else
undo_action.set_enabled (game.number_of_moves >= 2);
- var new_game_action = (SimpleAction) lookup_action ("new-game");
- new_game_action.set_enabled (game.number_of_moves >= 1);
-
/* Translators: this is a 2 digit representation of the current score. */
dark_score_label.set_markup ("<span font_weight='bold'>"+(_("%.2d").printf
(game.n_dark_tiles))+"</span>");
light_score_label.set_markup ("<span font_weight='bold'>"+(_("%.2d").printf
(game.n_light_tiles))+"</span>");
@@ -420,25 +526,6 @@ public class Iagno : Gtk.Application
}
}
- private void computer_level_changed_cb (Gtk.ComboBox combo)
- {
- Gtk.TreeIter iter;
- combo.get_active_iter (out iter);
- int level;
- combo.model.get (iter, 1, out level);
- settings.set_int ("computer-level", level);
- }
-
- private void mode_changed_cb (Gtk.ComboBox combo, Gtk.ComboBox level_combo)
- {
- Gtk.TreeIter iter;
- combo.get_active_iter (out iter);
- string mode;
- combo.model.get (iter, 1, out mode);
- settings.set_string ("play-as", mode);
- level_combo.sensitive = (mode == "two-players") ? false : true;
- }
-
private void sound_select (Gtk.ToggleButton widget)
{
var play_sounds = widget.get_active ();
@@ -479,25 +566,6 @@ public class Iagno : Gtk.Application
var grid = builder.get_object ("main-grid") as Gtk.Grid;
box.pack_start (grid, true, true, 0);
- var combo = builder.get_object ("mode-combo") as Gtk.ComboBox;
- var level_combo = builder.get_object ("level-combo") as Gtk.ComboBox;
-
- combo.changed.connect (() => mode_changed_cb (combo, level_combo));
- settings.changed["play-as"].connect (() => {
- var mode = settings.get_string ("play-as");
- combo.set_active_id (mode);
- level_combo.sensitive = (mode == "two-players") ? false : true;
- });
- var mode = settings.get_string ("play-as");
- combo.set_active_id (mode);
- level_combo.sensitive = (mode == "two-players") ? false : true;
-
- level_combo.changed.connect (computer_level_changed_cb);
- settings.changed["computer-level"].connect (() => {
- level_combo.set_active (settings.get_int ("computer-level") - 1);
- });
- level_combo.set_active (settings.get_int ("computer-level") - 1);
-
var theme_combo = builder.get_object ("theme-combo") as Gtk.ComboBox;
var model = builder.get_object ("liststore-theme") as Gtk.ListStore;
Dir dir;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]