Subversion Repositories tpanel

Rev

Rev 43 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 43 Rev 59
Line 30... Line 30...
30
#include <android/log.h>
30
#include <android/log.h>
31
#endif
31
#endif
32
 
32
 
33
#include "tconfig.h"
33
#include "tconfig.h"
34
 
34
 
-
 
35
#define RLOG_INFO           0x00fe
-
 
36
#define RLOG_WARNING        0x00fd
-
 
37
#define RLOG_ERROR          0x00fb
-
 
38
#define RLOG_TRACE          0x00f7
-
 
39
#define RLOG_DEBUG          0x00ef
-
 
40
#define RLOG_PROTOCOL       0x00f8
-
 
41
#define RLOG_ALL            0x00e0
-
 
42
 
35
TQtSettings::TQtSettings(QWidget *parent)
43
TQtSettings::TQtSettings(QWidget *parent)
36
	: QDialog(parent),
44
	: QDialog(parent),
37
	  ui(new Ui::TQtSettings)
45
	  ui(new Ui::TQtSettings)
38
{
46
{
39
	DECL_TRACER("TQtSettings::TQtSettings(QWidget *parent)");
47
	DECL_TRACER("TQtSettings::TQtSettings(QWidget *parent)");
40
 
48
 
-
 
49
    mInitRun = true;
41
	ui->setupUi(this);
50
	ui->setupUi(this);
42
 
51
 
43
    ui->lineEdit_logFile->setText(TConfig::getLogFile().c_str());
52
    ui->lineEdit_logFile->setText(TConfig::getLogFile().c_str());
44
    ui->lineEdit_Controller->setText(TConfig::getController().c_str());
53
    ui->lineEdit_Controller->setText(TConfig::getController().c_str());
45
    ui->lineEdit_PType->setText(TConfig::getPanelType().c_str());
54
    ui->lineEdit_PType->setText(TConfig::getPanelType().c_str());
46
 
55
 
47
    ui->spinBox_Port->setValue(TConfig::getPort());
56
    ui->spinBox_Port->setValue(TConfig::getPort());
48
    ui->spinBox_Channel->setValue(TConfig::getChannel());
57
    ui->spinBox_Channel->setValue(TConfig::getChannel());
-
 
58
 
-
 
59
    mLogLevel = TConfig::getLogLevelBits();
49
    ui->comboBox_logLevel->setCurrentIndex(getLogLevelIndex(TConfig::getLogLevel()));
60
    ui->checkBox_LogInfo->setCheckState((mLogLevel & HLOG_INFO) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
61
    ui->checkBox_LogWarning->setCheckState((mLogLevel & HLOG_WARNING) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
62
    ui->checkBox_LogError->setCheckState((mLogLevel & HLOG_ERROR) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
63
    ui->checkBox_LogTrace->setCheckState((mLogLevel & HLOG_TRACE) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
64
    ui->checkBox_LogDebug->setCheckState((mLogLevel & HLOG_DEBUG) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
65
    ui->checkBox_LogProtocol->setCheckState(((mLogLevel & HLOG_PROTOCOL) == HLOG_PROTOCOL) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
66
    ui->checkBox_LogAll->setCheckState(((mLogLevel & HLOG_ALL) == HLOG_ALL) ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
-
 
67
 
50
    ui->checkBox_Format->setCheckState((TConfig::isLongFormat() ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
68
    ui->checkBox_Format->setCheckState((TConfig::isLongFormat() ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
51
    ui->checkBox_Scale->setCheckState((TConfig::getScale() ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
69
    ui->checkBox_Scale->setCheckState((TConfig::getScale() ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
-
 
70
    mInitRun = false;
-
 
71
    mSetChanged = false;
52
}
72
}
53
 
73
 
54
TQtSettings::~TQtSettings()
74
TQtSettings::~TQtSettings()
55
{
75
{
56
	DECL_TRACER("TQtSettings::~TQtSettings()");
76
	DECL_TRACER("TQtSettings::~TQtSettings()");
Line 142... Line 162...
142
    {
162
    {
143
        rect = parent->geometry();
163
        rect = parent->geometry();
144
        this->move(rect.center() - this->rect().center());
164
        this->move(rect.center() - this->rect().center());
145
    }
165
    }
146
 
166
 
-
 
167
    // Layout
-
 
168
    size = ui->scrollArea->size();
-
 
169
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
170
    ui->scrollArea->resize(size);
-
 
171
    rect = ui->scrollArea->geometry();
-
 
172
    ui->scrollArea->move(scale(rect.left()), scale(rect.top()));
-
 
173
 
-
 
174
    size = ui->scrollAreaWidgetContents->size();
-
 
175
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
176
    ui->scrollAreaWidgetContents->resize(size);
-
 
177
    rect = ui->scrollAreaWidgetContents->geometry();
-
 
178
    ui->scrollAreaWidgetContents->move(scale(rect.left()), scale(rect.top()));
-
 
179
 
147
    // labels
180
    // labels
148
    QFont font = ui->label_Channel->font();
181
    QFont font = ui->label_Channel->font();
149
    font.setPointSizeF(12.0);
182
    font.setPointSizeF(12.0);
150
    size = ui->label_Channel->size();
183
    size = ui->label_Channel->size();
151
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
184
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
Line 182... Line 215...
182
    ui->label_logFile->resize(size);
215
    ui->label_logFile->resize(size);
183
    rect = ui->label_logFile->geometry();
216
    rect = ui->label_logFile->geometry();
184
    ui->label_logFile->move(scale(rect.left()), scale(rect.top()));
217
    ui->label_logFile->move(scale(rect.left()), scale(rect.top()));
185
    ui->label_logFile->setFont(font);
218
    ui->label_logFile->setFont(font);
186
 
219
 
-
 
220
    ui->label_logFormats->resize(size);
-
 
221
    rect = ui->label_logFormats->geometry();
-
 
222
    ui->label_logFormats->move(scale(rect.left()), scale(rect.top()));
-
 
223
    ui->label_logFormats->setFont(font);
-
 
224
 
187
    // Inputs
225
    // Inputs
188
    size = ui->lineEdit_Controller->size();
226
    size = ui->lineEdit_Controller->size();
189
    rect = ui->lineEdit_Controller->geometry();
227
    rect = ui->lineEdit_Controller->geometry();
190
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
228
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
191
    ui->lineEdit_Controller->resize(size);
229
    ui->lineEdit_Controller->resize(size);
Line 237... Line 275...
237
    ui->spinBox_Port->resize(size);
275
    ui->spinBox_Port->resize(size);
238
    rect = ui->spinBox_Port->geometry();
276
    rect = ui->spinBox_Port->geometry();
239
    ui->spinBox_Port->move(scale(rect.left()), scale(rect.top()));
277
    ui->spinBox_Port->move(scale(rect.left()), scale(rect.top()));
240
    ui->spinBox_Port->setFont(font);
278
    ui->spinBox_Port->setFont(font);
241
 
279
 
-
 
280
 
-
 
281
    size = ui->checkBox_LogInfo->size();
-
 
282
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
283
    ui->checkBox_LogInfo->resize(size);
-
 
284
    rect = ui->checkBox_LogInfo->geometry();
-
 
285
    ui->checkBox_LogInfo->move(scale(rect.left()), scale(rect.top()));
-
 
286
    ui->checkBox_LogInfo->setFont(font);
-
 
287
 
-
 
288
    size = ui->checkBox_LogWarning->size();
-
 
289
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
290
    ui->checkBox_LogWarning->resize(size);
-
 
291
    rect = ui->checkBox_LogWarning->geometry();
-
 
292
    ui->checkBox_LogWarning->move(scale(rect.left()), scale(rect.top()));
-
 
293
    ui->checkBox_LogWarning->setFont(font);
-
 
294
 
-
 
295
    size = ui->checkBox_LogError->size();
-
 
296
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
297
    ui->checkBox_LogError->resize(size);
-
 
298
    rect = ui->checkBox_LogError->geometry();
-
 
299
    ui->checkBox_LogError->move(scale(rect.left()), scale(rect.top()));
-
 
300
    ui->checkBox_LogError->setFont(font);
-
 
301
 
-
 
302
    size = ui->checkBox_LogTrace->size();
-
 
303
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
304
    ui->checkBox_LogTrace->resize(size);
-
 
305
    rect = ui->checkBox_LogTrace->geometry();
-
 
306
    ui->checkBox_LogTrace->move(scale(rect.left()), scale(rect.top()));
-
 
307
    ui->checkBox_LogTrace->setFont(font);
-
 
308
 
242
    size = ui->comboBox_logLevel->size();
309
    size = ui->checkBox_LogDebug->size();
243
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
310
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
244
    ui->comboBox_logLevel->resize(size);
311
    ui->checkBox_LogDebug->resize(size);
245
    rect = ui->comboBox_logLevel->geometry();
312
    rect = ui->checkBox_LogDebug->geometry();
246
    ui->comboBox_logLevel->move(scale(rect.left()), scale(rect.top()));
313
    ui->checkBox_LogDebug->move(scale(rect.left()), scale(rect.top()));
247
    ui->comboBox_logLevel->setFont(font);
314
    ui->checkBox_LogDebug->setFont(font);
-
 
315
 
-
 
316
    size = ui->checkBox_LogProtocol->size();
-
 
317
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
318
    ui->checkBox_LogProtocol->resize(size);
-
 
319
    rect = ui->checkBox_LogProtocol->geometry();
-
 
320
    ui->checkBox_LogProtocol->move(scale(rect.left()), scale(rect.top()));
-
 
321
    ui->checkBox_LogProtocol->setFont(font);
-
 
322
 
-
 
323
    size = ui->checkBox_LogAll->size();
-
 
324
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
-
 
325
    ui->checkBox_LogAll->resize(size);
-
 
326
    rect = ui->checkBox_LogAll->geometry();
-
 
327
    ui->checkBox_LogAll->move(scale(rect.left()), scale(rect.top()));
-
 
328
    ui->checkBox_LogAll->setFont(font);
248
 
329
 
249
    size = ui->checkBox_Format->size();
330
    size = ui->checkBox_Format->size();
250
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
331
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
251
    ui->checkBox_Format->resize(size);
332
    ui->checkBox_Format->resize(size);
252
    rect = ui->checkBox_Format->geometry();
333
    rect = ui->checkBox_Format->geometry();
Line 272... Line 353...
272
    ui->buttonBox->resize(size);
353
    ui->buttonBox->resize(size);
273
    rect = ui->buttonBox->geometry();
354
    rect = ui->buttonBox->geometry();
274
    ui->buttonBox->move(scale(rect.left()), scale(rect.top()));
355
    ui->buttonBox->move(scale(rect.left()), scale(rect.top()));
275
    ui->buttonBox->setFont(font);
356
    ui->buttonBox->setFont(font);
276
}
357
}
277
/*
-
 
278
void TQtSettings::on_kiconbutton_projectPath_clicked()
-
 
279
{
-
 
280
    DECL_TRACER("TQtSettings::on_kiconbutton_projectPath_clicked()");
-
 
281
 
358
 
282
    QString fname;
-
 
283
    QString actPath(TConfig::getProjectPath().c_str());
-
 
284
    QString fileName = QFileDialog::getExistingDirectory(this, tr("Directory of project"), actPath);
-
 
285
#ifdef __ANDROID__
-
 
286
    fileName = QQmlFile::urlToLocalFileOrQrc(fileName);
-
 
287
 
-
 
288
    if (fileName.contains("content://"))
-
 
289
    {
-
 
290
        QAndroidJniObject uri = QAndroidJniObject::callStaticObjectMethod(
-
 
291
              "android/net/Uri", "parse", "(Ljava/lang/String;)Landroid/net/Uri;",
-
 
292
              QAndroidJniObject::fromString(fileName).object<jstring>());
-
 
293
 
-
 
294
          fname =
-
 
295
              QAndroidJniObject::callStaticObjectMethod(
-
 
296
                  "org/qtproject/theosys/UriToPath", "getFileName",
-
 
297
                  "(Landroid/net/Uri;Landroid/content/Context;)Ljava/lang/String;",
-
 
298
                  uri.object(), QtAndroid::androidContext().object()).toString();
-
 
299
    }
-
 
300
    else
-
 
301
        fname = fileName;
-
 
302
#else
-
 
303
    QString fname = fileName;
-
 
304
#endif
-
 
305
    if (TConfig::getProjectPath().compare(fname.toStdString()) != 0)
-
 
306
    {
-
 
307
        ui->lineEdit_projectPath->setText(fname);
-
 
308
        mSetChanged = true;
-
 
309
        TConfig::saveProjectPath(fname.toStdString());
-
 
310
    }
-
 
311
}
-
 
312
*/
-
 
313
void TQtSettings::on_lineEdit_logFile_textChanged(const QString &arg1)
359
void TQtSettings::on_lineEdit_logFile_textChanged(const QString &arg1)
314
{
360
{
315
    DECL_TRACER("TQtSettings::on_lineEdit_logFile_textChanged(const QString &arg1)");
361
    DECL_TRACER("TQtSettings::on_lineEdit_logFile_textChanged(const QString &arg1)");
316
 
362
 
317
    if (arg1.compare(TConfig::getLogFile().c_str()) == 0)
363
    if (arg1.compare(TConfig::getLogFile().c_str()) == 0)
Line 319... Line 365...
319
 
365
 
320
    mSetChanged = true;
366
    mSetChanged = true;
321
    TConfig::saveLogFile(arg1.toStdString());
367
    TConfig::saveLogFile(arg1.toStdString());
322
}
368
}
323
 
369
 
324
void TQtSettings::on_comboBox_logLevel_currentIndexChanged(int index)
-
 
325
{
-
 
326
    DECL_TRACER("TQtSettings::on_comboBox_logLevel_currentIndexChanged(int index)");
-
 
327
 
-
 
328
    int idx = getLogLevelIndex(TConfig::getLogLevel());
-
 
329
 
-
 
330
    if (idx == index)
-
 
331
        return;
-
 
332
 
-
 
333
    mSetChanged = true;
-
 
334
 
-
 
335
    switch(index)
-
 
336
    {
-
 
337
        case 0: TConfig::saveLogLevel(SLOG_NONE); break;
-
 
338
        case 1: TConfig::saveLogLevel(SLOG_INFO); break;
-
 
339
        case 2: TConfig::saveLogLevel(SLOG_WARNING); break;
-
 
340
        case 3: TConfig::saveLogLevel(SLOG_ERROR); break;
-
 
341
        case 4: TConfig::saveLogLevel(SLOG_TRACE); break;
-
 
342
        case 5: TConfig::saveLogLevel(SLOG_DEBUG); break;
-
 
343
        case 6: TConfig::saveLogLevel(SLOG_PROTOCOL); break;
-
 
344
        case 7: TConfig::saveLogLevel(SLOG_ALL); break;
-
 
345
    }
-
 
346
}
-
 
347
/*
-
 
348
void TQtSettings::on_lineEdit_projectPath_textChanged(const QString &arg1)
-
 
349
{
-
 
350
    DECL_TRACER("TQtSettings::on_lineEdit_projectPath_textChanged(const QString &arg1)");
-
 
351
 
-
 
352
    if (arg1.compare(TConfig::getProjectPath().c_str()) == 0)
-
 
353
        return;
-
 
354
 
-
 
355
    mSetChanged = true;
-
 
356
    TConfig::saveProjectPath(arg1.toStdString());
-
 
357
}
-
 
358
*/
-
 
359
void TQtSettings::on_lineEdit_Controller_textChanged(const QString &arg1)
370
void TQtSettings::on_lineEdit_Controller_textChanged(const QString &arg1)
360
{
371
{
361
    DECL_TRACER("TQtSettings::on_lineEdit_Controller_textChanged(const QString &arg1)");
372
    DECL_TRACER("TQtSettings::on_lineEdit_Controller_textChanged(const QString &arg1)");
362
 
373
 
363
    if (arg1.compare(TConfig::getController().c_str()) == 0)
374
    if (arg1.compare(TConfig::getController().c_str()) == 0)
Line 398... Line 409...
398
 
409
 
399
    mSetChanged = true;
410
    mSetChanged = true;
400
    TConfig::savePanelType(arg1.toStdString());
411
    TConfig::savePanelType(arg1.toStdString());
401
}
412
}
402
 
413
 
403
int TQtSettings::getLogLevelIndex(const std::string &sl)
-
 
404
{
-
 
405
    DECL_TRACER("TQtSettings::getLogLevelIndex(const std::string &sl)");
-
 
406
 
-
 
407
    int idx = 0;
-
 
408
 
-
 
409
    if (sl.compare(SLOG_NONE) == 0)
-
 
410
        idx = 0;
-
 
411
    else if (sl.compare(SLOG_INFO) == 0)
-
 
412
        idx = 1;
-
 
413
    else if (sl.compare(SLOG_WARNING) == 0)
-
 
414
        idx = 2;
-
 
415
    else if (sl.compare(SLOG_ERROR) == 0)
-
 
416
        idx = 3;
-
 
417
    else if (sl.compare(SLOG_TRACE) == 0)
-
 
418
        idx = 4;
-
 
419
    else if (sl.compare(SLOG_DEBUG) == 0)
-
 
420
        idx = 5;
-
 
421
    else if (sl.compare(SLOG_PROTOCOL) == 0)
-
 
422
        idx = 6;
-
 
423
    else if (sl.compare(SLOG_ALL) == 0)
-
 
424
        idx = 7;
-
 
425
 
-
 
426
    return idx;
-
 
427
}
-
 
428
 
-
 
429
void TQtSettings::on_checkBox_Format_toggled(bool checked)
414
void TQtSettings::on_checkBox_Format_toggled(bool checked)
430
{
415
{
431
    DECL_TRACER("TQtSettings::on_checkBox_Format_toggled(bool checked)");
416
    DECL_TRACER("TQtSettings::on_checkBox_Format_toggled(bool checked)");
432
 
417
 
433
    if (TConfig::isLongFormat() == checked)
418
    if (TConfig::isLongFormat() == checked)
Line 457... Line 442...
457
 
442
 
458
    mSetChanged = true;
443
    mSetChanged = true;
459
    TConfig::saveProfiling(checked);
444
    TConfig::saveProfiling(checked);
460
}
445
}
461
 
446
 
-
 
447
void TQtSettings::on_checkBox_LogInfo_toggled(bool checked)
-
 
448
{
-
 
449
    DECL_TRACER("TQtSettings::on_checkBox_LogInfo_toggled(bool checked)");
-
 
450
 
-
 
451
    if (mInitRun)
-
 
452
        return;
-
 
453
 
-
 
454
    if (checked && !(mLogLevel & HLOG_INFO))
-
 
455
    {
-
 
456
        mLogLevel |= HLOG_INFO;
-
 
457
        mSetChanged = true;
-
 
458
    }
-
 
459
    else if (!checked && (mLogLevel & HLOG_INFO))
-
 
460
    {
-
 
461
        mSetChanged = true;
-
 
462
        mLogLevel &= RLOG_INFO;
-
 
463
    }
-
 
464
 
-
 
465
    mInitRun = true;
-
 
466
    if ((mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
467
        ui->checkBox_LogProtocol->setCheckState(Qt::CheckState::Unchecked);
-
 
468
 
-
 
469
    if ((mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
470
        ui->checkBox_LogAll->setCheckState(Qt::CheckState::Unchecked);
-
 
471
 
-
 
472
    mInitRun = false;
-
 
473
    TConfig::saveLogLevel(mLogLevel);
-
 
474
}
-
 
475
 
-
 
476
void TQtSettings::on_checkBox_LogWarning_toggled(bool checked)
-
 
477
{
-
 
478
    DECL_TRACER("TQtSettings::on_checkBox_LogWarning_toggled(bool checked)");
-
 
479
 
-
 
480
    if (mInitRun)
-
 
481
        return;
-
 
482
 
-
 
483
    if (checked && !(mLogLevel & HLOG_WARNING))
-
 
484
    {
-
 
485
        mLogLevel |= HLOG_WARNING;
-
 
486
        mSetChanged = true;
-
 
487
    }
-
 
488
    else if (!checked && (mLogLevel & HLOG_WARNING))
-
 
489
    {
-
 
490
        mLogLevel &= RLOG_WARNING;
-
 
491
        mSetChanged = true;
-
 
492
    }
-
 
493
 
-
 
494
    mInitRun = true;
-
 
495
    if ((mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
496
        ui->checkBox_LogProtocol->setCheckState(Qt::CheckState::Unchecked);
-
 
497
 
-
 
498
    if ((mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
499
        ui->checkBox_LogAll->setCheckState(Qt::CheckState::Unchecked);
-
 
500
 
-
 
501
    mInitRun = false;
-
 
502
    TConfig::saveLogLevel(mLogLevel);
-
 
503
}
-
 
504
 
-
 
505
void TQtSettings::on_checkBox_LogError_toggled(bool checked)
-
 
506
{
-
 
507
    DECL_TRACER("TQtSettings::on_checkBox_LogError_toggled(bool checked)");
-
 
508
 
-
 
509
    if (mInitRun)
-
 
510
        return;
-
 
511
 
-
 
512
    if (checked && !(mLogLevel & HLOG_ERROR))
-
 
513
    {
-
 
514
        mSetChanged = true;
-
 
515
        mLogLevel |= HLOG_ERROR;
-
 
516
    }
-
 
517
    else if (!checked && (mLogLevel & HLOG_ERROR))
-
 
518
    {
-
 
519
        mLogLevel &= RLOG_ERROR;
-
 
520
        mSetChanged = true;
-
 
521
    }
-
 
522
 
-
 
523
    mInitRun = true;
-
 
524
    if ((mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
525
        ui->checkBox_LogProtocol->setCheckState(Qt::CheckState::Unchecked);
-
 
526
 
-
 
527
    if ((mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
528
        ui->checkBox_LogAll->setCheckState(Qt::CheckState::Unchecked);
-
 
529
 
-
 
530
    mInitRun = false;
-
 
531
    TConfig::saveLogLevel(mLogLevel);
-
 
532
}
-
 
533
 
-
 
534
void TQtSettings::on_checkBox_LogTrace_toggled(bool checked)
-
 
535
{
-
 
536
    DECL_TRACER("TQtSettings::on_checkBox_LogTrace_toggled(bool checked)");
-
 
537
 
-
 
538
    if (mInitRun)
-
 
539
        return;
-
 
540
 
-
 
541
    if (checked && !(mLogLevel & HLOG_TRACE))
-
 
542
    {
-
 
543
        mLogLevel |= HLOG_TRACE;
-
 
544
        mSetChanged = true;
-
 
545
    }
-
 
546
    else if (!checked && (mLogLevel & HLOG_TRACE))
-
 
547
    {
-
 
548
        mLogLevel &= RLOG_TRACE;
-
 
549
        mSetChanged = true;
-
 
550
    }
-
 
551
 
-
 
552
    mInitRun = true;
-
 
553
    if ((mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
554
        ui->checkBox_LogProtocol->setCheckState(Qt::CheckState::Unchecked);
-
 
555
 
-
 
556
    if ((mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
557
        ui->checkBox_LogAll->setCheckState(Qt::CheckState::Unchecked);
-
 
558
 
-
 
559
    mInitRun = false;
-
 
560
    TConfig::saveLogLevel(mLogLevel);
-
 
561
}
-
 
562
 
-
 
563
void TQtSettings::on_checkBox_LogDebug_toggled(bool checked)
-
 
564
{
-
 
565
    DECL_TRACER("TQtSettings::on_checkBox_LogDebug_toggled(bool checked)");
-
 
566
 
-
 
567
    if (mInitRun)
-
 
568
        return;
-
 
569
 
-
 
570
    if (checked && !(mLogLevel & HLOG_DEBUG))
-
 
571
    {
-
 
572
        mLogLevel |= HLOG_DEBUG;
-
 
573
        mSetChanged = true;
-
 
574
    }
-
 
575
    else if (!checked && (mLogLevel & HLOG_DEBUG))
-
 
576
    {
-
 
577
        mLogLevel &= RLOG_DEBUG;
-
 
578
        mSetChanged = true;
-
 
579
    }
-
 
580
 
-
 
581
    mInitRun = true;
-
 
582
    if ((mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
583
        ui->checkBox_LogProtocol->setCheckState(Qt::CheckState::Unchecked);
-
 
584
 
-
 
585
    if ((mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
586
        ui->checkBox_LogAll->setCheckState(Qt::CheckState::Unchecked);
-
 
587
 
-
 
588
    mInitRun = false;
-
 
589
    TConfig::saveLogLevel(mLogLevel);
-
 
590
}
-
 
591
 
-
 
592
void TQtSettings::on_checkBox_LogProtocol_toggled(bool checked)
-
 
593
{
-
 
594
    DECL_TRACER("TQtSettings::on_checkBox_LogProtocol_toggled(bool checked)");
-
 
595
 
-
 
596
    if (mInitRun)
-
 
597
        return;
-
 
598
 
-
 
599
    if (checked && (mLogLevel & HLOG_PROTOCOL) != HLOG_PROTOCOL)
-
 
600
    {
-
 
601
        mLogLevel = HLOG_PROTOCOL;
-
 
602
        mInitRun = true;
-
 
603
        ui->checkBox_LogInfo->setCheckState(Qt::CheckState::Checked);
-
 
604
        ui->checkBox_LogWarning->setCheckState(Qt::CheckState::Checked);
-
 
605
        ui->checkBox_LogError->setCheckState(Qt::CheckState::Checked);
-
 
606
        ui->checkBox_LogTrace->setCheckState(Qt::CheckState::Unchecked);
-
 
607
        ui->checkBox_LogDebug->setCheckState(Qt::CheckState::Unchecked);
-
 
608
        TConfig::saveLogLevel(mLogLevel);
-
 
609
        mInitRun = false;
-
 
610
        mSetChanged = true;
-
 
611
    }
-
 
612
}
-
 
613
 
-
 
614
void TQtSettings::on_checkBox_LogAll_toggled(bool checked)
-
 
615
{
-
 
616
    DECL_TRACER("TQtSettings::on_checkBox_LogAll_toggled(bool checked)");
-
 
617
 
-
 
618
    if (mInitRun)
-
 
619
        return;
-
 
620
 
-
 
621
    if (checked && (mLogLevel & HLOG_ALL) != HLOG_ALL)
-
 
622
    {
-
 
623
        mLogLevel = HLOG_ALL;
-
 
624
        mInitRun = true;
-
 
625
        ui->checkBox_LogInfo->setCheckState(Qt::CheckState::Checked);
-
 
626
        ui->checkBox_LogWarning->setCheckState(Qt::CheckState::Checked);
-
 
627
        ui->checkBox_LogError->setCheckState(Qt::CheckState::Checked);
-
 
628
        ui->checkBox_LogTrace->setCheckState(Qt::CheckState::Checked);
-
 
629
        ui->checkBox_LogDebug->setCheckState(Qt::CheckState::Checked);
-
 
630
        TConfig::saveLogLevel(mLogLevel);
-
 
631
        mInitRun = false;
-
 
632
        mSetChanged = true;
-
 
633
    }
-
 
634
}
-
 
635
 
462
int TQtSettings::scale(int value)
636
int TQtSettings::scale(int value)
463
{
637
{
464
    if (value <= 0 || mScaleFactor == 1.0)
638
    if (value <= 0 || mScaleFactor == 1.0)
465
        return value;
639
        return value;
466
 
640