Changeset 5837 in vbox for trunk/src/VBox/Frontends/VirtualBox/ui
- Timestamp:
- Nov 26, 2007 4:49:18 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 26295
- Location:
- trunk/src/VBox/Frontends/VirtualBox/ui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui
r5194 r5837 6 6 7 7 Copyright (C) 2006-2007 innotek GmbH 8 8 9 9 This file is part of VirtualBox Open Source Edition (OSE), as 10 10 available from http://www.virtualbox.org. This file is free software; … … 230 230 <include location="global" impldecl="in implementation">qvalidator.h</include> 231 231 <include location="local" impldecl="in implementation">VBoxGlobal.h</include> 232 <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>233 232 <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.ui.h</include> 234 233 </includes> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSerialPortSettings.ui.h
r5807 r5837 83 83 mPort.SetIOBase (mIOPortLine->text().toULong (NULL, 0)); 84 84 85 CEnums::PortMode mode = vboxGlobal().toPortMode (mHostModeCombo->currentText()); 86 mPort.SetHostMode (mode); 85 mPort.SetPath (QDir::convertSeparators (mPortPathLine->text())); 87 86 87 mPort.SetHostMode (vboxGlobal().toPortMode (mHostModeCombo->currentText())); 88 88 mPort.SetServer (mServerCheck->isChecked()); 89 mPort.SetPath (QDir::convertSeparators (mPortPathLine->text()));90 89 } 91 90 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui
r5795 r5837 213 213 </property> 214 214 <property name="text"> 215 <string> 7</string>215 <string>8</string> 216 216 </property> 217 217 <property name="text"> … … 233 233 </property> 234 234 <property name="text"> 235 <string> 9</string>235 <string>10</string> 236 236 </property> 237 237 <property name="text"> … … 253 253 </property> 254 254 <property name="text"> 255 <string> 8</string>255 <string>9</string> 256 256 </property> 257 257 <property name="text"> … … 277 277 <property name="text"> 278 278 <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> 279 299 </property> 280 300 <property name="pixmap"> … … 2276 2296 </property> 2277 2297 <attribute name="id"> 2278 <number> 7</number>2298 <number>8</number> 2279 2299 </attribute> 2280 2300 <vbox> … … 2536 2556 </property> 2537 2557 <attribute name="id"> 2538 <number> 9</number>2558 <number>10</number> 2539 2559 </attribute> 2540 2560 <vbox> … … 2750 2770 </property> 2751 2771 <attribute name="id"> 2752 <number> 8</number>2772 <number>9</number> 2753 2773 </attribute> 2754 2774 </widget> … … 2770 2790 <property name="name"> 2771 2791 <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> 2772 2821 </property> 2773 2822 <property name="sizePolicy"> … … 3121 3170 <include location="local" impldecl="in implementation">VBoxVMNetworkSettings.h</include> 3122 3171 <include location="local" impldecl="in implementation">VBoxVMSerialPortSettings.h</include> 3172 <include location="local" impldecl="in implementation">VBoxVMParallelPortSettings.h</include> 3123 3173 <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include> 3124 3174 <include location="local" impldecl="in implementation">VBoxSharedFoldersSettings.h</include> … … 3183 3233 <slot>addNetworkAdapter( const CNetworkAdapter & )</slot> 3184 3234 <slot>addSerialPort( const CSerialPort & )</slot> 3235 <slot>addParallelPort( const CParallelPort & )</slot> 3185 3236 <slot>slRAM_valueChanged( int val )</slot> 3186 3237 <slot>leRAM_textChanged( const QString & text )</slot> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r5807 r5837 1505 1505 else if (pg == pageSerial) 1506 1506 { 1507 valid = true; 1507 1508 QValueList <QString> ports; 1508 1509 QValueList <QString> paths; … … 1541 1542 tr ("Duplicate port path is entered "); 1542 1543 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); 1543 1587 break; 1544 1588 } … … 1830 1874 } 1831 1875 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 1832 1886 /* USB */ 1833 1887 { … … 2115 2169 VBoxVMSerialPortSettings *page = 2116 2170 (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); 2117 2182 Assert (page); 2118 2183 page->putBackToPort(); … … 2306 2371 } 2307 2372 2373 void 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 2308 2405 void VBoxVMSettingsDlg::slRAM_valueChanged( int val ) 2309 2406 {
Note:
See TracChangeset
for help on using the changeset viewer.