VirtualBox

Changeset 85486 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 28, 2020 11:34:21 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9722: VirtualBox Manager: Allow terminal applications registered via Cloud Console Manager to have own argument without any profiles; Profiles will be overriding argument if created, s.a. r139521.

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  
    4141    , m_pLabelApplicationPath(0)
    4242    , m_pEditorApplicationPath(0)
     43    , m_pLabelApplicationArgument(0)
     44    , m_pEditorApplicationArgument(0)
    4345    , m_pLabelProfileName(0)
    4446    , m_pEditorProfileName(0)
     
    9597    m_pEditorApplicationName->setText(QString());
    9698    m_pEditorApplicationPath->setText(QString());
     99    m_pEditorApplicationArgument->setText(QString());
    97100    m_pEditorProfileName->setText(QString());
    98101    m_pEditorProfileArgument->setText(QString());
     
    110113    m_pLabelApplicationName->setText(tr("Name:"));
    111114    m_pLabelApplicationPath->setText(tr("Path:"));
     115    m_pLabelApplicationArgument->setText(tr("Argument:"));
    112116    m_pLabelProfileName->setText(tr("Name:"));
    113117    m_pLabelProfileArgument->setText(tr("Argument:"));
     
    127131    m_pEditorApplicationName->setPlaceholderText(tr("Enter a name for this console application..."));
    128132    m_pEditorApplicationPath->setPlaceholderText(tr("Enter a path for this console application..."));
     133    m_pEditorApplicationArgument->setPlaceholderText(tr("Enter an argument for this console application..."));
    129134    m_pEditorProfileName->setPlaceholderText(tr("Enter a name for this console profile..."));
    130135    m_pEditorProfileArgument->setPlaceholderText(tr("Enter an argument for this console profile..."));
     
    170175    /* Revalidate: */
    171176    revalidate(m_pEditorApplicationPath);
     177    /* Update button states: */
     178    updateButtonStates();
     179}
     180
     181void UICloudConsoleDetailsWidget::sltApplicationArgumentChanged(const QString &strArgument)
     182{
     183    /* Push changes back: */
     184    m_newApplicationData.m_strArgument = strArgument;
     185
     186    /* Revalidate: */
     187    revalidate(m_pEditorApplicationArgument);
    172188    /* Update button states: */
    173189    updateButtonStates();
     
    249265                {
    250266                    pLayoutApplication->setContentsMargins(0, 0, 0, 0);
    251                     pLayoutApplication->setRowStretch(2, 1);
     267                    pLayoutApplication->setRowStretch(3, 1);
    252268
    253269                    if (m_enmEmbedding == EmbedTo_Dialog)
     
    315331                        pLayoutApplication->addWidget(m_pLabelApplicationPath, 1, 0);
    316332                    }
     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                    }
    317354                }
    318355
     
    427464        m_pEditorApplicationName->setText(m_oldApplicationData.m_strName);
    428465        m_pEditorApplicationPath->setText(m_oldApplicationData.m_strPath);
     466        m_pEditorApplicationArgument->setText(m_oldApplicationData.m_strArgument);
    429467    }
    430468    /* If profile pane is selected: */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleDetailsWidget.h

    r85389 r85486  
    5353               && (m_strName == other.m_strName)
    5454               && (m_strPath == other.m_strPath)
     55               && (m_strArgument == other.m_strArgument)
    5556               && (m_fRestricted == other.m_fRestricted)
    5657               ;
     
    6869    /** Holds the console application path. */
    6970    QString  m_strPath;
     71    /** Holds the console application argument. */
     72    QString  m_strArgument;
    7073    /** Holds whether console application is restricted. */
    7174    bool     m_fRestricted;
     
    159162        /** Handles console application path change. */
    160163        void sltApplicationPathChanged(const QString &strPath);
     164        /** Handles console application argument change. */
     165        void sltApplicationArgumentChanged(const QString &strArgument);
    161166        /** Handles console profile name change. */
    162167        void sltProfileNameChanged(const QString &strName);
     
    225230        /** Holds the application path editor instance. */
    226231        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;
    227236
    228237        /** Holds the profile name label instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/cloud/consolemanager/UICloudConsoleManager.cpp

    r85443 r85486  
    8484    /** Returns item path. */
    8585    QString path() const { return m_strPath; }
     86    /** Returns item argument. */
     87    QString argument() const { return m_strArgument; }
    8688};
    8789
     
    123125    /** Returns application path. */
    124126    QString path() const;
     127    /** Returns application argument. */
     128    QString argument() const;
    125129
    126130protected:
     
    142146    /** Holds the path editor instance. */
    143147    QLineEdit *m_pEditorPath;
     148    /** Holds the argument label instance. */
     149    QLabel    *m_pLabelArgument;
     150    /** Holds the argument editor instance. */
     151    QLineEdit *m_pEditorArgument;
    144152
    145153    /** Holds the button-box instance. */
     
    240248    , m_pLabelPath(0)
    241249    , m_pEditorPath(0)
     250    , m_pLabelArgument(0)
     251    , m_pEditorArgument(0)
    242252    , m_pButtonBox(0)
    243253{
     
    253263{
    254264    return m_pEditorPath->text();
     265}
     266
     267QString UIInputDialogCloudConsoleApplication::argument() const
     268{
     269    return m_pEditorArgument->text();
    255270}
    256271
     
    260275    m_pLabelName->setText(tr("Name:"));
    261276    m_pLabelPath->setText(tr("Path:"));
     277    m_pLabelArgument->setText(tr("Argument:"));
    262278}
    263279
     
    271287    if (pMainLayout)
    272288    {
    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);
    277290
    278291        /* Prepare name editor: */
     
    306319        }
    307320
     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
    308336        /* Prepare button-box: */
    309337        m_pButtonBox = new QIDialogButtonBox(this);
     
    313341            connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIInputDialogCloudConsoleApplication::reject);
    314342            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);
    316344        }
    317345    }
     
    486514            if (newData != oldData)
    487515                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));
    489519            break;
    490520        }
     
    514544    QString strApplicationName;
    515545    QString strApplicationPath;
     546    QString strApplicationArgument;
    516547    bool fCancelled = true;
    517548    QPointer<UIInputDialogCloudConsoleApplication> pDialog = new UIInputDialogCloudConsoleApplication(this);
     
    523554            strApplicationName = pDialog->name();
    524555            strApplicationPath = pDialog->path();
     556            strApplicationArgument = pDialog->argument();
    525557            fCancelled = false;
    526558        }
     
    533565    m_strDefinition = QString("/%1").arg(strId);
    534566    /* 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);
    536568
    537569    /* Save new console application to extra-data: */
     
    9811013    applicationData.m_strName = values.value(1);
    9821014    applicationData.m_strPath = values.value(2);
     1015    applicationData.m_strArgument = values.value(3);
    9831016}
    9841017
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r85467 r85486  
    28122812                                                    this, &UIVirtualBoxManager::sltExecuteExternalApplication);
    28132813                pAction->setProperty("path", applicationValues.value(1));
     2814                pAction->setProperty("arguments", applicationValues.value(2));
    28142815            }
    28152816        }
Note: See TracChangeset for help on using the changeset viewer.

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