Fix #948: New Release Dialog does not show server version

This commit is contained in:
Calum Lind 2011-07-05 18:30:11 +01:00
parent b512a664c6
commit a701fddbe8
2 changed files with 44 additions and 9 deletions

View File

@ -1231,13 +1231,13 @@ This will filter torrents for the current selection on the sidebar.</property>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property> <property name="top_attach">2</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">3</property>
<property name="x_options"></property> <property name="x_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label25"> <widget class="GtkLabel" id="label_available_version_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
@ -1245,13 +1245,13 @@ This will filter torrents for the current selection on the sidebar.</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </widget>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">2</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label_current_version"> <widget class="GtkLabel" id="label_client_version">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</widget> </widget>
@ -1262,7 +1262,7 @@ This will filter torrents for the current selection on the sidebar.</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label24"> <widget class="GtkLabel" id="label_client_version_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
@ -1273,6 +1273,30 @@ This will filter torrents for the current selection on the sidebar.</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="label_server_version_text">
<property name="visible">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;Server Version&lt;/i&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_server_version">
<property name="visible">False</property>
</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_options"></property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>

View File

@ -37,6 +37,7 @@
import deluge.component as component import deluge.component as component
import deluge.common import deluge.common
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
from deluge.ui.client import client
class NewReleaseDialog: class NewReleaseDialog:
def __init__(self): def __init__(self):
@ -53,7 +54,7 @@ class NewReleaseDialog:
else: else:
glade.get_widget("image_new_release").set_from_icon_name("deluge", 4) glade.get_widget("image_new_release").set_from_icon_name("deluge", 4)
glade.get_widget("label_available_version").set_text(available_version) glade.get_widget("label_available_version").set_text(available_version)
glade.get_widget("label_current_version").set_text( glade.get_widget("label_client_version").set_text(
deluge.common.get_version()) deluge.common.get_version())
self.chk_not_show_dialog = glade.get_widget("chk_do_not_show_new_release") self.chk_not_show_dialog = glade.get_widget("chk_do_not_show_new_release")
glade.get_widget("button_goto_downloads").connect( glade.get_widget("button_goto_downloads").connect(
@ -61,7 +62,17 @@ class NewReleaseDialog:
glade.get_widget("button_close_new_release").connect( glade.get_widget("button_close_new_release").connect(
"clicked", self._on_button_close_new_release) "clicked", self._on_button_close_new_release)
self.dialog.show_all() if client.connected():
def on_info(version):
glade.get_widget("label_server_version").set_text(version)
glade.get_widget("label_server_version").show()
glade.get_widget("label_server_version_text").show()
if not client.is_classicmode():
glade.get_widget("label_client_version_text").set_label(_("<i>Client Version</i>"))
client.daemon.info().addCallback(on_info)
self.dialog.show()
def _on_button_goto_downloads(self, widget): def _on_button_goto_downloads(self, widget):
deluge.common.open_url_in_browser("http://deluge-torrent.org") deluge.common.open_url_in_browser("http://deluge-torrent.org")