removed confusing tray menu "title"
This commit is contained in:
@ -13,7 +13,6 @@
|
|||||||
LayoutManager::LayoutManager( bool useTrayIcon, const QString &devdir, const QString &settingsDir )
|
LayoutManager::LayoutManager( bool useTrayIcon, const QString &devdir, const QString &settingsDir )
|
||||||
: devdir(devdir), settingsDir(settingsDir),
|
: devdir(devdir), settingsDir(settingsDir),
|
||||||
layoutGroup(new QActionGroup(this)),
|
layoutGroup(new QActionGroup(this)),
|
||||||
titleAction(new QAction(this)),
|
|
||||||
updateDevicesAction(new QAction(QIcon::fromTheme("view-refresh"),tr("Update &Joystick Devices"),this)),
|
updateDevicesAction(new QAction(QIcon::fromTheme("view-refresh"),tr("Update &Joystick Devices"),this)),
|
||||||
updateLayoutsAction(new QAction(QIcon::fromTheme("view-refresh"),tr("Update &Layout List"),this)),
|
updateLayoutsAction(new QAction(QIcon::fromTheme("view-refresh"),tr("Update &Layout List"),this)),
|
||||||
quitAction(new QAction(QIcon::fromTheme("application-exit"),tr("&Quit"),this)),
|
quitAction(new QAction(QIcon::fromTheme("application-exit"),tr("&Quit"),this)),
|
||||||
@ -31,7 +30,6 @@ LayoutManager::LayoutManager( bool useTrayIcon, const QString &devdir, const QSt
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//prepare the popup first.
|
//prepare the popup first.
|
||||||
titleAction->setEnabled(false);
|
|
||||||
fillPopup();
|
fillPopup();
|
||||||
|
|
||||||
//make a tray icon
|
//make a tray icon
|
||||||
@ -556,24 +554,6 @@ void LayoutManager::fillPopup() {
|
|||||||
//start with an empty slate
|
//start with an empty slate
|
||||||
trayMenu.clear();
|
trayMenu.clear();
|
||||||
|
|
||||||
//make a list of joystick devices
|
|
||||||
QString title;
|
|
||||||
if (available.isEmpty()) {
|
|
||||||
title = tr("Joysticks: (none)");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
QStringList pads;
|
|
||||||
foreach (JoyPad *joypad, available) {
|
|
||||||
pads.append(QString::number(joypad->getIndex() + 1));
|
|
||||||
}
|
|
||||||
title = tr("Joysticks: %1").arg(pads.join(" "));
|
|
||||||
}
|
|
||||||
|
|
||||||
trayMenu.setTitle(title);
|
|
||||||
titleAction->setText(title);
|
|
||||||
trayMenu.addAction(titleAction);
|
|
||||||
trayMenu.addSeparator();
|
|
||||||
|
|
||||||
//add in the Update options
|
//add in the Update options
|
||||||
trayMenu.addAction(updateLayoutsAction);
|
trayMenu.addAction(updateLayoutsAction);
|
||||||
trayMenu.addAction(updateDevicesAction);
|
trayMenu.addAction(updateDevicesAction);
|
||||||
|
@ -95,7 +95,6 @@ class LayoutManager : public QObject {
|
|||||||
QMenu trayMenu;
|
QMenu trayMenu;
|
||||||
//known actions for the popup menu
|
//known actions for the popup menu
|
||||||
QActionGroup *layoutGroup;
|
QActionGroup *layoutGroup;
|
||||||
QAction *titleAction;
|
|
||||||
QAction *updateDevicesAction;
|
QAction *updateDevicesAction;
|
||||||
QAction *updateLayoutsAction;
|
QAction *updateLayoutsAction;
|
||||||
QAction *quitAction;
|
QAction *quitAction;
|
||||||
|
Reference in New Issue
Block a user