gnome-games r9006 - in trunk/glchess: . data glade src/lib src/lib/gtkui
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r9006 - in trunk/glchess: . data glade src/lib src/lib/gtkui
- Date: Tue, 7 Apr 2009 10:48:48 +0000 (UTC)
Author: rancell
Date: Tue Apr 7 10:48:48 2009
New Revision: 9006
URL: http://svn.gnome.org/viewvc/gnome-games?rev=9006&view=rev
Log:
Replace libglade with GtkBuilder (Robert Ancell, Bug #556808)
Added:
trunk/glchess/data/chess_view.ui
trunk/glchess/data/glchess.ui
trunk/glchess/data/load_game.ui
trunk/glchess/data/log.ui
trunk/glchess/data/network_game.ui
trunk/glchess/data/network_new_server.ui
trunk/glchess/data/new_game.ui
trunk/glchess/data/preferences.ui
trunk/glchess/data/save_game.ui
Removed:
trunk/glchess/glade/
Modified:
trunk/glchess/Makefile.am
trunk/glchess/data/Makefile.am
trunk/glchess/src/lib/defaults.py.in
trunk/glchess/src/lib/gtkui/chessview.py
trunk/glchess/src/lib/gtkui/dialogs.py
trunk/glchess/src/lib/gtkui/gtkui.py
trunk/glchess/src/lib/gtkui/log.py
trunk/glchess/src/lib/gtkui/network.py
Modified: trunk/glchess/Makefile.am
==============================================================================
--- trunk/glchess/Makefile.am (original)
+++ trunk/glchess/Makefile.am Tue Apr 7 10:48:48 2009
@@ -1,4 +1,4 @@
-SUBDIRS = data glade help src textures
+SUBDIRS = data help src textures
desktopdir = $(datadir)/applications
desktop_in_files = glchess.desktop.in.in
Modified: trunk/glchess/data/Makefile.am
==============================================================================
--- trunk/glchess/data/Makefile.am (original)
+++ trunk/glchess/data/Makefile.am Tue Apr 7 10:48:48 2009
@@ -1,3 +1,15 @@
+uidir = $(datadir)/glchess
+ui_DATA = \
+ chess_view.ui \
+ glchess.ui \
+ load_game.ui \
+ log.ui \
+ new_game.ui \
+ network_game.ui \
+ network_new_server.ui \
+ preferences.ui \
+ save_game.ui
+
schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_in_files = glchess.schemas.in
schema_DATA = $(schema_in_files:.schemas.in=.schemas)
@@ -7,4 +19,5 @@
aidir = $(datadir)/glchess/
ai_DATA = ai.xml
+EXTRA_DIST = $(ui_DATA)
DISTCLEANFILES = $(schema_DATA)
Added: trunk/glchess/data/chess_view.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/chess_view.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,212 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkTextBuffer" id="textbuffer1"/>
+ <object class="GtkTextBuffer" id="textbuffer2"/>
+ <object class="GtkVPaned" id="chess_view">
+ <property name="can_focus">True</property>
+ <property name="orientation">vertical</property>
+ <property name="position">300</property>
+ <property name="position_set">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox22">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkTable" id="info_panel">
+ <property name="border_width">6</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="icon_name">gtk-dialog-info</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="panel_title_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><b>Title</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkToggleButton" id="comment_edit_toggle">
+ <property name="label">gtk-edit</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <signal name="toggled" handler="_on_comment_edit_button_toggled"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="info_ok_button">
+ <property name="label">gtk-ok</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="comment_notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_border">False</property>
+ <child>
+ <object class="GtkLabel" id="panel_description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label">Sub description</property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="tab_expand">True</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label">(message tab)</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTextView" id="comment_text">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ <property name="buffer">textbuffer2</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_expand">True</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label">(comment tab)</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="view_container">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox21">
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="message_text">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="cursor_visible">False</property>
+ <property name="buffer">textbuffer1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="message_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+</interface>
Added: trunk/glchess/data/glchess.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/glchess.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,557 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkWindow" id="glchess_app">
+ <property name="title">glChess</property>
+ <property name="default_width">400</property>
+ <accel-groups>
+ <group name="accelgroup1"/>
+ </accel-groups>
+ <signal name="focus_in_event" handler="_on_focus_changed" after="yes"/>
+ <signal name="configure_event" handler="_on_resize"/>
+ <signal name="delete_event" handler="_on_close_window"/>
+ <signal name="window_state_event" handler="_on_window_state_changed"/>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkMenuItem" id="menuitem1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Game</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menuitem1_menu">
+ <child>
+ <object class="GtkImageMenuItem" id="new1">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_new_game_button_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="open1">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_open_game_button_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_save_item">
+ <property name="label">gtk-save</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_save_game_button_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_save_as_item">
+ <property name="label">gtk-save-as</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_save_as_game_button_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator1">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_play_online_item">
+ <property name="label">Network _Game</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <accelerator key="L" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ <signal name="activate" handler="_on_join_game_button_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separator2">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_undo_move">
+ <property name="label">_Undo Move</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <accelerator key="Z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ <signal name="activate" handler="_on_undo_move_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_resign">
+ <property name="label">_Resign</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_resign_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_claim_draw">
+ <property name="label">Claim _Draw</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_claim_draw_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="quit1">
+ <property name="label">gtk-quit</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_menu_quit"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="menuitem3_menu">
+ <child>
+ <object class="GtkImageMenuItem" id="menu_fullscreen">
+ <property name="label">_Fullscreen</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <accelerator key="F11" signal="activate"/>
+ <signal name="activate" handler="_on_view_fullscreen_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="menu_leave_fullscreen">
+ <property name="label">Leave _Fullscreen</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <accelerator key="F11" signal="activate"/>
+ <signal name="activate" handler="_on_view_unfullscreen_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="menu_view_3d">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">3_D Chess View</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="_on_toggle_3d_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckMenuItem" id="menu_view_logs">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show _Logs</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="_on_show_logs_clicked"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="settings">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Settings</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="settings_menu">
+ <child>
+ <object class="GtkImageMenuItem" id="preferences">
+ <property name="label">gtk-preferences</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_preferences_clicked"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="help2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu" id="help2_menu">
+ <child>
+ <object class="GtkImageMenuItem" id="menu_help">
+ <property name="label">_Contents</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_help_clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImageMenuItem" id="about2">
+ <property name="label">gtk-about</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <property name="accel_group">accelgroup1</property>
+ <signal name="activate" handler="_on_about_clicked"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="toolbar">
+ <property name="visible">True</property>
+ <property name="toolbar_style">both</property>
+ <child>
+ <object class="GtkToolButton" id="new_game_button">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Start a new game</property>
+ <property name="label" translatable="yes" comments="The New Game toolbar button">New Game</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-new</property>
+ <signal name="clicked" handler="_on_new_game_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="play_online_button">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Start a new multiplayer network game</property>
+ <property name="visible_vertical">False</property>
+ <property name="label" translatable="yes" comments="The Network Game toolbar button">Network _Game</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-network</property>
+ <signal name="clicked" handler="_on_join_game_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="toolbutton1">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">Load a saved game</property>
+ <property name="stock_id">gtk-open</property>
+ <signal name="clicked" handler="_on_open_game_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="save_game_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="tooltip_text" translatable="yes">Save the current game</property>
+ <property name="stock_id">gtk-save</property>
+ <signal name="clicked" handler="_on_save_game_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="undo_move_button">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Undo Move</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-undo</property>
+ <signal name="clicked" handler="_on_undo_move_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="resign_button">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="The tooltip for the Resign toolbar button">Resign</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-dialog-warning</property>
+ <signal name="clicked" handler="_on_resign_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox11">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkViewport" id="game_viewport">
+ <property name="width_request">300</property>
+ <property name="height_request">300</property>
+ <property name="visible">True</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="navigation_box">
+ <property name="sensitive">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="left_nav_box">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="first_move_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Rewind to the game start</property>
+ <signal name="clicked" handler="_on_history_start_clicked"/>
+ <child>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-goto-first</property>
+ <property name="icon-size">4</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="prev_move_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show the previous move</property>
+ <signal name="clicked" handler="_on_history_previous_clicked"/>
+ <child>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-back</property>
+ <property name="icon-size">4</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="next_move_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show the next move</property>
+ <signal name="clicked" handler="_on_history_next_clicked"/>
+ <child>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-forward</property>
+ <property name="icon-size">4</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="last_move_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show the current move</property>
+ <signal name="clicked" handler="_on_history_latest_clicked"/>
+ <child>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-goto-last</property>
+ <property name="icon-size">4</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="history_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_history_combo_changed"/>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="right_nav_box">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkDrawingArea" id="white_time_label">
+ <property name="width_request">20</property>
+ <property name="visible">True</property>
+ <signal name="expose_event" handler="_on_white_time_paint"/>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="black_time_label">
+ <property name="width_request">20</property>
+ <property name="visible">True</property>
+ <signal name="expose_event" handler="_on_black_time_paint"/>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkWindow" id="log_window">
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes" comments="The title of the log dialaog">Logs</property>
+ <property name="default_width">600</property>
+ <property name="default_height">400</property>
+ <signal name="delete_event" handler="_on_log_window_delete_event"/>
+ <child>
+ <object class="GtkNotebook" id="log_notebook">
+ <property name="visible">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <property name="scrollable">True</property>
+ <child>
+ <object class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image13">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label57">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Message displayed in log window when no logs are present">There are no active logs.</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label51">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkAccelGroup" id="accelgroup1"/>
+</interface>
Added: trunk/glchess/data/load_game.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/load_game.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="game_load_dialog">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes" comments="Title of load game dialog">Load Chess Game</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="_on_response"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkTable" id="error_box">
+ <property name="border_width">6</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="icon_name">gtk-dialog-warning</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="error_title_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><big><b>Error Title</b></big></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="error_description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label"><i>Error Description</i></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFileChooserWidget" id="filechooserwidget">
+ <property name="width_request">600</property>
+ <property name="height_request">400</property>
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <signal name="file_activated" handler="_on_file_activated"/>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button6">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="_on_close"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="properties_button">
+ <property name="label">gtk-properties</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="open_button">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">button6</action-widget>
+ <action-widget response="-8">properties_button</action-widget>
+ <action-widget response="-5">open_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Added: trunk/glchess/data/log.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/log.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkTextBuffer" id="textbuffer1"/>
+ <object class="GtkTable" id="log_table">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label52">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Log window: Label before name of executable being logged">Executable:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="executable_label">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="xalign">0</property>
+ <property name="label">(executable name)</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label55">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Log window: Label before name of player being logged">Playing as:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="game_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">(player in game)</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="comms_scrolled_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="comms_textview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="buffer">textbuffer1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label58">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Log window: Title above data being logged">Communication:</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+</interface>
Added: trunk/glchess/data/network_game.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/network_game.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,516 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="network_game_dialog">
+ <property name="title" translatable="yes" comments="Title of network game dialog">Join Game</property>
+ <property name="default_width">600</property>
+ <property name="default_height">500</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="_on_response"/>
+ <signal name="delete_event" handler="_on_delete"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkTable" id="info_panel">
+ <property name="border_width">12</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_panel_title">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><big><b>Error Title</b></big></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_panel_description">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label"><i>Error description</i></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="throbber_image">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Network Game Dialog: Label before the server profile combo box">_Profile:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">server_combo</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="server_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_server_combo_changed"/>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button2">
+ <property name="label">gtk-properties</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Network Game Dialog: Title above the server settings. Do not translate the <b> tag."><b>Server</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="controls_box">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="room_frame">
+ <property name="height_request">200</property>
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="room_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="room_list">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="room_button_box">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="table_join_button">
+ <property name="label" translatable="yes" comments="Network Game Dialog: Button to join a table">_Join</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="_on_table_join_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="table_new_button">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="_on_table_new_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow5">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="table_list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Network Game Dialog: Title above room list. Do not translate the <b> tag."><b>Rooms</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="game_frame">
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table6">
+ <property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow6">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="seat_list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="game_name_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">(game name)</property>
+ </object>
+ <packing>
+ <property name="y_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox2">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button3">
+ <property name="label" translatable="yes" comments="Network Game Dialog: Leave table button">_Leave</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="_on_table_leave_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Network Game Dialog: Title above the game settings. Do not translate the <b> tag."><b>Game</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="chat_frame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table4">
+ <property name="visible">True</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkScrolledWindow" id="chat_scroll_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="window_placement">bottom-left</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="chat_textview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="cursor_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="chat_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="activate" handler="_on_chat_entry_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="player_list">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Network Game Dialog: Title above the chat text. Do not translate the <b> tag."><b>Status/_Chat</b></property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">chat_entry</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">button1</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Added: trunk/glchess/data/network_new_server.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/network_new_server.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,214 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkDialog" id="add_account_dialog">
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">Add Account</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="_on_response"/>
+ <signal name="delete_event" handler="_on_delete"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkTable" id="table8">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Add Network Profile Dialog: Label beside username entry">User _Name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">username_entry</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="username_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="changed" handler="_on_input_changed"/>
+ <signal name="activate" handler="_on_username_activate"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Add Network Profile Dialog: Label beside server combo">_Server:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="server_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_server_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="custom_server_table">
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Add Network Profile Dialog: Label beside custom hostname entry">_Host:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">host_entry</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Add Network Profile Dialog: Label beside custom port entry">_Port:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">port_spin</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="host_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <signal name="changed" handler="_on_input_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="port_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button7">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="add_button">
+ <property name="label" translatable="yes" comments="Add Network Profile Dialog: Button to accept values and add profile">_Add Account</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">button7</action-widget>
+ <action-widget response="-5">add_button</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="value">1</property>
+ <property name="lower">1</property>
+ <property name="upper">65535</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+</interface>
Added: trunk/glchess/data/new_game.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/new_game.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,460 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="new_game_dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes" comments="Title of the new game dialog">New Game</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="_on_response"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkTable" id="info_box">
+ <property name="border_width">6</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="icon_name">gtk-dialog-info</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_title_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><big><b>Title</b></big></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><i>Description</i></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="frame3">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label60">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Title above the game properties widgets"><b>Game Properties</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before the game name entry">_Game name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">game_name_entry</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="game_name_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Enter the title for this game</property>
+ <property name="width_chars">25</property>
+ <signal name="changed" handler="_on_game_name_edited"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before game timer settings">Move _Time:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">time_combo</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="time_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_time_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="custom_time_box">
+ <property name="left_padding">18</property>
+ <child>
+ <object class="GtkHBox" id="hbox22">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkSpinButton" id="custom_time_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="custom_time_units_combo">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="frame1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label58">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Title above player options"><b>Players</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="white_ai_properties_table">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before black player combo box">_Black:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">black_type_combo</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before white player combo box">_White:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">white_type_combo</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="white_type_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_properties_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="black_type_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_properties_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="frame2">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label59">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Title above difficulty options"><b>Difficulty</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="black_ai_properties_table">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before white player difficulty">W_hite:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">white_difficulty_combo</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="New Game Dialog: Label before black player difficulty">B_lack:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">black_difficulty_combo</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="white_difficulty_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_properties_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="black_difficulty_combo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="_on_properties_changed"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="start_button">
+ <property name="label" translatable="yes" comments="New Game Dialog: Button to start a new game">_Start</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Start the game. The game can be started once all fields are complete</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton1</action-widget>
+ <action-widget response="-5">start_button</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="value">1</property>
+ <property name="upper">300</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+</interface>
Added: trunk/glchess/data/preferences.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/preferences.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,335 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="preferences">
+ <property name="title" translatable="yes" comments="Title for preferences dialog">Preferences</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">dialog</property>
+ <signal name="response" handler="_on_response"/>
+ <signal name="delete_event" handler="_on_delete"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkTable" id="game_table">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">5</property>
+ <property name="row_spacing">5</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="board_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before board orientation combo box">Board Orientation:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="format_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before move format combo box">Move Format:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before promotion type combo box">Promotion Type:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="board_combo">
+ <property name="visible">True</property>
+ <property name="model">liststore3</property>
+ <signal name="changed" handler="_on_board_combo_changed"/>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext3"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="move_format_combo">
+ <property name="visible">True</property>
+ <property name="model">liststore2</property>
+ <signal name="changed" handler="_on_move_format_combo_changed"/>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext2"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="promotion_type_combo">
+ <property name="visible">True</property>
+ <property name="model">liststore1</property>
+ <signal name="changed" handler="_on_promotion_type_combo_changed"/>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="game_label">
+ <property name="visible">True</property>
+ <property name="xalign">0.4699999988079071</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Title of game options tab">_Game</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="view_box">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <child>
+ <object class="GtkCheckButton" id="show_3d">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if 3D view is available">3_D Chess View</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">View the chess board by default in 2D mode, or optionally in 3D mode using OpenGL.</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_3d_view_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label"> </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_3d_smooth">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if the 3D view is smoothed (anti-aliased)">_Smooth Display</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Smooth edges of the 3D elements (anti-alias)</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_3d_smooth_toggled"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_toolbar">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if toolbar is visible">Show _Toolbar</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show or hide the toolbar</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_show_toolbar_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_history">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if history browser is visible">Show _History</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show or hide the game history panel</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_show_history_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_move_hints">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if move hints are visible">_Move Hints</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Shows hints during chess games</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_move_hints_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_numbering">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box for selecting if board numbering is visible">_Board Numbering</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Show or hide numbering on the chess board</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="_on_board_numbering_activate"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="view_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Title of view options tab">_View</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="closebutton1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">closebutton1</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name item text -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkListStore" id="liststore2">
+ <columns>
+ <!-- column-name item text -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkListStore" id="liststore3">
+ <columns>
+ <!-- column-name item text -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+</interface>
Added: trunk/glchess/data/save_game.ui
==============================================================================
--- (empty file)
+++ trunk/glchess/data/save_game.ui Tue Apr 7 10:48:48 2009
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="save_dialog">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes" comments="Title of save game dialog">Save Chess Game</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <signal name="response" handler="_on_response"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="spacing">24</property>
+ <child>
+ <object class="GtkTable" id="error_box">
+ <property name="border_width">6</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="icon_name">gtk-dialog-warning</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="error_title_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><big><b>Error Title</b></big></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="error_description_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label"><i>Error description</i></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFileChooserWidget" id="filechooser">
+ <property name="visible">True</property>
+ <property name="action">save</property>
+ <signal name="file_activated" handler="_on_file_activated"/>
+ <signal name="selection_changed" handler="_on_file_changed"/>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="okbutton1">
+ <property name="label">gtk-save</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton1</action-widget>
+ <action-widget response="-5">okbutton1</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Modified: trunk/glchess/src/lib/defaults.py.in
==============================================================================
--- trunk/glchess/src/lib/defaults.py.in (original)
+++ trunk/glchess/src/lib/defaults.py.in Tue Apr 7 10:48:48 2009
@@ -15,7 +15,7 @@
APP_DATA_DIR = os.path.join('@prefix@', 'share')
ICON_DIR = os.path.join(APP_DATA_DIR, 'pixmaps')
TEXTURE_DIR = os.path.join(ICON_DIR, 'glchess')
- GLADE_DIR = os.path.join(APP_DATA_DIR, 'glchess')
+ UI_DIR = os.path.join(APP_DATA_DIR, 'glchess')
BASE_DIR = os.path.join(APP_DATA_DIR, 'glchess')
LOCALEDIR = os.path.join(APP_DATA_DIR, 'locale')
DATA_DIR = os.path.expanduser('~/.gnome2/glchess/')
@@ -31,7 +31,7 @@
APP_DATA_DIR = os.path.join(root_dir, '../../data')
ICON_DIR = os.path.join(root_dir, '../../textures')
TEXTURE_DIR = os.path.join(root_dir, '../../textures')
- GLADE_DIR = os.path.join(root_dir, '../../glade')
+ UI_DIR = os.path.join(root_dir, '../../data')
BASE_DIR = os.path.join(root_dir, '../../data')
LOCALEDIR = os.path.join(APP_DATA_DIR, 'locale')
DATA_DIR = os.path.expanduser('~/.gnome2/glchess/')
@@ -48,10 +48,6 @@
gettext.textdomain(DOMAIN)
from gettext import gettext as _
-import gtk.glade
-gtk.glade.bindtextdomain(DOMAIN, LOCALEDIR)
-gtk.glade.textdomain(DOMAIN)
-
VERSION = "@VERSION@"
APPNAME = _("glChess")
ICON_NAME = 'gnome-glchess'
Modified: trunk/glchess/src/lib/gtkui/chessview.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/chessview.py (original)
+++ trunk/glchess/src/lib/gtkui/chessview.py Tue Apr 7 10:48:48 2009
@@ -238,14 +238,14 @@
self.needsSaving = False
# The GTK+ elements
- self.gui = gtkui.loadGladeFile('chess_view.glade', 'chess_view')
- self.gui.signal_autoconnect(self)
- self.widget = self.gui.get_widget('chess_view')
+ self.gui = gtkui.loadUIFile('chess_view.ui', 'chess_view')
+ self.gui.connect_signals(self)
+ self.widget = self.gui.get_object('chess_view')
self.viewWidget = GtkViewArea(self)
- self.gui.get_widget('view_container').add(self.viewWidget)
+ self.gui.get_object('view_container').add(self.viewWidget)
- self.ui.setTooltipStyle(self.gui.get_widget('info_panel'))
+ self.ui.setTooltipStyle(self.gui.get_object('info_panel'))
# Make a model for navigation (move object, number, description)
model = gtk.ListStore(gobject.TYPE_PYOBJECT, int, str)
@@ -255,7 +255,7 @@
self.moveModel = model
# Tabs are enabled to make editing the UI easier
- self.gui.get_widget('comment_notebook').set_show_tabs(False)
+ self.gui.get_object('comment_notebook').set_show_tabs(False)
self.updateInfoPanel()
@@ -269,9 +269,9 @@
"""
showPanel = False
- panel = self.gui.get_widget('info_panel')
- titleLabel = self.gui.get_widget('panel_title_label')
- descriptionLabel = self.gui.get_widget('panel_description_label')
+ panel = self.gui.get_object('info_panel')
+ titleLabel = self.gui.get_object('panel_title_label')
+ descriptionLabel = self.gui.get_object('panel_description_label')
move = self._getCurrentMove()
if self.gameResult is not None:
@@ -280,7 +280,7 @@
descriptionLabel.set_markup('<i>%s</i>' % description)
showPanel = True
- editToggle = self.gui.get_widget('comment_edit_toggle')
+ editToggle = self.gui.get_object('comment_edit_toggle')
if self.showComments:
# Show the comments
if move is None:
@@ -663,8 +663,8 @@
def _on_comment_edit_button_toggled(self, widget):
"""Gtk+ callback"""
- label = self.gui.get_widget('panel_description_label')
- entry = self.gui.get_widget('comment_text')
+ label = self.gui.get_object('panel_description_label')
+ entry = self.gui.get_object('comment_text')
buffer = entry.get_buffer()
move = self._getCurrentMove()
@@ -688,4 +688,4 @@
label.set_text(comment)
buffer.set_text('')
page = 0
- self.gui.get_widget('comment_notebook').set_current_page(page)
+ self.gui.get_object('comment_notebook').set_current_page(page)
Modified: trunk/glchess/src/lib/gtkui/dialogs.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/dialogs.py (original)
+++ trunk/glchess/src/lib/gtkui/dialogs.py Tue Apr 7 10:48:48 2009
@@ -8,7 +8,6 @@
import gobject
import gtk
-import gtk.glade
import gtk.gdk
import gtkui
@@ -21,7 +20,7 @@
self.__gui = gui
self.__servers = []
- view = gui.get_widget('server_list')
+ view = gui.get_object('server_list')
if view is not None:
store = gtk.ListStore(str, gobject.TYPE_PYOBJECT)
view.set_model(store)
@@ -34,7 +33,7 @@
def add(self, name, game):
"""
"""
- view = self.__gui.get_widget('server_list')
+ view = self.__gui.get_object('server_list')
if view is None:
return
model = view.get_model()
@@ -45,7 +44,7 @@
def getSelected(self):
"""
"""
- view = self.__gui.get_widget('server_list')
+ view = self.__gui.get_object('server_list')
if view is None:
return None
selection = view.get_selection()
@@ -59,7 +58,7 @@
def remove(self, game):
"""
"""
- view = self.__gui.get_widget('server_list')
+ view = self.__gui.get_object('server_list')
if view is None:
return
model = view.get_model()
@@ -90,20 +89,20 @@
self.__customName = False
# Load the UI
- self.__gui = gtkui.loadGladeFile('new_game.glade', 'new_game_dialog')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('new_game.ui')
+ self.__gui.connect_signals(self)
- self.window = self.__gui.get_widget('new_game_dialog')
+ self.window = self.__gui.get_object('new_game_dialog')
self.window.set_transient_for(mainUI.mainWindow)
# Set style of error panel
- mainUI.setTooltipStyle(self.__gui.get_widget('info_box'))
+ mainUI.setTooltipStyle(self.__gui.get_object('info_box'))
# Make all the labels the same width
group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
i = 1
while True:
- widget = self.__gui.get_widget('label%i' % i)
+ widget = self.__gui.get_object('label%i' % i)
if widget is None:
break
group.add_widget(widget)
@@ -113,7 +112,7 @@
group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
i = 1
while True:
- widget = self.__gui.get_widget('image%i' % i)
+ widget = self.__gui.get_object('image%i' % i)
if widget is None:
break
group.add_widget(widget)
@@ -141,7 +140,7 @@
activeIter = iter
timeModel.set(iter, 0, name, 1, time)
- widget = self.__gui.get_widget('time_combo')
+ widget = self.__gui.get_object('time_combo')
widget.set_model(timeModel)
if activeIter is None:
widget.set_active_iter(iter)
@@ -163,9 +162,9 @@
model.set(iter, 0, name, 1, multiplier)
# FIXME: Handle time units
- self.__gui.get_widget('custom_time_spin').set_value(defaultTime)
+ self.__gui.get_object('custom_time_spin').set_value(defaultTime)
- widget = self.__gui.get_widget('custom_time_units_combo')
+ widget = self.__gui.get_object('custom_time_units_combo')
widget.set_model(model)
cell = gtk.CellRendererText()
widget.pack_start(cell, False)
@@ -186,7 +185,7 @@
# Set the difficulty settings
for name in ['black_difficulty_combo', 'white_difficulty_combo']:
- widget = self.__gui.get_widget(name)
+ widget = self.__gui.get_object(name)
if widget is None:
continue
@@ -205,7 +204,7 @@
# Make all the AI combo boxes use one list of AI types
firstAIIndex = min(1, len(aiModel))
for (name, index) in [('white_type_combo', 0), ('black_type_combo', firstAIIndex)]:
- widget = self.__gui.get_widget(name)
+ widget = self.__gui.get_object(name)
if widget is None:
continue
@@ -239,7 +238,7 @@
errors = []
g = self.game
if g is not None:
- self.__gui.get_widget('game_name_entry').set_text(g.name)
+ self.__gui.get_object('game_name_entry').set_text(g.name)
self.__customName = True
# Translators: Error displayed when unable to load a game due to
# the require game engine not being available. %s is replaced with
@@ -261,9 +260,9 @@
# Display warning if missing the AIs
if len(errors) > 0:
# Translators: New Game Dialog: Title of error box when loaded game had AI engines missing
- self.__gui.get_widget('info_title_label').set_markup('<big><b>%s</b></big>' % _('Game settings changed'))
- self.__gui.get_widget('info_description_label').set_markup('<i>%s</i>' % '\n'.join(errors))
- self.__gui.get_widget('info_box').show()
+ self.__gui.get_object('info_title_label').set_markup('<big><b>%s</b></big>' % _('Game settings changed'))
+ self.__gui.get_object('info_description_label').set_markup('<i>%s</i>' % '\n'.join(errors))
+ self.__gui.get_object('info_box').show()
# Show the dialog
self.window.present()
@@ -275,7 +274,7 @@
def __setCombo(self, comboName, key):
"""
"""
- widget = self.__gui.get_widget(comboName)
+ widget = self.__gui.get_object(comboName)
iter = self.__getIter(widget.get_model(), key)
if iter is None:
return False
@@ -313,7 +312,7 @@
# Must have a name for the game
if self.__customName:
- name = self.__gui.get_widget('game_name_entry').get_text()
+ name = self.__gui.get_object('game_name_entry').get_text()
if len(name) == 0:
# Next time something changes generate a name
self.__customName = False
@@ -321,44 +320,44 @@
# Name the game based on the players
else:
- whiteName = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
- blackName = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
+ whiteName = self.__getComboData(self.__gui.get_object('white_type_combo'), 2)
+ blackName = self.__getComboData(self.__gui.get_object('black_type_combo'), 2)
# Translators: Default name for a new game. %(white) and %(black) are substituted for the names of the white and black players.
format = _('%(white)s versus %(black)s')
- self.__gui.get_widget('game_name_entry').set_text(format % {'white': whiteName, 'black': blackName})
+ self.__gui.get_object('game_name_entry').set_text(format % {'white': whiteName, 'black': blackName})
# Disable difficulty for human players
- whiteType = self.__getComboData(self.__gui.get_widget('white_type_combo'), 0)
- blackType = self.__getComboData(self.__gui.get_widget('black_type_combo'), 0)
- self.__gui.get_widget('white_difficulty_combo').set_sensitive(whiteType != '')
- self.__gui.get_widget('black_difficulty_combo').set_sensitive(blackType != '')
+ whiteType = self.__getComboData(self.__gui.get_object('white_type_combo'), 0)
+ blackType = self.__getComboData(self.__gui.get_object('black_type_combo'), 0)
+ self.__gui.get_object('white_difficulty_combo').set_sensitive(whiteType != '')
+ self.__gui.get_object('black_difficulty_combo').set_sensitive(blackType != '')
# Can only click OK if have enough information
- self.__gui.get_widget('start_button').set_sensitive(ready)
+ self.__gui.get_object('start_button').set_sensitive(ready)
self.__checking = False
def __startGame(self):
game = self.game
if game is None:
game = glchess.ui.Game()
- game.name = self.__gui.get_widget('game_name_entry').get_text()
+ game.name = self.__gui.get_object('game_name_entry').get_text()
game.allowSpectators = True
# Get the players
- game.white.type = self.__getComboData(self.__gui.get_widget('white_type_combo'), 0)
+ game.white.type = self.__getComboData(self.__gui.get_object('white_type_combo'), 0)
if game.white.type == '':
# Translators: Default name for the white player
game.white.name = _('White')
else:
- game.white.name = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
- game.white.level = self.__getComboData(self.__gui.get_widget('white_difficulty_combo'), 0)
- game.black.type = self.__getComboData(self.__gui.get_widget('black_type_combo'), 0)
+ game.white.name = self.__getComboData(self.__gui.get_object('white_type_combo'), 2)
+ game.white.level = self.__getComboData(self.__gui.get_object('white_difficulty_combo'), 0)
+ game.black.type = self.__getComboData(self.__gui.get_object('black_type_combo'), 0)
if game.black.type == '':
# Translators: Default name for the black player
game.black.name = _('Black')
else:
- game.black.name = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
- game.black.level = self.__getComboData(self.__gui.get_widget('black_difficulty_combo'), 0)
+ game.black.name = self.__getComboData(self.__gui.get_object('black_type_combo'), 2)
+ game.black.level = self.__getComboData(self.__gui.get_object('black_difficulty_combo'), 0)
game.duration = self.__getGameDuration()
@@ -373,10 +372,10 @@
self.__mainUI.feedback.onGameStart(game)
def __getGameDuration(self):
- duration = self.__getComboData(self.__gui.get_widget('time_combo'), 1)
+ duration = self.__getComboData(self.__gui.get_object('time_combo'), 1)
if duration < 0:
- multiplier = self.__getComboData(self.__gui.get_widget('custom_time_units_combo'), 1)
- duration = self.__gui.get_widget('custom_time_spin').get_value_as_int() * multiplier
+ multiplier = self.__getComboData(self.__gui.get_object('custom_time_units_combo'), 1)
+ duration = self.__gui.get_object('custom_time_spin').get_value_as_int() * multiplier
return duration
# Gtk+ signal handlers
@@ -391,7 +390,7 @@
def _on_time_changed(self, widget):
"""Gtk+ callback"""
time = self.__getComboData(widget, 1)
- w = self.__gui.get_widget('custom_time_box')
+ w = self.__gui.get_object('custom_time_box')
if time < 0:
w.show()
else:
@@ -418,16 +417,16 @@
self.__mainUI = mainUI
# Load the UI
- self.__gui = gtkui.loadGladeFile('load_game.glade')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('load_game.ui')
+ self.__gui.connect_signals(self)
- self.window = self.__gui.get_widget('game_load_dialog')
+ self.window = self.__gui.get_object('game_load_dialog')
self.window.set_transient_for(mainUI.mainWindow)
# Set style of error panel
- mainUI.setTooltipStyle(self.__gui.get_widget('error_box'))
+ mainUI.setTooltipStyle(self.__gui.get_object('error_box'))
- fileChooser = self.__gui.get_widget('filechooserwidget')
+ fileChooser = self.__gui.get_object('filechooserwidget')
try:
directory = str(glchess.config.get('load_directory'))
@@ -457,14 +456,14 @@
def _on_response(self, dialog, responseId):
"""Gtk+ callback"""
- chooser = self.__gui.get_widget('filechooserwidget')
+ chooser = self.__gui.get_object('filechooserwidget')
if responseId == gtk.RESPONSE_OK or responseId == gtk.RESPONSE_YES:
folder = chooser.get_current_folder()
if folder is not None:
glchess.config.set('load_directory', folder)
- fileName = self.__gui.get_widget('filechooserwidget').get_filename()
+ fileName = self.__gui.get_object('filechooserwidget').get_filename()
if fileName is None:
# Translators: Load Game Dialog: Message displayed when no file is selected
error = _('Please select a file to load')
@@ -473,10 +472,10 @@
if error is not None:
self.firstExpose = True
- self.__gui.get_widget('error_box').show()
+ self.__gui.get_object('error_box').show()
# Translators: Title of error box when unable to load game
- self.__gui.get_widget('error_title_label').set_markup('<big><b>%s</b></big>' % _('Unabled to load game'))
- self.__gui.get_widget('error_description_label').set_markup('<i>%s</i>' % error)
+ self.__gui.get_object('error_title_label').set_markup('<big><b>%s</b></big>' % _('Unabled to load game'))
+ self.__gui.get_object('error_description_label').set_markup('<i>%s</i>' % error)
return
dialog.destroy()
@@ -493,15 +492,15 @@
self.__view = view
# Load the UI
- self.__gui = gtkui.loadGladeFile('save_game.glade')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('save_game.ui')
+ self.__gui.connect_signals(self)
# Set style of error panel
- mainUI.setTooltipStyle(self.__gui.get_widget('error_box'))
+ mainUI.setTooltipStyle(self.__gui.get_object('error_box'))
- self.window = self.__gui.get_widget('save_dialog')
+ self.window = self.__gui.get_object('save_dialog')
self.window.set_transient_for(mainUI.mainWindow)
- chooser = self.__gui.get_widget('filechooser')
+ chooser = self.__gui.get_object('filechooser')
try:
directory = str(glchess.config.get('save_directory'))
@@ -532,13 +531,13 @@
"""
"""
self.firstExpose = True
- self.__gui.get_widget('error_box').show()
- self.__gui.get_widget('error_title_label').set_markup('<big><b>%s</b></big>' % title)
- self.__gui.get_widget('error_description_label').set_markup('<i>%s</i>' % content)
+ self.__gui.get_object('error_box').show()
+ self.__gui.get_object('error_title_label').set_markup('<big><b>%s</b></big>' % title)
+ self.__gui.get_object('error_description_label').set_markup('<i>%s</i>' % content)
def _on_response(self, dialog, responseId):
"""Gtk+ callback"""
- chooser = self.__gui.get_widget('filechooser')
+ chooser = self.__gui.get_object('filechooser')
if responseId == gtk.RESPONSE_OK:
# Append .pgn to the end if not provided
@@ -574,14 +573,14 @@
'mainUI' is the main UI.
"""
# Load the UI
- self.__gui = gtkui.loadGladeFile('preferences.glade', 'preferences')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('preferences.ui')
+ self.__gui.connect_signals(self)
- self.__gui.get_widget('preferences').set_transient_for(mainUI.mainWindow)
+ self.__gui.get_object('preferences').set_transient_for(mainUI.mainWindow)
# Make model for move format
moveModel = gtk.ListStore(str, str)
- widget = self.__gui.get_widget('move_format_combo')
+ widget = self.__gui.get_object('move_format_combo')
widget.set_model(moveModel)
# Translators: Move Format Combo: Moves shown in human descriptive notation
move_formats = [('human', _('Human')),
@@ -597,7 +596,7 @@
# Make model for board orientation
boardModel = gtk.ListStore(str, str)
- widget = self.__gui.get_widget('board_combo')
+ widget = self.__gui.get_object('board_combo')
widget.set_model(boardModel)
# Translators: Board Side Combo: Camera will face white player's side
view_list = [('white', _('White Side')),
@@ -613,7 +612,7 @@
# Make modelfor promotion type
promotionModel = gtk.ListStore(str, str)
- widget = self.__gui.get_widget('promotion_type_combo')
+ widget = self.__gui.get_object('promotion_type_combo')
widget.set_model(promotionModel)
# Translators: Promotion Combo: Promote to a queen. Do not translate the 'chess-piece|' text.
promotion_list = [('queen', _('chess-piece|Queen')),
@@ -647,38 +646,38 @@
"""
"""
if name == 'show_3d':
- self.__gui.get_widget('show_3d').set_active(value)
- self.__gui.get_widget('show_3d_smooth').set_sensitive(value)
+ self.__gui.get_object('show_3d').set_active(value)
+ self.__gui.get_object('show_3d_smooth').set_sensitive(value)
elif name == 'show_3d_smooth':
- self.__gui.get_widget('show_3d_smooth').set_active(value)
+ self.__gui.get_object('show_3d_smooth').set_active(value)
elif name == 'show_toolbar':
- self.__gui.get_widget('show_toolbar').set_active(value)
+ self.__gui.get_object('show_toolbar').set_active(value)
elif name == 'show_history':
- self.__gui.get_widget('show_history').set_active(value)
+ self.__gui.get_object('show_history').set_active(value)
elif name == 'show_move_hints':
- self.__gui.get_widget('show_move_hints').set_active(value)
+ self.__gui.get_object('show_move_hints').set_active(value)
elif name == 'show_numbering':
- self.__gui.get_widget('show_numbering').set_active(value)
+ self.__gui.get_object('show_numbering').set_active(value)
elif name == 'move_format':
- widget = self.__gui.get_widget('move_format_combo')
+ widget = self.__gui.get_object('move_format_combo')
for row in widget.get_model():
if row[1] == value:
widget.set_active_iter(row.iter)
elif name == 'promotion_type':
- widget = self.__gui.get_widget('promotion_type_combo')
+ widget = self.__gui.get_object('promotion_type_combo')
for row in widget.get_model():
if row[1] == value:
widget.set_active_iter(row.iter)
elif name == 'board_view':
- widget = self.__gui.get_widget('board_combo')
+ widget = self.__gui.get_object('board_combo')
for row in widget.get_model():
if row[1] == value:
widget.set_active_iter(row.iter)
@@ -687,7 +686,7 @@
assert(False), 'Unknown config item: %s' % name
def setVisible(self, isVisible):
- window = self.__gui.get_widget('preferences')
+ window = self.__gui.get_object('preferences')
if isVisible:
window.present()
else:
Modified: trunk/glchess/src/lib/gtkui/gtkui.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/gtkui.py (original)
+++ trunk/glchess/src/lib/gtkui/gtkui.py Tue Apr 7 10:48:48 2009
@@ -16,7 +16,6 @@
import gobject
import gtk
-import gtk.glade
import gtk.gdk
import cairo
import pango
@@ -37,8 +36,10 @@
# Mark all windows with our icon
gtk.window_set_default_icon_name(ICON_NAME)
-def loadGladeFile(name, root = None):
- return gtk.glade.XML(os.path.join(GLADE_DIR, name), root, domain = DOMAIN)
+def loadUIFile(name, root = None):
+ ui = gtk.Builder()
+ ui.add_from_file(os.path.join(UI_DIR, name))
+ return ui
class GLibTimer(glchess.ui.Timer):
"""
@@ -211,13 +212,10 @@
self._tooltipStyle = None
self._tooltipWidgetsDrawn = {}
- self._gui = loadGladeFile('glchess.glade')
- self._gui.signal_autoconnect(self)
+ self._gui = loadUIFile('glchess.ui')
+ self._gui.connect_signals(self)
- self.mainWindow = self._gui.get_widget('glchess_app')
-
- # Workaround as Glade 2 always overrides the system style for toolbars
- self.__getWidget('toolbar').unset_style()
+ self.mainWindow = self._gui.get_object('glchess_app')
# Create the model for the player types
self.__playerModel = gtk.ListStore(str, str, str)
@@ -225,7 +223,7 @@
# Translators: Player Type Combo: Player is human controlled
self.__playerModel.set(iter, 0, '', 1, 'stock_person', 2, _('Human'))
- self.__logWindow = log.LogWindow(self._gui.get_widget('log_notebook'))
+ self.__logWindow = log.LogWindow(self._gui.get_object('log_notebook'))
# Make preferences dialog
self.preferences = dialogs.GtkPreferencesDialog(self)
@@ -381,10 +379,10 @@
if whiteString != self.whiteTimeString:
self.whiteTimeString = whiteString
- self._gui.get_widget('white_time_label').queue_draw()
+ self._gui.get_object('white_time_label').queue_draw()
if blackString != self.blackTimeString:
self.blackTimeString = blackString
- self._gui.get_widget('black_time_label').queue_draw()
+ self._gui.get_object('black_time_label').queue_draw()
def run(self):
"""Run the UI.
@@ -627,7 +625,7 @@
return animating
def __getWidget(self, name):
- widget = self._gui.get_widget(name)
+ widget = self._gui.get_object(name)
assert(widget is not None), 'Unable to find widget: %s' % name
return widget
@@ -672,7 +670,7 @@
def _on_show_logs_clicked(self, widget):
"""Gtk+ callback"""
- window = self._gui.get_widget('log_window')
+ window = self._gui.get_object('log_window')
if widget.get_active():
window.present()
else:
@@ -898,7 +896,7 @@
def _on_log_window_delete_event(self, widget, event):
"""Gtk+ callback"""
- self._gui.get_widget('menu_view_logs').set_active(False)
+ self._gui.get_object('menu_view_logs').set_active(False)
# Stop the event - the window will be closed by the menu event
return True
@@ -919,11 +917,11 @@
if event.changed_mask & gtk.gdk.WINDOW_STATE_FULLSCREEN:
self.isFullscreen = event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN != 0
if self.isFullscreen:
- self._gui.get_widget('menu_fullscreen').hide()
- self._gui.get_widget('menu_leave_fullscreen').show()
+ self._gui.get_object('menu_fullscreen').hide()
+ self._gui.get_object('menu_leave_fullscreen').show()
else:
- self._gui.get_widget('menu_leave_fullscreen').hide()
- self._gui.get_widget('menu_fullscreen').show()
+ self._gui.get_object('menu_leave_fullscreen').hide()
+ self._gui.get_object('menu_fullscreen').show()
def _on_close_window(self, widget, event):
"""Gtk+ callback"""
Modified: trunk/glchess/src/lib/gtkui/log.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/log.py (original)
+++ trunk/glchess/src/lib/gtkui/log.py Tue Apr 7 10:48:48 2009
@@ -46,17 +46,17 @@
"""
"""
self.window = window
- self.__gui = gtkui.loadGladeFile('log.glade', 'log_table')
- self.__gui.get_widget('executable_label').set_text(executable)
- self.__gui.get_widget('game_label').set_text(description)
+ self.__gui = gtkui.loadUIFile('log.ui')
+ self.__gui.get_object('executable_label').set_text(executable)
+ self.__gui.get_object('game_label').set_text(description)
# Add into the notebook
- self.root = self.__gui.get_widget('log_table')
+ self.root = self.__gui.get_object('log_table')
notebook = window.notebook
notebook.append_page(self.root, gtk.Label(title))
# Create styles for the buffer
- buffer = self.__gui.get_widget('comms_textview').get_buffer()
+ buffer = self.__gui.get_object('comms_textview').get_buffer()
buffer.create_tag('input', family='Monospace')
buffer.create_tag('output', family='Monospace', weight = pango.WEIGHT_BOLD)
buffer.create_tag('move', family='Monospace', foreground = 'blue')
@@ -92,8 +92,8 @@
def addText(self, text, style = None):
"""FIXME: Define style
"""
- view = self.__gui.get_widget('comms_textview')
- scroll = self.__gui.get_widget('comms_scrolled_window')
+ view = self.__gui.get_object('comms_textview')
+ scroll = self.__gui.get_object('comms_scrolled_window')
buffer = view.get_buffer()
mark = buffer.get_mark('end')
adj = scroll.get_vadjustment()
Modified: trunk/glchess/src/lib/gtkui/network.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/network.py (original)
+++ trunk/glchess/src/lib/gtkui/network.py Tue Apr 7 10:48:48 2009
@@ -15,10 +15,10 @@
self.__networkDialog = networkDialog
# Load the UI
- self.__gui = gtkui.loadGladeFile('network_game.glade', 'add_account_dialog')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('network_new_server.ui')
+ self.__gui.connect_signals(self)
- self.__gui.get_widget('add_account_dialog').set_transient_for(parent)
+ self.__gui.get_object('add_account_dialog').set_transient_for(parent)
# FIXME: Hard-coded servers
# name, host, port
@@ -28,7 +28,7 @@
# Translators: Add Network Profile Dialog: Use a custom server
self.serverModel.set(self.serverModel.append(), 0, _("Custom"), 1, "", 2, 5688)
- widget = self.__gui.get_widget('server_combo')
+ widget = self.__gui.get_object('server_combo')
widget.set_model(self.serverModel)
cell = gtk.CellRendererText()
widget.pack_start(cell, False)
@@ -37,7 +37,7 @@
widget.set_active(0)
def setVisible(self, isVisible):
- widget = self.__gui.get_widget('add_account_dialog')
+ widget = self.__gui.get_object('add_account_dialog')
if isVisible:
widget.present()
else:
@@ -45,46 +45,46 @@
self.clear()
def clear(self):
- self.__gui.get_widget('server_combo').set_active(0)
- self.__gui.get_widget('username_entry').set_text('')
+ self.__gui.get_object('server_combo').set_active(0)
+ self.__gui.get_object('username_entry').set_text('')
def _on_server_changed(self, widget):
- widget = self.__gui.get_widget('server_combo')
+ widget = self.__gui.get_object('server_combo')
model = widget.get_model()
iter = widget.get_active_iter()
(host,) = model.get(iter, 1)
(port,) = model.get(iter, 2)
- self.__gui.get_widget('host_entry').set_text(host)
- self.__gui.get_widget('port_spin').set_value(port)
- table = self.__gui.get_widget('custom_server_table')
+ self.__gui.get_object('host_entry').set_text(host)
+ self.__gui.get_object('port_spin').set_value(port)
+ table = self.__gui.get_object('custom_server_table')
if host == '':
table.show()
else:
table.hide()
def have_data(self):
- username = self.__gui.get_widget('username_entry').get_text()
- host = self.__gui.get_widget('host_entry').get_text()
+ username = self.__gui.get_object('username_entry').get_text()
+ host = self.__gui.get_object('host_entry').get_text()
return username != '' and host != ''
def _on_input_changed(self, widget):
- self.__gui.get_widget('add_button').set_sensitive(self.have_data())
+ self.__gui.get_object('add_button').set_sensitive(self.have_data())
def _on_username_activate(self, widget):
if self.have_data():
self._on_response(None, gtk.RESPONSE_OK)
def _on_response(self, widget, response_id):
- username = self.__gui.get_widget('username_entry').get_text()
- host = self.__gui.get_widget('host_entry').get_text()
- port = self.__gui.get_widget('port_spin').get_value_as_int()
+ username = self.__gui.get_object('username_entry').get_text()
+ host = self.__gui.get_object('host_entry').get_text()
+ port = self.__gui.get_object('port_spin').get_value_as_int()
name = '%s %s' % (username, host) # FIXME
if response_id == gtk.RESPONSE_OK:
profile = self.__networkDialog.feedback.addProfile((name, username, host, port))
self.__networkDialog.addProfile(profile, profile.name, useNow = True)
- self.__gui.get_widget('add_account_dialog').hide()
+ self.__gui.get_object('add_account_dialog').hide()
self.clear()
def _on_delete(self, widget, event):
@@ -104,8 +104,8 @@
self.feedback = feedback
# Load the UI
- self.__gui = gtkui.loadGladeFile('network_game.glade', 'network_game_dialog')
- self.__gui.signal_autoconnect(self)
+ self.__gui = gtkui.loadUIFile('network_game.ui')
+ self.__gui.connect_signals(self)
# Selected profile
self.__profile = None
@@ -120,7 +120,7 @@
self.profileModel.set(self.profileModel.append(), 0, None, 1, self._new_profile, 2, _('New profile...'))
self.profileModelSuffixCount += 1
- widget = self.__gui.get_widget('server_combo')
+ widget = self.__gui.get_object('server_combo')
widget.set_model(self.profileModel)
widget.set_active(0)
widget.set_row_separator_func(self._is_profile_model_separator)
@@ -132,7 +132,7 @@
self.roomModel = gtk.TreeStore(gobject.TYPE_PYOBJECT, int, str, str, str, int, int, str)
self.firstNonChessIter = None
self.roomIters = {}
- view = self.__gui.get_widget('room_list')
+ view = self.__gui.get_object('room_list')
view.set_model(self.roomModel)
cell = gtk.CellRendererText()
column = gtk.TreeViewColumn('', cell)
@@ -156,7 +156,7 @@
# player, name, icon
self.playerModel = gtk.ListStore(gobject.TYPE_PYOBJECT, str, str)
- view = self.__gui.get_widget('player_list')
+ view = self.__gui.get_object('player_list')
view.set_model(self.playerModel)
cell = gtk.CellRendererPixbuf()
column = gtk.TreeViewColumn('', cell)
@@ -171,7 +171,7 @@
self.tableModel = gtk.ListStore(gobject.TYPE_PYOBJECT, str, str, str, gobject.TYPE_PYOBJECT, gobject.TYPE_BOOLEAN)
self.tableIters = {}
- view = self.__gui.get_widget('table_list')
+ view = self.__gui.get_object('table_list')
view.get_selection().connect('changed', self._on_table_selected)
view.set_model(self.tableModel)
@@ -191,7 +191,7 @@
column.add_attribute(cell, 'text', 3)
view.append_column(column)
- view = self.__gui.get_widget('seat_list')
+ view = self.__gui.get_object('seat_list')
cell = gtk.CellRendererText()
# Translators: Current GGZ Table: Seat name column title
column = gtk.TreeViewColumn(_('Seat'), cell)
@@ -206,7 +206,7 @@
self.__loadThrobber()
# Create styles for the buffer
- buffer = self.__gui.get_widget('chat_textview').get_buffer()
+ buffer = self.__gui.get_object('chat_textview').get_buffer()
buffer.create_tag('motd', family='Monospace', foreground = 'red')
buffer.create_tag('chat', family='Monospace')
#buffer.create_tag('output', family='Monospace', weight = pango.WEIGHT_BOLD)
@@ -215,15 +215,14 @@
#buffer.create_tag('error', family='Monospace', foreground = 'red')
buffer.create_mark('end', buffer.get_end_iter())
- mainUI.setTooltipStyle(self.__gui.get_widget('info_panel'))
-
- self.__addProfileDialog = GtkNetworkAddDialog(self, self.__gui.get_widget('network_game_dialog'))
+ mainUI.setTooltipStyle(self.__gui.get_object('info_panel'))
+ self.__addProfileDialog = GtkNetworkAddDialog(self, self.__gui.get_object('network_game_dialog'))
# Extended methods
def setVisible(self, isVisible):
"""Called by glchess.ui.NetworkController"""
- widget = self.__gui.get_widget('network_game_dialog')
+ widget = self.__gui.get_object('network_game_dialog')
if isVisible:
widget.present()
@@ -233,26 +232,27 @@
self.__addProfileDialog.setVisible(True)
else:
self.__addProfileDialog.setVisible(False)
+ self.__editProfileDialog.setVisible(False)
widget.hide()
def setSensitive(self, isSensitive):
- widget = self.__gui.get_widget('controls_box')
+ widget = self.__gui.get_object('controls_box')
widget.set_sensitive(isSensitive)
def setError(self, title, description):
- self.__gui.get_widget('info_panel_title').set_markup('<big><b>%s</b></big>' % title)
- self.__gui.get_widget('info_panel_description').set_markup('<i>%s</i>' % description)
- self.__gui.get_widget('info_panel').show()
+ self.__gui.get_object('info_panel_title').set_markup('<big><b>%s</b></big>' % title)
+ self.__gui.get_object('info_panel_description').set_markup('<i>%s</i>' % description)
+ self.__gui.get_object('info_panel').show()
def clearError(self):
- self.__gui.get_widget('info_panel').hide()
+ self.__gui.get_object('info_panel').hide()
def addProfile(self, profile, name, useNow = False):
"""Called by glchess.ui.UIController"""
iter = self.profileModel.insert(len(self.profileModel) - self.profileModelSuffixCount)
self.profileModel.set(iter, 0, profile, 1, self._set_profile, 2, name)
if self.__profile is None and useNow:
- self.__gui.get_widget('server_combo').set_active_iter(iter)
+ self.__gui.get_object('server_combo').set_active_iter(iter)
def setBusy(self, isBusy):
"""Called by glchess.ui.UIController"""
@@ -261,7 +261,7 @@
self._throbberTimer = None
# Disable room buttons when busy
- widget = self.__gui.get_widget('room_button_box')
+ widget = self.__gui.get_object('room_button_box')
widget.set_sensitive(not isBusy)
# Display animating frames if busy or idle frame if not
@@ -388,8 +388,8 @@
def joinTable(self, table):
"""Called by glchess.ui.UIController"""
- gameFrame = self.__gui.get_widget('game_frame')
- roomFrame = self.__gui.get_widget('room_frame')
+ gameFrame = self.__gui.get_object('game_frame')
+ roomFrame = self.__gui.get_object('room_frame')
if table is None:
gameFrame.hide()
roomFrame.show()
@@ -397,10 +397,10 @@
iter = self.tableIters[table]
seatModel = self.tableModel.get_value(iter, 4)
- self.__gui.get_widget('seat_list').set_model(seatModel)
+ self.__gui.get_object('seat_list').set_model(seatModel)
name = self.tableModel.get_value(iter, 3)
- self.__gui.get_widget('game_name_label').set_text(name)
+ self.__gui.get_object('game_name_label').set_text(name)
roomFrame.hide()
gameFrame.show()
@@ -429,8 +429,8 @@
def addText(self, text, style):
"""Called by glchess.ui.UIController"""
- view = self.__gui.get_widget('chat_textview')
- scroll = self.__gui.get_widget('chat_scroll_window')
+ view = self.__gui.get_object('chat_textview')
+ scroll = self.__gui.get_object('chat_scroll_window')
adj = scroll.get_vadjustment()
atBottom = adj.value >= adj.upper - adj.page_size
buffer = view.get_buffer()
@@ -440,12 +440,12 @@
view.scroll_mark_onscreen(mark)
def clearText(self):
- buffer = self.__gui.get_widget('chat_textview').get_buffer()
+ buffer = self.__gui.get_object('chat_textview').get_buffer()
buffer.delete(buffer.get_start_iter(), buffer.get_end_iter())
def close(self):
"""Called by glchess.ui.UIController"""
- self.__gui.get_widget('network_game_dialog').hide()
+ self.__gui.get_object('network_game_dialog').hide()
# Private methods
@@ -482,7 +482,7 @@
self._updateThrobber()
def _updateThrobber(self):
- widget = self.__gui.get_widget('throbber_image')
+ widget = self.__gui.get_object('throbber_image')
try:
icon = self._throbberFrames[self._throbberFrame]
except IndexError:
@@ -497,7 +497,7 @@
return True
def __setCombo(self, comboName, key):
- widget = self.__gui.get_widget(comboName)
+ widget = self.__gui.get_object(comboName)
iter = self.__getIter(widget.get_model(), key)
if iter is not None:
widget.set_active_iter(iter)
@@ -526,27 +526,27 @@
def __startGame(self):
game = glchess.ui.Game()
- game.name = self.__gui.get_widget('game_name_entry').get_text()
+ game.name = self.__gui.get_object('game_name_entry').get_text()
game.allowSpectators = True
# Get the players
- game.white.type = self.__getComboData(self.__gui.get_widget('white_type_combo'), 0)
+ game.white.type = self.__getComboData(self.__gui.get_object('white_type_combo'), 0)
if game.white.type == '':
game.white.name = _('White')
else:
- game.white.name = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
- game.white.level = self.__getComboData(self.__gui.get_widget('white_difficulty_combo'), 0)
- game.black.type = self.__getComboData(self.__gui.get_widget('black_type_combo'), 0)
+ game.white.name = self.__getComboData(self.__gui.get_object('white_type_combo'), 2)
+ game.white.level = self.__getComboData(self.__gui.get_object('white_difficulty_combo'), 0)
+ game.black.type = self.__getComboData(self.__gui.get_object('black_type_combo'), 0)
if game.black.type == '':
game.black.name = _('Black')
else:
- game.black.name = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
- game.black.level = self.__getComboData(self.__gui.get_widget('black_difficulty_combo'), 0)
+ game.black.name = self.__getComboData(self.__gui.get_object('black_type_combo'), 2)
+ game.black.level = self.__getComboData(self.__gui.get_object('black_difficulty_combo'), 0)
- game.duration = self.__getComboData(self.__gui.get_widget('time_combo'), 1)
+ game.duration = self.__getComboData(self.__gui.get_object('time_combo'), 1)
if game.duration < 0:
- multiplier = self.__getComboData(self.__gui.get_widget('custom_time_units_combo'), 1)
- game.duration = self.__getComboData(self.__gui.get_widget('custom_time_spin'), 1) * multiplier
+ multiplier = self.__getComboData(self.__gui.get_object('custom_time_units_combo'), 1)
+ game.duration = self.__getComboData(self.__gui.get_object('custom_time_spin'), 1) * multiplier
# Save properties
glchess.config.set('new_game_dialog/white/type', game.white.type)
@@ -571,12 +571,12 @@
if self.__profile == self.profileModel.get_value(iter, 0):
break
iter = self.profileModel.iter_next(iter)
- self.__gui.get_widget('server_combo').set_active_iter(iter)
+ self.__gui.get_object('server_combo').set_active_iter(iter)
def _new_profile(self, profile):
self.__selectActiveProfile()
self.__addProfileDialog.setVisible(True)
-
+
# Gtk+ signal handlers
def _on_table_selected(self, selection):
@@ -586,7 +586,7 @@
else:
isSensitive = model.get_value(iter, 5)
- widget = self.__gui.get_widget('table_join_button')
+ widget = self.__gui.get_object('table_join_button')
widget.set_sensitive(isSensitive)
def _on_table_list_activated(self):
@@ -612,12 +612,12 @@
def _on_response(self, widget, response_id):
"""Gtk+ callback"""
- self.__gui.get_widget('network_game_dialog').hide()
+ self.__gui.get_object('network_game_dialog').hide()
def _on_room_changed(self, widget, path, column):
"""Gtk+ callback"""
# FIXME: Only if allowed to enter room (state machine)
- model = self.__gui.get_widget('room_list').get_model()
+ model = self.__gui.get_object('room_list').get_model()
iter = model.get_iter(path)
if iter is None:
return True
@@ -628,7 +628,7 @@
def _on_table_join_button_clicked(self, widget):
"""Gtk+ callback"""
- (model, iter) = self.__gui.get_widget('table_list').get_selection().get_selected()
+ (model, iter) = self.__gui.get_object('table_list').get_selection().get_selected()
if iter is None:
return
table = model.get_value(iter, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]