58
imageFileFilterLabel(0),
59
movieFileFilterLabel(0),
60
audioFileFilterLabel(0),
61
revertImageFileFilterBtn(0),
62
revertMovieFileFilterBtn(0),
63
revertAudioFileFilterBtn(0),
64
imageFileFilterEdit(0),
65
movieFileFilterEdit(0),
66
audioFileFilterEdit(0)
59
imageFileFilterLabel = 0;
60
movieFileFilterLabel = 0;
61
audioFileFilterLabel = 0;
62
imageFileFilterEdit = 0;
63
movieFileFilterEdit = 0;
64
audioFileFilterEdit = 0;
65
revertImageFileFilterBtn = 0;
66
revertMovieFileFilterBtn = 0;
67
revertAudioFileFilterBtn = 0;
70
70
QLabel* imageFileFilterLabel;
83
83
SetupMime::SetupMime(QWidget* parent)
84
: QScrollArea(parent), d(new SetupMimePriv)
84
: QScrollArea(parent), d(new SetupMimePriv)
86
QWidget *panel = new QWidget(viewport());
86
QWidget* panel = new QWidget(viewport());
88
88
setWidgetResizable(true);
90
QVBoxLayout *layout = new QVBoxLayout(panel);
90
QVBoxLayout* layout = new QVBoxLayout(panel);
92
92
// --------------------------------------------------------
94
QLabel *explanationLabel = new QLabel;
94
QLabel* explanationLabel = new QLabel;
95
95
explanationLabel->setText(i18n("<p>digiKam attempts to support all of the image formats that digital cameras produce, "
96
96
"while being able to handle a few other important video and audio formats.</p> "
97
97
"<p>You can add to the already-appreciable list of formats that digiKam handles by "
101
101
// --------------------------------------------------------
103
QGroupBox *imageFileFilterBox = new QGroupBox(i18n("Image Files"), panel);
103
QGroupBox* imageFileFilterBox = new QGroupBox(i18n("Image Files"), panel);
104
104
QGridLayout* grid1 = new QGridLayout(imageFileFilterBox);
106
QLabel *logoLabel1 = new QLabel(imageFileFilterBox);
106
QLabel* logoLabel1 = new QLabel(imageFileFilterBox);
107
107
logoLabel1->setPixmap(DesktopIcon("image-jp2"));
109
109
d->imageFileFilterLabel = new QLabel(imageFileFilterBox);
110
110
d->imageFileFilterLabel->setText(i18n("Additional &image file extensions (<a href='image'>Currently-supported types</a>):"));
112
KHBox *hbox1 = new KHBox(imageFileFilterBox);
112
KHBox* hbox1 = new KHBox(imageFileFilterBox);
113
113
d->imageFileFilterEdit = new KLineEdit(hbox1);
114
114
d->imageFileFilterEdit->setWhatsThis( i18n("<p>Here you can add the extensions of image files (including RAW files) "
115
"to be displayed in the Album view. Just put \"xyz abc\" "
116
"to display files with the xyz and abc extensions in your Album view.</p>"
117
"<p>You can also remove file formats that are shown by default "
118
"by putting a minus sign in front of the extension: e.g. \"-gif\" would remove all GIF files "
119
"from your Album view and any trace of them in your database. "
120
"They would not be deleted, just not shown in digiKam.</p>"
121
"<p><b>Warning:</b> Removing files from the database means losing "
122
"all of their tags and ratings.</p>"));
115
"to be displayed in the Album view. Just put \"xyz abc\" "
116
"to display files with the xyz and abc extensions in your Album view.</p>"
117
"<p>You can also remove file formats that are shown by default "
118
"by putting a minus sign in front of the extension: e.g. \"-gif\" would remove all GIF files "
119
"from your Album view and any trace of them in your database. "
120
"They would not be deleted, just not shown in digiKam.</p>"
121
"<p><b>Warning:</b> Removing files from the database means losing "
122
"all of their tags and ratings.</p>"));
123
123
d->imageFileFilterLabel->setBuddy(d->imageFileFilterEdit);
124
124
hbox1->setStretchFactor(d->imageFileFilterEdit, 10);
137
137
// --------------------------------------------------------
139
QGroupBox *movieFileFilterBox = new QGroupBox(i18n("Movie Files"), panel);
139
QGroupBox* movieFileFilterBox = new QGroupBox(i18n("Movie Files"), panel);
140
140
QGridLayout* grid2 = new QGridLayout(movieFileFilterBox);
142
QLabel *logoLabel2 = new QLabel(movieFileFilterBox);
142
QLabel* logoLabel2 = new QLabel(movieFileFilterBox);
143
143
logoLabel2->setPixmap(DesktopIcon("video-mpeg"));
145
145
d->movieFileFilterLabel = new QLabel(movieFileFilterBox);
146
146
d->movieFileFilterLabel->setText(i18n("Additional &movie file extensions (<a href='video'>Currently-supported types</a>):"));
148
KHBox *hbox2 = new KHBox(movieFileFilterBox);
148
KHBox* hbox2 = new KHBox(movieFileFilterBox);
149
149
d->movieFileFilterEdit = new KLineEdit(hbox2);
150
150
d->movieFileFilterEdit->setWhatsThis( i18n("<p>Here you can add extra extensions of video files "
151
"to be displayed in your Album view. Just write \"xyz abc\" "
152
"to support files with the *.xyz and *.abc extensions. "
153
"Clicking on these files will "
154
"play them in an embedded KDE movie player.</p>"
155
"<p>You can also remove file formats that are supported by default "
156
"by putting a minus sign in front of the extension: e.g. \"-avi\" would remove "
157
"all AVI files from your Album view and any trace of them in your database. "
158
"They would not be deleted, just not shown in digiKam.</p>"
159
"<p><b>Warning:</b> Removing files from the database means losing "
160
"all of their tags and ratings.</p>"));
151
"to be displayed in your Album view. Just write \"xyz abc\" "
152
"to support files with the *.xyz and *.abc extensions. "
153
"Clicking on these files will "
154
"play them in an embedded KDE movie player.</p>"
155
"<p>You can also remove file formats that are supported by default "
156
"by putting a minus sign in front of the extension: e.g. \"-avi\" would remove "
157
"all AVI files from your Album view and any trace of them in your database. "
158
"They would not be deleted, just not shown in digiKam.</p>"
159
"<p><b>Warning:</b> Removing files from the database means losing "
160
"all of their tags and ratings.</p>"));
161
161
d->movieFileFilterLabel->setBuddy(d->movieFileFilterEdit);
162
162
hbox2->setStretchFactor(d->movieFileFilterEdit, 10);
175
175
// --------------------------------------------------------
177
QGroupBox *audioFileFilterBox = new QGroupBox(i18n("Audio Files"), panel);
177
QGroupBox* audioFileFilterBox = new QGroupBox(i18n("Audio Files"), panel);
178
178
QGridLayout* grid3 = new QGridLayout(audioFileFilterBox);
180
QLabel *logoLabel3 = new QLabel(audioFileFilterBox);
180
QLabel* logoLabel3 = new QLabel(audioFileFilterBox);
181
181
logoLabel3->setPixmap(DesktopIcon("audio-basic"));
183
183
d->audioFileFilterLabel = new QLabel(audioFileFilterBox);
184
184
d->audioFileFilterLabel->setText(i18n("Additional &audio file extensions (<a href='audio'>Currently-supported types</a>):"));
186
KHBox *hbox3 = new KHBox(audioFileFilterBox);
186
KHBox* hbox3 = new KHBox(audioFileFilterBox);
187
187
d->audioFileFilterEdit = new KLineEdit(hbox3);
188
188
d->audioFileFilterEdit->setWhatsThis( i18n("<p>Here you can add extra extensions of audio files "
189
"to be displayed in your Album view. Just write \"mp7\" "
190
"to support files with the *.mp7 extension. "
191
"Clicking on these files will "
192
"play them in an embedded KDE audio player.</p>"
193
"<p>You can also remove file formats that are supported by default "
194
"by putting a minus sign in front of the extension: e.g. \"-ogg\" would "
195
"remove all OGG files from your Album view and any trace of them in your database. "
196
"They would not be deleted, just not shown in digiKam.</p>"
197
"<p><b>Warning:</b> Removing files from the database means losing "
198
"all of their tags and ratings.</p>"));
189
"to be displayed in your Album view. Just write \"mp7\" "
190
"to support files with the *.mp7 extension. "
191
"Clicking on these files will "
192
"play them in an embedded KDE audio player.</p>"
193
"<p>You can also remove file formats that are supported by default "
194
"by putting a minus sign in front of the extension: e.g. \"-ogg\" would "
195
"remove all OGG files from your Album view and any trace of them in your database. "
196
"They would not be deleted, just not shown in digiKam.</p>"
197
"<p><b>Warning:</b> Removing files from the database means losing "
198
"all of their tags and ratings.</p>"));
199
199
d->audioFileFilterLabel->setBuddy(d->audioFileFilterEdit);
200
200
hbox3->setStretchFactor(d->audioFileFilterEdit, 10);
231
231
connect(d->revertAudioFileFilterBtn, SIGNAL(clicked()),
232
232
this, SLOT(slotRevertAudioFileFilter()));
234
connect(d->imageFileFilterLabel, SIGNAL(linkActivated(const QString &)),
234
connect(d->imageFileFilterLabel, SIGNAL(linkActivated(const QString&)),
235
235
this, SLOT(slotShowCurrentImageSettings()));
237
connect(d->movieFileFilterLabel, SIGNAL(linkActivated(const QString &)),
237
connect(d->movieFileFilterLabel, SIGNAL(linkActivated(const QString&)),
238
238
this, SLOT(slotShowCurrentMovieSettings()));
240
connect(d->audioFileFilterLabel, SIGNAL(linkActivated(const QString &)),
240
connect(d->audioFileFilterLabel, SIGNAL(linkActivated(const QString&)),
241
241
this, SLOT(slotShowCurrentAudioSettings()));
243
243
// --------------------------------------------------------
270
270
if (imageFilter.contains('-' + format)
271
271
|| imageFilter.contains("-*." + format))
272
273
removedImageFormats << format;
275
277
if (!removedImageFormats.isEmpty())
277
279
int result = KMessageBox::warningYesNo(this,
278
i18n("<p>You have chosen to remove the following image formats "
279
"from the list of supported formats: <b>%1</b>.</p>"
280
"<p>These are very common formats. If you have images in your collection "
281
"with these formats, they will be removed from the database and you will "
282
"lose all information about them, including rating and tags.</p>"
283
"<p>Are you sure you want to apply your changes and lose the support for these formats?</p>",
284
removedImageFormats.join(" "))
280
i18n("<p>You have chosen to remove the following image formats "
281
"from the list of supported formats: <b>%1</b>.</p>"
282
"<p>These are very common formats. If you have images in your collection "
283
"with these formats, they will be removed from the database and you will "
284
"lose all information about them, including rating and tags.</p>"
285
"<p>Are you sure you want to apply your changes and lose the support for these formats?</p>",
286
removedImageFormats.join(" "))
286
289
if (result != KMessageBox::Yes)
290
295
DatabaseAccess().db()->setUserFilterSettings(d->imageFileFilterEdit->text(),
291
d->movieFileFilterEdit->text(),
292
d->audioFileFilterEdit->text());
296
d->movieFileFilterEdit->text(),
297
d->audioFileFilterEdit->text());
295
300
void SetupMime::readSettings()