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

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

#include "desktopbehavior.h"

#include <ntqvariant.h>
#include <tdelistview.h>
#include <kseparator.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    behaviorTab = new TQTabWidget( this, "behaviorTab" );

    tab = new TQWidget( behaviorTab, "tab" );
    tabLayout = new TQVBoxLayout( tab, 11, 6, "tabLayout"); 

    iconsGroupBox = new TQGroupBox( tab, "iconsGroupBox" );
    iconsGroupBox->setColumnLayout(0, TQt::Vertical );
    iconsGroupBox->layout()->setSpacing( 6 );
    iconsGroupBox->layout()->setMargin( 11 );
    iconsGroupBoxLayout = new TQVBoxLayout( iconsGroupBox->layout() );
    iconsGroupBoxLayout->setAlignment( TQt::AlignTop );

    iconsEnabledBox = new TQCheckBox( iconsGroupBox, "iconsEnabledBox" );
    iconsEnabledBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, iconsEnabledBox->sizePolicy().hasHeightForWidth() ) );
    iconsGroupBoxLayout->addWidget( iconsEnabledBox );

    layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); 
    spacer1 = new TQSpacerItem( 20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout1->addItem( spacer1 );

    vrootBox = new TQCheckBox( iconsGroupBox, "vrootBox" );
    vrootBox->setEnabled( false );
    layout1->addWidget( vrootBox );
    iconsGroupBoxLayout->addLayout( layout1 );

    toolTipBox = new TQCheckBox( iconsGroupBox, "toolTipBox" );
    iconsGroupBoxLayout->addWidget( toolTipBox );

    iconOptsSeparator = new KSeparator( iconsGroupBox, "iconOptsSeparator" );
    iconsGroupBoxLayout->addWidget( iconOptsSeparator );

    iconOptsOuterLayout = new TQHBoxLayout( 0, 0, 6, "iconOptsOuterLayout"); 

    iconOptsVLayout = new TQVBoxLayout( 0, 0, 6, "iconOptsVLayout"); 

    lockInPlaceBox = new TQCheckBox( iconsGroupBox, "lockInPlaceBox" );
    lockInPlaceBox->setEnabled( false );
    iconOptsVLayout->addWidget( lockInPlaceBox );

    autoLineupIconsBox = new TQCheckBox( iconsGroupBox, "autoLineupIconsBox" );
    autoLineupIconsBox->setEnabled( false );
    iconOptsVLayout->addWidget( autoLineupIconsBox );
    iconOptsOuterLayout->addLayout( iconOptsVLayout );
    spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    iconOptsOuterLayout->addItem( spacer2 );

    spacingVLayout = new TQVBoxLayout( 0, 0, 6, "spacingVLayout"); 

    spacingValueLayout = new TQHBoxLayout( 0, 0, 6, "spacingValueLayout"); 

    spacingLabel = new TQLabel( iconsGroupBox, "spacingLabel" );
    spacingValueLayout->addWidget( spacingLabel );

    spacingValue = new TQSpinBox( iconsGroupBox, "spacingValue" );
    spacingValue->setMinValue( 5 );
    spacingValueLayout->addWidget( spacingValue );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    spacingValueLayout->addItem( spacer3 );
    spacingVLayout->addLayout( spacingValueLayout );

    spacingCtrlScroll = new TQCheckBox( iconsGroupBox, "spacingCtrlScroll" );
    spacingVLayout->addWidget( spacingCtrlScroll );
    iconOptsOuterLayout->addLayout( spacingVLayout );
    spacer2_2 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    iconOptsOuterLayout->addItem( spacer2_2 );
    iconsGroupBoxLayout->addLayout( iconOptsOuterLayout );
    tabLayout->addWidget( iconsGroupBox );

    desktopMenuGroup = new TQButtonGroup( tab, "desktopMenuGroup" );
    desktopMenuGroup->setColumnLayout(0, TQt::Vertical );
    desktopMenuGroup->layout()->setSpacing( 6 );
    desktopMenuGroup->layout()->setMargin( 11 );
    desktopMenuGroupLayout = new TQVBoxLayout( desktopMenuGroup->layout() );
    desktopMenuGroupLayout->setAlignment( TQt::AlignTop );

    radioButton1 = new TQRadioButton( desktopMenuGroup, "radioButton1" );
    desktopMenuGroupLayout->addWidget( radioButton1 );

    radioButton1_2 = new TQRadioButton( desktopMenuGroup, "radioButton1_2" );
    desktopMenuGroupLayout->addWidget( radioButton1_2 );

    radioButton1_3 = new TQRadioButton( desktopMenuGroup, "radioButton1_3" );
    desktopMenuGroupLayout->addWidget( radioButton1_3 );
    tabLayout->addWidget( desktopMenuGroup );

    groupBox3 = new TQGroupBox( tab, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQGridLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    middleLabel = new TQLabel( groupBox3, "middleLabel" );

    groupBox3Layout->addWidget( middleLabel, 1, 0 );

    leftLabel = new TQLabel( groupBox3, "leftLabel" );

    groupBox3Layout->addWidget( leftLabel, 0, 0 );

    rightLabel = new TQLabel( groupBox3, "rightLabel" );

    groupBox3Layout->addWidget( rightLabel, 2, 0 );

    rightComboBox = new TQComboBox( false, groupBox3, "rightComboBox" );
    rightComboBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, rightComboBox->sizePolicy().hasHeightForWidth() ) );

    groupBox3Layout->addWidget( rightComboBox, 2, 1 );

    leftComboBox = new TQComboBox( false, groupBox3, "leftComboBox" );
    leftComboBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, leftComboBox->sizePolicy().hasHeightForWidth() ) );

    groupBox3Layout->addWidget( leftComboBox, 0, 1 );

    leftEditButton = new TQPushButton( groupBox3, "leftEditButton" );
    leftEditButton->setEnabled( false );

    groupBox3Layout->addWidget( leftEditButton, 0, 2 );

    middleComboBox = new TQComboBox( false, groupBox3, "middleComboBox" );
    middleComboBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, middleComboBox->sizePolicy().hasHeightForWidth() ) );

    groupBox3Layout->addWidget( middleComboBox, 1, 1 );

    middleEditButton = new TQPushButton( groupBox3, "middleEditButton" );
    middleEditButton->setEnabled( false );

    groupBox3Layout->addWidget( middleEditButton, 1, 2 );

    rightEditButton = new TQPushButton( groupBox3, "rightEditButton" );
    rightEditButton->setEnabled( false );

    groupBox3Layout->addWidget( rightEditButton, 2, 2 );
    spacer4 = new TQSpacerItem( 191, 80, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox3Layout->addMultiCell( spacer4, 0, 2, 3, 3 );
    tabLayout->addWidget( groupBox3 );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer5 );
    behaviorTab->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( behaviorTab, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    showHiddenBox = new TQCheckBox( tab_2, "showHiddenBox" );

    tabLayout_2->addWidget( showHiddenBox, 1, 0 );

    previewListView = new TDEListView( tab_2, "previewListView" );
    previewListView->addColumn( tr2i18n( "Show Icon Previews For" ) );
    previewListView->header()->setClickEnabled( false, previewListView->header()->count() - 1 );
    previewListView->header()->setResizeEnabled( false, previewListView->header()->count() - 1 );
    previewListView->setFullWidth( true );

    tabLayout_2->addWidget( previewListView, 2, 0 );
    behaviorTab->insertTab( tab_2, TQString::fromLatin1("") );

    tab_3 = new TQWidget( behaviorTab, "tab_3" );
    tabLayout_3 = new TQVBoxLayout( tab_3, 11, 6, "tabLayout_3"); 

    enableMediaBox = new TQCheckBox( tab_3, "enableMediaBox" );
    tabLayout_3->addWidget( enableMediaBox );

    enableMediaFreeSpaceOverlayBox = new TQCheckBox( tab_3, "enableMediaFreeSpaceOverlayBox" );
    tabLayout_3->addWidget( enableMediaFreeSpaceOverlayBox );

    mediaListView = new TDEListView( tab_3, "mediaListView" );
    mediaListView->addColumn( tr2i18n( "Device Types to Display" ) );
    mediaListView->header()->setClickEnabled( false, mediaListView->header()->count() - 1 );
    mediaListView->header()->setResizeEnabled( false, mediaListView->header()->count() - 1 );
    mediaListView->setEnabled( true );
    mediaListView->setFullWidth( true );
    tabLayout_3->addWidget( mediaListView );
    behaviorTab->insertTab( tab_3, TQString::fromLatin1("") );
    DesktopBehaviorBaseLayout->addWidget( behaviorTab );
    languageChange();
    resize( TQSize(791, 501).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( autoLineupIconsBox, showHiddenBox );
    setTabOrder( showHiddenBox, previewListView );
    setTabOrder( previewListView, enableMediaBox );
    setTabOrder( enableMediaBox, mediaListView );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DesktopBehaviorBase::languageChange()
{
    iconsGroupBox->setTitle( tr2i18n( "Desktop Icons" ) );
    iconsEnabledBox->setText( tr2i18n( "&Show icons on desktop" ) );
    TQWhatsThis::add( iconsEnabledBox, tr2i18n( "Uncheck this option if you do not want to have icons on the desktop. Without icons the desktop will be somewhat faster but you will no longer be able to drag files to the desktop." ) );
    vrootBox->setText( tr2i18n( "Allow pro&grams in desktop window" ) );
    TQWhatsThis::add( vrootBox, tr2i18n( "Check this option if you want to run X11 programs that draw into the desktop such as xsnow, xpenguin or xmountain. If you have problems with applications like netscape that check the root window for running instances, disable this option." ) );
    toolTipBox->setText( tr2i18n( "Show &tooltips" ) );
    lockInPlaceBox->setText( tr2i18n( "Lock in Place" ) );
    TQWhatsThis::add( lockInPlaceBox, tr2i18n( "Check this option if you want to prevent your icons from being dragged around." ) );
    autoLineupIconsBox->setText( tr2i18n( "Align to grid" ) );
    TQWhatsThis::add( autoLineupIconsBox, tr2i18n( "Check this option if you want to see your icons automatically aligned to the grid when you move them." ) );
    spacingLabel->setText( tr2i18n( "Icon Spacing:" ) );
    TQWhatsThis::add( spacingLabel, tr2i18n( "Changing this value controls how close or far to each other the icons are placed on the desktop. This option has effect only if the \"Align to Grid\" option is enabled." ) );
    spacingValue->setSpecialValueText( tr2i18n( "Default" ) );
    spacingValue->setSuffix( tr2i18n( " px" ) );
    TQWhatsThis::add( spacingValue, tr2i18n( "Changing this value controls how close or far to each other the icons are placed on the desktop. This option has effect only if the \"Align to Grid\" option is enabled." ) );
    spacingCtrlScroll->setText( tr2i18n( "Ctrl+Mouse Scroll changes spacing" ) );
    TQWhatsThis::add( spacingCtrlScroll, tr2i18n( "Check this if you want to change desktop icon spacing by pressing Ctrl and scrolling on the desktop background." ) );
    desktopMenuGroup->setTitle( tr2i18n( "Menu Bar at Top of Screen" ) );
    radioButton1->setText( tr2i18n( "&None" ) );
    TQWhatsThis::add( radioButton1, tr2i18n( "If this option is selected, there is no menu bar at the top of the screen." ) );
    radioButton1_2->setText( tr2i18n( "&Desktop menu bar" ) );
    TQWhatsThis::add( radioButton1_2, tr2i18n( "If this option is selected, there is one menu bar at the top of the screen which shows the desktop menus." ) );
    radioButton1_3->setText( tr2i18n( "&Current application's menu bar (Mac OS-style)" ) );
    TQWhatsThis::add( radioButton1_3, tr2i18n( "If this option is selected, applications will not have their menu bar attached to their own window anymore. Instead, there is one menu bar at the top of the screen which shows the menus of the currently active application. You might recognize this behavior from Mac OS." ) );
    groupBox3->setTitle( tr2i18n( "Mouse Button Actions" ) );
    middleLabel->setText( tr2i18n( "Middle button:" ) );
    leftLabel->setText( tr2i18n( "Left button:" ) );
    rightLabel->setText( tr2i18n( "Right button:" ) );
    leftEditButton->setText( tr2i18n( "Edit..." ) );
    middleEditButton->setText( tr2i18n( "Edit..." ) );
    rightEditButton->setText( tr2i18n( "Edit..." ) );
    behaviorTab->changeTab( tab, tr2i18n( "General" ) );
    showHiddenBox->setText( tr2i18n( "Show &hidden files" ) );
    TQWhatsThis::add( showHiddenBox, tr2i18n( "<p>If you check this option, any files in your desktop directory that begin with a period (.) will be shown. Usually, such files contain configuration information, and remain hidden from view.</p>\n"
"<p>For example, files which are named \".directory\" are plain text files which contain information for Konqueror, such as the icon to use in displaying a directory, the order in which files should be sorted, etc. You should not change or delete these files unless you know what you are doing.</p>" ) );
    previewListView->header()->setLabel( 0, tr2i18n( "Show Icon Previews For" ) );
    TQWhatsThis::add( previewListView, tr2i18n( "Select for which types of files you want to enable preview images." ) );
    behaviorTab->changeTab( tab_2, tr2i18n( "File Icons" ) );
    enableMediaBox->setText( tr2i18n( "&Show device icons" ) );
    enableMediaFreeSpaceOverlayBox->setText( tr2i18n( "&Show free space overlay on device icons" ) );
    mediaListView->header()->setLabel( 0, tr2i18n( "Device Types to Display" ) );
    TQWhatsThis::add( mediaListView, tr2i18n( "Deselect the device types which you do not want to see on the desktop." ) );
    behaviorTab->changeTab( tab_3, tr2i18n( "Device Icons" ) );
}

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

TQMetaObject *DesktopBehaviorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DesktopBehaviorBase( "DesktopBehaviorBase", &DesktopBehaviorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* DesktopBehaviorBase::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(
	"DesktopBehaviorBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_DesktopBehaviorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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