mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-06 18:45:46 +00:00
added profile file
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
|
||||
#include "errorwindow.h"
|
||||
#include "netctlinteract.h"
|
||||
#include "netctlprofile.h"
|
||||
#include "passwdwidget.h"
|
||||
#include "wpasupinteract.h"
|
||||
#include <cstdio>
|
||||
@ -54,6 +55,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
wpaConfig.append(QString("users"));
|
||||
|
||||
netctlCommand = new Netctl(this, netctlPath, profileDir, sudoPath);
|
||||
netctlProfile = new NetctlProfile(this, profileDir, sudoPath);
|
||||
wpaCommand = new WpaSup(this, wpaConfig, sudoPath, ifaceDir, preferedInterface);
|
||||
|
||||
createActions();
|
||||
@ -64,6 +66,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete netctlCommand;
|
||||
delete netctlProfile;
|
||||
delete wpaCommand;
|
||||
delete ui;
|
||||
}
|
||||
@ -127,6 +130,8 @@ void MainWindow::updateTabs(const int tab)
|
||||
{
|
||||
if (tab == 0)
|
||||
updateMainTab();
|
||||
else if (tab == 1)
|
||||
|
||||
else if (tab == 2)
|
||||
updateWifiTab();
|
||||
}
|
||||
@ -174,6 +179,12 @@ void MainWindow::updateMainTab()
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::updateProfileTab()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::updateWifiTab()
|
||||
{
|
||||
wifiTabSetEnabled(checkExternalApps(QString("wpasup")));
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
class ErrorWindow;
|
||||
class Netctl;
|
||||
class NetctlProfile;
|
||||
class PasswdWidget;
|
||||
class WpaSup;
|
||||
|
||||
@ -41,6 +42,7 @@ public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
Netctl *netctlCommand;
|
||||
NetctlProfile *netctlProfile;
|
||||
WpaSup *wpaCommand;
|
||||
enum wpaConfigIndex {
|
||||
wpaCliPath = 0,
|
||||
@ -58,6 +60,7 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void updateMainTab();
|
||||
void updateProfileTab();
|
||||
void updateWifiTab();
|
||||
// main tab slots
|
||||
void mainTabEnableProfile();
|
||||
|
@ -19,17 +19,20 @@
|
||||
#define NETCTLINTERACT_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Netctl : public QWidget
|
||||
class Netctl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Netctl(MainWindow *wid, QString netctlPath, QString profileDir, QString sudoPath);
|
||||
explicit Netctl(MainWindow *wid = 0,
|
||||
QString netctlPath = QString(""),
|
||||
QString profileDir = QString(""),
|
||||
QString sudoPath = QString(""));
|
||||
~Netctl();
|
||||
// general information
|
||||
QList<QStringList> getProfileList();
|
||||
@ -44,7 +47,6 @@ public slots:
|
||||
bool enableProfile(QString profile);
|
||||
bool restartProfile(QString profile);
|
||||
bool startProfile(QString profile);
|
||||
// bool createProfile(QStringList profileInfo);
|
||||
|
||||
private:
|
||||
MainWindow *parent;
|
||||
|
35
sources/gui/src/netctlprofile.cpp
Normal file
35
sources/gui/src/netctlprofile.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
/***************************************************************************
|
||||
* 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 "netctlprofile.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
||||
NetctlProfile::NetctlProfile(MainWindow *wid, QString profileDir, QString sudoPath)
|
||||
: parent(wid),
|
||||
profileDirectory(new QDir(profileDir)),
|
||||
sudoCommand(sudoPath)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
NetctlProfile::~NetctlProfile()
|
||||
{
|
||||
delete profileDirectory;
|
||||
}
|
44
sources/gui/src/netctlprofile.h
Normal file
44
sources/gui/src/netctlprofile.h
Normal file
@ -0,0 +1,44 @@
|
||||
/***************************************************************************
|
||||
* 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 NETCTLPROFILE_H
|
||||
#define NETCTLPROFILE_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class NetctlProfile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NetctlProfile(MainWindow *wid = 0,
|
||||
QString profileDir = QString(""),
|
||||
QString sudoPath = QString(""));
|
||||
~NetctlProfile();
|
||||
|
||||
private:
|
||||
MainWindow *parent;
|
||||
QDir *profileDirectory;
|
||||
QString sudoCommand;
|
||||
};
|
||||
|
||||
|
||||
#endif /* NETCTLPROFILE_H */
|
@ -19,17 +19,21 @@
|
||||
#define WPASUPINTERACT_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class WpaSup : public QWidget
|
||||
class WpaSup : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WpaSup(MainWindow *wid, QStringList wpaConfig, QString sudoPath, QString ifaceDir, QString preferedInterface);
|
||||
explicit WpaSup(MainWindow *wid = 0,
|
||||
QStringList wpaConfig = QStringList(),
|
||||
QString sudoPath = QString(""),
|
||||
QString ifaceDir = QString(""),
|
||||
QString preferedInterface = QString(""));
|
||||
~WpaSup();
|
||||
// general information
|
||||
QStringList getInterfaceList();
|
||||
|
Reference in New Issue
Block a user