-
Notifications
You must be signed in to change notification settings - Fork 1
/
opt_flightplan.cpp
93 lines (76 loc) · 3.5 KB
/
opt_flightplan.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*****************************************************************************
* ____ ____ _ _ _ *
* /# /_\_ | _ \ (_) __| | (_) ___ _ __ *
* | |/o\o\ | | | | | | / _` | | | / _ \ | '__| *
* | \\_/_/ | |_| | | | | (_| | | | | __/ | | *
* / |_ | |____/ |_| \__,_| |_| \___| |_| *
* | ||\_ ~| *
* | ||| \/ *
* | ||| Project : KFreeFlight : a KDE4 GUI frontend for FlightGear *
* \// | *
* || | Developper : Didier FABERT <didier.fabert@gmail.com> *
* ||_ \ Date : 2009, April *
* \_| o| ,__, *
* \___/ Copyright (C) 2009 by didier fabert (oo)____ *
* ||||__ (__) )\ *
* (___)_) File : ||--|| * *
* *
* 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 2 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. *
*****************************************************************************/
#include "opt_flightplan.h"
#include "settings.h"
KFFOpt_flightplan::KFFOpt_flightplan( QWidget *parent )
: KFFOpt_skeleton( parent )
{
ui_widget.setupUi( this );
wSetupHeader(ui_widget.wHeaderLabel);
//* ffs - removing svg image
//QString img = Settings::data_dir() + "/world.svg";
//ui_widget.widgetLogo->load( img );
m_grp = new QButtonGroup( this );
m_grp->addButton( ui_widget.kcfg_WayPoint_none, 0 );
m_grp->addButton( ui_widget.kcfg_WayPoint_edit, 1 );
connect( ui_widget.btn_atlas,
SIGNAL( clicked() ),
SIGNAL( queryAtlas() )
);
connect( ui_widget.btn_WayPoint_Editor,
SIGNAL( clicked() ),
SIGNAL( queryFlightPlanWin() )
);
}
KFFOpt_flightplan::~KFFOpt_flightplan()
{
}
void KFFOpt_flightplan::saveSettings()
{
Settings::setFlightplan_selected( m_grp->checkedId() );
Settings::self()->writeConfig();
}
void KFFOpt_flightplan::loadSettings()
{
m_grp->button( Settings::flightplan_selected() )->setChecked( true );
}
bool KFFOpt_flightplan::getOptions( QStringList & list )
{
QStringList waypoints;
QStringList::Iterator it;
waypoints = Settings::flightplan_list();
if ( ui_widget.kcfg_WayPoint_edit->isChecked() )
{
for ( it = waypoints.begin() ; it != waypoints.end() ; it++ )
{
list << "--wp=" + it->section( "|", 0, 0 ) + "@" + it->section( "|", 3, 3 );
}
}
return true;
}
//void KFFOpt_flightplan::setOutput( KFFWin_messages* )