/****************************************************************************
** Form implementation generated from reading ui file 'todatabasesettingui.ui'
**
** Created: Tue Sep 18 08:21:28 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "todatabasesettingui.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

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

    AutoCommit = new QCheckBox( this, "AutoCommit" );

    toDatabaseSettingUILayout->addWidget( AutoCommit, 0, 0 );

    ObjectCache = new QComboBox( FALSE, this, "ObjectCache" );

    toDatabaseSettingUILayout->addWidget( ObjectCache, 1, 0 );

    QueryGroup = new QGroupBox( this, "QueryGroup" );
    QueryGroup->setFrameShape( QGroupBox::Box );
    QueryGroup->setFrameShadow( QGroupBox::Sunken );
    QueryGroup->setColumnLayout(0, Qt::Vertical );
    QueryGroup->layout()->setSpacing( 6 );
    QueryGroup->layout()->setMargin( 11 );
    QueryGroupLayout = new QGridLayout( QueryGroup->layout() );
    QueryGroupLayout->setAlignment( Qt::AlignTop );

    TextLabel6_2_2 = new QLabel( QueryGroup, "TextLabel6_2_2" );

    QueryGroupLayout->addWidget( TextLabel6_2_2, 2, 0 );

    MaxColDisp = new QLineEdit( QueryGroup, "MaxColDisp" );
    MaxColDisp->setFrameShape( QLineEdit::LineEditPanel );
    MaxColDisp->setFrameShadow( QLineEdit::Sunken );

    QueryGroupLayout->addMultiCellWidget( MaxColDisp, 2, 2, 1, 2 );

    InitialFetch = new QLineEdit( QueryGroup, "InitialFetch" );
    InitialFetch->setEnabled( TRUE );

    QueryGroupLayout->addWidget( InitialFetch, 0, 1 );

    ReadAll = new QCheckBox( QueryGroup, "ReadAll" );

    QueryGroupLayout->addWidget( ReadAll, 0, 2 );

    TextLabel6 = new QLabel( QueryGroup, "TextLabel6" );

    QueryGroupLayout->addWidget( TextLabel6, 0, 0 );

    TextLabel6_2 = new QLabel( QueryGroup, "TextLabel6_2" );

    QueryGroupLayout->addWidget( TextLabel6_2, 1, 0 );

    MaxContent = new QLineEdit( QueryGroup, "MaxContent" );
    MaxContent->setEnabled( TRUE );

    QueryGroupLayout->addWidget( MaxContent, 1, 1 );

    UnlimitedContent = new QCheckBox( QueryGroup, "UnlimitedContent" );

    QueryGroupLayout->addWidget( UnlimitedContent, 1, 2 );

    toDatabaseSettingUILayout->addWidget( QueryGroup, 2, 0 );

    KeepAlive = new QCheckBox( this, "KeepAlive" );

    toDatabaseSettingUILayout->addWidget( KeepAlive, 5, 0 );

    GroupBox2 = new QGroupBox( this, "GroupBox2" );
    GroupBox2->setColumnLayout(0, Qt::Vertical );
    GroupBox2->layout()->setSpacing( 6 );
    GroupBox2->layout()->setMargin( 11 );
    GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
    GroupBox2Layout->setAlignment( Qt::AlignTop );

    AutoLong = new QCheckBox( GroupBox2, "AutoLong" );

    GroupBox2Layout->addMultiCellWidget( AutoLong, 2, 2, 0, 1 );

    TextLabel1 = new QLabel( GroupBox2, "TextLabel1" );

    GroupBox2Layout->addWidget( TextLabel1, 3, 0 );

    MoveAfter = new QSpinBox( GroupBox2, "MoveAfter" );
    MoveAfter->setEnabled( FALSE );
    MoveAfter->setMinValue( 5 );

    GroupBox2Layout->addWidget( MoveAfter, 3, 1 );

    BkgndConnect = new QCheckBox( GroupBox2, "BkgndConnect" );

    GroupBox2Layout->addMultiCellWidget( BkgndConnect, 0, 0, 0, 1 );

    DontReread = new QCheckBox( GroupBox2, "DontReread" );

    GroupBox2Layout->addMultiCellWidget( DontReread, 1, 1, 0, 1 );

    toDatabaseSettingUILayout->addWidget( GroupBox2, 4, 0 );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    toDatabaseSettingUILayout->addItem( Spacer1, 6, 0 );

    GroupBox3 = new QGroupBox( this, "GroupBox3" );
    GroupBox3->setColumnLayout(0, Qt::Vertical );
    GroupBox3->layout()->setSpacing( 6 );
    GroupBox3->layout()->setMargin( 11 );
    GroupBox3Layout = new QGridLayout( GroupBox3->layout() );
    GroupBox3Layout->setAlignment( Qt::AlignTop );

    TextLabel1_2 = new QLabel( GroupBox3, "TextLabel1_2" );

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

    Decimals = new QSpinBox( GroupBox3, "Decimals" );
    Decimals->setEnabled( FALSE );
    Decimals->setMaxValue( 20 );
    Decimals->setValue( 2 );

    GroupBox3Layout->addWidget( Decimals, 1, 3 );

    IndicateEmpty = new QCheckBox( GroupBox3, "IndicateEmpty" );

    GroupBox3Layout->addMultiCellWidget( IndicateEmpty, 0, 0, 0, 1 );

    NumberFormat = new QComboBox( FALSE, GroupBox3, "NumberFormat" );

    GroupBox3Layout->addWidget( NumberFormat, 1, 1 );

    IndicateEmptyColor = new QPushButton( GroupBox3, "IndicateEmptyColor" );

    GroupBox3Layout->addMultiCellWidget( IndicateEmptyColor, 0, 0, 2, 3 );

    TextLabel3 = new QLabel( GroupBox3, "TextLabel3" );

    GroupBox3Layout->addWidget( TextLabel3, 1, 2 );

    toDatabaseSettingUILayout->addWidget( GroupBox3, 3, 0 );
    languageChange();
    resize( QSize(792, 515).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( ReadAll, SIGNAL( toggled(bool) ), InitialFetch, SLOT( setDisabled(bool) ) );
    connect( AutoLong, SIGNAL( toggled(bool) ), MoveAfter, SLOT( setEnabled(bool) ) );
    connect( UnlimitedContent, SIGNAL( toggled(bool) ), MaxContent, SLOT( setDisabled(bool) ) );
    connect( NumberFormat, SIGNAL( activated(const QString&) ), this, SLOT( numberFormatChange() ) );
    connect( IndicateEmptyColor, SIGNAL( clicked() ), this, SLOT( IndicateEmptyColor_clicked() ) );

    // tab order
    setTabOrder( AutoCommit, ObjectCache );
    setTabOrder( ObjectCache, InitialFetch );
    setTabOrder( InitialFetch, ReadAll );
    setTabOrder( ReadAll, MaxContent );
    setTabOrder( MaxContent, UnlimitedContent );
    setTabOrder( UnlimitedContent, MaxColDisp );
    setTabOrder( MaxColDisp, IndicateEmpty );
    setTabOrder( IndicateEmpty, NumberFormat );
    setTabOrder( NumberFormat, Decimals );
    setTabOrder( Decimals, BkgndConnect );
    setTabOrder( BkgndConnect, DontReread );
    setTabOrder( DontReread, AutoLong );
    setTabOrder( AutoLong, MoveAfter );
    setTabOrder( MoveAfter, KeepAlive );

    // buddies
    TextLabel6_2_2->setBuddy( MaxColDisp );
    TextLabel6->setBuddy( InitialFetch );
    TextLabel6_2->setBuddy( InitialFetch );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toDatabaseSettingUI::languageChange()
{
    setCaption( tr( "toDatabaseSettingUI" ) );
    AutoCommit->setText( tr( "&Autocommit changes" ) );
    AutoCommit->setAccel( QKeySequence( tr( "Alt+A" ) ) );
    QToolTip::add( AutoCommit, tr( "Specify if changes should be automatically commited." ) );
    ObjectCache->clear();
    ObjectCache->insertItem( tr( "Start read object cache when needed" ) );
    ObjectCache->insertItem( tr( "Read object cache on connect" ) );
    ObjectCache->insertItem( tr( "Never read object cache until mandatory" ) );
    ObjectCache->insertItem( tr( "Never read object cache (Will leave parts of application nonfunctianal)" ) );
    QueryGroup->setTitle( tr( "Query settings" ) );
    TextLabel6_2_2->setText( tr( "Maximum size &display" ) );
    QToolTip::add( TextLabel6_2_2, tr( "The largest default size of a column in query results." ) );
    ReadAll->setText( tr( "&All" ) );
    ReadAll->setAccel( QKeySequence( tr( "Alt+A" ) ) );
    TextLabel6->setText( tr( "&Initial rows to fetch in query" ) );
    QToolTip::add( TextLabel6, tr( "The number of rows to always fetch when executing a query." ) );
    TextLabel6_2->setText( tr( "Initially read in content editor" ) );
    QToolTip::add( TextLabel6_2, tr( "Number of rows to initially start reading in content editor, use unlimited on slow connections." ) );
    UnlimitedContent->setText( tr( "&All" ) );
    KeepAlive->setText( tr( "Keep alive by periodically executing statements on unused connections if they are not used." ) );
    QToolTip::add( KeepAlive, tr( "Make sure connections are kept alive by periodically (5 minutes) sending a query on all idle connections." ) );
    GroupBox2->setTitle( tr( "UI feedback settings" ) );
    AutoLong->setText( tr( "Abort long running queries and reexecute in own connection" ) );
    QToolTip::add( AutoLong, tr( "Reexecute a query taking more than 30 seconds in its own connection to prevent blocking other database access." ) );
    TextLabel1->setText( tr( "Move to own connection after" ) );
    MoveAfter->setSuffix( tr( " seconds" ) );
    BkgndConnect->setText( tr( "Run UI blocking queries exclusively in main connection" ) );
    QToolTip::add( BkgndConnect, tr( "Let the background queries normally running on the main connection run in a separate connection." ) );
    DontReread->setText( tr( "Don't reread data if parameters are exactly same" ) );
    QToolTip::add( DontReread, tr( "If checked will not refresh a result if it is reexecuted exactly the same two times in a row." ) );
    GroupBox3->setTitle( tr( "Dataformat" ) );
    TextLabel1_2->setText( tr( "Number format" ) );
    QToolTip::add( TextLabel1_2, tr( "The way numbers should be presented." ) );
    IndicateEmpty->setText( tr( "Indicate empty values as '' instead of NULL as {null}." ) );
    NumberFormat->clear();
    NumberFormat->insertItem( tr( "Default" ) );
    NumberFormat->insertItem( tr( "Scientific" ) );
    NumberFormat->insertItem( tr( "Fixed decimal" ) );
    IndicateEmptyColor->setText( tr( "NULL background color" ) );
    TextLabel3->setText( tr( "Decimals" ) );
    QToolTip::add( TextLabel3, tr( "Number of decimals for fixed decimal format." ) );
}

void toDatabaseSettingUI::numberFormatChange()
{
    qWarning( "toDatabaseSettingUI::numberFormatChange(): Not implemented yet" );
}

void toDatabaseSettingUI::IndicateEmpty_toggled(bool)
{
    qWarning( "toDatabaseSettingUI::IndicateEmpty_toggled(bool): Not implemented yet" );
}

void toDatabaseSettingUI::IndicateEmptyColor_clicked()
{
    qWarning( "toDatabaseSettingUI::IndicateEmptyColor_clicked(): Not implemented yet" );
}

