2013-04-07 15:20:43 -07:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
#include <QVBoxLayout>
|
2013-04-09 09:35:44 +01:00
|
|
|
#include <QtDebug>
|
2013-04-07 15:20:43 -07:00
|
|
|
|
2013-04-12 08:24:07 +01:00
|
|
|
#include "divelistview.h"
|
|
|
|
#include "divetripmodel.h"
|
|
|
|
|
2013-04-07 15:20:43 -07:00
|
|
|
MainWindow::MainWindow() : ui(new Ui::MainWindow())
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2013-04-12 08:24:07 +01:00
|
|
|
|
|
|
|
/* may want to change ctor to avoid filename as 1st param.
|
|
|
|
* here we just use an empty string
|
|
|
|
*/
|
|
|
|
model = new DiveTripModel("",this);
|
|
|
|
if (model){
|
|
|
|
ui->ListWidget->setModel(model);
|
|
|
|
}
|
|
|
|
/* add in dives here.
|
|
|
|
* we need to root to parent all top level dives
|
|
|
|
* trips need more work as it complicates parent/child stuff.
|
|
|
|
*
|
|
|
|
* We show how to obtain the root and add a demo dive
|
|
|
|
*
|
|
|
|
* Todo: work through integration with current list of dives/trips
|
|
|
|
* Todo: look at alignment/format of e.g. duration in view
|
|
|
|
*/
|
|
|
|
DiveItem *dive = 0;
|
|
|
|
DiveItem *root = model->itemForIndex(QModelIndex());
|
|
|
|
if (root){
|
|
|
|
dive = new DiveItem(1,QString("01/03/13"),14.2, 29.0,QString("Wraysbury"),root);
|
|
|
|
|
|
|
|
Q_UNUSED(dive)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-07 15:20:43 -07:00
|
|
|
}
|
|
|
|
|
2013-04-09 09:35:44 +01:00
|
|
|
void MainWindow::on_actionNew_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionNew");
|
2013-04-09 09:35:44 +01:00
|
|
|
}
|
2013-04-09 17:26:23 +01:00
|
|
|
|
|
|
|
void MainWindow::on_actionOpen_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionOpen");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionSave_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionSave");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionSaveAs_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionSaveAs");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
void MainWindow::on_actionClose_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionClose");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionImport_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionImport");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionExportUDDF_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionExportUDDF");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionPrint_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionPrint");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionPreferences_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionPreferences");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionQuit_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionQuit");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionDownloadDC_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionDownloadDC");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionDownloadWeb_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionDownloadWeb");}
|
2013-04-09 17:26:23 +01:00
|
|
|
|
|
|
|
void MainWindow::on_actionEditDeviceNames_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionEditDeviceNames");}
|
2013-04-09 17:26:23 +01:00
|
|
|
|
|
|
|
void MainWindow::on_actionAddDive_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionAddDive");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionRenumber_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionRenumber");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionAutoGroup_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionAutoGroup");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionToggleZoom_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionToggleZoom");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionYearlyStatistics_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionYearlyStatistics");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionViewList_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionViewList");
|
2013-04-10 08:07:02 +01:00
|
|
|
|
|
|
|
ui->InfoWidget->setVisible(false);
|
|
|
|
ui->ListWidget->setVisible(true);
|
|
|
|
ui->ProfileWidget->setVisible(false);
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionViewProfile_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionViewProfile");
|
2013-04-10 08:07:02 +01:00
|
|
|
|
|
|
|
ui->InfoWidget->setVisible(false);
|
|
|
|
ui->ListWidget->setVisible(false);
|
|
|
|
ui->ProfileWidget->setVisible(true);
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionViewInfo_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionViewInfo");
|
2013-04-10 08:07:02 +01:00
|
|
|
|
|
|
|
ui->InfoWidget->setVisible(true);
|
|
|
|
ui->ListWidget->setVisible(false);
|
|
|
|
ui->ProfileWidget->setVisible(false);
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionViewAll_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionViewAll");
|
2013-04-10 08:07:02 +01:00
|
|
|
|
|
|
|
ui->InfoWidget->setVisible(true);
|
|
|
|
ui->ListWidget->setVisible(true);
|
|
|
|
ui->ProfileWidget->setVisible(true);
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionPreviousDC_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionPreviousDC");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionNextDC_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionNextDC");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionSelectEvents_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionSelectEvents");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionInputPlan_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionInputPlan");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionAboutSubsurface_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionAboutSubsurface");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::on_actionUserManual_triggered()
|
|
|
|
{
|
2013-04-10 08:27:38 +02:00
|
|
|
qDebug("actionUserManual");
|
2013-04-09 17:26:23 +01:00
|
|
|
}
|