forked from luebking/qarma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQarma.h
76 lines (68 loc) · 2.6 KB
/
Qarma.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Qarma - a Zenity clone for Qt4 and Qt5
* Copyright 2014 by Thomas Lübking <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef QARMA_H
#define QARMA_H
class QDialog;
class QTreeWidgetItem;
#include <QApplication>
#include <QPair>
class Qarma : public QApplication
{
Q_OBJECT
public:
Qarma(int &argc, char **argv);
enum Type { Invalid, Calendar, Entry, Error, Info, FileSelection, List, Notification, Progress, Question, Warning,
Scale, TextInfo, ColorSelection, FontSelection, Password, Forms };
static void printHelp(const QString &category = QString());
using QApplication::notify;
private:
char showCalendar(const QStringList &args);
char showEntry(const QStringList &args);
char showPassword(const QStringList &args);
char showMessage(const QStringList &args, char type);
char showFileSelection(const QStringList &args);
char showList(const QStringList &args);
char showNotification(const QStringList &args);
char showProgress(const QStringList &args);
char showScale(const QStringList &args);
char showText(const QStringList &args);
char showColorSelection(const QStringList &args);
char showFontSelection(const QStringList &args);
char showForms(const QStringList &args);
bool readGeneral(QStringList &args);
bool error(const QString& message);
void listenToStdIn();
void notify(const QString& message, bool noClose = false);
QString labelText(const QString &s) const; // m_zenity requires \n and \t interpretation in html.
private slots:
void dialogFinished(int status);
void printInteger(int v);
void quitOnError();
void readStdIn();
void toggleItems(QTreeWidgetItem *item, int column);
void finishProgress();
private:
bool m_helpMission, m_modal, m_zenity, m_selectableLabel;
QString m_caption, m_icon, m_ok, m_cancel, m_notificationHints;
QSize m_size;
int m_parentWindow, m_timeout;
uint m_notificationId;
QDialog *m_dialog;
Type m_type;
};
#endif //QARMA_H