diff --git a/src/check_for_new_version.py b/src/check_for_new_version.py deleted file mode 100644 index 99bc64ac8..000000000 --- a/src/check_for_new_version.py +++ /dev/null @@ -1,96 +0,0 @@ -## check_for_new_version.py -## -## Gajim Team: -## - Yann Le Boulanger -## - Vincent Hanquez -## - Nikos Kouremenos -## -## Copyright (C) 2003-2005 Gajim Team -## -## 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 the Free Software Foundation; version 2 only. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## - -import gtk -import gtk.glade - -from common import gajim -from common import helpers -from common import i18n - -_ = i18n._ -APP = i18n.APP -gtk.glade.bindtextdomain(APP, i18n.DIR) -gtk.glade.textdomain(APP) - -GTKGUI_GLADE='gtkgui.glade' - -class Check_for_new_version_dialog: - def __init__(self): - try: - self.check_for_new_version() - except: - pass - - def parse_glade(self): - xml = gtk.glade.XML(GTKGUI_GLADE, 'new_version_available_dialog', APP) - self.window = xml.get_widget('new_version_available_dialog') - self.information_label = xml.get_widget('information_label') - self.changes_textview = xml.get_widget('changes_textview') - xml.signal_autoconnect(self) - - def on_new_version_available_dialog_delete_event(self, widget, event): - self.window.destroy() - - def on_open_download_page_button_clicked(self, widget): - url = 'http://www.gajim.org/downloads.php?lang=' - helpers.launch_browser_mailer('url', url) - self.window.destroy() - - def check_for_new_version(self): - '''parse online Changelog to find out last version - and the changes for that latest version''' - import urllib2 - import socket - dto = socket.getdefaulttimeout() - socket.setdefaulttimeout(5) - - url = 'http://trac.gajim.org/file/trunk/Changelog?rev=latest&format=txt' - changelog = urllib2.urlopen(url) - - socket.setdefaulttimeout(dto) - - # format is 'Gajim version (date)' - first_line = changelog.readline() - finish_version = first_line.find(' ', 6) # start search after 'Gajim' - latest_version = first_line[6:finish_version] - if float(latest_version) > float(gajim.version): - start_date = finish_version + 2 # one space and one ( - date = first_line[start_date:-2] # remove the last ) and \n - info = 'Gajim ' + latest_version + ' was released in ' + date + '!' - changes = '' - while True: - line = changelog.readline().lstrip() - if line.startswith('Gajim'): - break - else: - if line != '\n' or line !='': # line has some content - if not line.startswith('*'): - # the is not a new *real* line - # but a continuation from previous line. - # So remove \n from previous 'line' beforing adding it - changes = changes[:-1] - - changes += line - - self.parse_glade() - self.information_label.set_text(info) - buf = self.changes_textview.get_buffer() - buf.set_text(changes) - self.window.show_all() diff --git a/src/common/config.py b/src/common/config.py index a037ed890..ac454aac6 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -113,7 +113,6 @@ class Config: 'before_nickname': [ opt_str, '' ], 'after_nickname': [ opt_str, ':' ], 'send_os_info': [ opt_bool, True ], - 'check_for_new_version': [ opt_bool, False ], 'usegpg': [ opt_bool, False ], 'use_gpg_agent': [ opt_bool, False ], 'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')], diff --git a/src/config.py b/src/config.py index d6864332f..060e07111 100644 --- a/src/config.py +++ b/src/config.py @@ -396,11 +396,6 @@ class PreferencesWindow: # send os info st = gajim.config.get('send_os_info') self.xml.get_widget('send_os_info_checkbutton').set_active(st) - - # check for new version - st = gajim.config.get('check_for_new_version') - btn = self.xml.get_widget('check_for_new_version_checkbutton') - btn.set_active(st) self.xml.signal_autoconnect(self) @@ -879,9 +874,6 @@ class PreferencesWindow: def on_send_os_info_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'send_os_info') - def on_check_for_new_version_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'check_for_new_version') - def fill_msg_treeview(self): self.xml.get_widget('delete_msg_button').set_sensitive(False) model = self.msg_tree.get_model() diff --git a/src/gajim.py b/src/gajim.py index 85aff5019..532494abd 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -94,7 +94,6 @@ import gtkgui_helpers import notify import common.sleepy -import check_for_new_version from common import socks5 from common import gajim @@ -1377,8 +1376,6 @@ class Interface: if self.systray_capabilities and gajim.config.get('trayicon'): self.show_systray() - if gajim.config.get('check_for_new_version'): - check_for_new_version.Check_for_new_version_dialog() self.init_emoticons() self.make_regexps() diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 034753dc3..fc88d5ab2 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -6126,26 +6126,6 @@ Custom False - - - - True - True - Check for new _version on Gajim startup - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - -