Changeset 33702 in vbox
- Timestamp:
- Nov 2, 2010 5:52:06 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
-
nls/VirtualBox_en.ts (modified) (7 diffs)
-
src/globals/VBoxGlobal.cpp (modified) (1 diff)
-
src/globals/VBoxGlobal.h (modified) (1 diff)
-
src/globals/VBoxProblemReporter.cpp (modified) (1 diff)
-
src/globals/VBoxProblemReporter.h (modified) (1 diff)
-
src/wizards/exportappliance/UIExportApplianceWzd.cpp (modified) (7 diffs)
-
src/wizards/exportappliance/UIExportApplianceWzd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_en.ts
r29735 r33702 5 5 <name>VBoxGlobal</name> 6 6 <message numerus="yes"> 7 <location filename="../src/globals/VBoxGlobal.h" line=" 377"/>7 <location filename="../src/globals/VBoxGlobal.h" line="201"/> 8 8 <source>%n year(s)</source> 9 9 <translation> … … 13 13 </message> 14 14 <message numerus="yes"> 15 <location filename="../src/globals/VBoxGlobal.h" line=" 382"/>15 <location filename="../src/globals/VBoxGlobal.h" line="206"/> 16 16 <source>%n month(s)</source> 17 17 <translation> … … 21 21 </message> 22 22 <message numerus="yes"> 23 <location filename="../src/globals/VBoxGlobal.h" line=" 387"/>23 <location filename="../src/globals/VBoxGlobal.h" line="211"/> 24 24 <source>%n day(s)</source> 25 25 <translation> … … 29 29 </message> 30 30 <message numerus="yes"> 31 <location filename="../src/globals/VBoxGlobal.h" line=" 392"/>31 <location filename="../src/globals/VBoxGlobal.h" line="216"/> 32 32 <source>%n hour(s)</source> 33 33 <translation> … … 37 37 </message> 38 38 <message numerus="yes"> 39 <location filename="../src/globals/VBoxGlobal.h" line=" 402"/>39 <location filename="../src/globals/VBoxGlobal.h" line="226"/> 40 40 <source>%n second(s)</source> 41 41 <translation> … … 45 45 </message> 46 46 <message numerus="yes"> 47 <location filename="../src/globals/VBoxGlobal.h" line=" 397"/>47 <location filename="../src/globals/VBoxGlobal.h" line="221"/> 48 48 <source>%n minute(s)</source> 49 49 <translation> … … 54 54 </context> 55 55 <context> 56 <name>VBoxProblemReporter</name> 57 <message numerus="yes"> 58 <location filename="../src/globals/VBoxProblemReporter.cpp" line="2340"/> 59 <source><p>The virtual machine(s) <b>%1</b> are currently in a saved state.</p><p>If you continue the runtime state of the exported machine(s) will be discarded. Note that the existing machine(s) are not changed.</p></source> 60 <translation> 61 <numerusform><p>The virtual machine <b>%1</b> is currently in a saved state.</p><p>If you continue the runtime state of the exported machine will be discarded. Note that the existing machine is not changed.</p></numerusform> 62 <numerusform><p>The virtual machines <b>%1</b> are currently in a saved state.</p><p>If you continue the runtime state of the exported machines will be discarded. Note that the existing machines are not changed.</p></numerusform> 63 </translation> 64 </message> 65 </context> 66 <context> 56 67 <name>VBoxTakeSnapshotDlg</name> 57 68 <message numerus="yes"> 58 <location filename="../src/VBoxTakeSnapshotDlg.cpp" line=" 87"/>69 <location filename="../src/VBoxTakeSnapshotDlg.cpp" line="74"/> 59 70 <source>Warning: You are taking a snapshot of a running machine which has %n immutable image(s) attached to it. As long as you are working from this snapshot the immutable image(s) will not be reset to avoid loss of data.</source> 60 71 <translation> -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r33631 r33702 3399 3399 .arg (tr ("PB", "size suffix PBytes=1024 TBytes")); 3400 3400 return regexp; 3401 } 3402 3403 /* static */ 3404 QString VBoxGlobal::toHumanReadableList(const QStringList &list) 3405 { 3406 QString strList; 3407 if (list.size() == 1) 3408 strList = list.at(0); 3409 else if (list.size() > 1) 3410 { 3411 for (int i = 0; i < list.size() - 1; ++i) 3412 { 3413 strList += list.at(i); 3414 if (i < list.size() - 2) 3415 strList += + ", "; 3416 } 3417 strList += " " + tr("and") + " " + list.at(list.size() - 1); 3418 }else 3419 return strList; 3401 3420 } 3402 3421 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r33631 r33702 617 617 static QString sizeRegexp(); 618 618 619 static QString toHumanReadableList(const QStringList &list); 620 619 621 static quint64 parseSize (const QString &); 620 622 static QString formatSize (quint64 aSize, uint aDecimal = 2, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r33670 r33702 2335 2335 } 2336 2336 2337 bool VBoxProblemReporter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget * /* aParent = NULL */) const 2338 { 2339 return messageOkCancel(mainWindowShown(), Warning, 2340 tr("<p>The virtual machine(s) <b>%1</b> are currently in a saved state.</p>" 2341 "<p>If you " 2342 "continue the runtime state of the exported machine(s) will be " 2343 "discarded. Note that the existing machine(s) are not " 2344 "changed.</p>", "", machineNames.size()).arg(VBoxGlobal::toHumanReadableList(machineNames)), 2345 0 /* aAutoConfirmId */, 2346 tr("Continue"), tr("Cancel")); 2347 } 2348 2337 2349 void VBoxProblemReporter::cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent /* = NULL */) const 2338 2350 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r33670 r33702 368 368 void cannotRemoveFiles (const CProgress &aProgress, QWidget *aParent = NULL) const; 369 369 370 bool confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *aParent = NULL) const; 370 371 void cannotExportAppliance (CAppliance *aAppliance, QWidget *aParent = NULL) const; 371 372 void cannotExportAppliance (const CMachine &aMachine, CAppliance *aAppliance, QWidget *aParent = NULL) const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp
r33540 r33702 30 30 public: 31 31 32 VMListWidgetItems(QPixmap &pixIcon, QString &strText, Q ListWidget *pParent)32 VMListWidgetItems(QPixmap &pixIcon, QString &strText, QString strUuid, bool fInSaveState, QListWidget *pParent) 33 33 : QListWidgetItem(pixIcon, strText, pParent) 34 , m_strUuid(strUuid) 35 , m_fInSaveState(fInSaveState) 34 36 { 35 37 } … … 40 42 return text().toLower() < other.text().toLower(); 41 43 } 44 45 QString uuid() { return m_strUuid; } 46 bool isInSaveState() { return m_fInSaveState; } 47 48 private: 49 QString m_strUuid; 50 bool m_fInSaveState; 42 51 }; 43 52 … … 152 161 } 153 162 163 bool UIExportApplianceWzdPage1::validatePage() 164 { 165 /* Ask user about disk-less machine */ 166 QStringList savedMachines; 167 QList<QListWidgetItem*> pItems = m_pVMSelector->selectedItems(); 168 for (int i=0; i < pItems.size(); ++i) 169 { 170 if (static_cast<VMListWidgetItems*>(pItems.at(i))->isInSaveState()) 171 savedMachines << pItems.at(i)->text(); 172 } 173 174 if (!savedMachines.isEmpty()) 175 return vboxProblem().confirmExportMachinesInSaveState(savedMachines, this); 176 177 return true; 178 } 179 154 180 int UIExportApplianceWzdPage1::nextId() const 155 181 { … … 167 193 { 168 194 m_MachineNames << item->text(); 169 m_MachineIDs << item->data(Qt::UserRole).toString();195 m_MachineIDs << static_cast<VMListWidgetItems*>(item)->uuid(); 170 196 } 171 197 /* Revalidate page */ … … 181 207 QString strName; 182 208 QString strUuid; 183 bool bEnabled; 209 bool fInSaveState = false; 210 bool fEnabled = false; 184 211 if (m.GetAccessible()) 185 212 { … … 187 214 strName = m.GetName(); 188 215 strUuid = m.GetId(); 189 bEnabled = m.GetSessionState() == KSessionState_Unlocked; 216 fEnabled = m.GetSessionState() == KSessionState_Unlocked; 217 fInSaveState = m.GetState() == KMachineState_Saved; 190 218 } 191 219 else … … 193 221 QString settingsFile = m.GetSettingsFilePath(); 194 222 QFileInfo fi(settingsFile); 195 strName = fi.completeSuffix().toLower() == "xml"? fi.completeBaseName() : fi.fileName();223 strName = (fi.completeSuffix().toLower() == "xml" || fi.completeSuffix().toLower() == "vbox") ? fi.completeBaseName() : fi.fileName(); 196 224 pixIcon = QPixmap(":/os_other.png").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 197 bEnabled = false; 198 } 199 QListWidgetItem *item = new VMListWidgetItems(pixIcon, strName, m_pVMSelector); 200 item->setData(Qt::UserRole, strUuid); 201 if (!bEnabled) 225 } 226 QListWidgetItem *item = new VMListWidgetItems(pixIcon, strName, strUuid, fInSaveState, m_pVMSelector); 227 if (!fEnabled) 202 228 item->setFlags(0); 203 229 m_pVMSelector->addItem(item); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.h
r33438 r33702 77 77 78 78 bool isComplete() const; 79 bool validatePage(); 79 80 80 81 int nextId() const;
Note:
See TracChangeset
for help on using the changeset viewer.

