From b12e524a96436725075f75cbd9d75961be5f2f41 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 11 Feb 2011 23:16:11 +0100 Subject: [PATCH] Add option "Brose Output File Location" to context menu in processing window. --- etc/Translation/Blank.ts | 4 ++++ etc/Translation/LameXP_DE.ts | 6 ++++- etc/Translation/LameXP_ES.ts | 4 ++++ etc/Translation/LameXP_FR.ts | 4 ++++ etc/Translation/LameXP_IT.ts | 4 ++++ res/localization/LameXP_DE.qm | Bin 51339 -> 51449 bytes src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 17 ++++++++++---- src/Dialog_Processing.cpp | 53 +++++++++++++++++++++++++++++++++++++++--- src/Dialog_Processing.h | 3 ++- src/Model_Progress.cpp | 10 ++++++++ src/Model_Progress.h | 1 + 12 files changed, 98 insertions(+), 10 deletions(-) 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 d23f4466f2a80c407914a9abe335123b58d5c0f0..01adb397c5e8fa8fdc37e2ff5b3d2828d52368ac 100644 GIT binary patch delta 3298 zcmX9=2Ury67CpN&v$H!pJ4*m#0I7n21+hd0B^DF}6%m!DQUs&~K`CO?utec0h!g<> z7OEW(l*EcC5;dsLppa-tgc!Rf7R-y!0_GY%KEAs09b z1H&%>+(aOcr#Kf_v<{f(1Jq6hf?I%f@xaP?fLTa?-1r`B{d~aV2e7ADV8)gHxG4Z^ zn+-7A6Pz362{Z?nO}~dVgF71mm?wby;UchlD7d%l0bOwtG$ChzX)`f&gBeiu1Y_NU zfN?Q!-&P2eX)x3NG>|nO9%rqAx@>q3qX(VV!gE{^u*tSRRyy{_`qh}l#ZX~Am=&H1 zl&r^`^BF+yRCtGG0p4x!Z~YDkkB9%|66kPr7y{2y#ZkRjq^4-q)E~cAW6`oPz^V;c zY<`atoWSA@-vY%m5K%uG*iwyErg4C815%7W1@_*+m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q_UwHw0lBKgZ34FJ5ik=kjNf%0Ga+EUZK@Jf4t)oTEx-%bJnMT z$#e8q%I^^Z&icpk-lU5P{ZobR=~J)&)Q=p;F+#Ta-Vgzdtd*VZoT#Eva!-RB?K_?9 zI-On|Xe;;kt)u-_BM%>2PePj}NB%mEF4!#3O1nc|`BIKs`H{?7EyrE_gF3z`$G^=5 zR?d@GTG4)Uij>nP5FM@0$%TojWKEEZO%Krdj`FtDsf1{(+-$H+2I3v$)`tyr;JEyc zz7LQxUw$*hoYqFH{HA~oW+y88currentIndex(); 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); -- 2.11.0