New snapshot

This commit is contained in:
Manuel Cortez 2015-04-22 15:34:44 -05:00
parent 96671645bb
commit f51c873324
7 changed files with 31 additions and 16 deletions

View File

@ -5,7 +5,7 @@ if snapshot == False:
version = "0.80"
update_url = 'http://twblue.es/updates/twblue_ngen.json'
else:
version = "9"
version = "9.1"
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
author = u"Manuel Cortéz"
authorEmail = "manuel@manuelcortez.net"

View File

@ -1173,7 +1173,7 @@ class Controller(object):
webbrowser.open(application.url)
def manage_accounts(self, *args, **kwargs):
sm = sessionManager.sessionManagerController()
sm = sessionManager.sessionManagerController(started=True)
sm.fill_list()
sm.show()
for i in sm.new_sessions:

View File

@ -6,9 +6,6 @@ import locale
import gettext
import paths
import platform
import logging
log = logging.getLogger("languageHandler")
# A fix for the mac locales
#if platform.system() == 'Darwin':
@ -119,7 +116,6 @@ def makePgettext(translations):
return pgettext
def setLanguage(lang):
log.debug("Setting language for: %s" % (lang,))
system = platform.system()
global curLang
try:
@ -130,10 +126,12 @@ def setLanguage(lang):
elif system == "Darwin":
import Foundation
localeName = Foundation.NSLocale.currentLocale().identifier()
else:
elif system == "Linux":
localeName = locale.getdefaultlocale()[0]
trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
curLang=localeName
# else:
# localeName=locale.getdefaultlocale()[0]
# trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
# curLang=localeName
@ -165,7 +163,6 @@ def setLanguage(lang):
trans=gettext.translation("twblue",fallback=True)
curLang="en"
trans.install(unicode=True)
# log.debug(u"Current language: %s" % (curLang,))
# Install our pgettext function.
# __builtin__.__dict__["pgettext"] = makePgettext(trans)
@ -197,7 +194,6 @@ def langToWindowsLocale(lang):
"fr": "fre_FRA",
"gl": "glc",
"eu": "euq",
"hr": "hrv",
"hu": "hun",
"it": "ita",
"pl": "plk",

View File

@ -9,8 +9,10 @@ class sessionManagerWindow(widgetUtils.baseDialog):
btnBox = Gtk.Box(spacing=6)
self.new = Gtk.Button("New account")
self.remove = Gtk.Button("Remove account")
self.configuration = Gtk.Button("Configuration")
btnBox.add(self.new)
btnBox.add(self.remove)
btnBox.add(self.configuration)
self.box.add(btnBox)
self.show_all()

View File

@ -4,6 +4,7 @@ import widgetUtils
import platform
if platform.system() == "Windows":
import wxUI as view
from controller import settings
elif platform.system() == "Linux":
import gtkUI as view
import paths
@ -18,13 +19,18 @@ import config
log = logging.getLogger("sessionmanager.sessionManager")
class sessionManagerController(object):
def __init__(self):
def __init__(self, started=False):
super(sessionManagerController, self).__init__()
log.debug("Setting up the session manager.")
self.started = started
manager.setup()
self.view = view.sessionManagerWindow()
widgetUtils.connect_event(self.view.new, widgetUtils.BUTTON_PRESSED, self.manage_new_account)
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.remove)
if self.started == False:
widgetUtils.connect_event(self.view.configuration, widgetUtils.BUTTON_PRESSED, self.configuration)
else:
self.view.hide_configuration()
self.new_sessions = {}
self.removed_sessions = []
@ -87,3 +93,9 @@ class sessionManagerController(object):
self.sessions.remove(selected_account)
shutil.rmtree(path=paths.config_path(selected_account), ignore_errors=True)
def configuration(self, *args, **kwargs):
""" Opens the global settings dialogue."""
d = settings.globalSettingsController()
if d.response == widgetUtils.OK:
d.save_configuration()

View File

@ -15,11 +15,13 @@ class sessionManagerWindow(wx.Dialog):
sizer.Add(listSizer, 0, wx.ALL, 5)
self.new = wx.Button(panel, -1, u"New account", size=wx.DefaultSize)
self.remove = wx.Button(panel, -1, _(u"Remove account"))
self.configuration = wx.Button(panel, -1, _(u"Global Settings"))
ok = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
ok.SetDefault()
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
buttons = wx.BoxSizer(wx.HORIZONTAL)
buttons.Add(self.new, 0, wx.ALL, 5)
buttons.Add(self.configuration, 0, wx.ALL, 5)
buttons.Add(ok, 0, wx.ALL, 5)
buttons.Add(cancel, 0, wx.ALL, 5)
sizer.Add(buttons, 0, wx.ALL, 5)
@ -66,3 +68,6 @@ class sessionManagerWindow(wx.Dialog):
def remove_session(self, sessionID):
self.list.remove_item(sessionID)
def hide_configuration(self):
self.configuration.Hide()

View File

@ -5,7 +5,7 @@ import platform
from wxUpdater import *
def do_update():
# try:
try:
return update.perform_update(endpoint=application.update_url, current_version=application.version, app_name=application.name, update_available_callback=available_update_dialog, progress_callback=progress_callback, update_complete_callback=update_finished)
# except:
# pass
except:
pass