Changeset 17714 in vbox
- Timestamp:
- Mar 11, 2009 5:33:35 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 44226
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFilePathSelectorWidget.h
r17475 r17714 63 63 QString fileFilters() const; 64 64 65 void setDefaultSaveExt (const QString &aExt); 66 QString defaultSaveExt() const; 67 65 68 void resetModified(); 66 69 bool isModified() const; … … 107 110 QString mHomeDir; 108 111 QString mFileFilters; 112 QString mDefaultSaveExt; 109 113 QString mFileDialogTitle; 110 114 QString mNoneStr; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r17669 r17714 36 36 #include <QProcess> 37 37 #include <QHash> 38 #include <QDesktopServices> 39 #include <QDir> 38 40 39 41 class QAction; … … 731 733 } 732 734 735 static inline QString documentsPath() 736 { 737 QString path; 738 #if QT_VERSION < 0x040400 739 path = QDir::homePath(); 740 #else 741 path = QDesktopServices::storageLocation (QDesktopServices::DocumentsLocation); 742 #endif 743 return QDir::cleanPath (path); 744 } 745 733 746 signals: 734 747 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxExportApplianceWzd.cpp
r17475 r17714 26 26 #include "VBoxProblemReporter.h" 27 27 28 /* Qt includes */29 #include <QDir>30 31 28 class VMListWidgetItems: public QListWidgetItem 32 29 { … … 76 73 mFileSelector->setFileDialogTitle (tr ("Select a file to export into")); 77 74 mFileSelector->setFileFilters (tr ("Open Virtualization Format (%1)").arg ("*.ovf")); 75 mFileSelector->setDefaultSaveExt ("ovf"); 78 76 #ifdef Q_WS_MAC 79 77 /* Editable boxes are uncommon on the Mac */ … … 151 149 name = mVMListWidget->selectedItems().first()->text(); 152 150 153 mFileSelector->setPath (QDir::toNativeSeparators (QString ("%1/%2.ovf").arg ( QDir::currentPath())151 mFileSelector->setPath (QDir::toNativeSeparators (QString ("%1/%2.ovf").arg (vboxGlobal().documentsPath()) 154 152 .arg (name))); 155 153 mWValFileSelector->revalidate(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFilePathSelectorWidget.cpp
r17475 r17714 190 190 } 191 191 192 void VBoxFilePathSelectorWidget::setDefaultSaveExt (const QString &aExt) 193 { 194 mDefaultSaveExt = aExt; 195 } 196 197 QString VBoxFilePathSelectorWidget::defaultSaveExt() const 198 { 199 return mDefaultSaveExt; 200 } 201 192 202 /** 193 203 * Returns @c true if the selected (active) combobox item is a path item. … … 377 387 path = VBoxGlobal::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break; 378 388 case Mode_File_Save: 379 path = VBoxGlobal::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break; 389 { 390 path = VBoxGlobal::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); 391 if (QFileInfo (path).suffix().isEmpty()) 392 path = QString ("%1.%2").arg (path).arg (mDefaultSaveExt); 393 break; 394 } 380 395 case Mode_Folder: 381 396 path = VBoxGlobal::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp
r17475 r17714 45 45 mFileSelector->setFileDialogTitle (tr ("Select an appliance to import")); 46 46 mFileSelector->setFileFilters (tr ("Open Virtualization Format (%1)").arg ("*.ovf")); 47 mFileSelector->setHomeDir (vboxGlobal().documentsPath()); 47 48 #ifdef Q_WS_MAC 48 49 /* Editable boxes are uncommon on the Mac */
Note:
See TracChangeset
for help on using the changeset viewer.