VirtualBox

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


Ignore:
Timestamp:
Oct 30, 2018 6:35:27 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Moving more file manager actions to UIActionPool.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r75192 r75196  
    12471247        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    12481248        setStatusTip(QApplication::translate("UIActionPool", "Open pane with searching options"));
    1249         setToolTip(tr("Open Find Pane (%1)").arg(shortcut().toString()));
     1249        setToolTip(QApplication::translate("UIActionPool", "Open Find Pane (%1)").arg(shortcut().toString()));
    12501250    }
    12511251};
     
    12861286        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    12871287        setStatusTip(QApplication::translate("UIActionPool", "Open pane with filtering options"));
    1288         setToolTip(tr("Open Filter Pane (%1)").arg(shortcut().toString()));
     1288        setToolTip(QApplication::translate("UIActionPool", "Open Filter Pane (%1)").arg(shortcut().toString()));
    12891289    }
    12901290};
     
    13251325        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    13261326        setStatusTip(QApplication::translate("UIActionPool", "Open pane with bookmarking options"));
    1327         setToolTip(tr("Open Bookmark Pane (%1)").arg(shortcut().toString()));
     1327        setToolTip(QApplication::translate("UIActionPool", "Open Bookmark Pane (%1)").arg(shortcut().toString()));
    13281328    }
    13291329};
     
    13641364        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    13651365        setStatusTip(QApplication::translate("UIActionPool", "Open pane with log viewer settings"));
    1366         setToolTip(tr("Open Settings Pane (%1)").arg(shortcut().toString()));
     1366        setToolTip(QApplication::translate("UIActionPool", "Open Settings Pane (%1)").arg(shortcut().toString()));
    13671367    }
    13681368};
     
    14031403        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    14041404        setStatusTip(QApplication::translate("UIActionPool", "Refresh selected virtual machine log"));
    1405         setToolTip(tr("Refresh Virtual Machine Log (%1)").arg(shortcut().toString()));
     1405        setToolTip(QApplication::translate("UIActionPool", "Refresh Virtual Machine Log (%1)").arg(shortcut().toString()));
    14061406    }
    14071407};
     
    14421442        setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
    14431443        setStatusTip(QApplication::translate("UIActionPool", "Save selected virtual machine log"));
    1444         setToolTip(tr("Save Virtual Machine Log (%1)").arg(shortcut().toString()));
     1444        setToolTip(QApplication::translate("UIActionPool", "Save Virtual Machine Log (%1)").arg(shortcut().toString()));
    14451445    }
    14461446};
     
    15291529
    15301530
     1531/** Simple action extension, used as 'Copy to Guest' in guest control file manager action class. */
     1532class UIActionMenuGuestControlFileManagerCopyToGuest : public UIActionSimple
     1533{
     1534    Q_OBJECT;
     1535
     1536public:
     1537
     1538    /** Constructs action passing @a pParent to the base-class. */
     1539    UIActionMenuGuestControlFileManagerCopyToGuest(UIActionPool *pParent)
     1540        : UIActionSimple(pParent, ":/arrow_left_10px_x2.png", ":/arrow_left_disabled_10px_x2.png")
     1541    {}
     1542
     1543protected:
     1544
     1545    /** Returns shortcut extra-data ID. */
     1546    virtual QString shortcutExtraDataID() const /* override */
     1547    {
     1548        return QString("FileManagerCopyToGuest");
     1549    }
     1550
     1551    /** Returns default shortcut. */
     1552    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1553    {
     1554        return QKeySequence();
     1555    }
     1556
     1557    /** Handles translation event. */
     1558    virtual void retranslateUi() /* override */
     1559    {
     1560        setName(QApplication::translate("UIActionPool", "Copy the selected object(s) from host to guest"));
     1561        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1562        setToolTip(QApplication::translate("UIActionPool", "Copy the Selected Object(s) from Host to Guest"));
     1563        setStatusTip(QApplication::translate("UIActionPool", "Copy the selected object(s) from host to guest"));
     1564    }
     1565};
     1566
     1567/** Simple action extension, used as 'Copy to Host' in guest control file manager action class. */
     1568class UIActionMenuGuestControlFileManagerCopyToHost : public UIActionSimple
     1569{
     1570    Q_OBJECT;
     1571
     1572public:
     1573
     1574    /** Constructs action passing @a pParent to the base-class. */
     1575    UIActionMenuGuestControlFileManagerCopyToHost(UIActionPool *pParent)
     1576        : UIActionSimple(pParent, ":/arrow_right_10px_x2.png", ":/arrow_right_disabled_10px_x2.png")
     1577    {}
     1578
     1579protected:
     1580
     1581    /** Returns shortcut extra-data ID. */
     1582    virtual QString shortcutExtraDataID() const /* override */
     1583    {
     1584        return QString("FileManagerCopyToHost");
     1585    }
     1586
     1587    /** Returns default shortcut. */
     1588    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1589    {
     1590        return QKeySequence();
     1591    }
     1592
     1593    /** Handles translation event. */
     1594    virtual void retranslateUi() /* override */
     1595    {
     1596        setName(QApplication::translate("UIActionPool", "Copy the selected object(s) from guest to host"));
     1597        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1598        setToolTip(QApplication::translate("UIActionPool", "Copy the Selected Object(s) from Guest to Host"));
     1599        setStatusTip(QApplication::translate("UIActionPool", "Copy the selected object(s) from guest to host"));
     1600    }
     1601};
     1602
     1603
    15311604/** Simple action extension, used as 'File Manager Settings' in guest control file manager action class. */
    15321605class UIActionMenuGuestControlFileManagerSettings : public UIActionSimple
     
    15611634        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    15621635        setStatusTip(QApplication::translate("UIActionPool", "Modify file manager settings"));
    1563         setToolTip(tr("Modify File Manager Settings"));
     1636        setToolTip(QApplication::translate("UIActionPool", "Modify File Manager Settings"));
    15641637    }
    15651638};
     
    15961669        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    15971670        setStatusTip(QApplication::translate("UIActionPool", "Go one level up to parent folder"));
    1598         setToolTip(tr("Go One Level Up to Parent Folder"));
     1671        setToolTip(QApplication::translate("UIActionPool", "Go One Level Up to Parent Folder"));
    15991672    }
    16001673};
     
    16331706        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    16341707        setStatusTip(QApplication::translate("UIActionPool", "Go to home folder"));
    1635         setToolTip(tr("Go to Home Folder"));
     1708        setToolTip(QApplication::translate("UIActionPool", "Go to Home Folder"));
    16361709    }
    16371710};
     
    16701743        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    16711744        setStatusTip(QApplication::translate("UIActionPool", "Delete selected file object(s)"));
    1672         setToolTip(tr("Delete Selected File Object(s)"));
     1745        setToolTip(QApplication::translate("UIActionPool", "Delete Selected File Object(s)"));
    16731746    }
    16741747};
     
    17061779        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    17071780        setStatusTip(QApplication::translate("UIActionPool", "Refresh"));
    1708         setToolTip(tr("Refresh"));
     1781        setToolTip(QApplication::translate("UIActionPool", "Refresh"));
    17091782    }
    17101783};
     
    17421815        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    17431816        setStatusTip(QApplication::translate("UIActionPool", "Rename"));
    1744         setToolTip(tr("Rename"));
     1817        setToolTip(QApplication::translate("UIActionPool", "Rename"));
    17451818    }
    17461819};
     
    17771850        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    17781851        setStatusTip(QApplication::translate("UIActionPool", "Create New Directory"));
    1779         setToolTip(tr("Create New Directory"));
     1852        setToolTip(QApplication::translate("UIActionPool", "Create New Directory"));
    17801853    }
    17811854};
     
    18131886        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    18141887        setStatusTip(QApplication::translate("UIActionPool", "Copy selected file object(s)"));
    1815         setToolTip(tr("Copy Selected File Object(s)"));
     1888        setToolTip(QApplication::translate("UIActionPool", "Copy Selected File Object(s)"));
    18161889    }
    18171890};
     
    18481921        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    18491922        setStatusTip(QApplication::translate("UIActionPool", "Cut selected file object(s)"));
    1850         setToolTip(tr("Cut Selected File Object(s)"));
     1923        setToolTip(QApplication::translate("UIActionPool", "Cut Selected File Object(s)"));
    18511924    }
    18521925};
     
    18831956        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    18841957        setStatusTip(QApplication::translate("UIActionPool", "Paste copied/cut file object(s)"));
    1885         setToolTip(tr("Paste Copied/Cut File Object(s)"));
     1958        setToolTip(QApplication::translate("UIActionPool", "Paste Copied/Cut File Object(s)"));
    18861959    }
    18871960};
     
    19181991        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    19191992        setStatusTip(QApplication::translate("UIActionPool", "Select all files objects"));
    1920         setToolTip(tr("Select All Files Objects"));
     1993        setToolTip(QApplication::translate("UIActionPool", "Select All Files Objects"));
    19211994    }
    19221995};
     
    19542027        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    19552028        setStatusTip(QApplication::translate("UIActionPool", "Invert the current selection"));
    1956         setToolTip(tr("Invert The Current Selection"));
     2029        setToolTip(QApplication::translate("UIActionPool", "Invert The Current Selection"));
    19572030    }
    19582031};
     
    19902063        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
    19912064        setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)"));
    1992         setToolTip(tr("Show the Properties of Currently Selected File Object(s)"));
     2065        setToolTip(QApplication::translate("UIActionPool", "Show the Properties of Currently Selected File Object(s)"));
    19932066    }
    19942067};
     
    22072280    m_pool[UIActionIndex_M_GuestControlFileManager_M_HostSubmenu] = new UIActionMenuGuestControlFileManagerHostSubmenu(this);
    22082281    m_pool[UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu] = new UIActionMenuGuestControlFileManagerGuestSubmenu(this);
     2282    m_pool[UIActionIndex_M_GuestControlFileManager_S_CopyToGuest] = new  UIActionMenuGuestControlFileManagerCopyToGuest(this);
     2283    m_pool[UIActionIndex_M_GuestControlFileManager_S_CopyToHost] = new  UIActionMenuGuestControlFileManagerCopyToHost(this);
     2284
    22092285    m_pool[UIActionIndex_M_GuestControlFileManager_S_Settings] = new UIActionMenuGuestControlFileManagerSettings(this);
    22102286    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_GoUp] = new UIActionMenuGuestControlFileManagerGoUp(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r75136 r75196  
    102102    UIActionIndex_M_GuestControlFileManager_M_HostSubmenu,
    103103    UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu,
     104    UIActionIndex_M_GuestControlFileManager_S_CopyToGuest,
     105    UIActionIndex_M_GuestControlFileManager_S_CopyToHost,
    104106    UIActionIndex_M_GuestControlFileManager_S_Settings,
    105107    UIActionIndex_M_GuestControlFileManager_S_Host_GoUp,
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp

    r75193 r75196  
    353353    , m_pLogOutput(0)
    354354    , m_pToolBar(0)
    355     , m_pCopyGuestToHost(0)
    356     , m_pCopyHostToGuest(0)
    357355    , m_pFileTableContainerWidget(0)
    358356    , m_pFileTableContainerLayout(0)
     
    392390void UIGuestControlFileManager::retranslateUi()
    393391{
    394     if (m_pCopyGuestToHost)
    395     {
    396         m_pCopyGuestToHost->setText(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from guest to host"));
    397         m_pCopyGuestToHost->setToolTip(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from guest to host"));
    398         m_pCopyGuestToHost->setStatusTip(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from guest to host"));
    399     }
    400 
    401     if (m_pCopyHostToGuest)
    402     {
    403         m_pCopyHostToGuest->setText(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from host to guest"));
    404         m_pCopyHostToGuest->setToolTip(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from host to guest"));
    405         m_pCopyHostToGuest->setStatusTip(QApplication::translate("UIGuestProcessControlWidget", "Copy the selected object(s) from host to guest"));
    406     }
    407 
    408 
    409392    m_pTabWidget->setTabText(0, QApplication::translate("UIGuestProcessControlWidget", "Log"));
    410393    m_pTabWidget->setTabText(1, QApplication::translate("UIGuestProcessControlWidget", "File Operations"));
    411394    m_pTabWidget->setTabText(2, QApplication::translate("UIGuestProcessControlWidget", "Terminal"));
    412 
    413395}
    414396
     
    523505    bottomSpacerWidget->setVisible(true);
    524506
    525     m_pCopyGuestToHost = new QAction(this);
    526     if(m_pCopyGuestToHost)
    527     {
    528         m_pCopyGuestToHost->setIcon(UIIconPool::iconSet(QString(":/arrow_left_10px_x2.png")));
    529         connect(m_pCopyGuestToHost, &QAction::triggered, this, &UIGuestControlFileManager::sltCopyGuestToHost);
    530     }
    531 
    532     m_pCopyHostToGuest = new QAction(this);
    533     if (m_pCopyHostToGuest)
    534     {
    535         m_pCopyHostToGuest->setIcon(UIIconPool::iconSet(QString(":/arrow_right_10px_x2.png")));
    536         connect(m_pCopyHostToGuest, &QAction::triggered, this, &UIGuestControlFileManager::sltCopyHostToGuest);
    537     }
    538 
    539507    m_pToolBar->addWidget(topSpacerWidget);
    540     m_pToolBar->addAction(m_pCopyGuestToHost);
    541     m_pToolBar->addAction(m_pCopyHostToGuest);
     508    m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_CopyToHost));
     509    m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_CopyToGuest));
    542510    m_pToolBar->addWidget(bottomSpacerWidget);
     511
     512    connect(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_CopyToHost), &QAction::triggered,
     513            this, &UIGuestControlFileManager::sltCopyHostToGuest);
     514    connect(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_CopyToGuest), &QAction::triggered,
     515            this, &UIGuestControlFileManager::sltCopyGuestToHost);
    543516
    544517    m_pFileTableContainerLayout->addWidget(m_pToolBar);
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.h

    r75184 r75196  
    128128    QTextEdit                  *m_pLogOutput;
    129129    UIToolBar                  *m_pToolBar;
    130     QAction                    *m_pCopyGuestToHost;
    131     QAction                    *m_pCopyHostToGuest;
     130    // QAction                    *m_pCopyGuestToHost;
     131    // QAction                    *m_pCopyHostToGuest;
    132132    QWidget                    *m_pFileTableContainerWidget;
    133133    QHBoxLayout                *m_pFileTableContainerLayout;
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