Minor bugfixes
[someplayer] / src / managelibraryform.cpp
index 2fcd474..171d39c 100644 (file)
@@ -63,7 +63,7 @@ ManageLibraryForm::~ManageLibraryForm()
 }
 
 void ManageLibraryForm::_add() {
-       QString directory = QFileDialog::getExistingDirectory (this, "Select directory", DEFAULT_PATH_PREFIX, QFileDialog::ShowDirsOnly );
+       QString directory = QFileDialog::getExistingDirectory (this, tr("Select directory"), DEFAULT_PATH_PREFIX, QFileDialog::ShowDirsOnly );
        if (!directory.isEmpty()) {
                _library->addDirectory(directory);
        }
@@ -120,6 +120,10 @@ void ManageLibraryForm::_process_selection(QItemSelection selected, QItemSelecti
 void ManageLibraryForm::_delete_selected() {
        QList<QString> directories;
        QModelIndexList idx = ui->dirView->selectionModel()->selectedIndexes();
+       if (idx.count() == 0) {
+               return;
+       }
+       CONFIRM_ACTION(this, tr("Delete selected directories?"))
        foreach (QModelIndex id, idx) {
                if (id.column() == 1) {
                        QString path = id.data().toString();
@@ -138,6 +142,7 @@ void ManageLibraryForm::_delete_selected() {
 }
 
 void ManageLibraryForm::_update_selected() {
+       CONFIRM_ACTION(this, tr("Update selected directories? It may takes several minutes"))
        QList<QString> directories;
        QModelIndexList idx = ui->dirView->selectionModel()->selectedIndexes();
        foreach (QModelIndex id, idx) {
@@ -157,7 +162,12 @@ void ManageLibraryForm::_update_selected() {
 }
 
 void ManageLibraryForm::_update_all() {
+       CONFIRM_ACTION(this, tr("Update all library? It may takes a long time"))
        _library->updateAll();
        refresh();
        emit refreshLibrary();
 }
+
+void ManageLibraryForm::updateTranslations() {
+       ui->retranslateUi(this);
+}