Changeset 28755 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 26, 2010 3:23:04 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp
r26719 r28755 7 7 8 8 /* 9 * Copyright (C) 2006-20 09Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 167 167 adjustText(); 168 168 recacheToolTip(); 169 } 170 171 KMachineState getCurrentState() 172 { 173 if (mMachine.isNull()) 174 return KMachineState_Null; 175 176 return mMachineState; 169 177 } 170 178 … … 439 447 bool busy = mSessionState != KSessionState_Closed; 440 448 441 /* Enable/disable snapshot actions */ 442 mSnapshotActionGroup->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem()); 449 /* Machine state of the current state item */ 450 KMachineState s = KMachineState_Null; 451 if (curStateItem()) 452 s = curStateItem()->getCurrentState(); 453 454 /* Enable/disable restoring snapshot */ 455 mRestoreSnapshotAction->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem()); 456 457 /* Enable/disable deleting snapshot */ 458 mDeleteSnapshotAction->setEnabled ( ( !busy 459 || s == KMachineState_PoweredOff 460 || s == KMachineState_Saved 461 || s == KMachineState_Aborted 462 || s == KMachineState_Running 463 || s == KMachineState_Paused) 464 && mCurSnapshotItem && item && !item->isCurrentStateItem()); 443 465 444 466 /* Enable/disable the details action regardles of the session state */ … … 534 556 if (!vboxProblem().askAboutSnapshotDeleting (snapshot.GetName())) 535 557 return; 558 559 /** @todo check available space on the target filesystem etc etc. */ 560 #if 0 561 if (!vboxProblem().askAboutSnapshotDeletingFreeSpace (snapshot.GetName(), 562 "/home/juser/.VirtualBox/Machines/SampleVM/Snapshots/{01020304-0102-0102-0102-010203040506}.vdi", 563 "59 GiB", 564 "15 GiB")) 565 return; 566 #endif 567 536 568 537 569 /* Open a direct session (this call will handle all errors) */ … … 799 831 mCurSnapshotItem->child (mCurSnapshotItem->childCount() - 1) : 800 832 mTreeWidget->invisibleRootItem()->child (0); 801 Assert (csi);802 833 return static_cast <SnapshotWgtItem*> (csi); 803 834 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r28731 r28755 1978 1978 1979 1979 QString item = QString (sSectionItemTpl2).arg (tr ("Base Memory", "details report"), 1980 tr ("<nobr>%1 M iB</nobr>", "details report"))1980 tr ("<nobr>%1 MB</nobr>", "details report")) 1981 1981 .arg (aMachine.GetMemorySize()) 1982 1982 + QString (sSectionItemTpl2).arg (tr ("Processor(s)", "details report"), … … 2011 2011 QString item = QString(sSectionItemTpl2) 2012 2012 .arg(tr ("Video Memory", "details report"), 2013 tr ("<nobr>%1 M iB</nobr>", "details report"))2013 tr ("<nobr>%1 MB</nobr>", "details report")) 2014 2014 .arg(aMachine.GetVRAMSize()); 2015 2015 ++rows; … … 3832 3832 /** 3833 3833 * Returns the regexp string that defines the format of the human-readable 3834 * size representation, <tt>####[.##] B| kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB</tt>.3834 * size representation, <tt>####[.##] B|KB|MB|GB|TB|PB</tt>. 3835 3835 * 3836 3836 * This regexp will capture 5 groups of text: … … 3847 3847 { 3848 3848 QString regexp = 3849 tr ("^(?:(?:(\\d+)(?:\\s?(B| kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB))?)|(?:(\\d*)%1(\\d{1,2})(?:\\s?(kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB))))$", "regexp for matching ####[.##] B|kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB, %1=decimal point")3849 tr ("^(?:(?:(\\d+)(?:\\s?(B|KB|MB|GB|TB|PB))?)|(?:(\\d*)%1(\\d{1,2})(?:\\s?(KB|MB|GB|TB|PB))))$", "regexp for matching ####[.##] B|KB|MB|GB|TB|PB, %1=decimal point") 3850 3850 .arg (decimalSep()); 3851 3851 return regexp; … … 3854 3854 /** 3855 3855 * Parses the given size string that should be in form of 3856 * <tt>####[.##] B| kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB</tt> and returns3856 * <tt>####[.##] B|KB|MB|GB|TB|PB</tt> and returns 3857 3857 * the size value in bytes. Zero is returned on error. 3858 3858 */ … … 3877 3877 if (suff.isEmpty() || suff == tr ("B", "size suffix Bytes")) 3878 3878 denom = 1; 3879 else if (suff == tr ("kB", "size suffix kBytes=1000 Bytes")) 3880 denom = 1000; 3881 else if ( suff == tr ("KiB", "size suffix KiBytes") 3882 || suff == tr ("KB", "size suffix legacy KB=KiBytes")) 3879 else if (suff == tr ("KB", "size suffix KBytes=1024 Bytes")) 3883 3880 denom = _1K; 3884 else if (suff == tr ("MB", "size suffix MBytes=1000 kBytes")) 3885 denom = 1000000; 3886 else if (suff == tr ("MiB", "size suffix MiBytes")) 3881 else if (suff == tr ("MB", "size suffix MBytes=1024 KBytes")) 3887 3882 denom = _1M; 3888 else if (suff == tr ("GB", "size suffix GBytes=1000 MBytes")) 3889 denom = 1000000000; 3890 else if (suff == tr ("GiB", "size suffix GiBytes")) 3883 else if (suff == tr ("GB", "size suffix GBytes=1024 MBytes")) 3891 3884 denom = _1G; 3892 else if (suff == tr ("TB", "size suffix TBytes=1000 GBytes")) 3893 denom = 1000000000000ULL; 3894 else if (suff == tr ("TiB", "size suffix TiBytes")) 3885 else if (suff == tr ("TB", "size suffix TBytes=1024 GBytes")) 3895 3886 denom = _1T; 3896 else if (suff == tr ("PB", "size suffix PBytes=1000 TBytes")) 3897 denom = 1000000000000000ULL; 3898 else if (suff == tr ("PiB", "size suffix PiBytes")) 3887 else if (suff == tr ("PB", "size suffix PBytes=1024 TBytes")) 3899 3888 denom = _1P; 3900 3889 … … 3914 3903 /** 3915 3904 * Formats the given @a aSize value in bytes to a human readable string 3916 * in form of <tt>####[.##] B|K iB|MiB|GiB|TiB|PiB</tt>.3905 * in form of <tt>####[.##] B|KB|MB|GB|TB|PB</tt>. 3917 3906 * 3918 3907 * The @a aMode and @a aDecimal parameters are used for rounding the resulting 3919 * number when converting the size value to K iB, MiB, etc gives a fractional part:3908 * number when converting the size value to KB, MB, etc gives a fractional part: 3920 3909 * <ul> 3921 3910 * <li>When \a aMode is FormatSize_Round, the result is rounded to the … … 3947 3936 static QString Suffixes [7]; 3948 3937 Suffixes[0] = tr ("B", "size suffix Bytes"); 3949 Suffixes[1] = tr ("K iB", "size suffix KiBytes");3950 Suffixes[2] = tr ("M iB", "size suffix MiBytes");3951 Suffixes[3] = tr ("G iB", "size suffix GiBytes");3952 Suffixes[4] = tr ("T iB", "size suffix TiBytes");3953 Suffixes[5] = tr ("P iB", "size suffix PiBytes");3938 Suffixes[1] = tr ("KB", "size suffix KBytes=1024 Bytes"); 3939 Suffixes[2] = tr ("MB", "size suffix MBytes=1024 KBytes"); 3940 Suffixes[3] = tr ("GB", "size suffix GBytes=1024 MBytes"); 3941 Suffixes[4] = tr ("TB", "size suffix TBytes=1024 GBytes"); 3942 Suffixes[5] = tr ("PB", "size suffix PBytes=1024 TBytes"); 3954 3943 Suffixes[6] = (const char *)NULL; 3955 3944 AssertCompile(6 < RT_ELEMENTS (Suffixes)); … … 4014 4003 decm = 0; 4015 4004 ++ intg; 4016 /* check if we've got 1024 X iB after rounding and scale down if so */4005 /* check if we've got 1024 XB after rounding and scale down if so */ 4017 4006 if (intg == 1024 && Suffixes [suffix + 1] != NULL) 4018 4007 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp
r28593 r28755 7 7 8 8 /* 9 * Copyright (C) 2006-20 08Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 894 894 } 895 895 896 bool VBoxProblemReporter::askAboutSnapshotDeletingFreeSpace (const QString &aSnapshotName, 897 const QString &aTargetImageName, 898 const QString &aTargetImageMaxSize, 899 const QString &aTargetFilesystemFree) 900 { 901 return messageOkCancel (mainWindowShown(), Question, 902 tr ("<p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, " 903 "however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in " 904 "corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting " 905 "the snapshot at your own risk.</p>") 906 .arg (aSnapshotName) 907 .arg (aTargetImageName) 908 .arg (aTargetImageMaxSize) 909 .arg (aTargetFilesystemFree), 910 /* Do NOT allow this message to be disabled! */ 911 NULL /* aAutoConfirmId */, 912 tr ("Delete"), tr ("Cancel")); 913 } 914 896 915 void VBoxProblemReporter::cannotRestoreSnapshot (const CConsole &aConsole, 897 916 const QString &aSnapshotName) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h
r27695 r28755 6 6 7 7 /* 8 * Copyright (C) 2006-20 08Sun Microsystems, Inc.8 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 215 215 bool askAboutSnapshotRestoring (const QString &aSnapshotName); 216 216 bool askAboutSnapshotDeleting (const QString &aSnapshotName); 217 bool askAboutSnapshotDeletingFreeSpace (const QString &aSnapshotName, 218 const QString &aTargetImageName, 219 const QString &aTargetImageMaxSize, 220 const QString &aTargetFilesystemFree); 217 221 void cannotRestoreSnapshot (const CConsole &aConsole, const QString &aSnapshotName); 218 222 void cannotRestoreSnapshot (const CProgress &aProgress, const QString &aSnapshotName); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp
r28731 r28755 267 267 268 268 CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties(); 269 mLbMemoryMin->setText (tr ("<qt>%1 M iB</qt>").arg (m_minVRAM));270 mLbMemoryMax->setText (tr ("<qt>%1 M iB</qt>").arg (m_maxVRAMVisible));269 mLbMemoryMin->setText (tr ("<qt>%1 MB</qt>").arg (m_minVRAM)); 270 mLbMemoryMax->setText (tr ("<qt>%1 MB</qt>").arg (m_maxVRAMVisible)); 271 271 mLbMonitorsMin->setText (tr ("<qt>%1</qt>").arg (1)); 272 272 mLbMonitorsMax->setText (tr ("<qt>%1</qt>").arg (sys.GetMaxGuestMonitors())); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.ui
r28731 r28755 145 145 </property> 146 146 <property name="text"> 147 <string>M iB</string>147 <string>MB</string> 148 148 </property> 149 149 </widget> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSystem.cpp
r28731 r28755 381 381 382 382 /* Retranslate the memory slider legend */ 383 mLbMemoryMin->setText (tr ("<qt>%1 M iB</qt>").arg (mSlMemory->minRAM()));384 mLbMemoryMax->setText (tr ("<qt>%1 M iB</qt>").arg (mSlMemory->maxRAM()));383 mLbMemoryMin->setText (tr ("<qt>%1 MB</qt>").arg (mSlMemory->minRAM())); 384 mLbMemoryMax->setText (tr ("<qt>%1 MB</qt>").arg (mSlMemory->maxRAM())); 385 385 386 386 /* Retranslate the cpu slider legend */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSystem.ui
r28731 r28755 145 145 </property> 146 146 <property name="text"> 147 <string>M iB</string>147 <string>MB</string> 148 148 </property> 149 149 </widget> -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxApplianceEditorWgt.cpp
r28731 r28755 220 220 } 221 221 case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription (mConfigValue); break; 222 case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("M iB", "size suffix MiBytes"); break;222 case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("MB", "size suffix MBytes=1024 KBytes"); break; 223 223 case KVirtualSystemDescriptionType_SoundCard: v = vboxGlobal().toString (static_cast<KAudioControllerType> (mConfigValue.toInt())); break; 224 224 case KVirtualSystemDescriptionType_NetworkAdapter: v = vboxGlobal().toString (static_cast<KNetworkAdapterType> (mConfigValue.toInt())); break; … … 399 399 QSpinBox *e = new QSpinBox (aParent); 400 400 e->setRange (VBoxApplianceEditorWgt::minGuestRAM(), VBoxApplianceEditorWgt::maxGuestRAM()); 401 e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("M iB", "size suffix MiBytes"));401 e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("MB", "size suffix MBytes=1024KBytes")); 402 402 editor = e; 403 403 break; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp
r28732 r28755 220 220 221 221 /* Setup size-editor field */ 222 m_pSizeEditor->setFixedWidthByText("88888.88 M iB");222 m_pSizeEditor->setFixedWidthByText("88888.88 MB"); 223 223 m_pSizeEditor->setAlignment(Qt::AlignRight); 224 224 m_pSizeEditor->setValidator(new QRegExpValidator(QRegExp(vboxGlobal().sizeRegexp()), this)); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r28732 r28755 281 281 QString strRecommendedRAM = field("type").value<CGuestOSType>().isNull() ? QString() : 282 282 QString::number(field("type").value<CGuestOSType>().GetRecommendedRAM()); 283 m_pPage3Text2->setText(tr("The recommended base memory size is <b>%1</b> M iB.").arg(strRecommendedRAM));283 m_pPage3Text2->setText(tr("The recommended base memory size is <b>%1</b> MB.").arg(strRecommendedRAM)); 284 284 285 285 /* Translate minimum & maximum 'ram' field values */ 286 m_pRamMin->setText(QString("%1 %2").arg(m_pRamSlider->minRAM()).arg(tr("M iB", "size suffix MiBytes")));287 m_pRamMax->setText(QString("%1 %2").arg(m_pRamSlider->maxRAM()).arg(tr("M iB", "size suffix MiBytes")));286 m_pRamMin->setText(QString("%1 %2").arg(m_pRamSlider->minRAM()).arg(tr("MB", "size suffix MBytes=1024 KBytes"))); 287 m_pRamMax->setText(QString("%1 %2").arg(m_pRamSlider->maxRAM()).arg(tr("MB", "size suffix MBytes=1024 KBytes"))); 288 288 } 289 289 … … 374 374 QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() : 375 375 QString::number(field("type").value<CGuestOSType>().GetRecommendedHDD()); 376 m_pPage4Text2->setText (tr ("The recommended size of the boot hard disk is <b>%1</b> M iB.").arg (strRecommendedHDD));376 m_pPage4Text2->setText (tr ("The recommended size of the boot hard disk is <b>%1</b> MB.").arg (strRecommendedHDD)); 377 377 } 378 378 … … 585 585 .arg(tr("Name", "summary"), name) 586 586 .arg(tr("OS Type", "summary"), type) 587 .arg(tr("Base Memory", "summary"), ram, tr("M iB", "size suffix MiBytes"))587 .arg(tr("Base Memory", "summary"), ram, tr("MB", "size suffix MBytes=1024KBytes")) 588 588 ; 589 589 /* Feat summary to 3 lines */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage3.ui
r28732 r28755 96 96 <widget class="QLabel" name="m_pRamUnits"> 97 97 <property name="text"> 98 <string>M iB</string>98 <string>MB</string> 99 99 </property> 100 100 </widget>
Note:
See TracChangeset
for help on using the changeset viewer.