#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'ksettingsgpgdecl.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "ksettingsgpgdecl.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <keditlistbox.h>
#include <kled.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a KSettingsGpgDecl as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KSettingsGpgDecl::KSettingsGpgDecl( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "KSettingsGpgDecl" );
    KSettingsGpgDeclLayout = new TQVBoxLayout( this, 11, 6, "KSettingsGpgDeclLayout"); 

    kcfg_WriteDataEncrypted = new TQCheckBox( this, "kcfg_WriteDataEncrypted" );
    KSettingsGpgDeclLayout->addWidget( kcfg_WriteDataEncrypted );

    m_idGroup = new TQGroupBox( this, "m_idGroup" );
    m_idGroup->setEnabled( true );
    m_idGroup->setColumnLayout(0, TQt::Vertical );
    m_idGroup->layout()->setSpacing( 6 );
    m_idGroup->layout()->setMargin( 11 );
    m_idGroupLayout = new TQVBoxLayout( m_idGroup->layout() );
    m_idGroupLayout->setAlignment( TQt::AlignTop );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 

    textLabel1_2 = new TQLabel( m_idGroup, "textLabel1_2" );
    layout3->addWidget( textLabel1_2 );

    m_masterKeyCombo = new KComboBox( false, m_idGroup, "m_masterKeyCombo" );
    m_masterKeyCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 1, 0, m_masterKeyCombo->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( m_masterKeyCombo );
    m_idGroupLayout->addLayout( layout3 );

    kcfg_GpgRecipient = new KLineEdit( m_idGroup, "kcfg_GpgRecipient" );
    m_idGroupLayout->addWidget( kcfg_GpgRecipient );

    kcfg_GpgRecipientList = new KEditListBox( m_idGroup, "kcfg_GpgRecipientList" );
    kcfg_GpgRecipientList->setCheckable( false );
    kcfg_GpgRecipientList->setButtons( int( KEditListBox::Remove | KEditListBox::Add ) );
    m_idGroupLayout->addWidget( kcfg_GpgRecipientList );

    layout6 = new TQHBoxLayout( 0, 0, 6, "layout6"); 

    m_userKeysFound = new KLed( m_idGroup, "m_userKeysFound" );
    m_userKeysFound->setShape( KLed::Circular );
    m_userKeysFound->setLook( KLed::Sunken );
    layout6->addWidget( m_userKeysFound );

    textLabel1 = new TQLabel( m_idGroup, "textLabel1" );
    layout6->addWidget( textLabel1 );
    spacer3 = new TQSpacerItem( 50, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout6->addItem( spacer3 );
    m_idGroupLayout->addLayout( layout6 );

    layout5 = new TQHBoxLayout( 0, 0, 6, "layout5"); 

    m_recoverKeyFound = new KLed( m_idGroup, "m_recoverKeyFound" );
    m_recoverKeyFound->setShape( KLed::Circular );
    m_recoverKeyFound->setLook( KLed::Sunken );
    layout5->addWidget( m_recoverKeyFound );

    textLabel2 = new TQLabel( m_idGroup, "textLabel2" );
    layout5->addWidget( textLabel2 );
    spacer6 = new TQSpacerItem( 16, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer6 );
    m_idGroupLayout->addLayout( layout5 );

    kcfg_EncryptRecover = new TQCheckBox( m_idGroup, "kcfg_EncryptRecover" );
    m_idGroupLayout->addWidget( kcfg_EncryptRecover );
    KSettingsGpgDeclLayout->addWidget( m_idGroup );
    spacer5 = new TQSpacerItem( 21, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    KSettingsGpgDeclLayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(601, 418).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

/*
 *  Destroys the object and frees any allocated resources
 */
KSettingsGpgDecl::~KSettingsGpgDecl()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSettingsGpgDecl::languageChange()
{
    setCaption( tr2i18n( "GPG encryption settings" ) );
    TQWhatsThis::add( this, tr2i18n( "This page allows you to set the parameters for encrypted file storage of your <b>KMyMoney</b> data based on <b>GPG</b>.<p>\n"
"Access to the settings is disabled if <b>GPG</b> could not be detected on your system. In this case, please make sure that <b>GPG</b> is working properly for the current user.<p>\n"
"The <i>additional recovery encryption</i> is only accessible, if the necessary key for <b>kmymoney-recover@users.sourceforge.net</b> with id 0x8AFDDC8E is found in your keyring." ) );
    kcfg_WriteDataEncrypted->setText( tr2i18n( "Use GPG encryption" ) );
    m_idGroup->setTitle( tr2i18n( "GPG encryption" ) );
    textLabel1_2->setText( tr2i18n( "Your key" ) );
    TQWhatsThis::add( m_masterKeyCombo, tr2i18n( "This combo box lists all the secret keys you have in your keyring. Select the one you want to use for encryption when saving to a file." ) );
    kcfg_GpgRecipientList->setTitle( tr2i18n( "Additonal keys" ) );
    TQWhatsThis::add( kcfg_GpgRecipientList, tr2i18n( "Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id don't forget the leading 0x." ) );
    TQWhatsThis::add( m_userKeysFound, tr2i18n( "This symbol denotes, if the key for the given user id has been found in your keyring. It is green when found, dark otherwise." ) );
    textLabel1->setText( tr2i18n( "Keys for all of the above user ids found" ) );
    TQWhatsThis::add( m_recoverKeyFound, tr2i18n( "This symbol denotes, if the KMyMoney recovery key has been found in your keyring. It is green when found, dark otherwise." ) );
    textLabel2->setText( tr2i18n( "Recover Key available in keyring" ) );
    kcfg_EncryptRecover->setText( tr2i18n( "Also encrypt with KMyMoney's recover key" ) );
    TQWhatsThis::add( kcfg_EncryptRecover, tr2i18n( "You can specify to encrypt the data also with the KMyMoney recover key. Only the core KMyMoney developers are in posession of the respective private key required to read back such encrypted data.<p>\n"
"\n"
"This mechanism is provided for the case that you have lost your key and cannot access your data anymore. With this option activated, the KMyMoney developers can decrypt the data and supply you with it in a readable form. Please be prepared, that you have to answer a few detailed questions about the contents of your data before we will send it out.." ) );
}

/****************************************************************************
** KSettingsGpgDecl meta object code from reading C++ file 'ksettingsgpgdecl.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "ksettingsgpgdecl.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *KSettingsGpgDecl::className() const
{
    return "KSettingsGpgDecl";
}

TQMetaObject *KSettingsGpgDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KSettingsGpgDecl( "KSettingsGpgDecl", &KSettingsGpgDecl::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString KSettingsGpgDecl::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "KSettingsGpgDecl", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString KSettingsGpgDecl::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "KSettingsGpgDecl", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* KSettingsGpgDecl::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KSettingsGpgDecl", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KSettingsGpgDecl.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* KSettingsGpgDecl::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "KSettingsGpgDecl" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool KSettingsGpgDecl::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool KSettingsGpgDecl::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool KSettingsGpgDecl::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool KSettingsGpgDecl::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
