hideColumns();
fileUtil = new FileUtil(this);
-
initProgressDialog();
+
// do not move to parent class:
connectSignals();
}
{
DbObjectDialog::connectSignals();
connect(scanButton, SIGNAL(clicked()), this, SLOT(beginScanFilePath()));
- connect(fileUtil, SIGNAL(dbUpdateFinished()), this, SLOT(hideDbUpdating()));
- connect(fileUtil, SIGNAL(dbUpdateInProgress()), this, SLOT(showDbUpdating()));
-}
-
-void MediaImagePathMainDialog::showDbUpdating()
-{
- qDebug() << "DB updating";
- // TODO: the following is not currently working
- progressDialog->setWindowTitle(tr("Updating DB... please wait!"));
- progressDialog->setEnabled(false);
}
-void MediaImagePathMainDialog::hideDbUpdating()
-{
- qDebug() << "DB update finished";
- // TODO: the following is not currently working
- progressDialog->setEnabled(true);
- progressDialog->setWindowTitle(tr("Scanning files"));
-}
-
-
void MediaImagePathMainDialog::initEditDialog()
{
nameDialog = new MediaImagePathDialog(this, dynamic_cast<FilePathObject*>(dbObject));
dbMediaImageContainer->removeFromFilePath(fpo->getId());
progressDialog->show();
- progressDialog->setEnabled(true);
setUIEnabled(false);
int count = fileUtil->scanFilePath(fpo, l, dbMediaImageContainer, progressDialog);
if (containers.count() >= MIC_BUFFER_SIZE) {
//qDebug() << "We have " << containers.count() << " containers .. storing to db.";
- emit dbUpdateInProgress();
+ showDbUpdating(progressDialog);
dbMic->storeContainers(containers, fp);
- emit dbUpdateFinished();
+ hideDbUpdating(progressDialog);
qDeleteAll(containers);
containers.clear();
//qDebug() << "containers now: " << containers.count();
progressDialog->setValue(list.size());
if (containers.count() > 0) {
//qDebug() << "Storing the rest " << containers.count() << " containers.";
- emit dbUpdateInProgress();
+ //emit dbUpdateInProgress();
+ showDbUpdating(progressDialog);
dbMic->storeContainers(containers, fp);
- emit dbUpdateFinished();
+ hideDbUpdating(progressDialog);
+ //emit dbUpdateFinished();
qDeleteAll(containers);
containers.clear();
-
- }
- } catch (EmuFrontException &e) {
- qDebug() << "Got exception " << e.what() << ", aborting & deleting created data objects.";
+ } } catch (EmuFrontException &e) { qDebug() << "Got exception " << e.what() << ", aborting & deleting created data objects.";
qDeleteAll(containers);
throw e;
}
QString ext = filename.section('.', -1);
return supportedFileExtensions.contains(ext, Qt::CaseInsensitive);
}
+
+void FileUtil::showDbUpdating(QProgressDialog *progressDialog)
+{
+ qDebug() << "DB updating";
+ // TODO: the following is not currently working
+ progressDialog->setWindowTitle(tr("Updating DB... please wait!"));
+ progressDialog->setEnabled(false);
+}
+
+void FileUtil::hideDbUpdating(QProgressDialog *progressDialog)
+{
+ qDebug() << "DB update finished";
+ // TODO: the following is not currently working
+ progressDialog->setEnabled(true);
+ progressDialog->setWindowTitle(tr("Scanning files"));
+}
+