VirtualBox

Ignore:
Timestamp:
Nov 26, 2007 4:49:18 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
26295
Message:

2481: “Create parallel port UI”: implemented.

Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui

    r5194 r5837  
    66
    77     Copyright (C) 2006-2007 innotek GmbH
    8    
     8
    99     This file is part of VirtualBox Open Source Edition (OSE), as
    1010     available from http://www.virtualbox.org. This file is free software;
     
    230230    <include location="global" impldecl="in implementation">qvalidator.h</include>
    231231    <include location="local" impldecl="in implementation">VBoxGlobal.h</include>
    232     <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
    233232    <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.ui.h</include>
    234233</includes>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui.h

    r5807 r5837  
    8383    mPort.SetIOBase (mIOPortLine->text().toULong (NULL, 0));
    8484
    85     CEnums::PortMode mode = vboxGlobal().toPortMode (mHostModeCombo->currentText());
    86     mPort.SetHostMode (mode);
     85    mPort.SetPath (QDir::convertSeparators (mPortPathLine->text()));
    8786
     87    mPort.SetHostMode (vboxGlobal().toPortMode (mHostModeCombo->currentText()));
    8888    mPort.SetServer (mServerCheck->isChecked());
    89     mPort.SetPath (QDir::convertSeparators (mPortPathLine->text()));
    9089}
    9190
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui

    r5795 r5837  
    213213            </property>
    214214            <property name="text">
    215                 <string>7</string>
     215                <string>8</string>
    216216            </property>
    217217            <property name="text">
     
    233233            </property>
    234234            <property name="text">
    235                 <string>9</string>
     235                <string>10</string>
    236236            </property>
    237237            <property name="text">
     
    253253            </property>
    254254            <property name="text">
    255                 <string>8</string>
     255                <string>9</string>
    256256            </property>
    257257            <property name="text">
     
    277277            <property name="text">
    278278                <string>#serialPorts</string>
     279            </property>
     280            <property name="pixmap">
     281                <pixmap>serial_port_16px.png</pixmap>
     282            </property>
     283            <property name="pixmap">
     284                <pixmap></pixmap>
     285            </property>
     286            <property name="pixmap">
     287                <pixmap></pixmap>
     288            </property>
     289        </item>
     290        <item>
     291            <property name="text">
     292                <string> Parallel Ports </string>
     293            </property>
     294            <property name="text">
     295                <string>7</string>
     296            </property>
     297            <property name="text">
     298                <string>#parallelPorts</string>
    279299            </property>
    280300            <property name="pixmap">
     
    22762296                </property>
    22772297                <attribute name="id">
    2278                     <number>7</number>
     2298                    <number>8</number>
    22792299                </attribute>
    22802300                <vbox>
     
    25362556                </property>
    25372557                <attribute name="id">
    2538                     <number>9</number>
     2558                    <number>10</number>
    25392559                </attribute>
    25402560                <vbox>
     
    27502770                </property>
    27512771                <attribute name="id">
    2752                     <number>8</number>
     2772                    <number>9</number>
    27532773                </attribute>
    27542774            </widget>
     
    27702790                        <property name="name">
    27712791                            <cstring>tbwSerialPorts</cstring>
     2792                        </property>
     2793                        <property name="sizePolicy">
     2794                            <sizepolicy>
     2795                                <hsizetype>1</hsizetype>
     2796                                <vsizetype>1</vsizetype>
     2797                                <horstretch>0</horstretch>
     2798                                <verstretch>0</verstretch>
     2799                            </sizepolicy>
     2800                        </property>
     2801                    </widget>
     2802                </vbox>
     2803            </widget>
     2804            <widget class="QWidget">
     2805                <property name="name">
     2806                    <cstring>pageParallel</cstring>
     2807                </property>
     2808                <attribute name="id">
     2809                    <number>7</number>
     2810                </attribute>
     2811                <vbox>
     2812                    <property name="name">
     2813                        <cstring>unnamed</cstring>
     2814                    </property>
     2815                    <property name="margin">
     2816                        <number>0</number>
     2817                    </property>
     2818                    <widget class="QTabWidget">
     2819                        <property name="name">
     2820                            <cstring>tbwParallelPorts</cstring>
    27722821                        </property>
    27732822                        <property name="sizePolicy">
     
    31213170    <include location="local" impldecl="in implementation">VBoxVMNetworkSettings.h</include>
    31223171    <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.h</include>
     3172    <include location="local" impldecl="in implementation">VBoxVMParallelPortSettings.h</include>
    31233173    <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include>
    31243174    <include location="local" impldecl="in implementation">VBoxSharedFoldersSettings.h</include>
     
    31833233    <slot>addNetworkAdapter( const CNetworkAdapter &amp; )</slot>
    31843234    <slot>addSerialPort( const CSerialPort &amp; )</slot>
     3235    <slot>addParallelPort( const CParallelPort &amp; )</slot>
    31853236    <slot>slRAM_valueChanged( int val )</slot>
    31863237    <slot>leRAM_textChanged( const QString &amp; text )</slot>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r5807 r5837  
    15051505    else if (pg == pageSerial)
    15061506    {
     1507        valid = true;
    15071508        QValueList <QString> ports;
    15081509        QValueList <QString> paths;
     
    15411542                        tr ("Duplicate port path is entered ");
    15421543                    pageTitle += ": " + tbwSerialPorts->tabLabel (tab);
     1544                    break;
     1545                }
     1546                paths << path;
     1547            }
     1548        }
     1549    }
     1550    else if (pg == pageParallel)
     1551    {
     1552        valid = true;
     1553        QValueList <QString> ports;
     1554        QValueList <QString> paths;
     1555
     1556        int index = 0;
     1557        for (; index < tbwParallelPorts->count(); ++ index)
     1558        {
     1559            QWidget *tab = tbwParallelPorts->page (index);
     1560            VBoxVMParallelPortSettings *page =
     1561                static_cast <VBoxVMParallelPortSettings *> (tab);
     1562
     1563            /* check the predefined port number unicity */
     1564            if (page->mParallelPortBox->isChecked() && !page->isUserDefined())
     1565            {
     1566                QString port = page->mPortNumCombo->currentText();
     1567                valid = !ports.contains (port);
     1568                if (!valid)
     1569                {
     1570                    warningText = tr ("Duplicate port number is selected ");
     1571                    pageTitle += ": " + tbwParallelPorts->tabLabel (tab);
     1572                    break;
     1573                }
     1574                ports << port;
     1575            }
     1576            /* check the port path emptiness & unicity */
     1577            if (page->mParallelPortBox->isChecked())
     1578            {
     1579                QString path = page->mPortPathLine->text();
     1580                valid = !path.isEmpty() && !paths.contains (path);
     1581                if (!valid)
     1582                {
     1583                    warningText = path.isEmpty() ?
     1584                        tr ("Port path is not specified ") :
     1585                        tr ("Duplicate port path is entered ");
     1586                    pageTitle += ": " + tbwParallelPorts->tabLabel (tab);
    15431587                    break;
    15441588                }
     
    18301874    }
    18311875
     1876    /* parallel ports */
     1877    {
     1878        ulong count = vbox.GetSystemProperties().GetParallelPortCount();
     1879        for (ulong slot = 0; slot < count; ++ slot)
     1880        {
     1881            CParallelPort port = machine.GetParallelPort (slot);
     1882            addParallelPort (port);
     1883        }
     1884    }
     1885
    18321886    /* USB */
    18331887    {
     
    21152169            VBoxVMSerialPortSettings *page =
    21162170                (VBoxVMSerialPortSettings *) tbwSerialPorts->page (index);
     2171            Assert (page);
     2172            page->putBackToPort();
     2173        }
     2174    }
     2175
     2176    /* parallel ports */
     2177    {
     2178        for (int index = 0; index < tbwParallelPorts->count(); index++)
     2179        {
     2180            VBoxVMParallelPortSettings *page =
     2181                (VBoxVMParallelPortSettings *) tbwParallelPorts->page (index);
    21172182            Assert (page);
    21182183            page->putBackToPort();
     
    23062371}
    23072372
     2373void VBoxVMSettingsDlg::addParallelPort (const CParallelPort &aPort)
     2374{
     2375    VBoxVMParallelPortSettings *page = new VBoxVMParallelPortSettings();
     2376    page->getFromPort (aPort);
     2377    QString pageTitle = QString (tr ("Port %1", "parallel ports"))
     2378                                 .arg (aPort.GetSlot());
     2379    tbwParallelPorts->addTab (page, pageTitle);
     2380
     2381    /* fix the tab order so that main dialog's buttons are always the last */
     2382    setTabOrder (page->mPortPathLine, buttonHelp);
     2383    setTabOrder (buttonHelp, buttonOk);
     2384    setTabOrder (buttonOk, buttonCancel);
     2385
     2386    /* setup validation */
     2387    QIWidgetValidator *wval =
     2388        new QIWidgetValidator (QString ("%1: %2")
     2389                               .arg (pagePath (pageParallel), pageTitle),
     2390                               pageParallel, this);
     2391    connect (page->mParallelPortBox, SIGNAL (toggled (bool)),
     2392             wval, SLOT (revalidate()));
     2393    connect (page->mIRQLine, SIGNAL (textChanged (const QString &)),
     2394             wval, SLOT (revalidate()));
     2395    connect (page->mIOPortLine, SIGNAL (textChanged (const QString &)),
     2396             wval, SLOT (revalidate()));
     2397    connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),
     2398             this, SLOT (enableOk (const QIWidgetValidator *)));
     2399    connect (wval, SIGNAL (isValidRequested (QIWidgetValidator *)),
     2400             this, SLOT (revalidate (QIWidgetValidator *)));
     2401
     2402    wval->revalidate();
     2403}
     2404
    23082405void VBoxVMSettingsDlg::slRAM_valueChanged( int val )
    23092406{
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