Qt: Remove controls. Undefine emit so that it is easier to use Qt headers in native files.

This commit is contained in:
Sacha 2013-11-20 00:29:17 +10:00
parent faaabfa21d
commit a41e3d3432
5 changed files with 5 additions and 407 deletions

View File

@ -21,6 +21,10 @@
struct JitBlock;
#ifdef USING_QT_UI
#undef emit
#endif
#if defined(PPC)
#include "../PPC/PpcJit.h"
#elif defined(ARM)

View File

@ -1,92 +0,0 @@
#include "controls.h"
#include "ui_controls.h"
#include "Core/Config.h"
#include <QTimer>
Controls_ controllist[] = {
{"Edit_Start", "Start", Qt::Key_1, PAD_BUTTON_START, CTRL_START},
{"Edit_Select", "Select", Qt::Key_2, PAD_BUTTON_SELECT, CTRL_SELECT},
{"Edit_S", "Square", Qt::Key_Z, PAD_BUTTON_X, CTRL_SQUARE},
{"Edit_T", "Triangle", Qt::Key_A, PAD_BUTTON_Y, CTRL_TRIANGLE},
{"Edit_O", "Circle", Qt::Key_S, PAD_BUTTON_B, CTRL_CIRCLE},
{"Edit_X", "Cross", Qt::Key_X, PAD_BUTTON_A, CTRL_CROSS},
{"Edit_LT", "Left Trigger", Qt::Key_Q, PAD_BUTTON_LBUMPER, CTRL_LTRIGGER},
{"Edit_RT", "Right Trigger", Qt::Key_W, PAD_BUTTON_RBUMPER, CTRL_RTRIGGER},
{"Edit_Up", "Up", Qt::Key_Up, PAD_BUTTON_UP, CTRL_UP},
{"Edit_Down", "Down", Qt::Key_Down, PAD_BUTTON_DOWN, CTRL_DOWN},
{"Edit_Left", "Left", Qt::Key_Left, PAD_BUTTON_LEFT, CTRL_LEFT},
{"Edit_Right", "Right", Qt::Key_Right, PAD_BUTTON_RIGHT, CTRL_RIGHT},
{"", "Analog Up", Qt::Key_I, PAD_BUTTON_JOY_UP, 0},
{"", "Analog Down", Qt::Key_K, PAD_BUTTON_JOY_DOWN,0},
{"", "Analog Left", Qt::Key_J, PAD_BUTTON_JOY_LEFT,0},
{"", "Analog Right", Qt::Key_L, PAD_BUTTON_JOY_RIGHT,0},
};
Controls::Controls(QWidget *parent) :
QDialog(parent),
ui(new Ui::Controls)
{
ui->setupUi(this);
/*for(int i = 0; i < controllistCount; i++)
{
if(g_Config.iMappingMap.find(i) != g_Config.iMappingMap.end())
{
controllist[i].key = (Qt::Key)g_Config.iMappingMap[i];
}
}*/
}
Controls::~Controls()
{
delete ui;
}
void Controls::showEvent(QShowEvent*)
{
/*
for(int i = 0; i < controllistCount; i++)
{
if(g_Config.iMappingMap.find(i) != g_Config.iMappingMap.end())
{
controllist[i].key = (Qt::Key)g_Config.iMappingMap[i];
}
if(controllist[i].editName != "")
{
QLineEdit* edit = findChild<QLineEdit*>(controllist[i].editName);
if(edit)
{
QKeySequence sec(controllist[i].key);
edit->setText(sec.toString());
}
}
}*/
}
void Controls::changeEvent(QEvent *event)
{
if (event)
if (event->type() == QEvent::LanguageChange)
ui->retranslateUi(this);
QDialog::changeEvent(event);
}
void Controls::on_buttonBox_accepted()
{
/*
for(int i = 0; i < controllistCount; i++)
{
if(controllist[i].editName != "")
{
QLineEdit* edit = findChild<QLineEdit*>(controllist[i].editName);
if(edit)
{
QKeySequence sec(edit->text());
controllist[i].key = (Qt::Key)sec[0];
g_Config.iMappingMap[i] = sec[0];
}
}
}*/
}

View File

@ -1,42 +0,0 @@
#ifndef CONTROLS_H
#define CONTROLS_H
#include <QDialog>
#include "native/input/input_state.h"
#include "Core/HLE/sceCtrl.h"
namespace Ui {
class Controls;
}
struct Controls_
{
public:
QString editName;
QString command;
Qt::Key key;
int emu_id;
int psp_id;
};
const int controllistCount = 16;
extern Controls_ controllist[];
class Controls : public QDialog
{
Q_OBJECT
public:
explicit Controls(QWidget *parent = 0);
~Controls();
void showEvent(QShowEvent *);
void changeEvent(QEvent *);
private slots:
void on_buttonBox_accepted();
private:
Ui::Controls *ui;
};
#endif // CONTROLS_H

View File

@ -1,272 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Controls</class>
<widget class="QDialog" name="Controls">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>618</width>
<height>357</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string comment="Controls window title">Controls</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
<width>600</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>300</height>
</size>
</property>
<widget class="QLabel" name="PSP_Img">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>501</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/images/resources/psp.png</pixmap>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Up">
<property name="geometry">
<rect>
<x>50</x>
<y>100</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Left">
<property name="geometry">
<rect>
<x>30</x>
<y>130</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Right">
<property name="geometry">
<rect>
<x>80</x>
<y>130</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Down">
<property name="geometry">
<rect>
<x>50</x>
<y>160</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Home">
<property name="geometry">
<rect>
<x>150</x>
<y>240</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Start">
<property name="geometry">
<rect>
<x>410</x>
<y>240</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_Select">
<property name="geometry">
<rect>
<x>360</x>
<y>240</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_X">
<property name="geometry">
<rect>
<x>510</x>
<y>160</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_S">
<property name="geometry">
<rect>
<x>480</x>
<y>130</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_O">
<property name="geometry">
<rect>
<x>530</x>
<y>130</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_T">
<property name="geometry">
<rect>
<x>510</x>
<y>100</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_RT">
<property name="geometry">
<rect>
<x>440</x>
<y>20</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QKeyEdit" name="Edit_LT">
<property name="geometry">
<rect>
<x>120</x>
<y>20</y>
<width>41</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="PSP_Img_2">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>501</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/images/resources/psp_map.png</pixmap>
</property>
</widget>
<zorder>PSP_Img</zorder>
<zorder>PSP_Img_2</zorder>
<zorder>Edit_Up</zorder>
<zorder>Edit_Left</zorder>
<zorder>Edit_Right</zorder>
<zorder>Edit_Down</zorder>
<zorder>Edit_Home</zorder>
<zorder>Edit_Start</zorder>
<zorder>Edit_Select</zorder>
<zorder>Edit_X</zorder>
<zorder>Edit_S</zorder>
<zorder>Edit_O</zorder>
<zorder>Edit_T</zorder>
<zorder>Edit_RT</zorder>
<zorder>Edit_LT</zorder>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QKeyEdit</class>
<extends>QLineEdit</extends>
<header>qkeyedit.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="resources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Controls</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Controls</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

2
native

@ -1 +1 @@
Subproject commit 74e412ffd7faab3101804de186f14ea003d1ea7e
Subproject commit a54d58f8e350bdf3b1fb30f7c70da204dc51eb4f