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

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

#include "kpropertiesdesktopbase.h"

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

/*
 *  Constructs a KPropertiesDesktopBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KPropertiesDesktopBase::KPropertiesDesktopBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "KPropertiesDesktopBase" );
    KPropertiesDesktopBaseLayout = new TQGridLayout( this, 1, 1, 0, 6, "KPropertiesDesktopBaseLayout"); 
    spacer6 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    KPropertiesDesktopBaseLayout->addMultiCell( spacer6, 5, 5, 3, 4 );

    textLabel7 = new TQLabel( this, "textLabel7" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel7, 6, 6, 0, 6 );

    filetypeList = new TDEListView( this, "filetypeList" );
    filetypeList->addColumn( tr2i18n( "Mimetype" ) );
    filetypeList->addColumn( tr2i18n( "Description" ) );
    filetypeList->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, filetypeList->sizePolicy().hasHeightForWidth() ) );
    filetypeList->setFullWidth( true );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( filetypeList, 7, 7, 0, 6 );

    nameLabel = new TQLabel( this, "nameLabel" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( nameLabel, 0, 0, 0, 1 );

    nameEdit = new KLineEdit( this, "nameEdit" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( nameEdit, 0, 0, 2, 6 );

    textLabel2 = new TQLabel( this, "textLabel2" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel2, 1, 1, 0, 1 );

    genNameEdit = new KLineEdit( this, "genNameEdit" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( genNameEdit, 1, 1, 2, 6 );

    textLabel3 = new TQLabel( this, "textLabel3" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel3, 2, 2, 0, 1 );

    commentEdit = new KLineEdit( this, "commentEdit" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( commentEdit, 2, 2, 2, 6 );

    textLabel4 = new TQLabel( this, "textLabel4" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel4, 3, 3, 0, 1 );

    commandEdit = new KLineEdit( this, "commandEdit" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( commandEdit, 3, 3, 2, 5 );

    browseButton = new TQPushButton( this, "browseButton" );

    KPropertiesDesktopBaseLayout->addWidget( browseButton, 3, 6 );

    textLabel5 = new TQLabel( this, "textLabel5" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel5, 4, 4, 0, 1 );

    pathEdit = new KURLRequester( this, "pathEdit" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( pathEdit, 4, 4, 2, 6 );

    addFiletypeButton = new TQPushButton( this, "addFiletypeButton" );

    KPropertiesDesktopBaseLayout->addWidget( addFiletypeButton, 8, 0 );
    spacer31_2 = new TQSpacerItem( 53, 20, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    KPropertiesDesktopBaseLayout->addMultiCell( spacer31_2, 8, 8, 1, 2 );

    delFiletypeButton = new TQPushButton( this, "delFiletypeButton" );

    KPropertiesDesktopBaseLayout->addWidget( delFiletypeButton, 8, 3 );
    spacer31_3 = new TQSpacerItem( 53, 20, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    KPropertiesDesktopBaseLayout->addItem( spacer31_3, 8, 4 );

    advancedButton = new TQPushButton( this, "advancedButton" );

    KPropertiesDesktopBaseLayout->addMultiCellWidget( advancedButton, 8, 8, 5, 6 );
    languageChange();
    resize( TQSize(449, 304).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // buddies
    textLabel7->setBuddy( filetypeList );
    nameLabel->setBuddy( nameEdit );
    textLabel2->setBuddy( genNameEdit );
    textLabel3->setBuddy( commentEdit );
    textLabel4->setBuddy( commandEdit );
    textLabel5->setBuddy( pathEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KPropertiesDesktopBase::languageChange()
{
    textLabel7->setText( tr2i18n( "&Supported file types:" ) );
    TQWhatsThis::add( textLabel7, tr2i18n( "<qt><p>This list should show the types of file that your application can handle. This list is organized by <u>mimetypes</u>.</p>\n"
"<p>MIME, Multipurpose Internet (e)Mail Extension, is a standard protocol for identifying the type of data based on filename extensions and correspondent <u>mimetypes</u>. Example: the \"bmp\" part that comes after the dot in flower.bmp indicates that it is a specific kind of image, <u>image/x-bmp</u>. To know which application should open each type of file, the system should be informed about the abilities of each application to handle these extensions and mimetypes.</p>\n"
"<p>If you want to associate this application with one or more mimetypes that are not in this list, click on the button <b>Add</b> below. If there are one or more filetypes that this application cannot handle, you may want to remove them from the list clicking on the button <b>Remove</b> below.</p></qt>" ) );
    filetypeList->header()->setLabel( 0, tr2i18n( "Mimetype" ) );
    filetypeList->header()->setLabel( 1, tr2i18n( "Description" ) );
    TQWhatsThis::add( filetypeList, tr2i18n( "<qt><p>This list should show the types of file that your application can handle. This list is organized by <u>mimetypes</u>.</p>\n"
"<p>MIME, Multipurpose Internet (e)Mail Extension, is a standard protocol for identifying the type of data based on filename extensions and correspondent <u>mimetypes</u>. Example: the \"bmp\" part that comes after the dot in flower.bmp indicates that it is a specific kind of image, <u>image/x-bmp</u>. To know which application should open each type of file, the system should be informed about the abilities of each application to handle these extensions and mimetypes.</p>\n"
"<p>If you want to associate this application with one or more mimetypes that are not in this list, click on the button <b>Add</b> below. If there are one or more filetypes that this application cannot handle, you may want to remove them from the list clicking on the button <b>Remove</b> below.</p></qt>" ) );
    nameLabel->setText( tr2i18n( "&Name:" ) );
    TQWhatsThis::add( nameLabel, tr2i18n( "Type the name you want to give to this application here. This application will appear under this name in the applications menu and in the panel." ) );
    TQWhatsThis::add( nameEdit, tr2i18n( "Type the name you want to give to this application here. This application will appear under this name in the applications menu and in the panel." ) );
    textLabel2->setText( tr2i18n( "&Description:" ) );
    TQWhatsThis::add( textLabel2, tr2i18n( "Type the description of this application, based on its use, here. Examples: a dial up application (KPPP) would be \"Dial up tool\"." ) );
    TQWhatsThis::add( genNameEdit, tr2i18n( "Type the description of this application, based on its use, here. Examples: a dial up application (KPPP) would be \"Dial up tool\"." ) );
    textLabel3->setText( tr2i18n( "Comm&ent:" ) );
    TQWhatsThis::add( textLabel3, tr2i18n( "Type any comment you think is useful here." ) );
    TQWhatsThis::add( commentEdit, tr2i18n( "Type any comment you think is useful here." ) );
    textLabel4->setText( tr2i18n( "Co&mmand:" ) );
    TQWhatsThis::add( textLabel4, tr2i18n( "Type the command to start this application here.\n"
"\n"
"Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
"%f - a single file name\n"
"%F - a list of files; use for applications that can open several local files at once\n"
"%u - a single URL\n"
"%U - a list of URLs\n"
"%d - the directory of the file to open\n"
"%D - a list of directories\n"
"%i - the icon\n"
"%m - the mini-icon\n"
"%c - the caption" ) );
    TQWhatsThis::add( commandEdit, tr2i18n( "Type the command to start this application here.\n"
"\n"
"Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
"%f - a single file name\n"
"%F - a list of files; use for applications that can open several local files at once\n"
"%u - a single URL\n"
"%U - a list of URLs\n"
"%d - the directory of the file to open\n"
"%D - a list of directories\n"
"%i - the icon\n"
"%m - the mini-icon\n"
"%c - the caption" ) );
    browseButton->setText( tr2i18n( "&Browse..." ) );
    TQWhatsThis::add( browseButton, tr2i18n( "Click here to browse your file system in order to find the desired executable." ) );
    textLabel5->setText( tr2i18n( "&Work path:" ) );
    TQWhatsThis::add( textLabel5, tr2i18n( "Sets the working directory for your application." ) );
    TQWhatsThis::add( pathEdit, tr2i18n( "Sets the working directory for your application." ) );
    addFiletypeButton->setText( tr2i18n( "Add..." ) );
    TQWhatsThis::add( addFiletypeButton, tr2i18n( "Click on this button if you want to add a type of file (mimetype) that your application can handle." ) );
    delFiletypeButton->setText( tr2i18n( "Remove" ) );
    TQWhatsThis::add( delFiletypeButton, tr2i18n( "If you want to remove a type of file (mimetype) that your application cannot handle, select the mimetype in the list above and click on this button." ) );
    advancedButton->setText( tr2i18n( "Ad&vanced Options" ) );
    TQWhatsThis::add( advancedButton, tr2i18n( "Click here to modify the way this application will run, launch feedback, DCOP options or to run it as a different user." ) );
}

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

TQMetaObject *KPropertiesDesktopBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KPropertiesDesktopBase( "KPropertiesDesktopBase", &KPropertiesDesktopBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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