[gnome-games/sudoku-tube] Finetune the dialog
- From: Zhang Sen <zhangsen src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games/sudoku-tube] Finetune the dialog
- Date: Sat, 15 Aug 2009 09:39:56 +0000 (UTC)
commit 52c71a600631307004e4171b0270065d6ad3633f
Author: Zhang Sen <zh jesse gmail com>
Date: Sat Aug 15 17:37:24 2009 +0800
Finetune the dialog
Seems something wrong with attributes:
<attribute name="weight" value="semibold"/>
My glade=3.6.2 doesn't write it as above, causing a crash of sudoku
gnome-sudoku/data/network_game_offer.ui | 23 ++++++++++++++++++++---
gnome-sudoku/src/lib/main.py | 7 ++++---
gnome-sudoku/src/lib/tube_handler.py | 11 +++++++----
3 files changed, 31 insertions(+), 10 deletions(-)
---
diff --git a/gnome-sudoku/data/network_game_offer.ui b/gnome-sudoku/data/network_game_offer.ui
index 3279b6f..bad125e 100644
--- a/gnome-sudoku/data/network_game_offer.ui
+++ b/gnome-sudoku/data/network_game_offer.ui
@@ -13,13 +13,30 @@
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <object class="GtkLabel" id="label">
+ <object class="GtkLabel" id="name_label">
<property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">label</property>
+ <property name="selectable">True</property>
+ <attributes>
+ <attribute name="weight" value="semibold"/>
+ <attribute name="scale" value="1.200000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="info_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">label</property>
<property name="selectable">True</property>
</object>
<packing>
- <property name="padding">12</property>
<property name="position">1</property>
</packing>
</child>
@@ -59,7 +76,7 @@
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index 496e189..647d273 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -461,13 +461,14 @@ class SudokuGame(gconf_wrapper.GConfWrapper):
self._tube_offer = tp_tube.TubeOffer(
conn, handle, self._tube_service, puzzle)
- _connecting_label = gtk.Label(_("Connecting..."))
+ connecting_label = gtk.Label(_("Connecting..."))
self._wait_dialog = gtk.Dialog("Sending request...",
self.w,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
- _connecting_label.show()
- self._wait_dialog.vbox.pack_start(_connecting_label)
+ connecting_label.set_padding(12, 12)
+ connecting_label.show()
+ self._wait_dialog.vbox.pack_start(connecting_label)
self._wait_dialog.connect("response", self._wait_dialog_response_cb)
self._tube_offer.connect("offer-succeeded",
diff --git a/gnome-sudoku/src/lib/tube_handler.py b/gnome-sudoku/src/lib/tube_handler.py
index d3f54e6..b734b48 100644
--- a/gnome-sudoku/src/lib/tube_handler.py
+++ b/gnome-sudoku/src/lib/tube_handler.py
@@ -98,6 +98,8 @@ class TubeHandler(dbus.service.Object):
else:
logger.debug("deny tube offer")
self._tube_chan[CHANNEL_INTERFACE].Close()
+ dialog.destroy()
+
try:
puzzle = params['puzzle']
except KeyError:
@@ -114,10 +116,11 @@ class TubeHandler(dbus.service.Object):
dialog.set_default_response(gtk.RESPONSE_OK)
dialog.connect("response", reply_cb)
- label = builder.get_object("label")
+ name_label = builder.get_object("name_label")
+ name_label.set_text(_("%s wants to play with you") % alias)
+
info = sudoku.SudokuRater(self._puzzle).difficulty()
- label.set_text(_("%s wants to play with you.\n\n%s") %
- (alias, info.to_string()))
+ info_label = builder.get_object("info_label")
+ info_label.set_text(info.to_string())
dialog.run()
- dialog.destroy()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]