• 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
  • ihex
bytearrayihexstreamencoderconfigeditor.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 2010 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 "bytearrayihexstreamencoderconfigeditor.h"
24 
25 // lib
26 #include "bytearraytextstreamencoderpreview.h"
27 // KDE
28 #include <KLocale>
29 #include <KComboBox>
30 // Qt
31 #include <QtGui/QFormLayout>
32 #include <QtGui/QLabel>
33 
34 
35 namespace Kasten2
36 {
37 
38 ByteArrayIHexStreamEncoderConfigEditor::ByteArrayIHexStreamEncoderConfigEditor( ByteArrayIHexStreamEncoder* encoder, QWidget* parent )
39  : AbstractModelStreamEncoderConfigEditor( parent ),
40  mEncoder( encoder )
41 {
42  mSettings = mEncoder->settings();
43 
44  QFormLayout* pageLayout = new QFormLayout( this );
45  pageLayout->setMargin( 0 );
46 
47  // data type
48  const QString addressSizeLabel =
49  i18nc( "@label:listbox the size in bits of the addresses.",
50  "Address size:" );
51 
52  mAddressSizeSelect = new KComboBox( this );
53  // keep order in sync with IHexStreamEncoderSettings::AddressSizeId
54  QStringList addressSizeList;
55  addressSizeList
56  << i18nc("@item:inmenu address size",
57  "32-bit")
58  << i18nc("@item:inmenu address size",
59  "16-bit")
60  << i18nc("@item:inmenu address size",
61  "8-bit");
62  mAddressSizeSelect->addItems( addressSizeList );
63  mAddressSizeSelect->setCurrentIndex( mSettings.addressSizeId );
64  connect( mAddressSizeSelect, SIGNAL(activated(int)), SLOT(onSettingsChanged()) );
65  pageLayout->addRow( addressSizeLabel, mAddressSizeSelect );
66 }
67 
68 
69 AbstractSelectionView* ByteArrayIHexStreamEncoderConfigEditor::createPreviewView() const
70 {
71  return new ByteArrayTextStreamEncoderPreview( mEncoder );
72 }
73 
74 void ByteArrayIHexStreamEncoderConfigEditor::onSettingsChanged()
75 {
76  mSettings.addressSizeId = (IHexStreamEncoderSettings::AddressSizeId) mAddressSizeSelect->currentIndex();
77 
78  mEncoder->setSettings( mSettings );
79 }
80 
81 ByteArrayIHexStreamEncoderConfigEditor::~ByteArrayIHexStreamEncoderConfigEditor()
82 {
83 }
84 
85 }
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::onSettingsChanged
void onSettingsChanged()
Definition: bytearrayihexstreamencoderconfigeditor.cpp:74
Kasten2::AbstractSelectionView
Definition: abstractselectionview.h:41
bytearrayihexstreamencoderconfigeditor.h
QWidget
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::~ByteArrayIHexStreamEncoderConfigEditor
virtual ~ByteArrayIHexStreamEncoderConfigEditor()
Definition: bytearrayihexstreamencoderconfigeditor.cpp:81
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::mAddressSizeSelect
KComboBox * mAddressSizeSelect
Definition: bytearrayihexstreamencoderconfigeditor.h:55
Kasten2::AbstractModelStreamEncoderConfigEditor
Definition: abstractmodelstreamencoderconfigeditor.h:38
Kasten2::IHexStreamEncoderSettings::addressSizeId
AddressSizeId addressSizeId
Definition: bytearrayihexstreamencoder.h:47
bytearraytextstreamencoderpreview.h
Kasten2::ByteArrayTextStreamEncoderPreview
Definition: bytearraytextstreamencoderpreview.h:42
Kasten2::IHexStreamEncoderSettings::AddressSizeId
AddressSizeId
Definition: bytearrayihexstreamencoder.h:42
Kasten2::ByteArrayIHexStreamEncoder
Definition: bytearrayihexstreamencoder.h:51
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::ByteArrayIHexStreamEncoderConfigEditor
ByteArrayIHexStreamEncoderConfigEditor(ByteArrayIHexStreamEncoder *encoder, QWidget *parent=0)
Definition: bytearrayihexstreamencoderconfigeditor.cpp:38
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::mSettings
IHexStreamEncoderSettings mSettings
Definition: bytearrayihexstreamencoderconfigeditor.h:53
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::createPreviewView
virtual AbstractSelectionView * createPreviewView() const
default returns none
Definition: bytearrayihexstreamencoderconfigeditor.cpp:69
Kasten2::ByteArrayIHexStreamEncoderConfigEditor::mEncoder
ByteArrayIHexStreamEncoder * mEncoder
Definition: bytearrayihexstreamencoderconfigeditor.h:52
Kasten2::ByteArrayIHexStreamEncoder::settings
IHexStreamEncoderSettings settings() const
Definition: bytearrayihexstreamencoder.h:107
Kasten2::ByteArrayIHexStreamEncoder::setSettings
void setSettings(const IHexStreamEncoderSettings &settings)
Definition: bytearrayihexstreamencoder.h:108
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