checkpoint: manage parsing, persistence, mainwindow structure
This commit is contained in:
+24
-5
@@ -1,13 +1,32 @@
|
||||
#include "mainwindow.h"
|
||||
#include "service.h"
|
||||
#include "sessionslistmodel.h"
|
||||
#include <QFileDialog>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), m_service(new Service(this))
|
||||
{
|
||||
QWidget *centralWidget = new QWidget(this);
|
||||
QLabel *label = new QLabel(centralWidget);
|
||||
label->setText("Let's get some stuff done!");
|
||||
ui = new Ui::MainWindow;
|
||||
ui->setupUi(this);
|
||||
|
||||
setCentralWidget(centralWidget);
|
||||
m_listModel = new SessionsListModel(m_service, this);
|
||||
ui->listView->setModel(m_listModel);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {}
|
||||
|
||||
void MainWindow::on_selectVaultButton_clicked()
|
||||
{
|
||||
QString dir = QFileDialog::getExistingDirectory(this,
|
||||
"Select Directory",
|
||||
QDir::homePath(),
|
||||
QFileDialog::ShowDirsOnly);
|
||||
if (!dir.isEmpty()) {
|
||||
m_service->setVaultDirectory(dir);
|
||||
ui->tabWidget->setCurrentIndex(1);
|
||||
ui->vaultLabel->setText(m_service->vaultDirectory());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user