Changeset 2578 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 10, 2007 12:40:16 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h
r2411 r2578 28 28 #include <qlistview.h> 29 29 #include <qtextedit.h> 30 #include <qlabel.h> 30 31 31 32 /** … … 127 128 }; 128 129 129 /** 130 /** 130 131 * Watches the given widget and makes sure the minimum widget size set by the layout 131 132 * manager does never get smaller than the previous minimum size set by the … … 133 134 * toggle buttons) will be able only to grow, never shrink, to avoid flicker 134 135 * during alternate contents updates (Pause -> Resume -> Pause -> ...). 135 * 136 * 136 137 * @todo not finished 137 138 */ … … 169 170 170 171 171 /** 172 /** 172 173 * Simple QTextEdit subclass to return its minimumSizeHint() as sizeHint() 173 174 * for getting more compact layout. … … 175 176 class QITextEdit : public QTextEdit 176 177 { 178 Q_OBJECT 179 177 180 public: 178 181 … … 187 190 QSize minimumSizeHint() const 188 191 { 189 /// @todo (r=dmik) this looks a bit meanignless. any comment? 190 int w = 0; 191 int h = heightForWidth (w); 192 return QSize (w, h); 193 } 192 return QSize (width(), heightForWidth (width())); 193 } 194 }; 195 196 197 /** 198 * Simple QLabel subclass to re-query and return its sizeHint() 199 * before the widget to be shown for getting more compact layout. 200 */ 201 class QILabel : public QLabel 202 { 203 Q_OBJECT 204 205 public: 206 207 QILabel (QWidget *aParent, const char *aName) 208 : QLabel (aParent, aName), mSizeHint (-1, -1) 209 { 210 /* setup default size policy and alignment */ 211 setSizePolicy (QSizePolicy ((QSizePolicy::SizeType)1, 212 (QSizePolicy::SizeType)0, 213 0, 0, 214 sizePolicy().hasHeightForWidth())); 215 setAlignment (int (QLabel::WordBreak | QLabel::AlignTop)); 216 /* install show-parent-widget watcher */ 217 aParent->installEventFilter (this); 218 } 219 220 QSize sizeHint() const 221 { 222 /* use cashed sizeHint if mSizeHint is valid */ 223 if (!mSizeHint.isValid()) 224 mSizeHint = QLabel::sizeHint(); 225 return mSizeHint; 226 } 227 228 private: 229 230 bool eventFilter (QObject *aObject, QEvent *aEvent) 231 { 232 switch (aEvent->type()) 233 { 234 case QEvent::Show: 235 { 236 /* watch for parent's show-event to recalculate sizeHint */ 237 mSizeHint = QSize (width(), heightForWidth (width())); 238 updateGeometry(); 239 break; 240 } 241 default: 242 break; 243 } 244 return QLabel::eventFilter (aObject, aEvent); 245 } 246 247 mutable QSize mSizeHint; 194 248 }; 195 249 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui
r2413 r2578 86 86 <cstring>unnamed</cstring> 87 87 </property> 88 <widget class="QLabel">89 <property name="name">90 <cstring>txWelcome</cstring>91 </property>92 <property name="sizePolicy">93 <sizepolicy>94 <hsizetype>1</hsizetype>95 <vsizetype>0</vsizetype>96 <horstretch>0</horstretch>97 <verstretch>0</verstretch>98 </sizepolicy>99 </property>100 <property name="text">101 <string><p>This wizard will help you to create a new virtual hard disk image for your virtual machine.</p>102 <p>Use the <b>Next</b> button to go to the next page of the wizard103 and the <b>Back</b> button to return to the previous page.</p></string>104 </property>105 <property name="alignment">106 <set>WordBreak|AlignTop</set>107 </property>108 </widget>109 88 <spacer> 110 89 <property name="name"> … … 192 171 <number>10</number> 193 172 </property> 194 <widget class="QLabel">195 <property name="name">196 <cstring>textLabel1_2</cstring>197 </property>198 <property name="sizePolicy">199 <sizepolicy>200 <hsizetype>1</hsizetype>201 <vsizetype>0</vsizetype>202 <horstretch>0</horstretch>203 <verstretch>0</verstretch>204 </sizepolicy>205 </property>206 <property name="text">207 <string><p>Select the type of virtual hard disk image you want to create.</p>208 <p>A <b>dynamically expanding image</b> initially occupies a very small amount209 of space on your physical hard disk. It will grow dynamically (up to210 the size specified) as the Guest OS claims disk space.</p>211 <p>A <b>fixed-size image</b> does not grow. It is stored in a file of approximately212 the same size as the size of the virtual hard disk.</p></string>213 </property>214 <property name="alignment">215 <set>WordBreak|AlignTop</set>216 </property>217 </widget>218 173 <widget class="QButtonGroup"> 219 174 <property name="name"> … … 322 277 <number>10</number> 323 278 </property> 324 <widget class="QLabel">325 <property name="name">326 <cstring>txNameComment</cstring>327 </property>328 <property name="sizePolicy">329 <sizepolicy>330 <hsizetype>1</hsizetype>331 <vsizetype>0</vsizetype>332 <horstretch>0</horstretch>333 <verstretch>0</verstretch>334 </sizepolicy>335 </property>336 <property name="text">337 <string><p>Press the <b>Select</b> button to select the location and name of the file338 to store the virtual hard disk image or type a file name in the entry field.</p></string>339 </property>340 <property name="alignment">341 <set>WordBreak|AlignTop</set>342 </property>343 </widget>344 279 <widget class="QGroupBox"> 345 280 <property name="name"> … … 385 320 </widget> 386 321 </hbox> 387 </widget>388 <widget class="QLabel">389 <property name="name">390 <cstring>txSizeComment</cstring>391 </property>392 <property name="sizePolicy">393 <sizepolicy>394 <hsizetype>1</hsizetype>395 <vsizetype>0</vsizetype>396 <horstretch>0</horstretch>397 <verstretch>0</verstretch>398 </sizepolicy>399 </property>400 <property name="text">401 <string><p>Select the size of the virtual hard disk image in megabytes. This size will be reported to the Guest OS402 as the size of the virtual hard disk.</p></string>403 </property>404 <property name="alignment">405 <set>WordBreak|AlignTop</set>406 </property>407 322 </widget> 408 323 <widget class="QGroupBox"> … … 475 390 </property> 476 391 <property name="alignment"> 477 <set> WordBreak|AlignVCenter|AlignLeft</set>392 <set>AlignVCenter|AlignLeft</set> 478 393 </property> 479 394 </widget> … … 500 415 </property> 501 416 <property name="alignment"> 502 <set> WordBreak|AlignVCenter|AlignRight</set>417 <set>AlignVCenter|AlignRight</set> 503 418 </property> 504 419 </widget> … … 617 532 <number>15</number> 618 533 </property> 619 <widget class="QLabel">620 <property name="name">621 <cstring>txSummaryHdr</cstring>622 </property>623 <property name="sizePolicy">624 <sizepolicy>625 <hsizetype>1</hsizetype>626 <vsizetype>0</vsizetype>627 <horstretch>0</horstretch>628 <verstretch>0</verstretch>629 </sizepolicy>630 </property>631 <property name="text">632 <string>You are going to create a new virtual hard disk image with the following parameters:</string>633 </property>634 <property name="alignment">635 <set>WordBreak|AlignTop</set>636 </property>637 </widget>638 <widget class="QLabel">639 <property name="name">640 <cstring>txSummaryFtr</cstring>641 </property>642 <property name="sizePolicy">643 <sizepolicy>644 <hsizetype>1</hsizetype>645 <vsizetype>0</vsizetype>646 <horstretch>0</horstretch>647 <verstretch>0</verstretch>648 </sizepolicy>649 </property>650 <property name="text">651 <string>If the above settings are correct, press the <b>Finish</b> button.652 Once you press it, a new hard disk image will be created.653 </string>654 </property>655 <property name="alignment">656 <set>WordBreak|AlignTop</set>657 </property>658 </widget>659 534 <spacer> 660 535 <property name="name"> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui.h
r2392 r2578 157 157 void VBoxNewHDWzd::init() 158 158 { 159 /* Wizard labels recreation */ 160 161 QILabel *txWelcome = new QILabel (pageWelcome, "txWelcome"); 162 txWelcome->setText (tr ("<p>This wizard will help you to create a new " 163 "virtual hard disk image for your virtual " 164 "machine.</p>\n""<p>Use the <b>Next</b> button to " 165 "go to the next page of the wizard\n""and the " 166 "<b>Back</b> button to return to the previous " 167 "page.</p>")); 168 layout33->insertWidget (0, txWelcome); 169 170 QILabel *textLabel1_2 = new QILabel (pageType, "textLabel1_2"); 171 textLabel1_2->setText (tr ("<p>Select the type of virtual hard disk image " 172 "you want to create.</p>\n""<p>A " 173 "<b>dynamically expanding image</b> initially " 174 "occupies a very small amount\n""of space on " 175 "your physical hard disk. It will grow " 176 "dynamically (up to\n""the size specified) as " 177 "the Guest OS claims disk space.</p>\n""<p>A " 178 "<b>fixed-size image</b> does not grow. It is " 179 "stored in a file of approximately\n""the same " 180 "size as the size of the virtual hard " 181 "disk.</p>")); 182 layout12->insertWidget (0, textLabel1_2); 183 184 QILabel *txNameComment = new QILabel (pageNameAndSize, "txNameComment"); 185 txNameComment->setText (tr ("<p>Press the <b>Select</b> button to select " 186 "the location and name of the file\n""to " 187 "store the virtual hard disk image or type a " 188 "file name in the entry field.</p>")); 189 layout36->insertWidget (0, txNameComment); 190 191 QILabel *txSizeComment = new QILabel (pageNameAndSize, "txSizeComment" ); 192 txSizeComment->setText (tr ("<p>Select the size of the virtual hard disk " 193 "image in megabytes. This size will be " 194 "reported to the Guest OS\n""as the size of " 195 "the virtual hard disk.</p>")); 196 layout36->insertWidget (2, txSizeComment); 197 198 QILabel *txSummaryHdr = new QILabel (pageSummary, "txSummaryHdr"); 199 txSummaryHdr->setText (tr ("You are going to create a new virtual hard " 200 "disk image with the following parameters:")); 201 summaryLayout->insertWidget (0, txSummaryHdr); 202 203 QILabel *txSummaryFtr = new QILabel (pageSummary, "txSummaryFtr"); 204 txSummaryFtr->setText (tr ("If the above settings are correct, press the " 205 "<b>Finish</b> button.\n" 206 " Once you press " 207 "it, a new hard disk image will be created.\n" 208 " ")); 209 159 210 /* disable help buttons */ 160 211 helpButton()->setShown (false); … … 221 272 teSummary->setReadOnly (TRUE); 222 273 summaryLayout->insertWidget (1, teSummary); 274 summaryLayout->insertWidget (2, txSummaryFtr); 223 275 224 276 /* filter out Enter keys in order to direct them to the default dlg button */ … … 263 315 /* the finish button on the Summary page is always enabled */ 264 316 setFinishEnabled (pageSummary, true); 265 266 /* setup minimum width for the sizeHint to be calculated correctly */267 int wid = widthSpacer->minimumSize().width();268 txWelcome->setMinimumWidth (wid);269 textLabel1_2->setMinimumWidth (wid);270 txNameComment->setMinimumWidth (wid);271 txSizeComment->setMinimumWidth (wid);272 txSummaryHdr->setMinimumWidth (wid);273 txSummaryFtr->setMinimumWidth (wid);274 317 } 275 318 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui
r2414 r2578 84 84 <cstring>unnamed</cstring> 85 85 </property> 86 <widget class="QLabel">87 <property name="name">88 <cstring>txWelcome</cstring>89 </property>90 <property name="sizePolicy">91 <sizepolicy>92 <hsizetype>1</hsizetype>93 <vsizetype>0</vsizetype>94 <horstretch>0</horstretch>95 <verstretch>0</verstretch>96 </sizepolicy>97 </property>98 <property name="text">99 <string><p>This wizard will guide you through the steps that are necessary to create100 a new virtual machine for VirtualBox.</p>101 <p>Use the <b>Next</b> button to go the next page of the wizard102 and the <b>Back</b> button to return to the previous page.</p></string>103 </property>104 <property name="alignment">105 <set>WordBreak|AlignTop</set>106 </property>107 </widget>108 86 <spacer> 109 87 <property name="name"> … … 188 166 <number>15</number> 189 167 </property> 190 <widget class="QLabel">191 <property name="name">192 <cstring>txNameAndOS</cstring>193 </property>194 <property name="sizePolicy">195 <sizepolicy>196 <hsizetype>1</hsizetype>197 <vsizetype>0</vsizetype>198 <horstretch>0</horstretch>199 <verstretch>0</verstretch>200 </sizepolicy>201 </property>202 <property name="text">203 <string><p>Enter a name for the new virtual machine and select the type of the guest operating204 system you plan to install onto the virtual machine.</p>205 <p>The name of the virtual machine usually indicates its software and hardware configuration.206 It will be used by all VirtualBox components to identify your virtual machine.</p></string>207 </property>208 <property name="alignment">209 <set>WordBreak|AlignTop</set>210 </property>211 </widget>212 168 <widget class="QGroupBox"> 213 169 <property name="name"> … … 428 384 <number>15</number> 429 385 </property> 430 <widget class="QLabel">431 <property name="name">432 <cstring>textLabel1</cstring>433 </property>434 <property name="sizePolicy">435 <sizepolicy>436 <hsizetype>1</hsizetype>437 <vsizetype>0</vsizetype>438 <horstretch>0</horstretch>439 <verstretch>0</verstretch>440 </sizepolicy>441 </property>442 <property name="text">443 <string><p>Select the amount of base memory (RAM) in megabytes to be allocated to the virtual machine.</p></string>444 </property>445 <property name="alignment">446 <set>WordBreak|AlignTop</set>447 </property>448 </widget>449 <widget class="QLabel">450 <property name="name">451 <cstring>txRAMBest2</cstring>452 </property>453 <property name="sizePolicy">454 <sizepolicy>455 <hsizetype>1</hsizetype>456 <vsizetype>0</vsizetype>457 <horstretch>0</horstretch>458 <verstretch>0</verstretch>459 </sizepolicy>460 </property>461 <property name="text">462 <string></string>463 </property>464 <property name="alignment">465 <set>WordBreak|AlignTop</set>466 </property>467 </widget>468 386 <widget class="QGroupBox"> 469 387 <property name="name"> … … 747 665 <number>15</number> 748 666 </property> 749 <widget class="QLabel">750 <property name="name">751 <cstring>textLabel1_3</cstring>752 </property>753 <property name="sizePolicy">754 <sizepolicy>755 <hsizetype>1</hsizetype>756 <vsizetype>0</vsizetype>757 <horstretch>0</horstretch>758 <verstretch>0</verstretch>759 </sizepolicy>760 </property>761 <property name="text">762 <string><p>Select a hard disk image to be used763 as the boot hard disk of the virtual machine. You can either create a new hard764 disk using the <b>New</b> button or select an existing hard disk765 image from the drop-down list or by pressing the <b>Existing</b>766 button (to invoke the Virtual Disk Manager dialog).</p>767 <p>If you need a more complicated hard disk setup, you can also skip this768 step and attach hard disks later using the VM Settings dialog.</p></string>769 </property>770 <property name="alignment">771 <set>WordBreak|AlignTop</set>772 </property>773 </widget>774 <widget class="QLabel">775 <property name="name">776 <cstring>txVDIBest</cstring>777 </property>778 <property name="sizePolicy">779 <sizepolicy>780 <hsizetype>1</hsizetype>781 <vsizetype>0</vsizetype>782 <horstretch>0</horstretch>783 <verstretch>0</verstretch>784 </sizepolicy>785 </property>786 <property name="text">787 <string></string>788 </property>789 <property name="alignment">790 <set>WordBreak|AlignTop</set>791 </property>792 </widget>793 667 <widget class="QGroupBox"> 794 668 <property name="name"> … … 918 792 <number>15</number> 919 793 </property> 920 <widget class="QLabel">921 <property name="name">922 <cstring>txSummaryHdr</cstring>923 </property>924 <property name="sizePolicy">925 <sizepolicy>926 <hsizetype>1</hsizetype>927 <vsizetype>0</vsizetype>928 <horstretch>0</horstretch>929 <verstretch>0</verstretch>930 </sizepolicy>931 </property>932 <property name="text">933 <string>934 <p>935 You are going to create a new virtual machine936 with the following parameters:937 </p>938 </string>939 </property>940 <property name="alignment">941 <set>WordBreak|AlignTop</set>942 </property>943 </widget>944 <widget class="QLabel">945 <property name="name">946 <cstring>txSummaryFtr</cstring>947 </property>948 <property name="sizePolicy">949 <sizepolicy>950 <hsizetype>1</hsizetype>951 <vsizetype>0</vsizetype>952 <horstretch>0</horstretch>953 <verstretch>0</verstretch>954 </sizepolicy>955 </property>956 <property name="text">957 <string>958 <p>959 If the above is correct press the <b>Finish</b> button.960 Once you press it, a new virtual machine will be created.961 </p><p>962 Note that you can alter these and all other setting of the963 created virtual machine at any time using the964 <b>Settings</b> dialog accessible through965 the menu of the main window.966 </p>967 </string>968 </property>969 <property name="alignment">970 <set>WordBreak|AlignTop</set>971 </property>972 </widget>973 794 <spacer> 974 795 <property name="name"> … … 1047 868 <forward>class VBoxMediaComboBox</forward> 1048 869 <forward>class QITextEdit</forward> 870 <forward>class QILabel</forward> 1049 871 </forwards> 1050 872 <variables> … … 1057 879 <variable access="private">VBoxMediaComboBox *mediaCombo;</variable> 1058 880 <variable access="private">QITextEdit *teSummary;</variable> 881 <variable access="private">QILabel *txRAMBest2;</variable> 882 <variable access="private">QILabel *txVDIBest;</variable> 1059 883 </variables> 1060 884 <slots> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h
r2567 r2578 55 55 void VBoxNewVMWzd::init() 56 56 { 57 /* Wizard labels recreation */ 58 59 QILabel *txWelcome = new QILabel (pageWelcome, "txWelcome"); 60 txWelcome->setText (tr ("<p>This wizard will guide you through the steps " 61 "that are necessary to create\n""a new virtual " 62 "machine for VirtualBox.</p>\n""<p>Use the " 63 "<b>Next</b> button to go the next page of the " 64 "wizard\n""and the <b>Back</b> button to return " 65 "to the previous page.</p>")); 66 layout74->insertWidget (0, txWelcome); 67 68 QILabel *txNameAndOS = new QILabel (pageNameAndOS, "txNameAndOS"); 69 txNameAndOS->setText (tr ("<p>Enter a name for the new virtual machine " 70 "and select the type of the guest operating\n" 71 "system you plan to install onto the virtual " 72 "machine.</p>\n""<p>The name of the virtual " 73 "machine usually indicates its software and " 74 "hardware configuration.\n""It will be used by " 75 "all VirtualBox components to identify your " 76 "virtual machine.</p>")); 77 layout23->insertWidget (0, txNameAndOS); 78 79 QILabel *textLabel1 = new QILabel (pageMemory, "textLabel1"); 80 textLabel1->setText (tr ("<p>Select the amount of base memory (RAM) in " 81 "megabytes to be allocated to the virtual " 82 "machine.</p>")); 83 layout35->insertWidget (0, textLabel1); 84 85 txRAMBest2 = new QILabel (pageMemory, "txRAMBest2"); 86 layout35->insertWidget (1, txRAMBest2); 87 88 QILabel *textLabel1_3 = new QILabel (pageHDD, "textLabel1_3"); 89 textLabel1_3->setText (tr ("<p>Select a hard disk image to be used\n" 90 "as the boot hard disk of the virtual machine. " 91 "You can either create a new hard\n""disk " 92 "using the <b>New</b> button or select an " 93 "existing hard disk\n""image from the " 94 "drop-down list or by pressing the " 95 "<b>Existing</b>\n""button (to invoke the " 96 "Virtual Disk Manager dialog).</p>\n""<p>If " 97 "you need a more complicated hard disk setup, " 98 "you can also skip this\n""step and attach " 99 "hard disks later using the VM Settings " 100 "dialog.</p>")); 101 layout76->insertWidget (0, textLabel1_3); 102 103 txVDIBest = new QILabel (pageHDD, "txVDIBest"); 104 layout76->insertWidget (1, txVDIBest); 105 106 QILabel *txSummaryHdr = new QILabel (pageSummary, "txSummaryHdr"); 107 txSummaryHdr->setText (tr ("\n"" <p>\n" 108 " You are going " 109 "to create a new virtual machine\n" 110 " with the " 111 "following parameters:\n" 112 " </p>\n" 113 " ")); 114 summaryLayout->insertWidget (0, txSummaryHdr); 115 116 QILabel *txSummaryFtr = new QILabel (pageSummary, "txSummaryFtr"); 117 txSummaryFtr->setText (tr ("\n"" <p>\n" 118 " If the above is " 119 "correct press the <b>Finish</b> button.\n" 120 " Once you press " 121 "it, a new virtual machine will be created.\n" 122 " </p><p>\n" 123 " Note that you can " 124 "alter these and all other setting of the\n" 125 " created virtual " 126 "machine at any time using the\n" 127 " <b>Settings</b> " 128 "dialog accessible through\n" 129 " the menu of the " 130 "main window.\n"" " 131 "</p>\n"" ")); 132 57 133 /* disable help buttons */ 58 134 helpButton()->setShown (false); … … 127 203 teSummary->setReadOnly (TRUE); 128 204 summaryLayout->insertWidget (1, teSummary); 205 summaryLayout->insertWidget (2, txSummaryFtr); 129 206 130 207 /* filter out Enter keys in order to direct them to the default dlg button */ … … 179 256 /* the finish button on the Summary page is always enabled */ 180 257 setFinishEnabled (pageSummary, true); 181 182 /* setup minimum width for the sizeHint to be calculated correctly */183 int wid = widthSpacer->minimumSize().width();184 txWelcome->setMinimumWidth (wid);185 txNameAndOS->setMinimumWidth (wid);186 textLabel1->setMinimumWidth (wid);187 txRAMBest2->setMinimumWidth (wid);188 textLabel1_3->setMinimumWidth (wid);189 txVDIBest->setMinimumWidth (wid);190 txSummaryHdr->setMinimumWidth (wid);191 txSummaryFtr->setMinimumWidth (wid);192 258 } 193 259
Note:
See TracChangeset
for help on using the changeset viewer.