Make sure that the output folder label is updated when the output folder (tree item) is changed via keyboard.

This commit is contained in:
LoRd_MuldeR 2011-06-12 03:18:37 +02:00
parent df671a7be2
commit ca1c1b46d4

View File

@ -146,6 +146,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
outputFolderView->setAnimated(false); outputFolderView->setAnimated(false);
outputFolderView->setMouseTracking(false); outputFolderView->setMouseTracking(false);
outputFolderView->setContextMenuPolicy(Qt::CustomContextMenu); outputFolderView->setContextMenuPolicy(Qt::CustomContextMenu);
outputFolderView->installEventFilter(this);
while(saveToSourceFolderCheckBox->isChecked() != m_settings->outputToSourceDir()) saveToSourceFolderCheckBox->click(); while(saveToSourceFolderCheckBox->isChecked() != m_settings->outputToSourceDir()) saveToSourceFolderCheckBox->click();
prependRelativePathCheckBox->setChecked(m_settings->prependRelativeSourcePath()); prependRelativePathCheckBox->setChecked(m_settings->prependRelativeSourcePath());
connect(outputFolderView, SIGNAL(clicked(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex))); connect(outputFolderView, SIGNAL(clicked(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex)));
@ -819,11 +820,26 @@ void MainWindow::resizeEvent(QResizeEvent *event)
*/ */
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)
{
if(QApplication::overrideCursor() == NULL)
{ {
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 == outputFolderView)
{
switch(event->type())
{
case QEvent::Enter:
case QEvent::Leave:
case QEvent::KeyPress:
case QEvent::KeyRelease:
outputFolderViewClicked(outputFolderView->currentIndex());
break;
}
}
else if(obj == outputFolderLabel) else if(obj == outputFolderLabel)
{ {
switch(event->type()) switch(event->type())