mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
New snapshot
This commit is contained in:
parent
96671645bb
commit
f51c873324
@ -5,7 +5,7 @@ if snapshot == False:
|
|||||||
version = "0.80"
|
version = "0.80"
|
||||||
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
||||||
else:
|
else:
|
||||||
version = "9"
|
version = "9.1"
|
||||||
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
||||||
author = u"Manuel Cortéz"
|
author = u"Manuel Cortéz"
|
||||||
authorEmail = "manuel@manuelcortez.net"
|
authorEmail = "manuel@manuelcortez.net"
|
||||||
|
@ -1173,7 +1173,7 @@ class Controller(object):
|
|||||||
webbrowser.open(application.url)
|
webbrowser.open(application.url)
|
||||||
|
|
||||||
def manage_accounts(self, *args, **kwargs):
|
def manage_accounts(self, *args, **kwargs):
|
||||||
sm = sessionManager.sessionManagerController()
|
sm = sessionManager.sessionManagerController(started=True)
|
||||||
sm.fill_list()
|
sm.fill_list()
|
||||||
sm.show()
|
sm.show()
|
||||||
for i in sm.new_sessions:
|
for i in sm.new_sessions:
|
||||||
|
@ -6,9 +6,6 @@ import locale
|
|||||||
import gettext
|
import gettext
|
||||||
import paths
|
import paths
|
||||||
import platform
|
import platform
|
||||||
import logging
|
|
||||||
|
|
||||||
log = logging.getLogger("languageHandler")
|
|
||||||
|
|
||||||
# A fix for the mac locales
|
# A fix for the mac locales
|
||||||
#if platform.system() == 'Darwin':
|
#if platform.system() == 'Darwin':
|
||||||
@ -119,7 +116,6 @@ def makePgettext(translations):
|
|||||||
return pgettext
|
return pgettext
|
||||||
|
|
||||||
def setLanguage(lang):
|
def setLanguage(lang):
|
||||||
log.debug("Setting language for: %s" % (lang,))
|
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
global curLang
|
global curLang
|
||||||
try:
|
try:
|
||||||
@ -130,10 +126,12 @@ def setLanguage(lang):
|
|||||||
elif system == "Darwin":
|
elif system == "Darwin":
|
||||||
import Foundation
|
import Foundation
|
||||||
localeName = Foundation.NSLocale.currentLocale().identifier()
|
localeName = Foundation.NSLocale.currentLocale().identifier()
|
||||||
else:
|
elif system == "Linux":
|
||||||
localeName=locale.getdefaultlocale()[0]
|
localeName = locale.getdefaultlocale()[0]
|
||||||
trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
|
trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
|
||||||
curLang=localeName
|
curLang=localeName
|
||||||
|
# else:
|
||||||
|
# localeName=locale.getdefaultlocale()[0]
|
||||||
# trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
|
# trans=gettext.translation('twblue', localedir=paths.locale_path(), languages=[localeName])
|
||||||
# curLang=localeName
|
# curLang=localeName
|
||||||
|
|
||||||
@ -165,7 +163,6 @@ def setLanguage(lang):
|
|||||||
trans=gettext.translation("twblue",fallback=True)
|
trans=gettext.translation("twblue",fallback=True)
|
||||||
curLang="en"
|
curLang="en"
|
||||||
trans.install(unicode=True)
|
trans.install(unicode=True)
|
||||||
# log.debug(u"Current language: %s" % (curLang,))
|
|
||||||
# Install our pgettext function.
|
# Install our pgettext function.
|
||||||
# __builtin__.__dict__["pgettext"] = makePgettext(trans)
|
# __builtin__.__dict__["pgettext"] = makePgettext(trans)
|
||||||
|
|
||||||
@ -191,13 +188,12 @@ def langToWindowsLocale(lang):
|
|||||||
languages = {"en": "eng",
|
languages = {"en": "eng",
|
||||||
"ar": "ara",
|
"ar": "ara",
|
||||||
"ca": "cat",
|
"ca": "cat",
|
||||||
"de": "deu",
|
"de": "deu",
|
||||||
"es": "esp",
|
"es": "esp",
|
||||||
"fi": "fin",
|
"fi": "fin",
|
||||||
"fr": "fre_FRA",
|
"fr": "fre_FRA",
|
||||||
"gl": "glc",
|
"gl": "glc",
|
||||||
"eu": "euq",
|
"eu": "euq",
|
||||||
"hr": "hrv",
|
|
||||||
"hu": "hun",
|
"hu": "hun",
|
||||||
"it": "ita",
|
"it": "ita",
|
||||||
"pl": "plk",
|
"pl": "plk",
|
||||||
|
@ -9,8 +9,10 @@ class sessionManagerWindow(widgetUtils.baseDialog):
|
|||||||
btnBox = Gtk.Box(spacing=6)
|
btnBox = Gtk.Box(spacing=6)
|
||||||
self.new = Gtk.Button("New account")
|
self.new = Gtk.Button("New account")
|
||||||
self.remove = Gtk.Button("Remove account")
|
self.remove = Gtk.Button("Remove account")
|
||||||
|
self.configuration = Gtk.Button("Configuration")
|
||||||
btnBox.add(self.new)
|
btnBox.add(self.new)
|
||||||
btnBox.add(self.remove)
|
btnBox.add(self.remove)
|
||||||
|
btnBox.add(self.configuration)
|
||||||
self.box.add(btnBox)
|
self.box.add(btnBox)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import widgetUtils
|
|||||||
import platform
|
import platform
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
import wxUI as view
|
import wxUI as view
|
||||||
|
from controller import settings
|
||||||
elif platform.system() == "Linux":
|
elif platform.system() == "Linux":
|
||||||
import gtkUI as view
|
import gtkUI as view
|
||||||
import paths
|
import paths
|
||||||
@ -18,13 +19,18 @@ import config
|
|||||||
log = logging.getLogger("sessionmanager.sessionManager")
|
log = logging.getLogger("sessionmanager.sessionManager")
|
||||||
|
|
||||||
class sessionManagerController(object):
|
class sessionManagerController(object):
|
||||||
def __init__(self):
|
def __init__(self, started=False):
|
||||||
super(sessionManagerController, self).__init__()
|
super(sessionManagerController, self).__init__()
|
||||||
log.debug("Setting up the session manager.")
|
log.debug("Setting up the session manager.")
|
||||||
|
self.started = started
|
||||||
manager.setup()
|
manager.setup()
|
||||||
self.view = view.sessionManagerWindow()
|
self.view = view.sessionManagerWindow()
|
||||||
widgetUtils.connect_event(self.view.new, widgetUtils.BUTTON_PRESSED, self.manage_new_account)
|
widgetUtils.connect_event(self.view.new, widgetUtils.BUTTON_PRESSED, self.manage_new_account)
|
||||||
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.remove)
|
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.new_sessions = {}
|
||||||
self.removed_sessions = []
|
self.removed_sessions = []
|
||||||
|
|
||||||
@ -87,3 +93,9 @@ class sessionManagerController(object):
|
|||||||
self.sessions.remove(selected_account)
|
self.sessions.remove(selected_account)
|
||||||
shutil.rmtree(path=paths.config_path(selected_account), ignore_errors=True)
|
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()
|
||||||
|
@ -15,11 +15,13 @@ class sessionManagerWindow(wx.Dialog):
|
|||||||
sizer.Add(listSizer, 0, wx.ALL, 5)
|
sizer.Add(listSizer, 0, wx.ALL, 5)
|
||||||
self.new = wx.Button(panel, -1, u"New account", size=wx.DefaultSize)
|
self.new = wx.Button(panel, -1, u"New account", size=wx.DefaultSize)
|
||||||
self.remove = wx.Button(panel, -1, _(u"Remove account"))
|
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 = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
|
||||||
ok.SetDefault()
|
ok.SetDefault()
|
||||||
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
|
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
|
||||||
buttons = wx.BoxSizer(wx.HORIZONTAL)
|
buttons = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
buttons.Add(self.new, 0, wx.ALL, 5)
|
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(ok, 0, wx.ALL, 5)
|
||||||
buttons.Add(cancel, 0, wx.ALL, 5)
|
buttons.Add(cancel, 0, wx.ALL, 5)
|
||||||
sizer.Add(buttons, 0, wx.ALL, 5)
|
sizer.Add(buttons, 0, wx.ALL, 5)
|
||||||
@ -66,3 +68,6 @@ class sessionManagerWindow(wx.Dialog):
|
|||||||
def remove_session(self, sessionID):
|
def remove_session(self, sessionID):
|
||||||
self.list.remove_item(sessionID)
|
self.list.remove_item(sessionID)
|
||||||
|
|
||||||
|
|
||||||
|
def hide_configuration(self):
|
||||||
|
self.configuration.Hide()
|
@ -5,7 +5,7 @@ import platform
|
|||||||
from wxUpdater import *
|
from wxUpdater import *
|
||||||
|
|
||||||
def do_update():
|
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)
|
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:
|
except:
|
||||||
# pass
|
pass
|
Loading…
Reference in New Issue
Block a user