-
Notifications
You must be signed in to change notification settings - Fork 1
/
TODO.otl
308 lines (281 loc) · 16.5 KB
/
TODO.otl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
>>> Piony >>>
TODO
2015-04-20 [X] first extract radial layout
2015-04-20 [$] then reconcile all buttons and rotate paint itself
: but is it really possible for layout abstraction?
:> in which case I will try prototype w/o layout to check smoothiness
2015-04-22 [X] FIX text 'krita' in the center of ring
[_] Compare performance for individual pathes and QTransform rotated.
[_] Add extracting git log messages to changelog
[_] Option 'verbose' -- move under [Debug] section
[_] Убрать из списка задач на Убунте
[_] Socket to receive data directly from shell read/write (rather fast)
FLOW
2015-04-20 [X] SegmentShapeEngine class (draft version)
2015-04-23 [X] self.spacing() as pre-modifier for button outer size: path and mask
RFC
[_] SegmentShapeEngine: extract separate funcs
[_] coord-systems conversion code
[_] segment contour shrinking
2015-09-03 [$] Try extract R() as single separate function instead defining in each class
:> algorythms have changed, 'R' is used as value
2015-04-25 [X] Replace all imports with full versions
[_] -V l -- strictly unnecessary key
[_] -T --no-tooltip=no change to --show-tooltip=yes
[_] Calculate text size to fit into rect in one pass (find Qt Api)
[_] Rename all config options to format 'fTextScale' with type letter
: think if it's actual now, after migration to yaml
[_] Split GState in separately injected Style, Config, BudStruct
:= only if in further architecture only one of them used simultaneously
[_] When resizing window use view.fitIn then after end -- rebuild all widgets to remove blur
2015-09-03 [X] Inside layout engines make all values as public and replace _cache..() by setup()
[_] Add margin inside segments/rings (instead of lw variable)
[_] THINK YAML also has a set type, which looks like this:
: set: # http://learnxinyminutes.com/docs/yaml/
: ? item1
: ? item2
: ? item3
STYLE
2015-04-27 [$] remove my overload for mouseDown/Up for btn.connect work again
:> I will need overloading for future air-menu, so NO.
[_] (v1.1) for selection by <Tab> use different highlight than for hover
thin red-thansparent gradient lines as outer contour to current yellow.
they will cover only half-length of one petal, fading out with distance
[_] replace filling with gradient (radial?) to add volume
: http://doc.qt.digia.com/4.6/painting-painterpaths.html
[_] When resizing, spacing between segments and central area must change proportionally
:> Possible implementation only after porting to QGraphicsWidget
(v1.4) Groups
[_] different tint colors for buttons in different groups (like Excel)
[_] ? add 'group' property to button, or use direct color?
CONTROLS
[_] Extract key mappings into separate 'keymap.json' file
[_] Drag: replace by official dragMoveEvent? Or eventHolder?
2015-04-12 [X] M3+drag | moves piony window (ALT: Mod_i3+M1+drag)
[_] M3+nodrag | opens context menu
[_] C+M3+drag | rotate ring around center (also use '+', '-', '=')
: to adapt icons towards hand's anisotropy
: to group instruments for current task from different rings
[_] CS+M3+drag | rotates all rings as whole
[_] +/-, =/_ | Resize anchoring ring center
Slices
[_] -l <No> | current active slice
[_] CSA+hold | preview another slice (total 1+3!)
[_] CSA+M1 | switch to choosen slice (total 3N)
: useful if all instruments are grouped on several rings
[_] A+[0..9] | switch to slice <Number>
| How to intuitively fuse between layers by UI element?
[_] action on mouse release
[_] M1+down | changes segment hint to green
: this will give feedback what will be activated
[_] Crossing segment borders when dragging -- resets its color
[_] M2+up | use action from current button under cursor
[_] if M1+ was in segment and M1- occurs over center
:> do nothing and don't close menu
[_] W1+down | open piony
[_] W1+up | activate current button under cursor (or close on center)
[_] W-Wheel | select active sector of menu
[_] try to select by absolute wacom-wheel value, not relative
[_] W-Wheel | ALT: scroll through available slices and wheels
Keyboard
[_] Choose action by keyboard -- click button like in firefox-vim
[_] Show small index letter (mapped) in topLeft corner of gText bbox
SYSTEM
2015-04-23 [X] Port to PyQt5 and python3
2015-04-23 [X] : http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html
2015-04-23 [X] Complete current dev stage and only then port
[_] Port all text info to QStaticText + drawStaticText
[_] Port layouts to QGraphicsLayout and QGraphicsWidget (for QRectF support)
http://doc.qt.io/qt-5/graphicsview.html
http://stackoverflow.com/questions/3131399/extend-qgraphicsitem-with-pyqt
: A top-level item's style defaults to QGraphicsScene.style
: Graphics View provides a custom drag and drop framework, different from QWidget.
: If you are subclassing from QGraphicsItem directly and not from one
: of the provided subclasses like QGraphicsEllipseItem, make sure
: your contains() and boundingRect() methods are returning the correct results
: http://www.qtcentre.org/threads/40241-PyQt-QGraphicsItem-not-recieving-mouse-events
[_] try set my window as 'modal' -- to intercept all input events
: but this possible only for subwindows, or not?
2015-04-27 [X] find last active window to send keystrokes
: https://github.com/Mte90/QAsana/blob/master/qasana.py
: or you can simply unfocuse current before sending keystrokes
[_] Maybe, make on close() teleport mouse back to starting position?
:= it's convenient for mouse, but has not much sense for Wacom
[_] -f : overlay fullscreen/local
[_] local : close window on LeaveEvent for QRegion : slice bbox
[_] settings: toggle 'close on LeaveEvent'
[_] full : whole screen to intercept clicks from drawing in krita
2015-04-25 [X] -v <v/a>: verbose (debug) {all/{visuals/actions}}
2015-04-25 [X] activates several global variables from common.py
2015-04-25 [X] Cover debug code in if __debug__ statement in manner of C #ifdef
? Use __debug__ variable to enclose defining and launch 'python -O'?
http://stackoverflow.com/questions/12524570/how-do-you-implement-ifdef-in-python
[_] Extract global vars to __builtin__.py and access them as builtins.foo
2015-04-26 [X] Place all global variables into gvars.py (not common.py)
2015-05-04 [$] Setup custom WM_CLASS :> not possible, qt uses filename with extension.
[_] Launch server app (main) as 'python3 -O' and client as 'python3'
:= it's all due to prolonging startup time because of pre-compiling
Maybe, use two different apps -- server and client?
Or directly fork shell for server.py from first client launch?
: http://stackoverflow.com/questions/5735628/how-to-fix-shebang-flags-that-are-not-recognized-on-some-systems
[_] search_dst_window must be launched only on 'show', or exlude self from
window list. Better -- use prev-to-piony or next-to-piony active window.
THREADS
Signals
2015-04-27 [X] React to Ctrl-C from console
: http://codereview.stackexchange.com/questions/54348/handling-signals-in-python-inside-a-function
Clien-Server IPC
: > http://pymotw.com/2/multiprocessing/communication.html
: > https://wiki.qt.io/Threads_Events_QObjects
2015-05-05 [X] Port IPC to QLocalSocket
: http://doc.qt.io/qt-5/examples-ipc.html
2015-05-08 [$] Server's Listener must only be used as dispatcher
:> Architecture was changed. Now server manages global cfg and buds.
2015-05-08 [$] Process arguments and configs inside Client thread
:> Too slow imports of all libs, I forced to move parsing on server side
[_] Send to Server readied cfg dict to use 'read_dict' instantly
[_] Make 'bReload' as tuple to distinguish necessary refreshes.
[_] -N : new clean setup -- reset state objects and load only new sets
[_] Connect when exit server to close window and qapp
:= It's all to simplify exit in case of bad connection
[_] Send error messages (from print -> log) to client after parsing
[_] Set-up getting interface '-g : --get' to receive window id, current buds, etc
[_] All relative to client pathes must be converted to full before sending server
:= Therefore client could specify files from its pwd instead full-pathes
Tray
[_] tray icon and menu
> http://www.utilities-online.info/articles/Create-a-PyQt-tray-icon-to-send-UDP-Datagram/
> https://github.com/pcmantinker/Tray-Notification-System/blob/master/traynotificationwidget.cpp
: https://gist.github.com/juancarlospaco/7bf539c62015cc8ca7b0
: https://github.com/dglent/meteo-qt
[_] BUG: forever lost prev window focus when click on TrayIcon
:SEE: http://stackoverflow.com/questions/25314391/system-tray-icon-doesnt-show-in-qt5-linux-lxde
Start on log-in
http://stackoverflow.com/questions/6186091/pyqt-best-way-to-do-the-trick-start-at-boot-for-my-program-in-windows
<Flags>
[_] -d : start as background daemon, enable client-server (OR: '-D','--no-daemon')
: https://www.safaribooksonline.com/library/view/python-cookbook/0596001673/ch06s09.html
[_] toggle show/hide instead of creating each time
| check self.hide() functional -- does it hide from i3wm?
[_] -S : show -- "Show menu at current cursor position, or at 'x,y' coords", default='auto'
[_] -H : hide -- "Hide and if has argument '1' click last hovered before it.", default='auto'
[_] use only one instance (now old autocloses on focus lost when new created)
: https://pythonadventures.wordpress.com/2013/01/10/launch-just-one-instance-of-a-qt-application/
[_] on leaveEvent activate current action -- close/hide
[_] -C : close -- preferably close or hide window
[_] -k : kill -- "Kill demon."
Multiprocessing
: http://pymotw.com/2/multiprocessing/basics.html#daemon-processes
: https://docs.python.org/3.4/library/multiprocessing.html
: http://eli.thegreenplace.net/2012/01/04/shared-counter-with-pythons-multiprocessing
: http://stackoverflow.com/questions/2080660/python-multiprocessing-and-a-shared-counter
Daemons
: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
: https://gist.github.com/Jd007/5573672
[_] multithreading
: http://stackoverflow.com/questions/2846653/python-multithreading-for-dummies
: http://www.tutorialspoint.com/python/python_multithreading.htm
: http://stackoverflow.com/questions/6783194/background-thread-with-qthread-in-pyqt
: http://effbot.org/zone/thread-synchronization.htm
: http://www.python-course.eu/threads.php
[_] show active Slice as fast as it loaded, load others in background
:= to accelerate air-layouts pre-creation and launch time
[_] sendKeys in separate thread, launched simultaneously with app
:> But then there will be delay between pressing and sending!
IDEAS
2015-04-18 [$] use OpenGL window with transparent background :> replaced by pyqt
:> need too much time to start application, delayed feeling
2015-04-23 [$] create 3D sphere, which can be rotated with M2 with buttons on it
: ALT: plain-composition of window with magnify
:> Too slow the choosing of action, distraction from drawing process
[_] mouse gestures -- useful as I can write complex symbols by pen
: http://www.gulon.co.uk/2013/01/14/pyqt4-mouse-gestures-part-deux/
[_] for whole screen -- drawing on transparent canvas anywhere
[_] can have different sense, when written in different screen zones
[_] how about elliptic rings, with slope on 60 deg -- for hand anisotropy?
of course they can be rotated, changing their slope
[_] (v1.7) icons instead of / under text (applied by blending) in segments
| maybe I will be OK simply with hieroglyphs? (image from StyleSheet)
[_] Get vars values from krita to display onto piony buttons
: like pressed/released state, brush size, etc
[_] Profile: make 4-ring virt keyboard with frequences from colemac
[_] Undo for symmetrical commands: store last commands and by widget apply mirrored
> BUGS
2015-04-14 [X] make clipping ellipse over petals to leave focus on circle, not square
2015-04-21 [X] BUG: bad antialising due to clipping mask, make it more steady
2015-04-21 [X] BUG: petals positions are somewhat none-symmetrical
2015-04-18 [$] lets try QPointF :> No such overload
2015-04-18 [$] place all button on top each other and rotate only painting inside
2015-04-21 [X] inner petal's half-ellipses must cover arc (180-a), outer=(180+a)
: http://en.wikipedia.org/wiki/Ellipse
2015-04-22 [X] BUG: replace items order CW -> CCW
2015-04-27 [X] BUG: keys aren't printed or emulated on action
2015-04-30 [X] BUG: Button tooltip changes color to yellow if you fast move cursor over it
:> It's all due to self.setStyleSheet("background-color:yellow;") inside btn.leaveEvent
2015-04-30 [X] BUG: config options duplicates :> wrong way of applying defaults
2015-05-02 [X] BUG: resets geometry position to 0,0 when cursor at screen border
:> I suggest that trouble is related to i3wm -- repositioning all windows on showEvent.
2015-05-02 [X] BUG: no text when only 1 element in ring list -- must show at farthest
2015-05-02 [X] BUG: exception when list is empty
2015-05-02 [X] BUG: on resize must update petals and text sizes
:> setting up it in __init__ will be unnecessary
2015-05-03 [X] BUG: double click M1 for Mod_i3+drag generates Qt.close()
:> problem was with empty mask in eventFilter
2015-05-03 [X] Trash inside transparent region of Qt window
: maybe utilize QWidgets.QWidget.IgnoreMask
:> fill window bkgr in paintEvent, and draw bud over in separate widget
2015-05-03 [X] BUG: clipped border on left and top sides of pie. Wrong centering?
:> wrong QRect.center() : for 300x300 shows center at 149x149
2015-05-03 [$] BUG: window size can't be smaller then 100x80 :> look at ~/.i3/config
2015-05-03 [X] CRITICAL: pie.setGeometry has circular infinite call_ing
: base.adjustFontSize(self, self.text(), self.gText.size())
:> self -> p -- always use 'p' in paintEvent and 'self' in setGeometry
2015-05-04 [$] BUG: Ctrl-C works only after Qt window focused again :> only SIG_DFL works
: http://www.mail-archive.com/[email protected]/msg13757.html
[_] BUG: petal bHold isn't released if you click on ContextMenu
: https://wiki.python.org/moin/PyQt/Handling%20context%20menus
:> use Window.eventFilter and on mouseUp, leaveEvent send reset to all buttons
[_] After that leaveEvent is sent not always
2015-05-09 [~] DEFECT: When fast toggling the window, you can see how it firstly
appears at screen center. :> Fixed, but needs more testing in wm.
2015-05-09 [X] BUG: On launch one of buttons can occasionally became highlighted
:> it's composition of double-show window defect and the result of
: centering window when enabled trackingMouse
[_] BUG: AGAIN: resets geometry position to 0,0 when cursor at screen right border
2015-08-24 [X] FIX: context menu don't react on its shortcuts
:> NEED: shortcutContext=Qt.ApplicationShortcut
[_] NOTE: not equialent, white bkgr for view in second case:
-1- setStyleSheet("background: transparent")
-2- def paintEvent(self, e): p.setBrush(QtGui.QColor(0, 0, 0, 0))...
[_] BUG: launch piony from home -- exception on self.bud assign
:= it's about relative path for default bud. Need new exception for budparser
[_] FIX: message 'refused by peer' must be only if there is broken socket
:? but now it is printed on every launch
> OPTIMIZATION
[_] Optimize event calls with caching and restructuring
: e.g. setGeometry called three times on launch!
>> FAQ: https://docs.python.org/2/faq/programming.html#id14
[_] Pre-compile top-level script and launch *.pyc files to reduce startup time
python -m compileall myscript.py
[_] Direct key emulation -- use libxtest.so (or what used by xdotool internally?)
: https://github.com/pimoroni/skywriter-hat/tree/master/python/examples
[_] ALT: use udev LKM and registered device for full control
[_] For layout-on-cmdline use shared button style to start-up much faster
[_] Edit menu loads only on demand, when you toggle option in M2 menu
[_] Flags to enable/disable config.ini support
:? but then default values from cfgdefaults must migrate to argsdefault?
[_] Flags to enable/disable pre-parsing of buds
: if you specify whole profile in file, there is no need to fill or
: extend entries to full format, no need to check if entries are
: imported files or stdin.
[_] https://wiki.python.org/moin/PythonSpeed/PerformanceTips
[_] Reduce startup time
http://draketo.de/light/english/politics-and-free-software/reducing-python-startup-time
Compile to fast binary (also can be useful for Windows distribution)
[_] Freeze tool
std : is included in the Python source tree as Tools/freeze
http://www.py2exe.org/
http://cx-freeze.sourceforge.net/
[_] To bincode
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
http://psyco.sourceforge.net/