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

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

#include "ksortoptiondlg.h"

#include <ntqvariant.h>
#include <kmymoney/transactionsortoption.h>
#include <ntqcheckbox.h>
#include <kpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "ksortoptiondlg.ui.h"

/*
 *  Constructs a KSortOptionDlg 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.
 */
KSortOptionDlg::KSortOptionDlg( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KSortOptionDlg" );
    setSizeGripEnabled( true );
    KSortOptionDlgLayout = new TQVBoxLayout( this, 11, 6, "KSortOptionDlgLayout"); 

    m_useDefault = new TQCheckBox( this, "m_useDefault" );
    KSortOptionDlgLayout->addWidget( m_useDefault );

    m_sortOption = new TransactionSortOption( this, "m_sortOption" );
    KSortOptionDlgLayout->addWidget( m_sortOption );

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

    m_helpButton = new KPushButton( this, "m_helpButton" );
    layout5->addWidget( m_helpButton );
    Horizontal_Spacing2 = new TQSpacerItem( 237, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( Horizontal_Spacing2 );

    m_okButton = new KPushButton( this, "m_okButton" );
    m_okButton->setAutoDefault( true );
    m_okButton->setDefault( true );
    layout5->addWidget( m_okButton );

    m_cancelButton = new KPushButton( this, "m_cancelButton" );
    layout5->addWidget( m_cancelButton );
    KSortOptionDlgLayout->addLayout( layout5 );
    languageChange();
    resize( TQSize(511, 348).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( m_cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( m_useDefault, TQ_SIGNAL( toggled(bool) ), m_sortOption, TQ_SLOT( setDisabled(bool) ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSortOptionDlg::languageChange()
{
    setCaption( tr2i18n( "Sort options" ) );
    m_useDefault->setText( tr2i18n( "Use default" ) );
    m_helpButton->setText( tr2i18n( "Help" ) );
    m_okButton->setText( tr2i18n( "OK" ) );
    m_cancelButton->setText( tr2i18n( "Cancel" ) );
}

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

TQMetaObject *KSortOptionDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KSortOptionDlg( "KSortOptionDlg", &KSortOptionDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KSortOptionDlg::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 TQUParameter param_slot_0[] = {
	{ "option", &static_QUType_TQString, 0, TQUParameter::In },
	{ "def", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"setSortOption", 2, param_slot_0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "setSortOption(const TQString&,const TQString&)", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KSortOptionDlg", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KSortOptionDlg.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool KSortOptionDlg::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setSortOption((const TQString&)static_QUType_TQString.get(_o+1),(const TQString&)static_QUType_TQString.get(_o+2)); break;
    case 1: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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