Пример #1
0
    def OnInit(self):
        self.SetAppName(config.APP_NAME)
        self.SetVendorName(config.VENDOR_NAME)

        try:
            os.makedirs(config.get_config_dir())
        except OSError:
            pass
        self.config = wx.FileConfig( config.APP_NAME,
                                     config.VENDOR_NAME,
                                     localFilename=os.path.join(config.get_config_dir(),
                                                  config.CONFIG_FILE_NAME))
        wx.ConfigBase_Set(self.config)

        frame = ParentFrame(None)
        self.SetTopWindow(frame)
        frame.Show(True)
        return True
Пример #2
0
    def __init__(self, parent):
        aui.AuiMDIParentFrame.__init__(self, parent, -1,
                                          title="Conveggie a convore client",
                                          name="parentframe",
                                          size=(500,700),
                                          style=wx.DEFAULT_FRAME_STYLE)

        self.menu_items = {}

        self._persistance_mgr = PersistenceManager.Get()
        self._persistance_mgr.SetPersistenceFile(os.path.join(config.get_config_dir(), "ui.cfg"))

        self.request_queue = Queue.Queue()
        self.live_queue = Queue.Queue()
        self.convore_reader = ConvoreReader(self.request_queue)
        self.convore_reader.start()
        self.convore_live = ConvoreLive(self.live_queue, self.request_queue)
        self.convore_live.start()

        commands.request.set_queue(self.request_queue)

        Publisher().subscribe(self.on_group_selected, 'ui.convore.dashboard.group_selected')
        Publisher().subscribe(self.on_topic_selected, 'ui.convore.group.topic_selected')
        Publisher().subscribe(self._link_clicked, 'ui.convore.link_clicked')

        commands.response.subscribe(self._data_response_error, 'data_error')
        commands.response.subscribe(self._check_login, 'convore_login')

        s = wx.aui.AuiSimpleTabArt()
        self.SetArtProvider(s)
        self._create_menu()
        self.CreateStatusBar()

        self.Bind(wx.EVT_MENU, self._evt_menu, id=wx.ID_EXIT)
        self.Bind(wx.EVT_MENU, self._evt_menu, id=self.menu_items['your_groups'].GetId())
        self.Bind(wx.EVT_MENU, self._evt_menu, id=self.menu_items['live_stream'].GetId())

        self._persistance_mgr.RegisterAndRestore(self)


        self.SetIcon(self._make_icon())

        wx.CallAfter(self._login_and_fetch)