source: smplayer/trunk/src/sharewidget.h

Last change on this file was 188, checked in by Silvan Scherrer, 8 years ago

SMPlayer: update trunk to version 17.1.0

File size: 2.0 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19
20#ifndef SHAREWIDGET_H
21#define SHAREWIDGET_H
22
23#include <QWidget>
24#include <QPushButton>
25
26class QSettings;
27class QEvent;
28
29class ShareButton : public QPushButton
30{
31 Q_OBJECT
32
33public:
34 ShareButton(const QString icon_name, const QString & tooltip, QWidget * parent = 0);
35 ~ShareButton() {};
36
37 QSize sizeHint() const;
38
39protected:
40 void enterEvent(QEvent *);
41 void leaveEvent(QEvent *);
42};
43
44
45class ShareWidget : public QWidget
46{
47 Q_OBJECT
48
49public:
50 enum Display { Never = 0, Random = 1, Always = 2 };
51
52 ShareWidget(QSettings * settings, QWidget * parent = 0, Qt::WindowFlags f = 0);
53 ~ShareWidget();
54
55 virtual void setVisible(bool visible);
56
57 void setActions(int a);
58 int actions() { return actions_taken; }
59
60 void loadConfig();
61 void saveConfig();
62
63signals:
64 void supportClicked();
65
66protected:
67 void setActionPerformed(int action);
68 void updateButtons();
69 void retranslateStrings();
70 virtual void changeEvent(QEvent * event);
71
72protected slots:
73 void donate();
74 void facebook();
75 void twitter();
76
77protected:
78 ShareButton * donate_button;
79 ShareButton * fb_button;
80 ShareButton * twitter_button;
81 QPushButton * support_button;
82
83 QSettings * set;
84 int actions_taken;
85 int count;
86 int display;
87};
88
89#endif
90
Note: See TracBrowser for help on using the repository browser.