Fixed up Qt4 project file

Started preliminary Qt4 directory dialog in options
This commit is contained in:
mudlord 2008-05-16 02:40:47 +00:00
parent 9720e3ec10
commit f0e786aed0
5 changed files with 124 additions and 102 deletions

View File

@ -2,7 +2,7 @@ TEMPLATE = app
CONFIG += qt release CONFIG += qt release
QT += opengl QT += opengl
TARGET = VisualBoyAdvance TARGET = VisualBoyAdvance
DEFINES += BKPT_SUPPORT DEFINES += BKPT_SUPPORT NO_PNG
# Directory Locations # Directory Locations
M_DIR_QT = ../../src/qt/ M_DIR_QT = ../../src/qt/

View File

@ -21,16 +21,16 @@
VideoOptionsPage::VideoOptionsPage(QWidget *parent) VideoOptionsPage::VideoOptionsPage(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QGroupBox *RenderGroup = new QGroupBox(tr("Renderer Options")); QGroupBox *RenderGroup = new QGroupBox(tr("Renderer Options"));
QLabel *RenderLabel = new QLabel(tr("Renderer:")); QLabel *RenderLabel = new QLabel(tr("Renderer:"));
QComboBox *RenderCombo = new QComboBox; QComboBox *RenderCombo = new QComboBox;
RenderCombo->addItem("OpenGL"); RenderCombo->addItem("OpenGL");
RenderCombo->addItem("QPainter"); RenderCombo->addItem("QPainter");
QLabel *ResLabel = new QLabel(tr("Resolution:")); QLabel *ResLabel = new QLabel(tr("Resolution:"));
QComboBox *ResCombo = new QComboBox; QComboBox *ResCombo = new QComboBox;
ResCombo->addItem("320x200"); ResCombo->addItem("320x200");
ResCombo->addItem("320x240"); ResCombo->addItem("320x240");
ResCombo->addItem("400x300"); ResCombo->addItem("400x300");
ResCombo->addItem("512x384"); ResCombo->addItem("512x384");
ResCombo->addItem("640x480"); ResCombo->addItem("640x480");
@ -40,8 +40,8 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent)
QLabel *SWFilterLabel = new QLabel(tr("Software Filter:")); QLabel *SWFilterLabel = new QLabel(tr("Software Filter:"));
QComboBox *SWFilterCombo = new QComboBox; QComboBox *SWFilterCombo = new QComboBox;
SWFilterCombo->addItem("2xSai"); SWFilterCombo->addItem("2xSai");
SWFilterCombo->addItem("HQ2X"); SWFilterCombo->addItem("HQ2X");
SWFilterCombo->addItem("HQ3X"); SWFilterCombo->addItem("HQ3X");
SWFilterCombo->addItem("HQ4X"); SWFilterCombo->addItem("HQ4X");
SWFilterCombo->addItem("Super Eagle"); SWFilterCombo->addItem("Super Eagle");
@ -50,24 +50,24 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent)
QLabel *HWFilterLabel = new QLabel(tr("Hardware Filter:")); QLabel *HWFilterLabel = new QLabel(tr("Hardware Filter:"));
QComboBox *HWFilterCombo = new QComboBox; QComboBox *HWFilterCombo = new QComboBox;
HWFilterCombo->addItem("Nearest"); HWFilterCombo->addItem("Nearest");
HWFilterCombo->addItem("Bilinear"); HWFilterCombo->addItem("Bilinear");
QHBoxLayout *RenderLayout = new QHBoxLayout; QHBoxLayout *RenderLayout = new QHBoxLayout;
RenderLayout->addWidget(RenderLabel); RenderLayout->addWidget(RenderLabel);
RenderLayout->addWidget(RenderCombo); RenderLayout->addWidget(RenderCombo);
QHBoxLayout *ResLayout = new QHBoxLayout; QHBoxLayout *ResLayout = new QHBoxLayout;
ResLayout->addWidget(ResLabel); ResLayout->addWidget(ResLabel);
ResLayout->addWidget(ResCombo); ResLayout->addWidget(ResCombo);
QHBoxLayout *SWFilterLayout = new QHBoxLayout; QHBoxLayout *SWFilterLayout = new QHBoxLayout;
SWFilterLayout->addWidget(SWFilterLabel); SWFilterLayout->addWidget(SWFilterLabel);
SWFilterLayout->addWidget(SWFilterCombo); SWFilterLayout->addWidget(SWFilterCombo);
QHBoxLayout *HWFilterLayout = new QHBoxLayout; QHBoxLayout *HWFilterLayout = new QHBoxLayout;
HWFilterLayout->addWidget(HWFilterLabel); HWFilterLayout->addWidget(HWFilterLabel);
HWFilterLayout->addWidget(HWFilterCombo); HWFilterLayout->addWidget(HWFilterCombo);
QCheckBox *TripleBufCheckBox = new QCheckBox(tr("Triple Buffering")); QCheckBox *TripleBufCheckBox = new QCheckBox(tr("Triple Buffering"));
QCheckBox *VerticalSyncCheckBox = new QCheckBox(tr("Vertical Sync")); QCheckBox *VerticalSyncCheckBox = new QCheckBox(tr("Vertical Sync"));
@ -79,107 +79,106 @@ VideoOptionsPage::VideoOptionsPage(QWidget *parent)
CheckLayout->addWidget(VerticalSyncCheckBox, 4, 2); CheckLayout->addWidget(VerticalSyncCheckBox, 4, 2);
CheckLayout->addWidget(DisableStatCheckBox, 5, 2); CheckLayout->addWidget(DisableStatCheckBox, 5, 2);
QVBoxLayout *configLayout = new QVBoxLayout; QVBoxLayout *configLayout = new QVBoxLayout;
configLayout->addLayout(RenderLayout); configLayout->addLayout(RenderLayout);
configLayout->addLayout(ResLayout); configLayout->addLayout(ResLayout);
configLayout->addLayout(HWFilterLayout); configLayout->addLayout(HWFilterLayout);
configLayout->addLayout(SWFilterLayout); configLayout->addLayout(SWFilterLayout);
configLayout->addLayout(CheckLayout); configLayout->addLayout(CheckLayout);
RenderGroup->setLayout(configLayout); RenderGroup->setLayout(configLayout);
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(RenderGroup); mainLayout->addWidget(RenderGroup);
mainLayout->addStretch(1); mainLayout->addStretch(1);
setLayout(mainLayout); setLayout(mainLayout);
} }
InputOptionsPage::InputOptionsPage(QWidget *parent) InputOptionsPage::InputOptionsPage(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QGroupBox *InputGroup = new QGroupBox(tr("Input Keys")); QGroupBox *InputGroup = new QGroupBox(tr("Input Keys"));
QLabel *StartLabel = new QLabel(tr("Start:")); QLabel *StartLabel = new QLabel(tr("Start:"));
QLineEdit *StartEdit = new QLineEdit; QLineEdit *StartEdit = new QLineEdit;
QLabel *SelectLabel = new QLabel(tr("Select:")); QLabel *SelectLabel = new QLabel(tr("Select:"));
QLineEdit *SelectEdit = new QLineEdit; QLineEdit *SelectEdit = new QLineEdit;
QLabel *UpLabel = new QLabel(tr("Up:")); QLabel *UpLabel = new QLabel(tr("Up:"));
QLineEdit *UpEdit = new QLineEdit; QLineEdit *UpEdit = new QLineEdit;
QLabel *DownLabel = new QLabel(tr("Down:")); QLabel *DownLabel = new QLabel(tr("Down:"));
QLineEdit *DownEdit = new QLineEdit; QLineEdit *DownEdit = new QLineEdit;
QLabel *LeftLabel = new QLabel(tr("Left:")); QLabel *LeftLabel = new QLabel(tr("Left:"));
QLineEdit *LeftEdit = new QLineEdit; QLineEdit *LeftEdit = new QLineEdit;
QLabel *RightLabel = new QLabel(tr("Right:")); QLabel *RightLabel = new QLabel(tr("Right:"));
QLineEdit *RightEdit = new QLineEdit; QLineEdit *RightEdit = new QLineEdit;
QLabel *ALabel = new QLabel(tr("A:")); QLabel *ALabel = new QLabel(tr("A:"));
QLineEdit *AEdit = new QLineEdit; QLineEdit *AEdit = new QLineEdit;
QLabel *BLabel = new QLabel(tr("B:")); QLabel *BLabel = new QLabel(tr("B:"));
QLineEdit *BEdit = new QLineEdit; QLineEdit *BEdit = new QLineEdit;
QLabel *LLabel = new QLabel(tr("L:")); QLabel *LLabel = new QLabel(tr("L:"));
QLineEdit *LEdit = new QLineEdit; QLineEdit *LEdit = new QLineEdit;
QLabel *RLabel = new QLabel(tr("R:")); QLabel *RLabel = new QLabel(tr("R:"));
QLineEdit *REdit = new QLineEdit; QLineEdit *REdit = new QLineEdit;
QLabel *GSLabel = new QLabel(tr("Gameshark:")); QLabel *GSLabel = new QLabel(tr("Gameshark:"));
QLineEdit *GSEdit = new QLineEdit; QLineEdit *GSEdit = new QLineEdit;
QLabel *SpeedUpLabel = new QLabel(tr("Speed Up:")); QLabel *SpeedUpLabel = new QLabel(tr("Speed Up:"));
QLineEdit *SpeedUpEdit = new QLineEdit; QLineEdit *SpeedUpEdit = new QLineEdit;
QLabel *ScreenshotLabel = new QLabel(tr("Screenshot:")); QLabel *ScreenshotLabel = new QLabel(tr("Screenshot:"));
QLineEdit *ScreenshotEdit = new QLineEdit; QLineEdit *ScreenshotEdit = new QLineEdit;
QCheckBox *MultipleAssignCheckBox = new QCheckBox(tr("Multiple key assignments")); QCheckBox *MultipleAssignCheckBox = new QCheckBox(tr("Multiple key assignments"));
QGridLayout *InputLayout = new QGridLayout; QGridLayout *InputLayout = new QGridLayout;
InputLayout->addWidget(StartLabel, 0, 0); InputLayout->addWidget(StartLabel, 0, 0);
InputLayout->addWidget(StartEdit, 0, 1); InputLayout->addWidget(StartEdit, 0, 1);
InputLayout->addWidget(SelectLabel, 1, 0); InputLayout->addWidget(SelectLabel, 1, 0);
InputLayout->addWidget(SelectEdit, 1, 1); InputLayout->addWidget(SelectEdit, 1, 1);
InputLayout->addWidget(UpLabel, 2, 0); InputLayout->addWidget(UpLabel, 2, 0);
InputLayout->addWidget(UpEdit, 2, 1); InputLayout->addWidget(UpEdit, 2, 1);
InputLayout->addWidget(DownLabel, 3, 0); InputLayout->addWidget(DownLabel, 3, 0);
InputLayout->addWidget(DownEdit, 3, 1); InputLayout->addWidget(DownEdit, 3, 1);
InputLayout->addWidget(LeftLabel, 4, 0); InputLayout->addWidget(LeftLabel, 4, 0);
InputLayout->addWidget(LeftEdit, 4, 1); InputLayout->addWidget(LeftEdit, 4, 1);
InputLayout->addWidget(RightLabel, 5, 0); InputLayout->addWidget(RightLabel, 5, 0);
InputLayout->addWidget(RightEdit, 5, 1); InputLayout->addWidget(RightEdit, 5, 1);
InputLayout->addWidget(ALabel, 6, 0); InputLayout->addWidget(ALabel, 6, 0);
InputLayout->addWidget(AEdit, 6, 1); InputLayout->addWidget(AEdit, 6, 1);
InputLayout->addWidget(BLabel, 7, 0); InputLayout->addWidget(BLabel, 7, 0);
InputLayout->addWidget(BEdit, 7, 1); InputLayout->addWidget(BEdit, 7, 1);
InputLayout->addWidget(LLabel, 8, 0); InputLayout->addWidget(LLabel, 8, 0);
InputLayout->addWidget(LEdit, 8, 1); InputLayout->addWidget(LEdit, 8, 1);
InputLayout->addWidget(RLabel, 9, 0); InputLayout->addWidget(RLabel, 9, 0);
InputLayout->addWidget(REdit, 9, 1); InputLayout->addWidget(REdit, 9, 1);
InputLayout->addWidget(GSLabel, 0, 2); InputLayout->addWidget(GSLabel, 0, 2);
InputLayout->addWidget(GSEdit, 0, 3); InputLayout->addWidget(GSEdit, 0, 3);
InputLayout->addWidget(SpeedUpLabel, 1, 2); InputLayout->addWidget(SpeedUpLabel, 1, 2);
InputLayout->addWidget(SpeedUpEdit, 1, 3); InputLayout->addWidget(SpeedUpEdit, 1, 3);
InputLayout->addWidget(ScreenshotLabel, 2, 2); InputLayout->addWidget(ScreenshotLabel, 2, 2);
InputLayout->addWidget(ScreenshotEdit, 2, 3); InputLayout->addWidget(ScreenshotEdit, 2, 3);
InputLayout->addWidget(MultipleAssignCheckBox, 3, 2); InputLayout->addWidget(MultipleAssignCheckBox, 3, 2);
InputGroup->setLayout(InputLayout);
InputGroup->setLayout(InputLayout); QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(InputGroup);
QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addSpacing(12);
mainLayout->addWidget(InputGroup); mainLayout->addStretch(1);
mainLayout->addSpacing(12); setLayout(mainLayout);
mainLayout->addStretch(1);
setLayout(mainLayout);
} }
@ -203,7 +202,6 @@ SoundOptionsPage::SoundOptionsPage(QWidget *parent)
SRCombo->addItem("44100 Hz"); SRCombo->addItem("44100 Hz");
SRCombo->addItem("48000 Hz"); SRCombo->addItem("48000 Hz");
QHBoxLayout *APILayout = new QHBoxLayout; QHBoxLayout *APILayout = new QHBoxLayout;
APILayout->addWidget(APILabel); APILayout->addWidget(APILabel);
APILayout->addWidget(APICombo); APILayout->addWidget(APICombo);
@ -213,27 +211,36 @@ SoundOptionsPage::SoundOptionsPage(QWidget *parent)
SRLayout->addWidget(SRCombo); SRLayout->addWidget(SRCombo);
QCheckBox *SoundSyncCheckBox = new QCheckBox(tr("Sync game to audio")); QCheckBox *SoundSyncCheckBox = new QCheckBox(tr("Sync game to audio"));
QCheckBox *MuteAudioCheckBox = new QCheckBox(tr("Mute audio")); QCheckBox *MuteAudioCheckBox = new QCheckBox(tr("Mute audio"));
QCheckBox *InterpolateCheckBox = new QCheckBox(tr("Interpolate audio")); QCheckBox *InterpolateCheckBox = new QCheckBox(tr("Interpolate audio"));
QCheckBox *EchoCheckBox = new QCheckBox(tr("GB audio echo")); QCheckBox *EchoCheckBox = new QCheckBox(tr("GB audio echo"));
QGridLayout *CheckLayout = new QGridLayout; QGridLayout *CheckLayout = new QGridLayout;
CheckLayout->addWidget(SoundSyncCheckBox, 3, 2); CheckLayout->addWidget(SoundSyncCheckBox, 3, 2);
CheckLayout->addWidget(MuteAudioCheckBox, 4, 2); CheckLayout->addWidget(MuteAudioCheckBox, 4, 2);
CheckLayout->addWidget(InterpolateCheckBox, 5, 2); CheckLayout->addWidget(InterpolateCheckBox, 5, 2);
CheckLayout->addWidget(EchoCheckBox, 6, 2); CheckLayout->addWidget(EchoCheckBox, 6, 2);
QVBoxLayout *configLayout = new QVBoxLayout; QVBoxLayout *configLayout = new QVBoxLayout;
configLayout->addLayout(APILayout); configLayout->addLayout(APILayout);
configLayout->addLayout(SRLayout); configLayout->addLayout(SRLayout);
configLayout->addLayout(CheckLayout); configLayout->addLayout(CheckLayout);
SoundGroup->setLayout(configLayout); SoundGroup->setLayout(configLayout);
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(SoundGroup);
mainLayout->addWidget(SoundGroup); mainLayout->addStretch(1);
mainLayout->addStretch(1); setLayout(mainLayout);
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);
}

