mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-13 05:45:50 +00:00
added settings window
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user