First step to internationalization and localization.
This commit is contained in:
parent
6f47dc260a
commit
705e4ba7e4
@ -1550,6 +1550,10 @@
|
|||||||
RelativePath=".\tmp\RCC_Images.cpp"
|
RelativePath=".\tmp\RCC_Images.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\tmp\RCC_Localization.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\tmp\RCC_Tools.cpp"
|
RelativePath=".\tmp\RCC_Tools.cpp"
|
||||||
>
|
>
|
||||||
@ -1664,6 +1668,40 @@
|
|||||||
RelativePath=".\LameXP.rc"
|
RelativePath=".\LameXP.rc"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\res\Localization.qrc"
|
||||||
|
>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine=""$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp" -name "$(SafeInputName)" "$(InputPath)""
|
||||||
|
AdditionalDependencies="RCC "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
Outputs=""$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine=""$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp" -name "$(SafeInputName)" "$(InputPath)""
|
||||||
|
AdditionalDependencies="RCC "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
Outputs=""$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release_Static|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
CommandLine=""$(QTDIR)\bin\rcc.exe" -o "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp" -name "$(SafeInputName)" "$(InputPath)""
|
||||||
|
AdditionalDependencies="RCC "$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
Outputs=""$(SolutionDir)tmp\RCC_$(SafeInputName).cpp""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\res\MainIcon.ico"
|
RelativePath=".\res\MainIcon.ico"
|
||||||
>
|
>
|
||||||
|
25
etc/Translation/update.bat
Normal file
25
etc/Translation/update.bat
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
@echo off
|
||||||
|
REM ---------------------------
|
||||||
|
set "QTVARS=E:\Qt\MSVC\4.7.1\bin\qtvars.bat"
|
||||||
|
REM ---------------------------
|
||||||
|
call "%QTVARS%"
|
||||||
|
del update.lst > NUL
|
||||||
|
REM ---------------------------
|
||||||
|
if exist update.lst (
|
||||||
|
echo "Failed to delete old 'update.lst' file!"
|
||||||
|
pause
|
||||||
|
exit
|
||||||
|
)
|
||||||
|
REM ---------------------------
|
||||||
|
for %%f in (..\..\gui\*.ui) do (
|
||||||
|
echo %%f >> update.lst
|
||||||
|
)
|
||||||
|
for %%f in (..\..\src\*.cpp) do (
|
||||||
|
echo %%f >> update.lst
|
||||||
|
)
|
||||||
|
REM ---------------------------
|
||||||
|
for %%f in (*.ts) do (
|
||||||
|
lupdate.exe @update.lst -ts %%f
|
||||||
|
)
|
||||||
|
REM ---------------------------
|
||||||
|
pause
|
@ -239,6 +239,46 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="outputFolderLabel">
|
<widget class="QLabel" name="outputFolderLabel">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="Link">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>200</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="Link">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>200</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="Link">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>200</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="cursor">
|
||||||
|
<cursorShape>PointingHandCursor</cursorShape>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -1174,12 +1214,19 @@
|
|||||||
<addaction name="actionStyleWindowsXP"/>
|
<addaction name="actionStyleWindowsXP"/>
|
||||||
<addaction name="actionStyleWindowsClassic"/>
|
<addaction name="actionStyleWindowsClassic"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuLanguage">
|
||||||
|
<property name="title">
|
||||||
|
<string>Language</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionLanguageEnglish"/>
|
||||||
|
</widget>
|
||||||
<addaction name="actionSourceFiles"/>
|
<addaction name="actionSourceFiles"/>
|
||||||
<addaction name="actionOutputDirectory"/>
|
<addaction name="actionOutputDirectory"/>
|
||||||
<addaction name="actionMetaData"/>
|
<addaction name="actionMetaData"/>
|
||||||
<addaction name="actionCompression"/>
|
<addaction name="actionCompression"/>
|
||||||
<addaction name="actionAdvancedOptions"/>
|
<addaction name="actionAdvancedOptions"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="menuLanguage"/>
|
||||||
<addaction name="menuStyle"/>
|
<addaction name="menuStyle"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuTools">
|
<widget class="QMenu" name="menuTools">
|
||||||
@ -1407,6 +1454,14 @@
|
|||||||
<string>Show DropBox</string>
|
<string>Show DropBox</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionLanguageEnglish">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>English</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../res/Icons.qrc"/>
|
<include location="../res/Icons.qrc"/>
|
||||||
@ -1512,6 +1567,10 @@
|
|||||||
<include location="../res/Images.qrc"/>
|
<include location="../res/Images.qrc"/>
|
||||||
<include location="../res/Icons.qrc"/>
|
<include location="../res/Icons.qrc"/>
|
||||||
<include location="../res/Images.qrc"/>
|
<include location="../res/Images.qrc"/>
|
||||||
|
<include location="../res/Icons.qrc"/>
|
||||||
|
<include location="../res/Images.qrc"/>
|
||||||
|
<include location="../res/Icons.qrc"/>
|
||||||
|
<include location="../res/Images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
11
res/Localization.qrc
Normal file
11
res/Localization.qrc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE RCC>
|
||||||
|
<RCC version="1.0">
|
||||||
|
<qresource>
|
||||||
|
<file>localization/LameXP_DE.qm</file>
|
||||||
|
<file>localization/LameXP_DE.qm.txt</file>
|
||||||
|
<file>localization/LameXP_FR.qm</file>
|
||||||
|
<file>localization/LameXP_FR.qm.txt</file>
|
||||||
|
<file>localization/LameXP_IT.qm</file>
|
||||||
|
<file>localization/LameXP_IT.qm.txt</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
BIN
res/localization/LameXP_DE.qm
Normal file
BIN
res/localization/LameXP_DE.qm
Normal file
Binary file not shown.
1
res/localization/LameXP_DE.qm.txt
Normal file
1
res/localization/LameXP_DE.qm.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Deutsch
|
BIN
res/localization/LameXP_FR.qm
Normal file
BIN
res/localization/LameXP_FR.qm
Normal file
Binary file not shown.
1
res/localization/LameXP_FR.qm.txt
Normal file
1
res/localization/LameXP_FR.qm.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Française
|
BIN
res/localization/LameXP_IT.qm
Normal file
BIN
res/localization/LameXP_IT.qm
Normal file
Binary file not shown.
1
res/localization/LameXP_IT.qm.txt
Normal file
1
res/localization/LameXP_IT.qm.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Italiano
|
@ -25,7 +25,7 @@
|
|||||||
#define VER_LAMEXP_MAJOR 4
|
#define VER_LAMEXP_MAJOR 4
|
||||||
#define VER_LAMEXP_MINOR_HI 0
|
#define VER_LAMEXP_MINOR_HI 0
|
||||||
#define VER_LAMEXP_MINOR_LO 0
|
#define VER_LAMEXP_MINOR_LO 0
|
||||||
#define VER_LAMEXP_BUILD 189
|
#define VER_LAMEXP_BUILD 193
|
||||||
#define VER_LAMEXP_SUFFIX TechPreview
|
#define VER_LAMEXP_SUFFIX TechPreview
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -59,6 +59,8 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
#include <QTranslator>
|
||||||
|
#include <QResource>
|
||||||
|
|
||||||
//Win32 includes
|
//Win32 includes
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
@ -80,6 +82,16 @@ private:
|
|||||||
int m_index;
|
int m_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Helper class
|
||||||
|
class Tag: public QObjectUserData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Tag(const QString &text) : m_text(text) {}
|
||||||
|
QString text(void) { return m_text; }
|
||||||
|
private:
|
||||||
|
const QString m_text;
|
||||||
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@ -88,6 +100,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
|||||||
:
|
:
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
m_fileListModel(fileListModel),
|
m_fileListModel(fileListModel),
|
||||||
|
m_currentTranslator(new QTranslator),
|
||||||
m_metaData(metaInfo),
|
m_metaData(metaInfo),
|
||||||
m_settings(settingsModel),
|
m_settings(settingsModel),
|
||||||
m_accepted(false),
|
m_accepted(false),
|
||||||
@ -175,6 +188,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
|||||||
QAction *showFolderContextAction = m_outputFolderContextMenu->addAction(QIcon(":/icons/zoom.png"), "Browse Selected Folder");
|
QAction *showFolderContextAction = m_outputFolderContextMenu->addAction(QIcon(":/icons/zoom.png"), "Browse Selected Folder");
|
||||||
connect(outputFolderView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(outputFolderContextMenu(QPoint)));
|
connect(outputFolderView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(outputFolderContextMenu(QPoint)));
|
||||||
connect(showFolderContextAction, SIGNAL(triggered(bool)), this, SLOT(showFolderContextActionTriggered()));
|
connect(showFolderContextAction, SIGNAL(triggered(bool)), this, SLOT(showFolderContextActionTriggered()));
|
||||||
|
outputFolderLabel->installEventFilter(this);
|
||||||
|
|
||||||
//Setup "Meta Data" tab
|
//Setup "Meta Data" tab
|
||||||
m_metaInfoModel = new MetaInfoModel(m_metaData, 6);
|
m_metaInfoModel = new MetaInfoModel(m_metaData, 6);
|
||||||
@ -251,6 +265,22 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
|||||||
connect(m_styleActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(styleActionActivated(QAction*)));
|
connect(m_styleActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(styleActionActivated(QAction*)));
|
||||||
styleActionActivated(NULL);
|
styleActionActivated(NULL);
|
||||||
|
|
||||||
|
//Populate the language menu
|
||||||
|
m_languageActionGroup = new QActionGroup(this);
|
||||||
|
m_languageActionGroup->addAction(actionLanguageEnglish);
|
||||||
|
QStringList translations = QDir(":/localization").entryList(QStringList() << "*.qm", QDir::Files, QDir::Name);
|
||||||
|
for(int i = 0; i < translations.count(); i++)
|
||||||
|
{
|
||||||
|
QAction *currentLanguage = new QAction(this);
|
||||||
|
currentLanguage->setCheckable(true);
|
||||||
|
currentLanguage->setText(QString::fromUtf8(reinterpret_cast<const char*>(QResource(QString(":/localization/%1.txt").arg(translations.at(i))).data())));
|
||||||
|
currentLanguage->setUserData(0, new Tag(translations.at(i)));
|
||||||
|
m_languageActionGroup->addAction(currentLanguage);
|
||||||
|
menuLanguage->addAction(currentLanguage);
|
||||||
|
}
|
||||||
|
connect(m_languageActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(languageActionActivated(QAction*)));
|
||||||
|
actionLanguageEnglish->setChecked(true);
|
||||||
|
|
||||||
//Activate tools menu actions
|
//Activate tools menu actions
|
||||||
actionDisableUpdateReminder->setChecked(!m_settings->autoUpdateEnabled());
|
actionDisableUpdateReminder->setChecked(!m_settings->autoUpdateEnabled());
|
||||||
actionDisableSounds->setChecked(!m_settings->soundsEnabled());
|
actionDisableSounds->setChecked(!m_settings->soundsEnabled());
|
||||||
@ -317,9 +347,13 @@ MainWindow::~MainWindow(void)
|
|||||||
sourceFileView->setModel(NULL);
|
sourceFileView->setModel(NULL);
|
||||||
metaDataView->setModel(NULL);
|
metaDataView->setModel(NULL);
|
||||||
|
|
||||||
|
//Uninstall translator
|
||||||
|
QApplication::removeTranslator(m_currentTranslator);
|
||||||
|
|
||||||
//Free memory
|
//Free memory
|
||||||
LAMEXP_DELETE(m_tabActionGroup);
|
LAMEXP_DELETE(m_tabActionGroup);
|
||||||
LAMEXP_DELETE(m_styleActionGroup);
|
LAMEXP_DELETE(m_styleActionGroup);
|
||||||
|
LAMEXP_DELETE(m_languageActionGroup);
|
||||||
LAMEXP_DELETE(m_banner);
|
LAMEXP_DELETE(m_banner);
|
||||||
LAMEXP_DELETE(m_fileSystemModel);
|
LAMEXP_DELETE(m_fileSystemModel);
|
||||||
LAMEXP_DELETE(m_messageHandler);
|
LAMEXP_DELETE(m_messageHandler);
|
||||||
@ -330,12 +364,16 @@ MainWindow::~MainWindow(void)
|
|||||||
LAMEXP_DELETE(m_encoderButtonGroup);
|
LAMEXP_DELETE(m_encoderButtonGroup);
|
||||||
LAMEXP_DELETE(m_sourceFilesContextMenu);
|
LAMEXP_DELETE(m_sourceFilesContextMenu);
|
||||||
LAMEXP_DELETE(m_dropBox);
|
LAMEXP_DELETE(m_dropBox);
|
||||||
|
LAMEXP_DELETE(m_currentTranslator);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// PRIVATE FUNCTIONS
|
// PRIVATE FUNCTIONS
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add file to source list
|
||||||
|
*/
|
||||||
void MainWindow::addFiles(const QStringList &files)
|
void MainWindow::addFiles(const QStringList &files)
|
||||||
{
|
{
|
||||||
if(files.isEmpty())
|
if(files.isEmpty())
|
||||||
@ -369,6 +407,9 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
// EVENTS
|
// EVENTS
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window is about to be shown
|
||||||
|
*/
|
||||||
void MainWindow::showEvent(QShowEvent *event)
|
void MainWindow::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
m_accepted = false;
|
m_accepted = false;
|
||||||
@ -390,6 +431,9 @@ void MainWindow::showEvent(QShowEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File dragged over window
|
||||||
|
*/
|
||||||
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
||||||
{
|
{
|
||||||
QStringList formats = event->mimeData()->formats();
|
QStringList formats = event->mimeData()->formats();
|
||||||
@ -400,6 +444,9 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File dropped onto window
|
||||||
|
*/
|
||||||
void MainWindow::dropEvent(QDropEvent *event)
|
void MainWindow::dropEvent(QDropEvent *event)
|
||||||
{
|
{
|
||||||
ABORT_IF_BUSY;
|
ABORT_IF_BUSY;
|
||||||
@ -432,6 +479,9 @@ void MainWindow::dropEvent(QDropEvent *event)
|
|||||||
addFiles(droppedFiles);
|
addFiles(droppedFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window tries to close
|
||||||
|
*/
|
||||||
void MainWindow::closeEvent(QCloseEvent *event)
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if(m_banner->isVisible() || m_delayedFileTimer->isActive())
|
if(m_banner->isVisible() || m_delayedFileTimer->isActive())
|
||||||
@ -446,12 +496,18 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window was resized
|
||||||
|
*/
|
||||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QMainWindow::resizeEvent(event);
|
QMainWindow::resizeEvent(event);
|
||||||
m_dropNoteLabel->setGeometry(0, 0, sourceFileView->width(), sourceFileView->height());
|
m_dropNoteLabel->setGeometry(0, 0, sourceFileView->width(), sourceFileView->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Event filter
|
||||||
|
*/
|
||||||
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
if(obj == m_fileSystemModel && QApplication::overrideCursor() == NULL)
|
if(obj == m_fileSystemModel && QApplication::overrideCursor() == NULL)
|
||||||
@ -459,6 +515,26 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
|||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
QTimer::singleShot(250, this, SLOT(restoreCursor()));
|
QTimer::singleShot(250, this, SLOT(restoreCursor()));
|
||||||
}
|
}
|
||||||
|
else if(obj == outputFolderLabel)
|
||||||
|
{
|
||||||
|
switch(event->type())
|
||||||
|
{
|
||||||
|
case QEvent::MouseButtonPress:
|
||||||
|
if(dynamic_cast<QMouseEvent*>(event)->button() == Qt::LeftButton)
|
||||||
|
{
|
||||||
|
QDesktopServices::openUrl(QString("file:///%1").arg(outputFolderLabel->text()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case QEvent::Enter:
|
||||||
|
qDebug("QEvent::HoverEnter");
|
||||||
|
outputFolderLabel->setForegroundRole(QPalette::Link);
|
||||||
|
break;
|
||||||
|
case QEvent::Leave:
|
||||||
|
qDebug("QEvent::HoverLeave");
|
||||||
|
outputFolderLabel->setForegroundRole(QPalette::WindowText);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -536,7 +612,7 @@ void MainWindow::windowShown(void)
|
|||||||
QDate lastUpdateCheck = QDate::fromString(m_settings->autoUpdateLastCheck(), Qt::ISODate);
|
QDate lastUpdateCheck = QDate::fromString(m_settings->autoUpdateLastCheck(), Qt::ISODate);
|
||||||
if(!lastUpdateCheck.isValid() || QDate::currentDate() >= lastUpdateCheck.addDays(14))
|
if(!lastUpdateCheck.isValid() || QDate::currentDate() >= lastUpdateCheck.addDays(14))
|
||||||
{
|
{
|
||||||
if(QMessageBox::information(this, "Update Reminer", (lastUpdateCheck.isValid() ? "Your last update check was more than 14 days ago. Check for updates now?" : "Your did not check for LameXP updates yet. Check for updates now?"), "Check for Updates", "Defer") == 0)
|
if(QMessageBox::information(this, "Update Reminer", (lastUpdateCheck.isValid() ? "Your last update check was more than 14 days ago. Check for updates now?" : "Your did not check for LameXP updates yet. Check for updates now?"), "Check for Updates", "Postpone") == 0)
|
||||||
{
|
{
|
||||||
checkUpdatesActionActivated();
|
checkUpdatesActionActivated();
|
||||||
}
|
}
|
||||||
@ -878,6 +954,22 @@ void MainWindow::styleActionActivated(QAction *action)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Language action triggered
|
||||||
|
*/
|
||||||
|
void MainWindow::languageActionActivated(QAction *action)
|
||||||
|
{
|
||||||
|
QApplication::removeTranslator(m_currentTranslator);
|
||||||
|
if(action->userData(0))
|
||||||
|
{
|
||||||
|
if(m_currentTranslator->load(QString(":/localization/%1").arg(dynamic_cast<Tag*>(action->userData(0))->text())))
|
||||||
|
{
|
||||||
|
QApplication::installTranslator(m_currentTranslator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retranslateUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Output folder changed (mouse clicked)
|
* Output folder changed (mouse clicked)
|
||||||
*/
|
*/
|
||||||
@ -889,7 +981,7 @@ void MainWindow::outputFolderViewClicked(const QModelIndex &index)
|
|||||||
}
|
}
|
||||||
QString selectedDir = m_fileSystemModel->filePath(index);
|
QString selectedDir = m_fileSystemModel->filePath(index);
|
||||||
if(selectedDir.length() < 3) selectedDir.append(QDir::separator());
|
if(selectedDir.length() < 3) selectedDir.append(QDir::separator());
|
||||||
outputFolderLabel->setText(selectedDir);
|
outputFolderLabel->setText(QDir::toNativeSeparators(selectedDir));
|
||||||
m_settings->outputDir(selectedDir);
|
m_settings->outputDir(selectedDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -909,9 +1001,18 @@ void MainWindow::outputFolderViewMoved(const QModelIndex &index)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::gotoDesktopButtonClicked(void)
|
void MainWindow::gotoDesktopButtonClicked(void)
|
||||||
{
|
{
|
||||||
outputFolderView->setCurrentIndex(m_fileSystemModel->index(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)));
|
QString desktopPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
|
||||||
|
|
||||||
|
if(!desktopPath.isEmpty() && QDir(desktopPath).exists())
|
||||||
|
{
|
||||||
|
outputFolderView->setCurrentIndex(m_fileSystemModel->index(desktopPath));
|
||||||
outputFolderViewClicked(outputFolderView->currentIndex());
|
outputFolderViewClicked(outputFolderView->currentIndex());
|
||||||
outputFolderView->setFocus();
|
outputFolderView->setFocus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonGotoDesktop->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -919,9 +1020,18 @@ void MainWindow::gotoDesktopButtonClicked(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::gotoHomeFolderButtonClicked(void)
|
void MainWindow::gotoHomeFolderButtonClicked(void)
|
||||||
{
|
{
|
||||||
outputFolderView->setCurrentIndex(m_fileSystemModel->index(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
|
QString homePath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
|
||||||
|
|
||||||
|
if(!homePath.isEmpty() && QDir(homePath).exists())
|
||||||
|
{
|
||||||
|
outputFolderView->setCurrentIndex(m_fileSystemModel->index(homePath));
|
||||||
outputFolderViewClicked(outputFolderView->currentIndex());
|
outputFolderViewClicked(outputFolderView->currentIndex());
|
||||||
outputFolderView->setFocus();
|
outputFolderView->setFocus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonGotoHome->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -929,9 +1039,18 @@ void MainWindow::gotoHomeFolderButtonClicked(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::gotoMusicFolderButtonClicked(void)
|
void MainWindow::gotoMusicFolderButtonClicked(void)
|
||||||
{
|
{
|
||||||
outputFolderView->setCurrentIndex(m_fileSystemModel->index(QDesktopServices::storageLocation(QDesktopServices::MusicLocation)));
|
QString musicPath = QDesktopServices::storageLocation(QDesktopServices::MusicLocation);
|
||||||
|
|
||||||
|
if(!musicPath.isEmpty() && QDir(musicPath).exists())
|
||||||
|
{
|
||||||
|
outputFolderView->setCurrentIndex(m_fileSystemModel->index(musicPath));
|
||||||
outputFolderViewClicked(outputFolderView->currentIndex());
|
outputFolderViewClicked(outputFolderView->currentIndex());
|
||||||
outputFolderView->setFocus();
|
outputFolderView->setFocus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonGotoMusic->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1645,7 +1764,7 @@ void MainWindow::installWMADecoderActionTriggered(bool checked)
|
|||||||
QFile::remove(setupFile);
|
QFile::remove(setupFile);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
if(QMessageBox::information(this, "WMA Decoder", "The WMA File Decoder has been installed. Please restart LameXP now!", "Quit LameXP", "Ignore") == 0)
|
if(QMessageBox::information(this, "WMA Decoder", "The WMA File Decoder has been installed. Please restart LameXP now!", "Quit LameXP", "Postpone") == 0)
|
||||||
{
|
{
|
||||||
QApplication::quit();
|
QApplication::quit();
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ class FileListModel;
|
|||||||
class AbstractEncoder;
|
class AbstractEncoder;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class DropBox;
|
class DropBox;
|
||||||
|
class QTranslator;
|
||||||
|
|
||||||
class MainWindow: public QMainWindow, private Ui::MainWindow
|
class MainWindow: public QMainWindow, private Ui::MainWindow
|
||||||
{
|
{
|
||||||
@ -60,6 +61,7 @@ private slots:
|
|||||||
void tabPageChanged(int idx);
|
void tabPageChanged(int idx);
|
||||||
void tabActionActivated(QAction *action);
|
void tabActionActivated(QAction *action);
|
||||||
void styleActionActivated(QAction *action);
|
void styleActionActivated(QAction *action);
|
||||||
|
void languageActionActivated(QAction *action);
|
||||||
void outputFolderViewClicked(const QModelIndex &index);
|
void outputFolderViewClicked(const QModelIndex &index);
|
||||||
void outputFolderViewMoved(const QModelIndex &index);
|
void outputFolderViewMoved(const QModelIndex &index);
|
||||||
void makeFolderButtonClicked(void);
|
void makeFolderButtonClicked(void);
|
||||||
@ -112,6 +114,7 @@ private:
|
|||||||
QFileSystemModelEx *m_fileSystemModel;
|
QFileSystemModelEx *m_fileSystemModel;
|
||||||
QActionGroup *m_tabActionGroup;
|
QActionGroup *m_tabActionGroup;
|
||||||
QActionGroup *m_styleActionGroup;
|
QActionGroup *m_styleActionGroup;
|
||||||
|
QActionGroup *m_languageActionGroup;
|
||||||
QButtonGroup *m_encoderButtonGroup;
|
QButtonGroup *m_encoderButtonGroup;
|
||||||
QButtonGroup *m_modeButtonGroup;
|
QButtonGroup *m_modeButtonGroup;
|
||||||
WorkingBanner *m_banner;
|
WorkingBanner *m_banner;
|
||||||
@ -125,4 +128,5 @@ private:
|
|||||||
QMenu *m_sourceFilesContextMenu;
|
QMenu *m_sourceFilesContextMenu;
|
||||||
QMenu *m_outputFolderContextMenu;
|
QMenu *m_outputFolderContextMenu;
|
||||||
DropBox *m_dropBox;
|
DropBox *m_dropBox;
|
||||||
|
QTranslator *m_currentTranslator;
|
||||||
};
|
};
|
||||||
|
@ -523,6 +523,11 @@ bool lamexp_init_qt(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Load translation
|
||||||
|
//QTranslator *translator = new QTranslator();
|
||||||
|
//translator->load(":/localization/LameXP_DE.qm");
|
||||||
|
//application->installTranslator(translator);
|
||||||
|
|
||||||
//Done
|
//Done
|
||||||
qt_initialized = true;
|
qt_initialized = true;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user