• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • gui
  • io
  • streamencoder
  • values
bytearrayvaluesstreamencoderconfigeditor.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Kasten Framework, made within the KDE community.
3 
4  Copyright 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
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.
13 
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.
18 
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/>.
21 */
22 
23 #include "bytearrayvaluesstreamencoderconfigeditor.h"
24 
25 // lib
26 #include "bytearraytextstreamencoderpreview.h"
27 // KDE
28 #include <KLocale>
29 #include <KLineEdit>
30 // #include <KComboBox>
31 // Qt
32 #include <QtGui/QLayout>
33 #include <QtGui/QLabel>
34 
35 
36 namespace Kasten2
37 {
38 
39 ByteArrayValuesStreamEncoderConfigEditor::ByteArrayValuesStreamEncoderConfigEditor( ByteArrayValuesStreamEncoder* encoder, QWidget* parent )
40  : AbstractModelStreamEncoderConfigEditor( parent ),
41  mEncoder( encoder )
42 {
43  mSettings = mEncoder->settings();
44 
45  QGridLayout* pageLayout = new QGridLayout( this ); // unknown rows
46  pageLayout->setMargin( 0 );
47  pageLayout->setColumnStretch( 0, 0 );
48  pageLayout->setColumnStretch( 1, 0 );
49 
50 #if 0
51  // data type
52  QLabel* label = new QLabel( i18n("Value coding:"), this );
53  pageLayout->addWidget( label, 0, 0, Qt::AlignRight);
54 
55  mValueCodingSelect = new KComboBox( this );
56  QStringList list;
57  list.append( i18nc("@item:inmenu encoding of the bytes as values in the hexadecimal format","Hexadecimal") );
58  list.append( i18nc("@item:inmenu encoding of the bytes as values in the decimal format", "Decimal") );
59  list.append( i18nc("@item:inmenu encoding of the bytes as values in the octal format", "Octal") );
60  list.append( i18nc("@item:inmenu encoding of the bytes as values in the binary format", "Binary") );
61  mValueCodingSelect->addItems( list );
62  mValueCodingSelect->setCurrentIndex( mSettings.valueCoding );
63  connect( mValueCodingSelect, SIGNAL(activated(int)), SLOT(onSettingsChanged()) );
64  pageLayout->addWidget( mValueCodingSelect, 0, 1);
65 #endif
66  // separation string
67  QLabel* label = new QLabel( i18nc("@label:textbox substring which separates the values","Separation:"), this );
68  pageLayout->addWidget( label, 0, 0, Qt::AlignRight);
69 
70  mSeparationEdit = new KLineEdit( this );
71  mSeparationEdit->setText( mSettings.separation );
72  connect( mSeparationEdit, SIGNAL(textChanged(QString)), SLOT(onSettingsChanged()) );
73  pageLayout->addWidget( mSeparationEdit, 0, 1);
74 
75 
76  // finish
77  pageLayout->setRowStretch( 2, 10 );
78 }
79 
80 
81 AbstractSelectionView* ByteArrayValuesStreamEncoderConfigEditor::createPreviewView() const
82 {
83  return new ByteArrayTextStreamEncoderPreview( mEncoder );
84 }
85 
86 void ByteArrayValuesStreamEncoderConfigEditor::onSettingsChanged()
87 {
88 // mSettings.valueCoding = (Okteta::ValueCoding) mValueCodingSelect->currentIndex();
89  mSettings.separation = mSeparationEdit->text();
90 
91  mEncoder->setSettings( mSettings );
92 }
93 
94 ByteArrayValuesStreamEncoderConfigEditor::~ByteArrayValuesStreamEncoderConfigEditor()
95 {
96 }
97 
98 }
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::onSettingsChanged
void onSettingsChanged()
Definition: bytearrayvaluesstreamencoderconfigeditor.cpp:86
Kasten2::AbstractSelectionView
Definition: abstractselectionview.h:41
Kasten2::ByteArrayValuesStreamEncoder::setSettings
void setSettings(const ValuesStreamEncoderSettings &settings)
Definition: bytearrayvaluesstreamencoder.h:73
Kasten2::ValuesStreamEncoderSettings::separation
QString separation
Definition: bytearrayvaluesstreamencoder.h:43
QWidget
Kasten2::ByteArrayValuesStreamEncoder
Definition: bytearrayvaluesstreamencoder.h:49
Kasten2::AbstractModelStreamEncoderConfigEditor
Definition: abstractmodelstreamencoderconfigeditor.h:38
bytearrayvaluesstreamencoderconfigeditor.h
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::ByteArrayValuesStreamEncoderConfigEditor
ByteArrayValuesStreamEncoderConfigEditor(ByteArrayValuesStreamEncoder *encoder, QWidget *parent=0)
Definition: bytearrayvaluesstreamencoderconfigeditor.cpp:39
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::createPreviewView
virtual AbstractSelectionView * createPreviewView() const
default returns none
Definition: bytearrayvaluesstreamencoderconfigeditor.cpp:81
bytearraytextstreamencoderpreview.h
Kasten2::ByteArrayTextStreamEncoderPreview
Definition: bytearraytextstreamencoderpreview.h:42
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::mSeparationEdit
KLineEdit * mSeparationEdit
Definition: bytearrayvaluesstreamencoderconfigeditor.h:57
KLineEdit
Kasten2::ByteArrayValuesStreamEncoder::settings
ValuesStreamEncoderSettings settings() const
Definition: bytearrayvaluesstreamencoder.h:72
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::mEncoder
ByteArrayValuesStreamEncoder * mEncoder
Definition: bytearrayvaluesstreamencoderconfigeditor.h:53
Kasten2::ValuesStreamEncoderSettings::valueCoding
Okteta::ValueCoding valueCoding
Definition: bytearrayvaluesstreamencoder.h:42
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::~ByteArrayValuesStreamEncoderConfigEditor
virtual ~ByteArrayValuesStreamEncoderConfigEditor()
Definition: bytearrayvaluesstreamencoderconfigeditor.cpp:94
Kasten2::ByteArrayValuesStreamEncoderConfigEditor::mSettings
ValuesStreamEncoderSettings mSettings
Definition: bytearrayvaluesstreamencoderconfigeditor.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal