Changeset 6537 in vbox for trunk/src/VBox
- Timestamp:
- Jan 28, 2008 7:49:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h
r6384 r6537 58 58 VBoxRichListItem (FormatType aFormat, QListViewItem *aParent, 59 59 const QString& aName, const QString& aPath, 60 const QString& aEdited ) :61 QListViewItem (aParent, aName, aPath, aEdited ), mFormat (aFormat)62 { 63 mTextList << aName << aPath << aEdited ;60 const QString& aEdited, const QString& aWritable) : 61 QListViewItem (aParent, aName, aPath, aEdited, aWritable), mFormat (aFormat) 62 { 63 mTextList << aName << aPath << aEdited << aWritable; 64 64 } 65 65 … … 181 181 const SFoldersNameList &aUsedNames) 182 182 : QDialog (aParent, "VBoxAddSFDialog", true /* modal */) 183 , mLePath (0), mLeName (0), mCbPermanent (0) 183 , mLePath (0), mLeName (0), mCbPermanent (0), mCbWritable (0) 184 184 , mUsedNames (aUsedNames) 185 185 { … … 223 223 inputLayout->addMultiCellWidget (mLeName, 1, 1, 1, 2); 224 224 225 QHBoxLayout *cbLayout = new QHBoxLayout (0, "cbLayout"); 226 inputLayout->addMultiCellLayout (cbLayout, 2, 2, 0, 2); 227 mCbWritable = new QCheckBox (tr ("&Writable"), this); 228 mCbWritable->setChecked (true); 229 cbLayout->addWidget (mCbWritable); 225 230 if (aEnableSelector) 226 231 { 227 232 mCbPermanent = new QCheckBox ( tr ("&Make Permanent"), this); 228 233 mCbPermanent->setChecked (true); 229 inputLayout->addMultiCellWidget (mCbPermanent, 2, 2, 0, 2);234 cbLayout->addWidget (mCbPermanent); 230 235 connect (mCbPermanent, SIGNAL (toggled (bool)), 231 236 this, SLOT (validate())); … … 256 261 return mCbPermanent ? mCbPermanent->isChecked() : true; 257 262 } 263 bool getWritable() { return mCbWritable->isChecked(); } 258 264 259 265 void setPath (const QString &aPath) { mLePath->setText (aPath); } … … 267 273 } 268 274 } 275 void setWritable (bool aWritable) { mCbWritable->setChecked (aWritable); } 269 276 270 277 private slots: … … 331 338 QLineEdit *mLeName; 332 339 QCheckBox *mCbPermanent; 340 QCheckBox *mCbWritable; 333 341 SFoldersNameList mUsedNames; 334 342 }; … … 483 491 CSharedFolder sf = aEn.GetNext(); 484 492 new VBoxRichListItem (VBoxRichListItem::EllipsisFile, aRoot, 485 sf.GetName(), sf.GetHostPath(), "not edited"); 493 sf.GetName(), sf.GetHostPath(), "not edited", 494 sf.GetWritable() ? "writable" : "readonly"); 486 495 } 487 496 listView->setOpen (aRoot, true); … … 574 583 if (item && !item->getText (0).isNull() && !item->getText (1).isNull() 575 584 && item->getText (2) == "edited") 576 createSharedFolder (item->getText (0), item->getText (1), true, type); 585 createSharedFolder (item->getText (0), item->getText (1), 586 item->getText (3) == "writable" ? true : false, type); 577 587 iterator = iterator->nextSibling(); 578 588 } … … 621 631 /* Appending a new listview item to the root */ 622 632 VBoxRichListItem *item = new VBoxRichListItem ( 623 VBoxRichListItem::EllipsisFile, root, name, path, "edited"); 633 VBoxRichListItem::EllipsisFile, root, name, path, "edited", 634 dlg.getWritable() ? "writable" : "readonly"); 624 635 /* Make the created item selected */ 625 636 listView->ensureItemVisible (item); … … 662 673 dlg.setPermanent ((SFDialogType)item->parent()->text (2).toInt() 663 674 != ConsoleType); 675 dlg.setWritable (item->getText (3) == "writable"); 664 676 if (dlg.exec() != QDialog::Accepted) 665 677 return; … … 673 685 Assert (root); 674 686 /* Updating an edited listview item */ 687 item->updateText (3, dlg.getWritable() ? "writable" : "readonly"); 675 688 item->updateText (2, "edited"); 676 689 item->updateText (1, path); … … 707 720 Assert (item); 708 721 QString tip = tr ("<nobr>Name: %1</nobr><br>" 709 "<nobr>Path: %2</nobr>") 710 .arg (item->getText (0)).arg (item->getText (1)); 722 "<nobr>Path: %2</nobr><br>" 723 "<nobr>Access: %3</nobr>") 724 .arg (item->getText (0)).arg (item->getText (1)).arg (item->getText (3)); 711 725 if (!item->getText (0).isNull() && !item->getText (1).isNull()) 712 726 QToolTip::add (listView->viewport(), listView->itemRect (aItem), tip);
Note:
See TracChangeset
for help on using the changeset viewer.