From 879c5bf7ca8a65b3d86903c86da30dee7eb78ef7 Mon Sep 17 00:00:00 2001 From: mudlord Date: Fri, 16 May 2008 02:40:47 +0000 Subject: [PATCH] Fixed up Qt4 project file Started preliminary Qt4 directory dialog in options git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@510 a31d4220-a93d-0410-bf67-fe4944624d44 --- project/qmake/vba-m.pro | 2 +- src/qt/MainOptions.cpp | 207 +++++++++++++++-------------- src/qt/MainOptions.h | 8 ++ src/qt/configdialog.cpp | 9 +- src/qt/resources/folder-orange.png | Bin 0 -> 1202 bytes 5 files changed, 124 insertions(+), 102 deletions(-) create mode 100644 src/qt/resources/folder-orange.png diff --git a/project/qmake/vba-m.pro b/project/qmake/vba-m.pro index 9f5ad3c6..bb6061d7 100644 --- a/project/qmake/vba-m.pro +++ b/project/qmake/vba-m.pro @@ -2,7 +2,7 @@ TEMPLATE = app CONFIG += qt release QT += opengl TARGET = VisualBoyAdvance -DEFINES += BKPT_SUPPORT +DEFINES += BKPT_SUPPORT NO_PNG # Directory Locations M_DIR_QT = ../../src/qt/ diff --git a/src/qt/MainOptions.cpp b/src/qt/MainOptions.cpp index 6f927a08..0994a17b 100644 --- a/src/qt/MainOptions.cpp +++ b/src/qt/MainOptions.cpp @@ -21,16 +21,16 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent) : QWidget(parent) { - QGroupBox *RenderGroup = new QGroupBox(tr("Renderer Options")); - QLabel *RenderLabel = new QLabel(tr("Renderer:")); - QComboBox *RenderCombo = new QComboBox; - RenderCombo->addItem("OpenGL"); - RenderCombo->addItem("QPainter"); + QGroupBox *RenderGroup = new QGroupBox(tr("Renderer Options")); + QLabel *RenderLabel = new QLabel(tr("Renderer:")); + QComboBox *RenderCombo = new QComboBox; + RenderCombo->addItem("OpenGL"); + RenderCombo->addItem("QPainter"); QLabel *ResLabel = new QLabel(tr("Resolution:")); QComboBox *ResCombo = new QComboBox; - ResCombo->addItem("320x200"); - ResCombo->addItem("320x240"); + ResCombo->addItem("320x200"); + ResCombo->addItem("320x240"); ResCombo->addItem("400x300"); ResCombo->addItem("512x384"); ResCombo->addItem("640x480"); @@ -40,8 +40,8 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent) QLabel *SWFilterLabel = new QLabel(tr("Software Filter:")); QComboBox *SWFilterCombo = new QComboBox; - SWFilterCombo->addItem("2xSai"); - SWFilterCombo->addItem("HQ2X"); + SWFilterCombo->addItem("2xSai"); + SWFilterCombo->addItem("HQ2X"); SWFilterCombo->addItem("HQ3X"); SWFilterCombo->addItem("HQ4X"); SWFilterCombo->addItem("Super Eagle"); @@ -50,25 +50,25 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent) QLabel *HWFilterLabel = new QLabel(tr("Hardware Filter:")); QComboBox *HWFilterCombo = new QComboBox; - HWFilterCombo->addItem("Nearest"); - HWFilterCombo->addItem("Bilinear"); + HWFilterCombo->addItem("Nearest"); + HWFilterCombo->addItem("Bilinear"); + + QHBoxLayout *RenderLayout = new QHBoxLayout; + RenderLayout->addWidget(RenderLabel); + RenderLayout->addWidget(RenderCombo); - QHBoxLayout *RenderLayout = new QHBoxLayout; - RenderLayout->addWidget(RenderLabel); - RenderLayout->addWidget(RenderCombo); - QHBoxLayout *ResLayout = new QHBoxLayout; ResLayout->addWidget(ResLabel); - ResLayout->addWidget(ResCombo); + ResLayout->addWidget(ResCombo); QHBoxLayout *SWFilterLayout = new QHBoxLayout; SWFilterLayout->addWidget(SWFilterLabel); - SWFilterLayout->addWidget(SWFilterCombo); + SWFilterLayout->addWidget(SWFilterCombo); QHBoxLayout *HWFilterLayout = new QHBoxLayout; HWFilterLayout->addWidget(HWFilterLabel); - HWFilterLayout->addWidget(HWFilterCombo); - + HWFilterLayout->addWidget(HWFilterCombo); + QCheckBox *TripleBufCheckBox = new QCheckBox(tr("Triple Buffering")); QCheckBox *VerticalSyncCheckBox = new QCheckBox(tr("Vertical Sync")); QCheckBox *DisableStatCheckBox = new QCheckBox(tr("Disable status messages")); @@ -79,107 +79,106 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent) CheckLayout->addWidget(VerticalSyncCheckBox, 4, 2); CheckLayout->addWidget(DisableStatCheckBox, 5, 2); - QVBoxLayout *configLayout = new QVBoxLayout; - configLayout->addLayout(RenderLayout); + QVBoxLayout *configLayout = new QVBoxLayout; + configLayout->addLayout(RenderLayout); configLayout->addLayout(ResLayout); configLayout->addLayout(HWFilterLayout); configLayout->addLayout(SWFilterLayout); configLayout->addLayout(CheckLayout); - RenderGroup->setLayout(configLayout); + RenderGroup->setLayout(configLayout); - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(RenderGroup); - mainLayout->addStretch(1); - setLayout(mainLayout); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(RenderGroup); + mainLayout->addStretch(1); + setLayout(mainLayout); } InputOptionsPage::InputOptionsPage(QWidget *parent) : QWidget(parent) { - QGroupBox *InputGroup = new QGroupBox(tr("Input Keys")); + QGroupBox *InputGroup = new QGroupBox(tr("Input Keys")); - QLabel *StartLabel = new QLabel(tr("Start:")); - QLineEdit *StartEdit = new QLineEdit; + QLabel *StartLabel = new QLabel(tr("Start:")); + QLineEdit *StartEdit = new QLineEdit; - QLabel *SelectLabel = new QLabel(tr("Select:")); - QLineEdit *SelectEdit = new QLineEdit; + QLabel *SelectLabel = new QLabel(tr("Select:")); + QLineEdit *SelectEdit = new QLineEdit; - QLabel *UpLabel = new QLabel(tr("Up:")); - QLineEdit *UpEdit = new QLineEdit; + QLabel *UpLabel = new QLabel(tr("Up:")); + QLineEdit *UpEdit = new QLineEdit; - QLabel *DownLabel = new QLabel(tr("Down:")); - QLineEdit *DownEdit = new QLineEdit; + QLabel *DownLabel = new QLabel(tr("Down:")); + QLineEdit *DownEdit = new QLineEdit; - QLabel *LeftLabel = new QLabel(tr("Left:")); - QLineEdit *LeftEdit = new QLineEdit; + QLabel *LeftLabel = new QLabel(tr("Left:")); + QLineEdit *LeftEdit = new QLineEdit; - QLabel *RightLabel = new QLabel(tr("Right:")); - QLineEdit *RightEdit = new QLineEdit; + QLabel *RightLabel = new QLabel(tr("Right:")); + QLineEdit *RightEdit = new QLineEdit; - QLabel *ALabel = new QLabel(tr("A:")); - QLineEdit *AEdit = new QLineEdit; + QLabel *ALabel = new QLabel(tr("A:")); + QLineEdit *AEdit = new QLineEdit; - QLabel *BLabel = new QLabel(tr("B:")); - QLineEdit *BEdit = new QLineEdit; + QLabel *BLabel = new QLabel(tr("B:")); + QLineEdit *BEdit = new QLineEdit; - QLabel *LLabel = new QLabel(tr("L:")); - QLineEdit *LEdit = new QLineEdit; + QLabel *LLabel = new QLabel(tr("L:")); + QLineEdit *LEdit = new QLineEdit; - QLabel *RLabel = new QLabel(tr("R:")); - QLineEdit *REdit = new QLineEdit; + QLabel *RLabel = new QLabel(tr("R:")); + QLineEdit *REdit = new QLineEdit; - QLabel *GSLabel = new QLabel(tr("Gameshark:")); - QLineEdit *GSEdit = new QLineEdit; + QLabel *GSLabel = new QLabel(tr("Gameshark:")); + QLineEdit *GSEdit = new QLineEdit; - QLabel *SpeedUpLabel = new QLabel(tr("Speed Up:")); - QLineEdit *SpeedUpEdit = new QLineEdit; + QLabel *SpeedUpLabel = new QLabel(tr("Speed Up:")); + QLineEdit *SpeedUpEdit = new QLineEdit; - QLabel *ScreenshotLabel = new QLabel(tr("Screenshot:")); - QLineEdit *ScreenshotEdit = new QLineEdit; + QLabel *ScreenshotLabel = new QLabel(tr("Screenshot:")); + QLineEdit *ScreenshotEdit = new QLineEdit; - QCheckBox *MultipleAssignCheckBox = new QCheckBox(tr("Multiple key assignments")); + QCheckBox *MultipleAssignCheckBox = new QCheckBox(tr("Multiple key assignments")); - QGridLayout *InputLayout = new QGridLayout; - InputLayout->addWidget(StartLabel, 0, 0); - InputLayout->addWidget(StartEdit, 0, 1); - InputLayout->addWidget(SelectLabel, 1, 0); - InputLayout->addWidget(SelectEdit, 1, 1); - InputLayout->addWidget(UpLabel, 2, 0); - InputLayout->addWidget(UpEdit, 2, 1); - InputLayout->addWidget(DownLabel, 3, 0); - InputLayout->addWidget(DownEdit, 3, 1); - InputLayout->addWidget(LeftLabel, 4, 0); - InputLayout->addWidget(LeftEdit, 4, 1); - InputLayout->addWidget(RightLabel, 5, 0); - InputLayout->addWidget(RightEdit, 5, 1); - InputLayout->addWidget(ALabel, 6, 0); - InputLayout->addWidget(AEdit, 6, 1); - InputLayout->addWidget(BLabel, 7, 0); - InputLayout->addWidget(BEdit, 7, 1); - InputLayout->addWidget(LLabel, 8, 0); - InputLayout->addWidget(LEdit, 8, 1); - InputLayout->addWidget(RLabel, 9, 0); - InputLayout->addWidget(REdit, 9, 1); - InputLayout->addWidget(GSLabel, 0, 2); - InputLayout->addWidget(GSEdit, 0, 3); - InputLayout->addWidget(SpeedUpLabel, 1, 2); - InputLayout->addWidget(SpeedUpEdit, 1, 3); - InputLayout->addWidget(ScreenshotLabel, 2, 2); - InputLayout->addWidget(ScreenshotEdit, 2, 3); - InputLayout->addWidget(MultipleAssignCheckBox, 3, 2); + QGridLayout *InputLayout = new QGridLayout; + InputLayout->addWidget(StartLabel, 0, 0); + InputLayout->addWidget(StartEdit, 0, 1); + InputLayout->addWidget(SelectLabel, 1, 0); + InputLayout->addWidget(SelectEdit, 1, 1); + InputLayout->addWidget(UpLabel, 2, 0); + InputLayout->addWidget(UpEdit, 2, 1); + InputLayout->addWidget(DownLabel, 3, 0); + InputLayout->addWidget(DownEdit, 3, 1); + InputLayout->addWidget(LeftLabel, 4, 0); + InputLayout->addWidget(LeftEdit, 4, 1); + InputLayout->addWidget(RightLabel, 5, 0); + InputLayout->addWidget(RightEdit, 5, 1); + InputLayout->addWidget(ALabel, 6, 0); + InputLayout->addWidget(AEdit, 6, 1); + InputLayout->addWidget(BLabel, 7, 0); + InputLayout->addWidget(BEdit, 7, 1); + InputLayout->addWidget(LLabel, 8, 0); + InputLayout->addWidget(LEdit, 8, 1); + InputLayout->addWidget(RLabel, 9, 0); + InputLayout->addWidget(REdit, 9, 1); + InputLayout->addWidget(GSLabel, 0, 2); + InputLayout->addWidget(GSEdit, 0, 3); + InputLayout->addWidget(SpeedUpLabel, 1, 2); + InputLayout->addWidget(SpeedUpEdit, 1, 3); + InputLayout->addWidget(ScreenshotLabel, 2, 2); + InputLayout->addWidget(ScreenshotEdit, 2, 3); + InputLayout->addWidget(MultipleAssignCheckBox, 3, 2); + InputGroup->setLayout(InputLayout); - InputGroup->setLayout(InputLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(InputGroup); - mainLayout->addSpacing(12); - mainLayout->addStretch(1); - setLayout(mainLayout); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(InputGroup); + mainLayout->addSpacing(12); + mainLayout->addStretch(1); + setLayout(mainLayout); } @@ -203,37 +202,45 @@ SoundOptionsPage::SoundOptionsPage(QWidget *parent) SRCombo->addItem("44100 Hz"); SRCombo->addItem("48000 Hz"); - QHBoxLayout *APILayout = new QHBoxLayout; APILayout->addWidget(APILabel); APILayout->addWidget(APICombo); - + QHBoxLayout *SRLayout = new QHBoxLayout; SRLayout->addWidget(SRLabel); SRLayout->addWidget(SRCombo); QCheckBox *SoundSyncCheckBox = new QCheckBox(tr("Sync game to audio")); - QCheckBox *MuteAudioCheckBox = new QCheckBox(tr("Mute audio")); - QCheckBox *InterpolateCheckBox = new QCheckBox(tr("Interpolate audio")); + QCheckBox *MuteAudioCheckBox = new QCheckBox(tr("Mute audio")); + QCheckBox *InterpolateCheckBox = new QCheckBox(tr("Interpolate audio")); QCheckBox *EchoCheckBox = new QCheckBox(tr("GB audio echo")); - QGridLayout *CheckLayout = new QGridLayout; CheckLayout->addWidget(SoundSyncCheckBox, 3, 2); CheckLayout->addWidget(MuteAudioCheckBox, 4, 2); CheckLayout->addWidget(InterpolateCheckBox, 5, 2); CheckLayout->addWidget(EchoCheckBox, 6, 2); - QVBoxLayout *configLayout = new QVBoxLayout; configLayout->addLayout(APILayout); configLayout->addLayout(SRLayout); configLayout->addLayout(CheckLayout); SoundGroup->setLayout(configLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(SoundGroup); - mainLayout->addStretch(1); - setLayout(mainLayout); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(SoundGroup); + mainLayout->addStretch(1); + setLayout(mainLayout); } + +DirecOptionsPage::DirecOptionsPage(QWidget *parent) +: QWidget(parent) +{ + QGroupBox *FolderGroup = new QGroupBox(tr("Directory Options")); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(FolderGroup); + mainLayout->addStretch(1); + setLayout(mainLayout); +} + diff --git a/src/qt/MainOptions.h b/src/qt/MainOptions.h index af777d88..6323e07d 100644 --- a/src/qt/MainOptions.h +++ b/src/qt/MainOptions.h @@ -45,4 +45,12 @@ public: SoundOptionsPage(QWidget *parent = 0); }; +class DirecOptionsPage : public QWidget +{ + Q_OBJECT + +public: + DirecOptionsPage(QWidget *parent = 0); +}; + #endif diff --git a/src/qt/configdialog.cpp b/src/qt/configdialog.cpp index 542badf9..0f86696d 100644 --- a/src/qt/configdialog.cpp +++ b/src/qt/configdialog.cpp @@ -32,6 +32,8 @@ ConfigDialog::ConfigDialog() pagesWidget->addWidget( new VideoOptionsPage( pagesWidget ) ); pagesWidget->addWidget( new SoundOptionsPage( pagesWidget ) ); pagesWidget->addWidget( new InputOptionsPage( pagesWidget ) ); + //pagesWidget->addWidget( new DirecOptionsPage( pagesWidget ) ); + //mudlord: I need to work this shit out......Yuck. // item box contentsWidget = new QListWidget; @@ -58,7 +60,6 @@ ConfigDialog::ConfigDialog() horizontalLayout->addWidget( contentsWidget ); horizontalLayout->addLayout( verticalLayout ); - setWindowTitle(tr("Options")); setWindowIcon( QIcon( ":/resources/settings.png" ) ); } @@ -83,6 +84,12 @@ void ConfigDialog::createIcons() InputButton->setTextAlignment(Qt::AlignHCenter); InputButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + /*QListWidgetItem *DirecButton = new QListWidgetItem(contentsWidget); + DirecButton->setIcon(QIcon(":/resources/folder-orange.png")); + DirecButton->setText(tr("Directory")); + DirecButton->setTextAlignment(Qt::AlignHCenter); + DirecButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);*/ + connect(contentsWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); diff --git a/src/qt/resources/folder-orange.png b/src/qt/resources/folder-orange.png new file mode 100644 index 0000000000000000000000000000000000000000..b3adc7d8cd8c2a6b68d76d807cc57dd66484b689 GIT binary patch literal 1202 zcmV;j1Wo&iP)QWHgxauDuh<||lx^Uq}tOy06g1Qvk=t4vgiHOkBCZ#oLI_J*Zd(P*V_THJBOpt_b znltk-FLMWG^FDmv8Ri#N6|;<3<^tvdW*CnH*!kw2OGSU>L(-qaq0k3$6t1VR{qgdf zU;T<>#DRz4@cZ|FUwG<;b2uWyts6JWt($8rZ(aNOSg!!VbI^#RX5rN8^NS}}uWfz3 zcHx+x0jVu@bO|eGOv33#!ZBTe(Rc4@@6;+Dhw8yyXdK~*Ky^@u?a!9hu6}T+LlD|b zz++G>t>6h_3B=H65V1Wg8;RU98rem0vgMD^!E>6@XnR9 zw_MQ|qzX_4NKlH?S@uuWCR(IGtU~hf-g*T`hYnKYIRL2&H9Ewo(Ss~WSw;s^kRj8( zm`YDDObg&l2p}|g2nQ6wEKI=uo{%)~Pzl&yI8Oo7y{x+@QBLp1jI01rdN>~_GBqk$ zvcH#g_oN??4qb>$1?=xh3_Qh`AZPLnps@7fT$t)l&V&GQ2%gRdGR?*rpi?jR!Hbvx z)aXLY$OO;_PbmU4VGlF10%Q@q^CloxGjRw~6kVJ%0d&PSk|Us+{RBYvj=6RB;@n1x zp3v0MLu3ir9S81q_jJ8YaYJgVJMD=)Q36mH6i-@rZ``hHFVGZQ0g5~!*cBkV-91k( z-)2=3-3ib<70^HfUBQRlRTcG@uin&ZfCjIsr!y6>0U*L)u>}A2PtSQ66c-@UM@ve` z5sDDTxU(@4z*c}#DH*Q-4-i0CqAjgTGSdlw03_PZV*x5|0FkD@5=oIGDnbKoXHHh2 z2%u}924$WCNH-P$DLO0QdnMvx(?5~XAxG%^ik)4sGX& zfTBMD*$AkKSY;}pHxb|$2NMB)sRRo=B-Q{&$P&LRz&A3A?h5n+++ri3BI=9Uu)I&^)L^cLE0R%>>X3q=zhVg`oZFzb-pxfVgtJ8x(1-^Mm5X z-K_IO0Cfkcf~qpbk<(n?3~6+X1r3FD9t*hlZ@GT*g!bx~B#tVVRAINQAORtr)8T@5 zlJ4&e*Pm{GDogU&->zQ1_Trfn7X-SX$P-!;IQ-}K{a;?W_{o~8ZjJ>2c-?Z=vTW&D z#6skOT9RdC8Cd?XT;CPo@rZ59kCqL~s^u9=-y+C^WC@nLmRpuTEn9njEl$!mr57xP z#bxptxi07*qoM6N<$f{RNW9RL6T literal 0 HcmV?d00001