From: lordmulder Date: Fri, 11 Feb 2011 22:16:11 +0000 (+0100) Subject: Add option "Brose Output File Location" to context menu in processing window. X-Git-Tag: Release_400~31 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b12e524a96436725075f75cbd9d75961be5f2f41;p=lamexp%2FLameXP.git Add option "Brose Output File Location" to context menu in processing window. --- diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 48d9f74d..3d20ace7 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -1421,6 +1421,10 @@ + Browse Output File Location + + + Encoding Files diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index a28e5aa2..af06dd90 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -113,7 +113,7 @@ LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of thrird-party software used in LameXP belongs to the individual authors. - Das Urheberrecht an LameXP liegt bei LoRd_MuldeR. Das Urheberrecht an der eingesetzten Drittsoftware liegt bei den jeweiligen Authoren. + Das Urheberrecht an LameXP liegt bei LoRd_MuldeR. Das Urheberrecht an der eingesetzten Drittsoftware liegt bei den jeweiligen Autoren. LameXP &minus; Audio Encoder Front-end @@ -1497,6 +1497,10 @@ Multi-threading enabled: Running %1 instances in parallel! Multithreading aktiviert: Führe %1 Instanzen parallel aus! + + Browse Output File Location + Ausgabe-Datei Suchen + ProgressModel diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index 84fb3efc..bda5dbb0 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -1496,6 +1496,10 @@ Multi-threading enabled: Running %1 instances in parallel! Ejecución multi-hilo habilitada: ¡Ejecutando %1 instancias en paralelo! + + Browse Output File Location + + ProgressModel diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 1012d7b7..9212f983 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1499,6 +1499,10 @@ Votre dossier TEMP est situé ici: Multi-threading enabled: Running %1 instances in parallel! + + Browse Output File Location + + ProgressModel diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 43a46f16..bb8558a2 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1497,6 +1497,10 @@ Multi-threading enabled: Running %1 instances in parallel! + + Browse Output File Location + + ProgressModel diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index d23f4466..01adb397 100644 Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ diff --git a/src/Config.h b/src/Config.h index 5c014685..72836704 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 305 +#define VER_LAMEXP_BUILD 307 #define VER_LAMEXP_SUFFIX Beta-4 /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 132cc655..e62220f1 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -548,12 +548,12 @@ void MainWindow::changeEvent(QEvent *e) { int comboBoxIndex[3]; - //Backup combobox indices + //Backup combobox indices, as retranslateUi() resets comboBoxIndex[0] = comboBoxMP3ChannelMode->currentIndex(); comboBoxIndex[1] = comboBoxSamplingRate->currentIndex(); comboBoxIndex[2] = comboBoxNeroAACProfile->currentIndex(); - //Re.translate from UIC + //Re-translate from UIC Ui::MainWindow::retranslateUi(this); //Restore combobox indices @@ -566,7 +566,7 @@ void MainWindow::changeEvent(QEvent *e) setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION"))); } - //Manual re-translate + //Manually re-translate widgets that UIC doesn't handle m_dropNoteLabel->setText(QString("» %1 «").arg(tr("You can drop in audio files here!"))); m_showDetailsContextAction->setText(tr("Show Details")); m_previewContextAction->setText(tr("Open File in External Application")); @@ -579,6 +579,7 @@ void MainWindow::changeEvent(QEvent *e) updateEncoder(m_settings->compressionEncoder()); updateLameAlgoQuality(sliderLameAlgoQuality->value()); + //Re-install shell integration if(m_settings->shellIntegrationEnabled()) { ShellIntegration::install(); @@ -1135,13 +1136,18 @@ void MainWindow::tabActionActivated(QAction *action) */ void MainWindow::styleActionActivated(QAction *action) { + //Change style setting if(action && action->data().isValid()) { bool ok = false; int actionIndex = action->data().toInt(&ok); - m_settings->interfaceStyle(actionIndex); + if(ok) + { + m_settings->interfaceStyle(actionIndex); + } } + //Set up the new style switch(m_settings->interfaceStyle()) { case 1: @@ -1177,6 +1183,9 @@ void MainWindow::styleActionActivated(QAction *action) QApplication::setStyle(new QPlastiqueStyle()); break; } + + //Force re-translate after style change + changeEvent(new QEvent(QEvent::LanguageChange)); } /* diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index 9e04d544..ca92a651 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -117,10 +118,13 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel //Create context menu m_contextMenu = new QMenu(); - QAction *contextMenuAction = m_contextMenu->addAction(QIcon(":/icons/zoom.png"), tr("Show details for selected job")); + QAction *contextMenuDetailsAction = m_contextMenu->addAction(QIcon(":/icons/zoom.png"), tr("Show details for selected job")); + QAction *contextMenuShowFileAction = m_contextMenu->addAction(QIcon(":/icons/folder_go.png"), tr("Browse Output File Location")); + view_log->setContextMenuPolicy(Qt::CustomContextMenu); connect(view_log, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTriggered(QPoint))); - connect(contextMenuAction, SIGNAL(triggered(bool)), this, SLOT(contextMenuActionTriggered())); + connect(contextMenuDetailsAction, SIGNAL(triggered(bool)), this, SLOT(contextMenuDetailsActionTriggered())); + connect(contextMenuShowFileAction, SIGNAL(triggered(bool)), this, SLOT(contextMenuShowFileActionTriggered())); //Enque jobs if(fileListModel) @@ -424,12 +428,55 @@ void ProcessingDialog::contextMenuTriggered(const QPoint &pos) } } -void ProcessingDialog::contextMenuActionTriggered(void) +void ProcessingDialog::contextMenuDetailsActionTriggered(void) { QModelIndex index = view_log->indexAt(view_log->mapFromGlobal(m_contextMenu->pos())); logViewDoubleClicked(index.isValid() ? index : view_log->currentIndex()); } +void ProcessingDialog::contextMenuShowFileActionTriggered(void) +{ + QModelIndex index = view_log->indexAt(view_log->mapFromGlobal(m_contextMenu->pos())); + const QUuid &jobId = m_progressModel->getJobId(index.isValid() ? index : view_log->currentIndex()); + QString filePath = m_playList.value(jobId, QString()); + + if(filePath.isEmpty()) + { + MessageBeep(MB_ICONWARNING); + return; + } + + if(QFileInfo(filePath).exists()) + { + QString systemRootPath; + + QDir systemRoot(lamexp_known_folder(lamexp_folder_systemfolder)); + if(systemRoot.exists() && systemRoot.cdUp()) + { + systemRootPath = systemRoot.canonicalPath(); + } + + if(!systemRootPath.isEmpty()) + { + QFileInfo explorer(QString("%1/explorer.exe").arg(systemRootPath)); + if(explorer.exists() && explorer.isFile()) + { + QProcess::execute(explorer.canonicalFilePath(), QStringList() << "/select," << QDir::toNativeSeparators(QFileInfo(filePath).canonicalFilePath())); + return; + } + } + else + { + qWarning("SystemRoot directory could not be detected!"); + } + } + else + { + qWarning("File not found: %s", filePath.toLatin1().constData()); + MessageBeep(MB_ICONERROR); + } +} + //////////////////////////////////////////////////////////// // Private Functions //////////////////////////////////////////////////////////// diff --git a/src/Dialog_Processing.h b/src/Dialog_Processing.h index 91f3dd84..8a16052b 100644 --- a/src/Dialog_Processing.h +++ b/src/Dialog_Processing.h @@ -50,7 +50,8 @@ private slots: void progressModelChanged(void); void logViewDoubleClicked(const QModelIndex &index); void contextMenuTriggered(const QPoint &pos); - void contextMenuActionTriggered(void); + void contextMenuDetailsActionTriggered(void); + void contextMenuShowFileActionTriggered(void); void systemTrayActivated(QSystemTrayIcon::ActivationReason reason); protected: diff --git a/src/Model_Progress.cpp b/src/Model_Progress.cpp index 58233c18..d31bac7b 100644 --- a/src/Model_Progress.cpp +++ b/src/Model_Progress.cpp @@ -177,6 +177,16 @@ const QStringList &ProgressModel::getLogFile(const QModelIndex &index) return *(reinterpret_cast(NULL)); } +const QUuid &ProgressModel::getJobId(const QModelIndex &index) +{ + if(index.row() < m_jobList.count()) + { + return m_jobList.at(index.row()); + } + + return *(reinterpret_cast(NULL)); +} + void ProgressModel::addSystemMessage(const QString &text) { const QUuid &jobId = QUuid::createUuid(); diff --git a/src/Model_Progress.h b/src/Model_Progress.h index 4afd251b..9ab84a3e 100644 --- a/src/Model_Progress.h +++ b/src/Model_Progress.h @@ -55,6 +55,7 @@ public: //Public functions const QStringList &getLogFile(const QModelIndex &index); + const QUuid &getJobId(const QModelIndex &index); public slots: void addJob(const QUuid &jobId, const QString &jobName, const QString &jobInitialStatus = QString("Initializing..."), int jobInitialState = JobRunning);