Changeset 85565 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 30, 2020 4:02:42 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85551 r85565 2808 2808 pMenu->addSeparator(); 2809 2809 2810 #if defined(VBOX_WS_MAC)2811 2810 /* Default Connect action: */ 2812 2811 QAction *pDefaultAction = pMenu->addAction(QApplication::translate("UIActionPool", "Connect", "to cloud VM"), 2813 2812 this, &UIVirtualBoxManager::sltExecuteExternalApplication); 2813 #if defined(VBOX_WS_MAC) 2814 2814 pDefaultAction->setProperty("path", "open"); 2815 2815 #elif defined(VBOX_WS_WIN) 2816 /* Default Connect action: */2817 QAction *pDefaultAction = pMenu->addAction(QApplication::translate("UIActionPool", "Connect", "to cloud VM"),2818 this, &UIVirtualBoxManager::sltExecuteExternalApplication);2819 2816 pDefaultAction->setProperty("path", "powershell"); 2820 2817 #elif defined(VBOX_WS_X11) 2821 /// @todo invent something? 2818 pDefaultAction->setProperty("path", defaultTerminalApplication()); 2819 pDefaultAction->setProperty("arguments", "-e sh -c"); 2822 2820 #endif 2823 2821 … … 3499 3497 } 3500 3498 3499 #ifdef VBOX_WS_X11 3500 /* static */ 3501 QString UIVirtualBoxManager::defaultTerminalApplication() 3502 { 3503 /* List terminals supporting -e argument: */ 3504 QStringList knownTerminalNames; 3505 knownTerminalNames << "konsole" 3506 << "gnome-terminal" 3507 << "xfce4-terminal" 3508 << "terminator" 3509 << "xterm" 3510 << "aterm" 3511 << "wterm" 3512 << "guake" 3513 << "evilvte" 3514 << "mrxvt" 3515 << "rxvt" 3516 << "rxvt-unicode"; 3517 /* Search for a first one suitable through shell command -v test: */ 3518 foreach (const QString &strTerminalName, knownTerminalNames) 3519 { 3520 const QString strPath = "sh"; 3521 const QStringList arguments = QStringList() << "-c" << QString("command -v '%1'").arg(strTerminalName); 3522 QProcess process; 3523 process.start(strPath, arguments, QIODevice::ReadOnly); 3524 process.waitForFinished(3000); 3525 if (process.exitCode() == 0) 3526 { 3527 const QString strResult = process.readAllStandardOutput(); 3528 if (strResult.startsWith('/')) 3529 return strResult.trimmed(); 3530 } 3531 } 3532 return QString(); 3533 } 3534 #endif 3535 3501 3536 3502 3537 #include "UIVirtualBoxManager.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r85445 r85565 435 435 /** Returns whether at least one of passed @a items is running. */ 436 436 static bool isAtLeastOneItemRunning(const QList<UIVirtualMachineItem*> &items); 437 438 #ifdef VBOX_WS_X11 439 /** Tries to guess default X11 terminal emulator. */ 440 static QString defaultTerminalApplication(); 441 #endif 437 442 /** @} */ 438 443
Note:
See TracChangeset
for help on using the changeset viewer.