mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
+ GTK bindings: sound-dialog
git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@56 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
parent
cd896971ad
commit
a4a50fe867
11 changed files with 496 additions and 69 deletions
|
@ -69,3 +69,8 @@ gchar *s = N_("Change...");
|
||||||
gchar *s = N_("Change...");
|
gchar *s = N_("Change...");
|
||||||
gchar *s = N_("Change...");
|
gchar *s = N_("Change...");
|
||||||
gchar *s = N_("Change...");
|
gchar *s = N_("Change...");
|
||||||
|
gchar *s = N_("Sound settings");
|
||||||
|
gchar *s = N_("Sound enabled");
|
||||||
|
gchar *s = N_("Sample volume:");
|
||||||
|
gchar *s = N_("Music volume:");
|
||||||
|
gchar *s = N_("Enable samles");
|
||||||
|
|
|
@ -1850,7 +1850,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="highlight_samerank_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:28:47 GMT"/>
|
<signal name="value_changed" handler="highlight_samerank_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:28:47 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -1872,7 +1872,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="highlight_cards_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:07:30 GMT"/>
|
<signal name="value_changed" handler="highlight_cards_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:07:30 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -1894,7 +1894,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="highlight_piles_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:07:06 GMT"/>
|
<signal name="value_changed" handler="highlight_piles_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:07:06 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -1916,7 +1916,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="raise_card_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:06:41 GMT"/>
|
<signal name="value_changed" handler="raise_card_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:06:41 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -1938,7 +1938,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="hint_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:05:57 GMT"/>
|
<signal name="value_changed" handler="hint_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:05:57 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -1960,7 +1960,7 @@
|
||||||
<property name="digits">1</property>
|
<property name="digits">1</property>
|
||||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
<property name="inverted">False</property>
|
<property name="inverted">False</property>
|
||||||
<property name="adjustment">1 0.2 10 0.1 1 1</property>
|
<property name="adjustment">1 0.2 10 0.1 1 0</property>
|
||||||
<signal name="value_changed" handler="demo_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:05:44 GMT"/>
|
<signal name="value_changed" handler="demo_scale_value_changed" last_modification_time="Mon, 21 Aug 2006 15:05:44 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -4121,4 +4121,305 @@
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
<widget class="GtkDialog" id="sounds_dialog">
|
||||||
|
<property name="title" translatable="yes">Sound settings</property>
|
||||||
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
|
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||||
|
<property name="modal">True</property>
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="destroy_with_parent">False</property>
|
||||||
|
<property name="decorated">True</property>
|
||||||
|
<property name="skip_taskbar_hint">False</property>
|
||||||
|
<property name="skip_pager_hint">False</property>
|
||||||
|
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||||
|
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||||
|
<property name="has_separator">True</property>
|
||||||
|
|
||||||
|
<child internal-child="vbox">
|
||||||
|
<widget class="GtkVBox" id="dialog-vbox5">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="homogeneous">False</property>
|
||||||
|
<property name="spacing">0</property>
|
||||||
|
|
||||||
|
<child internal-child="action_area">
|
||||||
|
<widget class="GtkHButtonBox" id="dialog-action_area5">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="cancelbutton4">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label">gtk-cancel</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
|
<property name="focus_on_click">True</property>
|
||||||
|
<property name="response_id">-6</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="applybutton1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label">gtk-apply</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
|
<property name="focus_on_click">True</property>
|
||||||
|
<property name="response_id">-10</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="okbutton4">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label">gtk-ok</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
|
<property name="focus_on_click">True</property>
|
||||||
|
<property name="response_id">-5</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="pack_type">GTK_PACK_END</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkTable" id="table13">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="n_rows">4</property>
|
||||||
|
<property name="n_columns">3</property>
|
||||||
|
<property name="homogeneous">False</property>
|
||||||
|
<property name="row_spacing">0</property>
|
||||||
|
<property name="column_spacing">0</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="enable_checkbutton">
|
||||||
|
<property name="border_width">4</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Sound enabled</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
|
<property name="focus_on_click">True</property>
|
||||||
|
<property name="active">False</property>
|
||||||
|
<property name="inconsistent">False</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="bottom_attach">1</property>
|
||||||
|
<property name="x_options">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label76">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Sample volume:</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">4</property>
|
||||||
|
<property name="ypad">4</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="right_attach">1</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label77">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Music volume:</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">4</property>
|
||||||
|
<property name="ypad">4</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="right_attach">1</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkSpinButton" id="sample_spinbutton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="climb_rate">1</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
<property name="numeric">True</property>
|
||||||
|
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
|
||||||
|
<property name="snap_to_ticks">False</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="adjustment">1 0 128 1 10 10</property>
|
||||||
|
<signal name="value_changed" handler="sample_spinbutton_value_changed" last_modification_time="Thu, 24 Aug 2006 16:03:39 GMT"/>
|
||||||
|
</widget>
|
||||||
|
<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">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkHScale" id="music_scale">
|
||||||
|
<property name="width_request">120</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="draw_value">False</property>
|
||||||
|
<property name="value_pos">GTK_POS_TOP</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
|
<property name="inverted">False</property>
|
||||||
|
<property name="adjustment">0 0 128 1 10 0</property>
|
||||||
|
<signal name="value_changed" handler="music_scale_value_changed" last_modification_time="Thu, 24 Aug 2006 16:03:12 GMT"/>
|
||||||
|
</widget>
|
||||||
|
<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_padding">4</property>
|
||||||
|
<property name="y_options">fill</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkHScale" id="sample_scale">
|
||||||
|
<property name="width_request">120</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="draw_value">False</property>
|
||||||
|
<property name="value_pos">GTK_POS_TOP</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||||
|
<property name="inverted">False</property>
|
||||||
|
<property name="adjustment">0 0 128 1 10 0</property>
|
||||||
|
<signal name="value_changed" handler="sample_scale_value_changed" last_modification_time="Thu, 24 Aug 2006 16:02:55 GMT"/>
|
||||||
|
</widget>
|
||||||
|
<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_padding">4</property>
|
||||||
|
<property name="y_options">fill</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkSpinButton" id="music_spinbutton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="climb_rate">1</property>
|
||||||
|
<property name="digits">0</property>
|
||||||
|
<property name="numeric">True</property>
|
||||||
|
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
|
||||||
|
<property name="snap_to_ticks">False</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="adjustment">1 0 128 1 10 10</property>
|
||||||
|
<signal name="value_changed" handler="music_spinbutton_value_changed" last_modification_time="Thu, 24 Aug 2006 16:04:00 GMT"/>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkFrame" id="frame3">
|
||||||
|
<property name="border_width">4</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label_xalign">0</property>
|
||||||
|
<property name="label_yalign">0.5</property>
|
||||||
|
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkTable" id="samples_table">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="n_rows">10</property>
|
||||||
|
<property name="n_columns">2</property>
|
||||||
|
<property name="homogeneous">False</property>
|
||||||
|
<property name="row_spacing">0</property>
|
||||||
|
<property name="column_spacing">0</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label78">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Enable samles</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="type">label_item</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
|
<property name="y_options">fill</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
|
|
@ -58,7 +58,6 @@ from pysoltk import MfxMessageDialog, MfxSimpleEntry
|
||||||
from pysoltk import MfxExceptionDialog
|
from pysoltk import MfxExceptionDialog
|
||||||
from pysoltk import MfxRadioMenuItem, MfxCheckMenuItem, StringVar
|
from pysoltk import MfxRadioMenuItem, MfxCheckMenuItem, StringVar
|
||||||
from pysoltk import PlayerOptionsDialog
|
from pysoltk import PlayerOptionsDialog
|
||||||
from pysoltk import SoundOptionsDialog
|
|
||||||
#from pysoltk import HintOptionsDialog
|
#from pysoltk import HintOptionsDialog
|
||||||
from pysoltk import TimeoutsDialog
|
from pysoltk import TimeoutsDialog
|
||||||
from pysoltk import ColorsDialog
|
from pysoltk import ColorsDialog
|
||||||
|
@ -805,15 +804,20 @@ class PysolMenubarActions:
|
||||||
self.game.updateStatus(player=self.app.opt.player)
|
self.game.updateStatus(player=self.app.opt.player)
|
||||||
self.game.updateStatus(stats=self.app.stats.getStats(self.app.opt.player, self.game.id))
|
self.game.updateStatus(stats=self.app.stats.getStats(self.app.opt.player, self.game.id))
|
||||||
|
|
||||||
def mOptSoundDialog(self, *args):
|
|
||||||
if self._cancelDrag(break_pause=False): return
|
|
||||||
d = SoundOptionsDialog(self.top, _("Sound settings"), self.app)
|
|
||||||
self.tkopt.sound.set(self.app.opt.sound)
|
|
||||||
|
|
||||||
## def mOptIrregularPiles(self, *args):
|
## def mOptIrregularPiles(self, *args):
|
||||||
## if self._cancelDrag(): return
|
## if self._cancelDrag(): return
|
||||||
## self.app.opt.irregular_piles = self.tkopt.irregular_piles.get()
|
## self.app.opt.irregular_piles = self.tkopt.irregular_piles.get()
|
||||||
|
|
||||||
|
def _mOptTableTile(self, i):
|
||||||
|
if self.app.setTile(i):
|
||||||
|
self.tkopt.tabletile.set(i)
|
||||||
|
|
||||||
|
def _mOptTableColor(self, color):
|
||||||
|
tile = self.app.tabletile_manager.get(0)
|
||||||
|
tile.color = color
|
||||||
|
if self.app.setTile(0):
|
||||||
|
self.tkopt.tabletile.set(0)
|
||||||
|
|
||||||
def mOptColors(self, *args):
|
def mOptColors(self, *args):
|
||||||
if self._cancelDrag(break_pause=False): return
|
if self._cancelDrag(break_pause=False): return
|
||||||
d = ColorsDialog(self.top, _("Set colors"), self.app)
|
d = ColorsDialog(self.top, _("Set colors"), self.app)
|
||||||
|
|
|
@ -44,6 +44,7 @@ from pysollib.settings import PACKAGE
|
||||||
# toolkit imports
|
# toolkit imports
|
||||||
from tkutil import setTransient
|
from tkutil import setTransient
|
||||||
from tkutil import color_tk2gtk, color_gtk2tk
|
from tkutil import color_tk2gtk, color_gtk2tk
|
||||||
|
from soundoptionsdialog import SoundOptionsDialog
|
||||||
from selectcardset import SelectCardsetDialogWithPreview
|
from selectcardset import SelectCardsetDialogWithPreview
|
||||||
from selecttile import SelectTileDialogWithPreview
|
from selecttile import SelectTileDialogWithPreview
|
||||||
|
|
||||||
|
@ -190,12 +191,15 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
('playeroptions', None,
|
('playeroptions', None,
|
||||||
ltk2gtk('&Player options...'), None,
|
ltk2gtk('&Player options...'), None,
|
||||||
None,self.mOptPlayerOptions),
|
None,self.mOptPlayerOptions),
|
||||||
('tabletile', None,
|
('sound', None,
|
||||||
ltk2gtk('Table t&ile...'), None,
|
ltk2gtk('&Sound...'), None,
|
||||||
None,self.mOptTableTile),
|
None, self.mOptSoundDialog),
|
||||||
('cardset', None,
|
('cardset', None,
|
||||||
ltk2gtk('Cards&et...'), '<control>E',
|
ltk2gtk('Cards&et...'), '<control>E',
|
||||||
None, self.mSelectCardsetDialog),
|
None, self.mSelectCardsetDialog),
|
||||||
|
('tabletile', None,
|
||||||
|
ltk2gtk('Table t&ile...'), None,
|
||||||
|
None, self.mOptTableTile),
|
||||||
('fonts', None,
|
('fonts', None,
|
||||||
ltk2gtk('&Fonts...'), None,
|
ltk2gtk('&Fonts...'), None,
|
||||||
None, self.mOptFonts),
|
None, self.mOptFonts),
|
||||||
|
@ -360,8 +364,9 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
<menuitem action='showhintarrowinshisenshogames'/>
|
<menuitem action='showhintarrowinshisenshogames'/>
|
||||||
</menu>
|
</menu>
|
||||||
<separator/>
|
<separator/>
|
||||||
<menuitem action='tabletile'/>
|
<menuitem action='sound'/>
|
||||||
<menuitem action='cardset'/>
|
<menuitem action='cardset'/>
|
||||||
|
<menuitem action='tabletile'/>
|
||||||
<menu action='animations'>
|
<menu action='animations'>
|
||||||
<menuitem action='animationnone'/>
|
<menuitem action='animationnone'/>
|
||||||
<menuitem action='animationtimer'/>
|
<menuitem action='animationtimer'/>
|
||||||
|
@ -431,6 +436,10 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
menu = ui_manager.get_widget('/menubar/select').get_submenu()
|
menu = ui_manager.get_widget('/menubar/select').get_submenu()
|
||||||
self._createSelectMenu(games, menu)
|
self._createSelectMenu(games, menu)
|
||||||
|
|
||||||
|
if self.app.audio.audiodev is None:
|
||||||
|
item = ui_manager.get_widget('/menubar/options/sound')
|
||||||
|
item.set_sensitive(False)
|
||||||
|
|
||||||
menubar = ui_manager.get_widget('/menubar')
|
menubar = ui_manager.get_widget('/menubar')
|
||||||
return menubar
|
return menubar
|
||||||
|
|
||||||
|
@ -751,6 +760,11 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
self.game.quitGame(d.gameid, random=d.random)
|
self.game.quitGame(d.gameid, random=d.random)
|
||||||
|
|
||||||
|
|
||||||
|
def mOptSoundDialog(self, *args):
|
||||||
|
if self._cancelDrag(break_pause=False): return
|
||||||
|
d = SoundOptionsDialog(self.top, _('Sound settings'), self.app)
|
||||||
|
|
||||||
|
|
||||||
def mOptTableTile(self, *args):
|
def mOptTableTile(self, *args):
|
||||||
if self._cancelDrag(break_pause=False): return
|
if self._cancelDrag(break_pause=False): return
|
||||||
key = self.app.tabletile_index
|
key = self.app.tabletile_index
|
||||||
|
@ -762,11 +776,15 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
key=key)
|
key=key)
|
||||||
if d.status == 0 and d.button in (0, 1):
|
if d.status == 0 and d.button in (0, 1):
|
||||||
if type(d.key) is str:
|
if type(d.key) is str:
|
||||||
tile = self.app.tabletile_manager.get(0)
|
self._mOptTableColor(d.key)
|
||||||
tile.color = color
|
|
||||||
self.app.setTile(0)
|
|
||||||
elif d.key > 0 and d.key != self.app.tabletile_index:
|
elif d.key > 0 and d.key != self.app.tabletile_index:
|
||||||
self.app.setTile(i)
|
self._mOptTableTile(d.key)
|
||||||
|
## if type(d.key) is str:
|
||||||
|
## tile = self.app.tabletile_manager.get(0)
|
||||||
|
## tile.color = d.color
|
||||||
|
## self.app.setTile(0)
|
||||||
|
## elif d.key > 0 and d.key != self.app.tabletile_index:
|
||||||
|
## self.app.setTile(i)
|
||||||
|
|
||||||
|
|
||||||
def mSelectCardsetDialog(self, *event):
|
def mSelectCardsetDialog(self, *event):
|
||||||
|
|
|
@ -83,11 +83,11 @@ class PysolTreeView:
|
||||||
selection = self.treeview.get_selection()
|
selection = self.treeview.get_selection()
|
||||||
##selection.select_path(self._selected_row)
|
##selection.select_path(self._selected_row)
|
||||||
##selection.unselect_all()
|
##selection.unselect_all()
|
||||||
gtk.idle_add(selection.select_path, self._selected_row)
|
gobject.idle_add(selection.select_path, self._selected_row)
|
||||||
if self._vadjustment_position is not None:
|
if self._vadjustment_position is not None:
|
||||||
##self.sw_vadjustment.set_value(self._vadjustment_position)
|
##self.sw_vadjustment.set_value(self._vadjustment_position)
|
||||||
gtk.idle_add(self.sw_vadjustment.set_value,
|
gobject.idle_add(self.sw_vadjustment.set_value,
|
||||||
self._vadjustment_position)
|
self._vadjustment_position)
|
||||||
|
|
||||||
|
|
||||||
def _saveExpandedRows(self):
|
def _saveExpandedRows(self):
|
||||||
|
|
|
@ -146,18 +146,17 @@ class SelectTileDialogWithPreview(MfxDialog):
|
||||||
##canvas.deleteAllItems()
|
##canvas.deleteAllItems()
|
||||||
if type(key) is str:
|
if type(key) is str:
|
||||||
# solid color
|
# solid color
|
||||||
|
canvas.setTile(self.app, 0, force=True)
|
||||||
canvas.config(bg=key)
|
canvas.config(bg=key)
|
||||||
canvas.setBackgroundImage(None)
|
##canvas.setTextColor(None)
|
||||||
canvas.setTextColor(None)
|
|
||||||
self.preview_key = key
|
self.preview_key = key
|
||||||
self.colors['table'] = key
|
self.table_color = key
|
||||||
else:
|
else:
|
||||||
# image
|
# image
|
||||||
tile = self.manager.get(key)
|
if self.preview.setTile(self.app, key):
|
||||||
if tile:
|
self.preview_key = key
|
||||||
if self.preview.setTile(self.app, key):
|
else:
|
||||||
return
|
self.preview_key = -1
|
||||||
self.preview_key = -1
|
|
||||||
|
|
||||||
|
|
||||||
def initKw(self, kw):
|
def initKw(self, kw):
|
||||||
|
@ -206,7 +205,7 @@ class SelectTileDialogWithPreview(MfxDialog):
|
||||||
self.key = self.preview_key
|
self.key = self.preview_key
|
||||||
self.status = 0
|
self.status = 0
|
||||||
self.button = b
|
self.button = b
|
||||||
self.hide()
|
##self.hide()
|
||||||
self.quit()
|
self.quit()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
## vim:ts=4:et:nowrap
|
|
||||||
##
|
|
||||||
##---------------------------------------------------------------------------##
|
##---------------------------------------------------------------------------##
|
||||||
##
|
##
|
||||||
## PySol -- a Python Solitaire game
|
## PySol -- a Python Solitaire game
|
||||||
##
|
##
|
||||||
## Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
## Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
## Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
##
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This program is free software; you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
## the Free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -23,28 +17,139 @@
|
||||||
## If not, write to the Free Software Foundation, Inc.,
|
## If not, write to the Free Software Foundation, Inc.,
|
||||||
## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## Markus F.X.J. Oberhumer
|
|
||||||
## <markus.oberhumer@jk.uni-linz.ac.at>
|
|
||||||
## http://wildsau.idv.uni-linz.ac.at/mfx/pysol.html
|
|
||||||
##
|
|
||||||
##---------------------------------------------------------------------------##
|
##---------------------------------------------------------------------------##
|
||||||
|
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
import os, sys
|
import os, sys
|
||||||
import gtk
|
import gtk
|
||||||
|
from gtk import glade
|
||||||
|
|
||||||
# PySol imports
|
# PySol imports
|
||||||
|
|
||||||
# Toolkit imports
|
# Toolkit imports
|
||||||
from tkwidget import MfxDialog
|
from tkwidget import MfxDialog
|
||||||
|
|
||||||
|
gettext = _
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
# //
|
# //
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
class SoundOptionsDialog(MfxDialog):
|
class SoundOptionsDialog:
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
pass
|
saved_opt = app.opt.copy()
|
||||||
|
|
||||||
|
glade_file = app.dataloader.findFile('pysolfc.glade')
|
||||||
|
self.widgets_tree = gtk.glade.XML(glade_file)
|
||||||
|
|
||||||
|
keys = [
|
||||||
|
('areyousure', _('Are You Sure')),
|
||||||
|
|
||||||
|
('deal', _('Deal')),
|
||||||
|
('dealwaste', _('Deal waste')),
|
||||||
|
|
||||||
|
('turnwaste', _('Turn waste')),
|
||||||
|
('startdrag', _('Start drag')),
|
||||||
|
|
||||||
|
('drop', _('Drop')),
|
||||||
|
('droppair', _('Drop pair')),
|
||||||
|
('autodrop', _('Auto drop')),
|
||||||
|
|
||||||
|
('flip', _('Flip')),
|
||||||
|
('autoflip', _('Auto flip')),
|
||||||
|
('move', _('Move')),
|
||||||
|
('nomove', _('No move')),
|
||||||
|
|
||||||
|
('undo', _('Undo')),
|
||||||
|
('redo', _('Redo')),
|
||||||
|
|
||||||
|
('autopilotlost', _('Autopilot lost')),
|
||||||
|
('autopilotwon', _('Autopilot won')),
|
||||||
|
|
||||||
|
('gamefinished', _('Game finished')),
|
||||||
|
('gamelost', _('Game lost')),
|
||||||
|
('gamewon', _('Game won')),
|
||||||
|
('gameperfect', _('Perfect game')),
|
||||||
|
]
|
||||||
|
|
||||||
|
table = self.widgets_tree.get_widget('samples_table')
|
||||||
|
samples_checkbuttons = {}
|
||||||
|
row = 0
|
||||||
|
col = 0
|
||||||
|
for n, t in keys:
|
||||||
|
check = gtk.CheckButton(t)
|
||||||
|
check.show()
|
||||||
|
check.set_active(app.opt.sound_samples[n])
|
||||||
|
samples_checkbuttons[n] = check
|
||||||
|
table.attach(check,
|
||||||
|
col, col+1, row, row+1,
|
||||||
|
gtk.FILL|gtk.EXPAND, gtk.FILL,
|
||||||
|
4, 4)
|
||||||
|
if col == 1:
|
||||||
|
col = 0
|
||||||
|
row += 1
|
||||||
|
else:
|
||||||
|
col = 1
|
||||||
|
|
||||||
|
w = self.widgets_tree.get_widget('enable_checkbutton')
|
||||||
|
w.set_active(app.opt.sound)
|
||||||
|
dic = {}
|
||||||
|
for n in 'sample', 'music':
|
||||||
|
def callback(w, n=n):
|
||||||
|
sp = self.widgets_tree.get_widget(n+'_spinbutton')
|
||||||
|
sc = self.widgets_tree.get_widget(n+'_scale')
|
||||||
|
sp.set_value(sc.get_value())
|
||||||
|
dic[n+'_scale_value_changed'] = callback
|
||||||
|
def callback(w, n=n):
|
||||||
|
sp = self.widgets_tree.get_widget(n+'_spinbutton')
|
||||||
|
sc = self.widgets_tree.get_widget(n+'_scale')
|
||||||
|
sc.set_value(sp.get_value())
|
||||||
|
dic[n+'_spinbutton_value_changed'] = callback
|
||||||
|
self.widgets_tree.signal_autoconnect(dic)
|
||||||
|
w = self.widgets_tree.get_widget('sample_spinbutton')
|
||||||
|
w.set_value(app.opt.sound_sample_volume)
|
||||||
|
w = self.widgets_tree.get_widget('music_spinbutton')
|
||||||
|
w.set_value(app.opt.sound_music_volume)
|
||||||
|
|
||||||
|
self._translateLabels()
|
||||||
|
|
||||||
|
dialog = self.widgets_tree.get_widget('sounds_dialog')
|
||||||
|
dialog.set_title(title)
|
||||||
|
dialog.set_transient_for(parent)
|
||||||
|
|
||||||
|
while True: # for `apply'
|
||||||
|
response = dialog.run()
|
||||||
|
if response in (gtk.RESPONSE_OK, gtk.RESPONSE_APPLY):
|
||||||
|
w = self.widgets_tree.get_widget('enable_checkbutton')
|
||||||
|
app.opt.sound = w.get_active()
|
||||||
|
w = self.widgets_tree.get_widget('sample_spinbutton')
|
||||||
|
app.opt.soun_sample_volume = w.get_value()
|
||||||
|
w = self.widgets_tree.get_widget('music_spinbutton')
|
||||||
|
app.opt.sound_music_volume = w.get_value()
|
||||||
|
for n, t in keys:
|
||||||
|
w = samples_checkbuttons[n]
|
||||||
|
app.opt.sound_samples[n] = w.get_active()
|
||||||
|
else:
|
||||||
|
app.opt = saved_opt
|
||||||
|
if app.audio:
|
||||||
|
app.audio.updateSettings()
|
||||||
|
if response == gtk.RESPONSE_APPLY:
|
||||||
|
app.audio.playSample('drop', priority=1000)
|
||||||
|
if response != gtk.RESPONSE_APPLY:
|
||||||
|
dialog.destroy()
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
def _translateLabels(self):
|
||||||
|
for n in (
|
||||||
|
'label76',
|
||||||
|
'label77',
|
||||||
|
'label78',
|
||||||
|
):
|
||||||
|
w = self.widgets_tree.get_widget(n)
|
||||||
|
w.set_text(gettext(w.get_text()))
|
||||||
|
w = self.widgets_tree.get_widget('enable_checkbutton')
|
||||||
|
w.set_label(gettext(w.get_label()))
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,9 @@ class MfxCanvas(gnome.canvas.Canvas):
|
||||||
self._text_color = '#000000'
|
self._text_color = '#000000'
|
||||||
#
|
#
|
||||||
gnome.canvas.Canvas.__init__(self)
|
gnome.canvas.Canvas.__init__(self)
|
||||||
self.top_bg = top.style.bg[gtk.STATE_NORMAL]
|
c = top.style.bg[gtk.STATE_NORMAL]
|
||||||
|
c = '#%02x%02x%02x' % (c.red/256, c.green/256, c.blue/256)
|
||||||
|
self.top_bg = c
|
||||||
if bg is not None:
|
if bg is not None:
|
||||||
self.modify_bg(gtk.STATE_NORMAL, gdk.color_parse(bg))
|
self.modify_bg(gtk.STATE_NORMAL, gdk.color_parse(bg))
|
||||||
|
|
||||||
|
@ -419,8 +421,8 @@ class MfxCanvas(gnome.canvas.Canvas):
|
||||||
|
|
||||||
# PySol extension - set a tiled background image
|
# PySol extension - set a tiled background image
|
||||||
def setTile(self, app, i, force=False):
|
def setTile(self, app, i, force=False):
|
||||||
|
##print 'setTile:', i
|
||||||
tile = app.tabletile_manager.get(i)
|
tile = app.tabletile_manager.get(i)
|
||||||
##print 'setTile', i, tile
|
|
||||||
if tile is None or tile.error:
|
if tile is None or tile.error:
|
||||||
return False
|
return False
|
||||||
if i == 0:
|
if i == 0:
|
||||||
|
@ -439,9 +441,7 @@ class MfxCanvas(gnome.canvas.Canvas):
|
||||||
#
|
#
|
||||||
self._tile = tile
|
self._tile = tile
|
||||||
if i == 0:
|
if i == 0:
|
||||||
if self.__tileimage:
|
self.setBackgroundImage(None)
|
||||||
self.__tileimage.destroy()
|
|
||||||
self.__tileimage = None
|
|
||||||
self.configure(bg=tile.color)
|
self.configure(bg=tile.color)
|
||||||
##app.top.config(bg=tile.color)
|
##app.top.config(bg=tile.color)
|
||||||
color = None
|
color = None
|
||||||
|
@ -473,7 +473,7 @@ class MfxCanvas(gnome.canvas.Canvas):
|
||||||
self.realize()
|
self.realize()
|
||||||
##return False
|
##return False
|
||||||
|
|
||||||
gtk.idle_add(self.setBackgroundImage, filename, stretch)
|
gobject.idle_add(self.setBackgroundImage, filename, stretch)
|
||||||
|
|
||||||
|
|
||||||
def setBackgroundImage(self, filename, stretch=False):
|
def setBackgroundImage(self, filename, stretch=False):
|
||||||
|
|
|
@ -266,7 +266,7 @@ def unbind_destroy(widget):
|
||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
def after(widget, ms, func, *args):
|
def after(widget, ms, func, *args):
|
||||||
timer = gtk.timeout_add(ms, func, *args)
|
timer = gobject.timeout_add(ms, func, *args)
|
||||||
return timer
|
return timer
|
||||||
|
|
||||||
def after_idle(widget, func, *args):
|
def after_idle(widget, func, *args):
|
||||||
|
@ -275,7 +275,7 @@ def after_idle(widget, func, *args):
|
||||||
|
|
||||||
def after_cancel(t):
|
def after_cancel(t):
|
||||||
if t is not None:
|
if t is not None:
|
||||||
gtk.timeout_remove(t)
|
gobject.source_remove(t)
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
__all__ = ['PysolMenubar']
|
__all__ = ['PysolMenubar']
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
import math, os, re, types
|
import math, os, re
|
||||||
import Tkinter, tkColorChooser, tkFileDialog
|
import Tkinter, tkColorChooser, tkFileDialog
|
||||||
|
|
||||||
# PySol imports
|
# PySol imports
|
||||||
|
@ -53,8 +53,8 @@ from pysollib.pysolaudio import pysolsoundserver
|
||||||
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE, CURSOR_WATCH, COMPOUNDS
|
from tkconst import EVENT_HANDLED, EVENT_PROPAGATE, CURSOR_WATCH, COMPOUNDS
|
||||||
from tkutil import bind, after_idle
|
from tkutil import bind, after_idle
|
||||||
from selectgame import SelectGameDialog, SelectGameDialogWithPreview
|
from selectgame import SelectGameDialog, SelectGameDialogWithPreview
|
||||||
|
from soundoptionsdialog import SoundOptionsDialog
|
||||||
from selectcardset import SelectCardsetDialogWithPreview
|
from selectcardset import SelectCardsetDialogWithPreview
|
||||||
from selectcardset import SelectCardsetByTypeDialogWithPreview
|
|
||||||
from selecttile import SelectTileDialogWithPreview
|
from selecttile import SelectTileDialogWithPreview
|
||||||
|
|
||||||
#from toolbar import TOOLBAR_BUTTONS
|
#from toolbar import TOOLBAR_BUTTONS
|
||||||
|
@ -895,6 +895,11 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
self.game.saveGame(filename)
|
self.game.saveGame(filename)
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
|
|
||||||
|
def mOptSoundDialog(self, *args):
|
||||||
|
if self._cancelDrag(break_pause=False): return
|
||||||
|
d = SoundOptionsDialog(self.top, _("Sound settings"), self.app)
|
||||||
|
self.tkopt.sound.set(self.app.opt.sound)
|
||||||
|
|
||||||
def mOptAutoFaceUp(self, *args):
|
def mOptAutoFaceUp(self, *args):
|
||||||
if self._cancelDrag(): return
|
if self._cancelDrag(): return
|
||||||
self.app.opt.autofaceup = self.tkopt.autofaceup.get()
|
self.app.opt.autofaceup = self.tkopt.autofaceup.get()
|
||||||
|
@ -1036,19 +1041,9 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
def mOptChangeCardback(self, *event):
|
def mOptChangeCardback(self, *event):
|
||||||
self._mOptCardback(self.app.cardset.backindex + 1)
|
self._mOptCardback(self.app.cardset.backindex + 1)
|
||||||
|
|
||||||
def _mOptTableTile(self, i):
|
## def mOptTableTile(self, *event):
|
||||||
if self.app.setTile(i):
|
## if self._cancelDrag(break_pause=False): return
|
||||||
self.tkopt.tabletile.set(i)
|
## self._mOptTableTile(self.tkopt.tabletile.get())
|
||||||
|
|
||||||
def _mOptTableColor(self, color):
|
|
||||||
tile = self.app.tabletile_manager.get(0)
|
|
||||||
tile.color = color
|
|
||||||
if self.app.setTile(0):
|
|
||||||
self.tkopt.tabletile.set(0)
|
|
||||||
|
|
||||||
def mOptTableTile(self, *event):
|
|
||||||
if self._cancelDrag(break_pause=False): return
|
|
||||||
self._mOptTableTile(self.tkopt.tabletile.get())
|
|
||||||
|
|
||||||
def mOptChangeTableTile(self, *event):
|
def mOptChangeTableTile(self, *event):
|
||||||
if self._cancelDrag(break_pause=False): return
|
if self._cancelDrag(break_pause=False): return
|
||||||
|
@ -1067,7 +1062,7 @@ class PysolMenubar(PysolMenubarActions):
|
||||||
manager=self.app.tabletile_manager,
|
manager=self.app.tabletile_manager,
|
||||||
key=key)
|
key=key)
|
||||||
if d.status == 0 and d.button in (0, 1):
|
if d.status == 0 and d.button in (0, 1):
|
||||||
if type(d.key) is types.StringType:
|
if type(d.key) is str:
|
||||||
self._mOptTableColor(d.key)
|
self._mOptTableColor(d.key)
|
||||||
elif d.key > 0 and d.key != self.app.tabletile_index:
|
elif d.key > 0 and d.key != self.app.tabletile_index:
|
||||||
self._mOptTableTile(d.key)
|
self._mOptTableTile(d.key)
|
||||||
|
|
|
@ -190,7 +190,7 @@ class SelectTileDialogWithPreview(MfxDialog):
|
||||||
return
|
return
|
||||||
canvas = self.preview.canvas
|
canvas = self.preview.canvas
|
||||||
canvas.deleteAllItems()
|
canvas.deleteAllItems()
|
||||||
if type(key) in types.StringTypes:
|
if type(key) in str:
|
||||||
# solid color
|
# solid color
|
||||||
canvas.config(bg=key)
|
canvas.config(bg=key)
|
||||||
canvas.setTile(None)
|
canvas.setTile(None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue