From f6e936879299c2b4b02055cfe0d86007871d0c71 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 14 Jun 2016 00:52:03 +0200 Subject: [PATCH] Improve details in the GUI --- gui/mainwindow.cpp | 6 +-- gui/tageditorwidget.cpp | 8 ++- misc/htmlinfo.cpp | 2 +- translations/tageditor_de_DE.ts | 88 ++++++++++++++++++--------------- translations/tageditor_en_US.ts | 88 ++++++++++++++++++--------------- 5 files changed, 109 insertions(+), 83 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 9906f85..d8a6807 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -348,7 +348,7 @@ void MainWindow::showRenameFilesDlg() void MainWindow::selectNextFile() { QItemSelectionModel *selectionModel = m_ui->filesTreeView->selectionModel(); - QModelIndexList selectedIndexes = selectionModel->selectedIndexes(); + const QModelIndexList selectedIndexes = selectionModel->selectedIndexes(); if(!selectedIndexes.isEmpty()) { selectNextFile(selectionModel, selectedIndexes.at(0), false); } @@ -367,8 +367,8 @@ void MainWindow::selectNextFile(QItemSelectionModel *selectionModel, const QMode // a directory is selected -> go deeper if(m_fileFilterModel->canFetchMore(currentIndex)) { // files and subdirectories have to be fetched - // -> QFileSystemModel seems to use an extra thread to fetch files and directories - // -> fetchMore will return immediatly because + // -> QFileSystemModel seems to fetch files and directories async + // -> hence fetchMore will return immediatly // -> select next file when rowsInserted is emitted auto conn = make_shared(); *conn = connect(m_fileFilterModel, &QAbstractItemModel::rowsInserted, [this, selectionModel, currentIndex, conn] (const QModelIndex &parent, int, int) { diff --git a/gui/tageditorwidget.cpp b/gui/tageditorwidget.cpp index 9d03fbf..f02e28d 100644 --- a/gui/tageditorwidget.cpp +++ b/gui/tageditorwidget.cpp @@ -823,7 +823,13 @@ void TagEditorWidget::showFile(char result) // update status updateFileStatusStatus(); static const QString statusMsg(tr("The file could not be opened because an IO error occurred.")); - QMessageBox::critical(this, windowTitle(), statusMsg); + auto msgBox = new QMessageBox(this); + msgBox->setIcon(QMessageBox::Critical); + msgBox->setAttribute(Qt::WA_DeleteOnClose, true); + msgBox->setWindowTitle(tr("Opening file - %1").arg(windowTitle())); + msgBox->setText(statusMsg); + msgBox->setInformativeText(tr("Opening file: ") + m_currentPath); + msgBox->show(); emit statusMessage(statusMsg); } else { // update webview diff --git a/misc/htmlinfo.cpp b/misc/htmlinfo.cpp index 6c82da4..a93b91a 100644 --- a/misc/htmlinfo.cpp +++ b/misc/htmlinfo.cpp @@ -536,7 +536,7 @@ public: rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Size"), qstr(dataSizeToString(track->size(), true))); } if(!track->duration().isNull()) { - rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Duration"), qstr(track->duration().toString(TimeSpanOutputFormat::WithMeasures))); + rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Duration"), qstr(track->duration().toString(TimeSpanOutputFormat::WithMeasures)) % QStringLiteral(" (") % QString::number(track->duration().totalTicks()) % QChar(')')); } if(track->bitrate()) { rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Avg. bitrate"), qstr(bitrateToString(track->bitrate()))); diff --git a/translations/tageditor_de_DE.ts b/translations/tageditor_de_DE.ts index 1620c78..b300829 100644 --- a/translations/tageditor_de_DE.ts +++ b/translations/tageditor_de_DE.ts @@ -2509,7 +2509,7 @@ Error in line %1: %3 QtGui::SettingsDialog - + Necessary for lupdate. @@ -2611,7 +2611,7 @@ the file reverting all unsaved changings. - + Abort @@ -2773,107 +2773,117 @@ the file reverting all unsaved changings. - + + Opening file - %1 + + + + + Opening file: + + + + File could be parsed correctly. - + File couldn't be parsed correctly. - + There are critical parsing notifications. - + There are warnings. - + No write access; the file has been opened in read-only mode. - + File format is not supported (an ID3 tag can be added anyways). - + The file is composed of multiple segments. Dealing with such files has not been tested yet and might be broken. - + There is no (supported) tag assigned. - + The file %1 has been opened. - + Saving tags ... - + No file has been opened. - + Unable to apply the entered tags to the file because the current process hasn't finished yet. - + Do you really want to delete all tags from the file? - + don't show this message again - + Deleting all tags ... - + The selected file stores no tag (at least no supported), so there is nothing to delete. - + No file has been opened, so no tags can be deleted. - + Unable to delete all tags from the file because the current process hasn't been finished yet. - + Cancelling ... - + Unable to start saving process because there an other process hasn't finished yet. - + The tags have been saved, but there is/are %1 warning(s) @@ -2881,7 +2891,7 @@ the file reverting all unsaved changings. - + and %1 error(s). @@ -2889,7 +2899,7 @@ the file reverting all unsaved changings. - + The tags have been saved, but there is/are %1 warning(s). @@ -2897,72 +2907,72 @@ the file reverting all unsaved changings. - + The tags have been saved. - + The tags couldn't be saved. See the info box for detail. - + The tags couldn't be saved because an IO error occured. - + Automatic tag management - + The container format of the selected file is not supported. The file can be treated as MP3 file (an ID3 tag according to the settings will be created). This might break the file. Do you want to continue? - + Treat file as MP3 file - + The currently opened file changed on the disk. - + A tag (with the selected target) already exists. - + The tag can not be created. - + Unable to remove the tag because no file is opened. - + Unable to remove the tag because the current process hasn't been finished yet. - + Unable to change the target because no file is opened. - + Can not change the target of the selected tag because the tag does not support targets. - + Unable to change the target because the current process hasn't been finished yet. diff --git a/translations/tageditor_en_US.ts b/translations/tageditor_en_US.ts index 0b7225e..7acd42a 100644 --- a/translations/tageditor_en_US.ts +++ b/translations/tageditor_en_US.ts @@ -2509,7 +2509,7 @@ Error in line %1: %3 QtGui::SettingsDialog - + Necessary for lupdate. @@ -2611,7 +2611,7 @@ the file reverting all unsaved changings. - + Abort @@ -2773,107 +2773,117 @@ the file reverting all unsaved changings. - + + Opening file - %1 + + + + + Opening file: + + + + File could be parsed correctly. - + File couldn't be parsed correctly. - + There are critical parsing notifications. - + There are warnings. - + No write access; the file has been opened in read-only mode. - + File format is not supported (an ID3 tag can be added anyways). - + The file is composed of multiple segments. Dealing with such files has not been tested yet and might be broken. - + There is no (supported) tag assigned. - + The file %1 has been opened. - + Saving tags ... - + No file has been opened. - + Unable to apply the entered tags to the file because the current process hasn't finished yet. - + Do you really want to delete all tags from the file? - + don't show this message again - + Deleting all tags ... - + The selected file stores no tag (at least no supported), so there is nothing to delete. - + No file has been opened, so no tags can be deleted. - + Unable to delete all tags from the file because the current process hasn't been finished yet. - + Cancelling ... - + Unable to start saving process because there an other process hasn't finished yet. - + The tags have been saved, but there is/are %1 warning(s) @@ -2881,7 +2891,7 @@ the file reverting all unsaved changings. - + and %1 error(s). @@ -2889,7 +2899,7 @@ the file reverting all unsaved changings. - + The tags have been saved, but there is/are %1 warning(s). @@ -2897,72 +2907,72 @@ the file reverting all unsaved changings. - + The tags have been saved. - + The tags couldn't be saved. See the info box for detail. - + The tags couldn't be saved because an IO error occured. - + Automatic tag management - + The container format of the selected file is not supported. The file can be treated as MP3 file (an ID3 tag according to the settings will be created). This might break the file. Do you want to continue? - + Treat file as MP3 file - + The currently opened file changed on the disk. - + A tag (with the selected target) already exists. - + The tag can not be created. - + Unable to remove the tag because no file is opened. - + Unable to remove the tag because the current process hasn't been finished yet. - + Unable to change the target because no file is opened. - + Can not change the target of the selected tag because the tag does not support targets. - + Unable to change the target because the current process hasn't been finished yet.