Changeset 10897 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 26, 2008 12:53:27 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsNetwork.h
r10698 r10897 28 28 #include "COMDefs.h" 29 29 30 #if def Q_WS_WIN30 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 31 31 class QTreeWidget; 32 32 class QTreeWidgetItem; … … 57 57 void setNetworksList (const QStringList &aList); 58 58 59 #if def Q_WS_WIN59 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 60 60 void setInterfaceName (const QString &); 61 61 QString interfaceName() const; … … 86 86 QIWidgetValidator *mValidator; 87 87 88 #if def Q_WS_WIN88 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 89 89 QString mInterfaceName; 90 90 #endif … … 92 92 93 93 94 #if def Q_WS_WIN94 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) || defined(__APPLE__) /// @todo fix stupid stupid moc. 95 95 /* 96 96 * QGroupBox sub-class which represents network interface list. … … 129 129 QTreeWidget *mList; 130 130 131 # if defined (Q_WS_WIN) 131 132 QAction *mAddAction; 132 133 QAction *mDelAction; 134 # endif 133 135 }; 134 #endif 136 #endif /* Q_WS_WIN || Q_OS_MAC */ 135 137 136 138 … … 159 161 160 162 void updateNetworksList(); 161 #if def Q_WS_WIN163 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) || defined (__APPLE__) /// @todo fix stupid stupid moc. 162 164 void onCurrentPageChanged (int); 163 165 void onCurrentInterfaceChanged (const QString &); … … 170 172 /* Widgets */ 171 173 QTabWidget *mTwAdapters; 172 #if def Q_WS_WIN174 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 173 175 VBoxNIList *mNIList; 174 176 #endif -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsNetwork.cpp
r10759 r10897 25 25 #include "QIWidgetValidator.h" 26 26 #include "VBoxGlobal.h" 27 #if def Q_WS_WIN27 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 28 28 #include "VBoxToolBar.h" 29 29 #include "VBoxSettingsUtils.h" … … 35 35 #include <QFileDialog> 36 36 #endif 37 #if def Q_WS_WIN37 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 38 38 #include <QTreeWidget> 39 39 #endif 40 40 41 41 /* Common Stuff */ 42 #if def Q_WS_WIN42 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 43 43 static QTreeWidgetItem* findItem (QTreeWidget *aList, 44 44 const QString &aMatch) … … 65 65 /* Setup dialog for current platform */ 66 66 #ifndef Q_WS_X11 67 setTapVisible (false);68 #endif69 #ifdef Q_WS_MAC /// @todo hif on mac70 /* No Host Interface Networking on the Mac yet */71 67 setTapVisible (false); 72 68 #endif … … 107 103 mCbNetwork->setCurrentIndex (inPos == -1 ? 0 : inPos); 108 104 109 #if def Q_WS_WIN105 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 110 106 mInterfaceName = aAdapter.GetHostInterface().isEmpty() ? 111 107 QString::null : aAdapter.GetHostInterface(); … … 152 148 if (type == KNetworkAttachmentType_HostInterface) 153 149 { 154 #if def Q_WS_WIN150 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 155 151 mAdapter.SetHostInterface (mInterfaceName); 156 152 #endif … … 226 222 } 227 223 228 #if def Q_WS_WIN224 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 229 225 void VBoxVMSettingsNetwork::setInterfaceName (const QString &aName) 230 226 { … … 380 376 381 377 /* VBoxNIList Stuff */ 382 #if def Q_WS_WIN378 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 383 379 class VBoxNIListItem : public QTreeWidgetItem 384 380 { … … 440 436 441 437 /* Prepare actions */ 438 # if defined (Q_WS_WIN) 442 439 mAddAction = new QAction (mList); 443 440 mDelAction = new QAction (mList); … … 450 447 mDelAction->setIcon (VBoxGlobal::iconSet (":/remove_host_iface_16px.png", 451 448 ":/remove_host_iface_disabled_16px.png")); 449 # endif /* Q_WS_WIN */ 452 450 453 451 /* Prepare toolbar */ … … 456 454 toolBar->setUsesBigPixmaps (false); 457 455 toolBar->setOrientation (Qt::Vertical); 456 # if defined (Q_WS_WIN) 458 457 toolBar->addAction (mAddAction); 459 458 toolBar->addAction (mDelAction); 459 # endif /* Q_WS_WIN */ 460 460 layout->addWidget (toolBar); 461 461 … … 463 463 connect (mList, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)), 464 464 this, SLOT (onCurrentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *))); 465 # if defined (Q_WS_WIN) 465 466 connect (mAddAction, SIGNAL (triggered (bool)), 466 467 this, SLOT (addHostInterface())); 467 468 connect (mDelAction, SIGNAL (triggered (bool)), 468 469 this, SLOT (delHostInterface())); 470 # endif /* Q_WS_WIN */ 469 471 470 472 /* Populating interface list */ … … 516 518 QTreeWidgetItem *) 517 519 { 520 # if defined (Q_WS_WIN) 518 521 VBoxNIListItem *item = aCurrent && 519 522 aCurrent->type() == VBoxNIListItem::typeId ? 520 523 static_cast<VBoxNIListItem*> (aCurrent) : 0; 521 524 mDelAction->setEnabled (item && !item->isWrong()); 525 # else 526 NOREF (aCurrent); 527 # endif 522 528 523 529 emit currentInterfaceChanged (mList->currentItem() ? … … 527 533 void VBoxNIList::addHostInterface() 528 534 { 535 # if defined (Q_WS_WIN) 529 536 /* Allow the started helper process to make itself the foreground window */ 530 537 AllowSetForegroundWindow (ASFW_ANY); … … 569 576 /* Allow the started helper process to make itself the foreground window */ 570 577 AllowSetForegroundWindow (ASFW_ANY); 578 # endif /* Q_WS_WIN */ 571 579 } 572 580 … … 575 583 Assert (mList->currentItem()); 576 584 585 # if defined (Q_WS_WIN) 577 586 /* Allow the started helper process to make itself the foreground window */ 578 587 AllowSetForegroundWindow (ASFW_ANY); … … 618 627 619 628 emit listChanged(); 629 # endif /* Q_WS_WIN */ 620 630 } 621 631 … … 626 636 mList->setWhatsThis (tr ("Lists all available host interfaces.")); 627 637 638 # if defined (Q_WS_WIN) 628 639 mAddAction->setText (tr ("A&dd New Host Interface")); 629 640 mDelAction->setText (tr ("&Remove Selected Host Interface")); … … 634 645 mDelAction->setToolTip (mDelAction->text().remove ('&') + 635 646 QString (" (%1)").arg (mDelAction->shortcut().toString())); 647 # endif /* Q_WS_WIN */ 636 648 } 637 649 … … 661 673 onCurrentItemChanged (mList->currentItem()); 662 674 } 663 #endif 675 #endif /* Q_WS_WIN || Q_OS_MAC */ 664 676 665 677 … … 678 690 populateNetworksList(); 679 691 680 #if def Q_WS_WIN692 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 681 693 /* Creating Interfaces List */ 682 694 mNIList = new VBoxNIList (this); … … 725 737 } 726 738 727 #if def Q_WS_WIN739 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 728 740 setTabOrder (lastFocusWidget, mNIList->focusProxy()); 729 741 connect (mTwAdapters, SIGNAL (currentChanged (int)), … … 752 764 { 753 765 mValidator = aVal; 754 #if def Q_WS_WIN766 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 755 767 connect (mNIList, SIGNAL (listChanged()), mValidator, SLOT (revalidate())); 756 768 #endif … … 771 783 vboxGlobal().toNetworkAttachmentType (page->mCbNAType->currentText()); 772 784 773 #if def Q_WS_WIN785 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 774 786 if (type == KNetworkAttachmentType_HostInterface && 775 787 page->interfaceName().isNull()) … … 840 852 } 841 853 842 #if def Q_WS_WIN854 #if defined (Q_WS_WIN) || defined (Q_OS_MAC) 843 855 void VBoxVMSettingsNetworkPage::onCurrentPageChanged (int aIndex) 844 856 {
Note:
See TracChangeset
for help on using the changeset viewer.