mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
change menu to toolboxes
This commit is contained in:
parent
999914926a
commit
e7d2e0bd38
@ -21,10 +21,13 @@ Ver.1.3.0
|
||||
+ add ability to use helper
|
||||
+ add ability to start minimized/maximized/detached
|
||||
+ add ability to don't save profile from WiFi tab
|
||||
+ add ability to skip external components checking
|
||||
- remove buttons
|
||||
* more correct actions into SettingsWindow
|
||||
* update to library changes
|
||||
* rewrite tables to use toolTip
|
||||
* edit about window
|
||||
* change menuBar
|
||||
* helper:
|
||||
+ create daemon DBus system interface org.netctlgui.helper to the library:
|
||||
self control slots, netctl control slots and netctl information slots
|
||||
@ -39,11 +42,11 @@ Ver.1.3.0
|
||||
+ add slots forceStartProfile() and forceStopProfile()
|
||||
+ add double quotes to profile names
|
||||
+ add tests
|
||||
- remove functions getProfileDescriptions() and getProfileStatuses()
|
||||
- remove SleepThread class
|
||||
* rewrite to use [tasks](https://github.com/mhogomchungu/tasks) (see #7)
|
||||
* rename getInterfaceList() to getWirelessInterfaceList()
|
||||
* change temporaty directory from $HOME/.cache to system one
|
||||
- remove functions getProfileDescriptions() and getProfileStatuses()
|
||||
- remove SleepThread class
|
||||
* plasmoid:
|
||||
+ add 3rd party license information
|
||||
+ allow plasmoid to use system tray
|
||||
|
@ -63,6 +63,7 @@ _netctl_gui_settings=(
|
||||
'PREFERED_IFACE'
|
||||
'PROFILE_DIR'
|
||||
'RFKILL_DIR'
|
||||
'SKIPCOMPONENTS'
|
||||
'STARTTOTRAY'
|
||||
'SUDO_PATH'
|
||||
'SYSTEMCTL_PATH'
|
||||
|
@ -61,22 +61,22 @@ void MainWindow::setMenuActionsShown(const bool state)
|
||||
if (debug) qDebug() << PDEBUG << ":" << "State" << state;
|
||||
|
||||
// main
|
||||
ui->actionMainEdit->setVisible(state);
|
||||
ui->actionMainEnable->setVisible(state);
|
||||
ui->actionMainRefresh->setVisible(state);
|
||||
ui->actionMainRemove->setVisible(state);
|
||||
ui->actionMainRestart->setVisible(state);
|
||||
ui->actionMainStart->setVisible(state);
|
||||
ui->actionMainStopAll->setVisible(state);
|
||||
ui->actionMainSwitch->setVisible(state);
|
||||
toolBarActions[QString("mainRefresh")]->setVisible(state);
|
||||
toolBarActions[QString("mainStart")]->setVisible(state);
|
||||
toolBarActions[QString("mainSwitch")]->setVisible(state);
|
||||
toolBarActions[QString("mainRestart")]->setVisible(state);
|
||||
toolBarActions[QString("mainEnable")]->setVisible(state);
|
||||
toolBarActions[QString("mainStopAll")]->setVisible(state);
|
||||
toolBarActions[QString("mainEdit")]->setVisible(state);
|
||||
toolBarActions[QString("mainRemove")]->setVisible(state);
|
||||
// profile
|
||||
ui->actionProfileClear->setVisible(state);
|
||||
ui->actionProfileLoad->setVisible(state);
|
||||
ui->actionProfileRemove->setVisible(state);
|
||||
ui->actionProfileSave->setVisible(state);
|
||||
toolBarActions[QString("profileClear")]->setVisible(state);
|
||||
toolBarActions[QString("profileLoad")]->setVisible(state);
|
||||
toolBarActions[QString("profileSave")]->setVisible(state);
|
||||
toolBarActions[QString("profileRemove")]->setVisible(state);
|
||||
// wifi
|
||||
ui->actionWifiRefresh->setVisible(state);
|
||||
ui->actionWifiStart->setVisible(state);
|
||||
toolBarActions[QString("wifiRefresh")]->setVisible(state);
|
||||
toolBarActions[QString("wifiStart")]->setVisible(state);
|
||||
}
|
||||
|
||||
|
||||
@ -84,33 +84,33 @@ void MainWindow::updateMenuMain()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
ui->actionMainRefresh->setVisible(true);
|
||||
toolBarActions[QString("mainRefresh")]->setVisible(true);
|
||||
if (ui->tableWidget_main->currentItem() == 0) return;
|
||||
if (!ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 2)->text().isEmpty()) {
|
||||
ui->actionMainRestart->setVisible(true);
|
||||
ui->actionMainStart->setText(QApplication::translate("MainWindow", "Stop profile"));
|
||||
ui->actionMainStart->setIcon(QIcon::fromTheme("process-stop"));
|
||||
toolBarActions[QString("mainRestart")]->setVisible(true);
|
||||
toolBarActions[QString("mainStart")]->setText(QApplication::translate("MainWindow", "Stop"));
|
||||
toolBarActions[QString("mainStart")]->setIcon(QIcon::fromTheme("process-stop"));
|
||||
} else {
|
||||
ui->actionMainStart->setText(QApplication::translate("MainWindow", "Start profile"));
|
||||
ui->actionMainStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
toolBarActions[QString("mainStart")]->setText(QApplication::translate("MainWindow", "Start"));
|
||||
toolBarActions[QString("mainStart")]->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
if (!mainTabGetActiveProfiles().isEmpty()) {
|
||||
if (!mainTabGetActiveProfiles()
|
||||
.contains(ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 0)->text()))
|
||||
ui->actionMainSwitch->setVisible(true);
|
||||
ui->actionMainStopAll->setVisible(true);
|
||||
toolBarActions[QString("mainSwitch")]->setVisible(true);
|
||||
toolBarActions[QString("mainStopAll")]->setVisible(true);
|
||||
}
|
||||
ui->actionMainStart->setVisible(true);
|
||||
toolBarActions[QString("mainStart")]->setVisible(true);
|
||||
if (!ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 3)->text().isEmpty()) {
|
||||
ui->actionMainEnable->setText(QApplication::translate("MainWindow", "Disable profile"));
|
||||
ui->actionMainEnable->setIcon(QIcon::fromTheme("edit-remove"));
|
||||
toolBarActions[QString("mainEnable")]->setText(QApplication::translate("MainWindow", "Disable"));
|
||||
toolBarActions[QString("mainEnable")]->setIcon(QIcon::fromTheme("edit-remove"));
|
||||
} else {
|
||||
ui->actionMainEnable->setText(QApplication::translate("MainWindow", "Enable profile"));
|
||||
ui->actionMainEnable->setIcon(QIcon::fromTheme("edit-add"));
|
||||
toolBarActions[QString("mainEnable")]->setText(QApplication::translate("MainWindow", "Enable"));
|
||||
toolBarActions[QString("mainEnable")]->setIcon(QIcon::fromTheme("edit-add"));
|
||||
}
|
||||
ui->actionMainEnable->setVisible(true);
|
||||
ui->actionMainEdit->setVisible(true);
|
||||
ui->actionMainRemove->setVisible(true);
|
||||
toolBarActions[QString("mainEnable")]->setVisible(true);
|
||||
toolBarActions[QString("mainEdit")]->setVisible(true);
|
||||
toolBarActions[QString("mainRemove")]->setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
@ -118,15 +118,15 @@ void MainWindow::updateMenuProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
ui->actionProfileClear->setVisible(true);
|
||||
toolBarActions[QString("profileClear")]->setVisible(true);
|
||||
if (ui->comboBox_profile->currentText().isEmpty()) {
|
||||
ui->actionProfileLoad->setVisible(false);
|
||||
ui->actionProfileRemove->setVisible(false);
|
||||
ui->actionProfileSave->setVisible(false);
|
||||
toolBarActions[QString("profileLoad")]->setVisible(false);
|
||||
toolBarActions[QString("profileRemove")]->setVisible(false);
|
||||
toolBarActions[QString("profileSave")]->setVisible(false);
|
||||
} else {
|
||||
ui->actionProfileLoad->setVisible(true);
|
||||
ui->actionProfileRemove->setVisible(true);
|
||||
ui->actionProfileSave->setVisible(true);
|
||||
toolBarActions[QString("profileLoad")]->setVisible(true);
|
||||
toolBarActions[QString("profileRemove")]->setVisible(true);
|
||||
toolBarActions[QString("profileSave")]->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,21 +135,43 @@ void MainWindow::updateMenuWifi()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
ui->actionWifiRefresh->setVisible(true);
|
||||
toolBarActions[QString("wifiRefresh")]->setVisible(true);
|
||||
if (ui->tableWidget_wifi->currentItem() == 0) return;
|
||||
if (!ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 4)->text().isEmpty()) {
|
||||
if (!ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 3)->text().isEmpty()) {
|
||||
ui->actionWifiStart->setText(QApplication::translate("MainWindow", "Stop WiFi"));
|
||||
ui->actionWifiStart->setIcon(QIcon::fromTheme("process-stop"));
|
||||
toolBarActions[QString("wifiStart")]->setText(QApplication::translate("MainWindow", "Stop"));
|
||||
toolBarActions[QString("wifiStart")]->setIcon(QIcon::fromTheme("process-stop"));
|
||||
} else {
|
||||
ui->actionWifiStart->setText(QApplication::translate("MainWindow", "Start WiFi"));
|
||||
ui->actionWifiStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
toolBarActions[QString("wifiStart")]->setText(QApplication::translate("MainWindow", "Start"));
|
||||
toolBarActions[QString("wifiStart")]->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
} else {
|
||||
ui->actionWifiStart->setText(QApplication::translate("MainWindow", "Start WiFi"));
|
||||
ui->actionWifiStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
toolBarActions[QString("wifiStart")]->setText(QApplication::translate("MainWindow", "Start"));
|
||||
toolBarActions[QString("wifiStart")]->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
toolBarActions[QString("wifiStart")]->setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::updateToolBars()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
if (sender() == toolBarActions[QString("menu")]) {
|
||||
mainToolBar->setHidden(false);
|
||||
actionToolBar->setHidden(true);
|
||||
helpToolBar->setHidden(true);
|
||||
} else if (sender() == toolBarActions[QString("actions")]) {
|
||||
mainToolBar->setHidden(true);
|
||||
actionToolBar->setHidden(false);
|
||||
helpToolBar->setHidden(true);
|
||||
updateMenu();
|
||||
} else if (sender() == toolBarActions[QString("help")]) {
|
||||
mainToolBar->setHidden(true);
|
||||
actionToolBar->setHidden(true);
|
||||
helpToolBar->setHidden(false);
|
||||
|
||||
}
|
||||
ui->actionWifiStart->setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
@ -543,32 +565,6 @@ void MainWindow::mainTabSwitchToProfile()
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous)
|
||||
{
|
||||
Q_UNUSED(previous);
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (current == 0) {
|
||||
ui->pushButton_mainRestart->setDisabled(true);
|
||||
ui->pushButton_mainStart->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
ui->pushButton_mainStart->setEnabled(true);
|
||||
|
||||
if (!ui->tableWidget_main->item(current->row(), 2)->text().isEmpty()) {
|
||||
ui->pushButton_mainRestart->setEnabled(true);
|
||||
ui->pushButton_mainStart->setText(QApplication::translate("MainWindow", "Stop"));
|
||||
ui->pushButton_mainStart->setIcon(QIcon::fromTheme("process-stop"));
|
||||
} else {
|
||||
ui->pushButton_mainRestart->setDisabled(true);
|
||||
ui->pushButton_mainStart->setText(QApplication::translate("MainWindow", "Start"));
|
||||
ui->pushButton_mainStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// profile tab slots
|
||||
void MainWindow::profileTabChangeState(const QString current)
|
||||
{
|
||||
@ -1042,12 +1038,9 @@ void MainWindow::wifiTabSetEnabled(const bool state)
|
||||
|
||||
if (state) {
|
||||
ui->tableWidget_wifi->show();
|
||||
ui->pushButton_wifiRefresh->setEnabled(true);
|
||||
ui->label_wifi->hide();
|
||||
} else {
|
||||
ui->tableWidget_wifi->hide();
|
||||
ui->pushButton_wifiRefresh->setDisabled(true);
|
||||
ui->pushButton_wifiStart->setDisabled(true);
|
||||
ui->label_wifi->show();
|
||||
}
|
||||
}
|
||||
@ -1125,34 +1118,3 @@ void MainWindow::wifiTabStart()
|
||||
|
||||
updateWifiTab();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous)
|
||||
{
|
||||
Q_UNUSED(previous);
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (current == 0) {
|
||||
ui->pushButton_wifiStart->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_wifi->item(current->row(), 0)->text() == QString("<hidden>")) {
|
||||
ui->pushButton_wifiStart->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
ui->pushButton_wifiStart->setEnabled(true);
|
||||
if (!ui->tableWidget_wifi->item(current->row(), 4)->text().isEmpty()) {
|
||||
if (!ui->tableWidget_wifi->item(current->row(), 3)->text().isEmpty()) {
|
||||
ui->pushButton_wifiStart->setText(QApplication::translate("MainWindow", "Stop"));
|
||||
ui->pushButton_wifiStart->setIcon(QIcon::fromTheme("process-stop"));
|
||||
} else {
|
||||
ui->pushButton_wifiStart->setText(QApplication::translate("MainWindow", "Start"));
|
||||
ui->pushButton_wifiStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
} else {
|
||||
ui->pushButton_wifiStart->setText(QApplication::translate("MainWindow", "Start"));
|
||||
ui->pushButton_wifiStart->setIcon(QIcon::fromTheme("system-run"));
|
||||
}
|
||||
}
|
||||
|
@ -274,6 +274,7 @@ bool MainWindow::checkExternalApps(const QString apps = QString("all"))
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
if (configuration[QString("SKIPCOMPONENTS")] == QString("true")) return true;
|
||||
QStringList cmd;
|
||||
cmd.append("which");
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
@ -344,52 +345,23 @@ void MainWindow::createActions()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
|
||||
connect(ui->actionAbout, SIGNAL(triggered(bool)), this, SLOT(showAboutWindow()));
|
||||
connect(ui->actionApi, SIGNAL(triggered(bool)), this, SLOT(showApi()));
|
||||
connect(ui->actionLibrary, SIGNAL(triggered(bool)), this, SLOT(showLibrary()));
|
||||
connect(ui->actionNetctlAuto, SIGNAL(triggered(bool)), this, SLOT(showNetctlAutoWindow()));
|
||||
connect(ui->actionReport, SIGNAL(triggered(bool)), this, SLOT(reportABug()));
|
||||
connect(ui->actionSecurity, SIGNAL(triggered(bool)), this, SLOT(showSecurityNotes()));
|
||||
connect(ui->actionSettings, SIGNAL(triggered(bool)), this, SLOT(showSettingsWindow()));
|
||||
connect(ui->actionQuit, SIGNAL(triggered(bool)), this, SLOT(closeMainWindow()));
|
||||
|
||||
// actions menu
|
||||
connect(ui->menuActions, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||
connect(ui->actionMainEdit, SIGNAL(triggered(bool)), this, SLOT(mainTabEditProfile()));
|
||||
connect(ui->actionMainEnable, SIGNAL(triggered(bool)), this, SLOT(mainTabEnableProfile()));
|
||||
connect(ui->actionMainRefresh, SIGNAL(triggered(bool)), this, SLOT(updateMainTab()));
|
||||
connect(ui->actionMainRemove, SIGNAL(triggered(bool)), this, SLOT(mainTabRemoveProfile()));
|
||||
connect(ui->actionMainRestart, SIGNAL(triggered(bool)), this, SLOT(mainTabRestartProfile()));
|
||||
connect(ui->actionMainStart, SIGNAL(triggered(bool)), this, SLOT(mainTabStartProfile()));
|
||||
connect(ui->actionMainStopAll, SIGNAL(triggered(bool)), this, SLOT(mainTabStopAllProfiles()));
|
||||
connect(ui->actionMainSwitch, SIGNAL(triggered(bool)), this, SLOT(mainTabSwitchToProfile()));
|
||||
connect(ui->actionProfileClear, SIGNAL(triggered(bool)), this, SLOT(profileTabClear()));
|
||||
connect(ui->actionProfileLoad, SIGNAL(triggered(bool)), this, SLOT(profileTabLoadProfile()));
|
||||
connect(ui->actionProfileRemove, SIGNAL(triggered(bool)), this, SLOT(profileTabRemoveProfile()));
|
||||
connect(ui->actionProfileSave, SIGNAL(triggered(bool)), this, SLOT(profileTabCreateProfile()));
|
||||
connect(ui->actionWifiRefresh, SIGNAL(triggered(bool)), this, SLOT(updateWifiTab()));
|
||||
connect(ui->actionWifiStart, SIGNAL(triggered(bool)), this, SLOT(wifiTabStart()));
|
||||
|
||||
// main tab events
|
||||
connect(ui->pushButton_mainRefresh, SIGNAL(clicked(bool)), this, SLOT(updateMainTab()));
|
||||
connect(ui->pushButton_mainRestart, SIGNAL(clicked(bool)), this, SLOT(mainTabRestartProfile()));
|
||||
connect(ui->pushButton_mainStart, SIGNAL(clicked(bool)), this, SLOT(mainTabStartProfile()));
|
||||
connect(ui->pushButton_netctlAuto, SIGNAL(clicked(bool)), this, SLOT(showNetctlAutoWindow()));
|
||||
connect(ui->tableWidget_main, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(mainTabStartProfile()));
|
||||
connect(ui->tableWidget_main, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(mainTabRefreshButtons(QTableWidgetItem *, QTableWidgetItem *)));
|
||||
connect(ui->tableWidget_main, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),
|
||||
this, SLOT(updateMenuMain()));
|
||||
connect(ui->tableWidget_main, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(mainTabContextualMenu(QPoint)));
|
||||
|
||||
// profile tab events
|
||||
connect(ui->comboBox_profile, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabLoadProfile()));
|
||||
connect(ui->pushButton_profileClear, SIGNAL(clicked(bool)), this, SLOT(profileTabClear()));
|
||||
connect(ui->pushButton_profileSave, SIGNAL(clicked(bool)), this, SLOT(profileTabCreateProfile()));
|
||||
connect(ui->comboBox_profile, SIGNAL(editTextChanged(QString)), this, SLOT(updateMenuProfile()));
|
||||
connect(generalWid->connectionType, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabChangeState(QString)));
|
||||
|
||||
// wifi tab events
|
||||
connect(ui->pushButton_wifiRefresh, SIGNAL(clicked(bool)), this, SLOT(updateWifiTab()));
|
||||
connect(ui->pushButton_wifiStart, SIGNAL(clicked(bool)), this, SLOT(wifiTabStart()));
|
||||
connect(ui->tableWidget_wifi, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(wifiTabStart()));
|
||||
connect(ui->tableWidget_wifi, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(wifiTabRefreshButtons(QTableWidgetItem *, QTableWidgetItem *)));
|
||||
connect(ui->tableWidget_wifi, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),
|
||||
this, SLOT(updateMenuWifi()));
|
||||
connect(ui->tableWidget_wifi, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(wifiTabContextualMenu(QPoint)));
|
||||
}
|
||||
|
||||
@ -465,6 +437,108 @@ void MainWindow::createObjects()
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(vlanWid);
|
||||
wirelessWid = new WirelessWidget(this, configuration);
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(wirelessWid);
|
||||
|
||||
createToolBars();
|
||||
}
|
||||
|
||||
|
||||
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"),
|
||||
this, SLOT(showNetctlAutoWindow()));
|
||||
toolBarActions[QString("settings")] = mainToolBar->addAction(QIcon::fromTheme(QString("configure")),
|
||||
QApplication::translate("MainWindow", "Settings"),
|
||||
this, SLOT(showSettingsWindow()));
|
||||
appShortcuts[QString("settingsShortcut")] = new QShortcut(QKeySequence(QApplication::translate("MainWindow", "Ctrl+S")),
|
||||
this, SLOT(showSettingsWindow()));
|
||||
toolBarActions[QString("quit")] = mainToolBar->addAction(QIcon::fromTheme(QString("exit")),
|
||||
QApplication::translate("MainWindow", "Quit"),
|
||||
this, SLOT(closeMainWindow()));
|
||||
appShortcuts[QString("quitShortcut")] = new QShortcut(QKeySequence(QApplication::translate("MainWindow", "Ctrl+Q")),
|
||||
this, SLOT(closeMainWindow()));
|
||||
ui->verticalLayout_4->insertWidget(0, mainToolBar);
|
||||
mainToolBar->setHidden(true);
|
||||
|
||||
actionToolBar = new QToolBar(this);
|
||||
actionToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
|
||||
toolBarActions[QString("mainRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("stock-refresh")),
|
||||
QApplication::translate("MainWindow", "Refresh"),
|
||||
this, SLOT(updateMainTab()));
|
||||
toolBarActions[QString("profileClear")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-clear")),
|
||||
QApplication::translate("MainWindow", "Clear"),
|
||||
this, SLOT(profileTabClear()));
|
||||
toolBarActions[QString("wifiRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("stock-refresh")),
|
||||
QApplication::translate("MainWindow", "Refresh"),
|
||||
this, SLOT(updateWifiTab()));
|
||||
actionToolBar->addSeparator();
|
||||
toolBarActions[QString("mainStart")] = actionToolBar->addAction(QIcon::fromTheme(QString("system-run")),
|
||||
QApplication::translate("MainWindow", "Start"),
|
||||
this, SLOT(mainTabStartProfile()));
|
||||
toolBarActions[QString("mainSwitch")] = actionToolBar->addAction(QIcon::fromTheme(QString("system-run")),
|
||||
QApplication::translate("MainWindow", "Switch"),
|
||||
this, SLOT(mainTabSwitchToProfile()));
|
||||
toolBarActions[QString("mainRestart")] = actionToolBar->addAction(QIcon::fromTheme(QString("stock-refresh")),
|
||||
QApplication::translate("MainWindow", "Restart"),
|
||||
this, SLOT(mainTabRestartProfile()));
|
||||
toolBarActions[QString("mainEnable")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-add")),
|
||||
QApplication::translate("MainWindow", "Enable"),
|
||||
this, SLOT(mainTabEnableProfile()));
|
||||
toolBarActions[QString("mainStopAll")] = actionToolBar->addAction(QIcon::fromTheme(QString("process-stop")),
|
||||
QApplication::translate("MainWindow", "Stop all"),
|
||||
this, SLOT(mainTabStopAllProfiles()));
|
||||
toolBarActions[QString("profileLoad")] = actionToolBar->addAction(QIcon::fromTheme(QString("document-open")),
|
||||
QApplication::translate("MainWindow", "Load"),
|
||||
this, SLOT(profileTabLoadProfile()));
|
||||
toolBarActions[QString("profileSave")] = actionToolBar->addAction(QIcon::fromTheme(QString("document-save")),
|
||||
QApplication::translate("MainWindow", "Save"),
|
||||
this, SLOT(profileTabCreateProfile()));
|
||||
toolBarActions[QString("wifiStart")] = actionToolBar->addAction(QIcon::fromTheme(QString("system-run")),
|
||||
QApplication::translate("MainWindow", "Start"),
|
||||
this, SLOT(wifiTabStart()));
|
||||
actionToolBar->addSeparator();
|
||||
toolBarActions[QString("mainEdit")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit")),
|
||||
QApplication::translate("MainWindow", "Edit"),
|
||||
this, SLOT(mainTabEditProfile()));
|
||||
toolBarActions[QString("mainRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
|
||||
QApplication::translate("MainWindow", "Remove"),
|
||||
this, SLOT(mainTabRemoveProfile()));
|
||||
toolBarActions[QString("profileRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
|
||||
QApplication::translate("MainWindow", "Remove"),
|
||||
this, SLOT(profileTabRemoveProfile()));
|
||||
ui->verticalLayout_4->insertWidget(0, actionToolBar);
|
||||
actionToolBar->setHidden(true);
|
||||
|
||||
helpToolBar = new QToolBar(this);
|
||||
helpToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
|
||||
toolBarActions[QString("security")] = helpToolBar->addAction(QIcon::fromTheme(QString("security-medium")),
|
||||
QApplication::translate("MainWindow", "Security"),
|
||||
this, SLOT(showSecurityNotes()));
|
||||
toolBarActions[QString("api")] = helpToolBar->addAction(QApplication::translate("MainWindow", "DBus API"),
|
||||
this, SLOT(showApi()));
|
||||
toolBarActions[QString("library")] = helpToolBar->addAction(QApplication::translate("MainWindow", "Library"),
|
||||
this, SLOT(showLibrary()));
|
||||
helpToolBar->addSeparator();
|
||||
toolBarActions[QString("report")] = helpToolBar->addAction(QIcon::fromTheme(QString("tools-report-bug")),
|
||||
QApplication::translate("MainWindow", "Report a bug"),
|
||||
this, SLOT(reportABug()));
|
||||
toolBarActions[QString("about")] = helpToolBar->addAction(QIcon::fromTheme(QString("help-about")),
|
||||
QApplication::translate("MainWindow", "About"),
|
||||
this, SLOT(showAboutWindow()));
|
||||
ui->verticalLayout_4->insertWidget(0, helpToolBar);
|
||||
helpToolBar->setHidden(true);
|
||||
|
||||
toolBarActions[QString("menu")]->trigger();
|
||||
}
|
||||
|
||||
|
||||
@ -494,8 +568,25 @@ void MainWindow::deleteObjects()
|
||||
if (errorWin != nullptr) delete errorWin;
|
||||
if (netctlAutoWin != nullptr) delete netctlAutoWin;
|
||||
if (settingsWin != nullptr) delete settingsWin;
|
||||
if (actionToolBar != nullptr) {
|
||||
actionToolBar->clear();
|
||||
delete actionToolBar;
|
||||
}
|
||||
if (helpToolBar != nullptr) {
|
||||
helpToolBar->clear();
|
||||
delete helpToolBar;
|
||||
}
|
||||
if (mainToolBar != nullptr) {
|
||||
mainToolBar->clear();
|
||||
delete mainToolBar;
|
||||
delete appShortcuts[QString("settingsShortcut")];
|
||||
delete appShortcuts[QString("quitShortcut")];
|
||||
}
|
||||
if (trayIcon != nullptr) delete trayIcon;
|
||||
if (ui != nullptr) delete ui;
|
||||
if (ui != nullptr) {
|
||||
ui->menuBar->clear();
|
||||
delete ui;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QShortcut>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QToolBar>
|
||||
|
||||
#include <netctlgui/netctlgui.h>
|
||||
|
||||
@ -103,6 +105,7 @@ private slots:
|
||||
void updateMenuMain();
|
||||
void updateMenuProfile();
|
||||
void updateMenuWifi();
|
||||
void updateToolBars();
|
||||
// tab update slots
|
||||
void updateMainTab();
|
||||
void updateProfileTab();
|
||||
@ -117,7 +120,6 @@ private slots:
|
||||
void mainTabStartProfile();
|
||||
void mainTabStopAllProfiles();
|
||||
void mainTabSwitchToProfile();
|
||||
void mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||
// profile tab slots
|
||||
void profileTabChangeState(const QString current);
|
||||
void profileTabClear();
|
||||
@ -128,11 +130,15 @@ private slots:
|
||||
void wifiTabContextualMenu(const QPoint &pos);
|
||||
void wifiTabSetEnabled(const bool state);
|
||||
void wifiTabStart();
|
||||
void wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||
|
||||
private:
|
||||
// ui
|
||||
TrayIcon *trayIcon = nullptr;
|
||||
QMap<QString, QShortcut *> appShortcuts;
|
||||
QMap<QString, QAction *> toolBarActions;
|
||||
QToolBar *actionToolBar = nullptr;
|
||||
QToolBar *helpToolBar = nullptr;
|
||||
QToolBar *mainToolBar = nullptr;
|
||||
Ui::MainWindow *ui = nullptr;
|
||||
AboutWindow *aboutWin = nullptr;
|
||||
ErrorWindow *errorWin = nullptr;
|
||||
@ -160,6 +166,7 @@ private:
|
||||
void createActions();
|
||||
void createDBusSession();
|
||||
void createObjects();
|
||||
void createToolBars();
|
||||
void deleteObjects();
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
QString configPath;
|
||||
|
@ -101,77 +101,6 @@
|
||||
<column/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_mainButtons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_mainRefresh">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_mainButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_mainRestart">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restart</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_mainStart">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="system-run">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_new">
|
||||
@ -228,7 +157,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>437</width>
|
||||
<height>338</height>
|
||||
<height>371</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -241,47 +170,6 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_newProfileButtons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_profileClear">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_newProfileButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_profileSave">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="document-save">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_wifi">
|
||||
@ -357,59 +245,6 @@
|
||||
<column/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_wifiButtons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_wifiRefresh">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_wifiButtons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_wifiStart">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="system-run">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@ -425,271 +260,14 @@
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuMenu">
|
||||
<property name="title">
|
||||
<string>Menu</string>
|
||||
</property>
|
||||
<addaction name="actionNetctlAuto"/>
|
||||
<addaction name="actionSettings"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuActions">
|
||||
<property name="title">
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<addaction name="actionMainRefresh"/>
|
||||
<addaction name="actionWifiRefresh"/>
|
||||
<addaction name="actionProfileClear"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMainStart"/>
|
||||
<addaction name="actionMainSwitch"/>
|
||||
<addaction name="actionMainRestart"/>
|
||||
<addaction name="actionMainEnable"/>
|
||||
<addaction name="actionMainStopAll"/>
|
||||
<addaction name="actionProfileLoad"/>
|
||||
<addaction name="actionProfileSave"/>
|
||||
<addaction name="actionWifiStart"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMainEdit"/>
|
||||
<addaction name="actionMainRemove"/>
|
||||
<addaction name="actionProfileRemove"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionSecurity"/>
|
||||
<addaction name="actionApi"/>
|
||||
<addaction name="actionLibrary"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionReport"/>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuMenu"/>
|
||||
<addaction name="menuActions"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<action name="actionSettings">
|
||||
<property name="icon">
|
||||
<iconset theme="configure">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
<property name="icon">
|
||||
<iconset theme="exit">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainRefresh">
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainStart">
|
||||
<property name="icon">
|
||||
<iconset theme="system-run">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainRestart">
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restart profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainEnable">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-add">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainEdit">
|
||||
<property name="icon">
|
||||
<iconset theme="edit">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainRemove">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-delete">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionProfileClear">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWifiRefresh">
|
||||
<property name="icon">
|
||||
<iconset theme="stock-refresh">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionProfileLoad">
|
||||
<property name="icon">
|
||||
<iconset theme="document-open">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionProfileSave">
|
||||
<property name="icon">
|
||||
<iconset theme="document-save">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWifiStart">
|
||||
<property name="icon">
|
||||
<iconset theme="system-run">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start Wi-Fi</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionProfileRemove">
|
||||
<property name="icon">
|
||||
<iconset theme="edit-delete">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNetctlAuto">
|
||||
<property name="text">
|
||||
<string>netctl-auto</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset theme="help-about">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReport">
|
||||
<property name="icon">
|
||||
<iconset theme="tools-report-bug">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Report a bug</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionApi">
|
||||
<property name="text">
|
||||
<string>DBus API reference</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSecurity">
|
||||
<property name="icon">
|
||||
<iconset theme="security-medium">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Security notes</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLibrary">
|
||||
<property name="text">
|
||||
<string>Library documentation</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainSwitch">
|
||||
<property name="icon">
|
||||
<iconset theme="system-run"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Switch to profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMainStopAll">
|
||||
<property name="icon">
|
||||
<iconset theme="process-stop"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop all profiles</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>tableWidget_main</tabstop>
|
||||
<tabstop>pushButton_mainRefresh</tabstop>
|
||||
<tabstop>pushButton_mainRestart</tabstop>
|
||||
<tabstop>pushButton_mainStart</tabstop>
|
||||
<tabstop>scrollArea</tabstop>
|
||||
<tabstop>pushButton_profileClear</tabstop>
|
||||
<tabstop>pushButton_profileSave</tabstop>
|
||||
<tabstop>tableWidget_wifi</tabstop>
|
||||
<tabstop>pushButton_wifiRefresh</tabstop>
|
||||
<tabstop>pushButton_wifiStart</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../resources/resources.qrc"/>
|
||||
|
@ -263,6 +263,10 @@ QMap<QString, QString> SettingsWindow::readSettings()
|
||||
settings[QString("PREFERED_IFACE")] = ui->lineEdit_interface->text();
|
||||
settings[QString("PROFILE_DIR")] = ui->lineEdit_profilePath->text();
|
||||
settings[QString("RFKILL_DIR")] = ui->lineEdit_rfkill->text();
|
||||
if (ui->checkBox_components->checkState() == 2)
|
||||
settings[QString("SKIPCOMPONENTS")] = QString("true");
|
||||
else
|
||||
settings[QString("SKIPCOMPONENTS")] = QString("false");
|
||||
if (ui->checkBox_startToTray->checkState() == 2)
|
||||
settings[QString("STARTTOTRAY")] = QString("true");
|
||||
else
|
||||
@ -319,6 +323,10 @@ void SettingsWindow::setSettings(const QMap<QString, QString> settings)
|
||||
ui->lineEdit_interface->setText(settings[QString("PREFERED_IFACE")]);
|
||||
ui->lineEdit_profilePath->setText(settings[QString("PROFILE_DIR")]);
|
||||
ui->lineEdit_rfkill->setText(settings[QString("RFKILL_DIR")]);
|
||||
if (settings[QString("SKIPCOMPONENTS")] == QString("true"))
|
||||
ui->checkBox_components->setCheckState(Qt::Checked);
|
||||
else
|
||||
ui->checkBox_components->setCheckState(Qt::Unchecked);
|
||||
if (settings[QString("STARTTOTRAY")] == QString("true"))
|
||||
ui->checkBox_startToTray->setCheckState(Qt::Checked);
|
||||
else
|
||||
@ -362,6 +370,7 @@ QMap<QString, QString> SettingsWindow::getDefault()
|
||||
settings[QString("PREFERED_IFACE")] = QString("");
|
||||
settings[QString("PROFILE_DIR")] = QString("/etc/netctl/");
|
||||
settings[QString("RFKILL_DIR")] = QString("/sys/class/rfkill/");
|
||||
settings[QString("SKIPCOMPONENTS")] = QString("false");
|
||||
settings[QString("STARTTOTRAY")] = QString("false");
|
||||
settings[QString("SUDO_PATH")] = QString("/usr/bin/kdesu");
|
||||
settings[QString("SYSTEMCTL_PATH")] = QString("/usr/bin/systemctl");
|
||||
|
@ -180,6 +180,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_components">
|
||||
<property name="text">
|
||||
<string>Skip components checking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_general">
|
||||
<property name="orientation">
|
||||
@ -211,8 +218,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>464</width>
|
||||
<height>336</height>
|
||||
<width>397</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
|
@ -55,6 +55,7 @@ _netctl_gui_settings=(
|
||||
'PREFERED_IFACE'
|
||||
'PROFILE_DIR'
|
||||
'RFKILL_DIR'
|
||||
'SKIPCOMPONENTS'
|
||||
'STARTTOTRAY'
|
||||
'SUDO_PATH'
|
||||
'SYSTEMCTL_PATH'
|
||||
|
@ -39,6 +39,9 @@ PROFILE_DIR=/etc/netctl/
|
||||
# path to directory with rfkill devices.
|
||||
# This option is not recognized by netctlgui-helper
|
||||
RFKILL_DIR=/sys/class/rfkill/
|
||||
# skip external components checking
|
||||
# This option is not recognized by netctlgui-helper
|
||||
SKIPCOMPONENTS=false
|
||||
# start netctl-gui minimized to tray if it is available.
|
||||
# This option is not recognized by netctlgui-helper
|
||||
STARTTOTRAY=false
|
||||
|
@ -70,6 +70,9 @@ path to directory with
|
||||
.BR rfkill (8)
|
||||
devices. This option is not recognized by
|
||||
.BR netctlgui-helper (1)
|
||||
.IP "SKIPCOMPONENTS=false"
|
||||
skip external components checking. This option is not recognized by
|
||||
.BR netctlgui-helper (1)
|
||||
.IP "STARTTOTRAY=false"
|
||||
start
|
||||
.BR netctl-gui (1)
|
||||
|
@ -122,6 +122,7 @@ QMap<QString, QString> NetctlHelper::getDefault()
|
||||
settings[QString("PREFERED_IFACE")] = QString("");
|
||||
settings[QString("PROFILE_DIR")] = QString("/etc/netctl/");
|
||||
settings[QString("RFKILL_DIR")] = QString("/sys/class/rfkill/");
|
||||
settings[QString("SKIPCOMPONENTS")] = QString("false");
|
||||
settings[QString("STARTTOTRAY")] = QString("false");
|
||||
settings[QString("SUDO_PATH")] = QString("/usr/bin/kdesu");
|
||||
settings[QString("SYSTEMCTL_PATH")] = QString("/usr/bin/systemctl");
|
||||
|
Loading…
Reference in New Issue
Block a user