Skip to content

Commit

Permalink
[v0.2.0 Beta]
Browse files Browse the repository at this point in the history
- [update] Updated QMapControl to version 0.9.7.6.
- [update] Changed some icons.
- [update] Some minor GUI changes.
- [new] Double clicking an item in the track selection opens the track
properties dialogue.
- [new] Added undo/redo functionality.
- [new] Added functionality to split and combine a track.
- [new] Window state and position is stored on application closing and
restored on restart.
- [new] Header state of point list is stored on application closing and
restored on restart.
- [new] Added control to change the map zoom.
- [new] Added option to configure the map caching.
- [fix] Docks don't disappear any more when tabbed.
  • Loading branch information
BourgeoisLab committed Dec 6, 2014
1 parent 49f300e commit 3ed4dd0
Show file tree
Hide file tree
Showing 92 changed files with 3,402 additions and 774 deletions.
2 changes: 1 addition & 1 deletion GPXLab.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = GPXLab
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.1
PROJECT_NUMBER = v0.2.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
35 changes: 30 additions & 5 deletions GPXLab/GPXLab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
greaterThan(QT_MAJOR_VERSION, 4): cache()

TARGET = GPXLab
VERSION = 0.1.0.0
VERSION = 0.2.0.0
TEMPLATE = app

win32:RC_ICONS += gpxlab.ico
Expand All @@ -20,7 +20,7 @@ else {
LIBS += -L../bin/ -lqmapcontrol
}

INCLUDEPATH += ../QMapControl/ gpx_model/ functions/ dialogs/ widgets/
INCLUDEPATH += ../QMapControl/ gpx_model/ commands/ functions/ dialogs/ widgets/

SOURCES += main.cpp\
gpxlab.cpp \
Expand All @@ -42,7 +42,19 @@ SOURCES += main.cpp\
dialogs/dialog_modelproperties.cpp \
dialogs/dialog_trackproperties.cpp \
dialogs/dialog_srtm.cpp \
dialogs/dialog_about.cpp
dialogs/dialog_about.cpp \
commands/selectcommand.cpp \
commands/editfilepropertiescommand.cpp \
commands/edittrackpropertiescommand.cpp \
commands/setaltitudecommand.cpp \
commands/movetrackdowncommand.cpp \
commands/movetrackupcommand.cpp \
commands/removetrackcommand.cpp \
commands/appendtrackcommand.cpp \
commands/splittrackcommand.cpp \
commands/combinetrackcommand.cpp \
dialogs/dialog_settings.cpp \
settings.cpp

HEADERS += \
gpxlab.h \
Expand All @@ -63,14 +75,27 @@ HEADERS += \
dialogs/dialog_modelproperties.h \
dialogs/dialog_trackproperties.h \
dialogs/dialog_srtm.h \
dialogs/dialog_about.h
dialogs/dialog_about.h \
commands/selectcommand.h \
commands/editfilepropertiescommand.h \
commands/edittrackpropertiescommand.h \
commands/setaltitudecommand.h \
commands/movetrackdowncommand.h \
commands/movetrackupcommand.h \
commands/removetrackcommand.h \
commands/appendtrackcommand.h \
commands/splittrackcommand.h \
commands/combinetrackcommand.h \
dialogs/dialog_settings.h \
settings.h

FORMS += \
gpxlab.ui \
dialogs/dialog_modelproperties.ui \
dialogs/dialog_trackproperties.ui \
dialogs/dialog_srtm.ui \
dialogs/dialog_about.ui
dialogs/dialog_about.ui \
dialogs/dialog_settings.ui

OTHER_FILES +=

Expand Down
66 changes: 66 additions & 0 deletions GPXLab/commands/appendtrackcommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/****************************************************************************
* Copyright (c) 2014 Frederic Bourgeois <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with This program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/

#include "appendtrackcommand.h"

AppendTrackCommand::AppendTrackCommand(GPXLab *gpxlab, const QString &fileName, QUndoCommand *parent) :
QUndoCommand(parent),
gpxlab(gpxlab),
fileName(fileName)
{
}

void AppendTrackCommand::undo()
{
// remove tracks
for (int i = gpxlab->gpxmw->getNumTracks() - 1; i >= numTracksBeforeAppend; --i)
gpxlab->gpxmw->removeTrack(i);

// update file properties
gpxlab->updateFile();

// begin update of track widgets
gpxlab->beginUpdate();

// rebuild map and tree and select track
gpxlab->build(true);

// end update
gpxlab->endUpdate();
}

void AppendTrackCommand::redo()
{
// save number of tracks before appending
numTracksBeforeAppend = gpxlab->gpxmw->getNumTracks();

// append tracks
if (gpxlab->gpxmw->load(fileName, false) == GPX_model::GPXM_OK)
{
// update file properties
gpxlab->updateFile();

// begin update of widgets
gpxlab->beginUpdate();

// rebuild map and tree
gpxlab->build();

// end update
gpxlab->endUpdate();
}
}
69 changes: 69 additions & 0 deletions GPXLab/commands/appendtrackcommand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/****************************************************************************
* Copyright (c) 2014 Frederic Bourgeois <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with This program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/

#ifndef APPENDTRACKCOMMAND_H
#define APPENDTRACKCOMMAND_H

#include <QUndoCommand>
#include "gpxlab.h"

/**
* @addtogroup Commands Commands
* @brief Command functions implementing QUndoCommand
* @{
*/

/**
* @class AppendTrackCommand
*
* @brief Append track command
*
* @author Frederic Bourgeois <[email protected]>
* @version 1.0
* @date 28 Nov 2014
*/
class AppendTrackCommand : public QUndoCommand
{
public:

/**
* @brief Constructor
* @param gpxlab Pointer to application
* @param fileName File containing tracks to append
* @param parent Parent
*/
AppendTrackCommand(GPXLab *gpxlab, const QString &fileName, QUndoCommand *parent = 0);

/**
* @brief Undo the command
*/
void undo();

/**
* @brief Redo the command
*/
void redo();

private:
GPXLab *gpxlab;
const QString fileName;
int numTracksBeforeAppend;
};

/** @} Commands */

#endif // APPENDTRACKCOMMAND_H
71 changes: 71 additions & 0 deletions GPXLab/commands/combinetrackcommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/****************************************************************************
* Copyright (c) 2014 Frederic Bourgeois <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with This program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/

#include "combinetrackcommand.h"

CombineTrackCommand::CombineTrackCommand(GPXLab *gpxlab, int trackNumber, int trackSegmentNumber, int pointNumber, QUndoCommand *parent) :
QUndoCommand(parent),
gpxlab(gpxlab),
trackNumber(trackNumber),
trackSegmentNumber(trackSegmentNumber),
pointNumber(pointNumber)
{
}

void CombineTrackCommand::undo()
{
// split track segments
if (gpxlab->gpxmw->splitTrack(trackNumber, trackSegmentNumber, pointNumber) == GPX_model::GPXM_OK)
{
// begin update of track widgets
gpxlab->beginUpdate();

// rebuild tracks
gpxlab->build(true);

// update track properties
gpxlab->updateTrack();

// update track point properties
gpxlab->updatePoint();

// end update
gpxlab->endUpdate();
}
}

void CombineTrackCommand::redo()
{
// combine track segments
if (gpxlab->gpxmw->combineTrack(trackNumber, trackSegmentNumber, pointNumber) == GPX_model::GPXM_OK)
{
// begin update of track widgets
gpxlab->beginUpdate();

// rebuild tracks
gpxlab->build(true);

// update track properties
gpxlab->updateTrack();

// update track point properties
gpxlab->updatePoint();

// end update
gpxlab->endUpdate();
}
}
72 changes: 72 additions & 0 deletions GPXLab/commands/combinetrackcommand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/****************************************************************************
* Copyright (c) 2014 Frederic Bourgeois <[email protected]> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with This program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/

#ifndef COMBINETRACKCOMMAND_H
#define COMBINETRACKCOMMAND_H

#include <QUndoCommand>
#include "gpxlab.h"

/**
* @addtogroup Commands Commands
* @brief Command functions implementing QUndoCommand
* @{
*/

/**
* @class CombineTrackCommand
*
* @brief Combine track command
*
* @author Frederic Bourgeois <[email protected]>
* @version 1.0
* @date 28 Nov 2014
*/
class CombineTrackCommand : public QUndoCommand
{
public:

/**
* @brief Constructor
* @param gpxlab Pointer to application
* @param trackNumber Track number
* @param trackSegmentNumber Track segment number, if -1 for whole track
* @param pointNumber Point number at which the track is combined
* @param parent Parent
*/
CombineTrackCommand(GPXLab *gpxlab, int trackNumber, int trackSegmentNumber, int pointNumber, QUndoCommand *parent = 0);

/**
* @brief Undo the command
*/
void undo();

/**
* @brief Redo the command
*/
void redo();

private:
GPXLab *gpxlab;
int trackNumber;
int trackSegmentNumber;
int pointNumber;
};

/** @} Commands */

#endif // COMBINETRACKCOMMAND_H
Loading

0 comments on commit 3ed4dd0

Please sign in to comment.