ADDED basic cheat sidebar
This commit is contained in:
spacy51 2008-02-10 15:32:44 +00:00
parent 667fb7a175
commit 54c9174f7c
9 changed files with 270 additions and 61 deletions

View File

@ -61,97 +61,97 @@
<context>
<name>MainWnd</name>
<message>
<location filename="../src/qt/MainWnd.cpp" line="36"/>
<location filename="../src/qt/MainWnd.cpp" line="38"/>
<source>VBA-M</source>
<translation></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="90"/>
<location filename="../src/qt/MainWnd.cpp" line="93"/>
<source>&amp;File</source>
<translation>&amp;Datei</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="95"/>
<location filename="../src/qt/MainWnd.cpp" line="98"/>
<source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="101"/>
<location filename="../src/qt/MainWnd.cpp" line="104"/>
<source>&amp;Tools</source>
<translation>&amp;Werkzeuge</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="105"/>
<location filename="../src/qt/MainWnd.cpp" line="108"/>
<source>&amp;Help</source>
<translation>&amp;Hilfe</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="108"/>
<location filename="../src/qt/MainWnd.cpp" line="111"/>
<source>About &amp;OpenGL...</source>
<translation>Über &amp;OpenGL...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="107"/>
<location filename="../src/qt/MainWnd.cpp" line="110"/>
<source>About &amp;VBA-M...</source>
<translation>Über &amp;VBA-M...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="109"/>
<location filename="../src/qt/MainWnd.cpp" line="112"/>
<source>About &amp;Qt...</source>
<translation>Über &amp;Qt...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="191"/>
<location filename="../src/qt/MainWnd.cpp" line="210"/>
<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="205"/>
<location filename="../src/qt/MainWnd.cpp" line="229"/>
<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="208"/>
<location filename="../src/qt/MainWnd.cpp" line="232"/>
<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="211"/>
<location filename="../src/qt/MainWnd.cpp" line="235"/>
<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="214"/>
<location filename="../src/qt/MainWnd.cpp" line="238"/>
<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="217"/>
<location filename="../src/qt/MainWnd.cpp" line="241"/>
<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="220"/>
<location filename="../src/qt/MainWnd.cpp" line="244"/>
<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="223"/>
<location filename="../src/qt/MainWnd.cpp" line="247"/>
<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="229"/>
<location filename="../src/qt/MainWnd.cpp" line="253"/>
<source>OpenGL is NOT available!</source>
<translation>OpenGL ist NICHT verfügbar!</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="190"/>
<location filename="../src/qt/MainWnd.cpp" line="215"/>
<source>About VBA-M</source>
<translation>Über VBA-M</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="232"/>
<location filename="../src/qt/MainWnd.cpp" line="256"/>
<source>About OpenGL</source>
<translation>Über OpenGL</translation>
</message>
@ -171,44 +171,74 @@
<translation type="obsolete">Übersetzungsdateien (*.qm)</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="146"/>
<location filename="../src/qt/MainWnd.cpp" line="164"/>
<source>.qm</source>
<translation></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="91"/>
<location filename="../src/qt/MainWnd.cpp" line="94"/>
<source>Exit</source>
<translation>Beenden</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="96"/>
<location filename="../src/qt/MainWnd.cpp" line="99"/>
<source>Select language...</source>
<translation>Sprache auswählen...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="129"/>
<location filename="../src/qt/MainWnd.cpp" line="147"/>
<source>Select language</source>
<translation>Sprache auswählen</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="131"/>
<location filename="../src/qt/MainWnd.cpp" line="149"/>
<source>Language files (*.qm)</source>
<translation>Sprachdateien (*.qm)</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="139"/>
<location filename="../src/qt/MainWnd.cpp" line="157"/>
<source>Error!</source>
<translation>Fehler!</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="139"/>
<location filename="../src/qt/MainWnd.cpp" line="157"/>
<source>Language file can not be loaded!</source>
<translation>Sprachdatei kann nicht geladen werden!</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="59"/>
<location filename="../src/qt/MainWnd.cpp" line="62"/>
<source>Enable translation</source>
<translation>Übersetzung aktivieren</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="213"/>
<source>
No language file loaded.</source>
<translation>
Deutsche Übersetzung von spacy.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="123"/>
<source>Cheats</source>
<translation></translation>
</message>
</context>
<context>
<name>sidewidget_cheats</name>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="25"/>
<source>Enable</source>
<translation>Aktivieren</translation>
</message>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="32"/>
<source>Search...</source>
<translation>Suchen...</translation>
</message>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="19"/>
<source>Cheats</source>
<translation></translation>
</message>
</context>
</TS>

View File

