ADDED possibility to show/hide cheats sidebar

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@369 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2008-02-20 22:10:05 +00:00
parent b6cc37c047
commit 814e191201
3 changed files with 56 additions and 33 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="de_DE"> <!DOCTYPE TS><TS version="1.1" language="de_DE">
<defaultcodec></defaultcodec>
<context> <context>
<name>@default</name> <name>@default</name>
<message> <message>
@ -61,97 +62,97 @@
<context> <context>
<name>MainWnd</name> <name>MainWnd</name>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="38"/> <location filename="../src/qt/MainWnd.cpp" line="39"/>
<source>VBA-M</source> <source>VBA-M</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="93"/> <location filename="../src/qt/MainWnd.cpp" line="98"/>
<source>&amp;File</source> <source>&amp;File</source>
<translation>&amp;Datei</translation> <translation>&amp;Datei</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="98"/> <location filename="../src/qt/MainWnd.cpp" line="103"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation> <translation>&amp;Einstellungen</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="104"/> <location filename="../src/qt/MainWnd.cpp" line="109"/>
<source>&amp;Tools</source> <source>&amp;Tools</source>
<translation>&amp;Werkzeuge</translation> <translation>&amp;Werkzeuge</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="108"/> <location filename="../src/qt/MainWnd.cpp" line="116"/>
<source>&amp;Help</source> <source>&amp;Help</source>
<translation>&amp;Hilfe</translation> <translation>&amp;Hilfe</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="111"/> <location filename="../src/qt/MainWnd.cpp" line="119"/>
<source>About &amp;OpenGL...</source> <source>About &amp;OpenGL...</source>
<translation>Über &amp;OpenGL...</translation> <translation>Über &amp;OpenGL...</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="110"/> <location filename="../src/qt/MainWnd.cpp" line="118"/>
<source>About &amp;VBA-M...</source> <source>About &amp;VBA-M...</source>
<translation>Über &amp;VBA-M...</translation> <translation>Über &amp;VBA-M...</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="112"/> <location filename="../src/qt/MainWnd.cpp" line="120"/>
<source>About &amp;Qt...</source> <source>About &amp;Qt...</source>
<translation>Über &amp;Qt...</translation> <translation>Über &amp;Qt...</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="210"/> <location filename="../src/qt/MainWnd.cpp" line="225"/>
<source>This program is licensed under terms of the GNU General Public License.</source> <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> <translation>Dieses Programm ist unter den Bedingungen der GNU General Public License lizenziert.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="229"/> <location filename="../src/qt/MainWnd.cpp" line="246"/>
<source>OpenGL version 2.1 is present.</source> <source>OpenGL version 2.1 is present.</source>
<translation>OpenGL Version 2.1 ist verfügbar.</translation> <translation>OpenGL Version 2.1 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="232"/> <location filename="../src/qt/MainWnd.cpp" line="249"/>
<source>OpenGL version 2.0 is present.</source> <source>OpenGL version 2.0 is present.</source>
<translation>OpenGL Version 2.0 ist verfügbar.</translation> <translation>OpenGL Version 2.0 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="235"/> <location filename="../src/qt/MainWnd.cpp" line="252"/>
<source>OpenGL version 1.5 is present.</source> <source>OpenGL version 1.5 is present.</source>
<translation>OpenGL Version 1.5 ist verfügbar.</translation> <translation>OpenGL Version 1.5 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="238"/> <location filename="../src/qt/MainWnd.cpp" line="255"/>
<source>OpenGL version 1.4 is present.</source> <source>OpenGL version 1.4 is present.</source>
<translation>OpenGL Version 1.4 ist verfügbar.</translation> <translation>OpenGL Version 1.4 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="241"/> <location filename="../src/qt/MainWnd.cpp" line="258"/>
<source>OpenGL version 1.3 is present.</source> <source>OpenGL version 1.3 is present.</source>
<translation>OpenGL Version 1.3 ist verfügbar.</translation> <translation>OpenGL Version 1.3 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="244"/> <location filename="../src/qt/MainWnd.cpp" line="261"/>
<source>OpenGL version 1.2 is present.</source> <source>OpenGL version 1.2 is present.</source>
<translation>OpenGL Version 1.2 ist verfügbar.</translation> <translation>OpenGL Version 1.2 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="247"/> <location filename="../src/qt/MainWnd.cpp" line="264"/>
<source>OpenGL version 1.1 is present.</source> <source>OpenGL version 1.1 is present.</source>
<translation>OpenGL Version 1.1 ist verfügbar.</translation> <translation>OpenGL Version 1.1 ist verfügbar.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="253"/> <location filename="../src/qt/MainWnd.cpp" line="270"/>
<source>OpenGL is NOT available!</source> <source>OpenGL is NOT available!</source>
<translation>OpenGL ist NICHT verfügbar!</translation> <translation>OpenGL ist NICHT verfügbar!</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="215"/> <location filename="../src/qt/MainWnd.cpp" line="230"/>
<source>About VBA-M</source> <source>About VBA-M</source>
<translation>Über VBA-M</translation> <translation>Über VBA-M</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="256"/> <location filename="../src/qt/MainWnd.cpp" line="273"/>
<source>About OpenGL</source> <source>About OpenGL</source>
<translation>Über OpenGL</translation> <translation>Über OpenGL</translation>
</message> </message>
@ -171,57 +172,62 @@
<translation type="obsolete">Übersetzungsdateien (*.qm)</translation> <translation type="obsolete">Übersetzungsdateien (*.qm)</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="164"/> <location filename="../src/qt/MainWnd.cpp" line="177"/>
<source>.qm</source> <source>.qm</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="94"/> <location filename="../src/qt/MainWnd.cpp" line="99"/>
<source>Exit</source> <source>Exit</source>
<translation>Beenden</translation> <translation>Beenden</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="99"/> <location filename="../src/qt/MainWnd.cpp" line="104"/>
<source>Select language...</source> <source>Select language...</source>
<translation>Sprache auswählen...</translation> <translation>Sprache auswählen...</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="147"/> <location filename="../src/qt/MainWnd.cpp" line="159"/>
<source>Select language</source> <source>Select language</source>
<translation>Sprache auswählen</translation> <translation>Sprache auswählen</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="149"/> <location filename="../src/qt/MainWnd.cpp" line="161"/>
<source>Language files (*.qm)</source> <source>Language files (*.qm)</source>
<translation>Sprachdateien (*.qm)</translation> <translation>Sprachdateien (*.qm)</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="157"/> <location filename="../src/qt/MainWnd.cpp" line="169"/>
<source>Error!</source> <source>Error!</source>
<translation>Fehler!</translation> <translation>Fehler!</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="157"/> <location filename="../src/qt/MainWnd.cpp" line="169"/>
<source>Language file can not be loaded!</source> <source>Language file can not be loaded!</source>
<translation>Sprachdatei kann nicht geladen werden!</translation> <translation>Sprachdatei kann nicht geladen werden!</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="62"/> <location filename="../src/qt/MainWnd.cpp" line="66"/>
<source>Enable translation</source> <source>Enable translation</source>
<translation>Übersetzung aktivieren</translation> <translation>Übersetzung aktivieren</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="213"/> <location filename="../src/qt/MainWnd.cpp" line="228"/>
<source> <source>
No language file loaded.</source> No language file loaded.</source>
<translation> <translation>
Deutsche Übersetzung von spacy.</translation> Deutsche Übersetzung von spacy.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/MainWnd.cpp" line="123"/> <location filename="../src/qt/MainWnd.cpp" line="132"/>
<source>Cheats</source> <source>Cheats</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../src/qt/MainWnd.cpp" line="111"/>
<source>Show cheats sidebar</source>
<translation>Cheats-Seitenleiste anzeigen</translation>
</message>
</context> </context>
<context> <context>
<name>sidewidget_cheats</name> <name>sidewidget_cheats</name>

