1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Merge branch 'next' of ssh://git.openpilot.org/OpenPilot into next

This commit is contained in:
PT_Dreamer 2012-10-01 13:42:59 +01:00
commit 8744e3dc93
3 changed files with 13 additions and 40 deletions

View File

@ -93,8 +93,18 @@ bool SDLGamepad::setGamepad(qint16 index)
{
buttons = SDL_JoystickNumButtons(gamepad);
axes = SDL_JoystickNumAxes(gamepad);
this->index = index;
return true;
if (axes >= 4) {
this->index = index;
return true;
}
else
{
buttons = -1;
axes = -1;
this->index = -1;
qCritical("Gamepad has less than 4 axes");
}
}
else
{

View File

@ -39,7 +39,6 @@
#include <QtCore/QSettings>
#include "ui_generalsettings.h"
#include <QKeyEvent>
using namespace Utils;
using namespace Core::Internal;
@ -113,14 +112,8 @@ void GeneralSettings::fillLanguageBox() const
QWidget *GeneralSettings::createPage(QWidget *parent)
{
m_page = new Ui::GeneralSettings();
globalSettingsWidget *w = new globalSettingsWidget(parent);
connect(w,SIGNAL(showHidden()),this,SLOT(showHidden()));
QWidget *w = new QWidget(parent);
m_page->setupUi(w);
m_page->labelUDP->setVisible(false);
m_page->cbUseUDPMirror->setVisible(false);
m_page->labelExpert->setVisible(false);
m_page->cbExpertMode->setVisible(false);
fillLanguageBox();
connect(m_page->checkAutoConnect,SIGNAL(stateChanged(int)),this,SLOT(slotAutoConnect(int)));
m_page->checkBoxSaveOnExit->setChecked(m_saveSettingsOnExit);
@ -263,21 +256,3 @@ void GeneralSettings::slotAutoConnect(int value)
else
m_page->checkAutoSelect->setEnabled(true);
}
void GeneralSettings::showHidden()
{
m_page->labelUDP->setVisible(true);
m_page->cbUseUDPMirror->setVisible(true);
m_page->labelExpert->setVisible(true);
m_page->cbExpertMode->setVisible(true);
}
globalSettingsWidget::globalSettingsWidget(QWidget *parent):QWidget(parent){}
void globalSettingsWidget::keyPressEvent(QKeyEvent *event)
{
if(event->key()==Qt::Key_F7)
{
emit showHidden();
}
}

View File

@ -69,7 +69,6 @@ private slots:
void resetLanguage();
void showHelpForExternalEditor();
void slotAutoConnect(int);
void showHidden();
private:
void fillLanguageBox() const;
@ -86,17 +85,6 @@ private:
QList<QTextCodec *> m_codecs;
};
class globalSettingsWidget:public QWidget
{
Q_OBJECT
public:
globalSettingsWidget(QWidget * parent);
protected:
void keyPressEvent(QKeyEvent *);
signals:
void showHidden();
};
} // namespace Internal
} // namespace Core