Subversion Repositories svn1-original

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
99 david 1
#include "qmconfclass.h"
178 - 2
#include "qmconfig.h"
99 david 3
#include "ui_qmconfclass.h"
103 david 4
#include    "consts.h"
5
#include    "structs.h"
6
#include    "proto.h"
184 - 7
#include "mainwindow.h"
314 david 8
#include "qmTableWidgetItem.h"
99 david 9
 
290 david 10
#include <QDialogButtonBox>
103 david 11
#include "QTableWidgetItem"
111 david 12
#include "spinboxdelegate.h"
13
#include "timedelegate.h"
115 david 14
#include "textdelegate.h"
184 - 15
#include <QMenu>
103 david 16
 
231 - 17
#define COL_ABR 0
18
#define COL_CLASS 1
19
#define COL_TIME 2
20
#define COL_WINNERS 3
21
#define COL_NE 4
22
#define COL_NE_WINNERS 5
23
#define COL_ST_TOTAL 6
232 - 24
#define COL_ST_VALID 7
25
#define COL_ST_DISQ 8
26
#define COL_ST_NONEQ 9
27
#define COL_ST_VET 10
288 david 28
#define COL_ST_CEV 11
29
#define COL_ST_CNE 12
315 david 30
#define COL_INDEX 13
231 - 31
 
315 david 32
#define COL_COUNT 14
231 - 33
 
315 david 34
 
108 - 35
QmConfClass::QmConfClass(QWidget *parent) :
290 david 36
    QWidget(parent)
99 david 37
{
185 - 38
    populating = false;
316 david 39
    dirty = false;
103 david 40
 
290 david 41
    QVBoxLayout *verticalLayout = new QVBoxLayout(this);
42
    verticalLayout->setContentsMargins(0, 0, 0, 0);
43
 
44
    QGroupBox *groupBox = new QGroupBox("Class");
45
    verticalLayout->addWidget(groupBox);
46
    QVBoxLayout *verticalLayout2 = new QVBoxLayout(groupBox);
47
    tableWidget = new QTableWidget(groupBox);
48
    tableWidget->setAlternatingRowColors(true);
49
    tableWidget->setRowCount(config.num_class + 1);
50
    tableWidget->setColumnCount(COL_COUNT);
51
    tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
52
    tableWidget->horizontalHeader()->setVisible(true);
53
    tableWidget->horizontalHeader()->setDefaultSectionSize(70);
54
    tableWidget->horizontalHeader()->setHighlightSections(true);
294 david 55
    //tableWidget->horizontalHeader()->setStretchLastSection(true);
290 david 56
    tableWidget->verticalHeader()->setVisible(true);
57
    tableWidget->verticalHeader()->setDefaultSectionSize(20);
58
    //tableWidget->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding );
59
    //tableWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
60
    verticalLayout2->addWidget(tableWidget);
61
 
62
    //QSpacerItem *verticalSpacer1;
63
    //verticalSpacer1 = new QSpacerItem(0, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);
64
    //verticalLayout2->addItem(verticalSpacer1);
65
 
66
    QHBoxLayout *horizontalLayout;
67
    horizontalLayout = new QHBoxLayout();
68
    horizontalLayout->setContentsMargins(0, 0, 5, 5);
69
    verticalLayout->addLayout(horizontalLayout);
70
 
71
    QDialogButtonBox *buttonBox = new QDialogButtonBox();
72
    pushButtonRestore = buttonBox->addButton("Restore",QDialogButtonBox::ActionRole );
73
    pushButtonSave = buttonBox->addButton("Save",QDialogButtonBox::ActionRole );
74
    horizontalLayout->addWidget(buttonBox);
75
 
76
 
77
    connect(pushButtonSave, SIGNAL(clicked(bool)), this, SLOT(save()) );
78
    connect(pushButtonRestore, SIGNAL(clicked(bool)), this, SLOT(cancel()) );
79
 
113 david 80
    QStringList labels;
232 - 81
    labels << "Abr" << "Full Name" << "Start Time" << "Winners" << "NE" << "NE Winners";
113 david 82
 
315 david 83
    labels << "Total" << "Valid" <<"Disqual" << "NonEq" << "VetCheck" << "Comp Ev" << " Comp NE";
111 david 84
 
315 david 85
    labels << "Index";
86
 
87
    tableWidget->setHorizontalHeaderLabels(labels);
88
 
290 david 89
    connect(tableWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(ctxMenu(const QPoint &)));
90
    connect(tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(cellChanged(int,int)));
184 - 91
 
111 david 92
    /*
93
    **  Setup delegated for specialised editing
94
    */
290 david 95
    tableWidget->setItemDelegateForColumn(COL_ABR, new textDelegate(2));
96
    tableWidget->setItemDelegateForColumn(COL_CLASS, new textDelegate(LEN_CLASS_NAME));
97
    tableWidget->setItemDelegateForColumn(COL_TIME, new timeDelegate());
98
    tableWidget->setItemDelegateForColumn(COL_WINNERS, new SpinBoxDelegate(0,50));
99
    tableWidget->setItemDelegateForColumn(COL_NE_WINNERS, new SpinBoxDelegate(0,50));
316 david 100
}
111 david 101
 
316 david 102
/*----------------------------------------------------------------------------
103
** FUNCTION           : showEvent 
104
**
105
** DESCRIPTION        : Called when the page is shown
106
**                      Used to refresh the contents of the display as well
107
**                      as show them for the first time
108
**
109
----------------------------------------------------------------------------*/
110
 
111
void QmConfClass::showEvent ( QShowEvent * event )
112
{
113
    //qDebug("populate::showEvent");
114
    if ( ! event->spontaneous() && !dirty )
115
    {
116
        populate();
117
    }
315 david 118
}
184 - 119
 
315 david 120
/*----------------------------------------------------------------------------
121
** FUNCTION           : populate
122
**
123
** DESCRIPTION        : Populate the display with information
124
**
125
----------------------------------------------------------------------------*/
184 - 126
 
108 - 127
void QmConfClass::populate(void)
103 david 128
{
315 david 129
    bool    reportDataLoaded = false;
130
    t_class_summary data;
131
 
185 - 132
    populating = true;
314 david 133
    tableWidget->clearContents();
317 david 134
    tableWidget->setRowCount(0);
314 david 135
    tableWidget->setSortingEnabled(false);
315 david 136
 
137
    /*
138
    ** Load Report Data if we can
139
    */
140
    if( load_report_data() )
103 david 141
    {
315 david 142
        calc_class_summary( & data );
143
        reportDataLoaded = true;
144
    }
109 - 145
 
315 david 146
    /*
147
    **  Add all the information
148
    */
149
    int ii = 0;
150
    int entryIndex = 0;
151
    for ( ii = 0; ii < MAX_CLASS; ii++)
152
    {
153
        if ( config.team_class[ii].abr[0] )
115 david 154
        {
315 david 155
            // Keep the config item index entry
156
            //  Will need it when we write stiff out
317 david 157
            tableWidget->setRowCount(tableWidget->rowCount() + 1);
158
 
315 david 159
            tableWidget->setItem(entryIndex, COL_INDEX, new qmTwiNumber(ii));
160
 
317 david 161
            tableWidget->setItem(entryIndex, COL_ABR,        new qmTwiString(config.team_class[ii].abr) );
162
            tableWidget->setItem(entryIndex, COL_CLASS,      new qmTwiString(config.team_class[ii].full_name ));
315 david 163
 
115 david 164
            QTableWidgetItem *item;
165
            item = new QTableWidgetItem();
166
            item->setData(Qt::EditRole,QTime().addSecs(config.team_class[ii].start) );
315 david 167
            tableWidget->setItem(entryIndex, COL_TIME, item);
111 david 168
 
317 david 169
            tableWidget->setItem(entryIndex, COL_WINNERS,    new qmTwiEditNumber(config.class_winners[ii]));
170
            tableWidget->setItem(entryIndex, COL_NE,         new qmTwiEditFlag("",config.nonequestrian_class == 1 + ii));
171
            tableWidget->setItem(entryIndex, COL_NE_WINNERS, new qmTwiEditNumber(config.class_ne_winners[ii]));
185 - 172
 
315 david 173
            if (reportDataLoaded)
174
            {
175
                tableWidget->setItem(entryIndex,COL_ST_TOTAL, new qmTwiNumber(data.teamclass[ii+1].total) );
176
                tableWidget->setItem(entryIndex,COL_ST_VALID, new qmTwiNumber(data.teamclass[ii+1].valid) );
177
                tableWidget->setItem(entryIndex,COL_ST_DISQ,  new qmTwiNumber(data.teamclass[ii+1].disqualified));
178
                tableWidget->setItem(entryIndex,COL_ST_NONEQ, new qmTwiNumber(data.teamclass[ii+1].non_equestrian));
179
                tableWidget->setItem(entryIndex,COL_ST_VET,   new qmTwiNumber(data.teamclass[ii+1].vet_check));
180
                tableWidget->setItem(entryIndex,COL_ST_CEV,   new qmTwiNumber(data.teamclass[ii+1].valid_ev));
181
                tableWidget->setItem(entryIndex,COL_ST_CNE,   new qmTwiNumber(data.teamclass[ii+1].valid_ne));
182
            }
183
            entryIndex++;
115 david 184
        }
103 david 185
    }
315 david 186
 
187
    //  Insert Totals
188
    //      Flag that items on this this row is not to be sorted - or at least 
189
    //      sorted at the end
190
    //
191
    if (reportDataLoaded)
192
    {
317 david 193
        tableWidget->setRowCount(tableWidget->rowCount() + 1);
315 david 194
        tableWidget->setItem(entryIndex,COL_ABR,      new qmTwiString("Totals", 1));
195
        tableWidget->setItem(entryIndex,COL_ST_TOTAL, new qmTwiNumber(data.total.total, 1));
196
        tableWidget->setItem(entryIndex,COL_ST_VALID, new qmTwiNumber(data.total.valid, 1));
197
        tableWidget->setItem(entryIndex,COL_ST_DISQ,  new qmTwiNumber(data.total.disqualified, 1));
198
        tableWidget->setItem(entryIndex,COL_ST_NONEQ, new qmTwiNumber(data.total.non_equestrian, 1));
199
        tableWidget->setItem(entryIndex,COL_ST_VET,   new qmTwiNumber(data.total.vet_check, 1));
200
        tableWidget->setItem(entryIndex,COL_ST_CEV,   new qmTwiNumber(data.total.valid_ev, 1));
201
        tableWidget->setItem(entryIndex,COL_ST_CNE,   new qmTwiNumber(data.total.valid_ne, 1));
202
    }
203
 
204
    tableWidget->resizeColumnsToContents();
205
    tableWidget->resizeRowsToContents();
317 david 206
    tableWidget->sortByColumn ( COL_INDEX, Qt::AscendingOrder );
315 david 207
    tableWidget->setSortingEnabled(true);
208
 
185 - 209
    updateChanged(false);
210
    populating = false;
103 david 211
}
212
 
108 - 213
void QmConfClass::save(void)
103 david 214
{
108 - 215
    /*
216
    **    Copy original data
217
    */
180 - 218
    QmConfig newcfg(config);
108 - 219
 
220
    /*
221
    **  Extract the data from the Widgets
316 david 222
    **  Trap: The Class info is cross ref by index into the table
223
    **        Thus we need to maintain the order in the config.
108 - 224
    */
315 david 225
    for (int entryIndex = 0; entryIndex < tableWidget->rowCount(); entryIndex++)
108 - 226
    {
314 david 227
 
228
        // Check that this is a real Entry or the 'Totals' header
315 david 229
        //      Real rows have a COL_INDEX entr
314 david 230
        //
315 david 231
        QTableWidgetItem *item = tableWidget->item ( entryIndex, COL_INDEX );
232
        if (! item)
314 david 233
        {
318 david 234
            //qDebug("Ignore row:%d", entryIndex);
314 david 235
            continue;
236
        }
315 david 237
        int ii = item->text().toInt();
318 david 238
        //qDebug("Processing: %d", ii);
314 david 239
 
316 david 240
        /*
317 david 241
        ** This is a new entry - allocate a new index 
242
        **  Scan the entire available space looking for the first empty slot
316 david 243
        */
244
        if (ii < 0)
315 david 245
        {
317 david 246
            for (ii = 0; ii < MAX_CLASS ; ii++)
247
            {
248
                if (newcfg.team_class[ii].abr[0] == 0)
249
                {
250
                    break;
251
                }
252
            }
316 david 253
        }
254
 
255
        if (ii >= MAX_CLASS )
256
        {
257
            qDebug("Ignore row:%d. Class out of range", entryIndex);
315 david 258
            continue;
259
        }
260
 
261
        item = tableWidget->item ( entryIndex, COL_ABR );
115 david 262
        if ( item )
263
        {
264
            strncpy(newcfg.team_class[ii].abr, qPrintable(item->text()), sizeof(newcfg.team_class[ii].abr)-1);
265
        }
266
        else
267
        {
268
            *newcfg.team_class[ii].abr = 0;
269
        }
108 - 270
 
314 david 271
        item = tableWidget->item ( entryIndex, COL_CLASS );
115 david 272
        if ( item )
273
        {
274
            strncpy(newcfg.team_class[ii].full_name, qPrintable(item->text()), sizeof(newcfg.team_class[ii].full_name)-1);
275
        }
276
        else
277
        {
278
            *newcfg.team_class[ii].full_name = 0;
279
        }
112 david 280
 
314 david 281
        item = tableWidget->item( entryIndex, COL_TIME );
115 david 282
        if ( item )
283
        {
199 david 284
            QVariant data = item->data(Qt::EditRole);
285
            if (data.isValid())
286
            {
287
                newcfg.team_class[ii].start = QTime(0,0,0).secsTo(item->data(Qt::EditRole).toTime());
288
            }
289
            else
290
            {
291
                newcfg.team_class[ii].start = -1;
292
            }
115 david 293
        }
294
        else
295
        {
199 david 296
            newcfg.team_class[ii].start = -1;
115 david 297
        }
298
 
314 david 299
        item = tableWidget->item( entryIndex, COL_WINNERS );
115 david 300
        if ( item )
301
        {
302
            newcfg.class_winners[ii] = item->data(Qt::EditRole).toInt();
303
        }
304
        else
305
        {
306
            newcfg.class_winners[ii] = 0;
307
        }
231 - 308
 
314 david 309
        item = tableWidget->item( entryIndex, COL_NE );
185 - 310
        if ( item )
311
        {
312
            if ( item->checkState() == Qt::Checked)
313
            {
314
                newcfg.nonequestrian_class = ii;
315
                strncpy(newcfg.nonequestrian_class_abr, newcfg.team_class[ii].abr, sizeof(newcfg.team_class[ii].abr)-1);
316
            }
317
        }
231 - 318
 
314 david 319
        item = tableWidget->item( entryIndex, COL_NE_WINNERS );
231 - 320
        if ( item )
321
        {
322
            newcfg.class_ne_winners[ii] = item->data(Qt::EditRole).toInt();
323
        }
324
        else
325
        {
326
            newcfg.class_ne_winners[ii] = 0;
327
        }
108 - 328
    }
329
 
185 - 330
    // Validate the data
331
    try
108 - 332
    {
185 - 333
        MainWindow::showMessage( "Saving Config");
108 - 334
 
185 - 335
        /*
336
         **  Now do the Class definitions
337
         */
338
 
339
        for( int i = 0; i < MAX_CLASS; i++ )
108 - 340
        {
185 - 341
            compact( newcfg.team_class[i].abr );
342
            compact( newcfg.team_class[i].full_name );
108 - 343
        }
185 - 344
 
345
        for( int i = 0; i < MAX_CLASS; i++ )
108 - 346
        {
185 - 347
            if( ( newcfg.team_class[i].abr[0] == '\0' ) != ( newcfg.team_class[i].full_name[0] == '\0' ) )
348
            {
349
                throw( "Configuration error. Class without description" );
350
 
351
            }
352
            if( newcfg.team_class[i].abr[0] != '\0' && newcfg.team_class[i].start < 0L )
353
            {
354
                throw( "Configuration error. Bad start time on class" );
355
 
356
            }
108 - 357
        }
358
 
317 david 359
        //  Calculate new max number of classes
360
        //      Scan from the end looking for the last one used
361
        //
362
        for (int i = MAX_CLASS-1; i >= 0; i--)
363
        {
364
            if (newcfg.team_class[i].abr[0])
365
            {
318 david 366
                //qDebug("num_class:%d -> %d", newcfg.num_class, 1+i);
317 david 367
                newcfg.num_class = 1 + i;
368
                break;
369
            }
370
        }
108 - 371
 
185 - 372
        for( int i = newcfg.num_class; i < MAX_CLASS; i++ )
373
            if( newcfg.team_class[i].full_name[0] )
374
            {
317 david 375
                qDebug( "Configuration error: Missing Class name. Gaps not allowed" );
185 - 376
            }
377
 
378
        if( newcfg.num_class == 0 )
108 - 379
        {
185 - 380
            throw( "Error: No categories defined" );
381
 
108 - 382
        }
383
 
316 david 384
        /*
385
        ** Test for duplicate abbreviations 
386
        ** I know its a slow agorithm, but its only a small set 
387
        */
388
        for( int i = 0; i < MAX_CLASS; i++ )
389
        {
390
            if (newcfg.team_class[i].abr[0] != '\0')
391
            {
392
                for (int j = i+1; j < MAX_CLASS; j++)
393
                {
394
                    if (newcfg.team_class[j].abr[0] != '\0')
395
                    {
396
                        if (    newcfg.team_class[i].abr[0] == newcfg.team_class[j].abr[0]
397
                             && newcfg.team_class[i].abr[1] == newcfg.team_class[j].abr[1]
398
                            )
399
                        {
400
                            qDebug("Duplicate abr: %s", newcfg.team_class[i].abr);
401
                            throw( "Error: Duplicate abbreviations detected");
402
                        }
403
                    }
404
                }
405
            }
406
        }
407
 
408
        /*
409
        ** Sanity Test
410
        */
185 - 411
        newcfg.nonequestrian_class = newcfg.lookup_class( newcfg.nonequestrian_class_abr );
412
        if( newcfg.equestrian_leg && newcfg.nonequestrian_class == 0 )
413
            MainWindow::showMessage( "WARNING: Non-equestrian class not found" );
318 david 414
        //qDebug("NE Index is: %d", newcfg.nonequestrian_class );
185 - 415
        /*
416
        **  Sanity test of the data
417
        */
418
        for( int i = 0; i < MAX_CLASS; i++ )
419
        {
420
            if( newcfg.team_class[i].abr[0] != '\0' && newcfg.class_winners[i] == 0 )
421
            {
316 david 422
                if (newcfg.nonequestrian_class != i+1)
423
                {
424
                    MainWindow::showMessage(QString("Warning: Class without winners:")+ newcfg.team_class[i].abr); 
425
                }
185 - 426
            }
115 david 427
        }
428
 
231 - 429
        /*
430
        ** Cannot mix winners for NE class and NE Winners for each class
431
        */
432
        if (newcfg.nonequestrian_class)
433
        {
434
            newcfg.class_ne_winners_by_class = false;
435
            for( int i = 0; i < MAX_CLASS; i++ )
436
            {
232 - 437
                if ( newcfg.class_ne_winners[i])
438
                {
439
                    newcfg.class_ne_winners_by_class = true;
440
                    break;
441
                }
231 - 442
            }
443
            if (newcfg.class_winners[newcfg.nonequestrian_class - 1] && newcfg.class_ne_winners_by_class )
444
            {
445
                MainWindow::showMessage( QString("Should not mix NE winners by each class and by NE Class"));
446
                //throw( "Error: Cannot mix NE winners by each class and by NE Class" );
447
            }
448
        }
449
 
450
 
108 - 451
        config = newcfg;
180 - 452
        config.write_config();
185 - 453
        updateChanged(false);
454
 
316 david 455
        // Force re-populate so that the index field is now correct
456
        populate();
457
 
458
 
108 - 459
    }
317 david 460
    catch (const char * str )
185 - 461
    {
462
        MainWindow::showMessage(str);
463
    }
108 - 464
 
103 david 465
}
466
 
