new vault dialog
This commit is contained in:
21
src/mainwindow.cc
Normal file
21
src/mainwindow.cc
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
#include <fstream>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->actionNew, &QAction::triggered, this, [this]() {
|
||||
QString path = QFileDialog::getSaveFileName(this, "Choose vault location",
|
||||
QDir::currentPath(),
|
||||
"Dull Vaults (*.dull)");
|
||||
if (path.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::ofstream file(path.toStdString(), std::ios::binary);
|
||||
file.write("TEST", 4);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user