Changeset 85486 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 28, 2020 11:34:21 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.cpp
r85458 r85486 41 41 , m_pLabelApplicationPath(0) 42 42 , m_pEditorApplicationPath(0) 43 , m_pLabelApplicationArgument(0) 44 , m_pEditorApplicationArgument(0) 43 45 , m_pLabelProfileName(0) 44 46 , m_pEditorProfileName(0) … … 95 97 m_pEditorApplicationName->setText(QString()); 96 98 m_pEditorApplicationPath->setText(QString()); 99 m_pEditorApplicationArgument->setText(QString()); 97 100 m_pEditorProfileName->setText(QString()); 98 101 m_pEditorProfileArgument->setText(QString()); … … 110 113 m_pLabelApplicationName->setText(tr("Name:")); 111 114 m_pLabelApplicationPath->setText(tr("Path:")); 115 m_pLabelApplicationArgument->setText(tr("Argument:")); 112 116 m_pLabelProfileName->setText(tr("Name:")); 113 117 m_pLabelProfileArgument->setText(tr("Argument:")); … … 127 131 m_pEditorApplicationName->setPlaceholderText(tr("Enter a name for this console application...")); 128 132 m_pEditorApplicationPath->setPlaceholderText(tr("Enter a path for this console application...")); 133 m_pEditorApplicationArgument->setPlaceholderText(tr("Enter an argument for this console application...")); 129 134 m_pEditorProfileName->setPlaceholderText(tr("Enter a name for this console profile...")); 130 135 m_pEditorProfileArgument->setPlaceholderText(tr("Enter an argument for this console profile...")); … … 170 175 /* Revalidate: */ 171 176 revalidate(m_pEditorApplicationPath); 177 /* Update button states: */ 178 updateButtonStates(); 179 } 180 181 void UICloudConsoleDetailsWidget::sltApplicationArgumentChanged(const QString &strArgument) 182 { 183 /* Push changes back: */ 184 m_newApplicationData.m_strArgument = strArgument; 185 186 /* Revalidate: */ 187 revalidate(m_pEditorApplicationArgument); 172 188 /* Update button states: */ 173 189 updateButtonStates(); … … 249 265 { 250 266 pLayoutApplication->setContentsMargins(0, 0, 0, 0); 251 pLayoutApplication->setRowStretch( 2, 1);267 pLayoutApplication->setRowStretch(3, 1); 252 268 253 269 if (m_enmEmbedding == EmbedTo_Dialog) … … 315 331 pLayoutApplication->addWidget(m_pLabelApplicationPath, 1, 0); 316 332 } 333 334 /* Create argument editor: */ 335 m_pEditorApplicationArgument = new QLineEdit(pWidgetApplication); 336 if (m_pEditorApplicationArgument) 337 { 338 connect(m_pEditorApplicationArgument, &QLineEdit::textChanged, 339 this, &UICloudConsoleDetailsWidget::sltApplicationArgumentChanged); 340 341 /* Add into layout: */ 342 pLayoutApplication->addWidget(m_pEditorApplicationArgument, 2, 1); 343 } 344 /* Create argument label: */ 345 m_pLabelApplicationArgument = new QLabel(pWidgetApplication); 346 if (m_pLabelApplicationArgument) 347 { 348 m_pLabelApplicationArgument->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 349 m_pLabelApplicationArgument->setBuddy(m_pEditorApplicationArgument); 350 351 /* Add into layout: */ 352 pLayoutApplication->addWidget(m_pLabelApplicationArgument, 2, 0); 353 } 317 354 } 318 355 … … 427 464 m_pEditorApplicationName->setText(m_oldApplicationData.m_strName); 428 465 m_pEditorApplicationPath->setText(m_oldApplicationData.m_strPath); 466 m_pEditorApplicationArgument->setText(m_oldApplicationData.m_strArgument); 429 467 } 430 468 /* If profile pane is selected: */ -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.h
r85389 r85486 53 53 && (m_strName == other.m_strName) 54 54 && (m_strPath == other.m_strPath) 55 && (m_strArgument == other.m_strArgument) 55 56 && (m_fRestricted == other.m_fRestricted) 56 57 ; … … 68 69 /** Holds the console application path. */ 69 70 QString m_strPath; 71 /** Holds the console application argument. */ 72 QString m_strArgument; 70 73 /** Holds whether console application is restricted. */ 71 74 bool m_fRestricted; … … 159 162 /** Handles console application path change. */ 160 163 void sltApplicationPathChanged(const QString &strPath); 164 /** Handles console application argument change. */ 165 void sltApplicationArgumentChanged(const QString &strArgument); 161 166 /** Handles console profile name change. */ 162 167 void sltProfileNameChanged(const QString &strName); … … 225 230 /** Holds the application path editor instance. */ 226 231 QLineEdit *m_pEditorApplicationPath; 232 /** Holds the application argument label instance. */ 233 QLabel *m_pLabelApplicationArgument; 234 /** Holds the application argument editor instance. */ 235 QLineEdit *m_pEditorApplicationArgument; 227 236 228 237 /** Holds the profile name label instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.cpp
r85443 r85486 84 84 /** Returns item path. */ 85 85 QString path() const { return m_strPath; } 86 /** Returns item argument. */ 87 QString argument() const { return m_strArgument; } 86 88 }; 87 89 … … 123 125 /** Returns application path. */ 124 126 QString path() const; 127 /** Returns application argument. */ 128 QString argument() const; 125 129 126 130 protected: … … 142 146 /** Holds the path editor instance. */ 143 147 QLineEdit *m_pEditorPath; 148 /** Holds the argument label instance. */ 149 QLabel *m_pLabelArgument; 150 /** Holds the argument editor instance. */ 151 QLineEdit *m_pEditorArgument; 144 152 145 153 /** Holds the button-box instance. */ … … 240 248 , m_pLabelPath(0) 241 249 , m_pEditorPath(0) 250 , m_pLabelArgument(0) 251 , m_pEditorArgument(0) 242 252 , m_pButtonBox(0) 243 253 { … … 253 263 { 254 264 return m_pEditorPath->text(); 265 } 266 267 QString UIInputDialogCloudConsoleApplication::argument() const 268 { 269 return m_pEditorArgument->text(); 255 270 } 256 271 … … 260 275 m_pLabelName->setText(tr("Name:")); 261 276 m_pLabelPath->setText(tr("Path:")); 277 m_pLabelArgument->setText(tr("Argument:")); 262 278 } 263 279 … … 271 287 if (pMainLayout) 272 288 { 273 pMainLayout->setRowStretch(0, 0); 274 pMainLayout->setRowStretch(1, 0); 275 pMainLayout->setRowStretch(2, 1); 276 pMainLayout->setRowStretch(3, 0); 289 pMainLayout->setRowStretch(3, 1); 277 290 278 291 /* Prepare name editor: */ … … 306 319 } 307 320 321 /* Prepare argument editor: */ 322 m_pEditorArgument = new QLineEdit(this); 323 if (m_pEditorArgument) 324 { 325 pMainLayout->addWidget(m_pEditorArgument, 2, 1); 326 } 327 /* Prepare argument editor label: */ 328 m_pLabelArgument = new QLabel(this); 329 if (m_pLabelArgument) 330 { 331 m_pLabelArgument->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 332 m_pLabelArgument->setBuddy(m_pEditorArgument); 333 pMainLayout->addWidget(m_pLabelArgument, 2, 0); 334 } 335 308 336 /* Prepare button-box: */ 309 337 m_pButtonBox = new QIDialogButtonBox(this); … … 313 341 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIInputDialogCloudConsoleApplication::reject); 314 342 connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIInputDialogCloudConsoleApplication::accept); 315 pMainLayout->addWidget(m_pButtonBox, 3, 0, 1, 2);343 pMainLayout->addWidget(m_pButtonBox, 4, 0, 1, 2); 316 344 } 317 345 } … … 486 514 if (newData != oldData) 487 515 gEDataManager->setCloudConsoleManagerApplication(newData.m_strId, 488 QString("%1,%2").arg(newData.m_strName, newData.m_strPath)); 516 QString("%1,%2,%3").arg(newData.m_strName, 517 newData.m_strPath, 518 newData.m_strArgument)); 489 519 break; 490 520 } … … 514 544 QString strApplicationName; 515 545 QString strApplicationPath; 546 QString strApplicationArgument; 516 547 bool fCancelled = true; 517 548 QPointer<UIInputDialogCloudConsoleApplication> pDialog = new UIInputDialogCloudConsoleApplication(this); … … 523 554 strApplicationName = pDialog->name(); 524 555 strApplicationPath = pDialog->path(); 556 strApplicationArgument = pDialog->argument(); 525 557 fCancelled = false; 526 558 } … … 533 565 m_strDefinition = QString("/%1").arg(strId); 534 566 /* Compose extra-data superset: */ 535 const QString strValue = QString("%1,%2 ").arg(strApplicationName, strApplicationPath);567 const QString strValue = QString("%1,%2,%3").arg(strApplicationName, strApplicationPath, strApplicationArgument); 536 568 537 569 /* Save new console application to extra-data: */ … … 981 1013 applicationData.m_strName = values.value(1); 982 1014 applicationData.m_strPath = values.value(2); 1015 applicationData.m_strArgument = values.value(3); 983 1016 } 984 1017 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85467 r85486 2812 2812 this, &UIVirtualBoxManager::sltExecuteExternalApplication); 2813 2813 pAction->setProperty("path", applicationValues.value(1)); 2814 pAction->setProperty("arguments", applicationValues.value(2)); 2814 2815 } 2815 2816 }
Note:
See TracChangeset
for help on using the changeset viewer.