-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [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
1 parent
49f300e
commit 3ed4dd0
Showing
92 changed files
with
3,402 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.