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

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

#include "general_settings_ui.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqslider.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    behavior_box = new TQGroupBox( this, "behavior_box" );
    behavior_box->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, behavior_box->sizePolicy().hasHeightForWidth() ) );
    behavior_box->setColumnLayout(0, TQt::Vertical );
    behavior_box->layout()->setSpacing( KDialog::spacingHint() );
    behavior_box->layout()->setMargin( KDialog::marginHint() );
    behavior_boxLayout = new TQGridLayout( behavior_box->layout() );
    behavior_boxLayout->setAlignment( TQt::AlignTop );

    kcfg_popup = new TQCheckBox( behavior_box, "kcfg_popup" );

    behavior_boxLayout->addMultiCellWidget( kcfg_popup, 0, 0, 0, 2 );

    kcfg_confirmquit = new TQCheckBox( behavior_box, "kcfg_confirmquit" );

    behavior_boxLayout->addMultiCellWidget( kcfg_confirmquit, 1, 1, 0, 2 );

    kcfg_tabs = new TQCheckBox( behavior_box, "kcfg_tabs" );

    behavior_boxLayout->addMultiCellWidget( kcfg_tabs, 2, 2, 0, 2 );
    spacer10 = new TQSpacerItem( 16, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    behavior_boxLayout->addItem( spacer10, 6, 0 );
    spacer10_2 = new TQSpacerItem( 16, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    behavior_boxLayout->addItem( spacer10_2, 5, 0 );

    kcfg_keepabove = new TQCheckBox( behavior_box, "kcfg_keepabove" );
    kcfg_keepabove->setEnabled( false );

    behavior_boxLayout->addMultiCellWidget( kcfg_keepabove, 5, 5, 1, 2 );

    kcfg_focus = new TQCheckBox( behavior_box, "kcfg_focus" );

    behavior_boxLayout->addMultiCellWidget( kcfg_focus, 4, 4, 0, 1 );

    kcfg_focusontoggle = new TQCheckBox( behavior_box, "kcfg_focusontoggle" );
    kcfg_focusontoggle->setEnabled( false );

    behavior_boxLayout->addMultiCellWidget( kcfg_focusontoggle, 6, 6, 1, 2 );

    kcfg_poll = new TQCheckBox( behavior_box, "kcfg_poll" );
    kcfg_poll->setEnabled( true );

    behavior_boxLayout->addMultiCellWidget( kcfg_poll, 3, 3, 0, 1 );
    GeneralSettingsUILayout->addWidget( behavior_box );

    size_box = new TQGroupBox( this, "size_box" );
    size_box->setColumnLayout(0, TQt::Vertical );
    size_box->layout()->setSpacing( KDialog::spacingHint() );
    size_box->layout()->setMargin( KDialog::marginHint() );
    size_boxLayout = new TQGridLayout( size_box->layout() );
    size_boxLayout->setAlignment( TQt::AlignTop );

    width_label = new TQLabel( size_box, "width_label" );

    size_boxLayout->addWidget( width_label, 0, 0 );

    height_label = new TQLabel( size_box, "height_label" );

    size_boxLayout->addWidget( height_label, 1, 0 );

    speed_label = new TQLabel( size_box, "speed_label" );

    size_boxLayout->addWidget( speed_label, 2, 0 );

    width_slider = new TQSlider( size_box, "width_slider" );
    width_slider->setMinValue( 1 );
    width_slider->setMaxValue( 10 );
    width_slider->setLineStep( 1 );
    width_slider->setPageStep( 1 );
    width_slider->setValue( 10 );
    width_slider->setOrientation( TQSlider::Horizontal );
    width_slider->setTickmarks( TQSlider::Below );
    width_slider->setTickInterval( 1 );

    size_boxLayout->addWidget( width_slider, 0, 1 );

    height_slider = new TQSlider( size_box, "height_slider" );
    height_slider->setMinValue( 1 );
    height_slider->setMaxValue( 10 );
    height_slider->setLineStep( 1 );
    height_slider->setPageStep( 1 );
    height_slider->setValue( 5 );
    height_slider->setOrientation( TQSlider::Horizontal );
    height_slider->setTickmarks( TQSlider::Below );
    height_slider->setTickInterval( 1 );

    size_boxLayout->addWidget( height_slider, 1, 1 );

    kcfg_steps = new TQSlider( size_box, "kcfg_steps" );
    kcfg_steps->setMinValue( 0 );
    kcfg_steps->setMaxValue( 50 );
    kcfg_steps->setPageStep( 1 );
    kcfg_steps->setValue( 20 );
    kcfg_steps->setOrientation( TQSlider::Horizontal );
    kcfg_steps->setTickmarks( TQSlider::Below );
    kcfg_steps->setTickInterval( 5 );

    size_boxLayout->addWidget( kcfg_steps, 2, 1 );

    kcfg_height = new KIntSpinBox( size_box, "kcfg_height" );
    kcfg_height->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, kcfg_height->sizePolicy().hasHeightForWidth() ) );
    kcfg_height->setMaxValue( 100 );
    kcfg_height->setMinValue( 10 );
    kcfg_height->setLineStep( 10 );
    kcfg_height->setValue( 50 );

    size_boxLayout->addWidget( kcfg_height, 1, 2 );

    steps_spinbox = new KIntSpinBox( size_box, "steps_spinbox" );
    steps_spinbox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, steps_spinbox->sizePolicy().hasHeightForWidth() ) );
    steps_spinbox->setMaxValue( 500 );
    steps_spinbox->setMinValue( 0 );
    steps_spinbox->setLineStep( 50 );
    steps_spinbox->setValue( 200 );

    size_boxLayout->addWidget( steps_spinbox, 2, 2 );

    kcfg_width = new KIntSpinBox( size_box, "kcfg_width" );
    kcfg_width->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, kcfg_width->sizePolicy().hasHeightForWidth() ) );
    kcfg_width->setMaxValue( 100 );
    kcfg_width->setMinValue( 10 );
    kcfg_width->setLineStep( 10 );
    kcfg_width->setValue( 100 );

    size_boxLayout->addWidget( kcfg_width, 0, 2 );
    GeneralSettingsUILayout->addWidget( size_box );

    position_box = new TQGroupBox( this, "position_box" );
    position_box->setColumnLayout(0, TQt::Vertical );
    position_box->layout()->setSpacing( KDialog::spacingHint() );
    position_box->layout()->setMargin( KDialog::marginHint() );
    position_boxLayout = new TQVBoxLayout( position_box->layout() );
    position_boxLayout->setAlignment( TQt::AlignTop );

    layout10 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout10"); 

    left_label = new TQLabel( position_box, "left_label" );
    left_label->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, left_label->sizePolicy().hasHeightForWidth() ) );
    layout10->addWidget( left_label );

    kcfg_location = new TQSlider( position_box, "kcfg_location" );
    kcfg_location->setMaxValue( 100 );
    kcfg_location->setValue( 50 );
    kcfg_location->setOrientation( TQSlider::Horizontal );
    kcfg_location->setTickmarks( TQSlider::Below );
    kcfg_location->setTickInterval( 10 );
    layout10->addWidget( kcfg_location );

    right_label = new TQLabel( position_box, "right_label" );
    right_label->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, right_label->sizePolicy().hasHeightForWidth() ) );
    layout10->addWidget( right_label );
    position_boxLayout->addLayout( layout10 );

    layout20 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout20"); 

    screen_label = new TQLabel( position_box, "screen_label" );
    screen_label->setEnabled( false );
    layout20->addWidget( screen_label );

    kcfg_screen = new TQComboBox( false, position_box, "kcfg_screen" );
    kcfg_screen->setEnabled( false );
    layout20->addWidget( kcfg_screen );
    spacer1 = new TQSpacerItem( 210, 26, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout20->addItem( spacer1 );
    position_boxLayout->addLayout( layout20 );
    GeneralSettingsUILayout->addWidget( position_box );
    spacer9 = new TQSpacerItem( 21, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    GeneralSettingsUILayout->addItem( spacer9 );
    languageChange();
    resize( TQSize(481, 473).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_focus, TQ_SIGNAL( toggled(bool) ), kcfg_focusontoggle, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_focus, TQ_SIGNAL( toggled(bool) ), kcfg_keepabove, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_popup, kcfg_confirmquit );
    setTabOrder( kcfg_confirmquit, kcfg_tabs );
    setTabOrder( kcfg_tabs, kcfg_poll );
    setTabOrder( kcfg_poll, kcfg_focus );
    setTabOrder( kcfg_focus, kcfg_keepabove );
    setTabOrder( kcfg_keepabove, kcfg_focusontoggle );
    setTabOrder( kcfg_focusontoggle, width_slider );
    setTabOrder( width_slider, kcfg_width );
    setTabOrder( kcfg_width, height_slider );
    setTabOrder( height_slider, kcfg_height );
    setTabOrder( kcfg_height, kcfg_steps );
    setTabOrder( kcfg_steps, steps_spinbox );
    setTabOrder( steps_spinbox, kcfg_location );
    setTabOrder( kcfg_location, kcfg_screen );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GeneralSettingsUI::languageChange()
{
    behavior_box->setTitle( tr2i18n( "Options" ) );
    kcfg_popup->setText( tr2i18n( "Show notification popup at application startup" ) );
    kcfg_confirmquit->setText( tr2i18n( "Confirm quit when closing more than one session" ) );
    kcfg_tabs->setText( tr2i18n( "Show the tab bar" ) );
    kcfg_keepabove->setText( tr2i18n( "Keep window above other windows" ) );
    TQWhatsThis::add( kcfg_keepabove, tr2i18n( "Enable this option if you want the Yakuake window to keep on top of other windows even when it loses focus." ) );
    kcfg_focus->setText( tr2i18n( "Keep window open on focus change" ) );
    TQToolTip::add( kcfg_focus, TQString::null );
    TQWhatsThis::add( kcfg_focus, tr2i18n( "Enable this option if you want the Yakuake window to stay open when it loses focus." ) );
    kcfg_focusontoggle->setText( tr2i18n( "Use Open/Retract action to focus window" ) );
    TQWhatsThis::add( kcfg_focusontoggle, tr2i18n( "Enable this option if you want the Open/Retract shortcut to focus the Yakuake window when it is already open but lacks focus. Disable this option to have the Open/Retract shortcut retract the Yakuake window regardless of whether or not it has focus." ) );
    kcfg_poll->setText( tr2i18n( "Automatically open when pointer touches screen edge" ) );
    TQWhatsThis::add( kcfg_poll, tr2i18n( "Enable this option if you want the Yakuake window to open when the mouse pointer touches the top edge of the screen." ) );
    size_box->setTitle( tr2i18n( "Size and Animation" ) );
    width_label->setText( tr2i18n( "Width:" ) );
    height_label->setText( tr2i18n( "Height:" ) );
    speed_label->setText( tr2i18n( "Speed:" ) );
    TQWhatsThis::add( kcfg_steps, tr2i18n( "This setting controls the approximate duration of the sliding animation when the Yakuake window is opening or retracting." ) );
    position_box->setTitle( tr2i18n( "Position" ) );
    left_label->setText( tr2i18n( "Left" ) );
    right_label->setText( tr2i18n( "Right" ) );
    screen_label->setText( tr2i18n( "Open on screen:" ) );
    kcfg_screen->clear();
    kcfg_screen->insertItem( tr2i18n( "At mouse location" ) );
    kcfg_screen->insertItem( tr2i18n( "Screen 1" ) );
}

/****************************************************************************
** GeneralSettingsUI meta object code from reading C++ file 'general_settings_ui.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 "general_settings_ui.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 *GeneralSettingsUI::className() const
{
    return "GeneralSettingsUI";
}

TQMetaObject *GeneralSettingsUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GeneralSettingsUI( "GeneralSettingsUI", &GeneralSettingsUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* GeneralSettingsUI::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 TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"GeneralSettingsUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_GeneralSettingsUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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