2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 2.1.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
19
#ifndef UBUNTUDEVICESWIDGET_H
20
#define UBUNTUDEVICESWIDGET_H
23
#include "ubuntuprocess.h"
26
class UbuntuDevicesWidget;
29
class UbuntuDevicesWidget : public QWidget
34
explicit UbuntuDevicesWidget(QWidget *parent = 0);
35
~UbuntuDevicesWidget();
37
static UbuntuDevicesWidget* instance();
39
bool deviceDetected() { return m_deviceDetected; }
40
QString serialNumber();
44
void updateDeviceActions();
47
void onMessage(QString msg);
48
void onFinished(QString cmd, int code);
49
void onError(QString msg);
50
void onStarted(QString cmd);
52
void on_pushButtonRefresh_clicked();
53
void on_pushButtonRefresh_2_clicked() { on_pushButtonRefresh_clicked(); }
54
void on_pushButtonSshInstall_clicked();
55
void on_pushButtonSshRemove_clicked();
56
void on_pushButtonSshSetupPublicKey_clicked();
57
void on_pushButtonPortForward_clicked();
58
void on_pushButtonSshConnect_clicked();
59
void on_pushButtonReboot_clicked();
60
void on_pushButtonShutdown_clicked();
61
void on_pushButtonRebootToBootloader_clicked();
62
void on_pushButtonRebootToRecovery_clicked();
63
void on_pushButtonUpgradeToDailyImage_clicked();
64
void on_pushButtonUpgradeToDailyImageWithBootstrap_clicked();
65
void on_pushButtonCloneNetworkConfig_clicked();
66
void on_pushButtonCloneTimeConfig_clicked();
67
void on_pushButtonCloneNetworkConfig_2_clicked() { on_pushButtonCloneNetworkConfig_clicked(); }
68
void on_comboBoxSerialNumber_currentIndexChanged( const QString & text );
72
void detectHasNetworkConnection();
73
void detectDeviceVersion();
76
void beginAction(QString);
77
void endAction(QString);
79
Ui::UbuntuDevicesWidget *ui;
81
Ubuntu::Internal::UbuntuProcess m_ubuntuProcess;
85
bool m_deviceDetected;
86
QString m_deviceSerialNumber;
88
static UbuntuDevicesWidget *m_instance;
92
#endif // UBUNTUDEVICESWIDGET_H