-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialogs.h
More file actions
36 lines (29 loc) · 1.2 KB
/
dialogs.h
File metadata and controls
36 lines (29 loc) · 1.2 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
/////////////////////////////////////////////////////////////////////////////
// Name: dialogs.h
// Purpose: File- and message dialogs header
// Author: Jan Buchholz
// Created: 2025-11-23
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QObject>
#include <QDialog>
#include <QMessageBox>
#include <QMainWindow>
class Dialogs : public QObject {
Q_OBJECT
public:
explicit Dialogs(QWidget *parent = nullptr);
~Dialogs();
QString showOpenFileDialog(QString folder);
QString showSaveFileDialog(QString folder, QString fileName);
int showDialogUnsavedChanges();
void showDialogDisplayError(QString message);
const QString UNTITLED_DOCUMENT = tr("NoName.md");
private:
QMainWindow *mainWindow;
int yesNoCancelDialog(QString title, QString message, QMessageBox::Icon icon);
QString const MSG_WANTSAVE = QObject::tr("Should the changes be saved before closing?\n"
"If you don't save, the changes will be lost.");
QString const FILE_FILTER = QObject::tr("Markdown files (*.md)");
QString const DEFAULT_SUFFIX = ".md";
};