#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/kdeui/kshortcutdialog_advanced.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kshortcutdialog_advanced.h"

#include <qvariant.h>
#include <kpushbutton.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kpushbutton.h"

/*
 *  Constructs a KShortcutDialogAdvanced as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KShortcutDialogAdvanced::KShortcutDialogAdvanced( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "KShortcutDialogAdvanced" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
    KShortcutDialogAdvancedLayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "KShortcutDialogAdvancedLayout"); 

    m_frameMore = new QButtonGroup( this, "m_frameMore" );
    m_frameMore->setFrameShape( QButtonGroup::NoFrame );
    m_frameMore->setFrameShadow( QButtonGroup::Plain );
    m_frameMore->setColumnLayout(0, Qt::Vertical );
    m_frameMore->layout()->setSpacing( KDialog::spacingHint() );
    m_frameMore->layout()->setMargin( 0 );
    m_frameMoreLayout = new QGridLayout( m_frameMore->layout() );
    m_frameMoreLayout->setAlignment( Qt::AlignTop );

    m_btnAlternate = new QRadioButton( m_frameMore, "m_btnAlternate" );
    m_btnAlternate->setFocusPolicy( QRadioButton::NoFocus );

    m_frameMoreLayout->addWidget( m_btnAlternate, 1, 0 );

    m_btnPrimary = new QRadioButton( m_frameMore, "m_btnPrimary" );
    m_btnPrimary->setFocusPolicy( QRadioButton::NoFocus );

    m_frameMoreLayout->addWidget( m_btnPrimary, 0, 0 );

    layout6 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout6"); 

    m_txtAlternate = new KPushButton( m_frameMore, "m_txtAlternate" );
    m_txtAlternate->setPaletteBackgroundColor( QColor( 255, 255, 255 ) );
    m_txtAlternate->setFocusPolicy( KPushButton::ClickFocus );
    m_txtAlternate->setAutoDefault( FALSE );
    m_txtAlternate->setDefault( FALSE );
    layout6->addWidget( m_txtAlternate );
    spacer6 = new QSpacerItem( 21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout6->addItem( spacer6 );

    m_frameMoreLayout->addLayout( layout6, 1, 2 );

    layout7 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout7"); 

    m_txtPrimary = new KPushButton( m_frameMore, "m_txtPrimary" );
    m_txtPrimary->setPaletteBackgroundColor( QColor( 255, 255, 255 ) );
    m_txtPrimary->setCursor( QCursor( 4 ) );
    m_txtPrimary->setFocusPolicy( KPushButton::ClickFocus );
    m_txtPrimary->setAutoDefault( FALSE );
    layout7->addWidget( m_txtPrimary );
    spacer5 = new QSpacerItem( 21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer5 );

    m_frameMoreLayout->addLayout( layout7, 0, 2 );

    m_btnClearPrimary = new QPushButton( m_frameMore, "m_btnClearPrimary" );
    m_btnClearPrimary->setFlat( TRUE );

    m_frameMoreLayout->addWidget( m_btnClearPrimary, 0, 1 );

    m_btnClearAlternate = new QPushButton( m_frameMore, "m_btnClearAlternate" );
    m_btnClearAlternate->setFlat( TRUE );

    m_frameMoreLayout->addWidget( m_btnClearAlternate, 1, 1 );

    m_btnMultiKey = new QCheckBox( m_frameMore, "m_btnMultiKey" );
    m_btnMultiKey->setFocusPolicy( QCheckBox::NoFocus );

    m_frameMoreLayout->addWidget( m_btnMultiKey, 2, 0 );
    KShortcutDialogAdvancedLayout->addWidget( m_frameMore );
    languageChange();
    resize( QSize(359, 157).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_txtPrimary, SIGNAL( clicked() ), m_btnPrimary, SLOT( animateClick() ) );
    connect( m_txtAlternate, SIGNAL( clicked() ), m_btnAlternate, SLOT( animateClick() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KShortcutDialogAdvanced::languageChange()
{
    m_frameMore->setTitle( QString::null );
    m_btnAlternate->setText( tr2i18n( "Alternate shortcut:" ) );
    m_btnPrimary->setText( tr2i18n( "Primary shortcut:" ) );
    m_txtAlternate->setText( QString::null );
    m_txtPrimary->setText( QString::null );
    QWhatsThis::add( m_txtPrimary, tr2i18n( "The currently set shortcut or the shortcut you are entering will show up here." ) );
    m_btnClearPrimary->setText( tr2i18n( "x" ) );
    QToolTip::add( m_btnClearPrimary, tr2i18n( "Clear shortcut" ) );
    m_btnClearAlternate->setText( tr2i18n( "x" ) );
    QToolTip::add( m_btnClearAlternate, tr2i18n( "Clear shortcut" ) );
    m_btnMultiKey->setText( tr2i18n( "Multi-key mode" ) );
    QToolTip::add( m_btnMultiKey, tr2i18n( "Enable the entry of multi-key shortcuts" ) );
    QWhatsThis::add( m_btnMultiKey, tr2i18n( "Select this checkbox to enable the entry of multi-key shortcuts.  A multi-key shortcut consists of a sequence of up to 4 keys.  For example, you could assign \"Ctrl+F,B\" to Font-Bold and \"Ctrl+F,U\" to Font-Underline." ) );
}

#include "kshortcutdialog_advanced.moc"
