Subversion Repositories svn1

Rev

Rev 125 | Rev 127 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
126 david 1
#include "mainwindow.h"
2
#include "ui_mainwindow.h"
3
#include "qmconfigure.h"
4
#include "qmconfclass.h"
5
#include "qmconfwinners.h"
6
#include "qmteamdisplay.h"
7
#include "QMessageBox"
8
 
9
#include    "consts.h"
10
#include    "structs.h"
11
#include    "proto.h"
12
 
13
MainWindow *mw = NULL;
14
 
15
MainWindow::MainWindow(QWidget *parent) :
16
    QMainWindow(parent),
17
    ui(new Ui::MainWindow)
18
{
19
    ui->setupUi(this);
20
    mw = this;
21
 
22
    ui->tabWidget->addTab( new QmConfigure,   "Configure");
23
    ui->tabWidget->addTab( new QmConfClass,   "Class");
24
    ui->tabWidget->addTab( new QmConfWinners, "Winners");
25
    ui->tabWidget->addTab( new qmTeamDisplay, "Team Data");
26
 
27
    QMenu *m1 = new QMenu ("Menu1");
28
    m1->addAction("Set Start Times", this, SLOT(setStartTimes()));
29
    ui->menuBar->addMenu(m1);
30
 
31
 
32
}
33
 
34
MainWindow::~MainWindow()
35
{
36
    delete ui;
37
}
38
 
39
void MainWindow::changeEvent(QEvent *e)
40
{
41
    QMainWindow::changeEvent(e);
42
    switch (e->type()) {
43
    case QEvent::LanguageChange:
44
        ui->retranslateUi(this);
45
        break;
46
    default:
47
        break;
48
    }
49
}
50
 
51
void MainWindow::setStartTimes(void)
52
{
53
    if ( QMessageBox::Ok != QMessageBox::warning(this, tr("Mara"),
54
                                    tr("This will reset the start times for all teams.\n"
55
                                       "Are you sure you want to do this?"),
56
                                    QMessageBox::Cancel,
57
                                    QMessageBox::Ok))
58
    {
59
        return;
60
    }
61
    qDebug ("Reset start times");
62
    leg_start();
63
}
64
 
65
/*========================================================================
66
 *
67
 *  Position the cursor on the screen
68
 *
69
 *  Purpose:
70
 *      This function is called to Position the cursor on the screen
71
 *
72
 *  Parameters:
73
 *      x               col number
74
 *      y               line number
75
 *
76
 *  Returns:
77
 *      Nothing
78
 *
79
 *========================================================================*/
80
 
81
void cur( int x, int y )
82
{
83
}
84
 
85
/*========================================================================
86
 *
87
 *  Clears the vdu screen
88
 *
89
 *  Purpose:
90
 *      This function is called to Clears the vdu screen
91
 *      From the Microsoft Web Site
92
 *
93
 *  Parameters:
94
 *      None
95
 *
96
 *  Returns:
97
 *      Nothing
98
 *
99
 *========================================================================*/
100
 
101
void clearscreen( void )
102
{
103
}
104
#include    <stdio.h>
105
int printf( const char *format, ... )
106
{
107
    va_list     ap;
108
    char        pp[200];
109
    int         len;
110
 
111
 
112
 
113
    va_start( ap, format );
114
    len = vsprintf( pp, format, ap );
115
    va_end( ap );
116
    qDebug("%s",pp);
117
    return ( len );
118
}
119