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

#include <qvariant.h>
#include <qpushbutton.h>
#include <qheader.h>
#include <qlistview.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "tofilesize.h"

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

    Tablespaces = new QListView( this, "Tablespaces" );
    Tablespaces->addColumn( tr( "Tablespace" ) );
    Tablespaces->addColumn( tr( "Quota Size" ) );
    Tablespaces->addColumn( tr( "Used Size" ) );
    Tablespaces->setAllColumnsShowFocus( TRUE );

    toSecurityQuotaUILayout->addWidget( Tablespaces, 1, 0 );

    SizeGroup = new QButtonGroup( this, "SizeGroup" );
    SizeGroup->setEnabled( FALSE );
    SizeGroup->setLineWidth( 0 );
    SizeGroup->setColumnLayout(0, Qt::Vertical );
    SizeGroup->layout()->setSpacing( 6 );
    SizeGroup->layout()->setMargin( 0 );
    SizeGroupLayout = new QGridLayout( SizeGroup->layout() );
    SizeGroupLayout->setAlignment( Qt::AlignTop );

    Size = new toFilesize( SizeGroup, "Size" );
    Size->setFocusPolicy( toFilesize::TabFocus );

    SizeGroupLayout->addMultiCellWidget( Size, 1, 1, 0, 2 );

    Unlimited = new QRadioButton( SizeGroup, "Unlimited" );

    SizeGroupLayout->addWidget( Unlimited, 0, 2 );

    None = new QRadioButton( SizeGroup, "None" );

    SizeGroupLayout->addWidget( None, 0, 1 );

    Value = new QRadioButton( SizeGroup, "Value" );
    Value->setChecked( TRUE );

    SizeGroupLayout->addWidget( Value, 0, 0 );

    toSecurityQuotaUILayout->addWidget( SizeGroup, 2, 0 );

    Disabled = new QLabel( this, "Disabled" );
    Disabled->setAlignment( int( QLabel::AlignCenter ) );

    toSecurityQuotaUILayout->addWidget( Disabled, 0, 0 );
    languageChange();
    resize( QSize(682, 596).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( Value, SIGNAL( toggled(bool) ), Size, SLOT( setEnabled(bool) ) );
    connect( Tablespaces, SIGNAL( selectionChanged() ), this, SLOT( changeTablespace(void) ) );
    connect( SizeGroup, SIGNAL( clicked(int) ), this, SLOT( changeSize(void) ) );
    connect( Size, SIGNAL( valueChanged(void) ), this, SLOT( changeSize(void) ) );

    // tab order
    setTabOrder( Tablespaces, Value );
    setTabOrder( Value, None );
    setTabOrder( None, Unlimited );
    setTabOrder( Unlimited, Size );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toSecurityQuotaUI::languageChange()
{
    setCaption( tr( "Form1" ) );
    Tablespaces->header()->setLabel( 0, tr( "Tablespace" ) );
    Tablespaces->header()->setLabel( 1, tr( "Quota Size" ) );
    Tablespaces->header()->setLabel( 2, tr( "Used Size" ) );
    SizeGroup->setTitle( QString::null );
    Unlimited->setText( tr( "&Unlimited" ) );
    None->setText( tr( "&None" ) );
    Value->setText( tr( "&Value" ) );
    Disabled->setText( tr( "Belongs to Resource group or has unlimited tablespace privilege" ) );
}

void toSecurityQuotaUI::changeTablespace()
{
    qWarning( "toSecurityQuotaUI::changeTablespace(): Not implemented yet" );
}

void toSecurityQuotaUI::changeSize()
{
    qWarning( "toSecurityQuotaUI::changeSize(): Not implemented yet" );
}

