9 class MainWindow < KDE::XmlGuiWindow
12 Theme = Struct.new(:pieces, :board, :layout)
14 def initialize(loader, game)
28 std_action :open_new do
31 std_action :quit, :slot => :close
32 regular_action :back, :icon => 'go-previous',
33 :text => KDE.i18n("&Back") do
36 regular_action :forward, :icon => 'go-next',
37 :text => KDE.i18n("&Forward") do
44 config = KDE::Global.config.group('themes')
47 theme.pieces = @loader.get_matching('Celtic', game,
48 (game.keywords || []) + ['pieces'], [], :shadow => true)
49 theme.board = @loader.get_matching(nil, game,
50 ['board'], game.keywords || [])
51 theme.layout = @loader.get_matching(nil, game,
52 ['layout'], game.keywords || [])
56 state = game.state.new.tap {|s| s.setup }
58 field = AnimationField.new(20)
59 @board = Board.new(scene, theme, game, state, field)
60 if game.respond_to? :pool
61 @pools = game.players.inject({}) do |res, player|
62 res[player] = Pool.new(scene, theme, game, field)
67 table = Table.new scene, theme, self,
71 self.central_widget = table
73 history = History.new(state)
74 controller = Controller.new(@board, history)