Subversion Repositories svn1

Rev

Rev 313 | Rev 324 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 313 Rev 314
Line 229... Line 229...
229
        //      Real rows have a COL_INDEX entr
229
        //      Real rows have a COL_INDEX entr
230
        //
230
        //
231
        QTableWidgetItem *item = tableWidget->item ( entryIndex, COL_INDEX );
231
        QTableWidgetItem *item = tableWidget->item ( entryIndex, COL_INDEX );
232
        if (! item)
232
        if (! item)
233
        {
233
        {
234
            qDebug("Ignore row:%d", entryIndex);
234
            //qDebug("Ignore row:%d", entryIndex);
235
            continue;
235
            continue;
236
        }
236
        }
237
        int ii = item->text().toInt();
237
        int ii = item->text().toInt();
238
        qDebug("Processing: %d", ii);
238
        //qDebug("Processing: %d", ii);
239
 
239
 
240
        /*
240
        /*
241
        ** This is a new entry - allocate a new index 
241
        ** This is a new entry - allocate a new index 
242
        **  Scan the entire available space looking for the first empty slot
242
        **  Scan the entire available space looking for the first empty slot
243
        */
243
        */
Line 361... Line 361...
361
        //
361
        //
362
        for (int i = MAX_CLASS-1; i >= 0; i--)
362
        for (int i = MAX_CLASS-1; i >= 0; i--)
363
        {
363
        {
364
            if (newcfg.team_class[i].abr[0])
364
            if (newcfg.team_class[i].abr[0])
365
            {
365
            {
366
                qDebug("num_class:%d -> %d", newcfg.num_class, 1+i);
366
                //qDebug("num_class:%d -> %d", newcfg.num_class, 1+i);
367
                newcfg.num_class = 1 + i;
367
                newcfg.num_class = 1 + i;
368
                break;
368
                break;
369
            }
369
            }
370
        }
370
        }
371
 
371
 
Line 409... Line 409...
409
        ** Sanity Test
409
        ** Sanity Test
410
        */
410
        */
411
        newcfg.nonequestrian_class = newcfg.lookup_class( newcfg.nonequestrian_class_abr );
411
        newcfg.nonequestrian_class = newcfg.lookup_class( newcfg.nonequestrian_class_abr );
412
        if( newcfg.equestrian_leg && newcfg.nonequestrian_class == 0 )
412
        if( newcfg.equestrian_leg && newcfg.nonequestrian_class == 0 )
413
            MainWindow::showMessage( "WARNING: Non-equestrian class not found" );
413
            MainWindow::showMessage( "WARNING: Non-equestrian class not found" );
414
        qDebug("NE Index is: %d", newcfg.nonequestrian_class );
414
        //qDebug("NE Index is: %d", newcfg.nonequestrian_class );
415
        /*
415
        /*
416
        **  Sanity test of the data
416
        **  Sanity test of the data
417
        */
417
        */
418
        for( int i = 0; i < MAX_CLASS; i++ )
418
        for( int i = 0; i < MAX_CLASS; i++ )
419
        {
419
        {
Line 474... Line 474...
474
 
474
 
475
}
475
}
476
 
476
 
477
void QmConfClass::ctxMenu(const QPoint & pos)
477
void QmConfClass::ctxMenu(const QPoint & pos)
478
{
478
{
479
    qDebug("Context Menu");
479
    //qDebug("Context Menu");
480
    QMenu *menu = new QMenu;
480
    QMenu *menu = new QMenu;
481
    menu->addAction(tr("New Category"), this, SLOT(ctxMenuAddRow()));
481
    menu->addAction(tr("New Category"), this, SLOT(ctxMenuAddRow()));
482
 
482
 
483
    /*
483
    /*
484
    **      Determine if we can delete an item
484
    **      Determine if we can delete an item
Line 487... Line 487...
487
    */
487
    */
488
    QTableWidgetItem *item = tableWidget->itemAt(pos);
488
    QTableWidgetItem *item = tableWidget->itemAt(pos);
489
    if (item)
489
    if (item)
490
    {
490
    {
491
        int row = item->row();
491
        int row = item->row();
492
        qDebug("Item is at row:%d", row);
492
        //qDebug("Item is at row:%d", row);
493
        QTableWidgetItem *indexItem = tableWidget->item ( row, COL_INDEX );
493
        QTableWidgetItem *indexItem = tableWidget->item ( row, COL_INDEX );
494
        if (indexItem)
494
        if (indexItem)
495
        {
495
        {
496
            int index = indexItem->text().toInt();
496
            int index = indexItem->text().toInt();
497
            qDebug("Item is at row:%d, Index: %d", row, index);
497
            //qDebug("Item is at row:%d, Index: %d", row, index);
498
            if (index < 0)
498
            if (index < 0)
499
            {
499
            {
500
                menu->addAction(tr("Delete Newly added Category"), this, SLOT(ctxMenuDeleteRow())); 
500
                menu->addAction(tr("Delete Newly added Category"), this, SLOT(ctxMenuDeleteRow())); 
501
            }
501
            }
502
            else
502
            else
Line 525... Line 525...
525
    //qDebug ("DELETE ROW: %d", tableWidget->currentRow () );
525
    //qDebug ("DELETE ROW: %d", tableWidget->currentRow () );
526
    //tableWidget->removeCellWidget(tableWidget->currentRow (), COL_ABR);
526
    //tableWidget->removeCellWidget(tableWidget->currentRow (), COL_ABR);
527
    //tableWidget->removeRow(tableWidget->currentRow ());
527
    //tableWidget->removeRow(tableWidget->currentRow ());
528
    tableWidget->item(tableWidget->currentRow (), COL_ABR)->setText("");
528
    tableWidget->item(tableWidget->currentRow (), COL_ABR)->setText("");
529
    tableWidget->item(tableWidget->currentRow (), COL_CLASS)->setText("");
529
    tableWidget->item(tableWidget->currentRow (), COL_CLASS)->setText("");
-
 
530
    tableWidget->hideRow(tableWidget->currentRow ());
530
    updateChanged(true);
531
    updateChanged(true);
531
}
532
}
532
 
533
 
533
void QmConfClass::ctxMenuAddRow(void)
534
void QmConfClass::ctxMenuAddRow(void)
534
{
535
{