Qt:
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:
parent
b6cc37c047
commit
814e191201
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS><TS version="1.1" language="de_DE">
|
||||
<defaultcodec></defaultcodec>
|
||||
<context>
|
||||
<name>@default</name>
|
||||
<message>
|
||||
|
@ -61,97 +62,97 @@
|
|||
<context>
|
||||
<name>MainWnd</name>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="38"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="39"/>
|
||||
<source>VBA-M</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="93"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="98"/>
|
||||
<source>&File</source>
|
||||
<translation>&Datei</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="98"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="103"/>
|
||||
<source>&Settings</source>
|
||||
<translation>&Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="104"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="109"/>
|
||||
<source>&Tools</source>
|
||||
<translation>&Werkzeuge</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="108"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="116"/>
|
||||
<source>&Help</source>
|
||||
<translation>&Hilfe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="111"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="119"/>
|
||||
<source>About &OpenGL...</source>
|
||||
<translation>Über &OpenGL...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="110"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="118"/>
|
||||
<source>About &VBA-M...</source>
|
||||
<translation>Über &VBA-M...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="112"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="120"/>
|
||||
<source>About &Qt...</source>
|
||||
<translation>Über &Qt...</translation>
|
||||
</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>
|
||||
<translation>Dieses Programm ist unter den Bedingungen der GNU General Public License lizenziert.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 2.1 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 2.0 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 1.5 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 1.4 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 1.3 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 1.2 ist verfügbar.</translation>
|
||||
</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>
|
||||
<translation>OpenGL Version 1.1 ist verfügbar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="253"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="270"/>
|
||||
<source>OpenGL is NOT available!</source>
|
||||
<translation>OpenGL ist NICHT verfügbar!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="215"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="230"/>
|
||||
<source>About VBA-M</source>
|
||||
<translation>Über VBA-M</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="256"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="273"/>
|
||||
<source>About OpenGL</source>
|
||||
<translation>Über OpenGL</translation>
|
||||
</message>
|
||||
|
@ -171,57 +172,62 @@
|
|||
<translation type="obsolete">Übersetzungsdateien (*.qm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="164"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="177"/>
|
||||
<source>.qm</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="94"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="99"/>
|
||||
<source>Exit</source>
|
||||
<translation>Beenden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="99"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="104"/>
|
||||
<source>Select language...</source>
|
||||
<translation>Sprache auswählen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="147"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="159"/>
|
||||
<source>Select language</source>
|
||||
<translation>Sprache auswählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="149"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="161"/>
|
||||
<source>Language files (*.qm)</source>
|
||||
<translation>Sprachdateien (*.qm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="157"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="169"/>
|
||||
<source>Error!</source>
|
||||
<translation>Fehler!</translation>
|
||||
</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>
|
||||
<translation>Sprachdatei kann nicht geladen werden!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="62"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="66"/>
|
||||
<source>Enable translation</source>
|
||||
<translation>Übersetzung aktivieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="213"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="228"/>
|
||||
<source>
|
||||
No language file loaded.</source>
|
||||
<translation>
|
||||
Deutsche Übersetzung von spacy.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="123"/>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="132"/>
|
||||
<source>Cheats</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/qt/MainWnd.cpp" line="111"/>
|
||||
<source>Show cheats sidebar</source>
|
||||
<translation>Cheats-Seitenleiste anzeigen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>sidewidget_cheats</name>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release"
|
||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG"
|
||||
IncludeSearchPath=""$(ProjectDir)""
|
||||
IncludeSearchPath=""$(ProjectDir)";D:\qt\4.3.3\include"
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
|
@ -49,7 +49,7 @@
|
|||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release"
|
||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(ProjectDir)""
|
||||
IncludeSearchPath=""$(ProjectDir)";D:\qt\4.3.3\include"
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "glwidget.h"
|
||||
#include "sidewidget_cheats.h"
|
||||
|
||||
|
||||
MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
|
||||
: QMainWindow( parent ),
|
||||
theApp( app ),
|
||||
|
@ -37,19 +38,22 @@ MainWnd::MainWnd( QWidget *parent, QApplication *app, QTranslator **trans )
|
|||
setMinimumSize( 320, 240 );
|
||||
setWindowTitle( tr( "VBA-M" ) );
|
||||
|
||||
createDockWidgets();
|
||||
createActions();
|
||||
createMenus();
|
||||
createDockWidgets();
|
||||
}
|
||||
|
||||
|
||||
MainWnd::~MainWnd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::createActions()
|
||||
{
|
||||
bool enabled, checked;
|
||||
|
||||
|
||||
if( enableTranslationAct != 0 ) {
|
||||
enabled = enableTranslationAct->isEnabled(); // memorize state
|
||||
checked = enableTranslationAct->isChecked();
|
||||
|
@ -66,6 +70,7 @@ void MainWnd::createActions()
|
|||
connect( enableTranslationAct, SIGNAL( toggled( bool ) ), this, SLOT( enableTranslation( bool ) ) );
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::createMenus()
|
||||
{
|
||||
if( fileMenu ) {
|
||||
|
@ -102,6 +107,9 @@ void MainWnd::createMenus()
|
|||
|
||||
// Tools menu
|
||||
toolsMenu = menuBar()->addMenu( tr( "&Tools" ) );
|
||||
QAction *toggleCheats = dockWidget_cheats->toggleViewAction();
|
||||
toggleCheats->setText( tr( "Show cheats sidebar" ) );
|
||||
toolsMenu->addAction( toggleCheats ) ;
|
||||
|
||||
|
||||
// Help menu
|
||||
|
@ -112,6 +120,7 @@ void MainWnd::createMenus()
|
|||
helpMenu->addAction( tr( "About &Qt..." ), this, SLOT( showAboutQt() ) );
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::createDockWidgets()
|
||||
{
|
||||
if( dockWidget_cheats != 0 ) {
|
||||
|
@ -125,8 +134,10 @@ void MainWnd::createDockWidgets()
|
|||
dockWidget_cheats->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
dockWidget_cheats->setWidget( sw_cheats );
|
||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget_cheats );
|
||||
dockWidget_cheats->hide();
|
||||
}
|
||||
|
||||
|
||||
bool MainWnd::createDisplay()
|
||||
{
|
||||
if( !QGLFormat::hasOpenGL() ) return false;
|
||||
|
@ -140,6 +151,7 @@ bool MainWnd::createDisplay()
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool MainWnd::selectLanguage()
|
||||
{
|
||||
QString file = QFileDialog::getOpenFileName(
|
||||
|
@ -159,6 +171,7 @@ bool MainWnd::selectLanguage()
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool MainWnd::loadTranslation( QString file )
|
||||
{
|
||||
if( !file.endsWith( tr( ".qm" ), Qt::CaseInsensitive ) ) return false;
|
||||
|
@ -179,6 +192,7 @@ bool MainWnd::loadTranslation( QString file )
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool MainWnd::enableTranslation( bool enable )
|
||||
{
|
||||
if( enable ) {
|
||||
|
@ -198,12 +212,13 @@ bool MainWnd::enableTranslation( bool enable )
|
|||
|
||||
// apply translation
|
||||
// the user might have to restart the application to apply changes completely
|
||||
createDockWidgets();
|
||||
createActions();
|
||||
createMenus();
|
||||
createDockWidgets();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::showAbout()
|
||||
{
|
||||
QString info;
|
||||
|
@ -215,11 +230,13 @@ void MainWnd::showAbout()
|
|||
QMessageBox::about( this, tr( "About VBA-M" ), info );
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::showAboutQt()
|
||||
{
|
||||
QMessageBox::aboutQt( this );
|
||||
}
|
||||
|
||||
|
||||
void MainWnd::showAboutOpenGL()
|
||||
{
|
||||
QString info;
|
||||
|
|
Loading…
Reference in New Issue