some better stuff for my previous commit [new version related]
This commit is contained in:
parent
3a46243f4d
commit
616d8de422
|
@ -14,13 +14,14 @@ GTKGUI_GLADE='plugins/gtkgui/gtkgui.glade'
|
||||||
class Check_for_new_version_dialog:
|
class Check_for_new_version_dialog:
|
||||||
def __init__(self, plugin):
|
def __init__(self, plugin):
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
|
self.check_for_new_version()
|
||||||
|
|
||||||
|
def parse_glade(self):
|
||||||
xml = gtk.glade.XML(GTKGUI_GLADE, 'new_version_available_dialog', APP)
|
xml = gtk.glade.XML(GTKGUI_GLADE, 'new_version_available_dialog', APP)
|
||||||
self.window = xml.get_widget('new_version_available_dialog')
|
self.window = xml.get_widget('new_version_available_dialog')
|
||||||
self.information_label = xml.get_widget('information_label')
|
self.information_label = xml.get_widget('information_label')
|
||||||
self.changes_textview = xml.get_widget('changes_textview')
|
self.changes_textview = xml.get_widget('changes_textview')
|
||||||
xml.signal_autoconnect(self)
|
xml.signal_autoconnect(self)
|
||||||
self.check_for_new_version()
|
|
||||||
|
|
||||||
|
|
||||||
def on_new_version_available_dialog_delete_event(self, widget, event):
|
def on_new_version_available_dialog_delete_event(self, widget, event):
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
@ -28,6 +29,7 @@ class Check_for_new_version_dialog:
|
||||||
def on_open_download_page_button_clicked(self, widget):
|
def on_open_download_page_button_clicked(self, widget):
|
||||||
url = 'http://www.gajim.org/downloads.php?lang='
|
url = 'http://www.gajim.org/downloads.php?lang='
|
||||||
self.plugin.launch_browser_mailer('url', url)
|
self.plugin.launch_browser_mailer('url', url)
|
||||||
|
self.window.destroy()
|
||||||
|
|
||||||
def check_for_new_version(self):
|
def check_for_new_version(self):
|
||||||
'''parse online Changelog to find out last version
|
'''parse online Changelog to find out last version
|
||||||
|
@ -46,8 +48,7 @@ class Check_for_new_version_dialog:
|
||||||
if latest_version > version.version:
|
if latest_version > version.version:
|
||||||
start_date = finish_version + 2 # one space and one (
|
start_date = finish_version + 2 # one space and one (
|
||||||
date = first_line[start_date:-2] # remove the last ) and \n
|
date = first_line[start_date:-2] # remove the last ) and \n
|
||||||
text = 'Gajim ' + latest_version + ' was released in ' + date + '!'
|
info = 'Gajim ' + latest_version + ' was released in ' + date + '!'
|
||||||
self.information_label.set_text(text)
|
|
||||||
changes = ''
|
changes = ''
|
||||||
while True:
|
while True:
|
||||||
line = changelog.readline()
|
line = changelog.readline()
|
||||||
|
@ -57,6 +58,8 @@ class Check_for_new_version_dialog:
|
||||||
if line != '\n':
|
if line != '\n':
|
||||||
changes += line
|
changes += line
|
||||||
|
|
||||||
|
self.parse_glade()
|
||||||
|
self.information_label.set_text(info)
|
||||||
buf = self.changes_textview.get_buffer()
|
buf = self.changes_textview.get_buffer()
|
||||||
buf.set_text(changes)
|
buf.set_text(changes)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
|
@ -10253,6 +10253,7 @@ send a chat message to</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkFrame" id="frame28">
|
<widget class="GtkFrame" id="frame28">
|
||||||
|
<property name="border_width">5</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label_xalign">0</property>
|
<property name="label_xalign">0</property>
|
||||||
<property name="label_yalign">0.5</property>
|
<property name="label_yalign">0.5</property>
|
||||||
|
@ -10286,7 +10287,7 @@ send a chat message to</property>
|
||||||
<property name="overwrite">False</property>
|
<property name="overwrite">False</property>
|
||||||
<property name="accepts_tab">True</property>
|
<property name="accepts_tab">True</property>
|
||||||
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
||||||
<property name="wrap_mode">GTK_WRAP_NONE</property>
|
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||||
<property name="cursor_visible">False</property>
|
<property name="cursor_visible">False</property>
|
||||||
<property name="pixels_above_lines">0</property>
|
<property name="pixels_above_lines">0</property>
|
||||||
<property name="pixels_below_lines">0</property>
|
<property name="pixels_below_lines">0</property>
|
||||||
|
|
Loading…
Reference in New Issue