Subversion Repositories svn1

Rev

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

Rev 311 Rev 320
Line 77... Line 77...
77
    m2->addAction("Upload time information", this, SLOT(uploadLegData()));
77
    m2->addAction("Upload time information", this, SLOT(uploadLegData()));
78
 
78
 
79
    QMenu *m3 = new QMenu ("Export");
79
    QMenu *m3 = new QMenu ("Export");
80
    ui->menuBar->addMenu(m3);
80
    ui->menuBar->addMenu(m3);
81
    m3->addAction("Store team information to external file", this, SLOT(storeExternalTeams()));
81
    m3->addAction("Store team information to external file", this, SLOT(storeExternalTeams()));
-
 
82
    //m3->addAction("Store basic team info to external file", this, SLOT(storeTeamInfo()));
82
    m3->addAction("Create external leg data file", this, SLOT(storeLegData()));
83
    m3->addAction("Create external leg data file", this, SLOT(storeLegData()));
83
 
84
 
84
    QMenu *m4 = new QMenu ("Reports");
85
    QMenu *m4 = new QMenu ("Reports");
85
    ui->menuBar->addMenu(m4);
86
    ui->menuBar->addMenu(m4);
86
    m4->addAction("Generate All Reports", this, SLOT(generateReports()));
87
    m4->addAction("Generate All Reports", this, SLOT(generateReports()));
Line 275... Line 276...
275
    }
276
    }
276
}
277
}
277
 
278
 
278
void MainWindow::loadExternalTeams(void)
279
void MainWindow::loadExternalTeams(void)
279
{
280
{
280
    QString fileName = QFileDialog::getOpenFileName(this, tr("Load File"),
281
    QString fileName = QFileDialog::getOpenFileName(
281
                                                     filepath,
282
            this, tr("Load File"),
282
                                                     tr("Data (*.csv);;All (*.*)"),
283
            appSettings->value("Recent/ExternalTeams",filepath).toString(),
283
                                                     0,
284
            tr("Data (*.csv);;All (*.*)"),
-
 
285
            0,
284
                                                     QFileDialog::ReadOnly);
286
            QFileDialog::ReadOnly);
-
 
287
 
285
    if ( fileName.isEmpty() )
288
    if ( fileName.isEmpty() )
286
    {
289
    {
287
        return;
290
        return;
288
    }
291
    }
-
 
292
    appSettings->setValue("Recent/ExternalTeams", fileName); 
289
 
293
 
290
    QmDialogLoadExternalTeams dialog(fileName,this);
294
    QmDialogLoadExternalTeams dialog(fileName,this);
291
    dialog.exec();
295
    dialog.exec();
292
}
296
}
293
 
297
 
294
void MainWindow::loadExternalHtmlTeams(void)
298
void MainWindow::loadExternalHtmlTeams(void)
295
{
299
{
296
    Qmhttppath msgBox;
300
    Qmhttppath msgBox;
297
    int rv = msgBox.exec();
301
    int rv = msgBox.exec();
298
    if (rv == QDialog::Accepted	)
302
    if (rv == QDialog::Accepted)
299
    {
303
    {
300
        QmDialogLoadExternalTeams dialog( msgBox.urlLineEdit->text(), &msgBox.allData ,this);
304
        QmDialogLoadExternalTeams dialog( msgBox.urlLineEdit->text(), &msgBox.allData ,this);
301
        dialog.exec();
305
        dialog.exec();
302
    }
306
    }
303
    else
307
    else
Line 306... Line 310...
306
    }
310
    }
307
}
311
}
308
 
312
 
309
void MainWindow::storeExternalTeams(void)
313
void MainWindow::storeExternalTeams(void)
310
{
314
{
311
    QString fileName = QFileDialog::getSaveFileName(this, tr("Store File"),
315
    QString fileName = QFileDialog::getSaveFileName(
312
                                                     filepath,
316
            this, tr("Store File"),
313
                                                     tr("Data (*.csv);;All (*.*)"),
317
            appSettings->value("Recent/storeExternalTeams",filepath).toString(),
314
                                                     0
318
            tr("Data (*.csv);;All (*.*)"),
-
 
319
            0
315
                                                     );
320
            );
316
    if ( fileName.isEmpty() )
321
    if ( fileName.isEmpty() )
317
    {
322
    {
318
        return;
323
        return;
319
    }
324
    }
-
 
325
    appSettings->setValue("Recent/storeExternalTeams", fileName); 
320
    MainWindow::showMessage("Writing external data");
326
    MainWindow::showMessage("Writing external data");
321
    QmDialogLoadExternalTeams::storeData(fileName);
327
    QmDialogLoadExternalTeams::storeData(fileName);
322
    MainWindow::showMessage("Writing external data completed");
328
    MainWindow::showMessage("Writing external data completed");
323
}
329
}
324
 
330
 
325
void MainWindow::storeTeamInfo(void)
331
void MainWindow::storeTeamInfo(void)
326
{
332
{
327
    QString fileName = QFileDialog::getSaveFileName(this, tr("Store Team Info File"),
333
    QString fileName = QFileDialog::getSaveFileName(
328
                                                     filepath,
334
            this, tr("Store Team Info File"),
329
                                                     tr("Data (*.txt);;All (*.*)"),
335
            appSettings->value("Recent/storeTeamInfo",filepath).toString(),
330
                                                     0
336
            tr("Data (*.txt);;All (*.*)"),
-
 
337
            0
331
                                                     );
338
            );
332
    if ( fileName.isEmpty() )
339
    if ( fileName.isEmpty() )
333
    {
340
    {
334
        return;
341
        return;
335
    }
342
    }
-
 
343
    appSettings->setValue("Recent/storeTeamInfo", fileName); 
336
    MainWindow::showMessage("Writing team info");
344
    MainWindow::showMessage("Writing team info");
337
    QmDialogLoadExternalTeams::storeTeamInfo(fileName);
345
    QmDialogLoadExternalTeams::storeTeamInfo(fileName);
338
    MainWindow::showMessage("Writing team info completed");
346
    MainWindow::showMessage("Writing team info completed");
339
}
347
}
340
 
348