@ -3,22 +3,22 @@
<context>
<name>MainWnd</name>
<message>
<location filename="../src/qt/MainWnd.cpp" line="36"/>
<location filename="../src/qt/MainWnd.cpp" line="38"/>
<source>VBA-M</source>
<translation>VBA-M</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="90"/>
<location filename="../src/qt/MainWnd.cpp" line="93"/>
<source>&amp;File</source>
<translation>&amp;Archivo</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="91"/>
<location filename="../src/qt/MainWnd.cpp" line="94"/>
<source>Exit</source>
<translation>Salir</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="95"/>
<location filename="../src/qt/MainWnd.cpp" line="98"/>
<source>&amp;Settings</source>
<translation>&amp;Ajustes</translation>
</message>
@ -28,27 +28,27 @@
<translation type="obsolete">Seleccione traducción...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="101"/>
<location filename="../src/qt/MainWnd.cpp" line="104"/>
<source>&amp;Tools</source>
<translation>&amp;Herramientas</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="105"/>
<location filename="../src/qt/MainWnd.cpp" line="108"/>
<source>&amp;Help</source>
<translation>&amp;Ayuda</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="107"/>
<location filename="../src/qt/MainWnd.cpp" line="110"/>
<source>About &amp;VBA-M...</source>
<translation>Sobre &amp;VBA-M...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="108"/>
<location filename="../src/qt/MainWnd.cpp" line="111"/>
<source>About &amp;OpenGL...</source>
<translation>Sobre &amp;OpenGL...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="109"/>
<location filename="../src/qt/MainWnd.cpp" line="112"/>
<source>About &amp;Qt...</source>
<translation>Sobre &amp;Qt...</translation>
</message>
@ -63,94 +63,123 @@
<translation type="obsolete">Archivos de traducción (*.qm)</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="146"/>
<location filename="../src/qt/MainWnd.cpp" line="164"/>
<source>.qm</source>
<translation>.qm</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="190"/>
<location filename="../src/qt/MainWnd.cpp" line="215"/>
<source>About VBA-M</source>
<translation>Sobre VBA-M</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="191"/>
<location filename="../src/qt/MainWnd.cpp" line="210"/>
<source>This program is licensed under terms of the GNU General Public License.</source>
<translation>Este programa se licencia bajo los términos de la Licencia Pública General GNU.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="205"/>
<location filename="../src/qt/MainWnd.cpp" line="229"/>
<source>OpenGL version 2.1 is present.</source>
<translation>OpenGL versión 2.1 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="208"/>
<location filename="../src/qt/MainWnd.cpp" line="232"/>
<source>OpenGL version 2.0 is present.</source>
<translation>OpenGL versión 2.0 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="211"/>
<location filename="../src/qt/MainWnd.cpp" line="235"/>
<source>OpenGL version 1.5 is present.</source>
<translation>OpenGL versión 1.5 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="214"/>
<location filename="../src/qt/MainWnd.cpp" line="238"/>
<source>OpenGL version 1.4 is present.</source>
<translation>OpenGL versión 1.4 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="217"/>
<location filename="../src/qt/MainWnd.cpp" line="241"/>
<source>OpenGL version 1.3 is present.</source>
<translation>OpenGL versión 1.3 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="220"/>
<location filename="../src/qt/MainWnd.cpp" line="244"/>
<source>OpenGL version 1.2 is present.</source>
<translation>OpenGL versión 1.2 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="223"/>
<location filename="../src/qt/MainWnd.cpp" line="247"/>
<source>OpenGL version 1.1 is present.</source>
<translation>OpenGL versión 1.1 está presente.</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="229"/>
<location filename="../src/qt/MainWnd.cpp" line="253"/>
<source>OpenGL is NOT available!</source>
<translation>¡OpenGL no está disponible!</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="232"/>
<location filename="../src/qt/MainWnd.cpp" line="256"/>
<source>About OpenGL</source>
<translation>Sobre OpenGL</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="96"/>
<location filename="../src/qt/MainWnd.cpp" line="99"/>
<source>Select language...</source>
<translation>Seleccione traducción...</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="129"/>
<location filename="../src/qt/MainWnd.cpp" line="147"/>
<source>Select language</source>
<translation>Seleccione traducción</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="131"/>
<location filename="../src/qt/MainWnd.cpp" line="149"/>
<source>Language files (*.qm)</source>
<translation>Archivos de traducción (*.qm)</translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="139"/>
<location filename="../src/qt/MainWnd.cpp" line="157"/>
<source>Error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="139"/>
<location filename="../src/qt/MainWnd.cpp" line="157"/>
<source>Language file can not be loaded!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="59"/>
<location filename="../src/qt/MainWnd.cpp" line="62"/>
<source>Enable translation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="213"/>
<source>
No language file loaded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="123"/>
<source>Cheats</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>sidewidget_cheats</name>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="25"/>
<source>Enable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="32"/>
<source>Search...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/sidewidget_cheats.ui" line="19"/>
<source>Cheats</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -3,6 +3,9 @@ CONFIG += qt release
QT += opengl
TARGET = VisualBoyAdvance
TRANSLATIONS += ../../lang/german.ts
TRANSLATIONS += ../../lang/spanish.ts
PRECOMPILED_HEADER = ../../src/qt/precompile.h
HEADERS += ../../src/qt/main.h
@ -14,5 +17,6 @@ SOURCES += ../../src/qt/MainWnd.cpp
HEADERS += ../../src/qt/glwidget.h
SOURCES += ../../src/qt/glwidget.cpp
TRANSLATIONS += ../../lang/german.ts
TRANSLATIONS += ../../lang/spanish.ts
FORMS += ../../src/qt/sidewidget_cheats.ui
HEADERS += ../../src/qt/sidewidget_cheats.h
SOURCES += ../../src/qt/sidewidget_cheats.cpp

