new vault dialog

This commit is contained in:
2025-11-02 15:49:34 +01:00
parent 44022caf90
commit 75b41c49bb
5 changed files with 51 additions and 29 deletions

21
src/mainwindow.cc Normal file
View 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);
});
}