Предыдущие серии прелюдия, часть 1. часть 2. часть 3.
Ну, блин, ржу не могу!!! Ведь только перечитав то, что я понаписал в третьей части этого сериала, до меня дошло, что и в первой, и во второй частях речь тоже идёт о безобразиях, творимых таким же навязанным системой недекларируемым сервисом, от которого невозможно отказаться ("Пьяный дебош заказывали? Нет? Плевать, у нас оплачено!!!..." )
А самое неприятное, что этот сервис оказывает влияние на инструменты разработки (в частности, Qt Designer), причём делает это фрагментарно. Например, код файла дизайна из второй части сериала выглядит одинаково, независимо от того под какой системой его создавали. Проверялось это самым простым способом - файл дизайна создавался под Lubuntu, затем загружался в Qt Designer под OpenSUSE, сохранялся под другим именем и выполнялось сравнение содержимого этих двух файлов.
А вот слегка видоизменённый вариант дизайна в обновлённом приложении эту проверку уже не проходит.
gift_probe.py
| Python | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
| #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5 import uic
from PyQt5.QtCore import (
pyqtSlot
)
from PyQt5.QtWidgets import (
QApplication,
QLabel,
QMainWindow
)
APP_NAME = 'Greek Gift Probe v0.003'
class Main_window(QMainWindow):
def __init__(self, parent=None):
super(Main_window, self).__init__(parent)
uic.loadUi('gift_probe.ui', self)
@pyqtSlot(name='on_action_en_halt_triggered')
@pyqtSlot(name='on_action_ru_halt_triggered')
@pyqtSlot(name='on_action_en_double_triggered')
@pyqtSlot(name='on_action_ru_double_triggered')
@pyqtSlot(name='on_action_en_lie_triggered')
@pyqtSlot(name='on_action_ru_lie_triggered')
@pyqtSlot(name='on_action_en_alarm_triggered')
@pyqtSlot(name='on_action_ru_alarm_triggered')
@pyqtSlot(name='on_pushButton_en_halt_pressed')
@pyqtSlot(name='on_pushButton_ru_halt_pressed')
@pyqtSlot(name='on_pushButton_en_double_pressed')
@pyqtSlot(name='on_pushButton_ru_double_pressed')
@pyqtSlot(name='on_pushButton_en_lie_pressed')
@pyqtSlot(name='on_pushButton_ru_lie_pressed')
@pyqtSlot(name='on_pushButton_en_alarm_pressed')
@pyqtSlot(name='on_pushButton_ru_alarm_pressed')
def on_pushbutton_pressed(self):
self.findChild(QLabel, 'label_tablo').setText(
self.toolTip().format(
self.sender().text(),
self.sender().toolTip()
)
)
pass
@pyqtSlot(name='on_pushButton_en_halt_released')
@pyqtSlot(name='on_pushButton_ru_halt_released')
@pyqtSlot(name='on_pushButton_en_double_released')
@pyqtSlot(name='on_pushButton_ru_double_released')
@pyqtSlot(name='on_pushButton_en_lie_released')
@pyqtSlot(name='on_pushButton_ru_lie_released')
@pyqtSlot(name='on_pushButton_en_alarm_released')
@pyqtSlot(name='on_pushButton_ru_alarm_released')
def on_pushbutton_released(self):
self.findChild(QLabel, 'label_tablo').setText('')
pass
if __name__ == '__main__':
app = QApplication(sys.argv)
mwin = Main_window()
mwin.show()
sys.exit(app.exec_()) |
|
Файл дизайна, созданный под честной Lubuntu 
gift_probe.ui
| XML | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
| <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>456</width>
<height>324</height>
</rect>
</property>
<property name="windowTitle">
<string>Нажми на кнопку</string>
</property>
<property name="toolTip">
<string>{!s} ==> {!s}</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>51</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_tablo">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_ru_halt">
<property name="toolTip">
<string>По команде <b>Стой!</b> - стою</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Стой</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_en_alarm">
<property name="toolTip">
<string>По команде <b>Alarm!</b> - боюсь</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Alarm</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_ru_double">
<property name="toolTip">
<string>По команде <b>Бегом!</b> - бегу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Бегом</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_en_lie">
<property name="toolTip">
<string>По команде <b>Lie down!</b> - лежу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Lie down</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_ru_lie">
<property name="toolTip">
<string>По команде <b>Ложись!</b> - лежу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Ложись</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_en_double">
<property name="toolTip">
<string>По команде <b>At the double!</b> - бегу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>At the double</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_ru_alarm">
<property name="toolTip">
<string>По команде <b>Бойся!</b> - боюсь</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Бойся</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_en_halt">
<property name="toolTip">
<string>По команде <b>Halt!</b> - стою</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Halt</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>456</width>
<height>32</height>
</rect>
</property>
<widget class="QMenu" name="menuEnglish">
<property name="title">
<string>English</string>
</property>
<addaction name="action_en_halt"/>
<addaction name="action_en_double"/>
<addaction name="action_en_lie"/>
<addaction name="action_en_alarm"/>
</widget>
<widget class="QMenu" name="menuRussian">
<property name="title">
<string>Русский</string>
</property>
<addaction name="action_ru_halt"/>
<addaction name="action_ru_double"/>
<addaction name="action_ru_lie"/>
<addaction name="action_ru_alarm"/>
</widget>
<addaction name="menuEnglish"/>
<addaction name="menuRussian"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_en_halt">
<property name="text">
<string>Halt</string>
</property>
<property name="toolTip">
<string>По команде <b>Halt!</b> - стою</string>
</property>
</action>
<action name="action_en_double">
<property name="text">
<string>At the double</string>
</property>
<property name="toolTip">
<string>По команде <b>At the double!</b> - бегу</string>
</property>
</action>
<action name="action_en_lie">
<property name="text">
<string>Lie down</string>
</property>
<property name="toolTip">
<string>По команде <b>Lie down!</b> - лежу</string>
</property>
</action>
<action name="action_en_alarm">
<property name="text">
<string>Alarm</string>
</property>
<property name="toolTip">
<string>По команде <b>Alarm!</b> - боюсь</string>
</property>
</action>
<action name="action_ru_halt">
<property name="text">
<string>Стой</string>
</property>
<property name="toolTip">
<string>По команде <b>Стой!</b> - стою</string>
</property>
</action>
<action name="action_ru_double">
<property name="text">
<string>Бегом</string>
</property>
<property name="toolTip">
<string>По команде <b>Бегом!</b> - бегу</string>
</property>
</action>
<action name="action_ru_lie">
<property name="text">
<string>Ложись</string>
</property>
<property name="toolTip">
<string>По команде <b>Ложись!</b> - лежу</string>
</property>
</action>
<action name="action_ru_alarm">
<property name="text">
<string>Бойся</string>
</property>
<property name="toolTip">
<string>По команде <b>Бойся!</b> - боюсь</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui> |
|
А вот так он станет выглядеть, если его загрузить в Qt Designer под OpenSUSE и тут же сохранить:
gift_probe.ui
| XML | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
| <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>456</width>
<height>324</height>
</rect>
</property>
<property name="windowTitle">
<string>Нажми на кнопку</string>
</property>
<property name="toolTip">
<string>{!s} ==> {!s}</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>51</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_tablo">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_ru_halt">
<property name="toolTip">
<string>По команде <b>Стой!</b> - стою</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Стой</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_en_alarm">
<property name="toolTip">
<string>По команде <b>Alarm!</b> - боюсь</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Alarm</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_ru_double">
<property name="toolTip">
<string>По команде <b>Бегом!</b> - бегу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Бегом</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_en_lie">
<property name="toolTip">
<string>По команде <b>Lie down!</b> - лежу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Lie down</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_ru_lie">
<property name="toolTip">
<string>По команде <b>Ложись!</b> - лежу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Ложись</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_en_double">
<property name="toolTip">
<string>По команде <b>At the double!</b> - бегу</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>At the double</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_ru_alarm">
<property name="toolTip">
<string>По команде <b>Бойся!</b> - боюсь</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Бойся</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_en_halt">
<property name="toolTip">
<string>По команде <b>Halt!</b> - стою</string>
</property>
<property name="toolTipDuration">
<number>10</number>
</property>
<property name="text">
<string>Halt</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>456</width>
<height>32</height>
</rect>
</property>
<widget class="QMenu" name="menuEnglish">
<property name="title">
<string>E&nglish</string>
</property>
<addaction name="action_en_halt"/>
<addaction name="action_en_double"/>
<addaction name="action_en_lie"/>
<addaction name="action_en_alarm"/>
</widget>
<widget class="QMenu" name="menuRussian">
<property name="title">
<string>Русский</string>
</property>
<addaction name="action_ru_halt"/>
<addaction name="action_ru_double"/>
<addaction name="action_ru_lie"/>
<addaction name="action_ru_alarm"/>
</widget>
<addaction name="menuEnglish"/>
<addaction name="menuRussian"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_en_halt">
<property name="text">
<string>&Halt</string>
</property>
<property name="toolTip">
<string>По команде <b>Halt!</b> - стою</string>
</property>
</action>
<action name="action_en_double">
<property name="text">
<string>&At the double</string>
</property>
<property name="toolTip">
<string>По команде <b>At the double!</b> - бегу</string>
</property>
</action>
<action name="action_en_lie">
<property name="text">
<string>&Lie down</string>
</property>
<property name="toolTip">
<string>По команде <b>Lie down!</b> - лежу</string>
</property>
</action>
<action name="action_en_alarm">
<property name="text">
<string>Ala&rm</string>
</property>
<property name="toolTip">
<string>По команде <b>Alarm!</b> - боюсь</string>
</property>
</action>
<action name="action_ru_halt">
<property name="text">
<string>Стой</string>
</property>
<property name="toolTip">
<string>По команде <b>Стой!</b> - стою</string>
</property>
</action>
<action name="action_ru_double">
<property name="text">
<string>Бегом</string>
</property>
<property name="toolTip">
<string>По команде <b>Бегом!</b> - бегу</string>
</property>
</action>
<action name="action_ru_lie">
<property name="text">
<string>Ложись</string>
</property>
<property name="toolTip">
<string>По команде <b>Ложись!</b> - лежу</string>
</property>
</action>
<action name="action_ru_alarm">
<property name="text">
<string>Бойся</string>
</property>
<property name="toolTip">
<string>По команде <b>Бойся!</b> - боюсь</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui> |
|
Почему Qt Designer под OpenSUSE так по-разному сохраняет тексты элементов управления, выполненнные латиницей (где-то вставляет амперсанды, а где-то - нет) - тайна великая есть. Файлы дизайна (и тот, и другой) одинаково работоспособны.
Условно пострадавшим (может быть? ) тут будет переводчик, которому добавится работы при подготовке файлов переводов.
Закрывая тему, прихожу к выводу, что пользователя не мешало бы предупреждать о возможных проблемах. Ведь систем-то много - хороших и разных , не только в OpenSUSE могут быть такие причуды. А, вот, что может послужить надёжным индикатором этих самых проблем - пока не понятно... Напрашивается-то на эту роль подсчёт количества трансляторов, предустановленных системой при запуске приложения, но будет ли это достаточно надёжным?
|