Changeset 37893 in vbox
- Timestamp:
- Jul 12, 2011 12:31:43 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72794
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIMediumTypeChangeDialog.cpp
r37888 r37893 53 53 m_pLabel = new QILabel(this); 54 54 m_pLabel->setWordWrap(true); 55 m_pLabel->useSizeHintForWidth(4 00);55 m_pLabel->useSizeHintForWidth(450); 56 56 m_pLabel->updateGeometry(); 57 57 pMainLayout->addWidget(m_pLabel); … … 109 109 { 110 110 /* Translate window title: */ 111 setWindowTitle(tr(" Change medium type"));111 setWindowTitle(tr("Modify medium attributes")); 112 112 113 113 /* Translate description: */ 114 m_pLabel->setText(tr("<p>You are about to change the medium type of the virtual disk located in %1.</p>" 114 m_pLabel->setText(tr("<p>You are about to change the attributes of the virtual disk located in <b>%1</b>.</p>" 115 "<p><i>Note: For now only the 'medium type' attribute is changeable.</i></p>" 115 116 "<p>Please choose one of the following medium types and press <b>%2</b> " 116 117 "to proceed or <b>%3</b> otherwise.</p>") -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
r37891 r37893 285 285 this, SLOT (makeRequestForAdjustTable())); 286 286 287 /* Setup information pane: */288 m_pChangeMediumTypeButton->setIcon(UIIconPool::iconSet(":/arrow_down_10px.png"));289 connect(m_pChangeMediumTypeButton, SIGNAL(clicked()), this, SLOT(sltOpenMediumTypeChangeDialog()));290 m_pChangeMediumTypeButton->setIconSize(QSize(10, 10));291 292 287 /* Context menu composing */ 293 288 mActionsContextMenu = new QMenu (this); … … 296 291 mAddAction = new QAction (this); 297 292 mCopyAction = new QAction (this); 293 mModifyAction = new QAction (this); 298 294 mRemoveAction = new QAction (this); 299 295 mReleaseAction = new QAction (this); … … 303 299 connect (mAddAction, SIGNAL (triggered()), this, SLOT (doAddMedium())); 304 300 connect (mCopyAction, SIGNAL (triggered()), this, SLOT (doCopyMedium())); 301 connect (mModifyAction, SIGNAL (triggered()), this, SLOT (doModifyMedium())); 305 302 connect (mRemoveAction, SIGNAL (triggered()), this, SLOT (doRemoveMedium())); 306 303 connect (mReleaseAction, SIGNAL (triggered()), this, SLOT (doReleaseMedium())); … … 316 313 ":/hd_add_disabled_22px.png", ":/hd_add_disabled_16px.png")); 317 314 mCopyAction->setIcon(UIIconPool::iconSetFull ( 315 QSize (22, 22), QSize (16, 16), 316 ":/hd_add_22px.png", ":/hd_add_16px.png", 317 ":/hd_add_disabled_22px.png", ":/hd_add_disabled_16px.png")); 318 mModifyAction->setIcon(UIIconPool::iconSetFull ( 318 319 QSize (22, 22), QSize (16, 16), 319 320 ":/hd_new_22px.png", ":/hd_new_16px.png", … … 333 334 334 335 mActionsContextMenu->addAction (mCopyAction); 336 mActionsContextMenu->addAction (mModifyAction); 335 337 mActionsContextMenu->addAction (mRemoveAction); 336 338 mActionsContextMenu->addAction (mReleaseAction); … … 362 364 // mToolBar->addAction (mAddAction); 363 365 mToolBar->addAction (mCopyAction); 366 mToolBar->addAction (mModifyAction); 364 367 // mToolBar->addSeparator(); 365 368 mToolBar->addAction (mRemoveAction); … … 373 376 // mActionsMenu->addAction (mAddAction); 374 377 mActionsMenu->addAction (mCopyAction); 378 mActionsMenu->addAction (mModifyAction); 375 379 // mActionsMenu->addSeparator(); 376 380 mActionsMenu->addAction (mRemoveAction); … … 607 611 mAddAction->setText (tr ("&Add...")); 608 612 mCopyAction->setText (tr ("&Copy...")); 613 mModifyAction->setText (tr ("&Modify...")); 609 614 mRemoveAction->setText (tr ("R&emove")); 610 615 mReleaseAction->setText (tr ("Re&lease")); … … 614 619 mAddAction->setShortcut (QKeySequence ("Ins")); 615 620 mCopyAction->setShortcut (QKeySequence ("Ctrl+C")); 621 mModifyAction->setShortcut (QKeySequence ("Ctrl+Space")); 616 622 mRemoveAction->setShortcut (QKeySequence (QKeySequence::Delete)); 617 623 mReleaseAction->setShortcut (QKeySequence ("Ctrl+L")); … … 621 627 mAddAction->setStatusTip (tr ("Add an existing medium")); 622 628 mCopyAction->setStatusTip (tr ("Copy an existing medium")); 629 mModifyAction->setStatusTip (tr ("Modify an existing medium attributes")); 623 630 mRemoveAction->setStatusTip (tr ("Remove the selected medium")); 624 631 mReleaseAction->setStatusTip (tr ("Release the selected medium by detaching it from the machines")); … … 631 638 mCopyAction->setToolTip (mCopyAction->text().remove ('&') + 632 639 QString (" (%1)").arg (mCopyAction->shortcut().toString())); 640 mModifyAction->setToolTip (mModifyAction->text().remove ('&') + 641 QString (" (%1)").arg (mModifyAction->shortcut().toString())); 633 642 mRemoveAction->setToolTip (mRemoveAction->text().remove ('&') + 634 643 QString (" (%1)").arg (mRemoveAction->shortcut().toString())); … … 1063 1072 } 1064 1073 1074 void VBoxMediaManagerDlg::doModifyMedium() 1075 { 1076 MediaItem *pMediumItem = toMediaItem(currentTreeWidget()->currentItem()); 1077 UIMediumTypeChangeDialog dlg(this, pMediumItem->id()); 1078 if (dlg.exec() == QDialog::Accepted) 1079 { 1080 pMediumItem->refreshAll(); 1081 m_pTypePane->setText(pMediumItem->hardDiskType()); 1082 } 1083 } 1084 1065 1085 void VBoxMediaManagerDlg::doRemoveMedium() 1066 1086 { … … 1419 1439 bool copyEnabled = currentTreeWidgetType() == VBoxDefs::MediumType_HardDisk && 1420 1440 notInEnum && item && checkMediumFor (item, Action_Copy); 1441 bool modifyEnabled = currentTreeWidgetType() == VBoxDefs::MediumType_HardDisk && 1442 notInEnum && item && checkMediumFor (item, Action_Modify); 1421 1443 bool removeEnabled = notInEnum && item && checkMediumFor (item, Action_Remove); 1422 1444 bool releaseEnabled = item && checkMediumFor (item, Action_Release); … … 1425 1447 mAddAction->setEnabled (addEnabled); 1426 1448 mCopyAction->setEnabled (copyEnabled); 1449 mModifyAction->setEnabled (modifyEnabled); 1427 1450 mRemoveAction->setEnabled (removeEnabled); 1428 1451 mReleaseAction->setEnabled (releaseEnabled); … … 1443 1466 if (item->treeWidget() == mTwHD) 1444 1467 { 1445 /* Check if thats parent medium: */1446 bool fIsThatParentMedium = !item->medium().parent();1447 m_pChangeMediumTypeButton->setEnabled(fIsThatParentMedium);1448 1449 /* Other panes: */1450 1468 m_pTypePane->setText(item->hardDiskType()); 1451 1469 m_pLocationPane->setText(formatPaneText(item->location(), true, "end")); … … 1544 1562 if (widgetList [i]->header()->sectionSize (0) != size0) 1545 1563 widgetList [i]->header()->resizeSection (0, size0); 1546 }1547 }1548 1549 void VBoxMediaManagerDlg::sltOpenMediumTypeChangeDialog()1550 {1551 MediaItem *pMediumItem = toMediaItem(currentTreeWidget()->currentItem());1552 UIMediumTypeChangeDialog dlg(this, pMediumItem->id());1553 if (dlg.exec() == QDialog::Accepted)1554 {1555 pMediumItem->refreshAll();1556 m_pTypePane->setText(pMediumItem->hardDiskType());1557 1564 } 1558 1565 } … … 1761 1768 } 1762 1769 case Action_Copy: 1770 { 1771 /* False for children: */ 1772 return !aItem->medium().parent(); 1773 } 1774 case Action_Modify: 1763 1775 { 1764 1776 /* False for children: */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h
r37874 r37893 40 40 enum TabIndex { HDTab = 0, CDTab, FDTab }; 41 41 enum ItemAction { ItemAction_Added, ItemAction_Updated, ItemAction_Removed }; 42 enum Action { Action_Select, Action_Edit, Action_Copy, Action_ Remove, Action_Release };42 enum Action { Action_Select, Action_Edit, Action_Copy, Action_Modify, Action_Remove, Action_Release }; 43 43 44 44 public: … … 86 86 void doAddMedium(); 87 87 void doCopyMedium(); 88 void doModifyMedium(); 88 89 void doRemoveMedium(); 89 90 void doReleaseMedium(); … … 100 101 void makeRequestForAdjustTable(); 101 102 void performTablesAdjustment(); 102 103 void sltOpenMediumTypeChangeDialog();104 103 105 104 private: … … 159 158 QAction *mAddAction; 160 159 QAction *mCopyAction; 160 QAction *mModifyAction; 161 161 QAction *mRemoveAction; 162 162 QAction *mReleaseAction; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.ui
r37874 r37893 104 104 </item> 105 105 <item row="0" column="1" > 106 <layout class="QHBoxLayout"> 107 <item> 108 <widget class="QILabel" name="m_pTypePane"> 109 <property name="sizePolicy"> 110 <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding"> 111 <horstretch>0</horstretch> 112 <verstretch>0</verstretch> 113 </sizepolicy> 114 </property> 115 </widget> 116 </item> 117 <item> 118 <widget class="QIToolButton" name="m_pChangeMediumTypeButton"> 119 <property name="autoRaise"> 120 <bool>true</bool> 121 </property> 122 <property name="toolTip"> 123 <string>Change medium type...</string> 124 </property> 125 </widget> 126 </item> 127 </layout> 106 <widget class="QILabel" name="m_pTypePane"> 107 <property name="sizePolicy"> 108 <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding"> 109 <horstretch>0</horstretch> 110 <verstretch>0</verstretch> 111 </sizepolicy> 112 </property> 113 </widget> 128 114 </item> 129 115 <item row="1" column="0" > … … 413 399 <header>QITabWidget.h</header> 414 400 </customwidget> 415 <customwidget>416 <class>QIToolButton</class>417 <extends>QToolButton</extends>418 <header>QIToolButton.h</header>419 </customwidget>420 401 </customwidgets> 421 402 <resources/>
Note:
See TracChangeset
for help on using the changeset viewer.