-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
72 lines (59 loc) · 2.37 KB
/
mainwindow.cpp
File metadata and controls
72 lines (59 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <libudev.h>
#include <unistd.h>
#include <QSettings>
#define SHELLSCRIPT "\
while true\
do\
cat /tmp/psplash.txt | awk '{print $2}'\
sleep 0.1\
done\
"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
setFixedSize(800,480);
ui->centralwidget->setLayout(new QVBoxLayout());
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "burne");
QString path;
if (!settings.contains("path")) {
path = getenv("HOME");
settings.setValue("path",path);
} else {
path = settings.value("path").toString();
}
/*path.append("/taos/build/tmp-glibc/deploy/images");
//path.append("/taos");
if (!system("ping -c 1 -w 1 taos > /dev/null")){
qInfo("%s", path.toLocal8Bit().toStdString().c_str());
qInfo("%s", (QString("sshfs taos:/build/alex/st/stm32mp/poky ") + getenv("HOME") + "/taos -o allow_root").toLocal8Bit().toStdString().c_str());
system((QString("sshfs taos:/build/alex/st/stm32mp/poky ") + getenv("HOME") + "/taos -o allow_root").toLocal8Bit().toStdString().c_str());
qInfo("successful");
}else{
qInfo("not successful");
}*/
bStack = new ButtonStack();
filesAndBmap = new FilesAndBmap(path,bStack);
connect(bStack->getFlashButton(),&QPushButton::clicked,filesAndBmap,&FilesAndBmap::flash);
connect(bStack->getBackButton(),&QPushButton::clicked,filesAndBmap,&FilesAndBmap::back);
filters = new Filters();
connect(filters->getImgFilter(),&QPushButton::toggled,filesAndBmap,&FilesAndBmap::filterImg);
connect(filters->getWicFilter(),&QPushButton::toggled,filesAndBmap,&FilesAndBmap::filterWic);
connect(filters->getDisksComboBox(), &QComboBox::textActivated, filesAndBmap, &FilesAndBmap::setBlockDevice);
ui->centralwidget->layout()->addWidget(filters);
ui->centralwidget->layout()->addWidget(filesAndBmap);
ui->centralwidget->layout()->addWidget(bStack);
}
MainWindow::~MainWindow()
{
//qInfo("%s", (QString("umount ") + getenv("HOME") + "/taos").toLocal8Bit().toStdString().c_str());
//system((QString("umount ") + getenv("HOME") + "/taos").toLocal8Bit().toStdString().c_str());
delete bStack;
delete filesAndBmap;
delete filters;
delete layout();
delete ui;
}