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

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

#include "ksplittransactiondlgdecl.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "../dialogs/kmymoneysplittable.h"

/*
 *  Constructs a KSplitTransactionDlgDecl as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
KSplitTransactionDlgDecl::KSplitTransactionDlgDecl( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KSplitTransactionDlgDecl" );
    setSizeGripEnabled( true );
    KSplitTransactionDlgDeclLayout = new TQHBoxLayout( this, 11, 6, "KSplitTransactionDlgDeclLayout"); 

    Layout61 = new TQVBoxLayout( 0, 0, 6, "Layout61"); 

    transactionsTable = new kMyMoneySplitTable( this, "transactionsTable" );
    transactionsTable->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 5, transactionsTable->sizePolicy().hasHeightForWidth() ) );
    transactionsTable->setCursor( TQCursor( 0 ) );
    Layout61->addWidget( transactionsTable );

    m_sumFrame = new TQFrame( this, "m_sumFrame" );
    m_sumFrame->setFrameShape( TQFrame::StyledPanel );
    m_sumFrame->setFrameShadow( TQFrame::Raised );
    m_sumFrameLayout = new TQHBoxLayout( m_sumFrame, 1, 6, "m_sumFrameLayout"); 
    Spacer12 = new TQSpacerItem( 0, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_sumFrameLayout->addItem( Spacer12 );

    Layout49 = new TQGridLayout( 0, 1, 1, 0, 1, "Layout49"); 

    splitUnassigned = new TQLabel( m_sumFrame, "splitUnassigned" );
    splitUnassigned->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, splitUnassigned->sizePolicy().hasHeightForWidth() ) );
    splitUnassigned->setMinimumSize( TQSize( 120, 15 ) );
    splitUnassigned->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( splitUnassigned, 1, 1 );

    transactionAmount = new TQLabel( m_sumFrame, "transactionAmount" );
    transactionAmount->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, transactionAmount->sizePolicy().hasHeightForWidth() ) );
    transactionAmount->setMinimumSize( TQSize( 120, 15 ) );
    transactionAmount->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( transactionAmount, 3, 1 );

    TextLabel1_2 = new TQLabel( m_sumFrame, "TextLabel1_2" );
    TQFont TextLabel1_2_font(  TextLabel1_2->font() );
    TextLabel1_2_font.setBold( true );
    TextLabel1_2->setFont( TextLabel1_2_font ); 
    TextLabel1_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( TextLabel1_2, 1, 0 );

    TextLabel1 = new TQLabel( m_sumFrame, "TextLabel1" );
    TQFont TextLabel1_font(  TextLabel1->font() );
    TextLabel1_font.setBold( true );
    TextLabel1->setFont( TextLabel1_font ); 
    TextLabel1->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( TextLabel1, 0, 0 );

    splitSum = new TQLabel( m_sumFrame, "splitSum" );
    splitSum->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, splitSum->sizePolicy().hasHeightForWidth() ) );
    splitSum->setMinimumSize( TQSize( 120, 15 ) );
    splitSum->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( splitSum, 0, 1 );

    TextLabel1_2_2 = new TQLabel( m_sumFrame, "TextLabel1_2_2" );
    TextLabel1_2_2->setMinimumSize( TQSize( 150, 0 ) );
    TQFont TextLabel1_2_2_font(  TextLabel1_2_2->font() );
    TextLabel1_2_2_font.setBold( true );
    TextLabel1_2_2->setFont( TextLabel1_2_2_font ); 
    TextLabel1_2_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    Layout49->addWidget( TextLabel1_2_2, 3, 0 );

    Line2 = new TQFrame( m_sumFrame, "Line2" );
    Line2->setFrameShape( TQFrame::HLine );
    Line2->setFrameShadow( TQFrame::Sunken );
    Line2->setFrameShape( TQFrame::HLine );

    Layout49->addWidget( Line2, 2, 1 );
    m_sumFrameLayout->addLayout( Layout49 );

    Frame3 = new TQFrame( m_sumFrame, "Frame3" );
    Frame3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)3, 0, 0, Frame3->sizePolicy().hasHeightForWidth() ) );
    Frame3->setMinimumSize( TQSize( 15, 0 ) );
    Frame3->setMaximumSize( TQSize( 32767, 80 ) );
    Frame3->setFrameShape( TQFrame::NoFrame );
    Frame3->setFrameShadow( TQFrame::Raised );
    m_sumFrameLayout->addWidget( Frame3 );
    Layout61->addWidget( m_sumFrame );
    KSplitTransactionDlgDeclLayout->addLayout( Layout61 );

    layout4 = new TQVBoxLayout( 0, 0, 6, "layout4"); 

    mergeBtn = new KPushButton( this, "mergeBtn" );
    mergeBtn->setEnabled( false );
    layout4->addWidget( mergeBtn );

    clearZeroBtn = new KPushButton( this, "clearZeroBtn" );
    clearZeroBtn->setEnabled( false );
    layout4->addWidget( clearZeroBtn );

    clearAllBtn = new KPushButton( this, "clearAllBtn" );
    layout4->addWidget( clearAllBtn );
    Spacer30 = new TQSpacerItem( 20, 120, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout4->addItem( Spacer30 );

    cancelBtn = new KPushButton( this, "cancelBtn" );
    cancelBtn->setProperty( "stdItem", 2 );
    layout4->addWidget( cancelBtn );

    finishBtn = new KPushButton( this, "finishBtn" );
    finishBtn->setProperty( "stdItem", 1 );
    layout4->addWidget( finishBtn );
    KSplitTransactionDlgDeclLayout->addLayout( layout4 );
    languageChange();
    resize( TQSize(656, 408).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSplitTransactionDlgDecl::languageChange()
{
    setCaption( tr2i18n( "Split transaction" ) );
    splitUnassigned->setText( tr2i18n( "<b>11,00<b>" ) );
    transactionAmount->setText( tr2i18n( "<b>111,00<b>" ) );
    TextLabel1_2->setText( tr2i18n( "Unassigned" ) );
    TextLabel1->setText( tr2i18n( "Sum of splits" ) );
    splitSum->setText( tr2i18n( "100,00" ) );
    TextLabel1_2_2->setText( tr2i18n( "Transaction amount" ) );
    mergeBtn->setText( tr2i18n( "Merge" ) );
    TQToolTip::add( mergeBtn, tr2i18n( "Merges splits with the same category to one split" ) );
    TQWhatsThis::add( mergeBtn, tr2i18n( "In case you have multiple split entries to the same category and you like to keep them as a single split, press this button. The amount for identical categories will be added and stored in a single split for that category." ) );
    clearZeroBtn->setText( tr2i18n( "Clear &Zero" ) );
    TQToolTip::add( clearZeroBtn, tr2i18n( "Removes all splits that have a value of zero." ) );
    clearAllBtn->setText( tr2i18n( "Clear &All" ) );
    cancelBtn->setText( tr2i18n( "&Cancel" ) );
    finishBtn->setText( tr2i18n( "&OK" ) );
}

/****************************************************************************
** KSplitTransactionDlgDecl meta object code from reading C++ file 'ksplittransactiondlgdecl.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 "ksplittransactiondlgdecl.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 *KSplitTransactionDlgDecl::className() const
{
    return "KSplitTransactionDlgDecl";
}

TQMetaObject *KSplitTransactionDlgDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KSplitTransactionDlgDecl( "KSplitTransactionDlgDecl", &KSplitTransactionDlgDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KSplitTransactionDlgDecl::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KSplitTransactionDlgDecl", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KSplitTransactionDlgDecl.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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