Changeset 968 in vbox
- Timestamp:
- Feb 18, 2007 11:43:54 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18738
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h ¶
r945 r968 188 188 void cannotRemoveSharedFolder (QWidget *, const CMachine &, 189 189 const QString &, const QString &); 190 void cannotCreateSharedFolder (QWidget *, const CConsole &, 191 const QString &, const QString &); 192 void cannotRemoveSharedFolder (QWidget *, const CConsole &, 193 const QString &, const QString &); 190 194 191 195 bool confirmReleaseImage (QWidget*, QString); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp ¶
r952 r968 1153 1153 message (aParent, Error, 1154 1154 tr ("Failed to create a shared folder <b>%1</b> " 1155 "(pointing to <nobr><b>%2</b></nobr>) "1155 "(pointing to <nobr><b>%2</b></nobr>) " 1156 1156 "for the virtual machine <b>%3</b>.") 1157 1157 .arg (aName) … … 1171 1171 message (aParent, Error, 1172 1172 tr ("Failed to remove the shared folder <b>%1</b> " 1173 "(pointing to <nobr><b>%2</b></nobr>) "1173 "(pointing to <nobr><b>%2</b></nobr>) " 1174 1174 "from the virtual machine <b>%3</b>.") 1175 1175 .arg (aName) 1176 1176 .arg (aPath) 1177 1177 .arg (aMachine.GetName()), 1178 formatErrorInfo (errInfo)); 1179 } 1180 1181 void VBoxProblemReporter::cannotCreateSharedFolder (QWidget *aParent, 1182 const CConsole &aConsole, 1183 const QString &aName, 1184 const QString &aPath) 1185 { 1186 /* preserve the current error info before calling the object again */ 1187 COMErrorInfo errInfo = aConsole.errorInfo(); 1188 1189 message (aParent, Error, 1190 tr ("Failed to create a shared folder <b>%1</b> " 1191 "(pointing to <nobr><b>%2</b></nobr>) " 1192 "for the virtual machine <b>%3</b>.") 1193 .arg (aName) 1194 .arg (aPath) 1195 .arg (aConsole.GetMachine().GetName()), 1196 formatErrorInfo (errInfo)); 1197 } 1198 1199 void VBoxProblemReporter::cannotRemoveSharedFolder (QWidget *aParent, 1200 const CConsole &aConsole, 1201 const QString &aName, 1202 const QString &aPath) 1203 { 1204 /* preserve the current error info before calling the object again */ 1205 COMErrorInfo errInfo = aConsole.errorInfo(); 1206 1207 message (aParent, Error, 1208 tr ("Failed to remove the shared folder <b>%1</b> " 1209 "(pointing to <nobr><b>%2</b></nobr>) " 1210 "from the virtual machine <b>%3</b>.") 1211 .arg (aName) 1212 .arg (aPath) 1213 .arg (aConsole.GetMachine().GetName()), 1178 1214 formatErrorInfo (errInfo)); 1179 1215 } -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h ¶
r952 r968 65 65 int rtti() const { return QIRichListItemId; } 66 66 67 const QString& getText (int aIndex) { return mTextList [aIndex]; } 67 QString getText (int aIndex) 68 { 69 return aIndex >= 0 && aIndex < (int)mTextList.size() ? 70 mTextList [aIndex] : QString::null; 71 } 68 72 69 73 protected: … … 78 82 void processColumn (int aColumn, int aWidth) 79 83 { 80 QString oneString = mTextList [aColumn]; 81 if (oneString.isEmpty()) 84 QString oneString = aColumn >= 0 && aColumn < (int)mTextList.size() ? 85 mTextList [aColumn] : QString::null; 86 if (oneString.isNull()) 82 87 return; 83 88 int oldSize = listView()->fontMetrics().width (oneString); … … 147 152 mLePath (0), mLeName (0) 148 153 { 154 setCaption (tr ("Add Share")); 149 155 QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout"); 150 156 … … 207 213 QFileDialog dlg (QDir::rootDirPath(), QString::null, this); 208 214 dlg.setMode (QFileDialog::DirectoryOnly); 209 dlg.setCaption (tr ("Add Share"));210 215 if (dlg.exec() == QDialog::Accepted) 211 216 { … … 253 258 new QIListViewSelectionPreserver (this, listView); 254 259 listView->setShowToolTips (false); 260 listView->setRootIsDecorated (true); 255 261 tbAdd->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png", 256 262 "select_file_dis_16px.png")); … … 300 306 mConsole.RemoveSharedFolder (aName); 301 307 if (!mConsole.isOk()) 302 vboxProblem().cannotRemoveSharedFolder (this, mConsole .GetMachine(),308 vboxProblem().cannotRemoveSharedFolder (this, mConsole, 303 309 aName, aPath); 304 310 break; … … 337 343 mConsole.CreateSharedFolder (aName, aPath); 338 344 if (!mConsole.isOk()) 339 vboxProblem().cannotCreateSharedFolder (this, mConsole .GetMachine(),345 vboxProblem().cannotCreateSharedFolder (this, mConsole, 340 346 aName, aPath); 341 347 break; … … 447 453 QListViewItem *aRoot) 448 454 { 455 Assert (!aRoot->text (2).isNull()); 449 456 SFDialogType type = (SFDialogType)aRoot->text (2).toInt(); 450 Assert (type);451 457 452 458 /* deleting all existing folders if the list */ … … 464 470 if (iterator->rtti() == VBoxRichListItem::QIRichListItemId) 465 471 item = static_cast<VBoxRichListItem*> (iterator); 466 if (item )472 if (item && !item->getText (0).isNull() && !item->getText (1).isNull()) 467 473 createSharedFolder (item->getText (0), item->getText (1), type); 468 474 else … … 513 519 "<nobr>Path: %2</nobr>") 514 520 .arg (item->getText (0)).arg (item->getText (1)); 515 if (!item->getText (0).is Empty() && !item->getText (1).isEmpty())521 if (!item->getText (0).isNull() && !item->getText (1).isNull()) 516 522 QToolTip::add (listView->viewport(), listView->itemRect (aItem), tip); 517 523 else … … 521 527 void VBoxSharedFoldersSettings::processCurrentChanged (QListViewItem *aItem) 522 528 { 523 if (aItem && listView->selectedItem() != aItem)529 if (aItem && aItem->isSelectable() && listView->selectedItem() != aItem) 524 530 listView->setSelected (aItem, true); 525 531 bool removeEnabled = aItem && aItem->parent() &&
Note:
See TracChangeset
for help on using the changeset viewer.