From 010c0011aa5add1c3f984caa1b4d5fde842ec187 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 14 Mar 2018 13:34:56 -0600 Subject: [PATCH] Posted event codes and task bar icons --- src/controller/buffersController.py | 2 +- src/multiplatform_widgets/widgets.py | 6 +++--- src/widgetUtils/wxUtils.py | 5 +++-- src/wxUI/sysTrayIcon.py | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index c563411b..79f1d2df 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -610,7 +610,7 @@ class baseBufferController(bufferController): # fix this: original_date = arrow.get(self.session.db[self.name][self.buffer.list.get_selected()]["created_at"], "ddd MMM D H:m:s Z YYYY", locale="en") ts = original_date.humanize(locale=languageHandler.getLanguage()) - self.buffer.list.list.SetStringItem(self.buffer.list.get_selected(), 2, ts) + self.buffer.list.list.SetItem(self.buffer.list.get_selected(), 2, ts) if self.session.settings['sound']['indicate_audio'] and utils.is_audio(tweet): self.session.sound.play("audio.ogg") if self.session.settings['sound']['indicate_geo'] and utils.is_geocoded(tweet): diff --git a/src/multiplatform_widgets/widgets.py b/src/multiplatform_widgets/widgets.py index 13a50c1e..0ab06d07 100644 --- a/src/multiplatform_widgets/widgets.py +++ b/src/multiplatform_widgets/widgets.py @@ -37,9 +37,9 @@ class list(object): if self.system == "Windows": if reversed == False: items = self.list.GetItemCount() else: items = 0 - self.list.InsertStringItem(items, item[0]) - for i in xrange(1, len(self.columns)): - self.list.SetStringItem(items, i, item[i]) + self.list.InsertItem(items, str(item[0])) + for i in range(1, len(self.columns)): + self.list.SetItem(items, i, str(item[i])) else: self.list.Append(" ".join(item)) diff --git a/src/widgetUtils/wxUtils.py b/src/widgetUtils/wxUtils.py index a6247859..79577960 100644 --- a/src/widgetUtils/wxUtils.py +++ b/src/widgetUtils/wxUtils.py @@ -1,4 +1,5 @@ import wx +import wx.adv import paths import languageHandler import sys @@ -52,8 +53,8 @@ NOTEBOOK_PAGE_CHANGED = wx.EVT_TREEBOOK_PAGE_CHANGED RADIOBUTTON = wx.EVT_RADIOBUTTON # Taskbar mouse clicks. -TASKBAR_RIGHT_CLICK = wx.EVT_TASKBAR_RIGHT_DOWN -TASKBAR_LEFT_CLICK = wx.EVT_TASKBAR_LEFT_DOWN +TASKBAR_RIGHT_CLICK = wx.adv.EVT_TASKBAR_RIGHT_DOWN +TASKBAR_LEFT_CLICK = wx.adv.EVT_TASKBAR_LEFT_DOWN def exit_application(): """ Closes the current window cleanly. """ diff --git a/src/wxUI/sysTrayIcon.py b/src/wxUI/sysTrayIcon.py index b1221ee2..2ceffa25 100644 --- a/src/wxUI/sysTrayIcon.py +++ b/src/wxUI/sysTrayIcon.py @@ -19,11 +19,12 @@ ############################################################ import wx +import wx.adv import application import paths import os -class SysTrayIcon(wx.TaskBarIcon): +class SysTrayIcon(wx.adv.TaskBarIcon): def __init__(self): super(SysTrayIcon, self).__init__()