View File

@ -45,4 +45,12 @@ public:
SoundOptionsPage(QWidget *parent = 0); SoundOptionsPage(QWidget *parent = 0);
}; };
class DirecOptionsPage : public QWidget
{
Q_OBJECT
public:
DirecOptionsPage(QWidget *parent = 0);
};
#endif #endif

View File

@ -32,6 +32,8 @@ ConfigDialog::ConfigDialog()
pagesWidget->addWidget( new VideoOptionsPage( pagesWidget ) ); pagesWidget->addWidget( new VideoOptionsPage( pagesWidget ) );
pagesWidget->addWidget( new SoundOptionsPage( pagesWidget ) ); pagesWidget->addWidget( new SoundOptionsPage( pagesWidget ) );
pagesWidget->addWidget( new InputOptionsPage( pagesWidget ) ); pagesWidget->addWidget( new InputOptionsPage( pagesWidget ) );
//pagesWidget->addWidget( new DirecOptionsPage( pagesWidget ) );
//mudlord: I need to work this shit out......Yuck.
// item box // item box
contentsWidget = new QListWidget; contentsWidget = new QListWidget;
@ -58,7 +60,6 @@ ConfigDialog::ConfigDialog()
horizontalLayout->addWidget( contentsWidget ); horizontalLayout->addWidget( contentsWidget );
horizontalLayout->addLayout( verticalLayout ); horizontalLayout->addLayout( verticalLayout );
setWindowTitle(tr("Options")); setWindowTitle(tr("Options"));
setWindowIcon( QIcon( ":/resources/settings.png" ) ); setWindowIcon( QIcon( ":/resources/settings.png" ) );
} }
@ -83,6 +84,12 @@ void ConfigDialog::createIcons()
InputButton->setTextAlignment(Qt::AlignHCenter); InputButton->setTextAlignment(Qt::AlignHCenter);
InputButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); 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, connect(contentsWidget,
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*)));

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB