summaryrefslogtreecommitdiffstats
path: root/khexedit/converterdialog.cc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 12:30:30 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 12:30:30 +0900
commit7ec5a57fc3f04526f36477e22066199372beb0ee (patch)
treef46ff23820fcfbf612070cce46b7496bc766a9fd /khexedit/converterdialog.cc
parent062ea53b46c9b76c78fcde2fb0df8b2411af3f39 (diff)
downloadtdeutils-7ec5a57fc3f04526f36477e22066199372beb0ee.tar.gz
tdeutils-7ec5a57fc3f04526f36477e22066199372beb0ee.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'khexedit/converterdialog.cc')
-rw-r--r--khexedit/converterdialog.cc163
1 files changed, 0 insertions, 163 deletions
diff --git a/khexedit/converterdialog.cc b/khexedit/converterdialog.cc
deleted file mode 100644
index e742e73..0000000
--- a/khexedit/converterdialog.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * khexedit - Versatile hex editor
- * Copyright (C) 1999-2000 Espen Sand, espensa@online.no
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-
-#include <tqlabel.h>
-#include <tqlayout.h>
-
-#include <tdelocale.h>
-
-#include "converterdialog.h"
-#include "hexvalidator.h"
-
-
-CValidateLineEdit::CValidateLineEdit( TQWidget *parent, int validateType,
- const char *name )
- :TQLineEdit( parent, name ), mBusy(false)
-{
- mValidator = new CHexValidator( this, (CHexValidator::EState)validateType );
- setValidator( mValidator );
- connect( this, TQT_SIGNAL(textChanged(const TQString &)),
- this, TQT_SLOT(convertText(const TQString &)) );
-}
-
-
-CValidateLineEdit::~CValidateLineEdit( void )
-{
-}
-
-
-void CValidateLineEdit::setData( const TQByteArray &buf )
-{
- if( mBusy == false )
- {
- TQString text;
- mValidator->format( text, buf );
- setText( text );
- }
-}
-
-
-void CValidateLineEdit::convertText( const TQString &text )
-{
- TQByteArray buf;
- mValidator->convert( buf, text );
- mBusy = true; // Don't update while editing
- emit dataChanged( buf );
- mBusy = false;
-}
-
-
-
-CConverterDialog::CConverterDialog( TQWidget *parent, const char *name,
- bool modal )
- :KDialogBase( parent, name, modal, i18n("Converter"), Cancel|User2|User1,
- Cancel, true, KStdGuiItem::clear(), i18n("&On Cursor") )
-{
- TQWidget *page = new TQWidget( this );
- setMainWidget( page );
-
- TQGridLayout *topLayout = new TQGridLayout( page, 6, 2, 0, spacingHint() );
- topLayout->setRowStretch( 5, 10 );
- topLayout->setColStretch( 1, 10 );
-
- TQLabel *label = new TQLabel( i18n("Hexadecimal:"), page );
- topLayout->addWidget( label, 0, 0 );
- label = new TQLabel( i18n("Decimal:"), page );
- topLayout->addWidget( label, 1, 0 );
- label = new TQLabel( i18n("Octal:"), page );
- topLayout->addWidget( label, 2, 0 );
- label = new TQLabel( i18n("Binary:"), page );
- topLayout->addWidget( label, 3, 0 );
- label = new TQLabel( i18n("Text:"), page );
- topLayout->addWidget( label, 4, 0 );
-
- mHexInput = new CValidateLineEdit( page, CHexValidator::hexadecimal );
- mHexInput->setMinimumWidth( fontMetrics().maxWidth()*17 );
- topLayout->addWidget( mHexInput, 0, 1 );
- mDecInput = new CValidateLineEdit( page, CHexValidator::decimal );
- topLayout->addWidget( mDecInput, 1, 1 );
- mOctInput = new CValidateLineEdit( page, CHexValidator::octal );
- topLayout->addWidget( mOctInput, 2, 1 );
- mBinInput = new CValidateLineEdit( page, CHexValidator::binary );
- topLayout->addWidget( mBinInput, 3, 1 );
- mTxtInput = new CValidateLineEdit( page, CHexValidator::regularText );
- topLayout->addWidget( mTxtInput, 4, 1 );
-
- connect( mHexInput, TQT_SIGNAL(dataChanged(const TQByteArray &)),
- this, TQT_SLOT(setData(const TQByteArray &)) );
- connect( mDecInput, TQT_SIGNAL(dataChanged(const TQByteArray &)),
- this, TQT_SLOT(setData(const TQByteArray &)) );
- connect( mOctInput, TQT_SIGNAL(dataChanged(const TQByteArray &)),
- this, TQT_SLOT(setData(const TQByteArray &)) );
- connect( mBinInput, TQT_SIGNAL(dataChanged(const TQByteArray &)),
- this, TQT_SLOT(setData(const TQByteArray &)) );
- connect( mTxtInput, TQT_SIGNAL(dataChanged(const TQByteArray &)),
- this, TQT_SLOT(setData(const TQByteArray &)) );
-
-}
-
-
-CConverterDialog::~CConverterDialog( void )
-{
-}
-
-
-void CConverterDialog::showEvent( TQShowEvent *e )
-{
- KDialogBase::showEvent(e);
- mHexInput->setFocus();
-}
-
-
-void CConverterDialog::setData( const TQByteArray &data )
-{
- mHexInput->blockSignals(true);
- mDecInput->blockSignals(true);
- mOctInput->blockSignals(true);
- mBinInput->blockSignals(true);
- mTxtInput->blockSignals(true);
- mHexInput->setData(data);
- mDecInput->setData(data);
- mOctInput->setData(data);
- mBinInput->setData(data);
- mTxtInput->setData(data);
- mHexInput->blockSignals(false);
- mDecInput->blockSignals(false);
- mOctInput->blockSignals(false);
- mBinInput->blockSignals(false);
- mTxtInput->blockSignals(false);
-}
-
-void CConverterDialog::slotUser1( void ) // Clear
-{
- TQByteArray buf;
- setData( buf );
-}
-
-void CConverterDialog::slotUser2( void ) // On Cursor
-{
- TQByteArray buf;
- emit probeCursorValue( buf, 1 );
- setData( buf );
-}
-
-
-#include "converterdialog.moc"