finishing up repo migration

git-svn-id: svn://svn.code.sf.net/p/qjoypad/code/trunk@80 c05e91a0-76c8-4ec0-b377-ef19ce7cc080
This commit is contained in:
John Toman
2009-05-26 00:45:05 +00:00
committed by virtuoussin13
commit 1cc6e9087e
59 changed files with 6563 additions and 0 deletions

66
src/button_edit.cpp Normal file
View File

@ -0,0 +1,66 @@
#include "button_edit.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
ButtonEdit::ButtonEdit(Button* butt)
:QDialog(0) {
setModal(true);
//build the dialog!
button = butt;
setWindowTitle("Set " + button->getName());
setWindowIcon(QPixmap(ICON24));
QVBoxLayout* v = new QVBoxLayout(this);
v->setMargin(5);
v->setSpacing(5);
BKKey = new KeyButton( button->getName(), button->useMouse?button->mousecode:button->keycode, this, true, button->useMouse);
v->addWidget(BKKey);
QHBoxLayout* h = new QHBoxLayout();
CSticky = new QCheckBox("Sticky", this);
CSticky->setChecked(button->sticky);
h->addWidget(CSticky);
CRapid = new QCheckBox("Rapid Fire", this);
CRapid->setChecked(button->rapidfire);
h->addWidget(CRapid);
v->addLayout(h);
h = new QHBoxLayout();
BOkay = new QPushButton("Okay", this);
connect(BOkay, SIGNAL( clicked() ), this, SLOT( accept()));
h->addWidget(BOkay);
BCancel = new QPushButton("Cancel", this);
connect(BCancel, SIGNAL( clicked() ), this, SLOT( reject()));
h->addWidget(BCancel);
v->addLayout(h);
}
void ButtonEdit::show() {
QDialog::show();
setFixedSize(size());
}
void ButtonEdit::accept() {
//if the rapidfire status has changed, either request a timer or turn it down.
/*if (button->rapidfire) {
if (!CRapid->isChecked()) tossTimer(button);
}
else {
if (CRapid->isChecked()) takeTimer(button);
}*/
button->rapidfire = CRapid->isChecked();
button->sticky = (CSticky->isChecked());
//if the user chose a mouse button...
if (BKKey->choseMouse()) {
button->useMouse = true;
button->mousecode = BKKey->getValue();
}
else {
button->useMouse = false;
button->keycode = BKKey->getValue();
}
QDialog::accept();
}