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

#include "desktopbehavior.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qheader.h>
#include <klistview.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "klistview.h"

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

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

    tab = new QWidget( behaviorTab, "tab" );
    tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    iconsEnabledBox = new QCheckBox( tab, "iconsEnabledBox" );
    iconsEnabledBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, iconsEnabledBox->sizePolicy().hasHeightForWidth() ) );

    tabLayout->addWidget( iconsEnabledBox, 0, 0 );

    layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
    spacer3 = new QSpacerItem( 20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout1->addItem( spacer3 );

    vrootBox = new QCheckBox( tab, "vrootBox" );
    vrootBox->setEnabled( FALSE );
    layout1->addWidget( vrootBox );

    tabLayout->addLayout( layout1, 1, 0 );

    toolTipBox = new QCheckBox( tab, "toolTipBox" );

    tabLayout->addWidget( toolTipBox, 2, 0 );

    desktopMenuGroup = new QButtonGroup( tab, "desktopMenuGroup" );
    desktopMenuGroup->setColumnLayout(0, Qt::Vertical );
    desktopMenuGroup->layout()->setSpacing( 6 );
    desktopMenuGroup->layout()->setMargin( 11 );
    desktopMenuGroupLayout = new QVBoxLayout( desktopMenuGroup->layout() );
    desktopMenuGroupLayout->setAlignment( Qt::AlignTop );

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

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

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

    tabLayout->addWidget( desktopMenuGroup, 3, 0 );

    groupBox3 = new QGroupBox( tab, "groupBox3" );
    groupBox3->setColumnLayout(0, Qt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new QGridLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( Qt::AlignTop );

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

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

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

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

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

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

    rightComboBox = new QComboBox( FALSE, groupBox3, "rightComboBox" );
    rightComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, rightComboBox->sizePolicy().hasHeightForWidth() ) );

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

    leftComboBox = new QComboBox( FALSE, groupBox3, "leftComboBox" );
    leftComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, leftComboBox->sizePolicy().hasHeightForWidth() ) );

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

    leftEditButton = new QPushButton( groupBox3, "leftEditButton" );
    leftEditButton->setEnabled( FALSE );

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

    middleComboBox = new QComboBox( FALSE, groupBox3, "middleComboBox" );
    middleComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, middleComboBox->sizePolicy().hasHeightForWidth() ) );

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

    middleEditButton = new QPushButton( groupBox3, "middleEditButton" );
    middleEditButton->setEnabled( FALSE );

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

    rightEditButton = new QPushButton( groupBox3, "rightEditButton" );
    rightEditButton->setEnabled( FALSE );

    groupBox3Layout->addWidget( rightEditButton, 2, 2 );
    spacer5 = new QSpacerItem( 191, 80, QSizePolicy::Expanding, QSizePolicy::Minimum );
    groupBox3Layout->addMultiCell( spacer5, 0, 2, 3, 3 );

    tabLayout->addWidget( groupBox3, 4, 0 );
    spacer8 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
    tabLayout->addItem( spacer8, 5, 0 );
    behaviorTab->insertTab( tab, QString::fromLatin1("") );

    tab_2 = new QWidget( behaviorTab, "tab_2" );
    tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    autoLineupIconsBox = new QCheckBox( tab_2, "autoLineupIconsBox" );

    tabLayout_2->addWidget( autoLineupIconsBox, 0, 0 );

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

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

    previewListView = new KListView( 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, QString::fromLatin1("") );

    tab_3 = new QWidget( behaviorTab, "tab_3" );
    tabLayout_3 = new QVBoxLayout( tab_3, 11, 6, "tabLayout_3"); 

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

    mediaListView = new KListView( 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( FALSE );
    mediaListView->setFullWidth( TRUE );
    tabLayout_3->addWidget( mediaListView );
    behaviorTab->insertTab( tab_3, QString::fromLatin1("") );
    DesktopBehaviorBaseLayout->addWidget( behaviorTab );
    languageChange();
    resize( QSize(791, 501).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( enableMediaBox, SIGNAL( toggled(bool) ), mediaListView, SLOT( setEnabled(bool) ) );

    // 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, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DesktopBehaviorBase::languageChange()
{
    iconsEnabledBox->setText( tr2i18n( "&Show icons on desktop" ) );
    QWhatsThis::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" ) );
    QWhatsThis::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" ) );
    desktopMenuGroup->setTitle( tr2i18n( "Menu Bar at Top of Screen" ) );
    radioButton1->setText( tr2i18n( "&None" ) );
    QWhatsThis::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" ) );
    QWhatsThis::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)" ) );
    QWhatsThis::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" ) );
    autoLineupIconsBox->setText( tr2i18n( "Automatically &line up icons" ) );
    QWhatsThis::add( autoLineupIconsBox, tr2i18n( "Check this option if you want to see your icons automatically aligned to the grid when you move them." ) );
    showHiddenBox->setText( tr2i18n( "Show &hidden files" ) );
    QWhatsThis::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" ) );
    QWhatsThis::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:" ) );
    mediaListView->header()->setLabel( 0, tr2i18n( "Device Types to Display" ) );
    QWhatsThis::add( mediaListView, tr2i18n( "Deselect the device types which you do not want to see on the desktop." ) );
    behaviorTab->changeTab( tab_3, tr2i18n( "Device Icons" ) );
}

#include "desktopbehavior.moc"
