VirtualBox

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


Ignore:
Timestamp:
Jul 31, 2007 6:03:55 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23362
Message:

2049: The first run wizard should not be run if an existing VDI is attached to a new VM:

Dealing with "no-hd attached to newly created vm" situation. Two different messages in wizard solutions for:

  1. Newly created HD attached to newly created VM (installation case).
  2. No HD attached to newly created VM (boot from LiveCD case).

Note: If the attached HD was exist before the VM is created, First Run Wizard is not run at all.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r3943 r3947  
    218218    void remindAboutWrongColorDepth (ulong aRealBPP, ulong aWantedBPP);
    219219
     220    int remindAboutUnsetHD (QWidget *aParent);
     221
    220222    void cannotRunInSelectorMode();
    221223
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r3943 r3947  
    15731573}
    15741574
     1575int VBoxProblemReporter::remindAboutUnsetHD (QWidget *aParent)
     1576{
     1577    return message (
     1578        aParent,
     1579        Warning,
     1580        tr ("<p>You didn't attach any hard disk to the created virtual machine. "
     1581            "As a result, the machine will not be able to boot unless you attach "
     1582            "a hard disk with the guest operating system or some other bootable "
     1583            "media to it later using the machine settings dialog or the First "
     1584            "Run Wizard.</p><p>Do you want to continue?</p>"),
     1585        0, /* autoConfirmId */
     1586        QIMessageBox::Yes | QIMessageBox::Default,
     1587        QIMessageBox::No | QIMessageBox::Escape);
     1588}
     1589
    15751590void VBoxProblemReporter::cannotRunInSelectorMode()
    15761591{
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h

    r3802 r3947  
    243243    if (page == pageSummary)
    244244    {
     245        if (!mediaCombo->currentItem())
     246        {
     247            int result = vboxProblem().remindAboutUnsetHD (this);
     248            if (result == QIMessageBox::No)
     249                return;
     250        }
     251
    245252        /* compose summary */
    246253        QString summary = QString (tr (
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMFirstRunWzd.ui

    r2988 r3947  
    106106                        </property>
    107107                    </widget>
     108                    <widget class="QLabel">
     109                        <property name="name">
     110                            <cstring>txWelcomeHD</cstring>
     111                        </property>
     112                        <property name="sizePolicy">
     113                            <sizepolicy>
     114                                <hsizetype>1</hsizetype>
     115                                <vsizetype>0</vsizetype>
     116                                <horstretch>0</horstretch>
     117                                <verstretch>0</verstretch>
     118                            </sizepolicy>
     119                        </property>
     120                        <property name="text">
     121                            <string>&lt;p&gt;You have started a newly created virtual machine for the first time. This wizard will help you to perform the steps necessary for booting an operation system of your choice into the virtual machine.&lt;/p&gt;&lt;p&gt;Note that you will not be able to install an operating system into this virtual machine right now because you did not attach any hard disk to it. If this is not what you want, you can cancel execution of this wizard, select &lt;b&gt;Settings&lt;/b&gt; from the &lt;b&gt;Machine&lt;/b&gt; menu of the main VirtualBox window to access the settings dialog of this machine and change the hard disk configuration.&lt;/p&gt;&lt;p&gt;Use the &lt;b&gt;Next&lt;/b&gt; button to go to the next page of the wizard and the &lt;b&gt;Back&lt;/b&gt; button to return to the previous page. You can also press &lt;b&gt;Cancel&lt;/b&gt; if you want to cancel execution of this wizard.&lt;/p&gt;</string>
     122                        </property>
     123                        <property name="alignment">
     124                            <set>WordBreak|AlignTop</set>
     125                        </property>
     126                    </widget>
    108127                    <spacer>
    109128                        <property name="name">
     
    210229                        </property>
    211230                    </widget>
     231                    <widget class="QLabel">
     232                        <property name="name">
     233                            <cstring>txTypeHD</cstring>
     234                        </property>
     235                        <property name="sizePolicy">
     236                            <sizepolicy>
     237                                <hsizetype>1</hsizetype>
     238                                <vsizetype>0</vsizetype>
     239                                <horstretch>0</horstretch>
     240                                <verstretch>0</verstretch>
     241                            </sizepolicy>
     242                        </property>
     243                        <property name="text">
     244                            <string>&lt;p&gt;Select the type of the media you would like to use for booting an operating system.&lt;/p&gt;</string>
     245                        </property>
     246                        <property name="alignment">
     247                            <set>WordBreak|AlignTop</set>
     248                        </property>
     249                    </widget>
    212250                    <widget class="QButtonGroup">
    213251                        <property name="name">
     
    271309                        <property name="text">
    272310                            <string>&lt;p&gt;Select the media which contains the setup program of the operating system you want to install. This media must be bootable, otherwise the setup program will not be able to start.&lt;/p&gt;</string>
     311                        </property>
     312                        <property name="alignment">
     313                            <set>WordBreak|AlignTop</set>
     314                        </property>
     315                    </widget>
     316                    <widget class="QLabel">
     317                        <property name="name">
     318                            <cstring>txSourceHD</cstring>
     319                        </property>
     320                        <property name="sizePolicy">
     321                            <sizepolicy>
     322                                <hsizetype>1</hsizetype>
     323                                <vsizetype>0</vsizetype>
     324                                <horstretch>0</horstretch>
     325                                <verstretch>0</verstretch>
     326                            </sizepolicy>
     327                        </property>
     328                        <property name="text">
     329                            <string>&lt;p&gt;Select the media that contains the operating system you want to work with. This media must be bootable, otherwise the operating system will not be able to start.&lt;/p&gt;</string>
    273330                        </property>
    274331                        <property name="alignment">
     
    497554                    <widget class="QLabel">
    498555                        <property name="name">
     556                            <cstring>txSummaryHdrHD</cstring>
     557                        </property>
     558                        <property name="sizePolicy">
     559                            <sizepolicy>
     560                                <hsizetype>1</hsizetype>
     561                                <vsizetype>0</vsizetype>
     562                                <horstretch>0</horstretch>
     563                                <verstretch>0</verstretch>
     564                            </sizepolicy>
     565                        </property>
     566                        <property name="text">
     567                            <string>&lt;p&gt;You have selected the following media to boot an operating system from:&lt;/p&gt;</string>
     568                        </property>
     569                        <property name="alignment">
     570                            <set>WordBreak|AlignTop</set>
     571                        </property>
     572                    </widget>
     573                    <widget class="QLabel">
     574                        <property name="name">
    499575                            <cstring>txSummaryFtr</cstring>
    500576                        </property>
     
    509585                        <property name="text">
    510586                            <string>&lt;p&gt;If the above is correct, press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, the selected media will be temporarily mounted on the virtual machine and the machine will start execution.&lt;/p&gt;&lt;p&gt;Please note that when you close the virtual machine, the specified media will be automatically unmounted and the boot device will be set back to the first hard disk.&lt;/p&gt;&lt;p&gt;Depending on the type of the setup program, you may need to manually unmount (eject) the media after the setup program reboots the virtual machine, to prevent the installation process from starting again. You can do this by selecting the corresponding &lt;b&gt;Unmount...&lt;/b&gt; action in the &lt;b&gt;Devices&lt;/b&gt; menu.&lt;/p&gt;</string>
     587                        </property>
     588                        <property name="alignment">
     589                            <set>WordBreak|AlignTop</set>
     590                        </property>
     591                    </widget>
     592                    <widget class="QLabel">
     593                        <property name="name">
     594                            <cstring>txSummaryFtrHD</cstring>
     595                        </property>
     596                        <property name="sizePolicy">
     597                            <sizepolicy>
     598                                <hsizetype>1</hsizetype>
     599                                <vsizetype>0</vsizetype>
     600                                <horstretch>0</horstretch>
     601                                <verstretch>0</verstretch>
     602                            </sizepolicy>
     603                        </property>
     604                        <property name="text">
     605                            <string>&lt;p&gt;If the above is correct, press the &lt;b&gt;Finish&lt;/b&gt; button. Once you press it, the selected media will be mounted on the virtual machine and the machine will start execution.&lt;/p&gt;</string>
    511606                        </property>
    512607                        <property name="alignment">
     
    598693<functions>
    599694    <function access="private">init()</function>
    600     <function>setup( CMachine &amp; )</function>
     695    <function>setup( const CMachine &amp; )</function>
    601696    <function access="private">showEvent( QShowEvent* )</function>
    602697    <function>showPage( QWidget* )</function>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMFirstRunWzd.ui.h

    r3138 r3947  
    6565    teSummary->setReadOnly (TRUE);
    6666    teSummary->setPaper (pageSummary->backgroundBrush());
    67     ltSummary->insertWidget (1, teSummary);
     67    ltSummary->insertWidget (2, teSummary);
    6868
    6969    /* setup connections and set validation for pages
     
    8888
    8989    /* setup minimum width for the sizeHint to be calculated correctly */
    90     int wid = widthSpacer->minimumSize().width();
     90    int wid = widthSpacer->minimumSize().width() + 50;
    9191    txWelcome->setMinimumWidth (wid);
    9292    txType->setMinimumWidth (wid);
     
    9494    txSummaryHdr->setMinimumWidth (wid);
    9595    txSummaryFtr->setMinimumWidth (wid);
     96    txWelcomeHD->setMinimumWidth (wid);
     97    txTypeHD->setMinimumWidth (wid);
     98    txSourceHD->setMinimumWidth (wid);
     99    txSummaryHdrHD->setMinimumWidth (wid);
     100    txSummaryFtrHD->setMinimumWidth (wid);
    96101
    97102    /* media page */
     
    101106
    102107
    103 void VBoxVMFirstRunWzd::setup (CMachine &aMachine)
     108void VBoxVMFirstRunWzd::setup (const CMachine &aMachine)
    104109{
    105110    machine = aMachine;
     111
     112    CHardDiskAttachmentEnumerator en = machine.GetHardDiskAttachments().Enumerate();
     113    if (en.HasMore())
     114    {
     115        txWelcomeHD->setHidden (true);
     116        txTypeHD->setHidden (true);
     117        txSourceHD->setHidden (true);
     118        txSummaryHdrHD->setHidden (true);
     119        txSummaryFtrHD->setHidden (true);
     120    }
     121    else
     122    {
     123        txWelcome->setHidden (true);
     124        txType->setHidden (true);
     125        txSource->setHidden (true);
     126        txSummaryHdr->setHidden (true);
     127        txSummaryFtr->setHidden (true);
     128    }
    106129}
    107130
Note: See TracChangeset for help on using the changeset viewer.

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