1
2
3
4
5
6
7
8
9
10
11 from PyQt4.QtCore import *
12 from PyQt4.QtGui import *
13
14 from toolbar import ToolBar
15 from editor import Editor
16
18
20 '''
21 ToolBar ile ilgili ilk ayarları yapar.
22 '''
23 self._actionCodes = [
24 '250C',
25 '2500',
26 '2510',
27 '2502',
28 '2514',
29 '2518',
30 '2524',
31 '2534',
32 '252C',
33 '251C',
34 '253C',
35 ]
36
38 '''
39 ToolBar ile ilgili özel ayarları yapar.
40 '''
41 group = QActionGroup(self)
42 group.setExclusive(True)
43
44 for actionCode in self._actionCodes:
45 action = self.getAction('character%s' % actionCode)
46 action.setCheckable(True)
47 action.setData(QVariant(unichr(int(actionCode, 16))))
48
49 group.addAction(action)
50
51 self.connect(self._editor, SIGNAL('editorModeChanged(int)'), self.editorModeChanged)
52 self.connect(group, SIGNAL('triggered(QAction *)'), self.characterPressed)
53
55 '''
56 Editör modu değiştiğinde gerekli düğmelerdeki ayarlar yapılır.
57 '''
58 if newMode != Editor.MODE_ADDLINECHARACTER:
59 for actionCode in self._actionCodes:
60 action = self.getAction('character%s' % actionCode)
61 action.setChecked(False)
62
73
75 '''
76 Toolbar'da nelerin olacağını belirler.
77 '''
78 toolbarItems = []
79
80 for actionCode in self._actionCodes:
81 item = ('character%s' % actionCode, tr('Çizgi karakterini ekle'), '', tr('İlgili çizgi karakterini, editöre ekler.'))
82
83 toolbarItems.append(item)
84
85 return toolbarItems
86