2
This file is part of the Kasten Framework, part of the KDE project.
4
Copyright 2010 Friedrich W. H. Kossebau <kossebau@kde.org>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) version 3, or any
10
later version accepted by the membership of KDE e.V. (or its
11
successor approved by the membership of KDE e.V.), which shall
12
act as a proxy defined in Section 6 of version 3 of the license.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
#include "bytearrayuuencodingstreamencoderconfigeditor.h"
26
#include "bytearraytextstreamencoderpreview.h"
32
#include <QtGui/QFormLayout>
33
#include <QtGui/QLabel>
39
ByteArrayUuencodingStreamEncoderConfigEditor::ByteArrayUuencodingStreamEncoderConfigEditor( ByteArrayUuencodingStreamEncoder* encoder, QWidget* parent )
40
: AbstractModelStreamEncoderConfigEditor( parent ),
43
mSettings = mEncoder->settings();
45
QFormLayout* pageLayout = new QFormLayout( this );
46
pageLayout->setMargin( 0 );
49
const QString fileNameLabel =
50
i18nc( "@label:textbox file name internally given to the encoded data",
51
"Internal name of file:" );
53
mFileNameEdit = new KLineEdit( this );
54
mFileNameEdit->setText( mSettings.fileName );
55
connect( mFileNameEdit, SIGNAL(textChanged( const QString& )), SLOT(onSettingsChanged()) );
56
pageLayout->addRow( fileNameLabel, mFileNameEdit );
59
const QString encodingTypeLabel =
60
i18nc( "@label:listbox the type of the used encoding: historical or Base64.",
63
mEncodingSelect = new KComboBox( this );
65
list.append( i18nc("@item:inmenu Doing the uuencoding using the historical encoding",
67
list.append( i18nc("@item:inmenu Doing the uuencoding using the base64 encoding",
69
mEncodingSelect->addItems( list );
70
mEncodingSelect->setCurrentIndex( mSettings.algorithmId );
71
connect( mEncodingSelect, SIGNAL(activated(int)), SLOT(onSettingsChanged()) );
72
pageLayout->addRow( encodingTypeLabel, mEncodingSelect );
75
AbstractSelectionView* ByteArrayUuencodingStreamEncoderConfigEditor::createPreviewView() const
77
return new ByteArrayTextStreamEncoderPreview( mEncoder );
80
void ByteArrayUuencodingStreamEncoderConfigEditor::onSettingsChanged()
82
mSettings.algorithmId = (UuencodingStreamEncoderSettings::AlgorithmId) mEncodingSelect->currentIndex();
83
mSettings.fileName = mFileNameEdit->text();
85
mEncoder->setSettings( mSettings );
88
ByteArrayUuencodingStreamEncoderConfigEditor::~ByteArrayUuencodingStreamEncoderConfigEditor()