blob: a6b6482f426a119509ace3bb4dde70a8722b468e (
plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
//-*-C++-*-
/*
**************************************************************************
description
--------------------
copyright : (C) 2001 by Andreas Zehender
email : zehender@kde.org
**************************************************************************
**************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
**************************************************************************/
#ifndef PMRENDERMODESDIALOG_H
#define PMRENDERMODESDIALOG_H
#include "pmrendermode.h"
#include <kdialogbase.h>
class QCheckBox;
class QComboBox;
class QLineEdit;
class QListBox;
class QPushButton;
class QTabWidget;
class KConfig;
class PMIntEdit;
class PMFloatEdit;
/**
* Dialog for editing a list of render modes.
* @see PMRenderMode
*/
class PMRenderModesDialog : public KDialogBase
{
Q_OBJECT
public:
/**
* Creates a dialog for the modes list
*/
PMRenderModesDialog( PMRenderModeList* modes, QWidget* parent = 0, const char* name = 0 );
static void saveConfig( KConfig* cfg );
static void restoreConfig( KConfig* cfg );
protected slots:
/**
* Called when a mode is selected in the list view
*/
void slotModeSelected( int index );
/**
* Called when the add button is klicked
*/
void slotAdd( );
/**
* Called when the remove button is klicked
*/
void slotRemove( );
/**
* Called when the up button is klicked
*/
void slotUp( );
/**
* Called when the down button is klicked
*/
void slotDown( );
/**
* Called when the edit button is klicked
*/
void slotEdit( );
/**
* Called when the modes are changed
*/
void slotChanged( );
virtual void slotOk( );
protected:
virtual void resizeEvent( QResizeEvent* ev );
private:
void displayList( );
void checkButtons( );
PMRenderModeList* m_pOriginalModes;
PMRenderModeList m_workingModes;
int m_selectionIndex;
QListBox* m_pListBox;
QPushButton* m_pAddButton;
QPushButton* m_pRemoveButton;
QPushButton* m_pUpButton;
QPushButton* m_pDownButton;
QPushButton* m_pEditButton;
static QSize s_size;
};
/**
* Dialog for editing one render mode
* @see PMRenderMode
*/
class PMRenderModeDialog : public KDialogBase
{
Q_OBJECT
public:
/**
* Creates a dialog for the mode
*/
PMRenderModeDialog( PMRenderMode* mode, QWidget* parent = 0, const char* name = 0 );
static void saveConfig( KConfig* cfg );
static void restoreConfig( KConfig* cfg );
protected:
virtual void resizeEvent( QResizeEvent* ev );
protected slots:
virtual void slotOk( );
void slotChanged( );
void slotTextChanged( const QString& );
void slotActivated( int );
void slotSubsectionToggled( bool );
void slotAntialiasingToggled( bool );
void slotJitterToggled( bool );
void slotToggled( bool );
private:
/**
* Saves the current changes. Returns true if successful.
*/
bool saveChanges( );
/**
* Returns true if the data is valid
*/
bool validate( );
/**
* Displays the selected mode
*/
void displayMode( );
void enableSubsection( bool yes );
void enableAntialiasing( bool yes );
void enableJitter( bool yes );
int qualityToIndex( int quality );
int indexToQuality( int index );
PMRenderMode* m_pMode;
QTabWidget* m_pTabWidget;
QLineEdit* m_pDescriptionEdit;
PMIntEdit* m_pHeightEdit;
PMIntEdit* m_pWidthEdit;
QCheckBox* m_pSubsectionBox;
PMFloatEdit* m_pStartRowEdit;
PMFloatEdit* m_pEndRowEdit;
PMFloatEdit* m_pStartColumnEdit;
PMFloatEdit* m_pEndColumnEdit;
// quality
QComboBox* m_pQualityCombo;
QCheckBox* m_pRadiosityBox;
QCheckBox* m_pAntialiasingBox;
QComboBox* m_pSamplingCombo;
PMFloatEdit* m_pThresholdEdit;
QCheckBox* m_pJitterBox;
PMFloatEdit* m_pJitterAmountEdit;
PMIntEdit* m_pAntialiasDepthEdit;
// output
QCheckBox* m_pAlphaBox;
static QSize s_size;
};
#endif
|