View File

@ -29,7 +29,7 @@
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath=""
IncludeSearchPath="&quot;$(ProjectDir)&quot;"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
@ -49,7 +49,7 @@
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath=""
IncludeSearchPath="&quot;$(ProjectDir)&quot;"
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
@ -88,6 +88,26 @@
>
</File>
</Filter>
<Filter
Name="side widgets"
>
<Filter
Name="cheats"
>
<File
RelativePath="..\..\src\qt\sidewidget_cheats.cpp"
>
</File>
<File
RelativePath="..\..\src\qt\sidewidget_cheats.h"
>
</File>
<File
RelativePath="..\..\src\qt\sidewidget_cheats.ui"
>
</File>
</Filter>
</Filter>
</Filter>
<Filter
Name="Makefile"

View File

@ -19,6 +19,7 @@
#include "MainWnd.h"
#include "glwidget.h"
#include "sidewidget_cheats.h"
MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
: QMainWindow( parent ),
@ -28,7 +29,8 @@ MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
settingsMenu( 0 ),
toolsMenu( 0 ),
helpMenu( 0 ),
enableTranslationAct( 0 )
enableTranslationAct( 0 ),
dockWidget_cheats( 0 )
{
createDisplay();
@ -37,6 +39,7 @@ MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
createActions();
createMenus();
createDockWidgets();
}
MainWnd::~MainWnd()
@ -109,6 +112,21 @@ void MainWnd::createMenus()
helpMenu->addAction( tr( "About &Qt..." ), this, SLOT( showAboutQt() ) );
}
void MainWnd::createDockWidgets()
{
if( dockWidget_cheats != 0 ) {
delete dockWidget_cheats;
dockWidget_cheats = 0;
}
// Cheat Widget
dockWidget_cheats = new QDockWidget( tr( "Cheats" ), this );
SideWidget_Cheats *sw_cheats = new SideWidget_Cheats( dockWidget_cheats );
dockWidget_cheats->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
dockWidget_cheats->setWidget( sw_cheats );
addDockWidget( Qt::LeftDockWidgetArea, dockWidget_cheats );
}
bool MainWnd::createDisplay()
{
if( !QGLFormat::hasOpenGL() ) return false;
@ -182,13 +200,19 @@ bool MainWnd::enableTranslation( bool enable )
// the user might have to restart the application to apply changes completely
createActions();
createMenus();
createDockWidgets();
return true;
}
void MainWnd::showAbout()
{
QMessageBox::about( this, tr( "About VBA-M" ),
tr( "This program is licensed under terms of the GNU General Public License." ) );
QString info;
info += tr ( "This program is licensed under terms of the GNU General Public License." );
// translators may use this string to give informations about the language file
info += tr ( "\nNo language file loaded." );
QMessageBox::about( this, tr( "About VBA-M" ), info );
}
void MainWnd::showAboutQt()

View File

@ -35,6 +35,7 @@ public slots:
private:
void createActions();
void createMenus();
void createDockWidgets();
bool createDisplay();
QApplication *theApp;
@ -44,6 +45,7 @@ private:
QAction *enableTranslationAct;
QMenu *toolsMenu;
QMenu *helpMenu;
QDockWidget *dockWidget_cheats;
private slots:
bool selectLanguage();

View File

@ -0,0 +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 "sidewidget_cheats.h"
SideWidget_Cheats::SideWidget_Cheats( QWidget *parent )
: QWidget( parent )
{
ui.setupUi( this );
}

View File

@ -0,0 +1,36 @@
// 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 SIDEWIDGET_CHEAT_H
#define SIDEWIDGET_CHEAT_H
#include "precompile.h"
#include "ui_sidewidget_cheats.h"
class SideWidget_Cheats : public QWidget
{
Q_OBJECT
public:
SideWidget_Cheats( QWidget *parent = 0 );
private:
Ui::sidewidget_cheats ui;
};
#endif // #ifndef SIDEWIDGET_CHEAT_H

View File

@ -0,0 +1,40 @@
<ui version="4.0" >
<class>sidewidget_cheats</class>
<widget class="QWidget" name="sidewidget_cheats" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>143</width>
<height>126</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="windowTitle" >
<string>Cheats</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QCheckBox" name="enableCheatsCheckbox" >
<property name="text" >
<string>Enable</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="searchForCheatsButton" >
<property name="text" >
<string>Search...</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>