VirtualBox

Changeset 28758 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 26, 2010 3:30:22 PM (15 years ago)
Author:
vboxsync
Message:

really back out accidental previous commit

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox

    • Property svn:mergeinfo deleted
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r28755 r28758  
    77
    88/*
    9  * Copyright (C) 2006-2010 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    167167        adjustText();
    168168        recacheToolTip();
    169     }
    170 
    171     KMachineState getCurrentState()
    172     {
    173         if (mMachine.isNull())
    174             return KMachineState_Null;
    175 
    176         return mMachineState;
    177169    }
    178170
     
    447439    bool busy = mSessionState != KSessionState_Closed;
    448440
    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());
     441    /* Enable/disable snapshot actions */
     442    mSnapshotActionGroup->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem());
    465443
    466444    /* Enable/disable the details action regardles of the session state */
     
    556534    if (!vboxProblem().askAboutSnapshotDeleting (snapshot.GetName()))
    557535        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                                                          
    568536
    569537    /* Open a direct session (this call will handle all errors) */
     
    831799                           mCurSnapshotItem->child (mCurSnapshotItem->childCount() - 1) :
    832800                           mTreeWidget->invisibleRootItem()->child (0);
     801    Assert (csi);
    833802    return static_cast <SnapshotWgtItem*> (csi);
    834803}
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r28755 r28758  
    19781978
    19791979        QString item = QString (sSectionItemTpl2).arg (tr ("Base Memory", "details report"),
    1980                                                        tr ("<nobr>%1 MB</nobr>", "details report"))
     1980                                                       tr ("<nobr>%1 MiB</nobr>", "details report"))
    19811981                       .arg (aMachine.GetMemorySize())
    19821982                     + QString (sSectionItemTpl2).arg (tr ("Processor(s)", "details report"),
     
    20112011        QString item = QString(sSectionItemTpl2)
    20122012                       .arg(tr ("Video Memory", "details report"),
    2013                              tr ("<nobr>%1 MB</nobr>", "details report"))
     2013                             tr ("<nobr>%1 MiB</nobr>", "details report"))
    20142014                       .arg(aMachine.GetVRAMSize());
    20152015        ++rows;
     
    38323832/**
    38333833 *  Returns the regexp string that defines the format of the human-readable
    3834  *  size representation, <tt>####[.##] B|KB|MB|GB|TB|PB</tt>.
     3834 *  size representation, <tt>####[.##] B|kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB</tt>.
    38353835 *
    38363836 *  This regexp will capture 5 groups of text:
     
    38473847{
    38483848    QString regexp =
    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")
     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")
    38503850            .arg (decimalSep());
    38513851    return regexp;
     
    38543854/**
    38553855 *  Parses the given size string that should be in form of
    3856  *  <tt>####[.##] B|KB|MB|GB|TB|PB</tt> and returns
     3856 *  <tt>####[.##] B|kB|KB|KiB|MB|MiB|GB|GiB|TB|TiB|PB|PiB</tt> and returns
    38573857 *  the size value in bytes. Zero is returned on error.
    38583858 */
     
    38773877        if (suff.isEmpty() || suff == tr ("B", "size suffix Bytes"))
    38783878            denom = 1;
    3879         else if (suff == tr ("KB", "size suffix KBytes=1024 Bytes"))
     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"))
    38803883            denom = _1K;
    3881         else if (suff == tr ("MB", "size suffix MBytes=1024 KBytes"))
     3884        else if (suff == tr ("MB", "size suffix MBytes=1000 kBytes"))
     3885            denom = 1000000;
     3886        else if (suff == tr ("MiB", "size suffix MiBytes"))
    38823887            denom = _1M;
    3883         else if (suff == tr ("GB", "size suffix GBytes=1024 MBytes"))
     3888        else if (suff == tr ("GB", "size suffix GBytes=1000 MBytes"))
     3889            denom = 1000000000;
     3890        else if (suff == tr ("GiB", "size suffix GiBytes"))
    38843891            denom = _1G;
    3885         else if (suff == tr ("TB", "size suffix TBytes=1024 GBytes"))
     3892        else if (suff == tr ("TB", "size suffix TBytes=1000 GBytes"))
     3893            denom = 1000000000000ULL;
     3894        else if (suff == tr ("TiB", "size suffix TiBytes"))
    38863895            denom = _1T;
    3887         else if (suff == tr ("PB", "size suffix PBytes=1024 TBytes"))
     3896        else if (suff == tr ("PB", "size suffix PBytes=1000 TBytes"))
     3897            denom = 1000000000000000ULL;
     3898        else if (suff == tr ("PiB", "size suffix PiBytes"))
    38883899            denom = _1P;
    38893900
     
    39033914/**
    39043915 * Formats the given @a aSize value in bytes to a human readable string
    3905  * in form of <tt>####[.##] B|KB|MB|GB|TB|PB</tt>.
     3916 * in form of <tt>####[.##] B|KiB|MiB|GiB|TiB|PiB</tt>.
    39063917 *
    39073918 * The @a aMode and @a aDecimal parameters are used for rounding the resulting
    3908  * number when converting the size value to KB, MB, etc gives a fractional part:
     3919 * number when converting the size value to KiB, MiB, etc gives a fractional part:
    39093920 * <ul>
    39103921 * <li>When \a aMode is FormatSize_Round, the result is rounded to the
     
    39363947    static QString Suffixes [7];
    39373948    Suffixes[0] = tr ("B", "size suffix Bytes");
    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");
     3949    Suffixes[1] = tr ("KiB", "size suffix KiBytes");
     3950    Suffixes[2] = tr ("MiB", "size suffix MiBytes");
     3951    Suffixes[3] = tr ("GiB", "size suffix GiBytes");
     3952    Suffixes[4] = tr ("TiB", "size suffix TiBytes");
     3953    Suffixes[5] = tr ("PiB", "size suffix PiBytes");
    39433954    Suffixes[6] = (const char *)NULL;
    39443955    AssertCompile(6 < RT_ELEMENTS (Suffixes));
     
    40034014            decm = 0;
    40044015            ++ intg;
    4005             /* check if we've got 1024 XB after rounding and scale down if so */
     4016            /* check if we've got 1024 XiB after rounding and scale down if so */
    40064017            if (intg == 1024 && Suffixes [suffix + 1] != NULL)
    40074018            {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp

    r28755 r28758  
    77
    88/*
    9  * Copyright (C) 2006-2010 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    894894}
    895895
    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 
    915896void VBoxProblemReporter::cannotRestoreSnapshot (const CConsole &aConsole,
    916897                                                 const QString &aSnapshotName)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r28755 r28758  
    66
    77/*
    8  * Copyright (C) 2006-2010 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    215215    bool askAboutSnapshotRestoring (const QString &aSnapshotName);
    216216    bool askAboutSnapshotDeleting (const QString &aSnapshotName);
    217     bool askAboutSnapshotDeletingFreeSpace (const QString &aSnapshotName,
    218                                             const QString &aTargetImageName,
    219                                             const QString &aTargetImageMaxSize,
    220                                             const QString &aTargetFilesystemFree);
    221217    void cannotRestoreSnapshot (const CConsole &aConsole, const QString &aSnapshotName);
    222218    void cannotRestoreSnapshot (const CProgress &aProgress, const QString &aSnapshotName);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp

    r28755 r28758  
    267267
    268268    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
    269     mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (m_minVRAM));
    270     mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (m_maxVRAMVisible));
     269    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MiB</qt>").arg (m_minVRAM));
     270    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MiB</qt>").arg (m_maxVRAMVisible));
    271271    mLbMonitorsMin->setText (tr ("<qt>%1</qt>").arg (1));
    272272    mLbMonitorsMax->setText (tr ("<qt>%1</qt>").arg (sys.GetMaxGuestMonitors()));
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.ui

    r28755 r28758  
    145145              </property>
    146146              <property name="text">
    147                <string>MB</string>
     147               <string>MiB</string>
    148148              </property>
    149149             </widget>
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSystem.cpp

    r28755 r28758  
    381381
    382382    /* Retranslate the memory slider legend */
    383     mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->minRAM()));
    384     mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MB</qt>").arg (mSlMemory->maxRAM()));
     383    mLbMemoryMin->setText (tr ("<qt>%1&nbsp;MiB</qt>").arg (mSlMemory->minRAM()));
     384    mLbMemoryMax->setText (tr ("<qt>%1&nbsp;MiB</qt>").arg (mSlMemory->maxRAM()));
    385385
    386386    /* Retranslate the cpu slider legend */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSystem.ui

    r28755 r28758  
    145145           </property>
    146146           <property name="text">
    147             <string>MB</string>
     147            <string>MiB</string>
    148148           </property>
    149149          </widget>
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxApplianceEditorWgt.cpp

    r28755 r28758  
    220220                            }
    221221                        case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription (mConfigValue); break;
    222                         case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("MB", "size suffix MBytes=1024 KBytes"); break;
     222                        case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("MiB", "size suffix MiBytes"); break;
    223223                        case KVirtualSystemDescriptionType_SoundCard: v = vboxGlobal().toString (static_cast<KAudioControllerType> (mConfigValue.toInt())); break;
    224224                        case KVirtualSystemDescriptionType_NetworkAdapter: v = vboxGlobal().toString (static_cast<KNetworkAdapterType> (mConfigValue.toInt())); break;
     
    399399                    QSpinBox *e = new QSpinBox (aParent);
    400400                    e->setRange (VBoxApplianceEditorWgt::minGuestRAM(), VBoxApplianceEditorWgt::maxGuestRAM());
    401                     e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("MB", "size suffix MBytes=1024KBytes"));
     401                    e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("MiB", "size suffix MiBytes"));
    402402                    editor = e;
    403403                    break;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWzd.cpp

    r28755 r28758  
    220220
    221221    /* Setup size-editor field */
    222     m_pSizeEditor->setFixedWidthByText("88888.88 MB");
     222    m_pSizeEditor->setFixedWidthByText("88888.88 MiB");
    223223    m_pSizeEditor->setAlignment(Qt::AlignRight);
    224224    m_pSizeEditor->setValidator(new QRegExpValidator(QRegExp(vboxGlobal().sizeRegexp()), this));
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r28755 r28758  
    281281    QString strRecommendedRAM = field("type").value<CGuestOSType>().isNull() ? QString() :
    282282                                QString::number(field("type").value<CGuestOSType>().GetRecommendedRAM());
    283     m_pPage3Text2->setText(tr("The recommended base memory size is <b>%1</b> MB.").arg(strRecommendedRAM));
     283    m_pPage3Text2->setText(tr("The recommended base memory size is <b>%1</b> MiB.").arg(strRecommendedRAM));
    284284
    285285    /* Translate minimum & maximum 'ram' field values */
    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")));
     286    m_pRamMin->setText(QString("%1 %2").arg(m_pRamSlider->minRAM()).arg(tr("MiB", "size suffix MiBytes")));
     287    m_pRamMax->setText(QString("%1 %2").arg(m_pRamSlider->maxRAM()).arg(tr("MiB", "size suffix MiBytes")));
    288288}
    289289
     
    374374    QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
    375375                                QString::number(field("type").value<CGuestOSType>().GetRecommendedHDD());
    376     m_pPage4Text2->setText (tr ("The recommended size of the boot hard disk is <b>%1</b> MB.").arg (strRecommendedHDD));
     376    m_pPage4Text2->setText (tr ("The recommended size of the boot hard disk is <b>%1</b> MiB.").arg (strRecommendedHDD));
    377377}
    378378
     
    585585    .arg(tr("Name", "summary"), name)
    586586    .arg(tr("OS Type", "summary"), type)
    587     .arg(tr("Base Memory", "summary"), ram, tr("MB", "size suffix MBytes=1024KBytes"))
     587    .arg(tr("Base Memory", "summary"), ram, tr("MiB", "size suffix MiBytes"))
    588588    ;
    589589    /* Feat summary to 3 lines */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage3.ui

    r28755 r28758  
    9696       <widget class="QLabel" name="m_pRamUnits">
    9797        <property name="text">
    98          <string>MB</string>
     98         <string>MiB</string>
    9999        </property>
    100100       </widget>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette