Skip to content

Commit

Permalink
Delete Wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
procount committed Mar 17, 2022
1 parent af947b7 commit 3f17a29
Show file tree
Hide file tree
Showing 24 changed files with 3,077 additions and 2,942 deletions.
283 changes: 144 additions & 139 deletions recovery/translation_ae.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_ast.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_ca.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_de.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_en.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_es.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_eu.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_fi.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_fr.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_hu.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_it.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_ja.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_ko.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_nl.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_no.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_pl.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_pt.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_ru.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_sv.ts

Large diffs are not rendered by default.

283 changes: 144 additions & 139 deletions recovery/translation_tr.ts

Large diffs are not rendered by default.

288 changes: 144 additions & 144 deletions recovery/translation_zh_TW.ts

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions recovery/wifisettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "wpa_supplicant/wpafactory.h"
#include "twoiconsdelegate.h"
#include "input.h"
#include "util.h"

#include <QMessageBox>
#include <QPushButton>
Expand Down Expand Up @@ -431,3 +432,22 @@ void WifiSettingsDialog::on_checkBox_stateChanged(int arg1)
mode = QLineEdit::Normal;
ui->passwordEdit->setEchoMode(mode);
}

void WifiSettingsDialog::on_pbDelete_clicked()
{
int errorcode;
qDebug() << "Deleting wifi configuration";
readexec(1, "/usr/sbin/wpa_cli -i "+_ifname+" remove_network 0", errorcode);
msleep(500);
readexec(1, "/usr/sbin/wpa_cli -i "+_ifname+" save_config", errorcode);

/* Clear the icon showing the current connection (if any) */
for (int i=0; i< ui->list->count(); i++)
{
QListWidgetItem *wi = ui->list->item(i);
if ( wi->data(SecondIconRole).isValid() )
{
wi->setData(SecondIconRole, QVariant() );
}
}
}
1 change: 1 addition & 0 deletions recovery/wifisettingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private slots:
void on_list_currentItemChanged(QListWidgetItem *current);
void on_vkeyboard_toggled(bool checked);
void on_checkBox_stateChanged(int arg1);
void on_pbDelete_clicked();
};

#endif // WIFISETTINGSDIALOG_H
50 changes: 32 additions & 18 deletions recovery/wifisettingsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>415</height>
<height>480</height>
</rect>
</property>
<property name="font">
Expand Down Expand Up @@ -148,47 +148,61 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<item>
<widget class="QPushButton" name="pbDelete">
<property name="text">
<string>&amp;Delete</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<signal>rejected()</signal>
<receiver>WifiSettingsDialog</receiver>
<slot>accept()</slot>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>325</x>
<y>419</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<signal>accepted()</signal>
<receiver>WifiSettingsDialog</receiver>
<slot>reject()</slot>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>257</x>
<y>419</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<x>157</x>
<y>274</y>
</hint>
</hints>
Expand Down

0 comments on commit 3f17a29

Please sign in to comment.