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

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

#include "ksettingsgeneraldecl.h"

#include <ntqvariant.h>
#include <kmymoney/kmymoneydateinput.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <knuminput.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <tdelistview.h>
#include <ntqdatetimeedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    tabWidget2 = new TQTabWidget( this, "tabWidget2" );

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQVBoxLayout( tab, 11, 6, "tabLayout"); 

    kcfg_StartLastViewSelected = new TQButtonGroup( tab, "kcfg_StartLastViewSelected" );
    kcfg_StartLastViewSelected->setExclusive( true );
    kcfg_StartLastViewSelected->setColumnLayout(0, TQt::Vertical );
    kcfg_StartLastViewSelected->layout()->setSpacing( 6 );
    kcfg_StartLastViewSelected->layout()->setMargin( 11 );
    kcfg_StartLastViewSelectedLayout = new TQVBoxLayout( kcfg_StartLastViewSelected->layout() );
    kcfg_StartLastViewSelectedLayout->setAlignment( TQt::AlignTop );

    radioButton1 = new TQRadioButton( kcfg_StartLastViewSelected, "radioButton1" );
    radioButton1->setChecked( true );
    kcfg_StartLastViewSelected->insert( radioButton1, 0 );
    kcfg_StartLastViewSelectedLayout->addWidget( radioButton1 );

    radioButton2 = new TQRadioButton( kcfg_StartLastViewSelected, "radioButton2" );
    kcfg_StartLastViewSelected->insert( radioButton2, 1 );
    kcfg_StartLastViewSelectedLayout->addWidget( radioButton2 );
    tabLayout->addWidget( kcfg_StartLastViewSelected );

    groupBox1 = new TQGroupBox( tab, "groupBox1" );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQHBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

    textLabel1 = new TQLabel( groupBox1, "textLabel1" );
    groupBox1Layout->addWidget( textLabel1 );

    kcfg_PricePrecision = new TQSpinBox( groupBox1, "kcfg_PricePrecision" );
    kcfg_PricePrecision->setMaxValue( 10 );
    groupBox1Layout->addWidget( kcfg_PricePrecision );

    textLabel2 = new TQLabel( groupBox1, "textLabel2" );
    groupBox1Layout->addWidget( textLabel2 );
    spacer2 = new TQSpacerItem( 61, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox1Layout->addItem( spacer2 );
    tabLayout->addWidget( groupBox1 );

    groupBox3 = new TQGroupBox( tab, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQHBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    kcfg_AutoSaveFile = new TQCheckBox( groupBox3, "kcfg_AutoSaveFile" );
    groupBox3Layout->addWidget( kcfg_AutoSaveFile );

    m_periodFrame = new TQFrame( groupBox3, "m_periodFrame" );
    m_periodFrame->setEnabled( false );
    m_periodFrame->setFrameShape( TQFrame::NoFrame );
    m_periodFrame->setFrameShadow( TQFrame::Plain );
    m_periodFrameLayout = new TQHBoxLayout( m_periodFrame, 0, 6, "m_periodFrameLayout"); 

    kcfg_AutoSavePeriod = new TQSpinBox( m_periodFrame, "kcfg_AutoSavePeriod" );
    kcfg_AutoSavePeriod->setMaxValue( 60 );
    m_periodFrameLayout->addWidget( kcfg_AutoSavePeriod );

    textLabel3 = new TQLabel( m_periodFrame, "textLabel3" );
    m_periodFrameLayout->addWidget( textLabel3 );
    spacer3 = new TQSpacerItem( 354, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_periodFrameLayout->addItem( spacer3 );
    groupBox3Layout->addWidget( m_periodFrame );
    tabLayout->addWidget( groupBox3 );

    groupBox6 = new TQGroupBox( tab, "groupBox6" );
    groupBox6->setColumnLayout(0, TQt::Vertical );
    groupBox6->layout()->setSpacing( 6 );
    groupBox6->layout()->setMargin( 11 );
    groupBox6Layout = new TQHBoxLayout( groupBox6->layout() );
    groupBox6Layout->setAlignment( TQt::AlignTop );

    textLabel1_2_2 = new TQLabel( groupBox6, "textLabel1_2_2" );
    groupBox6Layout->addWidget( textLabel1_2_2 );

    kcfg_FiscalYearBeginDay = new KIntSpinBox( groupBox6, "kcfg_FiscalYearBeginDay" );
    groupBox6Layout->addWidget( kcfg_FiscalYearBeginDay );

    kcfg_FiscalYearBegin = new KComboBox( false, groupBox6, "kcfg_FiscalYearBegin" );
    groupBox6Layout->addWidget( kcfg_FiscalYearBegin );
    spacer11 = new TQSpacerItem( 90, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox6Layout->addItem( spacer11 );
    tabLayout->addWidget( groupBox6 );
    spacer3_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer3_2 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    kcfg_syncLedgerInvestment = new TQCheckBox( tab_2, "kcfg_syncLedgerInvestment" );
    tabLayout_2->addWidget( kcfg_syncLedgerInvestment );

    kcfg_hiddenViews = new KLineEdit( tab_2, "kcfg_hiddenViews" );
    kcfg_hiddenViews->setEnabled( true );
    tabLayout_2->addWidget( kcfg_hiddenViews );

    m_viewLabel = new TQLabel( tab_2, "m_viewLabel" );
    m_viewLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    tabLayout_2->addWidget( m_viewLabel );

    m_viewList = new TDEListView( tab_2, "m_viewList" );
    m_viewList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 2, m_viewList->sizePolicy().hasHeightForWidth() ) );
    tabLayout_2->addWidget( m_viewList );

    kcfg_iconSize = new TQButtonGroup( tab_2, "kcfg_iconSize" );
    kcfg_iconSize->setExclusive( true );
    kcfg_iconSize->setColumnLayout(0, TQt::Vertical );
    kcfg_iconSize->layout()->setSpacing( 6 );
    kcfg_iconSize->layout()->setMargin( 11 );
    kcfg_iconSizeLayout = new TQGridLayout( kcfg_iconSize->layout() );
    kcfg_iconSizeLayout->setAlignment( TQt::AlignTop );

    radioButton3 = new TQRadioButton( kcfg_iconSize, "radioButton3" );

    kcfg_iconSizeLayout->addWidget( radioButton3, 0, 0 );

    radioButton4 = new TQRadioButton( kcfg_iconSize, "radioButton4" );

    kcfg_iconSizeLayout->addWidget( radioButton4, 1, 0 );

    radioButton5 = new TQRadioButton( kcfg_iconSize, "radioButton5" );
    radioButton5->setChecked( true );

    kcfg_iconSizeLayout->addWidget( radioButton5, 0, 1 );

    radioButton6 = new TQRadioButton( kcfg_iconSize, "radioButton6" );

    kcfg_iconSizeLayout->addWidget( radioButton6, 1, 1 );
    tabLayout_2->addWidget( kcfg_iconSize );

    kcfg_showTitleBar = new TQCheckBox( tab_2, "kcfg_showTitleBar" );
    tabLayout_2->addWidget( kcfg_showTitleBar );
    spacer7 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer7 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );

    TabPage = new TQWidget( tabWidget2, "TabPage" );
    TabPageLayout = new TQVBoxLayout( TabPage, 11, 6, "TabPageLayout"); 

    groupBox2 = new TQGroupBox( TabPage, "groupBox2" );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 11 );
    groupBox2Layout = new TQVBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    kcfg_HideUnusedCategory = new TQCheckBox( groupBox2, "kcfg_HideUnusedCategory" );
    groupBox2Layout->addWidget( kcfg_HideUnusedCategory );

    kcfg_HideClosedAccounts = new TQCheckBox( groupBox2, "kcfg_HideClosedAccounts" );
    groupBox2Layout->addWidget( kcfg_HideClosedAccounts );

    kcfg_ExpertMode = new TQCheckBox( groupBox2, "kcfg_ExpertMode" );
    groupBox2Layout->addWidget( kcfg_ExpertMode );
    TabPageLayout->addWidget( groupBox2 );

    groupBox4 = new TQGroupBox( TabPage, "groupBox4" );
    groupBox4->setColumnLayout(0, TQt::Vertical );
    groupBox4->layout()->setSpacing( 6 );
    groupBox4->layout()->setMargin( 11 );
    groupBox4Layout = new TQVBoxLayout( groupBox4->layout() );
    groupBox4Layout->setAlignment( TQt::AlignTop );

    kcfg_HideFinishedSchedules = new TQCheckBox( groupBox4, "kcfg_HideFinishedSchedules" );
    groupBox4Layout->addWidget( kcfg_HideFinishedSchedules );
    TabPageLayout->addWidget( groupBox4 );

    groupBox5 = new TQGroupBox( TabPage, "groupBox5" );
    groupBox5->setColumnLayout(0, TQt::Vertical );
    groupBox5->layout()->setSpacing( 6 );
    groupBox5->layout()->setMargin( 11 );
    groupBox5Layout = new TQVBoxLayout( groupBox5->layout() );
    groupBox5Layout->setAlignment( TQt::AlignTop );

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

    textLabel1_3 = new TQLabel( groupBox5, "textLabel1_3" );
    layout2->addWidget( textLabel1_3 );

    m_startDateEdit = new kMyMoneyDateInput( groupBox5, "m_startDateEdit" );
    layout2->addWidget( m_startDateEdit );

    kcfg_StartDate = new TQDateEdit( groupBox5, "kcfg_StartDate" );
    layout2->addWidget( kcfg_StartDate );
    spacer10 = new TQSpacerItem( 63, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer10 );
    groupBox5Layout->addLayout( layout2 );

    kcfg_HideReconciledTransactions = new TQCheckBox( groupBox5, "kcfg_HideReconciledTransactions" );
    groupBox5Layout->addWidget( kcfg_HideReconciledTransactions );
    TabPageLayout->addWidget( groupBox5 );
    spacer4 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    TabPageLayout->addItem( spacer4 );
    tabWidget2->insertTab( TabPage, TQString::fromLatin1("") );
    KSettingsGeneralDeclLayout->addWidget( tabWidget2 );
    languageChange();
    resize( TQSize(614, 438).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_AutoSaveFile, TQ_SIGNAL( toggled(bool) ), m_periodFrame, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KSettingsGeneralDecl::languageChange()
{
    setCaption( tr2i18n( "General Settings" ) );
    kcfg_StartLastViewSelected->setTitle( tr2i18n( "Startup page options" ) );
    radioButton1->setText( tr2i18n( "Start with homepage" ) );
    radioButton2->setText( tr2i18n( "Start with last selected view" ) );
    groupBox1->setTitle( tr2i18n( "Precision settings" ) );
    textLabel1->setText( tr2i18n( "Price precision" ) );
    textLabel2->setText( tr2i18n( "digits" ) );
    groupBox3->setTitle( tr2i18n( "Autosave options" ) );
    kcfg_AutoSaveFile->setText( tr2i18n( "Autosave periodically" ) );
    textLabel3->setText( tr2i18n( "minutes" ) );
    groupBox6->setTitle( tr2i18n( "Fiscal Year" ) );
    textLabel1_2_2->setText( tr2i18n( "Your fiscal year starts on" ) );
    kcfg_FiscalYearBegin->clear();
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "January" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "February" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "March" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "April" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "May" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "June" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "July" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "August" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "September" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "October" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "November" ) );
    kcfg_FiscalYearBegin->insertItem( tr2i18n( "December" ) );
    tabWidget2->changeTab( tab, tr2i18n( "Global" ) );
    kcfg_syncLedgerInvestment->setText( tr2i18n( "Synchronize account selection of ledger and investment view" ) );
    m_viewLabel->setText( tr2i18n( "Check the views you want to enable, uncheck those you want to hide, because you don't need the functionality." ) );
    kcfg_iconSize->setTitle( tr2i18n( "Icon size of navigation bar" ) );
    radioButton3->setText( tr2i18n( "Micro (16px)" ) );
    radioButton4->setText( tr2i18n( "Small (32px)" ) );
    radioButton5->setText( tr2i18n( "Normal (48px)" ) );
    radioButton6->setText( tr2i18n( "Large (64px)" ) );
    kcfg_showTitleBar->setText( tr2i18n( "Show title bar on each page" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "Views" ) );
    groupBox2->setTitle( tr2i18n( "Accounts / Categories" ) );
    kcfg_HideUnusedCategory->setText( tr2i18n( "Don't show unused categories" ) );
    TQWhatsThis::add( kcfg_HideUnusedCategory, tr2i18n( "This option hides all categories in the categories view that are not used in at least a single transaction. They are still shown in the category selection lists." ) );
    kcfg_HideClosedAccounts->setText( tr2i18n( "Don't show closed accounts" ) );
    TQWhatsThis::add( kcfg_HideClosedAccounts, tr2i18n( "This option hides all accounts that have been closed by the user in views and selection lists.\n"
"\n"
"You can use <b>View/Show all accounts</b> to temporarily show hidden accounts in the views." ) );
    kcfg_ExpertMode->setText( tr2i18n( "Show equity accounts" ) );
    groupBox4->setTitle( tr2i18n( "Schedules" ) );
    kcfg_HideFinishedSchedules->setText( tr2i18n( "Don't show finished schedules" ) );
    TQWhatsThis::add( kcfg_HideFinishedSchedules, tr2i18n( "This option hides all finished schedules in the schedules view." ) );
    groupBox5->setTitle( tr2i18n( "Transactions" ) );
    textLabel1_3->setText( tr2i18n( "Don't show transactions prior to" ) );
    kcfg_HideReconciledTransactions->setText( tr2i18n( "Don't show reconciled transactions" ) );
    TQWhatsThis::add( kcfg_HideReconciledTransactions, tr2i18n( "This option hides all reconciled transactions in the ledger view." ) );
    tabWidget2->changeTab( TabPage, tr2i18n( "Filter" ) );
}

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

TQMetaObject *KSettingsGeneralDecl::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KSettingsGeneralDecl( "KSettingsGeneralDecl", &KSettingsGeneralDecl::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KSettingsGeneralDecl::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(
	"KSettingsGeneralDecl", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KSettingsGeneralDecl.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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