-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
33 lines (28 loc) · 749 Bytes
/
Copy pathmainwindow.cpp
File metadata and controls
33 lines (28 loc) · 749 Bytes
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "filesender.h"
#include "hacker.h"
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
hacker(new Hacker(this))
{
ui->setupUi(this);
connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendFile()));
connect(ui->fileSelectButton, SIGNAL(clicked()), this, SLOT(selectFile()));
}
MainWindow::~MainWindow()
{
delete ui;
delete hacker;
}
void MainWindow::sendFile()
{
hacker->sendFile(ui->file_path_edit->displayText());
}
void MainWindow::selectFile()
{
QString filePath = QFileDialog::getOpenFileName(this, "Select File", "/home/evilsmile");
ui->file_path_edit->setText(filePath);
}