#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'editshortcutbase.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "editshortcutbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqlabel.h>
#include <ntqframe.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a EditShortcutBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
EditShortcutBase::EditShortcutBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "EditShortcutBase" );
    EditShortcutBaseLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "EditShortcutBaseLayout"); 

    textLabel2 = new TQLabel( this, "textLabel2" );
    textLabel2->setTextFormat( TQLabel::RichText );
    EditShortcutBaseLayout->addWidget( textLabel2 );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );
    EditShortcutBaseLayout->addWidget( line1 );

    shortcut = new KLineEdit( this, "shortcut" );
    EditShortcutBaseLayout->addWidget( shortcut );

    layout2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 
    spacer1 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer1 );

    pushButton1 = new TQPushButton( this, "pushButton1" );
    layout2->addWidget( pushButton1 );
    spacer2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer2 );

    pushButton2 = new TQPushButton( this, "pushButton2" );
    layout2->addWidget( pushButton2 );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer3 );
    EditShortcutBaseLayout->addLayout( layout2 );

    line2 = new TQFrame( this, "line2" );
    line2->setFrameShape( TQFrame::HLine );
    line2->setFrameShadow( TQFrame::Sunken );
    line2->setFrameShape( TQFrame::HLine );
    EditShortcutBaseLayout->addWidget( line2 );
    languageChange();
    resize( TQSize(587, 402).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( pushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( editShortcut() ) );
    connect( pushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( clearShortcut() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EditShortcutBase::languageChange()
{
    textLabel2->setText( tr2i18n( "A single shortcut can be easily assigned or cleared using the two buttons. Only shortcuts with modifiers can be used.<p>\n"
"It is possible to have several possible shortcuts, and the first available shortcut will be used. The shortcuts are specified using space-separated shortcut sets. One set is specified as <i>base</i>+(<i>list</i>), where base are modifiers and list is a list of keys.<br>\n"
"For example \"<b>Shift+Alt+(123) Shift+Ctrl+(ABC)</b>\" will first try <b>Shift+Alt+1</b>, then others with <b>Shift+Ctrl+C</b> as the last one." ) );
    pushButton1->setText( tr2i18n( "&Single Shortcut" ) );
    pushButton2->setText( tr2i18n( "C&lear" ) );
}

/****************************************************************************
** EditShortcutBase meta object code from reading C++ file 'editshortcutbase.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "editshortcutbase.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *EditShortcutBase::className() const
{
    return "EditShortcutBase";
}

TQMetaObject *EditShortcutBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EditShortcutBase( "EditShortcutBase", &EditShortcutBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString EditShortcutBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "EditShortcutBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString EditShortcutBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "EditShortcutBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* EditShortcutBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"editShortcut", 0, 0 };
    static const TQUMethod slot_2 = {"clearShortcut", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "editShortcut()", &slot_1, TQMetaData::Protected },
	{ "clearShortcut()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"EditShortcutBase", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_EditShortcutBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* EditShortcutBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "EditShortcutBase" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool EditShortcutBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: editShortcut(); break;
    case 2: clearShortcut(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool EditShortcutBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool EditShortcutBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool EditShortcutBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
