diff --git a/sources/gui/src/passwdwidget.cpp b/sources/gui/src/passwdwidget.cpp index d6ed51a..dd8623c 100644 --- a/sources/gui/src/passwdwidget.cpp +++ b/sources/gui/src/passwdwidget.cpp @@ -27,12 +27,16 @@ PasswdWidget::PasswdWidget(MainWindow *wid) ui(new Ui::PasswdWidget) { ui->setupUi(this); + okButton = ui->buttonBox->button(QDialogButtonBox::Ok); + cancelButton = ui->buttonBox->button(QDialogButtonBox::Cancel); createActions(); } PasswdWidget::~PasswdWidget() { + delete cancelButton; + delete okButton; delete ui; } @@ -40,18 +44,16 @@ PasswdWidget::~PasswdWidget() // ESC press event void PasswdWidget::keyPressEvent(QKeyEvent *pressedKey) { - if (pressedKey->key() == Qt::Key_Escape) { - hide(); - parent->updateTabs(2); - this->~PasswdWidget(); - } + if (pressedKey->key() == Qt::Key_Escape) + cancel(); } void PasswdWidget::createActions() { connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(passwdApply())); - connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(passwdApply())); + connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(cancel())); + connect(okButton, SIGNAL(clicked(bool)), this, SLOT(passwdApply())); } @@ -61,6 +63,14 @@ void PasswdWidget::setFocusToLineEdit() } +void PasswdWidget::cancel() +{ + hide(); + parent->updateTabs(2); + this->~PasswdWidget(); +} + + void PasswdWidget::passwdApply() { hide(); diff --git a/sources/gui/src/passwdwidget.h b/sources/gui/src/passwdwidget.h index 3516f01..fa9ef44 100644 --- a/sources/gui/src/passwdwidget.h +++ b/sources/gui/src/passwdwidget.h @@ -19,6 +19,7 @@ #define PASSWDWIDGET_H #include +#include #include @@ -40,11 +41,14 @@ public slots: void setFocusToLineEdit(); private slots: + void cancel(); void passwdApply(); private: MainWindow *parent; Ui::PasswdWidget *ui; + QPushButton *cancelButton; + QPushButton *okButton; // ESC pressed event void keyPressEvent(QKeyEvent *pressedKey); void createActions(); diff --git a/sources/gui/src/passwdwidget.ui b/sources/gui/src/passwdwidget.ui index 8f46269..d1ecb97 100644 --- a/sources/gui/src/passwdwidget.ui +++ b/sources/gui/src/passwdwidget.ui @@ -80,9 +80,9 @@ - - - Ok + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/sources/gui/src/settingswindow.cpp b/sources/gui/src/settingswindow.cpp new file mode 100644 index 0000000..c614407 --- /dev/null +++ b/sources/gui/src/settingswindow.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * This file is part of netctl-plasmoid * + * * + * netctl-plasmoid is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * netctl-plasmoid is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with netctl-plasmoid. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#include "settingswindow.h" +#include "ui_settingswindow.h" + + +SettingsWindow::SettingsWindow(QWidget *parent) + : QMainWindow(parent), + ui(new Ui::SettingsWindow) +{ + ui->setupUi(this); +} + + +SettingsWindow::~SettingsWindow() +{ + delete ui; +} diff --git a/sources/gui/src/settingswindow.h b/sources/gui/src/settingswindow.h new file mode 100644 index 0000000..a18accf --- /dev/null +++ b/sources/gui/src/settingswindow.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * This file is part of netctl-plasmoid * + * * + * netctl-plasmoid is free software: you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * netctl-plasmoid is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with netctl-plasmoid. If not, see http://www.gnu.org/licenses/ * + ***************************************************************************/ + +#ifndef SETTINGSWINDOW_H +#define SETTINGSWINDOW_H + +#include + + +namespace Ui { +class SettingsWindow; +} + +class SettingsWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit SettingsWindow(QWidget *parent = 0); + ~SettingsWindow(); + +private: + Ui::SettingsWindow *ui; +}; + + +#endif /* SETTINGSWINDOW_H */ diff --git a/sources/gui/src/settingswindow.ui b/sources/gui/src/settingswindow.ui new file mode 100644 index 0000000..6396893 --- /dev/null +++ b/sources/gui/src/settingswindow.ui @@ -0,0 +1,502 @@ + + + SettingsWindow + + + + 0 + 0 + 461 + 287 + + + + Settings + + + + + + + 0 + + + + General + + + + + + + + Language + + + + + + + Select a language + + + + + + + + + You will need to restart the application + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + netctl + + + + + + + + + 150 + 0 + + + + netctl path + + + + + + + Path to netctl + + + + + + + Browse + + + + + + + + + + + + 150 + 0 + + + + Profile path + + + + + + + Path to profile directory + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + sudo + + + + + + + + + 150 + 0 + + + + sudo path + + + + + + + Path to sudo + + + + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 192 + + + + + + + + + wpa_supplicant + + + + + + + + + 150 + 0 + + + + wpa_supplicant path + + + + + + + Path to wpa_supplicant + + + + + + + Browse + + + + + + + + + + + + 150 + 0 + + + + wpa_cli path + + + + + + + Path to wpa_cli + + + + + + + Browse + + + + + + + + + + + + 150 + 0 + + + + PID file + + + + + + + wpa_supplicant PID file + + + + + + + + + + + + 150 + 0 + + + + wpa_supplicant drivers + + + + + + + wpa_supplicant drivers comma separated + + + + + + + + + + + + 150 + 0 + + + + ctrl_interface directory + + + + + + + Path to control directory + + + + + + + + + + + + 150 + 0 + + + + ctrl_interface group + + + + + + + Group of control directory + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Other + + + + + + + + + 150 + 0 + + + + Path to interface list + + + + + + + Path to directory which contains network devices + + + + + + + Browse + + + + + + + + + + + + 150 + 0 + + + + Path to rfkill device list + + + + + + + Path to directory which contains rfkill devices + + + + + + + Browse + + + + + + + + + + + + 150 + 0 + + + + Prefered wireless interface + + + + + + + Prefered wireless interface + + + + + + + + + Qt::Vertical + + + + 20 + 130 + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + +