Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui	(revision 5807)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui	(revision 5837)
@@ -6,5 +6,5 @@
 
      Copyright (C) 2006-2007 innotek GmbH
-    
+
      This file is part of VirtualBox Open Source Edition (OSE), as
      available from http://www.virtualbox.org. This file is free software;
@@ -230,5 +230,4 @@
     <include location="global" impldecl="in implementation">qvalidator.h</include>
     <include location="local" impldecl="in implementation">VBoxGlobal.h</include>
-    <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
     <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.ui.h</include>
 </includes>
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui.h	(revision 5807)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui.h	(revision 5837)
@@ -83,9 +83,8 @@
     mPort.SetIOBase (mIOPortLine->text().toULong (NULL, 0));
 
-    CEnums::PortMode mode = vboxGlobal().toPortMode (mHostModeCombo->currentText());
-    mPort.SetHostMode (mode);
+    mPort.SetPath (QDir::convertSeparators (mPortPathLine->text()));
 
+    mPort.SetHostMode (vboxGlobal().toPortMode (mHostModeCombo->currentText()));
     mPort.SetServer (mServerCheck->isChecked());
-    mPort.SetPath (QDir::convertSeparators (mPortPathLine->text()));
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui	(revision 5807)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui	(revision 5837)
@@ -213,5 +213,5 @@
             </property>
             <property name="text">
-                <string>7</string>
+                <string>8</string>
             </property>
             <property name="text">
@@ -233,5 +233,5 @@
             </property>
             <property name="text">
-                <string>9</string>
+                <string>10</string>
             </property>
             <property name="text">
@@ -253,5 +253,5 @@
             </property>
             <property name="text">
-                <string>8</string>
+                <string>9</string>
             </property>
             <property name="text">
@@ -277,4 +277,24 @@
             <property name="text">
                 <string>#serialPorts</string>
+            </property>
+            <property name="pixmap">
+                <pixmap>serial_port_16px.png</pixmap>
+            </property>
+            <property name="pixmap">
+                <pixmap></pixmap>
+            </property>
+            <property name="pixmap">
+                <pixmap></pixmap>
+            </property>
+        </item>
+        <item>
+            <property name="text">
+                <string> Parallel Ports </string>
+            </property>
+            <property name="text">
+                <string>7</string>
+            </property>
+            <property name="text">
+                <string>#parallelPorts</string>
             </property>
             <property name="pixmap">
@@ -2276,5 +2296,5 @@
                 </property>
                 <attribute name="id">
-                    <number>7</number>
+                    <number>8</number>
                 </attribute>
                 <vbox>
@@ -2536,5 +2556,5 @@
                 </property>
                 <attribute name="id">
-                    <number>9</number>
+                    <number>10</number>
                 </attribute>
                 <vbox>
@@ -2750,5 +2770,5 @@
                 </property>
                 <attribute name="id">
-                    <number>8</number>
+                    <number>9</number>
                 </attribute>
             </widget>
@@ -2770,4 +2790,33 @@
                         <property name="name">
                             <cstring>tbwSerialPorts</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>1</hsizetype>
+                                <vsizetype>1</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                    </widget>
+                </vbox>
+            </widget>
+            <widget class="QWidget">
+                <property name="name">
+                    <cstring>pageParallel</cstring>
+                </property>
+                <attribute name="id">
+                    <number>7</number>
+                </attribute>
+                <vbox>
+                    <property name="name">
+                        <cstring>unnamed</cstring>
+                    </property>
+                    <property name="margin">
+                        <number>0</number>
+                    </property>
+                    <widget class="QTabWidget">
+                        <property name="name">
+                            <cstring>tbwParallelPorts</cstring>
                         </property>
                         <property name="sizePolicy">
@@ -3121,4 +3170,5 @@
     <include location="local" impldecl="in implementation">VBoxVMNetworkSettings.h</include>
     <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.h</include>
+    <include location="local" impldecl="in implementation">VBoxVMParallelPortSettings.h</include>
     <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include>
     <include location="local" impldecl="in implementation">VBoxSharedFoldersSettings.h</include>
@@ -3183,4 +3233,5 @@
     <slot>addNetworkAdapter( const CNetworkAdapter &amp; )</slot>
     <slot>addSerialPort( const CSerialPort &amp; )</slot>
+    <slot>addParallelPort( const CParallelPort &amp; )</slot>
     <slot>slRAM_valueChanged( int val )</slot>
     <slot>leRAM_textChanged( const QString &amp; text )</slot>
