Qmmp
Loading...
Searching...
No Matches
templateeditor.h
1/***************************************************************************
2 * Copyright (C) 2010-2022 by Ilya Kotov *
3 * forkotov02@ya.ru *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20
21#ifndef TEMPLATEEDITOR_H
22#define TEMPLATEEDITOR_H
23
24#include <QDialog>
25#include "qmmpui_export.h"
26
27namespace Ui {
28 class TemplateEditor;
29}
30
34class QMMPUI_EXPORT TemplateEditor : public QDialog
35{
36Q_OBJECT
37public:
42 explicit TemplateEditor(QWidget *parent = nullptr);
46 QString currentTemplate() const;
50 void setTemplate(const QString &text = QString());
55 void setDefaultTemplate(const QString &text);
64 static QString getTemplate (QWidget *parent, const QString &title, const QString &text = QString(),
65 const QString &default_template = QString(), bool *ok = nullptr);
66
67private slots:
68 void on_resetButton_clicked();
69
70private:
71 void createMenu();
72 Ui::TemplateEditor *m_ui;
73 QString m_defaultTemplate;
74
75};
76
77#endif // TEMPLATEEDITOR_H
The TemplateEditor class provides simple template editor dialog.
Definition templateeditor.h:35
static QString getTemplate(QWidget *parent, const QString &title, const QString &text=QString(), const QString &default_template=QString(), bool *ok=nullptr)
QString currentTemplate() const
TemplateEditor(QWidget *parent=nullptr)
void setDefaultTemplate(const QString &text)
void setTemplate(const QString &text=QString())