mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
change appmenu to button set to better user experience
(if user will have global appmenu enabled)
This commit is contained in:
parent
4e8bbeed35
commit
28a4934a82
@ -11,7 +11,7 @@ set (PROJECT_CONTACT "esalexeev@gmail.com")
|
||||
set (PROJECT_LICENSE "GPLv3")
|
||||
set (PROJECT_VERSION_MAJOR 1)
|
||||
set (PROJECT_VERSION_MINOR 3)
|
||||
set (PROJECT_VERSION_PATCH 1)
|
||||
set (PROJECT_VERSION_PATCH 2)
|
||||
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||
string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
|
||||
string (TIMESTAMP CURRENT_YEAR "%Y")
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QMenu>
|
||||
#include <QUrl>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
@ -163,16 +164,16 @@ void MainWindow::updateToolBars()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
if (sender() == toolBarActions[QString("menu")]) {
|
||||
if (sender() == ui->pushButton_menu) {
|
||||
mainToolBar->setHidden(false);
|
||||
actionToolBar->setHidden(true);
|
||||
helpToolBar->setHidden(true);
|
||||
} else if (sender() == toolBarActions[QString("actions")]) {
|
||||
} else if (sender() == ui->pushButton_action) {
|
||||
mainToolBar->setHidden(true);
|
||||
actionToolBar->setHidden(false);
|
||||
helpToolBar->setHidden(true);
|
||||
updateMenu();
|
||||
} else if (sender() == toolBarActions[QString("help")]) {
|
||||
} else if (sender() == ui->pushButton_help) {
|
||||
mainToolBar->setHidden(true);
|
||||
actionToolBar->setHidden(true);
|
||||
helpToolBar->setHidden(false);
|
||||
|
@ -361,6 +361,7 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
|
||||
createObjects();
|
||||
createActions();
|
||||
createToolBars();
|
||||
|
||||
// tray
|
||||
if ((QSystemTrayIcon::isSystemTrayAvailable()) &&
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
|
||||
#include <pdebug/pdebug.h>
|
||||
#include <task/taskadds.h>
|
||||
@ -345,6 +346,9 @@ void MainWindow::createActions()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
|
||||
connect(ui->pushButton_menu, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
connect(ui->pushButton_action, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
connect(ui->pushButton_help, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
|
||||
// main tab events
|
||||
connect(ui->pushButton_netctlAuto, SIGNAL(clicked(bool)), this, SLOT(showNetctlAutoWindow()));
|
||||
@ -437,8 +441,6 @@ void MainWindow::createObjects()
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(vlanWid);
|
||||
wirelessWid = new WirelessWidget(this, configuration);
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid);
|
||||
|
||||
createToolBars();
|
||||
}
|
||||
|
||||
|
||||
@ -446,13 +448,6 @@ void MainWindow::createToolBars()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
toolBarActions[QString("menu")] = ui->menuBar->addAction(QApplication::translate("MainWindow", "Menu"),
|
||||
this, SLOT(updateToolBars()));
|
||||
toolBarActions[QString("actions")] = ui->menuBar->addAction(QApplication::translate("MainWindow", "Actions"),
|
||||
this, SLOT(updateToolBars()));
|
||||
toolBarActions[QString("help")] = ui->menuBar->addAction(QApplication::translate("MainWindow", "Help"),
|
||||
this, SLOT(updateToolBars()));
|
||||
|
||||
mainToolBar = new QToolBar(this);
|
||||
mainToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
|
||||
toolBarActions[QString("netctlAuto")] = mainToolBar->addAction(QApplication::translate("MainWindow", "netctl-auto"),
|
||||
@ -467,7 +462,7 @@ void MainWindow::createToolBars()
|
||||
this, SLOT(closeMainWindow()));
|
||||
appShortcuts[QString("quitShortcut")] = new QShortcut(QKeySequence(QApplication::translate("MainWindow", "Ctrl+Q")),
|
||||
this, SLOT(closeMainWindow()));
|
||||
ui->centralLayout->insertWidget(0, mainToolBar);
|
||||
ui->centralLayout->insertWidget(1, mainToolBar);
|
||||
mainToolBar->setHidden(true);
|
||||
|
||||
actionToolBar = new QToolBar(this);
|
||||
@ -522,7 +517,7 @@ void MainWindow::createToolBars()
|
||||
toolBarActions[QString("profileRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
|
||||
QApplication::translate("MainWindow", "Remove"),
|
||||
this, SLOT(profileTabRemoveProfile()));
|
||||
ui->centralLayout->insertWidget(0, actionToolBar);
|
||||
ui->centralLayout->insertWidget(1, actionToolBar);
|
||||
actionToolBar->setHidden(true);
|
||||
|
||||
helpToolBar = new QToolBar(this);
|
||||
@ -541,10 +536,10 @@ void MainWindow::createToolBars()
|
||||
toolBarActions[QString("about")] = helpToolBar->addAction(QIcon::fromTheme(QString("help-about")),
|
||||
QApplication::translate("MainWindow", "About"),
|
||||
this, SLOT(showAboutWindow()));
|
||||
ui->centralLayout->insertWidget(0, helpToolBar);
|
||||
ui->centralLayout->insertWidget(1, helpToolBar);
|
||||
helpToolBar->setHidden(true);
|
||||
|
||||
toolBarActions[QString("menu")]->trigger();
|
||||
ui->pushButton_menu->click();
|
||||
}
|
||||
|
||||
|
||||
@ -593,10 +588,7 @@ void MainWindow::deleteObjects()
|
||||
delete appShortcuts[QString("quitShortcut")];
|
||||
}
|
||||
if (trayIcon != nullptr) delete trayIcon;
|
||||
if (ui != nullptr) {
|
||||
ui->menuBar->clear();
|
||||
delete ui;
|
||||
}
|
||||
if (ui != nullptr) delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,6 +15,40 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="centralLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_menus">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_menu">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Menu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_action">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_help">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
@ -157,7 +191,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>437</width>
|
||||
<height>371</height>
|
||||
<height>368</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -251,16 +285,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>469</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<tabstops>
|
||||
|
Loading…
Reference in New Issue
Block a user