Index: trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h	(revision 5807)
+++ trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h	(revision 5837)
@@ -1505,4 +1505,5 @@
     else if (pg == pageSerial)
     {
+        valid = true;
         QValueList <QString> ports;
         QValueList <QString> paths;
@@ -1541,4 +1542,47 @@
                         tr ("Duplicate port path is entered ");
                     pageTitle += ": " + tbwSerialPorts->tabLabel (tab);
+                    break;
+                }
+                paths << path;
+            }
+        }
+    }
+    else if (pg == pageParallel)
+    {
+        valid = true;
+        QValueList <QString> ports;
+        QValueList <QString> paths;
+
+        int index = 0;
+        for (; index < tbwParallelPorts->count(); ++ index)
+        {
+            QWidget *tab = tbwParallelPorts->page (index);
+            VBoxVMParallelPortSettings *page =
+                static_cast <VBoxVMParallelPortSettings *> (tab);
+
+            /* check the predefined port number unicity */
+            if (page->mParallelPortBox->isChecked() && !page->isUserDefined())
+            {
+                QString port = page->mPortNumCombo->currentText();
+                valid = !ports.contains (port);
+                if (!valid)
+                {
+                    warningText = tr ("Duplicate port number is selected ");
+                    pageTitle += ": " + tbwParallelPorts->tabLabel (tab);
+                    break;
+                }
+                ports << port;
+            }
+            /* check the port path emptiness & unicity */
+            if (page->mParallelPortBox->isChecked())
+            {
+                QString path = page->mPortPathLine->text();
+                valid = !path.isEmpty() && !paths.contains (path);
+                if (!valid)
+                {
+                    warningText = path.isEmpty() ?
+                        tr ("Port path is not specified ") :
+                        tr ("Duplicate port path is entered ");
+                    pageTitle += ": " + tbwParallelPorts->tabLabel (tab);
                     break;
                 }
@@ -1830,4 +1874,14 @@
     }
 
+    /* parallel ports */
+    {
+        ulong count = vbox.GetSystemProperties().GetParallelPortCount();
+        for (ulong slot = 0; slot < count; ++ slot)
+        {
+            CParallelPort port = machine.GetParallelPort (slot);
+            addParallelPort (port);
+        }
+    }
+
     /* USB */
     {
@@ -2115,4 +2169,15 @@
             VBoxVMSerialPortSettings *page =
                 (VBoxVMSerialPortSettings *) tbwSerialPorts->page (index);
+            Assert (page);
+            page->putBackToPort();
+        }
+    }
+
+    /* parallel ports */
+    {
+        for (int index = 0; index < tbwParallelPorts->count(); index++)
+        {
+            VBoxVMParallelPortSettings *page =
+                (VBoxVMParallelPortSettings *) tbwParallelPorts->page (index);
             Assert (page);
             page->putBackToPort();
@@ -2306,4 +2371,36 @@
 }
 
+void VBoxVMSettingsDlg::addParallelPort (const CParallelPort &aPort)
+{
+    VBoxVMParallelPortSettings *page = new VBoxVMParallelPortSettings();
+    page->getFromPort (aPort);
+    QString pageTitle = QString (tr ("Port %1", "parallel ports"))
+                                 .arg (aPort.GetSlot());
+    tbwParallelPorts->addTab (page, pageTitle);
+
+    /* fix the tab order so that main dialog's buttons are always the last */
+    setTabOrder (page->mPortPathLine, buttonHelp);
+    setTabOrder (buttonHelp, buttonOk);
+    setTabOrder (buttonOk, buttonCancel);
+
+    /* setup validation */
+    QIWidgetValidator *wval =
+        new QIWidgetValidator (QString ("%1: %2")
+                               .arg (pagePath (pageParallel), pageTitle),
+                               pageParallel, this);
+    connect (page->mParallelPortBox, SIGNAL (toggled (bool)),
+             wval, SLOT (revalidate()));
+    connect (page->mIRQLine, SIGNAL (textChanged (const QString &)),
+             wval, SLOT (revalidate()));
+    connect (page->mIOPortLine, SIGNAL (textChanged (const QString &)),
+             wval, SLOT (revalidate()));
+    connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),
+             this, SLOT (enableOk (const QIWidgetValidator *)));
+    connect (wval, SIGNAL (isValidRequested (QIWidgetValidator *)),
+             this, SLOT (revalidate (QIWidgetValidator *)));
+
+    wval->revalidate();
+}
+
 void VBoxVMSettingsDlg::slRAM_valueChanged( int val )
 {