108 - 467
void QmConfClass::cancel(void)
103 david 468
{
469
    populate();
470
}
471
 
108 - 472
QmConfClass::~QmConfClass()
99 david 473
{
290 david 474
 
99 david 475
}
476
 
184 - 477
void QmConfClass::ctxMenu(const QPoint & pos)
478
{
318 david 479
    //qDebug("Context Menu");
184 - 480
    QMenu *menu = new QMenu;
316 david 481
    menu->addAction(tr("New Category"), this, SLOT(ctxMenuAddRow()));
482
 
483
    /*
317 david 484
    **      Determine if we can delete an item
485
    **          Can delete a category we added in this session
486
    **          Can delete one if it has no teams using it.
316 david 487
    */
290 david 488
    QTableWidgetItem *item = tableWidget->itemAt(pos);
184 - 489
    if (item)
490
    {
316 david 491
        int row = item->row();
318 david 492
        //qDebug("Item is at row:%d", row);
316 david 493
        QTableWidgetItem *indexItem = tableWidget->item ( row, COL_INDEX );
494
        if (indexItem)
495
        {
496
            int index = indexItem->text().toInt();
318 david 497
            //qDebug("Item is at row:%d, Index: %d", row, index);
316 david 498
            if (index < 0)
499
            {
317 david 500
                menu->addAction(tr("Delete Newly added Category"), this, SLOT(ctxMenuDeleteRow())); 
316 david 501
            }
317 david 502
            else
503
            {
504
                QTableWidgetItem *itemTotalCount = tableWidget->item ( row, COL_ST_TOTAL );
505
                if (itemTotalCount)
506
                {
507
                    int count = itemTotalCount->text().toInt();
508
                    if (count == 0)
509
                    {
510
                        menu->addAction(tr("Delete Category - its not used"), this, SLOT(ctxMenuDeleteRow()));  
511
                    }
512
                }
513
 
514
            }
316 david 515
        }
184 - 516
    }
317 david 517
    menu->exec(tableWidget->mapToGlobal(pos));
184 - 518
}
519
 
520
void QmConfClass::ctxMenuDeleteRow(void)
521
{
316 david 522
    //
523
    //  Assume that if the menu was shown, then we can delete it
524
    // 
290 david 525
    //qDebug ("DELETE ROW: %d", tableWidget->currentRow () );
317 david 526
    //tableWidget->removeCellWidget(tableWidget->currentRow (), COL_ABR);
527
    //tableWidget->removeRow(tableWidget->currentRow ());
528
    tableWidget->item(tableWidget->currentRow (), COL_ABR)->setText("");
529
    tableWidget->item(tableWidget->currentRow (), COL_CLASS)->setText("");
318 david 530
    tableWidget->hideRow(tableWidget->currentRow ());
193 - 531
    updateChanged(true);
184 - 532
}
533
 
534
void QmConfClass::ctxMenuAddRow(void)
535
{
317 david 536
    tableWidget->setSortingEnabled(false);
290 david 537
    tableWidget->setRowCount( 1+ tableWidget->rowCount());
316 david 538
    tableWidget->setItem(tableWidget->rowCount() - 1, COL_INDEX, new qmTwiNumber(-1));
184 - 539
}
540
 
185 - 541
void QmConfClass::cellChanged(int row,int col)
542
{
543
    if ( populating )
544
        return;
316 david 545
    if (col == COL_INDEX)
546
        return;
547
 
548
    updateChanged(true); 
185 - 549
    populating = true;
550
    //qDebug("Cell changed: %d, %d", row, col);
231 - 551
    if (col == COL_NE)
185 - 552
    {
290 david 553
        for (int ii = 0; ii < tableWidget->rowCount(); ii++)
185 - 554
        {
290 david 555
            QTableWidgetItem *item = tableWidget->item(ii, COL_NE);
185 - 556
            if (item)
557
            {
558
                item->setCheckState(ii == row ? Qt::Checked : Qt::Unchecked);
559
            }
560
        }
561
    }
562
    populating = false;
563
}
564
 
565
void QmConfClass::updateChanged(bool newDirty)
566
{
567
    if (newDirty != dirty)
568
    {
569
        dirty = newDirty;
570
        if (dirty)
571
        {
290 david 572
            pushButtonSave->setEnabled(true);
573
            pushButtonSave->setStyleSheet("background-color: rgb(255, 0, 0);");
185 - 574
        }
575
        else
576
        {
290 david 577
            pushButtonSave->setEnabled(false);
578
            pushButtonSave->setStyleSheet("");
185 - 579
        }
580
    }
581
}
582
 
108 - 583
void QmConfClass::changeEvent(QEvent *e)
99 david 584
{
585
    QWidget::changeEvent(e);
586
    switch (e->type()) {
290 david 587
 
99 david 588
    default:
589
        break;
590
    }
591
}