mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
The next generation branch has been added
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
import platform
|
||||
if platform.system() == "Windows":
|
||||
from wxUI import *
|
@@ -41,5 +41,5 @@ actions = {
|
||||
"search": _(u"Search on twitter"),
|
||||
"edit_keystrokes": _(u"Shows the keystroke editor"),
|
||||
"view_user_lists": _(u"Show lists for a specified user"),
|
||||
"get_more_items": _(u"loads previous items to any buffer"),
|
||||
"get_more_items": _(u"Loads more items for the current buffer"),
|
||||
}
|
@@ -4,13 +4,12 @@ import wx
|
||||
import constants
|
||||
from multiplatform_widgets import widgets
|
||||
from constants import actions
|
||||
from pubsub import pub
|
||||
|
||||
class keystrokeEditor(wx.Dialog):
|
||||
def __init__(self, parent=None, keyboard_handler=None):
|
||||
super(keystrokeEditor, self).__init__(parent=parent, id=-1, title=_(u"Keystroke editor"))
|
||||
def __init__(self):
|
||||
super(keystrokeEditor, self).__init__(parent=None, id=-1, title=_(u"Keystroke editor"))
|
||||
panel = wx.Panel(self)
|
||||
self.parent = parent
|
||||
self.keyboard_handler = keyboard_handler or None
|
||||
self.actions = []
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
keysText = wx.StaticText(panel, -1, _(u"Select a keystroke to edit"))
|
||||
@@ -30,27 +29,20 @@ class keystrokeEditor(wx.Dialog):
|
||||
sizer.Add(firstSizer)
|
||||
sizer.Add(secondSizer)
|
||||
panel.SetSizerAndFit(sizer)
|
||||
self.put_keystrokes()
|
||||
|
||||
def put_keystrokes(self):
|
||||
for i in config.main["keymap"]:
|
||||
def put_keystrokes(self, **keystrokes):
|
||||
for i in keystrokes:
|
||||
action = actions[i]
|
||||
self.actions.append(i)
|
||||
keystroke = config.main["keymap"][i]
|
||||
keystroke = keystrokes[i]
|
||||
self.keys.insert_item(False, *[action, keystroke])
|
||||
|
||||
def edit(self, ev):
|
||||
action = self.actions[self.keys.get_selected()]
|
||||
dlg = editKeystroke(self.parent, action, config.main["keymap"][action], self.keyboard_handler)
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
pos = self.keys.get_selected()
|
||||
self.keys.clear()
|
||||
self.put_keystrokes()
|
||||
self.keys.select_item(pos)
|
||||
# dlg.Destroy()
|
||||
pub.sendMessage("editing_keystroke", action=action, parentDialog=self)
|
||||
|
||||
class editKeystroke(wx.Dialog):
|
||||
def __init__(self, parent, action, keystroke, keyboard_handler):
|
||||
def __init__(self, action, keystroke, keyboard_handler):
|
||||
super(editKeystroke, self).__init__(parent=None, id=-1, title=_(u"Editing keystroke"))
|
||||
self.parent = parent
|
||||
self.keyboard_handler = keyboard_handler
|
Reference in New Issue
Block a user