View File

@ -29,7 +29,7 @@
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release" CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe" Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;_DEBUG" PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath="&quot;$(ProjectDir)&quot;" IncludeSearchPath="&quot;$(ProjectDir)&quot;;D:\qt\4.3.3\include"
ForcedIncludes="" ForcedIncludes=""
AssemblySearchPath="" AssemblySearchPath=""
ForcedUsingAssemblies="" ForcedUsingAssemblies=""
@ -49,7 +49,7 @@
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release" CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe" Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;NDEBUG" PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="&quot;$(ProjectDir)&quot;" IncludeSearchPath="&quot;$(ProjectDir)&quot;;D:\qt\4.3.3\include"
ForcedIncludes="" ForcedIncludes=""
AssemblySearchPath="" AssemblySearchPath=""
ForcedUsingAssemblies="" ForcedUsingAssemblies=""

View File

@ -21,6 +21,7 @@
#include "glwidget.h" #include "glwidget.h"
#include "sidewidget_cheats.h" #include "sidewidget_cheats.h"
MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans ) MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
: QMainWindow( parent ), : QMainWindow( parent ),
theApp( app ), theApp( app ),
@ -37,19 +38,22 @@ MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
setMinimumSize( 320, 240 ); setMinimumSize( 320, 240 );
setWindowTitle( tr( "VBA-M" ) ); setWindowTitle( tr( "VBA-M" ) );
createDockWidgets();
createActions(); createActions();
createMenus(); createMenus();
createDockWidgets();
} }
MainWnd::~MainWnd() MainWnd::~MainWnd()
{ {
} }
void MainWnd::createActions() void MainWnd::createActions()
{ {
bool enabled, checked; bool enabled, checked;
if( enableTranslationAct != 0 ) { if( enableTranslationAct != 0 ) {
enabled = enableTranslationAct->isEnabled(); // memorize state enabled = enableTranslationAct->isEnabled(); // memorize state
checked = enableTranslationAct->isChecked(); checked = enableTranslationAct->isChecked();
@ -66,6 +70,7 @@ void MainWnd::createActions()
connect( enableTranslationAct, SIGNAL( toggled( bool ) ), this, SLOT( enableTranslation( bool ) ) ); connect( enableTranslationAct, SIGNAL( toggled( bool ) ), this, SLOT( enableTranslation( bool ) ) );
} }
void MainWnd::createMenus() void MainWnd::createMenus()
{ {
if( fileMenu ) { if( fileMenu ) {
@ -102,6 +107,9 @@ void MainWnd::createMenus()
// Tools menu // Tools menu
toolsMenu = menuBar()->addMenu( tr( "&Tools" ) ); toolsMenu = menuBar()->addMenu( tr( "&Tools" ) );
QAction *toggleCheats = dockWidget_cheats->toggleViewAction();
toggleCheats->setText( tr( "Show cheats sidebar" ) );
toolsMenu->addAction( toggleCheats ) ;
// Help menu // Help menu
@ -112,6 +120,7 @@ void MainWnd::createMenus()
helpMenu->addAction( tr( "About &Qt..." ), this, SLOT( showAboutQt() ) ); helpMenu->addAction( tr( "About &Qt..." ), this, SLOT( showAboutQt() ) );
} }
void MainWnd::createDockWidgets() void MainWnd::createDockWidgets()
{ {
if( dockWidget_cheats != 0 ) { if( dockWidget_cheats != 0 ) {
@ -125,8 +134,10 @@ void MainWnd::createDockWidgets()
dockWidget_cheats->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea ); dockWidget_cheats->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
dockWidget_cheats->setWidget( sw_cheats ); dockWidget_cheats->setWidget( sw_cheats );
addDockWidget( Qt::LeftDockWidgetArea, dockWidget_cheats ); addDockWidget( Qt::LeftDockWidgetArea, dockWidget_cheats );
dockWidget_cheats->hide();
} }
bool MainWnd::createDisplay() bool MainWnd::createDisplay()
{ {
if( !QGLFormat::hasOpenGL() ) return false; if( !QGLFormat::hasOpenGL() ) return false;
@ -140,6 +151,7 @@ bool MainWnd::createDisplay()
return false; return false;
} }
bool MainWnd::selectLanguage() bool MainWnd::selectLanguage()
{ {
QString file = QFileDialog::getOpenFileName( QString file = QFileDialog::getOpenFileName(
@ -159,6 +171,7 @@ bool MainWnd::selectLanguage()
return ret; return ret;
} }
bool MainWnd::loadTranslation( QString file ) bool MainWnd::loadTranslation( QString file )
{ {
if( !file.endsWith( tr( ".qm" ), Qt::CaseInsensitive ) ) return false; if( !file.endsWith( tr( ".qm" ), Qt::CaseInsensitive ) ) return false;
@ -179,6 +192,7 @@ bool MainWnd::loadTranslation( QString file )
return ret; return ret;
} }
bool MainWnd::enableTranslation( bool enable ) bool MainWnd::enableTranslation( bool enable )
{ {
if( enable ) { if( enable ) {
@ -198,12 +212,13 @@ bool MainWnd::enableTranslation( bool enable )
// apply translation // apply translation
// the user might have to restart the application to apply changes completely // the user might have to restart the application to apply changes completely
createDockWidgets();
createActions(); createActions();
createMenus(); createMenus();
createDockWidgets();
return true; return true;
} }
void MainWnd::showAbout() void MainWnd::showAbout()
{ {
QString info; QString info;
@ -215,11 +230,13 @@ void MainWnd::showAbout()
QMessageBox::about( this, tr( "About VBA-M" ), info ); QMessageBox::about( this, tr( "About VBA-M" ), info );
} }
void MainWnd::showAboutQt() void MainWnd::showAboutQt()
{ {
QMessageBox::aboutQt( this ); QMessageBox::aboutQt( this );
} }
void MainWnd::showAboutOpenGL() void MainWnd::showAboutOpenGL()
{ {
QString info; QString info;