QT:
USE precompiled header ADDED basic menu ADDED OpenGL frame ADDED german translation
This commit is contained in:
parent
4a61da3136
commit
3d2fe9980f
|
@ -1,11 +1,97 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS><TS version="1.1" language="de_DE">
|
||||
<defaultcodec></defaultcodec>
|
||||
<context>
|
||||
<name>QPushButton</name>
|
||||
<name>MainWnd</name>
|
||||
<message>
|
||||
<location filename="../src/qt/main.cpp" line="16"/>
|
||||
<source>Hello World!</source>
|
||||
<translation>Hallo Welt!</translation>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="73"/>
|
||||
<source>VBA-M</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="40"/>
|
||||
<source>&File</source>
|
||||
<translation>&Datei</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="41"/>
|
||||
<source>&Settings</source>
|
||||
<translation>&Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="42"/>
|
||||
<source>&Tools</source>
|
||||
<translation>&Werkzeuge</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="43"/>
|
||||
<source>&Help</source>
|
||||
<translation>&Hilfe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="45"/>
|
||||
<source>About &OpenGL...</source>
|
||||
<translation>Über &OpenGL...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="49"/>
|
||||
<source>About &VBA-M...</source>
|
||||
<translation>Über &VBA-M...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="53"/>
|
||||
<source>About &Qt...</source>
|
||||
<translation>Über &Qt...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="74"/>
|
||||
<source>This program is licensed under terms of the GNU General Public License.</source>
|
||||
<translation>Dieses Programm ist unter den Bedingungen der GNU General Public License lizenziert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="88"/>
|
||||
<source>OpenGL version 2.1 is present.</source>
|
||||
<translation>OpenGL Version 2.1 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="91"/>
|
||||
<source>OpenGL version 2.0 is present.</source>
|
||||
<translation>OpenGL Version 2.0 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="94"/>
|
||||
<source>OpenGL version 1.5 is present.</source>
|
||||
<translation>OpenGL Version 1.5 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="97"/>
|
||||
<source>OpenGL version 1.4 is present.</source>
|
||||
<translation>OpenGL Version 1.4 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="100"/>
|
||||
<source>OpenGL version 1.3 is present.</source>
|
||||
<translation>OpenGL Version 1.3 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="103"/>
|
||||
<source>OpenGL version 1.2 is present.</source>
|
||||
<translation>OpenGL Version 1.2 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="106"/>
|
||||
<source>OpenGL version 1.1 is present.</source>
|
||||
<translation>OpenGL Version 1.1 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="112"/>
|
||||
<source>OpenGL is NOT available!</source>
|
||||
<translation>OpenGL ist NICHT verfügbar!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/mainwnd.cpp" line="115"/>
|
||||
<source>OpenGL</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
TEMPLATE = app
|
||||
CONFIG += qt
|
||||
QT += opengl
|
||||
TARGET = VisualBoyAdvance
|
||||
|
||||
PRECOMPILED_HEADER = ../../src/qt/precompile.h
|
||||
|
||||
HEADERS += ../../src/qt/main.h
|
||||
SOURCES += ../../src/qt/main.cpp
|
||||
|
||||
HEADERS += ../../src/qt/mainwnd.h
|
||||
SOURCES += ../../src/qt/mainwnd.cpp
|
||||
|
||||
HEADERS += ../../src/qt/glwidget.h
|
||||
SOURCES += ../../src/qt/glwidget.cpp
|
||||
|
||||
TRANSLATIONS += ../../lang/german.ts
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="qmake -makefile -win32 -Wall ../qmake/vba-m.pro
nmake debug
lupdate ../qmake/vba-m.pro"
|
||||
BuildCommandLine="qmake -makefile -win32 -Wall ..\qmake\vba-m.pro
nmake debug
lupdate ..\qmake\vba-m.pro"
|
||||
ReBuildCommandLine=""
|
||||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release
"
|
||||
Output="$(OutDir)/VisualBoyAdvance.exe"
|
||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG"
|
||||
IncludeSearchPath=""
|
||||
ForcedIncludes=""
|
||||
|
@ -47,7 +47,7 @@
|
|||
BuildCommandLine="qmake -makefile -win32 -Wall ..\qmake\vba-m.pro
nmake release
upx -9 "$(TargetPath)"
lrelease ..\qmake\vba-m.pro
echo "Copying translation files to release directory..."
mkdir $(OutDir)\lang
copy /Y ..\..\lang\*.qm $(OutDir)\lang"
|
||||
ReBuildCommandLine=""
|
||||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release
"
|
||||
Output="$(OutDir)/VisualBoyAdvance.exe"
|
||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""
|
||||
ForcedIncludes=""
|
||||
|
@ -62,6 +62,7 @@
|
|||
<Files>
|
||||
<Filter
|
||||
Name="GUI"
|
||||
Filter="cpp;h"
|
||||
>
|
||||
<Filter
|
||||
Name="main"
|
||||
|
@ -75,6 +76,18 @@
|
|||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="MainWnd"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\qt\mainwnd.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\qt\mainwnd.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Makefile"
|
||||
|
@ -94,6 +107,26 @@
|
|||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Other"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\qt\precompile.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="OpenGL"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\qt\glwidget.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\qt\glwidget.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#include "mainwnd.h"
|
||||
|
||||
#include "glwidget.h"
|
||||
|
||||
MainWnd::MainWnd( QWidget *parent )
|
||||
: QMainWindow( parent )
|
||||
{
|
||||
createDisplay();
|
||||
|
||||
setMinimumSize( 320, 240 );
|
||||
setWindowTitle( tr( "VBA-M" ) );
|
||||
|
||||
createMenus();
|
||||
}
|
||||
|
||||
MainWnd::~MainWnd()
|
||||
{
|
||||
}
|
||||
|
||||
void MainWnd::createMenus()
|
||||
{
|
||||
QMenu *fileMenu = menuBar()->addMenu( tr( "&File" ) );
|
||||
QMenu *settingsMenu = menuBar()->addMenu( tr( "&Settings" ) );
|
||||
QMenu *toolsMenu = menuBar()->addMenu( tr( "&Tools" ) );
|
||||
QMenu *helpMenu = menuBar()->addMenu( tr( "&Help" ) );
|
||||
|
||||
QAction *showAboutOpenGLAct = new QAction( tr( "About &OpenGL..." ), this );
|
||||
connect( showAboutOpenGLAct, SIGNAL( triggered() ), this, SLOT( showAboutOpenGL() ) );
|
||||
helpMenu->addAction( showAboutOpenGLAct );
|
||||
|
||||
QAction *showAboutAct = new QAction( tr( "About &VBA-M..." ), this );
|
||||
connect( showAboutAct, SIGNAL( triggered() ), this, SLOT( showAbout() ) );
|
||||
helpMenu->addAction( showAboutAct );
|
||||
|
||||
QAction *showAboutQtAct = new QAction( tr( "About &Qt..." ), this );
|
||||
connect( showAboutQtAct, SIGNAL( triggered() ), this, SLOT( showAboutQt() ) );
|
||||
helpMenu->addAction( showAboutQtAct );
|
||||
}
|
||||
|
||||
bool MainWnd::createDisplay()
|
||||
{
|
||||
if( !QGLFormat::hasOpenGL() ) return false;
|
||||
|
||||
GLWidget *ogl = new GLWidget( this );
|
||||
if( ogl->isValid() ) {
|
||||
setCentralWidget( ogl );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainWnd::showAbout()
|
||||
{
|
||||
QMessageBox::about( this, tr( "VBA-M" ),
|
||||
tr( "This program is licensed under terms of the GNU General Public License." ) );
|
||||
}
|
||||
|
||||
void MainWnd::showAboutQt()
|
||||
{
|
||||
QMessageBox::aboutQt( this );
|
||||
}
|
||||
|
||||
void MainWnd::showAboutOpenGL()
|
||||
{
|
||||
QString info;
|
||||
if( QGLFormat::hasOpenGL() ) {
|
||||
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
|
||||
if( flags & QGLFormat::OpenGL_Version_2_1 ) {
|
||||
info = tr( "OpenGL version 2.1 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_2_0 ) {
|
||||
info = tr( "OpenGL version 2.0 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_1_5 ) {
|
||||
info = tr( "OpenGL version 1.5 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_1_4 ) {
|
||||
info = tr( "OpenGL version 1.4 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_1_3 ) {
|
||||
info = tr( "OpenGL version 1.3 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_1_2 ) {
|
||||
info = tr( "OpenGL version 1.2 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_1_1 ) {
|
||||
info = tr( "OpenGL version 1.1 is present." );
|
||||
} else
|
||||
if( flags & QGLFormat::OpenGL_Version_None ) {
|
||||
info = tr( "OpenGL is NOT available!" );
|
||||
}
|
||||
} else {
|
||||
info = tr( "OpenGL is NOT available!" );
|
||||
}
|
||||
|
||||
QMessageBox *test = new QMessageBox( QMessageBox::NoIcon, tr( "OpenGL" ), info, QMessageBox::NoButton, this );
|
||||
test->show();
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#ifndef MAINWND_H
|
||||
#define MAINWND_H
|
||||
|
||||
#include "precompile.h"
|
||||
|
||||
class MainWnd : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWnd::MainWnd( QWidget *parent = 0 );
|
||||
MainWnd::~MainWnd();
|
||||
|
||||
private:
|
||||
void createMenus();
|
||||
bool createDisplay();
|
||||
|
||||
private slots:
|
||||
void showAbout();
|
||||
void showAboutQt();
|
||||
void showAboutOpenGL();
|
||||
};
|
||||
|
||||
#endif // #ifndef MAINWND_H
|
|
@ -0,0 +1,42 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#include "glwidget.h"
|
||||
|
||||
GLWidget::GLWidget( QWidget *parent )
|
||||
: QGLWidget( parent )
|
||||
{
|
||||
}
|
||||
|
||||
GLWidget::~GLWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void GLWidget::initializeGL()
|
||||
{
|
||||
qglClearColor( QColor( 0xFF, 0x00, 0xFF ) );
|
||||
}
|
||||
|
||||
void GLWidget::paintGL()
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
}
|
||||
|
||||
void GLWidget::resizeGL( int width, int height )
|
||||
{
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#ifndef GL_WIDGET_H
|
||||
#define GL_WIDGET_H
|
||||
|
||||
#include "precompile.h"
|
||||
|
||||
class GLWidget : public QGLWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GLWidget( QWidget *parent = 0 );
|
||||
~GLWidget();
|
||||
|
||||
protected:
|
||||
void initializeGL();
|
||||
void paintGL();
|
||||
void resizeGL( int width, int height );
|
||||
};
|
||||
|
||||
#endif // #ifndef GL_WIDGET_H
|
|
@ -1,9 +1,24 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPushButton>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "mainwnd.h"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
|
@ -13,9 +28,8 @@ int main( int argc, char *argv[] )
|
|||
translator.load( "lang/german" );
|
||||
theApp.installTranslator( &translator );
|
||||
|
||||
QPushButton hello( QPushButton::tr( "Hello World!" ) );
|
||||
hello.resize( 192, 48 );
|
||||
hello.show();
|
||||
MainWnd *mainWnd = new MainWnd();
|
||||
mainWnd->show();
|
||||
|
||||
return theApp.exec();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
|
||||
#include "precompile.h"
|
||||
|
||||
#endif // #ifndef MAIN_H
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// VBA-M, A Nintendo Handheld Console Emulator
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#ifndef PRECOMPILE_H
|
||||
#define PRECOMPILE_H
|
||||
|
||||
#if defined __cplusplus
|
||||
// Add C++ includes here
|
||||
#include <QtGui>
|
||||
#include <QtOpenGL>
|
||||
#endif
|
||||
|
||||
#endif // #ifndef PRECOMPILE_H
|
Loading…
Reference in New Issue