/****************************************************************************
** Form implementation generated from reading ui file 'toworksheetsetupui.ui'
**
** Created: Tue Sep 18 08:21:27 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 "toworksheetsetupui.h"

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

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

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

    AutoSave = new QCheckBox( GroupBox1, "AutoSave" );

    GroupBox1Layout->addMultiCellWidget( AutoSave, 0, 0, 0, 2 );

    CheckSave = new QCheckBox( GroupBox1, "CheckSave" );

    GroupBox1Layout->addMultiCellWidget( CheckSave, 1, 1, 0, 2 );

    LogAtEnd = new QCheckBox( GroupBox1, "LogAtEnd" );

    GroupBox1Layout->addMultiCellWidget( LogAtEnd, 2, 2, 0, 2 );

    LogMulti = new QCheckBox( GroupBox1, "LogMulti" );

    GroupBox1Layout->addMultiCellWidget( LogMulti, 3, 3, 0, 2 );

    Statistics = new QCheckBox( GroupBox1, "Statistics" );

    GroupBox1Layout->addMultiCellWidget( Statistics, 4, 4, 0, 2 );

    TimedStatistics = new QCheckBox( GroupBox1, "TimedStatistics" );

    GroupBox1Layout->addMultiCellWidget( TimedStatistics, 5, 5, 0, 2 );

    DisplayNumber = new QCheckBox( GroupBox1, "DisplayNumber" );

    GroupBox1Layout->addMultiCellWidget( DisplayNumber, 6, 6, 0, 2 );

    MoveToError = new QCheckBox( GroupBox1, "MoveToError" );

    GroupBox1Layout->addMultiCellWidget( MoveToError, 7, 7, 0, 2 );

    History = new QCheckBox( GroupBox1, "History" );

    GroupBox1Layout->addMultiCellWidget( History, 8, 8, 0, 2 );

    DefaultFile = new QLineEdit( GroupBox1, "DefaultFile" );
    DefaultFile->setFrameShape( QLineEdit::LineEditPanel );
    DefaultFile->setFrameShadow( QLineEdit::Sunken );

    GroupBox1Layout->addWidget( DefaultFile, 11, 1 );

    FileChoose = new QPushButton( GroupBox1, "FileChoose" );

    GroupBox1Layout->addWidget( FileChoose, 11, 2 );

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

    GroupBox1Layout->addWidget( TextLabel1, 11, 0 );
    Spacer1 = new QSpacerItem( 20, 160, QSizePolicy::Minimum, QSizePolicy::Expanding );
    GroupBox1Layout->addItem( Spacer1, 12, 1 );

    ExecLog = new QCheckBox( GroupBox1, "ExecLog" );

    GroupBox1Layout->addMultiCellWidget( ExecLog, 9, 9, 0, 2 );

    ToplevelDescribe = new QCheckBox( GroupBox1, "ToplevelDescribe" );

    GroupBox1Layout->addMultiCellWidget( ToplevelDescribe, 10, 10, 0, 2 );

    toWorksheetSetupUILayout->addWidget( GroupBox1, 0, 0 );
    languageChange();
    resize( QSize(568, 480).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( FileChoose, SIGNAL( clicked() ), this, SLOT( chooseFile() ) );
    connect( History, SIGNAL( toggled(bool) ), ExecLog, SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( AutoSave, CheckSave );
    setTabOrder( CheckSave, LogAtEnd );
    setTabOrder( LogAtEnd, LogMulti );
    setTabOrder( LogMulti, Statistics );
    setTabOrder( Statistics, TimedStatistics );
    setTabOrder( TimedStatistics, DisplayNumber );
    setTabOrder( DisplayNumber, History );
    setTabOrder( History, ExecLog );
    setTabOrder( ExecLog, DefaultFile );
    setTabOrder( DefaultFile, FileChoose );

    // buddies
    TextLabel1->setBuddy( DefaultFile );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toWorksheetSetupUI::languageChange()
{
    setCaption( tr( "Form1" ) );
    QToolTip::add( this, tr( "Automatically save file when closing editor (Without asking any questions)." ) );
    GroupBox1->setTitle( tr( "SQL Editor" ) );
    AutoSave->setText( tr( "Auto &save" ) );
    CheckSave->setText( tr( "Ask about saving &changes" ) );
    QToolTip::add( CheckSave, tr( "Ask about saving changes when closing worksheet." ) );
    LogAtEnd->setText( tr( "Add &log entries at end" ) );
    QToolTip::add( LogAtEnd, tr( "Add newly executed queries at end of log instead of top. Changing this will mess up the log in the windows that are opened." ) );
    LogMulti->setText( tr( "&Multiple lines in log." ) );
    QToolTip::add( LogMulti, tr( "Display multiple lines in the SQL column of the logging." ) );
    Statistics->setText( tr( "&Enable statistics" ) );
    QToolTip::add( Statistics, tr( "Enable statistic collection per default." ) );
    TimedStatistics->setText( tr( "Enable &timed statistics" ) );
    QToolTip::add( TimedStatistics, tr( "Enable timed statistics as well when collecting normal statistics." ) );
    DisplayNumber->setText( tr( "&Display number column" ) );
    QToolTip::add( DisplayNumber, tr( "Add a numbering column to the left of the result." ) );
    MoveToError->setText( tr( "Move &cursor to error" ) );
    QToolTip::add( MoveToError, tr( "Move the cursor to an error if the error occurs." ) );
    History->setText( tr( "Save previous results" ) );
    QToolTip::add( History, tr( "Keep previous results in while editor is open. Will consume lot of memory." ) );
    FileChoose->setText( tr( "&Browse" ) );
    TextLabel1->setText( tr( "Default &file" ) );
    QToolTip::add( TextLabel1, tr( "File to automatically open in a new editor." ) );
    ExecLog->setText( tr( "Execute directly when selecting in log" ) );
    QToolTip::add( ExecLog, tr( "Execute a statement when it is\n"
"			selected in the log, if disabled simply selected\n"
"			the statement in the log." ) );
    ToplevelDescribe->setText( tr( "Display column descriptions in own toplevel window." ) );
    QToolTip::add( ToplevelDescribe, tr( "Execute a statement when it is\n"
"			selected in the log, if disabled simply selected\n"
"			the statement in the log." ) );
}

void toWorksheetSetupUI::chooseFile()
{
    qWarning( "toWorksheetSetupUI::chooseFile(): Not implemented yet" );
}

