2
* This file is part of the KAudioCreator package
3
* Copyright (C) 2003 Benjamin C Meyer (ben+kaudiocreator at meyerhome dot net)
5
* This program 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 2 of the License, or
8
* (at your option) any later version.
10
* This library 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 GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public License
16
* along with this library; see the file COPYING.LIB. If not, write to
17
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#include "encodefileimp.h"
25
#include <qlineedit.h>
26
#include <kurlrequester.h>
27
#include <qcombobox.h>
28
#include <kmessagebox.h>
30
EncodeFileImp::EncodeFileImp(QWidget* parent,
31
const char* name) : EncodeFile(parent, name), m_genres(KCDDB::Genres()) {
32
genre->insertStringList(m_genres.i18nList());
33
// Specify to only accept wav files
34
file->setFilter("*.wav|Wav Files");
38
* When the user presses the encode button create a job with all of the current
39
* selection options and emit a signal with it.
41
void EncodeFileImp::encode(){
42
Job *newJob = new Job();
44
newJob->location = file->url();
46
newJob->album = album->text();
47
newJob->genre = m_genres.i18n2cddb(genre->currentText());
48
if(newJob->genre.isEmpty())
49
newJob->genre = "Pop";
50
newJob->group = artist->text();
51
newJob->comment = comment->text();
52
newJob->year = year->value();
53
newJob->track = track->value();
55
newJob->track_title = track_title->text();
56
newJob->track_artist = track_artist->text();
57
newJob->track_comment = track_comment->text();
59
emit(startJob(newJob));
61
// Same message and *strings* from tracksimp.cpp
63
KMessageBox::information(this,
64
i18n("%1 Job(s) have been started. You can watch their progress in the " \
65
"jobs section.").arg(counter),
66
i18n("Jobs have started"), i18n("Jobs have started"));
70
#include "encodefileimp.moc"