352 |
352 |
353 |
353 |
354 void FmBackupWidget::on_changeTargetDrive() |
354 void FmBackupWidget::on_changeTargetDrive() |
355 { |
355 { |
356 QString title = constFileManagerBackupSettingsTitleTargetDrive; |
356 QString title = constFileManagerBackupSettingsTitleTargetDrive; |
357 QStringList queryStringList; |
357 QString drive = FmDlgUtils::showBackupDriveQuery( title ); |
358 QStringList driveStringList; |
358 if( !drive.isEmpty() && |
359 |
359 mBackupSettings->targetDrive().compare( drive, Qt::CaseInsensitive ) != 0 ) { |
360 QStringList driveList; |
360 mBackupSettings->setTargetDrive( drive ); |
361 //FmUtils::getDriveList( driveList, true ); |
|
362 FmViewManager::viewManager()->operationService()->backupRestoreHandler()->getBackupDriveList( driveList ); |
|
363 QString targetDrive = mBackupSettings->targetDrive(); |
|
364 int selectIndex = -1; |
|
365 |
|
366 int currentIndex = 0; |
|
367 for( QStringList::const_iterator it = driveList.begin(); it != driveList.end(); ++it ) |
|
368 { |
|
369 QString drive = (*it); |
|
370 drive = FmUtils::removePathSplash( drive ); |
|
371 QString driveWithVolume = FmUtils::fillDriveVolume( drive, true ); |
|
372 |
|
373 driveStringList.push_back( drive ); |
|
374 queryStringList.push_back( driveWithVolume ); |
|
375 |
|
376 if( drive == targetDrive ) |
|
377 { |
|
378 // adjust index offset against drive. |
|
379 selectIndex = currentIndex; |
|
380 } |
|
381 ++currentIndex; |
|
382 } |
|
383 |
|
384 if( FmDlgUtils::showSingleSettingQuery( title, queryStringList, selectIndex ) ) |
|
385 { |
|
386 mBackupSettings->setTargetDrive( driveStringList.at( selectIndex ) ); |
|
387 emit doModelRefresh(); |
361 emit doModelRefresh(); |
388 } |
362 } |
389 } |
363 } |
390 |
364 |
391 void FmBackupWidget::updateBackupDate() |
365 void FmBackupWidget::updateBackupDate() |