Add option "Brose Output File Location" to context menu in processing window.

This commit is contained in:
LoRd_MuldeR 2011-02-11 23:16:11 +01:00
parent 54ae153b54
commit b12e524a96
12 changed files with 98 additions and 10 deletions

View File

@ -1420,6 +1420,10 @@
<source>Show details for selected job</source> <source>Show details for selected job</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Browse Output File Location</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Encoding Files</source> <source>Encoding Files</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@ -113,7 +113,7 @@
</message> </message>
<message> <message>
<source>LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of thrird-party software used in LameXP belongs to the individual authors.</source> <source>LameXP as a whole is copyrighted by LoRd_MuldeR. The copyright of thrird-party software used in LameXP belongs to the individual authors.</source>
<translation>Das Urheberrecht an LameXP liegt bei LoRd_MuldeR. Das Urheberrecht an der eingesetzten Drittsoftware liegt bei den jeweiligen Authoren.</translation> <translation>Das Urheberrecht an LameXP liegt bei LoRd_MuldeR. Das Urheberrecht an der eingesetzten Drittsoftware liegt bei den jeweiligen Autoren.</translation>
</message> </message>
<message> <message>
<source>LameXP &amp;minus; Audio Encoder Front-end</source> <source>LameXP &amp;minus; Audio Encoder Front-end</source>
@ -1497,6 +1497,10 @@
<source>Multi-threading enabled: Running %1 instances in parallel!</source> <source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation>Multithreading aktiviert: Führe %1 Instanzen parallel aus!</translation> <translation>Multithreading aktiviert: Führe %1 Instanzen parallel aus!</translation>
</message> </message>
<message>
<source>Browse Output File Location</source>
<translation>Ausgabe-Datei Suchen</translation>
</message>
</context> </context>
<context> <context>
<name>ProgressModel</name> <name>ProgressModel</name>

View File

@ -1496,6 +1496,10 @@
<source>Multi-threading enabled: Running %1 instances in parallel!</source> <source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation>Ejecución multi-hilo habilitada: ¡Ejecutando %1 instancias en paralelo!</translation> <translation>Ejecución multi-hilo habilitada: ¡Ejecutando %1 instancias en paralelo!</translation>
</message> </message>
<message>
<source>Browse Output File Location</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProgressModel</name> <name>ProgressModel</name>

View File

@ -1499,6 +1499,10 @@ Votre dossier TEMP est situé ici:</translation>
<source>Multi-threading enabled: Running %1 instances in parallel!</source> <source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Browse Output File Location</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProgressModel</name> <name>ProgressModel</name>

View File

@ -1497,6 +1497,10 @@
<source>Multi-threading enabled: Running %1 instances in parallel!</source> <source>Multi-threading enabled: Running %1 instances in parallel!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Browse Output File Location</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ProgressModel</name> <name>ProgressModel</name>

Binary file not shown.

View File

@ -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 305 #define VER_LAMEXP_BUILD 307
#define VER_LAMEXP_SUFFIX Beta-4 #define VER_LAMEXP_SUFFIX Beta-4
/* /*

View File

@ -548,12 +548,12 @@ void MainWindow::changeEvent(QEvent *e)
{ {
int comboBoxIndex[3]; int comboBoxIndex[3];
//Backup combobox indices //Backup combobox indices, as retranslateUi() resets
comboBoxIndex[0] = comboBoxMP3ChannelMode->currentIndex(); comboBoxIndex[0] = comboBoxMP3ChannelMode->currentIndex();
comboBoxIndex[1] = comboBoxSamplingRate->currentIndex(); comboBoxIndex[1] = comboBoxSamplingRate->currentIndex();
comboBoxIndex[2] = comboBoxNeroAACProfile->currentIndex(); comboBoxIndex[2] = comboBoxNeroAACProfile->currentIndex();
//Re.translate from UIC //Re-translate from UIC
Ui::MainWindow::retranslateUi(this); Ui::MainWindow::retranslateUi(this);
//Restore combobox indices //Restore combobox indices
@ -566,7 +566,7 @@ void MainWindow::changeEvent(QEvent *e)
setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION"))); 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_dropNoteLabel->setText(QString("» %1 «").arg(tr("You can drop in audio files here!")));
m_showDetailsContextAction->setText(tr("Show Details")); m_showDetailsContextAction->setText(tr("Show Details"));
m_previewContextAction->setText(tr("Open File in External Application")); m_previewContextAction->setText(tr("Open File in External Application"));
@ -579,6 +579,7 @@ void MainWindow::changeEvent(QEvent *e)
updateEncoder(m_settings->compressionEncoder()); updateEncoder(m_settings->compressionEncoder());
updateLameAlgoQuality(sliderLameAlgoQuality->value()); updateLameAlgoQuality(sliderLameAlgoQuality->value());
//Re-install shell integration
if(m_settings->shellIntegrationEnabled()) if(m_settings->shellIntegrationEnabled())
{ {
ShellIntegration::install(); ShellIntegration::install();
@ -1135,13 +1136,18 @@ void MainWindow::tabActionActivated(QAction *action)
*/ */
void MainWindow::styleActionActivated(QAction *action) void MainWindow::styleActionActivated(QAction *action)
{ {
//Change style setting
if(action && action->data().isValid()) if(action && action->data().isValid())
{ {
bool ok = false; bool ok = false;
int actionIndex = action->data().toInt(&ok); 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()) switch(m_settings->interfaceStyle())
{ {
case 1: case 1:
@ -1177,6 +1183,9 @@ void MainWindow::styleActionActivated(QAction *action)
QApplication::setStyle(new QPlastiqueStyle()); QApplication::setStyle(new QPlastiqueStyle());
break; break;
} }
//Force re-translate after style change
changeEvent(new QEvent(QEvent::LanguageChange));
} }
/* /*

View File

@ -52,6 +52,7 @@
#include <QDir> #include <QDir>
#include <QMenu> #include <QMenu>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QProcess>
#include <Windows.h> #include <Windows.h>
@ -117,10 +118,13 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel
//Create context menu //Create context menu
m_contextMenu = new QMenu(); 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); view_log->setContextMenuPolicy(Qt::CustomContextMenu);
connect(view_log, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTriggered(QPoint))); 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 //Enque jobs
if(fileListModel) 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())); QModelIndex index = view_log->indexAt(view_log->mapFromGlobal(m_contextMenu->pos()));
logViewDoubleClicked(index.isValid() ? index : view_log->currentIndex()); 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 // Private Functions
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -50,7 +50,8 @@ private slots:
void progressModelChanged(void); void progressModelChanged(void);
void logViewDoubleClicked(const QModelIndex &index); void logViewDoubleClicked(const QModelIndex &index);
void contextMenuTriggered(const QPoint &pos); void contextMenuTriggered(const QPoint &pos);
void contextMenuActionTriggered(void); void contextMenuDetailsActionTriggered(void);
void contextMenuShowFileActionTriggered(void);
void systemTrayActivated(QSystemTrayIcon::ActivationReason reason); void systemTrayActivated(QSystemTrayIcon::ActivationReason reason);
protected: protected:

View File

@ -177,6 +177,16 @@ const QStringList &ProgressModel::getLogFile(const QModelIndex &index)
return *(reinterpret_cast<QStringList*>(NULL)); return *(reinterpret_cast<QStringList*>(NULL));
} }
const QUuid &ProgressModel::getJobId(const QModelIndex &index)
{
if(index.row() < m_jobList.count())
{
return m_jobList.at(index.row());
}
return *(reinterpret_cast<QUuid*>(NULL));
}
void ProgressModel::addSystemMessage(const QString &text) void ProgressModel::addSystemMessage(const QString &text)
{ {
const QUuid &jobId = QUuid::createUuid(); const QUuid &jobId = QUuid::createUuid();

View File

@ -55,6 +55,7 @@ public:
//Public functions //Public functions
const QStringList &getLogFile(const QModelIndex &index); const QStringList &getLogFile(const QModelIndex &index);
const QUuid &getJobId(const QModelIndex &index);
public slots: public slots:
void addJob(const QUuid &jobId, const QString &jobName, const QString &jobInitialStatus = QString("Initializing..."), int jobInitialState = JobRunning); void addJob(const QUuid &jobId, const QString &jobName, const QString &jobInitialStatus = QString("Initializing..."), int jobInitialState = JobRunning);