From f4e20f8ed481534d2cae68c82102232cc482fc73 Mon Sep 17 00:00:00 2001 From: Jose Manuel Delicado Date: Sun, 12 Aug 2018 13:38:39 +0200 Subject: [PATCH] Load libvlccore.dll before importing the sound module --- .../AudioUploader/wx_transfer_dialogs.py | 2 +- src/extra/autocompletionUsers/wx_menu.py | 2 +- src/main.py | 12 +-- src/wxUI/dialogs/attach.py | 6 +- src/wxUI/dialogs/configuration.py | 42 +++++----- src/wxUI/dialogs/filterDialogs.py | 20 ++--- src/wxUI/dialogs/lists.py | 2 +- src/wxUI/dialogs/message.py | 10 +-- src/wxUI/dialogs/show_user.py | 2 +- src/wxUI/dialogs/utils.py | 2 +- src/wxUI/menus.py | 70 ++++++++-------- src/wxUI/view.py | 84 +++++++++---------- 12 files changed, 128 insertions(+), 126 deletions(-) diff --git a/src/extra/AudioUploader/wx_transfer_dialogs.py b/src/extra/AudioUploader/wx_transfer_dialogs.py index 61bb17a1..c209ad5e 100644 --- a/src/extra/AudioUploader/wx_transfer_dialogs.py +++ b/src/extra/AudioUploader/wx_transfer_dialogs.py @@ -6,7 +6,7 @@ import widgetUtils class UploadDialog(widgetUtils.BaseDialog): def __init__(self, filename, *args, **kwargs): - super(UploadDialog, self).__init__(parent=None, id=wx.NewId(), *args, **kwargs) + super(UploadDialog, self).__init__(parent=None, id=wx.ID_ANY, *args, **kwargs) self.pane = wx.Panel(self) self.progress_bar = wx.Gauge(parent=self.pane) fileBox = wx.BoxSizer(wx.HORIZONTAL) diff --git a/src/extra/autocompletionUsers/wx_menu.py b/src/extra/autocompletionUsers/wx_menu.py index 4861bd5b..55d81458 100644 --- a/src/extra/autocompletionUsers/wx_menu.py +++ b/src/extra/autocompletionUsers/wx_menu.py @@ -10,7 +10,7 @@ class menu(wx.Menu): def append_options(self, options): for i in options: - item = wx.MenuItem(self, wx.NewId(), "%s (@%s)" % (i[1], i[0])) + item = wx.MenuItem(self, wx.ID_ANY, "%s (@%s)" % (i[1], i[0])) self.AppendItem(item) self.Bind(wx.EVT_MENU, lambda evt, temp=i[0]: self.select_text(evt, temp), item) diff --git a/src/main.py b/src/main.py index ae35a2d3..39722b06 100644 --- a/src/main.py +++ b/src/main.py @@ -19,14 +19,12 @@ if os.path.exists(paths.app_path(u"Uninstall.exe")): paths.mode="installed" import commandline import config -import sound import output import logging import application import keys from mysc.thread_utils import call_threaded import fixes -#extra variables to control the temporary stdout and stderr, while the final files are opened. We understand that some errors could happen while all outputs are closed, so let's try to avoid it. import widgetUtils import webbrowser from wxUI import commonMessageDialogs @@ -47,14 +45,18 @@ if system == "Windows": arch="x86" if platform.architecture()[0][:2] == "64": arch="x64" - os.environ['PYTHON_VLC_MODULE_PATH']=paths.app_path("..", "windows-dependencies", arch, "plugins") - os.environ['PYTHON_VLC_LIB_PATH']=paths.app_path("..", "windows-dependencies", arch, "libvlc.dll") + os.environ['PYTHON_VLC_MODULE_PATH']=os.path.abspath(paths.app_path("..", "windows-dependencies", arch)) + os.environ['PYTHON_VLC_LIB_PATH']=os.path.abspath(paths.app_path("..", "windows-dependencies", arch, "libvlc.dll")) + # I don't know why libvlccore.dll needs to be loaded first, but it works when doing it + from ctypes import CDLL + CDLL(os.path.abspath(paths.app_path("..", "windows-dependencies", arch, "libvlccore.dll"))) #the final log files have been opened succesfully, let's close the temporary files stdout_temp.close() stderr_temp.close() - #finally, remove the temporal files. TW Blue doesn't need them anymore, and we will get more free space on the harddrive + #finally, remove the temporary files. TW Blue doesn't need them anymore, and we will get more free space on the harddrive os.remove(stdout_temp.name) os.remove(stderr_temp.name) +import sound if system == "Linux": from gi.repository import Gdk, GObject, GLib diff --git a/src/wxUI/dialogs/attach.py b/src/wxUI/dialogs/attach.py index b3e97376..50da4743 100644 --- a/src/wxUI/dialogs/attach.py +++ b/src/wxUI/dialogs/attach.py @@ -9,15 +9,15 @@ class attachDialog(widgetUtils.BaseDialog): super(attachDialog, self).__init__(None, title=_(u"Add an attachment")) panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) - lbl1 = wx.StaticText(panel, wx.NewId(), _(u"Attachments")) + lbl1 = wx.StaticText(panel, wx.ID_ANY, _(u"Attachments")) self.attachments = widgets.list(panel, _(u"Type"), _(u"Title"), style=wx.LC_REPORT) box = wx.BoxSizer(wx.HORIZONTAL) box.Add(lbl1, 0, wx.ALL, 5) box.Add(self.attachments.list, 0, wx.ALL, 5) sizer.Add(box, 0, wx.ALL, 5) static = wx.StaticBox(panel, label=_(u"Add attachments")) - self.photo = wx.Button(panel, wx.NewId(), _(u"&Photo")) - self.remove = wx.Button(panel, wx.NewId(), _(u"Remove attachment")) + self.photo = wx.Button(panel, wx.ID_ANY, _(u"&Photo")) + self.remove = wx.Button(panel, wx.ID_ANY, _(u"Remove attachment")) self.remove.Enable(False) btnsizer = wx.StaticBoxSizer(static, wx.HORIZONTAL) btnsizer.Add(self.photo, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/configuration.py b/src/wxUI/dialogs/configuration.py index 2dfba02a..09b85b90 100644 --- a/src/wxUI/dialogs/configuration.py +++ b/src/wxUI/dialogs/configuration.py @@ -26,7 +26,7 @@ class general(wx.Panel, baseDialog.BaseWXDialog): sizer.Add(self.no_streaming, 0, wx.ALL, 5) updatePeriodBox = wx.BoxSizer(wx.HORIZONTAL) updatePeriodBox.Add(wx.StaticText(self, -1, _(u"Buffer update interval, in minutes")), 0, wx.ALL, 5) - self.update_period = wx.SpinCtrl(self, wx.NewId()) + self.update_period = wx.SpinCtrl(self, wx.ID_ANY) self.update_period.SetRange(1, 30) self.update_period.SetSize(self.update_period.GetBestSize()) updatePeriodBox.Add(self.update_period, 0, wx.ALL, 5) @@ -41,7 +41,7 @@ class general(wx.Panel, baseDialog.BaseWXDialog): sizer.Add(self.disable_sapi5, 0, wx.ALL, 5) self.hide_gui = wx.CheckBox(self, -1, _(u"Hide GUI on launch")) sizer.Add(self.hide_gui, 0, wx.ALL, 5) - self.handle_longtweets = wx.CheckBox(self, wx.NewId(), _(u"Use Codeofdusk's longtweet handlers (may decrease client performance)")) + self.handle_longtweets = wx.CheckBox(self, wx.ID_ANY, _(u"Use Codeofdusk's longtweet handlers (may decrease client performance)")) sizer.Add(self.handle_longtweets, 0, wx.ALL, 5) self.remember_mention_and_longtweet = wx.CheckBox(self, -1, _(u"Remember state for mention all and long tweet")) sizer.Add(self.remember_mention_and_longtweet, 0, wx.ALL, 5) @@ -61,33 +61,33 @@ class proxy(wx.Panel, baseDialog.BaseWXDialog): def __init__(self, parent, proxyTypes): super(proxy, self).__init__(parent) sizer = wx.BoxSizer(wx.VERTICAL) - type=wx.StaticText(self, wx.NewId(), _(u"Proxy type: ")) + type=wx.StaticText(self, wx.ID_ANY, _(u"Proxy type: ")) self.type=wx.ComboBox(self, -1, choices=proxyTypes, style=wx.CB_READONLY) self.type.SetSize(self.type.GetBestSize()) typeBox = wx.BoxSizer(wx.HORIZONTAL) typeBox.Add(type, 0, wx.ALL, 5) typeBox.Add(self.type, 0, wx.ALL, 5) sizer.Add(typeBox, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"Proxy server: ")) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"Proxy server: ")) self.server = wx.TextCtrl(self, -1) serverBox = wx.BoxSizer(wx.HORIZONTAL) serverBox.Add(lbl, 0, wx.ALL, 5) serverBox.Add(self.server, 0, wx.ALL, 5) sizer.Add(serverBox, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"Port: ")) - self.port = wx.TextCtrl(self, wx.NewId()) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"Port: ")) + self.port = wx.TextCtrl(self, wx.ID_ANY) portBox = wx.BoxSizer(wx.HORIZONTAL) portBox.Add(lbl, 0, wx.ALL, 5) portBox.Add(self.port, 0, wx.ALL, 5) sizer.Add(portBox, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"User: ")) - self.user = wx.TextCtrl(self, wx.NewId()) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"User: ")) + self.user = wx.TextCtrl(self, wx.ID_ANY) userBox = wx.BoxSizer(wx.HORIZONTAL) userBox.Add(lbl, 0, wx.ALL, 5) userBox.Add(self.user, 0, wx.ALL, 5) sizer.Add(userBox, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"Password: ")) - self.password = wx.TextCtrl(self, wx.NewId(), style=wx.TE_PASSWORD) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"Password: ")) + self.password = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PASSWORD) passwordBox = wx.BoxSizer(wx.HORIZONTAL) passwordBox.Add(lbl, 0, wx.ALL, 5) passwordBox.Add(self.password, 0, wx.ALL, 5) @@ -98,34 +98,34 @@ class generalAccount(wx.Panel, baseDialog.BaseWXDialog): def __init__(self, parent): super(generalAccount, self).__init__(parent) sizer = wx.BoxSizer(wx.VERTICAL) - self.au = wx.Button(self, wx.NewId(), _(u"Autocompletion settings...")) + self.au = wx.Button(self, wx.ID_ANY, _(u"Autocompletion settings...")) sizer.Add(self.au, 0, wx.ALL, 5) - self.relative_time = wx.CheckBox(self, wx.NewId(), _(U"Relative timestamps")) + self.relative_time = wx.CheckBox(self, wx.ID_ANY, _(U"Relative timestamps")) sizer.Add(self.relative_time, 0, wx.ALL, 5) if application.streaming_lives(): apiCallsBox = wx.BoxSizer(wx.HORIZONTAL) apiCallsBox.Add(wx.StaticText(self, -1, _(u"API calls (One API call = 200 tweets, two API calls = 400 tweets, etc):")), 0, wx.ALL, 5) - self.apiCalls = wx.SpinCtrl(self, wx.NewId()) + self.apiCalls = wx.SpinCtrl(self, wx.ID_ANY) self.apiCalls.SetRange(1, 10) self.apiCalls.SetSize(self.apiCalls.GetBestSize()) apiCallsBox.Add(self.apiCalls, 0, wx.ALL, 5) sizer.Add(apiCallsBox, 0, wx.ALL, 5) tweetsPerCallBox = wx.BoxSizer(wx.HORIZONTAL) tweetsPerCallBox.Add(wx.StaticText(self, -1, _(u"Items on each API call")), 0, wx.ALL, 5) - self.itemsPerApiCall = wx.SpinCtrl(self, wx.NewId()) + self.itemsPerApiCall = wx.SpinCtrl(self, wx.ID_ANY) self.itemsPerApiCall.SetRange(0, 200) self.itemsPerApiCall.SetSize(self.itemsPerApiCall.GetBestSize()) tweetsPerCallBox.Add(self.itemsPerApiCall, 0, wx.ALL, 5) sizer.Add(tweetsPerCallBox, 0, wx.ALL, 5) - self.reverse_timelines = wx.CheckBox(self, wx.NewId(), _(u"Inverted buffers: The newest tweets will be shown at the beginning while the oldest at the end")) + self.reverse_timelines = wx.CheckBox(self, wx.ID_ANY, _(u"Inverted buffers: The newest tweets will be shown at the beginning while the oldest at the end")) sizer.Add(self.reverse_timelines, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"Retweet mode")) - self.retweet_mode = wx.ComboBox(self, wx.NewId(), choices=[_(u"Ask"), _(u"Retweet without comments"), _(u"Retweet with comments")], style=wx.CB_READONLY) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"Retweet mode")) + self.retweet_mode = wx.ComboBox(self, wx.ID_ANY, choices=[_(u"Ask"), _(u"Retweet without comments"), _(u"Retweet with comments")], style=wx.CB_READONLY) rMode = wx.BoxSizer(wx.HORIZONTAL) rMode.Add(lbl, 0, wx.ALL, 5) rMode.Add(self.retweet_mode, 0, wx.ALL, 5) sizer.Add(rMode, 0, wx.ALL, 5) - self.show_screen_names = wx.CheckBox(self, wx.NewId(), _(U"Show screen names instead of full names")) + self.show_screen_names = wx.CheckBox(self, wx.ID_ANY, _(U"Show screen names instead of full names")) sizer.Add(self.show_screen_names, 0, wx.ALL, 5) PersistSizeLabel = wx.StaticText(self, -1, _(u"Number of items per buffer to cache in database (0 to disable caching, blank for unlimited)")) self.persist_size = wx.TextCtrl(self, -1) @@ -137,9 +137,9 @@ class reporting(wx.Panel, baseDialog.BaseWXDialog): def __init__(self, parent): super(reporting, self).__init__(parent) sizer = wx.BoxSizer(wx.VERTICAL) - self.speech_reporting = wx.CheckBox(self, wx.NewId(), _(U"Enable automatic speech feedback")) + self.speech_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic speech feedback")) sizer.Add(self.speech_reporting, 0, wx.ALL, 5) - self.braille_reporting = wx.CheckBox(self, wx.NewId(), _(U"Enable automatic Braille feedback")) + self.braille_reporting = wx.CheckBox(self, wx.ID_ANY, _(U"Enable automatic Braille feedback")) sizer.Add(self.braille_reporting, 0, wx.ALL, 5) self.SetSizer(sizer) @@ -326,7 +326,7 @@ class extrasPanel(wx.Panel): ocrLanguageSizer = wx.StaticBoxSizer(OCRBox, wx.HORIZONTAL) ocrLanguageSizer.Add(self.ocr_lang, 0, wx.ALL, 5) mainSizer.Add(ocrLanguageSizer, 0, wx.ALL, 5) - lbl = wx.StaticText(self, wx.NewId(), _(u"API Key for SndUp")) + lbl = wx.StaticText(self, wx.ID_ANY, _(u"API Key for SndUp")) self.sndup_apiKey = wx.TextCtrl(self, -1) sndupBox = wx.BoxSizer(wx.HORIZONTAL) sndupBox.Add(lbl, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/filterDialogs.py b/src/wxUI/dialogs/filterDialogs.py index f28c27a9..6430df19 100644 --- a/src/wxUI/dialogs/filterDialogs.py +++ b/src/wxUI/dialogs/filterDialogs.py @@ -11,7 +11,7 @@ class filterDialog(baseDialog.BaseWXDialog): panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) self.SetTitle(_(u"Create a filter for this buffer")) - label = wx.StaticText(panel, wx.NewId(), _(u"Filter title")) + label = wx.StaticText(panel, wx.ID_ANY, _(u"Filter title")) self.title = wx.TextCtrl(panel, -1, value) dc = wx.WindowDC(self.title) dc.SetFont(self.title.GetFont()) @@ -32,9 +32,9 @@ class filterDialog(baseDialog.BaseWXDialog): dc = wx.WindowDC(self.term) dc.SetFont(self.term.GetFont()) self.term.SetSize(dc.GetTextExtent("0"*40)) - self.allow_rts = wx.CheckBox(panel, wx.NewId(), _(u"Allow retweets")) - self.allow_quotes = wx.CheckBox(panel, wx.NewId(), _(u"Allow quoted tweets")) - self.allow_replies = wx.CheckBox(panel, wx.NewId(), _(u"Allow replies")) + self.allow_rts = wx.CheckBox(panel, wx.ID_ANY, _(u"Allow retweets")) + self.allow_quotes = wx.CheckBox(panel, wx.ID_ANY, _(u"Allow quoted tweets")) + self.allow_replies = wx.CheckBox(panel, wx.ID_ANY, _(u"Allow replies")) self.allow_rts.SetValue(True) self.allow_quotes.SetValue(True) self.allow_replies.SetValue(True) @@ -42,7 +42,7 @@ class filterDialog(baseDialog.BaseWXDialog): bsizer.Add(label, 0, wx.ALL, 5) bsizer.Add(self.term, 0, wx.ALL, 5) sizer.Add(bsizer, 0, wx.ALL, 5) - self.regexp = wx.CheckBox(panel, wx.NewId(), _(u"Use this term as a regular expression")) + self.regexp = wx.CheckBox(panel, wx.ID_ANY, _(u"Use this term as a regular expression")) sizer.Add(self.regexp, 0, wx.ALL, 5) staticbox = wx.StaticBox(panel, label=_(u"Filter by language")) self.load_language = wx.RadioButton(panel, -1, _(u"Load tweets in the following languages"), style=wx.RB_GROUP) @@ -63,13 +63,13 @@ class filterDialog(baseDialog.BaseWXDialog): langsSizer = wx.BoxSizer() langsSizer.Add(langsLabel, 0, wx.ALL, 5) langsSizer.Add(self.cb, 0, wx.ALL, 5) - self.add = wx.Button(panel, wx.NewId(), _(u"Add selected language to filter")) + self.add = wx.Button(panel, wx.ID_ANY, _(u"Add selected language to filter")) self.add.Bind(wx.EVT_BUTTON, self.add_lang) langsSizer.Add(self.add, 0, wx.ALL, 5) sizer.Add(langsSizer, 0, wx.ALL, 5) - lbl = wx.StaticText(panel, wx.NewId(), _(u"Selected languages")) + lbl = wx.StaticText(panel, wx.ID_ANY, _(u"Selected languages")) self.langs = wx.ListBox(panel, -1) - self.remove = wx.Button(panel, wx.NewId(), _(u"Remove")) + self.remove = wx.Button(panel, wx.ID_ANY, _(u"Remove")) self.remove.Bind(wx.EVT_BUTTON, self.remove_lang) selectionSizer = wx.BoxSizer(wx.HORIZONTAL) selectionSizer.Add(lbl, 0, wx.ALL, 5) @@ -125,9 +125,9 @@ class filterManagerDialog(widgetUtils.BaseDialog): sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(label) sizer.Add(self.filters.list) - self.edit = wx.Button(panel, wx.NewId(), _(u"Edit")) + self.edit = wx.Button(panel, wx.ID_ANY, _(u"Edit")) self.edit.Enable(False) - self.delete = wx.Button(panel, wx.NewId(), _(u"Remove")) + self.delete = wx.Button(panel, wx.ID_ANY, _(u"Remove")) self.cancel = wx.Button(panel, wx.ID_CANCEL) btnSizer = wx.BoxSizer() btnSizer.Add(self.edit, 0, wx.ALL, 5) diff --git a/src/wxUI/dialogs/lists.py b/src/wxUI/dialogs/lists.py index 3e5e0d74..a5914211 100644 --- a/src/wxUI/dialogs/lists.py +++ b/src/wxUI/dialogs/lists.py @@ -15,7 +15,7 @@ class listViewer(widgetUtils.BaseDialog): sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(label) sizer.Add(self.lista.list) - self.createBtn = wx.Button(panel, wx.NewId(), _(u"Create a new list")) + self.createBtn = wx.Button(panel, wx.ID_ANY, _(u"Create a new list")) self.editBtn = wx.Button(panel, -1, _(u"Edit")) self.deleteBtn = wx.Button(panel, -1, _(u"Remove")) self.view = wx.Button(panel, -1, _(u"Open in buffer")) diff --git a/src/wxUI/dialogs/message.py b/src/wxUI/dialogs/message.py index b8aef4c8..d570344b 100644 --- a/src/wxUI/dialogs/message.py +++ b/src/wxUI/dialogs/message.py @@ -98,7 +98,7 @@ class tweet(textLimited): self.ok_cancelSizer.Add(self.okButton, 0, wx.ALL, 10) self.ok_cancelSizer.Add(cancelButton, 0, wx.ALL, 10) self.mainBox.Add(self.ok_cancelSizer) - selectId = wx.NewId() + selectId = wx.ID_ANY self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) self.accel_tbl = wx.AcceleratorTable([ (wx.ACCEL_CTRL, ord('A'), selectId), @@ -157,7 +157,7 @@ class retweet(tweet): self.ok_cancelSizer.Add(self.okButton, 0, wx.ALL, 10) self.ok_cancelSizer.Add(cancelButton, 0, wx.ALL, 10) self.mainBox.Add(self.ok_cancelSizer) - selectId = wx.NewId() + selectId = wx.ID_ANY self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) self.accel_tbl = wx.AcceleratorTable([ (wx.ACCEL_CTRL, ord('A'), selectId), @@ -279,7 +279,7 @@ class reply(textLimited): self.ok_cancelSizer.Add(self.okButton, 0, wx.ALL, 10) self.ok_cancelSizer.Add(cancelButton, 0, wx.ALL, 10) self.mainBox.Add(self.ok_cancelSizer, 0, wx.ALL, 10) - selectId = wx.NewId() + selectId = wx.ID_ANY self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) self.accel_tbl = wx.AcceleratorTable([ (wx.ACCEL_CTRL, ord('A'), selectId), @@ -356,7 +356,7 @@ class viewTweet(widgetUtils.BaseDialog): buttonsBox.Add(self.translateButton, 0, wx.ALL, 5) buttonsBox.Add(cancelButton, 0, wx.ALL, 5) mainBox.Add(buttonsBox, 0, wx.ALL, 5) - selectId = wx.NewId() + selectId = wx.ID_ANY self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) self.accel_tbl = wx.AcceleratorTable([ (wx.ACCEL_CTRL, ord('A'), selectId), @@ -418,7 +418,7 @@ class viewNonTweet(widgetUtils.BaseDialog): buttonsBox.Add(self.translateButton, 0, wx.ALL, 5) buttonsBox.Add(cancelButton, 0, wx.ALL, 5) mainBox.Add(buttonsBox, 0, wx.ALL, 5) - selectId = wx.NewId() + selectId = wx.ID_ANY self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) self.accel_tbl = wx.AcceleratorTable([ (wx.ACCEL_CTRL, ord('A'), selectId), diff --git a/src/wxUI/dialogs/show_user.py b/src/wxUI/dialogs/show_user.py index a3850a7b..74b02070 100644 --- a/src/wxUI/dialogs/show_user.py +++ b/src/wxUI/dialogs/show_user.py @@ -4,7 +4,7 @@ import baseDialog class showUserProfile(baseDialog.BaseWXDialog): def __init__(self): - super(showUserProfile, self).__init__(parent=None, id=wx.NewId()) + super(showUserProfile, self).__init__(parent=None, id=wx.ID_ANY) panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) static = wx.StaticText(panel, -1, _(u"Details")) diff --git a/src/wxUI/dialogs/utils.py b/src/wxUI/dialogs/utils.py index 09da8e4a..fbc1be23 100644 --- a/src/wxUI/dialogs/utils.py +++ b/src/wxUI/dialogs/utils.py @@ -21,7 +21,7 @@ import baseDialog class selectUserDialog(baseDialog.BaseWXDialog): def __init__(self, title, users): - super(selectUserDialog, self).__init__(parent=None, id=wx.NewId(), title=title) + super(selectUserDialog, self).__init__(parent=None, id=wx.ID_ANY, title=title) panel = wx.Panel(self) userSizer = wx.BoxSizer() self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0], size=wx.DefaultSize) diff --git a/src/wxUI/menus.py b/src/wxUI/menus.py index 866816e7..8d1f2602 100644 --- a/src/wxUI/menus.py +++ b/src/wxUI/menus.py @@ -4,94 +4,94 @@ import wx class basePanelMenu(wx.Menu): def __init__(self): super(basePanelMenu, self).__init__() - self.retweet = wx.MenuItem(self, wx.NewId(), _(u"&Retweet")) + self.retweet = wx.MenuItem(self, wx.ID_ANY, _(u"&Retweet")) self.Append(self.retweet) - self.reply = wx.MenuItem(self, wx.NewId(), _(u"Re&ply")) + self.reply = wx.MenuItem(self, wx.ID_ANY, _(u"Re&ply")) self.Append(self.reply) - self.fav = wx.MenuItem(self, wx.NewId(), _(u"&Like")) + self.fav = wx.MenuItem(self, wx.ID_ANY, _(u"&Like")) self.Append(self.fav) - self.unfav = wx.MenuItem(self, wx.NewId(), _(u"&Unlike")) + self.unfav = wx.MenuItem(self, wx.ID_ANY, _(u"&Unlike")) self.Append(self.unfav) - self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL")) + self.openUrl = wx.MenuItem(self, wx.ID_ANY, _(u"&Open URL")) self.Append(self.openUrl) - self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio")) + self.play = wx.MenuItem(self, wx.ID_ANY, _(u"&Play audio")) self.Append(self.play) - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show tweet")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show tweet")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) - self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete")) + self.remove = wx.MenuItem(self, wx.ID_ANY, _(u"&Delete")) self.Append(self.remove) - self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions...")) + self.userActions = wx.MenuItem(self, wx.ID_ANY, _(u"&User actions...")) self.Append(self.userActions) class dmPanelMenu(wx.Menu): def __init__(self): super(dmPanelMenu, self).__init__() - self.reply = wx.MenuItem(self, wx.NewId(), _(u"Re&ply")) + self.reply = wx.MenuItem(self, wx.ID_ANY, _(u"Re&ply")) self.Append(self.reply) - self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL")) + self.openUrl = wx.MenuItem(self, wx.ID_ANY, _(u"&Open URL")) self.Append(self.openUrl) - self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio")) + self.play = wx.MenuItem(self, wx.ID_ANY, _(u"&Play audio")) self.Append(self.play) - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show direct message")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show direct message")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) - self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete")) + self.remove = wx.MenuItem(self, wx.ID_ANY, _(u"&Delete")) self.Append(self.remove) - self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions...")) + self.userActions = wx.MenuItem(self, wx.ID_ANY, _(u"&User actions...")) self.Append(self.userActions) class sentPanelMenu(wx.Menu): def __init__(self): super(sentPanelMenu, self).__init__() - self.openUrl = wx.MenuItem(self, wx.NewId(), _(u"&Open URL")) + self.openUrl = wx.MenuItem(self, wx.ID_ANY, _(u"&Open URL")) self.Append(self.openUrl) - self.play = wx.MenuItem(self, wx.NewId(), _(u"&Play audio")) + self.play = wx.MenuItem(self, wx.ID_ANY, _(u"&Play audio")) self.Append(self.play) - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show tweet")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show tweet")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) - self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete")) + self.remove = wx.MenuItem(self, wx.ID_ANY, _(u"&Delete")) self.Append(self.remove) class eventsPanelMenu(wx.Menu): def __init__(self): super(eventsPanelMenu, self).__init__() - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show event")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show event")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) - self.remove = wx.MenuItem(self, wx.NewId(), _(u"&Delete")) + self.remove = wx.MenuItem(self, wx.ID_ANY, _(u"&Delete")) self.Append(self.remove) class peoplePanelMenu(wx.Menu): def __init__(self): super(peoplePanelMenu, self).__init__() - self.reply = wx.MenuItem(self, wx.NewId(), _(u"Direct &message")) + self.reply = wx.MenuItem(self, wx.ID_ANY, _(u"Direct &message")) self.Append(self.reply) - self.lists = wx.MenuItem(self, wx.NewId(), _(u"&View lists")) + self.lists = wx.MenuItem(self, wx.ID_ANY, _(u"&View lists")) self.Append(self.lists) self.lists.Enable(False) - self.details = wx.MenuItem(self, wx.NewId(), _(u"Show user &profile")) + self.details = wx.MenuItem(self, wx.ID_ANY, _(u"Show user &profile")) self.Append(self.details) - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show user")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show user")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) - self.userActions = wx.MenuItem(self, wx.NewId(), _(u"&User actions...")) + self.userActions = wx.MenuItem(self, wx.ID_ANY, _(u"&User actions...")) self.Append(self.userActions) class trendsPanelMenu(wx.Menu): def __init__(self): super(trendsPanelMenu, self).__init__() - self.search_topic = wx.MenuItem(self, wx.NewId(), _(u"Search topic")) + self.search_topic = wx.MenuItem(self, wx.ID_ANY, _(u"Search topic")) self.Append(self.search_topic) - self.tweetThisTrend = wx.MenuItem(self, wx.NewId(), _(u"&Tweet about this trend")) + self.tweetThisTrend = wx.MenuItem(self, wx.ID_ANY, _(u"&Tweet about this trend")) self.Append(self.tweetThisTrend) - self.view = wx.MenuItem(self, wx.NewId(), _(u"&Show item")) + self.view = wx.MenuItem(self, wx.ID_ANY, _(u"&Show item")) self.Append(self.view) - self.copy = wx.MenuItem(self, wx.NewId(), _(u"&Copy to clipboard")) + self.copy = wx.MenuItem(self, wx.ID_ANY, _(u"&Copy to clipboard")) self.Append(self.copy) diff --git a/src/wxUI/view.py b/src/wxUI/view.py index a7e34f43..64a2597b 100644 --- a/src/wxUI/view.py +++ b/src/wxUI/view.py @@ -13,66 +13,66 @@ class mainFrame(wx.Frame): # Application menu app = wx.Menu() - self.manage_accounts = app.Append(wx.NewId(), _(u"&Manage accounts")) - self.updateProfile = app.Append(wx.NewId(), _(u"&Update profile")) - self.show_hide = app.Append(wx.NewId(), _(u"&Hide window")) - self.menuitem_search = app.Append(wx.NewId(), _(u"&Search")) - self.lists = app.Append(wx.NewId(), _(u"&Lists manager")) - self.keystroke_editor = app.Append(wx.NewId(), _(u"&Edit keystrokes")) - self.account_settings = app.Append(wx.NewId(), _(u"Account se&ttings")) + self.manage_accounts = app.Append(wx.ID_ANY, _(u"&Manage accounts")) + self.updateProfile = app.Append(wx.ID_ANY, _(u"&Update profile")) + self.show_hide = app.Append(wx.ID_ANY, _(u"&Hide window")) + self.menuitem_search = app.Append(wx.ID_ANY, _(u"&Search")) + self.lists = app.Append(wx.ID_ANY, _(u"&Lists manager")) + self.keystroke_editor = app.Append(wx.ID_ANY, _(u"&Edit keystrokes")) + self.account_settings = app.Append(wx.ID_ANY, _(u"Account se&ttings")) self.prefs = app.Append(wx.ID_PREFERENCES, _(u"&Global settings")) self.close = app.Append(wx.ID_EXIT, _(u"E&xit")) # Tweet menu tweet = wx.Menu() - self.compose = tweet.Append(wx.NewId(), _(u"&Tweet")) - self.reply = tweet.Append(wx.NewId(), _(u"Re&ply")) - self.retweet = tweet.Append(wx.NewId(), _(u"&Retweet")) - self.fav = tweet.Append(wx.NewId(), _(u"&Like")) - self.unfav = tweet.Append(wx.NewId(), _(u"&Unlike")) - self.view = tweet.Append(wx.NewId(), _(u"&Show tweet")) - self.view_coordinates = tweet.Append(wx.NewId(), _(u"View &address")) - self.view_conversation = tweet.Append(wx.NewId(), _(u"View conversa&tion")) - self.ocr = tweet.Append(wx.NewId(), _(u"Read text in picture")) - self.delete = tweet.Append(wx.NewId(), _(u"&Delete")) + self.compose = tweet.Append(wx.ID_ANY, _(u"&Tweet")) + self.reply = tweet.Append(wx.ID_ANY, _(u"Re&ply")) + self.retweet = tweet.Append(wx.ID_ANY, _(u"&Retweet")) + self.fav = tweet.Append(wx.ID_ANY, _(u"&Like")) + self.unfav = tweet.Append(wx.ID_ANY, _(u"&Unlike")) + self.view = tweet.Append(wx.ID_ANY, _(u"&Show tweet")) + self.view_coordinates = tweet.Append(wx.ID_ANY, _(u"View &address")) + self.view_conversation = tweet.Append(wx.ID_ANY, _(u"View conversa&tion")) + self.ocr = tweet.Append(wx.ID_ANY, _(u"Read text in picture")) + self.delete = tweet.Append(wx.ID_ANY, _(u"&Delete")) # User menu user = wx.Menu() - self.follow = user.Append(wx.NewId(), _(u"&Actions...")) - self.timeline = user.Append(wx.NewId(), _(u"&View timeline...")) - self.dm = user.Append(wx.NewId(), _(u"Direct me&ssage")) - self.addToList = user.Append(wx.NewId(), _(u"&Add to list")) - self.removeFromList = user.Append(wx.NewId(), _(u"R&emove from list")) - self.viewLists = user.Append(wx.NewId(), _(u"&View lists")) - self.details = user.Append(wx.NewId(), _(u"Show user &profile")) - self.favs = user.Append(wx.NewId(), _(u"V&iew likes")) + self.follow = user.Append(wx.ID_ANY, _(u"&Actions...")) + self.timeline = user.Append(wx.ID_ANY, _(u"&View timeline...")) + self.dm = user.Append(wx.ID_ANY, _(u"Direct me&ssage")) + self.addToList = user.Append(wx.ID_ANY, _(u"&Add to list")) + self.removeFromList = user.Append(wx.ID_ANY, _(u"R&emove from list")) + self.viewLists = user.Append(wx.ID_ANY, _(u"&View lists")) + self.details = user.Append(wx.ID_ANY, _(u"Show user &profile")) + self.favs = user.Append(wx.ID_ANY, _(u"V&iew likes")) # buffer menu buffer = wx.Menu() - self.update_buffer = buffer.Append(wx.NewId(), _(u"&Update buffer")) - self.trends = buffer.Append(wx.NewId(), _(u"New &trending topics buffer...")) - self.filter = buffer.Append(wx.NewId(), _(u"Create a &filter")) - self.manage_filters = buffer.Append(wx.NewId(), _(u"&Manage filters")) - self.find = buffer.Append(wx.NewId(), _(u"Find a string in the currently focused buffer...")) - self.load_previous_items = buffer.Append(wx.NewId(), _(u"&Load previous items")) + self.update_buffer = buffer.Append(wx.ID_ANY, _(u"&Update buffer")) + self.trends = buffer.Append(wx.ID_ANY, _(u"New &trending topics buffer...")) + self.filter = buffer.Append(wx.ID_ANY, _(u"Create a &filter")) + self.manage_filters = buffer.Append(wx.ID_ANY, _(u"&Manage filters")) + self.find = buffer.Append(wx.ID_ANY, _(u"Find a string in the currently focused buffer...")) + self.load_previous_items = buffer.Append(wx.ID_ANY, _(u"&Load previous items")) buffer.AppendSeparator() - self.mute_buffer = buffer.AppendCheckItem(wx.NewId(), _(u"&Mute")) - self.autoread = buffer.AppendCheckItem(wx.NewId(), _(u"&Autoread")) - self.clear = buffer.Append(wx.NewId(), _(u"&Clear buffer")) - self.deleteTl = buffer.Append(wx.NewId(), _(u"&Destroy")) + self.mute_buffer = buffer.AppendCheckItem(wx.ID_ANY, _(u"&Mute")) + self.autoread = buffer.AppendCheckItem(wx.ID_ANY, _(u"&Autoread")) + self.clear = buffer.Append(wx.ID_ANY, _(u"&Clear buffer")) + self.deleteTl = buffer.Append(wx.ID_ANY, _(u"&Destroy")) # audio menu audio = wx.Menu() - self.seekLeft = audio.Append(wx.NewId(), _(u"&Seek back 5 seconds")) - self.seekRight = audio.Append(wx.NewId(), _(u"&Seek forward 5 seconds")) + self.seekLeft = audio.Append(wx.ID_ANY, _(u"&Seek back 5 seconds")) + self.seekRight = audio.Append(wx.ID_ANY, _(u"&Seek forward 5 seconds")) # Help Menu help = wx.Menu() self.doc = help.Append(-1, _(u"&Documentation")) - self.sounds_tutorial = help.Append(wx.NewId(), _(u"Sounds &tutorial")) - self.changelog = help.Append(wx.NewId(), _(u"&What's new in this version?")) - self.check_for_updates = help.Append(wx.NewId(), _(u"&Check for updates")) - self.reportError = help.Append(wx.NewId(), _(u"&Report an error")) + self.sounds_tutorial = help.Append(wx.ID_ANY, _(u"Sounds &tutorial")) + self.changelog = help.Append(wx.ID_ANY, _(u"&What's new in this version?")) + self.check_for_updates = help.Append(wx.ID_ANY, _(u"&Check for updates")) + self.reportError = help.Append(wx.ID_ANY, _(u"&Report an error")) self.visit_website = help.Append(-1, _(u"{0}'s &website").format(application.name,)) self.about = help.Append(-1, _(u"About &{0}").format(application.name,)) @@ -115,7 +115,7 @@ class mainFrame(wx.Frame): self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetTitle(application.name) self.SetMenuBar(self.makeMenus()) - self.nb = wx.Treebook(self.panel, wx.NewId()) + self.nb = wx.Treebook(self.panel, wx.ID_ANY) self.buffers = {} def get_buffer_count(self):