#include "simapi.h"
/****************************************************************************
** Form implementation generated from reading ui file './historycfgbase.ui'
**
** Created: вт мар 30 16:41:19 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.2   edited Dec 19 11:45 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "historycfgbase.h"

#include <qvariant.h>
#include <qwidget.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qcombobox.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "textshow.h"
#include "msgview.h"
static const char* const img0_historycfgbase[] = { 
"22 22 2 1",
". c None",
"# c #a4c610",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};

static const char* const img1_historycfgbase[] = { 
"22 22 2 1",
". c None",
"# c #a1c410",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};


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

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

    HistoryCfgLayout->addWidget( chkOwn, 0, 0 );

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

    HistoryCfgLayout->addWidget( chkSmile, 1, 0 );

    lblSize = new QLabel( this, "lblSize" );
    lblSize->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    HistoryCfgLayout->addWidget( lblSize, 0, 2 );

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

    HistoryCfgLayout->addWidget( chkSize, 0, 1 );

    edtSize = new QSpinBox( this, "edtSize" );
    edtSize->setProperty( "maxValue", 1000 );

    HistoryCfgLayout->addWidget( edtSize, 0, 3 );

    lblSize1 = new QLabel( this, "lblSize1" );

    HistoryCfgLayout->addWidget( lblSize1, 0, 4 );

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

    HistoryCfgLayout->addWidget( chkDays, 1, 1 );

    lblDays = new QLabel( this, "lblDays" );
    lblDays->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    HistoryCfgLayout->addWidget( lblDays, 1, 2 );

    edtDays = new QSpinBox( this, "edtDays" );
    edtDays->setProperty( "maxValue", 1000 );

    HistoryCfgLayout->addWidget( edtDays, 1, 3 );

    lblDays1 = new QLabel( this, "lblDays1" );

    HistoryCfgLayout->addWidget( lblDays1, 1, 4 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    HistoryCfgLayout->addItem( spacer, 0, 5 );

    Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2"); 

    cmbStyle = new QComboBox( FALSE, this, "cmbStyle" );
    cmbStyle->setProperty( "sizePolicy", QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, cmbStyle->sizePolicy().hasHeightForWidth() ) );
    Layout2->addWidget( cmbStyle );

    btnCopy = new QPushButton( this, "btnCopy" );
    Layout2->addWidget( btnCopy );

    btnRename = new QPushButton( this, "btnRename" );
    Layout2->addWidget( btnRename );

    btnDelete = new QPushButton( this, "btnDelete" );
    Layout2->addWidget( btnDelete );

    HistoryCfgLayout->addMultiCellLayout( Layout2, 3, 3, 0, 5 );

    Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); 

    lblPage1 = new QLabel( this, "lblPage1" );
    Layout1->addWidget( lblPage1 );

    cmbPage = new QComboBox( FALSE, this, "cmbPage" );
    Layout1->addWidget( cmbPage );

    lblPage2 = new QLabel( this, "lblPage2" );
    lblPage2->setProperty( "sizePolicy", QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, lblPage2->sizePolicy().hasHeightForWidth() ) );
    Layout1->addWidget( lblPage2 );

    HistoryCfgLayout->addMultiCellLayout( Layout1, 2, 2, 0, 5 );

    tabStyle = new QTabWidget( this, "tabStyle" );
    tabStyle->setProperty( "tabPosition", "Bottom" );

    preview = new QWidget( tabStyle, "preview" );
    previewLayout = new QVBoxLayout( preview, 11, 6, "previewLayout"); 

    edtPreview = new MsgViewBase( preview, "edtPreview" );
    previewLayout->addWidget( edtPreview );
    tabStyle->insertTab( preview, QString("") );

    source = new QWidget( tabStyle, "source" );
    sourceLayout = new QVBoxLayout( source, 0, 0, "sourceLayout"); 

    edtStyle = new TextEdit( source, "edtStyle" );
    sourceLayout->addWidget( edtStyle );
    tabStyle->insertTab( source, QString("") );

    HistoryCfgLayout->addMultiCellWidget( tabStyle, 4, 4, 0, 5 );
    languageChange();
    resize( QSize(425, 340).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( chkOwn, chkSmile );
    setTabOrder( chkSmile, chkSize );
    setTabOrder( chkSize, chkDays );
    setTabOrder( chkDays, edtSize );
    setTabOrder( edtSize, edtDays );
    setTabOrder( edtDays, cmbPage );
    setTabOrder( cmbPage, cmbStyle );
    setTabOrder( cmbStyle, btnCopy );
    setTabOrder( btnCopy, btnRename );
    setTabOrder( btnRename, btnDelete );
    setTabOrder( btnDelete, tabStyle );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void HistoryConfigBase::languageChange()
{
    setProperty( "caption", i18n( "Form1" ) );
    chkOwn->setProperty( "text", i18n( "Use &own colors and fonts settings" ) );
    chkSmile->setProperty( "text", i18n( "Use emotional &icons" ) );
    lblSize->setProperty( "text", i18n( "Max history file size" ) );
    chkSize->setProperty( "text", QString::null );
    lblSize1->setProperty( "text", i18n( "Mb" ) );
    chkDays->setProperty( "text", QString::null );
    lblDays->setProperty( "text", i18n( "Keep history " ) );
    lblDays1->setProperty( "text", i18n( "days" ) );
    btnCopy->setProperty( "text", i18n( "&Copy" ) );
    btnRename->setProperty( "text", i18n( "&Rename" ) );
    btnDelete->setProperty( "text", i18n( "&Delete" ) );
    lblPage1->setProperty( "text", QString::null );
    lblPage2->setProperty( "text", QString::null );
    tabStyle->changeTab( preview, i18n( "&Preview" ) );
    tabStyle->changeTab( source, i18n( "&Source" ) );
}

#include "historycfgbase.moc"
