From acb8c5acd38f6535b908a65c84c9e7d1a55269df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Thu, 27 Nov 2014 07:18:05 -0600 Subject: [PATCH] TWBlue starts automatically if there is only an account --- src/gui/main.py | 2 +- src/main.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/gui/main.py b/src/gui/main.py index 189a72ac..cacbf5ec 100644 --- a/src/gui/main.py +++ b/src/gui/main.py @@ -504,7 +504,7 @@ class mainFrame(wx.Frame): dlg = dialogs.lists.removeUserListDialog(self) if dlg.ShowModal() == wx.ID_OK: try: - list = self.twitter.twitter.delete_list_member(list_id=self.db.settings["lists"][dlg.get_selected()]["id"], screen_name=user) + list = self.twitter.twitter.delete_list_member(list_id=self.db.settings["lists"][dlg.lista.get_selected()]["id"], screen_name=user) older_list = twitter.utils.find_item(self.db.settings["lists"][dlg.get_selected()]["id"], self.db.settings["lists"]) if list["mode"] == "private": self.db.settings["lists"].pop(older_list) diff --git a/src/main.py b/src/main.py index 7b4ed5a3..7cf5f49c 100644 --- a/src/main.py +++ b/src/main.py @@ -20,7 +20,7 @@ A twitter accessible, easy of use and cross platform application.""" # ############################################################ import wx - +import os ssmg = None import gui import paths @@ -32,14 +32,32 @@ from sessionmanager import manager from sessionmanager import gui as smGUI manager.setup() import sys +import config +import output +import sound +import languageHandler if hasattr(sys, 'frozen'): sys.stderr = open(paths.logs_path("stderr.log"), 'w') sys.stdout = open(paths.logs_path("stdout.log"), 'w') app = wx.App() -ssmg = smGUI.sessionManagerWindow() -if ssmg.ShowModal() == wx.ID_OK: +configured = False +configs = [] +for i in os.listdir(paths.config_path()): + if os.path.isdir(paths.config_path(i)): configs.append(i) +if len(configs) == 1: + manager.manager.set_current_session(configs[0]) + config.MAINFILE = "%s/session.conf" % (manager.manager.get_current_session()) + config.setup() + lang=config.main['general']['language'] + languageHandler.setLanguage(lang) + sound.setup() + output.setup() + configured = True +else: + ssmg = smGUI.sessionManagerWindow() +if configured == True or ssmg.ShowModal() == wx.ID_OK: frame = gui.main.mainFrame() frame.Show() frame.showing = True