Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
69d3ebb7
Commit
69d3ebb7
authored
Aug 26, 2014
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved joystick settings into the main settings page.
No major functionality changes.
parent
7cfc2708
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
80 deletions
+14
-80
JoystickWidget.cc
src/ui/JoystickWidget.cc
+1
-1
JoystickWidget.h
src/ui/JoystickWidget.h
+2
-2
JoystickWidget.ui
src/ui/JoystickWidget.ui
+3
-48
MainWindow.cc
src/ui/MainWindow.cc
+1
-18
MainWindow.h
src/ui/MainWindow.h
+1
-6
MainWindow.ui
src/ui/MainWindow.ui
+0
-1
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+5
-3
QGCSettingsWidget.h
src/ui/QGCSettingsWidget.h
+1
-1
No files found.
src/ui/JoystickWidget.cc
View file @
69d3ebb7
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <QDesktopWidget>
#include <QDesktopWidget>
JoystickWidget
::
JoystickWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
)
:
JoystickWidget
::
JoystickWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
)
:
Q
Dialog
(
parent
),
Q
Widget
(
parent
),
joystick
(
joystick
),
joystick
(
joystick
),
m_ui
(
new
Ui
::
JoystickWidget
)
m_ui
(
new
Ui
::
JoystickWidget
)
{
{
...
...
src/ui/JoystickWidget.h
View file @
69d3ebb7
...
@@ -31,7 +31,7 @@ This file is part of the PIXHAWK project
...
@@ -31,7 +31,7 @@ This file is part of the PIXHAWK project
#ifndef JOYSTICKWIDGET_H
#ifndef JOYSTICKWIDGET_H
#define JOYSTICKWIDGET_H
#define JOYSTICKWIDGET_H
#include <Q
Dialog
>
#include <Q
Widget
>
#include <QLabel>
#include <QLabel>
#include <QMap>
#include <QMap>
#include "JoystickInput.h"
#include "JoystickInput.h"
...
@@ -44,7 +44,7 @@ namespace Ui
...
@@ -44,7 +44,7 @@ namespace Ui
class
JoystickWidget
;
class
JoystickWidget
;
}
}
class
JoystickWidget
:
public
Q
Dialog
class
JoystickWidget
:
public
Q
Widget
{
{
Q_OBJECT
Q_OBJECT
Q_DISABLE_COPY
(
JoystickWidget
)
Q_DISABLE_COPY
(
JoystickWidget
)
...
...
src/ui/JoystickWidget.ui
View file @
69d3ebb7
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<ui
version=
"4.0"
>
<class>
JoystickWidget
</class>
<class>
JoystickWidget
</class>
<widget
class=
"Q
Dialog
"
name=
"JoystickWidget"
>
<widget
class=
"Q
Widget
"
name=
"JoystickWidget"
>
<property
name=
"geometry"
>
<property
name=
"geometry"
>
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<number>
8
</number>
<number>
8
</number>
</property>
</property>
<property
name=
"sizeConstraint"
>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::Set
FixedSize
</enum>
<enum>
QLayout::Set
DefaultConstraint
</enum>
</property>
</property>
<property
name=
"leftMargin"
>
<property
name=
"leftMargin"
>
<number>
8
</number>
<number>
8
</number>
...
@@ -174,53 +174,8 @@
...
@@ -174,53 +174,8 @@
</layout>
</layout>
</widget>
</widget>
</item>
</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>
</layout>
</widget>
</widget>
<resources/>
<resources/>
<connections>
<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>
</ui>
</ui>
src/ui/MainWindow.cc
View file @
69d3ebb7
...
@@ -279,7 +279,6 @@ void MainWindow::init()
...
@@ -279,7 +279,6 @@ void MainWindow::init()
// Connect user interface devices
// Connect user interface devices
emit
initStatusChanged
(
tr
(
"Initializing joystick interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
emit
initStatusChanged
(
tr
(
"Initializing joystick interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
joystickWidget
=
NULL
;
joystick
=
new
JoystickInput
();
joystick
=
new
JoystickInput
();
#ifdef QGC_MOUSE_ENABLED_WIN
#ifdef QGC_MOUSE_ENABLED_WIN
...
@@ -1329,9 +1328,6 @@ void MainWindow::connectCommonActions()
...
@@ -1329,9 +1328,6 @@ void MainWindow::connectCommonActions()
// so no ressources spend on this.
// so no ressources spend on this.
ui
.
actionJoystickSettings
->
setVisible
(
true
);
ui
.
actionJoystickSettings
->
setVisible
(
true
);
// Configuration
// Joystick
connect
(
ui
.
actionJoystickSettings
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
configure
()));
// Application Settings
// Application Settings
connect
(
ui
.
actionSettings
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showSettings
()));
connect
(
ui
.
actionSettings
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showSettings
()));
...
@@ -1380,22 +1376,9 @@ void MainWindow::showRoadMap()
...
@@ -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
()
void
MainWindow
::
showSettings
()
{
{
QGCSettingsWidget
*
settings
=
new
QGCSettingsWidget
(
this
);
QGCSettingsWidget
*
settings
=
new
QGCSettingsWidget
(
joystick
,
this
);
settings
->
show
();
settings
->
show
();
}
}
...
...
src/ui/MainWindow.h
View file @
69d3ebb7
...
@@ -81,7 +81,6 @@ class QSplashScreen;
...
@@ -81,7 +81,6 @@ class QSplashScreen;
class
QGCStatusBar
;
class
QGCStatusBar
;
class
Linecharts
;
class
Linecharts
;
class
QGCDataPlot2D
;
class
QGCDataPlot2D
;
class
JoystickWidget
;
class
MenuActionHelper
;
class
MenuActionHelper
;
class
QGCUASFileViewMulti
;
class
QGCUASFileViewMulti
;
...
@@ -202,7 +201,6 @@ public slots:
...
@@ -202,7 +201,6 @@ public slots:
LinkInterface
*
addLink
();
LinkInterface
*
addLink
();
void
addLink
(
LinkInterface
*
link
);
void
addLink
(
LinkInterface
*
link
);
bool
configLink
(
LinkInterface
*
link
);
bool
configLink
(
LinkInterface
*
link
);
void
configure
();
/** @brief Simulate a link */
/** @brief Simulate a link */
void
simulateLink
(
bool
simulate
);
void
simulateLink
(
bool
simulate
);
/** @brief Set the currently controlled UAS */
/** @brief Set the currently controlled UAS */
...
@@ -459,10 +457,7 @@ protected:
...
@@ -459,10 +457,7 @@ protected:
QPointer
<
QGCUASFileViewMulti
>
fileWidget
;
QPointer
<
QGCUASFileViewMulti
>
fileWidget
;
// Popup widgets
JoystickInput
*
joystick
;
///< The joystick manager for QGC
JoystickWidget
*
joystickWidget
;
JoystickInput
*
joystick
;
#ifdef QGC_MOUSE_ENABLED_WIN
#ifdef QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */
/** @brief 3d Mouse support (WIN only) */
...
...
src/ui/MainWindow.ui
View file @
69d3ebb7
...
@@ -62,7 +62,6 @@
...
@@ -62,7 +62,6 @@
<addaction
name=
"actionSimulate"
/>
<addaction
name=
"actionSimulate"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionMuteAudioOutput"
/>
<addaction
name=
"actionMuteAudioOutput"
/>
<addaction
name=
"actionJoystickSettings"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"actionAdvanced_Mode"
/>
<addaction
name=
"actionAdvanced_Mode"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"separator"
/>
...
...
src/ui/QGCSettingsWidget.cc
View file @
69d3ebb7
...
@@ -5,14 +5,13 @@
...
@@ -5,14 +5,13 @@
#include "MainWindow.h"
#include "MainWindow.h"
#include "ui_QGCSettingsWidget.h"
#include "ui_QGCSettingsWidget.h"
#include "JoystickWidget.h"
#include "LinkManager.h"
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
#include "MAVLinkSettingsWidget.h"
#include "GAudioOutput.h"
#include "GAudioOutput.h"
//, Qt::WindowFlags flags
QGCSettingsWidget
::
QGCSettingsWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QGCSettingsWidget
::
QGCSettingsWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDialog
(
parent
,
flags
),
QDialog
(
parent
,
flags
),
mainWindow
((
MainWindow
*
)
parent
),
mainWindow
((
MainWindow
*
)
parent
),
ui
(
new
Ui
::
QGCSettingsWidget
)
ui
(
new
Ui
::
QGCSettingsWidget
)
...
@@ -24,6 +23,9 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
...
@@ -24,6 +23,9 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
position
.
moveCenter
(
QApplication
::
desktop
()
->
availableGeometry
().
center
());
position
.
moveCenter
(
QApplication
::
desktop
()
->
availableGeometry
().
center
());
move
(
position
.
topLeft
());
move
(
position
.
topLeft
());
// Add the joystick settings pane
ui
->
tabWidget
->
addTab
(
new
JoystickWidget
(
joystick
,
this
),
"Controllers"
);
// Add all protocols
// Add all protocols
QList
<
ProtocolInterface
*>
protocols
=
LinkManager
::
instance
()
->
getProtocols
();
QList
<
ProtocolInterface
*>
protocols
=
LinkManager
::
instance
()
->
getProtocols
();
foreach
(
ProtocolInterface
*
protocol
,
protocols
)
{
foreach
(
ProtocolInterface
*
protocol
,
protocols
)
{
...
...
src/ui/QGCSettingsWidget.h
View file @
69d3ebb7
...
@@ -14,7 +14,7 @@ class QGCSettingsWidget : public QDialog
...
@@ -14,7 +14,7 @@ class QGCSettingsWidget : public QDialog
Q_OBJECT
Q_OBJECT
public:
public:
QGCSettingsWidget
(
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
QGCSettingsWidget
(
JoystickInput
*
joystick
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
Qt
::
Sheet
);
~
QGCSettingsWidget
();
~
QGCSettingsWidget
();
public
slots
:
public
slots
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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