VirtualBox

Changeset 75643 in vbox


Ignore:
Timestamp:
Nov 21, 2018 2:27:42 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Make use of the delete confirmation dialog

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp

    r75642 r75643  
    243243            connect(m_pHostFileTable, &UIHostFileTable::sigLogOutput,
    244244                    this, &UIGuestControlFileManager::sltReceieveLogOutput);
     245            connect(m_pHostFileTable, &UIHostFileTable::sigDeleteConfirmationOptionChanged,
     246                    this, &UIGuestControlFileManager::sltHandleOptionsUpdated);
    245247            pFileTableContainerLayout->addWidget(m_pHostFileTable);
    246248        }
     
    254256            connect(m_pGuestFileTable, &UIGuestFileTable::sigCacheHostFileObjectsForDeletion,
    255257                    this, &UIGuestControlFileManager::sltCacheHostFileObjectsForDeletion);
    256 
     258            connect(m_pGuestFileTable, &UIGuestFileTable::sigDeleteConfirmationOptionChanged,
     259                    this, &UIGuestControlFileManager::sltHandleOptionsUpdated);
    257260            pFileTableContainerLayout->addWidget(m_pGuestFileTable);
    258261        }
     
    548551}
    549552
     553void UIGuestControlFileManager::sltHandleOptionsUpdated()
     554{
     555    if (m_pSettingsPanel)
     556    {
     557        m_pSettingsPanel->update();
     558    }
     559}
     560
    550561void UIGuestControlFileManager::copyMoveToHost(bool fIsMove)
    551562{
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.h

    r75642 r75643  
    117117    void sltFileOperationComplete(QUuid progressId);
    118118    void sltCacheHostFileObjectsForDeletion(const QUuid &moveProgessId, const QStringList &hostPathList);
     119    /** Performs whatever necessary when some signal about option change has been receieved. */
     120    void sltHandleOptionsUpdated();
    119121
    120122private:
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSettingsPanel.cpp

    r75480 r75643  
    5151{
    5252    return "SettingsPanel";
     53}
     54
     55void UIGuestControlFileManagerSettingsPanel::update()
     56{
     57    if (!m_pFileManagerSettings)
     58        return;
     59
     60    if (m_pListDirectoriesOnTopCheckBox)
     61    {
     62        m_pListDirectoriesOnTopCheckBox->blockSignals(true);
     63        m_pListDirectoriesOnTopCheckBox->setChecked(m_pFileManagerSettings->bListDirectoriesOnTop);
     64        m_pListDirectoriesOnTopCheckBox->blockSignals(false);
     65    }
     66
     67    if (m_pDeleteConfirmationCheckBox)
     68    {
     69        m_pDeleteConfirmationCheckBox->blockSignals(true);
     70        m_pDeleteConfirmationCheckBox->setChecked(m_pFileManagerSettings->bAskDeleteConfirmation);
     71        m_pDeleteConfirmationCheckBox->blockSignals(false);
     72    }
     73
     74    if (m_pHumanReabableSizesCheckBox)
     75    {
     76        m_pHumanReabableSizesCheckBox->blockSignals(true);
     77        m_pHumanReabableSizesCheckBox->setChecked(m_pFileManagerSettings->bShowHumanReadableSizes);
     78        m_pHumanReabableSizesCheckBox->blockSignals(false);
     79    }
    5380}
    5481
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerSettingsPanel.h

    r75480 r75643  
    3939                                           QWidget *pParent, UIGuestControlFileManagerSettings *pFileManagerSettings);
    4040    virtual QString panelName() const /* override */;
     41    /** Reads the file manager options and updates te widget accordingly. This functions is typically called
     42     *  when file manager options have been change by other means and this panel needs to adapt. */
     43    void update();
    4144
    4245signals:
     
    6063private:
    6164
    62     QCheckBox                         *m_pListDirectoriesOnTopCheckBox;
    63     QCheckBox                         *m_pDeleteConfirmationCheckBox;
    64     QCheckBox                         *m_pHumanReabableSizesCheckBox;
     65    QCheckBox          *m_pListDirectoriesOnTopCheckBox;
     66    QCheckBox          *m_pDeleteConfirmationCheckBox;
     67    QCheckBox          *m_pHumanReabableSizesCheckBox;
    6568
    6669    UIGuestControlFileManagerSettings *m_pFileManagerSettings;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileTable.cpp

    r75633 r75643  
    652652    }
    653653
    654     QCheckBox *m_pAskNextTimeCheckBox = new QCheckBox;
     654    m_pAskNextTimeCheckBox = new QCheckBox;
    655655
    656656    if (m_pAskNextTimeCheckBox)
    657657    {
     658        UIGuestControlFileManagerSettings *pFileManagerSettings = UIGuestControlFileManagerSettings::instance();
     659        if (pFileManagerSettings)
     660            m_pAskNextTimeCheckBox->setChecked(pFileManagerSettings->bAskDeleteConfirmation);
     661
    658662        pLayout->addWidget(m_pAskNextTimeCheckBox);
    659663        m_pAskNextTimeCheckBox->setText(UIGuestControlFileManager::tr("Ask for this confirmation next time"));
     
    15131517        pFileManagerSettings->bAskDeleteConfirmation = bAskNextTime;
    15141518        /* Notify file manager settings panel so that the check box there is updated: */
    1515         emit sigDeleteConfirmationSettingChanged();
     1519        emit sigDeleteConfirmationOptionChanged();
    15161520    }
    15171521
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileTable.h

    r75633 r75643  
    246246
    247247    void sigLogOutput(QString strLog, FileManagerLogType eLogType);
    248     void sigDeleteConfirmationSettingChanged();
     248    void sigDeleteConfirmationOptionChanged();
    249249
    250250public:
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