VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h@ 3802

Last change on this file since 3802 was 3802, checked in by vboxsync, 17 years ago

2130: Improve Shared Folders UI:

Shared Folders Dialog improvements done:

  1. Dialog made modal (all the title buttons made like in non-modal VDM).
  2. [Help]....[Ok][Cancel] dialog's button configuration.
  3. Permanent shared folder could be created during VM session runtime (through the discussed check-box).
  4. Edit action opens on list-view's item double-click.

Note: Also all the GUI_ constants from the different *.cpp files moved into VBoxDefs.cpp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.1 KB
Line 
1/**
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * "Shared Folders" settings dialog UI include (Qt Designer)
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23/****************************************************************************
24** ui.h extension file, included from the uic-generated form implementation.
25**
26** If you want to add, delete, or rename functions or slots, use
27** Qt Designer to update this file, preserving your code.
28**
29** You should not define a constructor or destructor in this file.
30** Instead, write your code in functions called init() and destroy().
31** These will automatically be called by the form's constructor and
32** destructor.
33*****************************************************************************/
34
35
36class VBoxRichListItem : public QListViewItem
37{
38public:
39
40 enum { QIRichListItemId = 1010 };
41
42 enum FormatType
43 {
44 IncorrectFormat = 0,
45 EllipsisStart = 1,
46 EllipsisMiddle = 2,
47 EllipsisEnd = 3,
48 EllipsisFile = 4
49 };
50
51 VBoxRichListItem (FormatType aFormat, QListView *aParent,
52 const QString& aName, const QString& aNull,
53 const QString& aKey) :
54 QListViewItem (aParent, aName, aNull, aKey), mFormat (aFormat)
55 {
56 }
57
58 VBoxRichListItem (FormatType aFormat, QListViewItem *aParent,
59 const QString& aName, const QString& aPath) :
60 QListViewItem (aParent, aName, aPath), mFormat (aFormat)
61 {
62 mTextList << aName << aPath;
63 }
64
65 int rtti() const { return QIRichListItemId; }
66
67 QString getText (int aIndex)
68 {
69 return aIndex >= 0 && aIndex < (int)mTextList.size() ?
70 mTextList [aIndex] : QString::null;
71 }
72
73 void updateText (int aColumn, const QString &aText)
74 {
75 if (aColumn >= 0 && aColumn < (int)mTextList.size())
76 mTextList [aColumn] = aText;
77 }
78
79protected:
80
81 void paintCell (QPainter *aPainter, const QColorGroup &aColorGroup,
82 int aColumn, int aWidth, int aAlign)
83 {
84 processColumn (aColumn, aWidth);
85 QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
86 }
87
88 void processColumn (int aColumn, int aWidth)
89 {
90 QString oneString = aColumn >= 0 && aColumn < (int)mTextList.size() ?
91 mTextList [aColumn] : QString::null;
92 if (oneString.isNull())
93 return;
94 int oldSize = listView()->fontMetrics().width (oneString);
95 int indentSize = listView()->fontMetrics().width ("...x");
96
97 /* compress text */
98 int start = 0;
99 int finish = 0;
100 int position = 0;
101 int textWidth = 0;
102 do {
103 textWidth = listView()->fontMetrics().width (oneString);
104 if (textWidth + indentSize > aWidth)
105 {
106 start = 0;
107 finish = oneString.length();
108
109 /* selecting remove position */
110 switch (mFormat)
111 {
112 case EllipsisStart:
113 position = start;
114 break;
115 case EllipsisMiddle:
116 position = (finish - start) / 2;
117 break;
118 case EllipsisEnd:
119 position = finish - 1;
120 break;
121 case EllipsisFile:
122 {
123 QRegExp regExp ("([\\\\/][^\\\\^/]+[\\\\/]?$)");
124 int newFinish = regExp.search (oneString);
125 if (newFinish != -1)
126 finish = newFinish;
127 position = (finish - start) / 2;
128 break;
129 }
130 default:
131 AssertMsgFailed (("Invalid format type\n"));
132 }
133
134 if (position == finish)
135 break;
136 oneString.remove (position, 1);
137 }
138 } while (textWidth + indentSize > aWidth);
139 if (position || mFormat == EllipsisFile) oneString.insert (position, "...");
140
141 int newSize = listView()->fontMetrics().width (oneString);
142 setText (aColumn, newSize < oldSize ? oneString : mTextList [aColumn]);
143 }
144
145 FormatType mFormat;
146 QStringList mTextList;
147};
148
149
150class VBoxAddSFDialog : public QDialog
151{
152 Q_OBJECT
153
154public:
155
156 enum DialogType { AddDialogType, EditDialogType };
157
158 VBoxAddSFDialog (QWidget *aParent, VBoxAddSFDialog::DialogType aType,
159 bool aEnableSelector /* for "permanent" checkbox */) :
160 QDialog (aParent, "VBoxAddSFDialog", true /* modal */),
161 mLePath (0), mLeName (0), mCbPermanent (0)
162 {
163 switch (aType)
164 {
165 case AddDialogType:
166 setCaption (tr ("Add Share"));
167 break;
168 case EditDialogType:
169 setCaption (tr ("Edit Share"));
170 break;
171 default:
172 AssertMsgFailed (("Incorrect SF Dialog type\n"));
173 }
174 QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout");
175
176 /* Setup Input layout */
177 QGridLayout *inputLayout = new QGridLayout (mainLayout, 3, 3, 10, "inputLayout");
178 QLabel *lbPath = new QLabel (tr ("Folder Path"), this);
179 mLePath = new QLineEdit (this);
180 QToolButton *tbPath = new QToolButton (this);
181 QLabel *lbName = new QLabel (tr ("Folder Name"), this);
182 mLeName = new QLineEdit (this);
183 tbPath->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",
184 "select_file_dis_16px.png"));
185 tbPath->setFocusPolicy (QWidget::TabFocus);
186 connect (mLePath, SIGNAL (textChanged (const QString &)),
187 this, SLOT (validate()));
188 connect (mLeName, SIGNAL (textChanged (const QString &)),
189 this, SLOT (validate()));
190 connect (tbPath, SIGNAL (clicked()), this, SLOT (showFileDialog()));
191 QWhatsThis::add (mLePath, tr ("Displays the path to an existing folder on the host PC."));
192 QWhatsThis::add (mLeName, tr ("Displays the name of the shared folder "
193 "(as it will be seen by the guest OS)."));
194 QWhatsThis::add (tbPath, tr ("Opens the dialog to select a folder."));
195
196 inputLayout->addWidget (lbPath, 0, 0);
197 inputLayout->addWidget (mLePath, 0, 1);
198 inputLayout->addWidget (tbPath, 0, 2);
199 inputLayout->addWidget (lbName, 1, 0);
200 inputLayout->addMultiCellWidget (mLeName, 1, 1, 1, 2);
201
202 if (aEnableSelector)
203 {
204 mCbPermanent = new QCheckBox ("&Make Permanent", this);
205 mCbPermanent->setChecked (true);
206 inputLayout->addMultiCellWidget (mCbPermanent, 2, 2, 0, 2);
207 }
208
209 /* Setup Button layout */
210 QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10, "buttonLayout");
211 mBtOk = new QPushButton (tr ("OK"), this, "btOk");
212 QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
213 QPushButton *btCancel = new QPushButton (tr ("Cancel"), this, "btCancel");
214 connect (mBtOk, SIGNAL (clicked()), this, SLOT (accept()));
215 connect (btCancel, SIGNAL (clicked()), this, SLOT (reject()));
216
217 buttonLayout->addWidget (mBtOk);
218 buttonLayout->addItem (spacer);
219 buttonLayout->addWidget (btCancel);
220
221 /* Validate fields */
222 validate();
223 }
224
225 ~VBoxAddSFDialog() {}
226
227 QString getPath() { return mLePath->text(); }
228 QString getName() { return mLeName->text(); }
229 bool getPermanent()
230 {
231 return mCbPermanent ? mCbPermanent->isChecked() : true;
232 }
233
234 void setPath (const QString &aPath) { mLePath->setText (aPath); }
235 void setName (const QString &aName) { mLeName->setText (aName); }
236 void setPermanent (bool aPermanent)
237 {
238 if (mCbPermanent)
239 {
240 mCbPermanent->setChecked (aPermanent);
241 mCbPermanent->setEnabled (!aPermanent);
242 }
243 }
244
245private slots:
246
247 void validate()
248 {
249 mBtOk->setEnabled (!mLePath->text().isEmpty() && !mLeName->text().isEmpty());
250 }
251
252 void showFileDialog()
253 {
254 QString folder = vboxGlobal().getExistingDirectory (QDir::rootDirPath(),
255 this, "addSharedFolderDialog",
256 tr ("Select a folder to share"));
257 if (folder.isNull())
258 return;
259
260 QString folderName = QDir::convertSeparators (folder);
261 QRegExp commonRule ("[\\\\/]([^\\\\^/]+)[\\\\/]?$");
262 QRegExp rootRule ("(([a-zA-Z])[^\\\\^/])?[\\\\/]$");
263 if (commonRule.search (folderName) != -1)
264 {
265 /* processing non-root folder */
266 mLePath->setText (folderName.remove (QRegExp ("[\\\\/]$")));
267 mLeName->setText (commonRule.cap (1));
268 }
269 else if (rootRule.search (folderName) != -1)
270 {
271 /* processing root folder */
272 mLePath->setText (folderName);
273#if defined(Q_WS_WIN32)
274 mLeName->setText (rootRule.cap (2) + "_DRIVE");
275#elif defined(Q_WS_X11)
276 mLeName->setText ("ROOT");
277#endif
278 }
279 else
280 return; /* hm, what type of folder it was? */
281 }
282
283private:
284
285 void showEvent (QShowEvent *aEvent)
286 {
287 setFixedHeight (height());
288 QDialog::showEvent (aEvent);
289 }
290
291 QPushButton *mBtOk;
292 QLineEdit *mLePath;
293 QLineEdit *mLeName;
294 QCheckBox *mCbPermanent;
295};
296
297
298void VBoxSharedFoldersSettings::init()
299{
300 mDialogType = WrongType;
301 new QIListViewSelectionPreserver (this, listView);
302 listView->setShowToolTips (false);
303 listView->setRootIsDecorated (true);
304 tbAdd->setIconSet (VBoxGlobal::iconSet ("add_shared_folder_16px.png",
305 "add_shared_folder_disabled_16px.png"));
306 tbEdit->setIconSet (VBoxGlobal::iconSet ("edit_shared_folder_16px.png",
307 "edit_shared_folder_disabled_16px.png"));
308 tbRemove->setIconSet (VBoxGlobal::iconSet ("revome_shared_folder_16px.png",
309 "revome_shared_folder_disabled_16px.png"));
310 QToolTip::add (tbAdd, tr ("Add a new shared folder"));
311 QToolTip::add (tbEdit, tr ("Edit the selected shared folder"));
312 QToolTip::add (tbRemove, tr ("Remove the selected shared folder"));
313 connect (tbAdd, SIGNAL (clicked()), this, SLOT (tbAddPressed()));
314 connect (tbEdit, SIGNAL (clicked()), this, SLOT (tbEditPressed()));
315 connect (tbRemove, SIGNAL (clicked()), this, SLOT (tbRemovePressed()));
316 connect (listView, SIGNAL (currentChanged (QListViewItem *)),
317 this, SLOT (processCurrentChanged (QListViewItem *)));
318 connect (listView, SIGNAL (onItem (QListViewItem *)),
319 this, SLOT (processOnItem (QListViewItem *)));
320
321 mIsListViewChanged = false;
322}
323
324void VBoxSharedFoldersSettings::setDialogType (int aType)
325{
326 mDialogType = aType;
327}
328
329
330void VBoxSharedFoldersSettings::removeSharedFolder (const QString & aName,
331 const QString & aPath,
332 SFDialogType aType)
333{
334 switch (aType)
335 {
336 case GlobalType:
337 {
338 /* This feature is not implemented yet */
339 AssertMsgFailed (("Global shared folders are not implemented yet\n"));
340 break;
341 }
342 case MachineType:
343 {
344 Assert (!mMachine.isNull());
345 mMachine.RemoveSharedFolder (aName);
346 if (!mMachine.isOk())
347 vboxProblem().cannotRemoveSharedFolder (this, mMachine,
348 aName, aPath);
349 break;
350 }
351 case ConsoleType:
352 {
353 Assert (!mConsole.isNull());
354 mConsole.RemoveSharedFolder (aName);
355 if (!mConsole.isOk())
356 vboxProblem().cannotRemoveSharedFolder (this, mConsole,
357 aName, aPath);
358 break;
359 }
360 default:
361 {
362 AssertMsgFailed (("Incorrect shared folder type\n"));
363 }
364 }
365}
366
367void VBoxSharedFoldersSettings::createSharedFolder (const QString & aName,
368 const QString & aPath,
369 SFDialogType aType)
370{
371 switch (aType)
372 {
373 case GlobalType:
374 {
375 /* This feature is not implemented yet */
376 AssertMsgFailed (("Global shared folders are not implemented yet\n"));
377 break;
378 }
379 case MachineType:
380 {
381 Assert (!mMachine.isNull());
382 mMachine.CreateSharedFolder (aName, aPath);
383 if (!mMachine.isOk())
384 vboxProblem().cannotCreateSharedFolder (this, mMachine,
385 aName, aPath);
386 break;
387 }
388 case ConsoleType:
389 {
390 Assert (!mConsole.isNull());
391 mConsole.CreateSharedFolder (aName, aPath);
392 if (!mConsole.isOk())
393 vboxProblem().cannotCreateSharedFolder (this, mConsole,
394 aName, aPath);
395 break;
396 }
397 default:
398 {
399 AssertMsgFailed (("Incorrect shared folder type\n"));
400 }
401 }
402}
403
404
405void VBoxSharedFoldersSettings::getFromGlobal()
406{
407 /* This feature is not implemented yet */
408 AssertMsgFailed (("Global shared folders are not implemented yet\n"));
409
410 /*
411 QString name = tr (" Global Folders");
412 QString key (QString::number (GlobalType));
413 VBoxRichListItem *root = new VBoxRichListItem (VBoxRichListItem::EllipsisEnd,
414 listView, name, QString::null, key);
415 getFrom (vboxGlobal().virtualBox().GetSharedFolders().Enumerate(), root);
416 */
417}
418
419void VBoxSharedFoldersSettings::getFromMachine (const CMachine &aMachine)
420{
421 mMachine = aMachine;
422 QString name = tr (" Machine Folders");
423 QString key (QString::number (MachineType));
424 VBoxRichListItem *root = new VBoxRichListItem (VBoxRichListItem::EllipsisEnd,
425 listView, name, QString::null, key);
426 getFrom (mMachine.GetSharedFolders().Enumerate(), root);
427}
428
429void VBoxSharedFoldersSettings::getFromConsole (const CConsole &aConsole)
430{
431 mConsole = aConsole;
432 QString name = tr (" Transient Folders");
433 QString key (QString::number (ConsoleType));
434 VBoxRichListItem *root = new VBoxRichListItem (VBoxRichListItem::EllipsisEnd,
435 listView, name, QString::null, key);
436 getFrom (mConsole.GetSharedFolders().Enumerate(), root);
437}
438
439void VBoxSharedFoldersSettings::getFrom (const CSharedFolderEnumerator &aEn,
440 QListViewItem *aRoot)
441{
442 aRoot->setSelectable (false);
443 while (aEn.HasMore())
444 {
445 CSharedFolder sf = aEn.GetNext();
446 new VBoxRichListItem (VBoxRichListItem::EllipsisFile, aRoot,
447 sf.GetName(), sf.GetHostPath());
448 }
449 listView->setOpen (aRoot, true);
450 listView->setCurrentItem (aRoot);
451 processCurrentChanged (aRoot);
452}
453
454
455void VBoxSharedFoldersSettings::putBackToGlobal()
456{
457 /* This feature is not implemented yet */
458 AssertMsgFailed (("Global shared folders are not implemented yet\n"));
459
460 /*
461 if (!mIsListViewChanged) return;
462 // This function is only available for GlobalType dialog
463 Assert (mDialogType == GlobalType);
464 // Searching for GlobalType item's root
465 QListViewItem *root = listView->findItem (QString::number (GlobalType), 2);
466 Assert (root);
467 CSharedFolderEnumerator en = vboxGlobal().virtualBox().GetSharedFolders().Enumerate();
468 putBackTo (en, root);
469 */
470}
471
472void VBoxSharedFoldersSettings::putBackToMachine()
473{
474 if (!mIsListViewChanged)
475 return;
476
477 /* This function is only available for MachineType dialog */
478 Assert (mDialogType & MachineType);
479 /* Searching for MachineType item's root */
480 QListViewItem *root = listView->findItem (QString::number (MachineType), 2);
481 Assert (root);
482 CSharedFolderEnumerator en = mMachine.GetSharedFolders().Enumerate();
483 putBackTo (en, root);
484}
485
486void VBoxSharedFoldersSettings::putBackToConsole()
487{
488 if (!mIsListViewChanged)
489 return;
490
491 /* This function is only available for ConsoleType dialog */
492 Assert (mDialogType & ConsoleType);
493 /* Searching for ConsoleType item's root */
494 QListViewItem *root = listView->findItem (QString::number (ConsoleType), 2);
495 Assert (root);
496 CSharedFolderEnumerator en = mConsole.GetSharedFolders().Enumerate();
497 putBackTo (en, root);
498}
499
500void VBoxSharedFoldersSettings::putBackTo (CSharedFolderEnumerator &aEn,
501 QListViewItem *aRoot)
502{
503 Assert (!aRoot->text (2).isNull());
504 SFDialogType type = (SFDialogType)aRoot->text (2).toInt();
505
506 /* deleting all existing folders if the list */
507 while (aEn.HasMore())
508 {
509 CSharedFolder sf = aEn.GetNext();
510 removeSharedFolder (sf.GetName(), sf.GetHostPath(), type);
511 }
512
513 /* saving all machine related list view items */
514 QListViewItem *iterator = aRoot->firstChild();
515 while (iterator)
516 {
517 VBoxRichListItem *item = 0;
518 if (iterator->rtti() == VBoxRichListItem::QIRichListItemId)
519 item = static_cast<VBoxRichListItem*> (iterator);
520 if (item && !item->getText (0).isNull() && !item->getText (1).isNull())
521 createSharedFolder (item->getText (0), item->getText (1), type);
522 else
523 AssertMsgFailed (("Incorrect listview item type\n"));
524 iterator = iterator->nextSibling();
525 }
526}
527
528
529QListViewItem* VBoxSharedFoldersSettings::searchRoot (bool aIsPermanent)
530{
531 if (!aIsPermanent)
532 return listView->findItem (QString::number (ConsoleType), 2);
533 else if (mDialogType & MachineType)
534 return listView->findItem (QString::number (MachineType), 2);
535 else
536 return listView->findItem (QString::number (GlobalType), 2);
537}
538
539void VBoxSharedFoldersSettings::tbAddPressed()
540{
541 /* Invoke Add-Box Dialog */
542 VBoxAddSFDialog dlg (this, VBoxAddSFDialog::AddDialogType,
543 mDialogType & ConsoleType);
544 if (dlg.exec() != QDialog::Accepted)
545 return;
546 QString name = dlg.getName();
547 QString path = dlg.getPath();
548 bool isPermanent = dlg.getPermanent();
549 /* Shared folder's name & path could not be empty */
550 Assert (!name.isEmpty() && !path.isEmpty());
551 /* Searching root for the new listview item */
552 QListViewItem *root = searchRoot (isPermanent);
553 Assert (root);
554 /* Appending a new listview item to the root */
555 VBoxRichListItem *item = new VBoxRichListItem (
556 VBoxRichListItem::EllipsisFile, root, name, path);
557 /* Make the created item selected */
558 listView->ensureItemVisible (item);
559 listView->setCurrentItem (item);
560 processCurrentChanged (item);
561 listView->setFocus();
562
563 mIsListViewChanged = true;
564}
565
566void VBoxSharedFoldersSettings::tbEditPressed()
567{
568 /* Check selected item */
569 QListViewItem *selectedItem = listView->selectedItem();
570 VBoxRichListItem *item =
571 selectedItem->rtti() == VBoxRichListItem::QIRichListItemId ?
572 static_cast<VBoxRichListItem*> (selectedItem) : 0;
573 Assert (item);
574 Assert (item->parent());
575 /* Invoke Edit-Box Dialog */
576 VBoxAddSFDialog dlg (this, VBoxAddSFDialog::EditDialogType,
577 mDialogType & ConsoleType);
578 dlg.setPath (item->getText (1));
579 dlg.setName (item->getText (0));
580 dlg.setPermanent ((SFDialogType)item->parent()->text (2).toInt()
581 != ConsoleType);
582 if (dlg.exec() != QDialog::Accepted)
583 return;
584 QString name = dlg.getName();
585 QString path = dlg.getPath();
586 bool isPermanent = dlg.getPermanent();
587 /* Shared folder's name & path could not be empty */
588 Assert (!name.isEmpty() && !path.isEmpty());
589 /* Searching new root for the selected listview item */
590 QListViewItem *root = searchRoot (isPermanent);
591 Assert (root);
592 /* Updating an edited listview item */
593 item->updateText (1, path);
594 item->updateText (0, name);
595 if (item->parent() != root)
596 {
597 /* Move the selected item into new location */
598 item->parent()->takeItem (item);
599 root->insertItem (item);
600
601 /* Make the created item selected */
602 listView->ensureItemVisible (item);
603 listView->setCurrentItem (item);
604 processCurrentChanged (item);
605 listView->setFocus();
606 }
607
608 mIsListViewChanged = true;
609}
610
611void VBoxSharedFoldersSettings::tbRemovePressed()
612{
613 Assert (listView->selectedItem());
614 delete listView->selectedItem();
615 mIsListViewChanged = true;
616}
617
618
619void VBoxSharedFoldersSettings::processOnItem (QListViewItem *aItem)
620{
621 VBoxRichListItem *item = 0;
622 if (aItem->rtti() == VBoxRichListItem::QIRichListItemId)
623 item = static_cast<VBoxRichListItem*> (aItem);
624 Assert (item);
625 QString tip = tr ("<nobr>Name:&nbsp;&nbsp;%1</nobr><br>"
626 "<nobr>Path:&nbsp;&nbsp;%2</nobr>")
627 .arg (item->getText (0)).arg (item->getText (1));
628 if (!item->getText (0).isNull() && !item->getText (1).isNull())
629 QToolTip::add (listView->viewport(), listView->itemRect (aItem), tip);
630 else
631 QToolTip::remove (listView->viewport());
632}
633
634void VBoxSharedFoldersSettings::processCurrentChanged (QListViewItem *aItem)
635{
636 if (aItem && aItem->isSelectable() && listView->selectedItem() != aItem)
637 listView->setSelected (aItem, true);
638 bool addEnabled = aItem &&
639 (isEditable (aItem->text (2)) ||
640 aItem->parent() && isEditable (aItem->parent()->text (2)));
641 bool removeEnabled = aItem && aItem->parent() &&
642 isEditable (aItem->parent()->text (2));
643 tbAdd->setEnabled (addEnabled);
644 tbEdit->setEnabled (removeEnabled);
645 tbRemove->setEnabled (removeEnabled);
646}
647
648void VBoxSharedFoldersSettings::processDoubleClick (QListViewItem *aItem)
649{
650 bool editEnabled = aItem && aItem->parent() &&
651 isEditable (aItem->parent()->text (2));
652 if (editEnabled)
653 tbEditPressed();
654}
655
656bool VBoxSharedFoldersSettings::isEditable (const QString &aKey)
657{
658 /* mDialogType should be sutup already */
659 Assert (mDialogType);
660 /* simple item has no key information */
661 if (aKey.isEmpty())
662 return false;
663 SFDialogType type = (SFDialogType)aKey.toInt();
664 if (!type)
665 AssertMsgFailed (("Incorrect listview item key value\n"));
666 return mDialogType & type;
667}
668
669
670#include "VBoxSharedFoldersSettings.ui.moc"
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette