@@ -44,10 +44,12 @@ void AnnouncementSettingWidget::changeEvent(QEvent *e)
44
44
}
45
45
}
46
46
47
- void AnnouncementSettingWidget::setSettings (TextSettings &settings, TextSettings &settings2)
47
+ void AnnouncementSettingWidget::setSettings (TextSettings &settings, TextSettings &settings2, TextSettings &settings3, TextSettings &settings4 )
48
48
{
49
49
mySettings = settings;
50
50
mySettings2 = settings2;
51
+ mySettings3 = settings3;
52
+ mySettings4 = settings4;
51
53
loadSettings ();
52
54
}
53
55
@@ -62,20 +64,40 @@ void AnnouncementSettingWidget::loadSettings()
62
64
ui->checkBoxUseFading2 ->setChecked (mySettings2.useFading );
63
65
ui->checkBoxUseBlurredShadow2 ->setChecked (mySettings2.useBlurShadow );
64
66
67
+ ui->checkBoxUseShadow3 ->setChecked (mySettings3.useShadow );
68
+ ui->checkBoxUseFading3 ->setChecked (mySettings3.useFading );
69
+ ui->checkBoxUseBlurredShadow3 ->setChecked (mySettings3.useBlurShadow );
70
+
71
+ ui->checkBoxUseShadow4 ->setChecked (mySettings4.useShadow );
72
+ ui->checkBoxUseFading4 ->setChecked (mySettings4.useFading );
73
+ ui->checkBoxUseBlurredShadow4 ->setChecked (mySettings4.useBlurShadow );
74
+
65
75
// Set background
66
76
ui->groupBoxBackground ->setChecked (mySettings.useBackground );
67
77
ui->lineEditBackground ->setText (mySettings.backgroundName );
68
78
69
79
ui->groupBoxBackground2 ->setChecked (mySettings2.useBackground );
70
80
ui->lineEditBackground2 ->setText (mySettings2.backgroundName );
71
81
82
+ ui->groupBoxBackground3 ->setChecked (mySettings3.useBackground );
83
+ ui->lineEditBackground3 ->setText (mySettings3.backgroundName );
84
+
85
+ ui->groupBoxBackground4 ->setChecked (mySettings4.useBackground );
86
+ ui->lineEditBackground4 ->setText (mySettings4.backgroundName );
87
+
72
88
// Set Alignment
73
89
ui->comboBoxVerticalAling ->setCurrentIndex (mySettings.textAlignmentV );
74
90
ui->comboBoxHorizontalAling ->setCurrentIndex (mySettings.textAlignmentH );
75
91
76
92
ui->comboBoxVerticalAling2 ->setCurrentIndex (mySettings2.textAlignmentV );
77
93
ui->comboBoxHorizontalAling2 ->setCurrentIndex (mySettings2.textAlignmentH );
78
94
95
+ ui->comboBoxVerticalAling3 ->setCurrentIndex (mySettings3.textAlignmentV );
96
+ ui->comboBoxHorizontalAling3 ->setCurrentIndex (mySettings3.textAlignmentH );
97
+
98
+ ui->comboBoxVerticalAling4 ->setCurrentIndex (mySettings4.textAlignmentV );
99
+ ui->comboBoxHorizontalAling4 ->setCurrentIndex (mySettings4.textAlignmentH );
100
+
79
101
// Set text color
80
102
QPalette p;
81
103
p.setColor (QPalette::Base,mySettings.textColor );
@@ -84,15 +106,29 @@ void AnnouncementSettingWidget::loadSettings()
84
106
p.setColor (QPalette::Base,mySettings2.textColor );
85
107
ui->graphicViewTextColor2 ->setPalette (p);
86
108
109
+ p.setColor (QPalette::Base,mySettings3.textColor );
110
+ ui->graphicViewTextColor3 ->setPalette (p);
111
+
112
+ p.setColor (QPalette::Base,mySettings4.textColor );
113
+ ui->graphicViewTextColor4 ->setPalette (p);
114
+
87
115
// Set text font lable
88
116
ui->labelFont ->setText (getFontText (mySettings.textFont ));
89
117
ui->labelFont2 ->setText (getFontText (mySettings2.textFont ));
118
+ ui->labelFont3 ->setText (getFontText (mySettings3.textFont ));
119
+ ui->labelFont4 ->setText (getFontText (mySettings4.textFont ));
120
+
121
+ ui->groupBoxUseDisp2 ->setChecked (!mySettings2.useDisp1settings );
122
+ on_groupBoxUseDisp2_toggled (!mySettings2.useDisp1settings );
90
123
91
- ui->groupBoxUseDisp2 ->setChecked (mySettings2.useDisp2settings );
92
- on_groupBoxUseDisp2_toggled (mySettings2.useDisp2settings );
124
+ ui->groupBoxUseDisp3 ->setChecked (!mySettings3.useDisp1settings );
125
+ on_groupBoxUseDisp3_toggled (!mySettings3.useDisp1settings );
126
+
127
+ ui->groupBoxUseDisp4 ->setChecked (!mySettings4.useDisp1settings );
128
+ on_groupBoxUseDisp4_toggled (!mySettings4.useDisp1settings );
93
129
}
94
130
95
- void AnnouncementSettingWidget::getSettings (TextSettings &settings, TextSettings &settings2)
131
+ void AnnouncementSettingWidget::getSettings (TextSettings &settings, TextSettings &settings2, TextSettings &settings3, TextSettings &settings4 )
96
132
{
97
133
// Effects
98
134
mySettings.useShadow = ui->checkBoxUseShadow ->isChecked ();
@@ -103,24 +139,53 @@ void AnnouncementSettingWidget::getSettings(TextSettings &settings, TextSettings
103
139
mySettings2.useFading = ui->checkBoxUseFading2 ->isChecked ();
104
140
mySettings2.useBlurShadow = ui->checkBoxUseBlurredShadow2 ->isChecked ();
105
141
142
+ mySettings3.useShadow = ui->checkBoxUseShadow3 ->isChecked ();
143
+ mySettings3.useFading = ui->checkBoxUseFading3 ->isChecked ();
144
+ mySettings3.useBlurShadow = ui->checkBoxUseBlurredShadow3 ->isChecked ();
145
+
146
+ mySettings4.useShadow = ui->checkBoxUseShadow4 ->isChecked ();
147
+ mySettings4.useFading = ui->checkBoxUseFading4 ->isChecked ();
148
+ mySettings4.useBlurShadow = ui->checkBoxUseBlurredShadow4 ->isChecked ();
149
+
106
150
// Get Background
107
151
mySettings.useBackground = ui->groupBoxBackground ->isChecked ();
108
152
mySettings.backgroundName = ui->lineEditBackground ->text ();
109
153
110
154
mySettings2.useBackground = ui->groupBoxBackground2 ->isChecked ();
111
155
mySettings2.backgroundName = ui->lineEditBackground2 ->text ();
112
156
113
- // Alingmet
157
+ mySettings3.useBackground = ui->groupBoxBackground3 ->isChecked ();
158
+ mySettings3.backgroundName = ui->lineEditBackground3 ->text ();
159
+
160
+ mySettings4.useBackground = ui->groupBoxBackground4 ->isChecked ();
161
+ mySettings4.backgroundName = ui->lineEditBackground4 ->text ();
162
+
163
+ // Alignmet
114
164
mySettings.textAlignmentV = ui->comboBoxVerticalAling ->currentIndex ();
115
165
mySettings.textAlignmentH = ui->comboBoxHorizontalAling ->currentIndex ();
116
166
117
167
mySettings2.textAlignmentV = ui->comboBoxVerticalAling2 ->currentIndex ();
118
168
mySettings2.textAlignmentH = ui->comboBoxHorizontalAling2 ->currentIndex ();
119
169
170
+ mySettings3.textAlignmentV = ui->comboBoxVerticalAling3 ->currentIndex ();
171
+ mySettings3.textAlignmentH = ui->comboBoxHorizontalAling3 ->currentIndex ();
172
+
173
+ mySettings4.textAlignmentV = ui->comboBoxVerticalAling4 ->currentIndex ();
174
+ mySettings4.textAlignmentH = ui->comboBoxHorizontalAling4 ->currentIndex ();
175
+
176
+ mySettings2.useDisp1settings = !ui->groupBoxUseDisp2 ->isChecked ();
120
177
mySettings2.useDisp2settings = ui->groupBoxUseDisp2 ->isChecked ();
121
178
179
+ mySettings3.useDisp1settings = !ui->groupBoxUseDisp3 ->isChecked ();
180
+ mySettings3.useDisp3settings = ui->groupBoxUseDisp3 ->isChecked ();
181
+
182
+ mySettings4.useDisp1settings = !ui->groupBoxUseDisp4 ->isChecked ();
183
+ mySettings4.useDisp4settings = ui->groupBoxUseDisp4 ->isChecked ();
184
+
122
185
settings = mySettings;
123
- settings2 = mySettings2;
186
+ settings2 = mySettings2;
187
+ settings3 = mySettings3;
188
+ settings4 = mySettings4;
124
189
}
125
190
126
191
void AnnouncementSettingWidget::on_checkBoxUseShadow_stateChanged (int arg1)
@@ -145,6 +210,28 @@ void AnnouncementSettingWidget::on_checkBoxUseShadow2_stateChanged(int arg1)
145
210
}
146
211
}
147
212
213
+ void AnnouncementSettingWidget::on_checkBoxUseShadow3_stateChanged (int arg1)
214
+ {
215
+ if (arg1==2 )
216
+ ui->checkBoxUseBlurredShadow3 ->setEnabled (true );
217
+ else
218
+ {
219
+ ui->checkBoxUseBlurredShadow3 ->setChecked (false );
220
+ ui->checkBoxUseBlurredShadow3 ->setEnabled (false );
221
+ }
222
+ }
223
+
224
+ void AnnouncementSettingWidget::on_checkBoxUseShadow4_stateChanged (int arg1)
225
+ {
226
+ if (arg1==2 )
227
+ ui->checkBoxUseBlurredShadow4 ->setEnabled (true );
228
+ else
229
+ {
230
+ ui->checkBoxUseBlurredShadow4 ->setChecked (false );
231
+ ui->checkBoxUseBlurredShadow4 ->setEnabled (false );
232
+ }
233
+ }
234
+
148
235
void AnnouncementSettingWidget::on_buttonBackground_clicked ()
149
236
{
150
237
QString filename = QFileDialog::getOpenFileName (this , tr (" Select a image for announcement wallpaper" ),
@@ -175,11 +262,51 @@ void AnnouncementSettingWidget::on_buttonBackground2_clicked()
175
262
}
176
263
}
177
264
265
+ void AnnouncementSettingWidget::on_buttonBackground3_clicked ()
266
+ {
267
+ QString filename = QFileDialog::getOpenFileName (this , tr (" Select a image for announcement wallpaper" ),
268
+ " ." , tr (" Images(%1)" ).arg (getSupportedImageFormats ()));
269
+ if (!filename.isNull ())
270
+ {
271
+ QPixmap p (filename);
272
+ mySettings3.backgroundPix = p;
273
+ QFileInfo fi (filename);
274
+ filename = fi.fileName ();
275
+ mySettings3.backgroundName = filename;
276
+ ui->lineEditBackground3 ->setText (filename);
277
+ }
278
+ }
279
+
280
+ void AnnouncementSettingWidget::on_buttonBackground4_clicked ()
281
+ {
282
+ QString filename = QFileDialog::getOpenFileName (this , tr (" Select a image for announcement wallpaper" ),
283
+ " ." , tr (" Images(%1)" ).arg (getSupportedImageFormats ()));
284
+ if (!filename.isNull ())
285
+ {
286
+ QPixmap p (filename);
287
+ mySettings4.backgroundPix = p;
288
+ QFileInfo fi (filename);
289
+ filename = fi.fileName ();
290
+ mySettings4.backgroundName = filename;
291
+ ui->lineEditBackground4 ->setText (filename);
292
+ }
293
+ }
294
+
178
295
void AnnouncementSettingWidget::setDispScreen2Visible (bool visible)
179
296
{
180
297
ui->groupBoxUseDisp2 ->setVisible (visible);
181
298
}
182
299
300
+ void AnnouncementSettingWidget::setDispScreen3Visible (bool visible)
301
+ {
302
+ ui->groupBoxUseDisp3 ->setVisible (visible);
303
+ }
304
+
305
+ void AnnouncementSettingWidget::setDispScreen4Visible (bool visible)
306
+ {
307
+ ui->groupBoxUseDisp4 ->setVisible (visible);
308
+ }
309
+
183
310
void AnnouncementSettingWidget::on_toolButtonColor_clicked ()
184
311
{
185
312
QColor c (QColorDialog::getColor (mySettings.textColor ,this ));
@@ -200,6 +327,26 @@ void AnnouncementSettingWidget::on_toolButtonColor2_clicked()
200
327
ui->graphicViewTextColor2 ->setPalette (p);
201
328
}
202
329
330
+ void AnnouncementSettingWidget::on_toolButtonColor3_clicked ()
331
+ {
332
+ QColor c (QColorDialog::getColor (mySettings3.textColor ,this ));
333
+ if (c.isValid ())
334
+ mySettings3.textColor = c;
335
+ QPalette p;
336
+ p.setColor (QPalette::Base,mySettings3.textColor );
337
+ ui->graphicViewTextColor3 ->setPalette (p);
338
+ }
339
+
340
+ void AnnouncementSettingWidget::on_toolButtonColor4_clicked ()
341
+ {
342
+ QColor c (QColorDialog::getColor (mySettings4.textColor ,this ));
343
+ if (c.isValid ())
344
+ mySettings4.textColor = c;
345
+ QPalette p;
346
+ p.setColor (QPalette::Base,mySettings4.textColor );
347
+ ui->graphicViewTextColor4 ->setPalette (p);
348
+ }
349
+
203
350
void AnnouncementSettingWidget::on_toolButtonFont_clicked ()
204
351
{
205
352
bool ok;
@@ -220,18 +367,54 @@ void AnnouncementSettingWidget::on_toolButtonFont2_clicked()
220
367
ui->labelFont2 ->setText (getFontText (mySettings2.textFont ));
221
368
}
222
369
370
+ void AnnouncementSettingWidget::on_toolButtonFont3_clicked ()
371
+ {
372
+ bool ok;
373
+ QFont font = QFontDialog::getFont (&ok,mySettings3.textFont ,this );
374
+ if (ok)
375
+ mySettings3.textFont = font;
376
+
377
+ ui->labelFont3 ->setText (getFontText (mySettings3.textFont ));
378
+ }
379
+
380
+ void AnnouncementSettingWidget::on_toolButtonFont4_clicked ()
381
+ {
382
+ bool ok;
383
+ QFont font = QFontDialog::getFont (&ok,mySettings4.textFont ,this );
384
+ if (ok)
385
+ mySettings4.textFont = font;
386
+
387
+ ui->labelFont4 ->setText (getFontText (mySettings4.textFont ));
388
+ }
389
+
223
390
void AnnouncementSettingWidget::on_groupBoxUseDisp2_toggled (bool arg1)
224
391
{
225
392
ui->groupBoxBackground2 ->setVisible (arg1);
226
393
ui->groupBoxEffects2 ->setVisible (arg1);
227
394
ui->groupBoxTextProperties2 ->setVisible (arg1);
228
395
}
229
396
397
+ void AnnouncementSettingWidget::on_groupBoxUseDisp3_toggled (bool arg1)
398
+ {
399
+ ui->groupBoxBackground3 ->setVisible (arg1);
400
+ ui->groupBoxEffects3 ->setVisible (arg1);
401
+ ui->groupBoxTextProperties3 ->setVisible (arg1);
402
+ }
403
+
404
+ void AnnouncementSettingWidget::on_groupBoxUseDisp4_toggled (bool arg1)
405
+ {
406
+ ui->groupBoxBackground4 ->setVisible (arg1);
407
+ ui->groupBoxEffects4 ->setVisible (arg1);
408
+ ui->groupBoxTextProperties4 ->setVisible (arg1);
409
+ }
410
+
230
411
void AnnouncementSettingWidget::on_pushButtonDefault_clicked ()
231
412
{
232
413
TextSettings a;
233
414
mySettings = a;
234
415
mySettings2 = a;
416
+ mySettings3 = a;
417
+ mySettings4 = a;
235
418
loadSettings ();
236
419
}
237
420
@@ -262,6 +445,12 @@ void AnnouncementSettingWidget::setBackgroungds(QString name, QPixmap back)
262
445
mySettings.backgroundPix = back;
263
446
mySettings2.backgroundName = name;
264
447
mySettings2.backgroundPix = back;
448
+ mySettings3.backgroundName = name;
449
+ mySettings3.backgroundPix = back;
450
+ mySettings4.backgroundName = name;
451
+ mySettings4.backgroundPix = back;
265
452
ui->lineEditBackground ->setText (name);
266
453
ui->lineEditBackground2 ->setText (name);
454
+ ui->lineEditBackground3 ->setText (name);
455
+ ui->lineEditBackground4 ->setText (name);
267
456
}
0 commit comments