mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-12-14 23:03:40 +00:00
rewrite ui (refactoring, simplification, improvement of user expierence)
This commit is contained in:
@ -20,29 +20,17 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QToolBar>
|
||||
#include <QToolButton>
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
#include <netctlgui/netctlgui.h>
|
||||
|
||||
|
||||
class AboutWindow;
|
||||
class BridgeWidget;
|
||||
class EthernetWidget;
|
||||
class GeneralWidget;
|
||||
class IpWidget;
|
||||
class MacvlanWidget;
|
||||
class MobileWidget;
|
||||
class NetctlAutoWindow;
|
||||
class PasswdWidget;
|
||||
class PppoeWidget;
|
||||
class MainWidget;
|
||||
class NewProfileWidget;
|
||||
class SettingsWindow;
|
||||
class TrayIcon;
|
||||
class TunnelWidget;
|
||||
class TuntapWidget;
|
||||
class VlanWidget;
|
||||
class WirelessWidget;
|
||||
class WiFiMenuWidget;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
@ -76,6 +64,7 @@ public slots:
|
||||
void showSettingsWindow();
|
||||
// trayicon control slots
|
||||
bool enableProfileSlot(const QString profile);
|
||||
void openProfileSlot(const QString profile);
|
||||
bool startProfileSlot(const QString profile);
|
||||
bool stopAllProfilesSlot();
|
||||
bool switchToProfileSlot(const QString profile);
|
||||
@ -89,86 +78,39 @@ public slots:
|
||||
bool forceStopHelper();
|
||||
bool startHelper();
|
||||
// main
|
||||
void setDisabled(const bool disabled = true);
|
||||
void setTab(int tab);
|
||||
void showMessage(const bool status);
|
||||
void updateConfiguration(const QMap<QString, QVariant> args = QMap<QString, QVariant>());
|
||||
void updateMenu();
|
||||
void updateTabs(const int tab);
|
||||
// wifi tab slots
|
||||
void connectToUnknownEssid(const QString passwd);
|
||||
void setHiddenName(const QString name);
|
||||
|
||||
signals:
|
||||
void needToBeConfigured();
|
||||
|
||||
private slots:
|
||||
void setMainTab();
|
||||
void setProfileTab();
|
||||
void setWifiTab();
|
||||
void reportABug();
|
||||
// menu update slots
|
||||
void setMenuActionsShown(const bool state = true);
|
||||
void updateMenuMain();
|
||||
void updateMenuProfile();
|
||||
void updateMenuWifi();
|
||||
// tab update slots
|
||||
void updateMainTab();
|
||||
void updateProfileTab();
|
||||
void updateWifiTab();
|
||||
// main tab slots
|
||||
void mainTabContextualMenu(const QPoint &pos);
|
||||
void mainTabEditProfile();
|
||||
void mainTabEnableProfile();
|
||||
QStringList mainTabGetActiveProfiles();
|
||||
void mainTabRemoveProfile();
|
||||
void mainTabRestartProfile();
|
||||
void mainTabStartProfile();
|
||||
void mainTabStopAllProfiles();
|
||||
void mainTabSwitchToProfile();
|
||||
// profile tab slots
|
||||
void profileTabChangeState(const QString current);
|
||||
void profileTabClear();
|
||||
void profileTabCreateProfile();
|
||||
void profileTabLoadProfile();
|
||||
void profileTabRemoveProfile();
|
||||
// wifi tab slots
|
||||
void wifiTabContextualMenu(const QPoint &pos);
|
||||
void wifiTabSetEnabled(const bool state);
|
||||
void wifiTabStart();
|
||||
|
||||
private:
|
||||
// ui
|
||||
TrayIcon *trayIcon = nullptr;
|
||||
QMap<QString, QAction *> toolBarActions;
|
||||
QToolButton *actionMenu = nullptr;
|
||||
QToolBar *actionToolBar = nullptr;
|
||||
Ui::MainWindow *ui = nullptr;
|
||||
AboutWindow *aboutWin = nullptr;
|
||||
NetctlAutoWindow *netctlAutoWin = nullptr;
|
||||
PasswdWidget *passwdWid = nullptr;
|
||||
MainWidget *mainWidget = nullptr;
|
||||
NewProfileWidget *newProfileWidget = nullptr;
|
||||
SettingsWindow *settingsWin = nullptr;
|
||||
BridgeWidget *bridgeWid = nullptr;
|
||||
EthernetWidget *ethernetWid = nullptr;
|
||||
GeneralWidget *generalWid = nullptr;
|
||||
IpWidget *ipWid = nullptr;
|
||||
MacvlanWidget *macvlanWid = nullptr;
|
||||
MobileWidget *mobileWid = nullptr;
|
||||
PppoeWidget *pppoeWid = nullptr;
|
||||
TunnelWidget *tunnelWid = nullptr;
|
||||
TuntapWidget *tuntapWid = nullptr;
|
||||
VlanWidget *vlanWid = nullptr;
|
||||
WirelessWidget *wirelessWid = nullptr;
|
||||
WiFiMenuWidget *wifiMenuWidget = nullptr;
|
||||
// backend
|
||||
Netctl *netctlCommand = nullptr;
|
||||
NetctlProfile *netctlProfile = nullptr;
|
||||
WpaSup *wpaCommand = nullptr;
|
||||
bool checkExternalApps(const QString apps);
|
||||
bool checkHelperStatus();
|
||||
QString checkStatus(const bool statusBool, const bool nullFalse = false);
|
||||
void createActions();
|
||||
void createDBusSession();
|
||||
void createObjects();
|
||||
void createToolBars();
|
||||
void deleteObjects();
|
||||
QString configPath;
|
||||
bool debug = false;
|
||||
bool hiddenNetwork;
|
||||
bool useHelper = true;
|
||||
QTranslator *qtTranslator = nullptr;
|
||||
QTranslator *translator = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user