Changeset 35897 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 8, 2011 1:25:30 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp
r35634 r35897 79 79 const char* VBoxDefs::GUI_Export_Bucket = "GUI/Export/Bucket"; 80 80 const char* VBoxDefs::GUI_PreventBetaWarning = "GUI/PreventBetaWarning"; 81 const char* VBoxDefs::GUI_RecentFolderHD = "GUI/RecentFolderHD"; 82 const char* VBoxDefs::GUI_RecentFolderCD = "GUI/RecentFolderCD"; 83 const char* VBoxDefs::GUI_RecentFolderFD = "GUI/RecentFolderFD"; 81 84 const char* VBoxDefs::GUI_RecentListHD = "GUI/RecentListHD"; 82 85 const char* VBoxDefs::GUI_RecentListCD = "GUI/RecentListCD"; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h
r35634 r35897 155 155 static const char* GUI_PreventBetaWarning; 156 156 157 static const char* GUI_RecentFolderHD; 158 static const char* GUI_RecentFolderCD; 159 static const char* GUI_RecentFolderFD; 157 160 static const char* GUI_RecentListHD; 158 161 static const char* GUI_RecentListCD; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r35894 r35897 2634 2634 { 2635 2635 /* Initialize variables: */ 2636 QString strHomeFolder = fUseLastFolder && !m_strLastFolder.isEmpty() ? m_strLastFolder :2637 strDefaultFolder.isEmpty() ? vboxGlobal().virtualBox().GetHomeFolder() : strDefaultFolder;2638 2636 QList < QPair <QString, QString> > filters; 2639 2637 QStringList backends; … … 2642 2640 QString strTitle; 2643 2641 QString allType; 2642 QString strLastFolder; 2644 2643 switch (mediumType) 2645 2644 { … … 2649 2648 strTitle = tr ("Choose a virtual hard disk file"); 2650 2649 allType = tr ("hard disk"); 2650 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderHD); 2651 if (strLastFolder.isEmpty()) 2652 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderCD); 2653 if (strLastFolder.isEmpty()) 2654 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderFD); 2651 2655 break; 2652 2656 } … … 2656 2660 strTitle = tr ("Choose a virtual CD/DVD disk file"); 2657 2661 allType = tr ("CD/DVD-ROM disk"); 2662 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderCD); 2663 if (strLastFolder.isEmpty()) 2664 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderHD); 2665 if (strLastFolder.isEmpty()) 2666 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderFD); 2658 2667 break; 2659 2668 } … … 2663 2672 strTitle = tr ("Choose a virtual floppy disk file"); 2664 2673 allType = tr ("floppy disk"); 2674 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderFD); 2675 if (strLastFolder.isEmpty()) 2676 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderCD); 2677 if (strLastFolder.isEmpty()) 2678 strLastFolder = virtualBox().GetExtraData(VBoxDefs::GUI_RecentFolderHD); 2665 2679 break; 2666 2680 } … … 2668 2682 break; 2669 2683 } 2684 QString strHomeFolder = fUseLastFolder && !strLastFolder.isEmpty() ? strLastFolder : 2685 strDefaultFolder.isEmpty() ? vboxGlobal().virtualBox().GetHomeFolder() : strDefaultFolder; 2670 2686 2671 2687 /* Prepare filters and backends: */ … … 2703 2719 2704 2720 /* Remember the path of the last chosen medium: */ 2705 m_strLastFolder = QFileInfo(strMediumLocation).absolutePath(); 2721 QString strRecentFolderKey = mediumType == VBoxDefs::MediumType_HardDisk ? VBoxDefs::GUI_RecentFolderHD : 2722 mediumType == VBoxDefs::MediumType_DVD ? VBoxDefs::GUI_RecentFolderCD : 2723 mediumType == VBoxDefs::MediumType_Floppy ? VBoxDefs::GUI_RecentFolderFD : 2724 QString(); 2725 vbox.SetExtraData(strRecentFolderKey, QFileInfo(strMediumLocation).absolutePath()); 2706 2726 2707 2727 /* Update recently used list: */ 2708 QString strRecent Address= mediumType == VBoxDefs::MediumType_HardDisk ? VBoxDefs::GUI_RecentListHD :2728 QString strRecentListKey = mediumType == VBoxDefs::MediumType_HardDisk ? VBoxDefs::GUI_RecentListHD : 2709 2729 mediumType == VBoxDefs::MediumType_DVD ? VBoxDefs::GUI_RecentListCD : 2710 2730 mediumType == VBoxDefs::MediumType_Floppy ? VBoxDefs::GUI_RecentListFD : 2711 2731 QString(); 2712 QStringList recentMediumList = v irtualBox().GetExtraData(strRecentAddress).split(';');2732 QStringList recentMediumList = vbox.GetExtraData(strRecentListKey).split(';'); 2713 2733 if (recentMediumList.contains(strMediumLocation)) 2714 2734 recentMediumList.removeAll(strMediumLocation); 2715 2735 recentMediumList.prepend(strMediumLocation); 2716 2736 while(recentMediumList.size() > 5) recentMediumList.removeLast(); 2717 v irtualBox().SetExtraData(strRecentAddress, recentMediumList.join(";"));2737 vbox.SetExtraData(strRecentListKey, recentMediumList.join(";")); 2718 2738 2719 2739 /* Open corresponding medium: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r35564 r35897 862 862 QString mUserDefinedPortName; 863 863 864 mutable QString m_strLastFolder;865 866 864 QPixmap mWarningIcon, mErrorIcon; 867 865
Note:
See TracChangeset
for help on using the changeset viewer.