Changeset 25136 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 1, 2009 6:36:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55525
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
- 3 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r25114 r25136 307 307 include/VBoxVMLogViewer.h \ 308 308 include/VBoxMediaManagerDlg.h \ 309 include/VBoxSettingsUtils.h \310 309 include/VBoxVMSettingsGeneral.h \ 311 310 include/VBoxVMSettingsSystem.h \ … … 335 334 include/VBoxExportApplianceWgt.h \ 336 335 include/VBoxExportApplianceWzd.h \ 337 include/VBoxSpecialControls.h 336 include/VBoxSpecialControls.h \ 337 include/VBoxBootTable.h \ 338 include/VBoxWarningPane.h 338 339 339 340 # Sources containing local definitions of classes that use the Q_OBJECT macro. … … 435 436 src/VBoxExportApplianceWgt.cpp \ 436 437 src/VBoxExportApplianceWzd.cpp \ 437 src/VBoxSpecialControls.cpp 438 src/VBoxSpecialControls.cpp \ 439 src/VBoxBootTable.cpp \ 440 src/VBoxWarningPane.cpp 438 441 439 442 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxBootTable.h
r25125 r25136 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox SettingsUtilsclass declaration4 * VBoxBootTable class declaration 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 200 6-2008Sun Microsystems, Inc.8 * Copyright (C) 2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 */ 22 22 23 #ifndef __VBox SettingsUtils_h__24 #define __VBox SettingsUtils_h__23 #ifndef __VBoxBootTable_h__ 24 #define __VBoxBootTable_h__ 25 25 26 #include <VBoxGlobal.h> 27 28 /* Qt includes */ 29 #ifdef Q_WS_WIN 30 #include <QDialog> 31 #include <QLineEdit> 32 #include <QPushButton> 33 #endif 34 #include <QHBoxLayout> 35 #include <QLabel> 26 /* Global includes */ 36 27 #include <QTreeWidget> 37 #include <QHeaderView>38 #include <QKeyEvent>39 #include <QTableView>40 41 enum42 {43 /* mTwUSBFilters column numbers */44 twUSBFilters_Name = 0,45 };46 28 47 29 /** … … 52 34 * Emits itemToggled() signal when the item changed. 53 35 */ 54 class BootItemsTable : public QTreeWidget36 class VBoxBootTable : public QTreeWidget 55 37 { 56 38 Q_OBJECT; … … 58 40 public: 59 41 60 BootItemsTable (QWidget *aParent) : QTreeWidget (aParent) 61 { 62 header()->hide(); 63 connect (this, SIGNAL (itemChanged (QTreeWidgetItem *, int)), 64 this, SLOT (onItemChanged())); 65 } 66 67 ~BootItemsTable() {} 42 VBoxBootTable(QWidget *pParent); 68 43 69 44 signals: … … 73 48 void itemToggled(); 74 49 50 protected: 51 52 void keyPressEvent(QKeyEvent *pEvent); 53 75 54 private slots: 76 55 77 void onItemChanged() 78 { 79 emit itemToggled(); 80 } 81 82 void keyPressEvent (QKeyEvent *aEvent) 83 { 84 if (aEvent->QInputEvent::modifiers () == Qt::ControlModifier) 85 { 86 switch (aEvent->key()) 87 { 88 case Qt::Key_Up: 89 emit moveItemUp(); 90 return; 91 case Qt::Key_Down: 92 emit moveItemDown(); 93 return; 94 default: 95 break; 96 } 97 } 98 QTreeWidget::keyPressEvent (aEvent); 99 } 56 void onItemChanged(); 100 57 }; 101 58 102 class USBListItem : public QTreeWidgetItem 103 { 104 public: 59 #endif // __VBoxBootTable_h__ 105 60 106 enum { USBListItemType = 1002 };107 108 USBListItem (QTreeWidget *aParent)109 : QTreeWidgetItem (aParent, QStringList (QString::null), USBListItemType)110 , mId (-1) {}111 112 USBListItem (QTreeWidget *aParent, QTreeWidgetItem *aPreceding)113 : QTreeWidgetItem (aParent, aPreceding, USBListItemType)114 , mId (-1) {}115 116 int mId;117 };118 119 /**120 * Table-View class reimplementation to extend standard QTableView.121 */122 class QITableView : public QTableView123 {124 Q_OBJECT;125 126 public:127 128 QITableView (QWidget *aParent) : QTableView (aParent) {}129 130 signals:131 132 void currentChanged (const QModelIndex &aCurrent);133 134 protected:135 136 void currentChanged (const QModelIndex &aCurrent,137 const QModelIndex &aPrevious)138 {139 QTableView::currentChanged (aCurrent, aPrevious);140 emit currentChanged (aCurrent);141 }142 143 void focusInEvent (QFocusEvent *aEvent)144 {145 /* Restore edit-mode on focus in. */146 QTableView::focusInEvent (aEvent);147 if (model()->flags (currentIndex()) & Qt::ItemIsEditable)148 edit (currentIndex());149 }150 };151 152 class VBoxWarnIconLabel: public QWidget153 {154 Q_OBJECT;155 156 public:157 158 VBoxWarnIconLabel (QWidget *aParent = NULL)159 : QWidget (aParent)160 {161 QHBoxLayout *layout = new QHBoxLayout (this);162 VBoxGlobal::setLayoutMargin (layout, 0);163 layout->addWidget (&mIcon);164 layout->addWidget (&mLabel);165 setVisible (false);166 }167 168 void setWarningPixmap (const QPixmap& aPixmap) { mIcon.setPixmap (aPixmap); }169 void setWarningText (const QString& aText) { mLabel.setText (aText); }170 171 private:172 173 QLabel mIcon;174 QLabel mLabel;175 };176 177 #endif // __VBoxSettingsUtils_h__178 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxSettingsDialog.h
r21804 r25136 35 35 36 36 /* VBox forwards*/ 37 class VBoxWarn IconLabel;37 class VBoxWarningPane; 38 38 class VBoxSettingsSelector; 39 39 class VBoxSettingsPage; … … 106 106 QPixmap mErrorIcon; 107 107 QPixmap mWarnIcon; 108 VBoxWarn IconLabel*mIconLabel;108 VBoxWarningPane *mIconLabel; 109 109 110 110 /* WhatsThis Stuff */ -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxWarningPane.h
r25125 r25136 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox SettingsUtilsclass declaration4 * VBoxWarningPane class declaration 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 200 6-2008Sun Microsystems, Inc.8 * Copyright (C) 2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 */ 22 22 23 #ifndef __VBox SettingsUtils_h__24 #define __VBox SettingsUtils_h__23 #ifndef __VBoxWarningPane_h__ 24 #define __VBoxWarningPane_h__ 25 25 26 #include <VBoxGlobal.h> 26 /* Global includes */ 27 #include <QWidget> 28 #include <QLabel> 27 29 28 /* Qt includes */ 29 #ifdef Q_WS_WIN 30 #include <QDialog> 31 #include <QLineEdit> 32 #include <QPushButton> 33 #endif 34 #include <QHBoxLayout> 35 #include <QLabel> 36 #include <QTreeWidget> 37 #include <QHeaderView> 38 #include <QKeyEvent> 39 #include <QTableView> 40 41 enum 42 { 43 /* mTwUSBFilters column numbers */ 44 twUSBFilters_Name = 0, 45 }; 46 47 /** 48 * QTreeWidget class reimplementation to use as boot items table. 49 * It has one unsorted column without header. 50 * Keymapping handlers for ctrl-up & ctrl-down are translated into 51 * boot-items up/down moving signals. 52 * Emits itemToggled() signal when the item changed. 53 */ 54 class BootItemsTable : public QTreeWidget 30 class VBoxWarningPane: public QWidget 55 31 { 56 32 Q_OBJECT; … … 58 34 public: 59 35 60 BootItemsTable (QWidget *aParent) : QTreeWidget (aParent) 61 { 62 header()->hide(); 63 connect (this, SIGNAL (itemChanged (QTreeWidgetItem *, int)), 64 this, SLOT (onItemChanged())); 65 } 36 VBoxWarningPane(QWidget *pParent = 0); 66 37 67 ~BootItemsTable() {} 68 69 signals: 70 71 void moveItemUp(); 72 void moveItemDown(); 73 void itemToggled(); 74 75 private slots: 76 77 void onItemChanged() 78 { 79 emit itemToggled(); 80 } 81 82 void keyPressEvent (QKeyEvent *aEvent) 83 { 84 if (aEvent->QInputEvent::modifiers () == Qt::ControlModifier) 85 { 86 switch (aEvent->key()) 87 { 88 case Qt::Key_Up: 89 emit moveItemUp(); 90 return; 91 case Qt::Key_Down: 92 emit moveItemDown(); 93 return; 94 default: 95 break; 96 } 97 } 98 QTreeWidget::keyPressEvent (aEvent); 99 } 100 }; 101 102 class USBListItem : public QTreeWidgetItem 103 { 104 public: 105 106 enum { USBListItemType = 1002 }; 107 108 USBListItem (QTreeWidget *aParent) 109 : QTreeWidgetItem (aParent, QStringList (QString::null), USBListItemType) 110 , mId (-1) {} 111 112 USBListItem (QTreeWidget *aParent, QTreeWidgetItem *aPreceding) 113 : QTreeWidgetItem (aParent, aPreceding, USBListItemType) 114 , mId (-1) {} 115 116 int mId; 117 }; 118 119 /** 120 * Table-View class reimplementation to extend standard QTableView. 121 */ 122 class QITableView : public QTableView 123 { 124 Q_OBJECT; 125 126 public: 127 128 QITableView (QWidget *aParent) : QTableView (aParent) {} 129 130 signals: 131 132 void currentChanged (const QModelIndex &aCurrent); 133 134 protected: 135 136 void currentChanged (const QModelIndex &aCurrent, 137 const QModelIndex &aPrevious) 138 { 139 QTableView::currentChanged (aCurrent, aPrevious); 140 emit currentChanged (aCurrent); 141 } 142 143 void focusInEvent (QFocusEvent *aEvent) 144 { 145 /* Restore edit-mode on focus in. */ 146 QTableView::focusInEvent (aEvent); 147 if (model()->flags (currentIndex()) & Qt::ItemIsEditable) 148 edit (currentIndex()); 149 } 150 }; 151 152 class VBoxWarnIconLabel: public QWidget 153 { 154 Q_OBJECT; 155 156 public: 157 158 VBoxWarnIconLabel (QWidget *aParent = NULL) 159 : QWidget (aParent) 160 { 161 QHBoxLayout *layout = new QHBoxLayout (this); 162 VBoxGlobal::setLayoutMargin (layout, 0); 163 layout->addWidget (&mIcon); 164 layout->addWidget (&mLabel); 165 setVisible (false); 166 } 167 168 void setWarningPixmap (const QPixmap& aPixmap) { mIcon.setPixmap (aPixmap); } 169 void setWarningText (const QString& aText) { mLabel.setText (aText); } 38 void setWarningPixmap(const QPixmap &imgPixmap); 39 void setWarningText(const QString &strText); 170 40 171 41 private: 172 42 173 QLabel m Icon;174 QLabel m Label;43 QLabel m_icon; 44 QLabel m_label; 175 45 }; 176 46 177 #endif // __VBox SettingsUtils_h__47 #endif // __VBoxWarningPane_h__ 178 48 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxBootTable.cpp
r25125 r25136 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox SettingsUtils class declaration4 * VBoxBootTable class implementation 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 200 6-2008Sun Microsystems, Inc.8 * Copyright (C) 2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 */ 22 22 23 #ifndef __VBoxSettingsUtils_h__ 24 #define __VBoxSettingsUtils_h__ 25 26 #include <VBoxGlobal.h> 27 28 /* Qt includes */ 29 #ifdef Q_WS_WIN 30 #include <QDialog> 31 #include <QLineEdit> 32 #include <QPushButton> 33 #endif 34 #include <QHBoxLayout> 35 #include <QLabel> 36 #include <QTreeWidget> 23 /* Global include */ 37 24 #include <QHeaderView> 38 25 #include <QKeyEvent> 39 #include <QTableView>40 26 41 enum 27 /* Local includes */ 28 #include "VBoxBootTable.h" 29 #include "VBoxGlobal.h" 30 31 VBoxBootTable::VBoxBootTable(QWidget *pParent) 32 : QTreeWidget(pParent) 42 33 { 43 /* mTwUSBFilters column numbers */44 twUSBFilters_Name = 0,45 } ;34 header()->hide(); 35 connect(this, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(onItemChanged())); 36 } 46 37 47 /** 48 * QTreeWidget class reimplementation to use as boot items table. 49 * It has one unsorted column without header. 50 * Keymapping handlers for ctrl-up & ctrl-down are translated into 51 * boot-items up/down moving signals. 52 * Emits itemToggled() signal when the item changed. 53 */ 54 class BootItemsTable : public QTreeWidget 38 void VBoxBootTable::onItemChanged() 55 39 { 56 Q_OBJECT; 40 emit itemToggled(); 41 } 57 42 58 public: 43 void VBoxBootTable::keyPressEvent(QKeyEvent *pEvent) 44 { 45 if (pEvent->QInputEvent::modifiers() == Qt::ControlModifier) 46 { 47 switch (pEvent->key()) 48 { 49 case Qt::Key_Up: 50 emit moveItemUp(); 51 return; 52 case Qt::Key_Down: 53 emit moveItemDown(); 54 return; 55 default: 56 break; 57 } 58 } 59 QTreeWidget::keyPressEvent(pEvent); 60 } 59 61 60 BootItemsTable (QWidget *aParent) : QTreeWidget (aParent)61 {62 header()->hide();63 connect (this, SIGNAL (itemChanged (QTreeWidgetItem *, int)),64 this, SLOT (onItemChanged()));65 }66 67 ~BootItemsTable() {}68 69 signals:70 71 void moveItemUp();72 void moveItemDown();73 void itemToggled();74 75 private slots:76 77 void onItemChanged()78 {79 emit itemToggled();80 }81 82 void keyPressEvent (QKeyEvent *aEvent)83 {84 if (aEvent->QInputEvent::modifiers () == Qt::ControlModifier)85 {86 switch (aEvent->key())87 {88 case Qt::Key_Up:89 emit moveItemUp();90 return;91 case Qt::Key_Down:92 emit moveItemDown();93 return;94 default:95 break;96 }97 }98 QTreeWidget::keyPressEvent (aEvent);99 }100 };101 102 class USBListItem : public QTreeWidgetItem103 {104 public:105 106 enum { USBListItemType = 1002 };107 108 USBListItem (QTreeWidget *aParent)109 : QTreeWidgetItem (aParent, QStringList (QString::null), USBListItemType)110 , mId (-1) {}111 112 USBListItem (QTreeWidget *aParent, QTreeWidgetItem *aPreceding)113 : QTreeWidgetItem (aParent, aPreceding, USBListItemType)114 , mId (-1) {}115 116 int mId;117 };118 119 /**120 * Table-View class reimplementation to extend standard QTableView.121 */122 class QITableView : public QTableView123 {124 Q_OBJECT;125 126 public:127 128 QITableView (QWidget *aParent) : QTableView (aParent) {}129 130 signals:131 132 void currentChanged (const QModelIndex &aCurrent);133 134 protected:135 136 void currentChanged (const QModelIndex &aCurrent,137 const QModelIndex &aPrevious)138 {139 QTableView::currentChanged (aCurrent, aPrevious);140 emit currentChanged (aCurrent);141 }142 143 void focusInEvent (QFocusEvent *aEvent)144 {145 /* Restore edit-mode on focus in. */146 QTableView::focusInEvent (aEvent);147 if (model()->flags (currentIndex()) & Qt::ItemIsEditable)148 edit (currentIndex());149 }150 };151 152 class VBoxWarnIconLabel: public QWidget153 {154 Q_OBJECT;155 156 public:157 158 VBoxWarnIconLabel (QWidget *aParent = NULL)159 : QWidget (aParent)160 {161 QHBoxLayout *layout = new QHBoxLayout (this);162 VBoxGlobal::setLayoutMargin (layout, 0);163 layout->addWidget (&mIcon);164 layout->addWidget (&mLabel);165 setVisible (false);166 }167 168 void setWarningPixmap (const QPixmap& aPixmap) { mIcon.setPixmap (aPixmap); }169 void setWarningText (const QString& aText) { mLabel.setText (aText); }170 171 private:172 173 QLabel mIcon;174 QLabel mLabel;175 };176 177 #endif // __VBoxSettingsUtils_h__178 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsDialog.cpp
r24784 r25136 21 21 */ 22 22 #include "VBoxSettingsDialog.h" 23 #include "VBox SettingsUtils.h"23 #include "VBoxWarningPane.h" 24 24 #include "VBoxGlobal.h" 25 25 #include "VBoxProblemReporter.h" … … 47 47 , mValid (true) 48 48 , mSilent (true) 49 , mIconLabel (new VBoxWarn IconLabel(this))49 , mIconLabel (new VBoxWarningPane (this)) 50 50 , mWhatsThisTimer (new QTimer (this)) 51 51 , mWhatsThisCandidate (0) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsSelector.cpp
r24083 r25136 21 21 */ 22 22 23 /* Global includes */ 24 #include <QHeaderView> 25 #include <QTabWidget> 26 27 /* Local includes */ 23 28 #include "VBoxSettingsSelector.h" 24 #include "VBoxSettingsUtils.h"25 29 #include "VBoxSettingsPage.h" 30 #include "VBoxGlobal.h" 31 #include "VBoxToolBar.h" 26 32 #include "QITreeWidget.h" 27 #include "VBoxToolBar.h"28 29 /* Qt includes */30 #include <QTabWidget>31 33 32 34 enum -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsSystem.cpp
r24900 r25136 21 21 */ 22 22 23 /* Global includes */ 24 #include <QHeaderView> 25 26 /* Local includes */ 27 #include "VBoxVMSettingsSystem.h" 28 #include "VBoxGlobal.h" 23 29 #include "QIWidgetValidator.h" 24 #include "VBoxVMSettingsSystem.h"25 26 30 #include <iprt/cdefs.h> 27 31 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsUSB.cpp
r24600 r25136 23 23 #include "VBoxVMSettingsUSB.h" 24 24 #include "VBoxVMSettingsUSBFilterDetails.h" 25 #include "VBoxSettingsUtils.h"26 25 #include "QIWidgetValidator.h" 27 26 #include "VBoxToolBar.h" … … 313 312 while (*iterator) 314 313 { 315 QString filterName = (*iterator)->text ( twUSBFilters_Name);314 QString filterName = (*iterator)->text (0); 316 315 int pos = regExp.indexIn (filterName); 317 316 if (pos != -1) … … 462 461 { 463 462 filter.SetName (fd.mLeName->text().isEmpty() ? QString::null : fd.mLeName->text()); 464 item->setText ( twUSBFilters_Name, fd.mLeName->text());463 item->setText (0, fd.mLeName->text()); 465 464 filter.SetVendorId (fd.mLeVendorID->text().isEmpty() ? QString::null : fd.mLeVendorID->text()); 466 465 filter.SetProductId (fd.mLeProductID->text().isEmpty() ? QString::null : fd.mLeProductID->text()); … … 567 566 new QTreeWidgetItem (mTwFilters); 568 567 item->setCheckState (0, aFilter.GetActive() ? Qt::Checked : Qt::Unchecked); 569 item->setText ( twUSBFilters_Name, aFilter.GetName());568 item->setText (0, aFilter.GetName()); 570 569 item->setToolTip (0, vboxGlobal().toolTip (aFilter)); 571 570 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxWarningPane.cpp
r25125 r25136 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox SettingsUtils class declaration4 * VBoxWarningPane class implementation 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 200 6-2008Sun Microsystems, Inc.8 * Copyright (C) 2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 */ 22 22 23 #ifndef __VBoxSettingsUtils_h__ 24 # define __VBoxSettingsUtils_h__23 /* Global includes */ 24 #include <QHBoxLayout> 25 25 26 #include <VBoxGlobal.h> 26 /* Local includes */ 27 #include "VBoxWarningPane.h" 28 #include "VBoxGlobal.h" 27 29 28 /* Qt includes */ 29 #ifdef Q_WS_WIN 30 #include <QDialog> 31 #include <QLineEdit> 32 #include <QPushButton> 33 #endif 34 #include <QHBoxLayout> 35 #include <QLabel> 36 #include <QTreeWidget> 37 #include <QHeaderView> 38 #include <QKeyEvent> 39 #include <QTableView> 30 VBoxWarningPane::VBoxWarningPane(QWidget *pParent) 31 : QWidget(pParent) 32 { 33 QHBoxLayout *pLayout = new QHBoxLayout(this); 34 VBoxGlobal::setLayoutMargin(pLayout, 0); 35 pLayout->addWidget(&m_icon); 36 pLayout->addWidget(&m_label); 37 setVisible(false); 38 } 40 39 41 enum 40 void VBoxWarningPane::setWarningPixmap(const QPixmap &imgPixmap) 42 41 { 43 /* mTwUSBFilters column numbers */ 44 twUSBFilters_Name = 0, 45 }; 42 m_icon.setPixmap (imgPixmap); 43 } 46 44 47 /** 48 * QTreeWidget class reimplementation to use as boot items table. 49 * It has one unsorted column without header. 50 * Keymapping handlers for ctrl-up & ctrl-down are translated into 51 * boot-items up/down moving signals. 52 * Emits itemToggled() signal when the item changed. 53 */ 54 class BootItemsTable : public QTreeWidget 45 void VBoxWarningPane::setWarningText(const QString &strText) 55 46 { 56 Q_OBJECT; 47 m_label.setText (strText); 48 } 57 49 58 public:59 60 BootItemsTable (QWidget *aParent) : QTreeWidget (aParent)61 {62 header()->hide();63 connect (this, SIGNAL (itemChanged (QTreeWidgetItem *, int)),64 this, SLOT (onItemChanged()));65 }66 67 ~BootItemsTable() {}68 69 signals:70 71 void moveItemUp();72 void moveItemDown();73 void itemToggled();74 75 private slots:76 77 void onItemChanged()78 {79 emit itemToggled();80 }81 82 void keyPressEvent (QKeyEvent *aEvent)83 {84 if (aEvent->QInputEvent::modifiers () == Qt::ControlModifier)85 {86 switch (aEvent->key())87 {88 case Qt::Key_Up:89 emit moveItemUp();90 return;91 case Qt::Key_Down:92 emit moveItemDown();93 return;94 default:95 break;96 }97 }98 QTreeWidget::keyPressEvent (aEvent);99 }100 };101 102 class USBListItem : public QTreeWidgetItem103 {104 public:105 106 enum { USBListItemType = 1002 };107 108 USBListItem (QTreeWidget *aParent)109 : QTreeWidgetItem (aParent, QStringList (QString::null), USBListItemType)110 , mId (-1) {}111 112 USBListItem (QTreeWidget *aParent, QTreeWidgetItem *aPreceding)113 : QTreeWidgetItem (aParent, aPreceding, USBListItemType)114 , mId (-1) {}115 116 int mId;117 };118 119 /**120 * Table-View class reimplementation to extend standard QTableView.121 */122 class QITableView : public QTableView123 {124 Q_OBJECT;125 126 public:127 128 QITableView (QWidget *aParent) : QTableView (aParent) {}129 130 signals:131 132 void currentChanged (const QModelIndex &aCurrent);133 134 protected:135 136 void currentChanged (const QModelIndex &aCurrent,137 const QModelIndex &aPrevious)138 {139 QTableView::currentChanged (aCurrent, aPrevious);140 emit currentChanged (aCurrent);141 }142 143 void focusInEvent (QFocusEvent *aEvent)144 {145 /* Restore edit-mode on focus in. */146 QTableView::focusInEvent (aEvent);147 if (model()->flags (currentIndex()) & Qt::ItemIsEditable)148 edit (currentIndex());149 }150 };151 152 class VBoxWarnIconLabel: public QWidget153 {154 Q_OBJECT;155 156 public:157 158 VBoxWarnIconLabel (QWidget *aParent = NULL)159 : QWidget (aParent)160 {161 QHBoxLayout *layout = new QHBoxLayout (this);162 VBoxGlobal::setLayoutMargin (layout, 0);163 layout->addWidget (&mIcon);164 layout->addWidget (&mLabel);165 setVisible (false);166 }167 168 void setWarningPixmap (const QPixmap& aPixmap) { mIcon.setPixmap (aPixmap); }169 void setWarningText (const QString& aText) { mLabel.setText (aText); }170 171 private:172 173 QLabel mIcon;174 QLabel mLabel;175 };176 177 #endif // __VBoxSettingsUtils_h__178 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsSystem.ui
r24811 r25136 176 176 </property> 177 177 <item> 178 <widget class=" BootItemsTable" name="mTwBootOrder">178 <widget class="VBoxBootTable" name="mTwBootOrder"> 179 179 <property name="sizePolicy"> 180 180 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> … … 579 579 <customwidgets> 580 580 <customwidget> 581 <class> BootItemsTable</class>581 <class>VBoxBootTable</class> 582 582 <extends>QTreeWidget</extends> 583 <header>VBox SettingsUtils.h</header>583 <header>VBoxBootTable.h</header> 584 584 </customwidget> 585 585 <customwidget>
Note:
See TracChangeset
for help on using the changeset viewer.