- Eye candy
- Code cleanup
This commit is contained in:
spacy51 2008-02-21 17:33:04 +00:00
parent ac1fe601d1
commit fc8a26841c
13 changed files with 28 additions and 26 deletions

View File

@ -143,11 +143,11 @@
</File>
<File
RelativePath="..\..\src\qt\vba-m.qrc"
FileType="13"
>
</File>
<File
RelativePath="..\..\src\qt\vba-m.rc"
FileType="5"
>
</File>
</Filter>

View File

@ -23,9 +23,8 @@
#include "sidewidget_cheats.h"
MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
MainWnd::MainWnd( QWidget *parent, QTranslator **trans )
: QMainWindow( parent ),
theApp( app ),
translator( trans ),
fileMenu( 0 ),
settingsMenu( 0 ),
@ -96,14 +95,14 @@ void MainWnd::createMenus()
// File menu
fileMenu = menuBar()->addMenu( tr( "&File" ) );
fileMenu->addAction( tr( "Open ROM" ), this, SLOT( showOpenROM() ) );
fileMenu->addAction( tr( "Exit" ), this, SLOT( close() ) );
fileMenu->addAction( QIcon( ":/resources/open.png" ), tr( "Open ROM" ), this, SLOT( showOpenROM() ) );
fileMenu->addAction( QIcon( ":/resources/exit.png" ), tr( "Exit" ), this, SLOT( close() ) );
// Settings menu
settingsMenu = menuBar()->addMenu( tr( "&Settings" ) );
settingsMenu->addAction( tr( "Main options..." ), this, SLOT( showMainOptions() ) );
settingsMenu->addAction( tr( "Select language..." ), this, SLOT( selectLanguage() ) );
settingsMenu->addAction( QIcon( ":/resources/settings.png" ), tr( "Main options..." ), this, SLOT( showMainOptions() ) );
settingsMenu->addAction( QIcon( ":/resources/locale.png" ), tr( "Select language..." ), this, SLOT( selectLanguage() ) );
settingsMenu->addAction( enableTranslationAct );
@ -117,9 +116,9 @@ void MainWnd::createMenus()
// Help menu
helpMenu = menuBar()->addMenu( tr( "&Help" ) );
helpMenu->addAction( tr( "About &VBA-M..." ), this, SLOT( showAbout() ) );
helpMenu->addAction( tr( "About &OpenGL..." ), this, SLOT( showAboutOpenGL() ) );
helpMenu->addAction( tr( "About &Qt..." ), this, SLOT( showAboutQt() ) );
helpMenu->addAction( QIcon( ":/resources/vba-m.png" ), tr( "About &VBA-M..." ), this, SLOT( showAbout() ) );
helpMenu->addAction( QIcon( ":/resources/gl.png" ), tr( "About &OpenGL..." ), this, SLOT( showAboutOpenGL() ) );
helpMenu->addAction( QIcon( ":/resources/qt_logo.png" ), tr( "About &Qt..." ), qApp, SLOT( aboutQt() ) );
}
@ -199,14 +198,14 @@ bool MainWnd::enableTranslation( bool enable )
{
if( enable ) {
if( *translator != 0 ) {
theApp->installTranslator( *translator );
qApp->installTranslator( *translator );
enableTranslationAct->setChecked( true );
} else {
return false;
}
} else {
if( *translator != 0 ) {
theApp->removeTranslator( *translator );
qApp->removeTranslator( *translator );
} else {
return false;
}
@ -233,11 +232,6 @@ void MainWnd::showAbout()
}
void MainWnd::showAboutQt()
{
QMessageBox::aboutQt( this );
}
void MainWnd::showOpenROM()
{
QString info;
@ -246,6 +240,7 @@ void MainWnd::showOpenROM()
QMessageBox::about( this, tr( "Status" ), info );
}
void MainWnd::showMainOptions()
{
ConfigDialog dialog;
@ -287,5 +282,6 @@ void MainWnd::showAboutOpenGL()
}
QMessageBox *test = new QMessageBox( QMessageBox::NoIcon, tr( "About OpenGL" ), info, QMessageBox::NoButton, this );
test->setWindowIcon( QIcon( ":/resources/gl.png" ) );
test->show();
}

View File

@ -26,7 +26,7 @@ class MainWnd : public QMainWindow
Q_OBJECT
public:
MainWnd( QWidget *parent = 0, QApplication *app = 0, QTranslator **trans = 0 );
MainWnd( QWidget *parent = 0, QTranslator **trans = 0 );
~MainWnd();
public slots:
@ -38,7 +38,6 @@ private:
void createDockWidgets();
bool createDisplay();
QApplication *theApp;
QTranslator **translator;
QMenu *fileMenu;
QMenu *settingsMenu;
@ -52,7 +51,6 @@ private slots:
bool enableTranslation( bool enable );
void showAbout();
void showAboutOpenGL();
void showAboutQt();
void showOpenROM();
void showMainOptions();
};

View File

@ -60,6 +60,7 @@ ConfigDialog::ConfigDialog()
setWindowTitle(tr("Options"));
setWindowIcon( QIcon( ":/resources/settings.png" ) );
}
void ConfigDialog::createIcons()

View File

@ -25,7 +25,7 @@ int main( int argc, char *argv[] )
QApplication theApp( argc, argv );
QTranslator *translator = 0;
MainWnd *mainWnd = new MainWnd( 0, &theApp, &translator );
MainWnd *mainWnd = new MainWnd( 0, &translator );
mainWnd->show();
return theApp.exec();

BIN
src/qt/resources/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

BIN
src/qt/resources/gl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

BIN
src/qt/resources/locale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

BIN
src/qt/resources/open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

BIN
src/qt/resources/vba-m.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View File

@ -3,5 +3,12 @@
<file>resources/video.png</file>
<file>resources/input.png</file>
<file>resources/sound.png</file>
<file>resources/exit.png</file>
<file>resources/locale.png</file>
<file>resources/settings.png</file>
<file>resources/open.png</file>
<file>resources/qt_logo.png</file>
<file>resources/gl.png</file>
<file>resources/vba-m.png</file>
</qresource>
</RCC>