Updraft  1.0
Open source glider flight visualisation tool.
Updraft::TaskDeclPanel Class Reference

Widget that is shown in the task declaration tab. More...

#include <taskdeclpanel.h>

Collaboration diagram for Updraft::TaskDeclPanel:

List of all members.

Public Member Functions

 TaskDeclPanel (TaskLayer *layer, QWidget *parent=0, Qt::WFlags flags=0)
 ~TaskDeclPanel ()
bool hasToggledButton ()
int getToggledButtonIndex ()
void newTurnpointButton (int index, const QString &name)
 Create and insert into GUI a new turnpoint button.
void newAddTpButton (int index, bool checked=false)
 Create and insert into GUI a new add turnpoint button.
void initFromFile (TaskFile *file)
 Initializes the task from a file.
const QWidget * getTaskPointWidget (int i) const

Private Slots

void addTpButtonPushed ()
void removeTpButtonPushed ()
void saveButtonPushed ()
void undoButtonPushed ()
void redoButtonPushed ()
void dataChanged ()
void updateButtons ()
 Called when the buttons should be updated due to changes in the file.

Private Member Functions

bool tpButtonExists (int pos)
 Says whether the turnpoint button exists for the given position.
bool tpButtonCorrect (int pos, const TaskPoint *point)
 Says, whether the taskpoint button is a correct representation of the given TaskPoint.
void updateTpButton (int pos, const TaskPoint *point)
 Updates the taskpoint button to represent the given TurnPoint.
void updateAddTpButton (int pos, bool checkState)
 Updates the add taskpoint button by changing its check state.
void updateSummaryLabel (const TaskData *data)
 Updates the text on task summary label.
void removeTpButtons (int pos)
 Removes TaskPoint buttons for the given position.
int tpIndexToLayoutPos (int index) const
int tpLayoutPosToIndex (int pos) const
int addIndexToLayoutPos (int index) const
int addLayoutPosToIndex (int pos) const
void adjustAddTpText ()
 Hides or shows the add turnpoint button text according to button number.
void uncheckAllAddTpButtons ()
 Untoggles all plus signs that serve for adding taskpoints.

Private Attributes

QString addTpText
Ui::TaskDeclPanel * ui
QButtonGroup * addButtons
 Button group that ensures just one checked add tp button.
bool isBeingEdited
 Flag that says, whether the task is being edited.
TaskAxistaskAxis
 Axis with lengths of task legs.
TaskLayertaskLayer

Detailed Description

Widget that is shown in the task declaration tab.


Constructor & Destructor Documentation

Updraft::TaskDeclPanel::TaskDeclPanel ( TaskLayer layer,
QWidget *  parent = 0,
Qt::WFlags  flags = 0 
)

Member Function Documentation

int Updraft::TaskDeclPanel::addIndexToLayoutPos ( int  index) const [private]
int Updraft::TaskDeclPanel::addLayoutPosToIndex ( int  pos) const [private]

Hides or shows the add turnpoint button text according to button number.

void Updraft::TaskDeclPanel::dataChanged ( ) [private, slot]
const QWidget * Updraft::TaskDeclPanel::getTaskPointWidget ( int  i) const
Parameters:
iindex of desired task point
Returns:
Widget representing taskpoint (NULL if it fails).
Returns:
Index of the turnpoint that should be added for the toggled btn.
Returns:
Whether an add turnpoint button is toggled.

Initializes the task from a file.

void Updraft::TaskDeclPanel::newAddTpButton ( int  index,
bool  checked = false 
)

Create and insert into GUI a new add turnpoint button.

void Updraft::TaskDeclPanel::newTurnpointButton ( int  index,
const QString &  name 
)

Create and insert into GUI a new turnpoint button.

void Updraft::TaskDeclPanel::redoButtonPushed ( ) [private, slot]
void Updraft::TaskDeclPanel::removeTpButtons ( int  pos) [private]

Removes TaskPoint buttons for the given position.

void Updraft::TaskDeclPanel::saveButtonPushed ( ) [private, slot]
bool Updraft::TaskDeclPanel::tpButtonCorrect ( int  pos,
const TaskPoint point 
) [private]

Says, whether the taskpoint button is a correct representation of the given TaskPoint.

bool Updraft::TaskDeclPanel::tpButtonExists ( int  pos) [private]

Says whether the turnpoint button exists for the given position.

int Updraft::TaskDeclPanel::tpIndexToLayoutPos ( int  index) const [private]
int Updraft::TaskDeclPanel::tpLayoutPosToIndex ( int  pos) const [private]

Untoggles all plus signs that serve for adding taskpoints.

void Updraft::TaskDeclPanel::undoButtonPushed ( ) [private, slot]
void Updraft::TaskDeclPanel::updateAddTpButton ( int  pos,
bool  checkState 
) [private]

Updates the add taskpoint button by changing its check state.

void Updraft::TaskDeclPanel::updateButtons ( ) [private, slot]

Called when the buttons should be updated due to changes in the file.

void Updraft::TaskDeclPanel::updateSummaryLabel ( const TaskData data) [private]

Updates the text on task summary label.

void Updraft::TaskDeclPanel::updateTpButton ( int  pos,
const TaskPoint point 
) [private]

Updates the taskpoint button to represent the given TurnPoint.


Member Data Documentation

QButtonGroup* Updraft::TaskDeclPanel::addButtons [private]

Button group that ensures just one checked add tp button.

Flag that says, whether the task is being edited.

Axis with lengths of task legs.

Ui::TaskDeclPanel* Updraft::TaskDeclPanel::ui [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines