src/eric7/UI/SymbolsWidget.py

Thu, 21 Dec 2023 19:50:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 21 Dec 2023 19:50:01 +0100
branch
eric7
changeset 10433
328f3ec4b77a
parent 10069
435cc5875135
child 10439
21c28b0f9e41
permissions
-rw-r--r--

Converted some source code documentation to the new style.

365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
9653
e67609152c5e Updated copyright for 2023.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9539
diff changeset
3 # Copyright (c) 2010 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a widget to select a symbol in various formats.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
10 import html.entities
4970
dcbb14191a3b Redid the SymbolsWidget fix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
11 import sys
dcbb14191a3b Redid the SymbolsWidget fix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
12 import unicodedata
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
14 from PyQt6.QtCore import (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
15 QAbstractTableModel,
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
16 QItemSelectionModel,
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
17 QLocale,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
18 QModelIndex,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
19 Qt,
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
20 pyqtSignal,
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
21 pyqtSlot,
7264
bedbe458d792 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
22 )
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
23 from PyQt6.QtGui import QColor
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
24 from PyQt6.QtWidgets import QAbstractItemView, QHeaderView, QWidget
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
26 from eric7 import Preferences
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
27 from eric7.EricGui import EricPixmapCache
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
28 from eric7.EricWidgets.EricApplication import ericApp
8853
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
29
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 from .Ui_SymbolsWidget import Ui_SymbolsWidget
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
32
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 class SymbolsModel(QAbstractTableModel):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 Class implementing the model for the symbols widget.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
37
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
38 def __init__(self, parent=None):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
41
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
42 @param parent reference to the parent object
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
43 @type QObject
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
45 super().__init__(parent)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
46
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
47 self.__locale = QLocale()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
48
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.__headerData = [
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
50 self.tr("Code"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
51 self.tr("Char"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
52 self.tr("Hex"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
53 self.tr("HTML"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
54 self.tr("Name"),
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
56
8853
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
57 self.__isDark = ericApp().usesDarkPalette()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
58
2603
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
59 self.__tables = [
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
60 # first last display name
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
61 (0x0, 0x1F, self.tr("Control Characters")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
62 (0x20, 0x7F, self.tr("Basic Latin")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
63 (0x80, 0xFF, self.tr("Latin-1 Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
64 (0x100, 0x17F, self.tr("Latin Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
65 (0x180, 0x24F, self.tr("Latin Extended-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
66 (0x250, 0x2AF, self.tr("IPA Extensions")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
67 (0x2B0, 0x2FF, self.tr("Spacing Modifier Letters")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
68 (0x300, 0x36F, self.tr("Combining Diacritical Marks")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
69 (0x370, 0x3FF, self.tr("Greek and Coptic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
70 (0x400, 0x4FF, self.tr("Cyrillic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
71 (0x500, 0x52F, self.tr("Cyrillic Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
72 (0x530, 0x58F, self.tr("Armenian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
73 (0x590, 0x5FF, self.tr("Hebrew")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 (0x600, 0x6FF, self.tr("Arabic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75 (0x700, 0x74F, self.tr("Syriac")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
76 (0x780, 0x7BF, self.tr("Thaana")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
77 (0x7C0, 0x7FF, self.tr("N'Ko")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
78 (0x800, 0x83F, self.tr("Samaritan")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
79 (0x840, 0x85F, self.tr("Mandaic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
80 (0x8A0, 0x8FF, self.tr("Arabic Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81 (0x900, 0x97F, self.tr("Devanagari")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
82 (0x980, 0x9FF, self.tr("Bengali")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
83 (0xA00, 0xA7F, self.tr("Gurmukhi")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
84 (0xA80, 0xAFF, self.tr("Gujarati")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
85 (0xB00, 0xB7F, self.tr("Oriya")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
86 (0xB80, 0xBFF, self.tr("Tamil")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
87 (0xC00, 0xC7F, self.tr("Telugu")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88 (0xC80, 0xCFF, self.tr("Kannada")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89 (0xD00, 0xD7F, self.tr("Malayalam")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
90 (0xD80, 0xDFF, self.tr("Sinhala")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
91 (0xE00, 0xE7F, self.tr("Thai")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
92 (0xE80, 0xEFF, self.tr("Lao")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
93 (0xF00, 0xFFF, self.tr("Tibetan")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
94 (0x1000, 0x109F, self.tr("Myanmar")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
95 (0x10A0, 0x10FF, self.tr("Georgian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
96 (0x1100, 0x11FF, self.tr("Hangul Jamo")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97 (0x1200, 0x137F, self.tr("Ethiopic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
98 (0x1380, 0x139F, self.tr("Ethiopic Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
99 (0x13A0, 0x13FF, self.tr("Cherokee")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
100 (0x1400, 0x167F, self.tr("Unified Canadian Aboriginal Syllabics")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
101 (0x1680, 0x169F, self.tr("Ogham")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
102 (0x16A0, 0x16FF, self.tr("Runic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
103 (0x1700, 0x171F, self.tr("Tagalog")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104 (0x1720, 0x173F, self.tr("Hanunoo")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
105 (0x1740, 0x175F, self.tr("Buhid")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
106 (0x1760, 0x177F, self.tr("Tagbanwa")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
107 (0x1780, 0x17FF, self.tr("Khmer")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
108 (0x1800, 0x18AF, self.tr("Mongolian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
109 (0x18B0, 0x18FF, self.tr("Unified Canadian Aboriginal Syllabics Extended")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
110 (0x1900, 0x194F, self.tr("Limbu")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
111 (0x1950, 0x197F, self.tr("Tai Le")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
112 (0x19E0, 0x19FF, self.tr("Khmer Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
113 (0x1A00, 0x1A1F, self.tr("Buginese")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
114 (0x1A20, 0x1AAF, self.tr("Tai Tham")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
115 (0x1B00, 0x1B7F, self.tr("Balinese")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
116 (0x1B80, 0x1BBF, self.tr("Sundanese")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
117 (0x1BC0, 0x1BFF, self.tr("Batak")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
118 (0x1C00, 0x1C4F, self.tr("Lepcha")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
119 (0x1C50, 0x1C7F, self.tr("Ol Chiki")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
120 (0x1CC0, 0x1CCF, self.tr("Sundanese Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
121 (0x1CD0, 0x1CFF, self.tr("Vedic Extensions")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
122 (0x1D00, 0x1D7F, self.tr("Phonetic Extensions")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
123 (0x1D80, 0x1DBF, self.tr("Phonetic Extensions Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
124 (0x1DC0, 0x1DFF, self.tr("Combining Diacritical Marks Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
125 (0x1E00, 0x1EFF, self.tr("Latin Extended Additional")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
126 (0x1F00, 0x1FFF, self.tr("Greek Extended")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
127 (0x2000, 0x206F, self.tr("General Punctuation")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
128 (0x2070, 0x209F, self.tr("Superscripts and Subscripts")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
129 (0x20A0, 0x20CF, self.tr("Currency Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
130 (0x20D0, 0x20FF, self.tr("Combining Diacritical Marks")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
131 (0x2100, 0x214F, self.tr("Letterlike Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132 (0x2150, 0x218F, self.tr("Number Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
133 (0x2190, 0x21FF, self.tr("Arcolumns")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
134 (0x2200, 0x22FF, self.tr("Mathematical Operators")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
135 (0x2300, 0x23FF, self.tr("Miscellaneous Technical")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136 (0x2400, 0x243F, self.tr("Control Pictures")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
137 (0x2440, 0x245F, self.tr("Optical Character Recognition")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
138 (0x2460, 0x24FF, self.tr("Enclosed Alphanumerics")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
139 (0x2500, 0x257F, self.tr("Box Drawing")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
140 (0x2580, 0x259F, self.tr("Block Elements")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
141 (0x25A0, 0x25FF, self.tr("Geometric Shapes")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
142 (0x2600, 0x26FF, self.tr("Miscellaneous Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143 (0x2700, 0x27BF, self.tr("Dingbats")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
144 (0x27C0, 0x27EF, self.tr("Miscellaneous Mathematical Symbols-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145 (0x27F0, 0x27FF, self.tr("Supplement Arcolumns-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
146 (0x2800, 0x28FF, self.tr("Braille Patterns")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147 (0x2900, 0x297F, self.tr("Supplement Arcolumns-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
148 (0x2980, 0x29FF, self.tr("Miscellaneous Mathematical Symbols-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
149 (0x2A00, 0x2AFF, self.tr("Supplemental Mathematical Operators")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 (0x2B00, 0x2BFF, self.tr("Miscellaneous Symbols and Arcolumns")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 (0x2C00, 0x2C5F, self.tr("Glagolitic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 (0x2C60, 0x2C7F, self.tr("Latin Extended-C")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
153 (0x2C80, 0x2CFF, self.tr("Coptic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154 (0x2D00, 0x2D2F, self.tr("Georgian Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155 (0x2D30, 0x2D7F, self.tr("Tifinagh")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156 (0x2D80, 0x2DDF, self.tr("Ethiopic Extended")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
157 (0x2DE0, 0x2DFF, self.tr("Cyrillic Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
158 (0x2E00, 0x2E7F, self.tr("Supplemental Punctuation")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
159 (0x2E80, 0x2EFF, self.tr("CJK Radicals Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
160 (0x2F00, 0x2FDF, self.tr("KangXi Radicals")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
161 (0x2FF0, 0x2FFF, self.tr("Ideographic Description Chars")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
162 (0x3000, 0x303F, self.tr("CJK Symbols and Punctuation")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
163 (0x3040, 0x309F, self.tr("Hiragana")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
164 (0x30A0, 0x30FF, self.tr("Katakana")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 (0x3100, 0x312F, self.tr("Bopomofo")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
166 (0x3130, 0x318F, self.tr("Hangul Compatibility Jamo")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
167 (0x3190, 0x319F, self.tr("Kanbun")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168 (0x31A0, 0x31BF, self.tr("Bopomofo Extended")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 (0x31C0, 0x31EF, self.tr("CJK Strokes")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 (0x31F0, 0x31FF, self.tr("Katakana Phonetic Extensions")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 (0x3200, 0x32FF, self.tr("Enclosed CJK Letters and Months")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
172 (0x3300, 0x33FF, self.tr("CJK Compatibility")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173 (0x3400, 0x4DBF, self.tr("CJK Unified Ideogr. Ext. A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
174 (0x4DC0, 0x4DFF, self.tr("Yijing Hexagram Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175 (0x4E00, 0x9FFF, self.tr("CJK Unified Ideographs")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
176 (0xA000, 0xA48F, self.tr("Yi Syllables")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
177 (0xA490, 0xA4CF, self.tr("Yi Radicals")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
178 (0xA4D0, 0xA4FF, self.tr("Lisu")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
179 (0xA500, 0xA63F, self.tr("Vai")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
180 (0xA640, 0xA69F, self.tr("Cyrillic Extended-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
181 (0xA6A0, 0xA6FF, self.tr("Bamum")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
182 (0xA700, 0xA71F, self.tr("Modifier Tone Letters")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
183 (0xA720, 0xA7FF, self.tr("Latin Extended-D")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
184 (0xA800, 0xA82F, self.tr("Syloti Nagri")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
185 (0xA830, 0xA83F, self.tr("Common Indic Number Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
186 (0xA840, 0xA87F, self.tr("Phags-pa")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
187 (0xA880, 0xA8DF, self.tr("Saurashtra")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
188 (0xA8E0, 0xA8FF, self.tr("Devanagari Extended")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
189 (0xA900, 0xA92F, self.tr("Kayah Li")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190 (0xA930, 0xA95F, self.tr("Rejang")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
191 (0xA960, 0xA97F, self.tr("Hangul Jamo Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
192 (0xA980, 0xA9DF, self.tr("Javanese")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
193 (0xAA00, 0xAA5F, self.tr("Cham")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
194 (0xAA60, 0xAA7F, self.tr("Myanmar Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
195 (0xAA80, 0xAADF, self.tr("Tai Viet")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
196 (0xAAE0, 0xAAFF, self.tr("Meetei Mayek Extensions")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
197 (0xAB00, 0xAB2F, self.tr("Ethiopic Extended-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
198 (0xABC0, 0xABFF, self.tr("Meetei Mayek")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
199 (0xAC00, 0xD7AF, self.tr("Hangul Syllables")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
200 (0xD7B0, 0xD7FF, self.tr("Hangul Jamo Extended-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
201 (0xD800, 0xDB7F, self.tr("High Surrogates")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
202 (0xDB80, 0xDBFF, self.tr("High Private Use Surrogates")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
203 (0xDC00, 0xDFFF, self.tr("Low Surrogates")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
204 (0xE000, 0xF8FF, self.tr("Private Use")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
205 (0xF900, 0xFAFF, self.tr("CJK Compatibility Ideographs")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
206 (0xFB00, 0xFB4F, self.tr("Alphabetic Presentation Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207 (0xFB50, 0xFDFF, self.tr("Arabic Presentation Forms-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
208 (0xFE00, 0xFE0F, self.tr("Variation Selectors")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 (0xFE10, 0xFE1F, self.tr("Vertical Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210 (0xFE20, 0xFE2F, self.tr("Combining Half Marks")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
211 (0xFE30, 0xFE4F, self.tr("CJK Compatibility Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
212 (0xFE50, 0xFE6F, self.tr("Small Form Variants")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
213 (0xFE70, 0xFEFF, self.tr("Arabic Presentation Forms-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
214 (0xFF00, 0xFFEF, self.tr("Half- and Fullwidth Forms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
215 (0xFFF0, 0xFFFF, self.tr("Specials")),
2603
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
216 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
217 if sys.maxunicode > 0xFFFF:
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
218 self.__tables.extend(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
219 [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
220 (0x10000, 0x1007F, self.tr("Linear B Syllabary")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
221 (0x10080, 0x100FF, self.tr("Linear B Ideograms")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
222 (0x10100, 0x1013F, self.tr("Aegean Numbers")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
223 (0x10140, 0x1018F, self.tr("Ancient Greek Numbers")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
224 (0x10190, 0x101CF, self.tr("Ancient Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
225 (0x101D0, 0x101FF, self.tr("Phaistos Disc")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
226 (0x10280, 0x1029F, self.tr("Lycian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
227 (0x102A0, 0x102DF, self.tr("Carian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
228 (0x10300, 0x1032F, self.tr("Old Italic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
229 (0x10330, 0x1034F, self.tr("Gothic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
230 (0x10380, 0x1039F, self.tr("Ugaritic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
231 (0x103A0, 0x103DF, self.tr("Old Persian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
232 (0x10400, 0x1044F, self.tr("Deseret")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
233 (0x10450, 0x1047F, self.tr("Shavian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 (0x10480, 0x104AF, self.tr("Osmanya")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
235 (0x10800, 0x1083F, self.tr("Cypriot Syllabary")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
236 (0x10840, 0x1085F, self.tr("Imperial Aramaic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237 (0x10900, 0x1091F, self.tr("Phoenician")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
238 (0x10920, 0x1093F, self.tr("Lydian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
239 (0x10980, 0x1099F, self.tr("Meroitic Hieroglyphs")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
240 (0x109A0, 0x109FF, self.tr("Meroitic Cursive")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
241 (0x10A00, 0x10A5F, self.tr("Kharoshthi")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
242 (0x10A60, 0x10A7F, self.tr("Old South Arabian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
243 (0x10B00, 0x10B3F, self.tr("Avestan")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244 (0x10B40, 0x10B5F, self.tr("Inscriptional Parthian")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
245 (0x10B60, 0x10B7F, self.tr("Inscriptional Pahlavi")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
246 (0x10C00, 0x10C4F, self.tr("Old Turkic")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
247 (0x10E60, 0x10E7F, self.tr("Rumi Numeral Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
248 (0x11000, 0x1107F, self.tr("Brahmi")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249 (0x11080, 0x110CF, self.tr("Kaithi")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
250 (0x110D0, 0x110FF, self.tr("Sora Sompeng")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
251 (0x11100, 0x1114F, self.tr("Chakma")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
252 (0x11180, 0x111DF, self.tr("Sharada")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
253 (0x11680, 0x116CF, self.tr("Takri")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
254 (0x12000, 0x123FF, self.tr("Cuneiform")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
255 (0x12400, 0x1247F, self.tr("Cuneiform Numbers and Punctuation")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
256 (0x13000, 0x1342F, self.tr("Egyptian Hieroglyphs")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
257 (0x16800, 0x16A3F, self.tr("Bamum Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
258 (0x16F00, 0x16F9F, self.tr("Miao")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
259 (0x1B000, 0x1B0FF, self.tr("Kana Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 (0x1D000, 0x1D0FF, self.tr("Byzantine Musical Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261 (0x1D100, 0x1D1FF, self.tr("Musical Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
262 (0x1D200, 0x1D24F, self.tr("Ancient Greek Musical Notation")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
263 (0x1D300, 0x1D35F, self.tr("Tai Xuan Jing Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
264 (0x1D360, 0x1D37F, self.tr("Counting Rod Numerals")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
265 (0x1D400, 0x1D7FF, self.tr("Mathematical Alphanumeric Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
266 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
267 0x1EE00,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
268 0x1EEFF,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269 self.tr("Arabic Mathematical Alphabetic Symbols"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
270 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
271 (0x1F000, 0x1F02F, self.tr("Mahjong Tiles")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
272 (0x1F030, 0x1F09F, self.tr("Domino Tiles")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
273 (0x1F0A0, 0x1F0FF, self.tr("Playing Cards")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
274 (0x1F100, 0x1F1FF, self.tr("Enclosed Alphanumeric Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 (0x1F200, 0x1F2FF, self.tr("Enclosed Ideographic Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
276 (
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
277 0x1F300,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
278 0x1F5FF,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
279 self.tr("Miscellaneous Symbols And Pictographs"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
280 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
281 (0x1F600, 0x1F64F, self.tr("Emoticons")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
282 (0x1F680, 0x1F6FF, self.tr("Transport And Map Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
283 (0x1F700, 0x1F77F, self.tr("Alchemical Symbols")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
284 (0x20000, 0x2A6DF, self.tr("CJK Unified Ideogr. Ext. B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
285 (0x2A700, 0x2B73F, self.tr("CJK Unified Ideographs Extension C")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
286 (0x2B740, 0x2B81F, self.tr("CJK Unified Ideographs Extension D")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
287 (0x2F800, 0x2FA1F, self.tr("CJK Compatapility Ideogr. Suppl.")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
288 (0xE0000, 0xE007F, self.tr("Tags")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
289 (0xE0100, 0xE01EF, self.tr("Variation Selectors Supplement")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
290 (0xF0000, 0xFFFFF, self.tr("Supplementary Private Use Area-A")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
291 (0x100000, 0x10FFFF, self.tr("Supplementary Private Use Area-B")),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
292 ]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
293 )
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
294 self.__currentTableIndex = 0
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
295
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
296 def getTableNames(self):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 """
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
298 Public method to get a list of table names.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
299
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
300 @return list of table names
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
301 @rtype list of str
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
302 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
303 return [table[2] for table in self.__tables]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
304
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
305 def getTableBoundaries(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
306 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
307 Public method to get the first and last character position
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
308 of the given table.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
309
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
310 @param index index of the character table
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
311 @type int
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
312 @return first and last character position
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
313 @rtype tuple of (int, int)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 """
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
315 return self.__tables[index][0], self.__tables[index][1]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
316
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
317 def getTableIndex(self):
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
318 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3539
diff changeset
319 Public method to get the current table index.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
320
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
321 @return current table index
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
322 @rtype int
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
323 """
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
324 return self.__currentTableIndex
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
325
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
326 def selectTable(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
327 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
328 Public method to select the shown character table.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
329
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
330 @param index index of the character table
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
331 @type int
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
332 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
333 self.beginResetModel()
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
334 self.__currentTableIndex = index
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
335 self.endResetModel()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
336
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
337 def headerData(self, section, orientation, role=Qt.ItemDataRole.DisplayRole):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 Public method to get header data from the model.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
340
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
341 @param section section number
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
342 @type int
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
343 @param orientation orientation
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
344 @type Qt.Orientation
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
345 @param role role of the data to retrieve
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
346 @type Qt.ItemDataRole
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 @return requested data
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
348 @rtype Any
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 """
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
350 if (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
351 orientation == Qt.Orientation.Horizontal
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
352 and role == Qt.ItemDataRole.DisplayRole
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
353 ):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 return self.__headerData[section]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
355
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 return QAbstractTableModel.headerData(self, section, orientation, role)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
357
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
358 def data(self, index, role=Qt.ItemDataRole.DisplayRole):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 Public method to get data from the model.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
361
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
362 @param index index to get data for
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
363 @type QModelIndex
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
364 @param role role of the data to retrieve
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
365 @type int
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 @return requested data
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
367 @rtype Any
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 """
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
369 symbolId = self.__tables[self.__currentTableIndex][0] + index.row()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
370
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
371 if role == Qt.ItemDataRole.DisplayRole:
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 col = index.column()
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 if col == 0:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
374 return self.__locale.toString(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 elif col == 1:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
376 return chr(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 elif col == 2:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
378 return "0x{0:04x}".format(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 elif col == 3:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
380 if symbolId in html.entities.codepoint2name:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
381 return "&{0};".format(html.entities.codepoint2name[symbolId])
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
382 elif col == 4:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
383 return unicodedata.name(chr(symbolId), "").title()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
384
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
385 if role == Qt.ItemDataRole.BackgroundRole and index.column() == 0:
8853
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
386 if self.__isDark:
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
387 return QColor("#4d4d4d")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
388 else:
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
389 return QColor(Qt.GlobalColor.lightGray)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
390
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
391 if role == Qt.ItemDataRole.ForegroundRole:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
392 char = chr(symbolId)
8853
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
393 if self.__isDark:
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
394 if self.__isDigit(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
395 return QColor("#8787ff")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
396 elif self.__isLetter(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
397 return QColor("#87ff87")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
398 elif self.__isMark(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
399 return QColor("#ff8787")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
400 elif self.__isSymbol(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
401 return QColor("#ffc060")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
402 elif self.__isPunct(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
403 return QColor("#d080ff")
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
404 else:
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
405 return QColor(Qt.GlobalColor.lightGray)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 else:
8853
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
407 if self.__isDigit(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
408 return QColor(Qt.GlobalColor.darkBlue)
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
409 elif self.__isLetter(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
410 return QColor(Qt.GlobalColor.darkGreen)
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
411 elif self.__isMark(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
412 return QColor(Qt.GlobalColor.darkRed)
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
413 elif self.__isSymbol(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
414 return QColor(Qt.GlobalColor.darkYellow)
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
415 elif self.__isPunct(char):
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
416 return QColor(Qt.GlobalColor.darkMagenta)
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
417 else:
efcceef1e26b Adapted the colors of the symbols viewer for dark color themes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8838
diff changeset
418 return QColor(Qt.GlobalColor.darkGray)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
419
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
420 if role == Qt.ItemDataRole.TextAlignmentRole and index.column() in [0, 1, 3]:
9160
1675c039a568 Implemented a correction for a PyQt6 enum related issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
421 return Qt.AlignmentFlag.AlignHCenter.value
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
422
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 return None
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
424
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 def columnCount(self, parent):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 Public method to get the number of columns of the model.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
428
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
429 @param parent parent index
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
430 @type QModelIndex
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
431 @return number of columns
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
432 @rtype int
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 if parent.column() > 0:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 return 0
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 else:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 return len(self.__headerData)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 def rowCount(self, parent):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 Public method to get the number of rows of the model.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
442
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
443 @param parent parent index
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
444 @type QModelIndex
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
445 @return number of columns
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
446 @rtype int
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 if parent.isValid():
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 return 0
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 else:
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
451 first, last = self.__tables[self.__currentTableIndex][:2]
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
452 return last - first + 1
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
453
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 def __isDigit(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 Private method to check, if a character is a digit.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
457
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
458 @param char character to test
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
459 @type str
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
460 @return flag indicating a digit
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
461 @rtype bool
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 """
9539
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
463 return unicodedata.category(str(char)) in ("Nd", "Nl", "No")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
464
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 def __isLetter(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 Private method to check, if a character is a letter.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
468
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
469 @param char character to test
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
470 @type str
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
471 @return flag indicating a letter
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
472 @rtype bool
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 """
9539
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
474 return unicodedata.category(str(char)) in ("Lu", "Ll", "Lt", "Lm", "Lo")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
475
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 def __isMark(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 Private method to check, if a character is a mark character.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
479
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
480 @param char character to test
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
481 @type str
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
482 @return flag indicating a mark character
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
483 @rtype bool
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 """
9539
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
485 return unicodedata.category(str(char)) in ("Mn", "Mc", "Me")
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
486
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
487 def __isPunct(self, char):
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
488 """
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
489 Private method to check, if a character is a punctuation character.
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
490
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
491 @param char character to test
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
492 @type str
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
493 @return flag indicating a punctuation character
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
494 @rtype boolean)
9539
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
495 """
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
496 return unicodedata.category(str(char)) in (
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
497 "Pc",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
498 "Pd",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
499 "Ps",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
500 "Pe",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
501 "Pi",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
502 "Pf",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
503 "Po",
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
504 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
505
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 def __isSymbol(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 Private method to check, if a character is a symbol.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
509
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
510 @param char character to test
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
511 @type str
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
512 @return flag indicating a symbol
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
513 @rtype bool
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 """
9539
67a811025fa7 Some little changes to the Symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
515 return unicodedata.category(str(char)) in ("Sm", "Sc", "Sk", "So")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
516
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
517 def getLocale(self):
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
518 """
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
519 Public method to get the used locale.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
520
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
521 @return used locale
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
522 @rtype QLocale
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
523 """
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
524 return self.__locale
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
526
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 class SymbolsWidget(QWidget, Ui_SymbolsWidget):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 Class implementing a widget to select a symbol in various formats.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
530
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 @signal insertSymbol(str) emitted after the user has selected a symbol
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
533
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 insertSymbol = pyqtSignal(str)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
535
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
536 def __init__(self, parent=None):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
539
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
540 @param parent reference to the parent widget
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
541 @type QWidget
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
543 super().__init__(parent)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 self.setupUi(self)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
545
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
546 self.setWindowIcon(EricPixmapCache.getIcon("eric"))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
547
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 self.__model = SymbolsModel(self)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 self.symbolsTable.setModel(self.__model)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
550 self.symbolsTable.selectionModel().currentRowChanged.connect(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
551 self.__currentRowChanged
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
552 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
553
7198
684261ef2165 Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
554 self.symbolsTable.horizontalHeader().setSectionResizeMode(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
555 QHeaderView.ResizeMode.Fixed
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
556 )
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 fm = self.fontMetrics()
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
558 em = fm.horizontalAdvance("M")
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 self.symbolsTable.horizontalHeader().resizeSection(0, em * 5)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 self.symbolsTable.horizontalHeader().resizeSection(1, em * 5)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 self.symbolsTable.horizontalHeader().resizeSection(2, em * 6)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 self.symbolsTable.horizontalHeader().resizeSection(3, em * 8)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
563 self.symbolsTable.horizontalHeader().resizeSection(4, em * 85)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
564 self.symbolsTable.verticalHeader().setDefaultSectionSize(fm.height() + 4)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
565
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
566 tableIndex = int(Preferences.getSettings().value("Symbols/CurrentTable", 1))
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
567 self.tableCombo.addItems(self.__model.getTableNames())
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
568 self.tableCombo.setCurrentIndex(tableIndex)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
569
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
570 index = self.__model.index(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
571 int(Preferences.getSettings().value("Symbols/Top", 0)), 0
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
572 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
573 self.symbolsTable.scrollTo(index, QAbstractItemView.ScrollHint.PositionAtTop)
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3012
diff changeset
574 self.symbolsTable.selectionModel().setCurrentIndex(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3012
diff changeset
575 index,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
576 QItemSelectionModel.SelectionFlag.SelectCurrent
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
577 | QItemSelectionModel.SelectionFlag.Rows,
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
578 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
579
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 @pyqtSlot(QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 def on_symbolsTable_activated(self, index):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 Private slot to signal the selection of a symbol.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
584
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
585 @param index index of the selected symbol
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
586 @type QModelIndex
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588 txt = self.__model.data(index)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
589 if txt:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
590 self.insertSymbol.emit(txt)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
591
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
592 @pyqtSlot()
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
593 def on_symbolSpinBox_editingFinished(self):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
594 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
595 Private slot to move the table to the entered symbol id.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
596 """
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
597 symbolId = self.symbolSpinBox.value()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
598 first, last = self.__model.getTableBoundaries(self.__model.getTableIndex())
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
599 row = symbolId - first
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
600 self.symbolsTable.selectRow(row)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
601 self.symbolsTable.scrollTo(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
602 self.__model.index(row, 0), QAbstractItemView.ScrollHint.PositionAtCenter
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
603 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
604
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
605 @pyqtSlot(int)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
606 def on_tableCombo_currentIndexChanged(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
607 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
608 Private slot to select the current character table.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
609
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
610 @param index index of the character table
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
611 @type int
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
612 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
613 self.symbolsTable.setUpdatesEnabled(False)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
614 self.__model.selectTable(index)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
615 self.symbolsTable.setUpdatesEnabled(True)
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
616 self.symbolsTable.resizeColumnsToContents()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
617
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
618 first, last = self.__model.getTableBoundaries(index)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
619 self.symbolSpinBox.setMinimum(first)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
620 self.symbolSpinBox.setMaximum(last)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
621
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
622 Preferences.getSettings().setValue("Symbols/CurrentTable", index)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
623
10069
435cc5875135 Corrected and checked some code style issues (unused function arguments).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
624 @pyqtSlot(QModelIndex, QModelIndex)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
625 def __currentRowChanged(self, current, previous):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
626 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
627 Private slot recording the currently selected row.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
628
10433
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
629 @param current current index
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
630 @type QModelIndex
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
631 @param previous previous current index
328f3ec4b77a Converted some source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10069
diff changeset
632 @type QModelIndex
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
633 """
8637
394377638256 Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
634 Preferences.getSettings().setValue("Symbols/Top", current.row())
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
635 self.symbolSpinBox.setValue(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
636 self.__model.getLocale().toInt(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
637 self.__model.data(self.__model.index(current.row(), 0))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
638 )[0]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
639 )

eric ide

mercurial