1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2012 Leo Franchi <lfranchi@kde.org>
5
* Tomahawk 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 3 of the License, or
8
* (at your option) any later version.
10
* Tomahawk 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.
15
* You should have received a copy of the GNU General Public License
16
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef SOURCETREE_POPUP_DIALOG
20
#define SOURCETREE_POPUP_DIALOG
31
class QDialogButtonBox;
37
* Place me at offset() to the left of the right edge of the sourcetree.
39
class DLLEXPORT SourceTreePopupDialog : public QWidget
43
explicit SourceTreePopupDialog();
45
int offset() const { return 16; }
47
void setTitle( const QString& text );
48
void setMainText( const QString& text );
49
void setOkButtonText( const QString& text );
50
void setExtraQuestions( const Tomahawk::PlaylistDeleteQuestions& questions );
52
bool resultValue() const { return m_result; }
53
QMap< int, bool > questionResults() const { return m_questionResults; }
56
void result( bool accepted );
59
virtual void paintEvent( QPaintEvent* );
60
virtual void focusOutEvent( QFocusEvent* );
61
virtual void showEvent( QShowEvent* );
68
void calculateResults();
70
QVBoxLayout* m_layout;
71
QList< QCheckBox* > m_questionCheckboxes;
74
Tomahawk::PlaylistDeleteQuestions m_questions;
75
QMap< int, bool > m_questionResults;
78
QWidget* m_separatorLine;
80
QDialogButtonBox* m_buttons;
84
Q_DECLARE_METATYPE( SourceTreePopupDialog* )