Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
69d3ebb7
Commit
69d3ebb7
authored
Aug 26, 2014
by
Bryant
Browse files
Moved joystick settings into the main settings page.
No major functionality changes.
parent
7cfc2708
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/ui/JoystickWidget.cc
View file @
69d3ebb7
...
...
@@ -7,7 +7,7 @@
#include
<QDesktopWidget>
JoystickWidget
::
JoystickWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
)
:
Q
Dialog
(
parent
),
Q
Widget
(
parent
),
joystick
(
joystick
),
m_ui
(
new
Ui
::
JoystickWidget
)
{
...
...
src/ui/JoystickWidget.h
View file @
69d3ebb7
...
...
@@ -31,7 +31,7 @@ This file is part of the PIXHAWK project
#ifndef JOYSTICKWIDGET_H
#define JOYSTICKWIDGET_H
#include
<Q
Dialog
>
#include
<Q
Widget
>
#include
<QLabel>
#include
<QMap>
#include
"JoystickInput.h"
...
...
@@ -44,7 +44,7 @@ namespace Ui
class
JoystickWidget
;
}
class
JoystickWidget
:
public
Q
Dialog
class
JoystickWidget
:
public
Q
Widget
{
Q_OBJECT
Q_DISABLE_COPY
(
JoystickWidget
)
...
...
src/ui/JoystickWidget.ui
View file @
69d3ebb7
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
JoystickWidget
</class>
<widget
class=
"Q
Dialog
"
name=
"JoystickWidget"
>
<widget
class=
"Q
Widget
"
name=
"JoystickWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
...
...
@@ -30,7 +30,7 @@
<number>
8
</number>
</property>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::Set
FixedSize
</enum>
<enum>
QLayout::Set
DefaultConstraint
</enum>
</property>
<property
name=
"leftMargin"
>
<number>
8
</number>
...
...
@@ -174,53 +174,8 @@
</layout>
</widget>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"dialogButtonsBox"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
50
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>
dialogButtonsBox
</sender>
<signal>
accepted()
</signal>
<receiver>
JoystickWidget
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
263
</x>
<y>
438
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
157
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
src/ui/MainWindow.cc
View file @
69d3ebb7
...
...
@@ -279,7 +279,6 @@ void MainWindow::init()
// Connect user interface devices
emit
initStatusChanged
(
tr
(
"Initializing joystick interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
joystickWidget
=
NULL
;
joystick
=
new
JoystickInput
();
#ifdef QGC_MOUSE_ENABLED_WIN
...
...
@@ -1329,9 +1328,6 @@ void MainWindow::connectCommonActions()
// so no ressources spend on this.
ui
.
actionJoystickSettings
->
setVisible
(
true
);
// Configuration
// Joystick
connect
(
ui
.
actionJoystickSettings
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
configure
()));
// Application Settings
connect
(
ui
.
actionSettings
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showSettings
()));
...
...
@@ -1380,22 +1376,9 @@ void MainWindow::showRoadMap()
}
}
void
MainWindow
::
configure
()
{
if
(
!
joystickWidget
)
{
if
(
!
joystick
->
isRunning
())
{
joystick
->
start
();
}
joystickWidget
=
new
JoystickWidget
(
joystick
,
this
);
}
joystickWidget
->
show
();
}
void
MainWindow
::
showSettings
()
{
QGCSettingsWidget
*
settings
=
new
QGCSettingsWidget
(
this
);
QGCSettingsWidget
*
settings
=
new
QGCSettingsWidget
(
joystick
,
this
);
settings
->
show
();
}
...
...
src/ui/MainWindow.h
View file @
69d3ebb7
...
...
@@ -81,7 +81,6 @@ class QSplashScreen;
class
QGCStatusBar
;
class
Linecharts
;
class
QGCDataPlot2D
;
class
JoystickWidget
;
class
MenuActionHelper
;
class
QGCUASFileViewMulti
;
...
...
@@ -202,7 +201,6 @@ public slots:
LinkInterface
*
addLink
();
void
addLink
(
LinkInterface
*
link
);
bool
configLink
(
LinkInterface
*
link
);
void
configure
();
/** @brief Simulate a link */
void
simulateLink
(
bool
simulate
);
/** @brief Set the currently controlled UAS */
...
...
@@ -459,10 +457,7 @@ protected:
QPointer
<
QGCUASFileViewMulti
>
fileWidget
;
// Popup widgets
JoystickWidget
*
joystickWidget
;
JoystickInput
*
joystick
;
JoystickInput
*
joystick
;
///< The joystick manager for QGC
#ifdef QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */
...
...
src/ui/MainWindow.ui
View file @
69d3ebb7
...
...
@@ -62,7 +62,6 @@
<addaction
name=
"actionSimulate"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionMuteAudioOutput"
/>
<addaction
name=
"actionJoystickSettings"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"actionAdvanced_Mode"
/>
<addaction
name=
"separator"
/>
...
...
src/ui/QGCSettingsWidget.cc
View file @
69d3ebb7
...
...
@@ -5,14 +5,13 @@
#include
"MainWindow.h"
#include
"ui_QGCSettingsWidget.h"
#include
"JoystickWidget.h"
#include
"LinkManager.h"
#include
"MAVLinkProtocol.h"
#include
"MAVLinkSettingsWidget.h"
#include
"GAudioOutput.h"
//, Qt::WindowFlags flags
QGCSettingsWidget
::
QGCSettingsWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QGCSettingsWidget
::
QGCSettingsWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDialog
(
parent
,
flags
),
mainWindow
((
MainWindow
*
)
parent
),
ui
(
new
Ui
::
QGCSettingsWidget
)
...
...
@@ -24,6 +23,9 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
position
.
moveCenter
(
QApplication
::
desktop
()
->
availableGeometry
().
center
());
move
(
position
.
topLeft
());
// Add the joystick settings pane
ui
->
tabWidget
->
addTab
(
new
JoystickWidget
(
joystick
,
this
),
"Controllers"
);
// Add all protocols
QList
<
ProtocolInterface
*>
protocols
=
LinkManager
::
instance
()
->
getProtocols
();
foreach
(
ProtocolInterface
*
protocol
,
protocols
)
{
...
...
src/ui/QGCSettingsWidget.h
View file @
69d3ebb7
...
...
@@ -14,7 +14,7 @@ class QGCSettingsWidget : public QDialog
Q_OBJECT
public:
QGCSettingsWidget
(
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
QGCSettingsWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
~
QGCSettingsWidget
();
public
slots
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment