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

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

#include "wpeditaccountbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <knuminput.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqtabwidget.h>
#include <ntqgroupbox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    labelStatusMessage = new TQLabel( this, "labelStatusMessage" );
    labelStatusMessage->setAlignment( int( TQLabel::AlignCenter ) );

    WPEditAccountBaseLayout->addWidget( labelStatusMessage, 0, 1 );

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

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

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

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

    label1 = new TQLabel( groupBox51, "label1" );
    layout40->addWidget( label1 );

    mHostName = new TQLineEdit( groupBox51, "mHostName" );
    layout40->addWidget( mHostName );

    doInstallSamba = new KPushButton( groupBox51, "doInstallSamba" );
    layout40->addWidget( doInstallSamba );
    groupBox51Layout->addLayout( layout40 );
    tabLayout->addWidget( groupBox51 );

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

    textLabel12 = new TQLabel( groupBox22, "textLabel12" );
    textLabel12->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)1, 0, 0, textLabel12->sizePolicy().hasHeightForWidth() ) );
    textLabel12->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    groupBox22Layout->addWidget( textLabel12 );

    textLabel1_3 = new TQLabel( groupBox22, "textLabel1_3" );
    groupBox22Layout->addWidget( textLabel1_3 );

    textLabel1_2 = new TQLabel( groupBox22, "textLabel1_2" );
    textLabel1_2->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    groupBox22Layout->addWidget( textLabel1_2 );
    tabLayout->addWidget( groupBox22 );
    spacer7 = new TQSpacerItem( 21, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer7 );
    tabWidget10->insertTab( tab, TQString::fromLatin1("") );

    TabPage = new TQWidget( tabWidget10, "TabPage" );
    TabPageLayout = new TQGridLayout( TabPage, 1, 1, 11, 6, "TabPageLayout"); 
    spacer4 = new TQSpacerItem( 20, 135, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    TabPageLayout->addItem( spacer4, 2, 0 );

    groupBox5 = new TQGroupBox( TabPage, "groupBox5" );
    groupBox5->setColumnLayout(0, TQt::Vertical );
    groupBox5->layout()->setSpacing( 6 );
    groupBox5->layout()->setMargin( 11 );
    groupBox5Layout = new TQGridLayout( groupBox5->layout() );
    groupBox5Layout->setAlignment( TQt::AlignTop );

    textLabel2_2 = new TQLabel( groupBox5, "textLabel2_2" );

    groupBox5Layout->addMultiCellWidget( textLabel2_2, 1, 1, 0, 1 );

    TabPageLayout->addWidget( groupBox5, 1, 0 );

    groupBox4 = new TQGroupBox( TabPage, "groupBox4" );
    groupBox4->setColumnLayout(0, TQt::Vertical );
    groupBox4->layout()->setSpacing( 6 );
    groupBox4->layout()->setMargin( 11 );
    groupBox4Layout = new TQGridLayout( groupBox4->layout() );
    groupBox4Layout->setAlignment( TQt::AlignTop );

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

    groupBox4Layout->addWidget( textLabel4, 0, 0 );

    textLabel1 = new TQLabel( groupBox4, "textLabel1" );

    groupBox4Layout->addWidget( textLabel1, 1, 0 );

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

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

    mHostCheckFreq = new KIntSpinBox( groupBox4, "mHostCheckFreq" );
    mHostCheckFreq->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, mHostCheckFreq->sizePolicy().hasHeightForWidth() ) );
    mHostCheckFreq->setMaxValue( 3600 );
    mHostCheckFreq->setMinValue( 1 );
    layout5->addWidget( mHostCheckFreq );

    textLabel6 = new TQLabel( groupBox4, "textLabel6" );
    textLabel6->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)5, 0, 0, textLabel6->sizePolicy().hasHeightForWidth() ) );
    layout5->addWidget( textLabel6 );
    layout6->addLayout( layout5 );

    mSmbcPath = new KURLRequester( groupBox4, "mSmbcPath" );
    layout6->addWidget( mSmbcPath );

    groupBox4Layout->addMultiCellLayout( layout6, 0, 1, 1, 1 );

    TabPageLayout->addWidget( groupBox4, 0, 0 );
    tabWidget10->insertTab( TabPage, TQString::fromLatin1("") );

    WPEditAccountBaseLayout->addWidget( tabWidget10, 0, 0 );
    languageChange();
    resize( TQSize(398, 445).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( doInstallSamba, TQ_SIGNAL( clicked() ), this, TQ_SLOT( installSamba() ) );

    // tab order
    setTabOrder( tabWidget10, mHostName );
    setTabOrder( mHostName, doInstallSamba );

    // buddies
    label1->setBuddy( mHostName );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void WPEditAccountBase::languageChange()
{
    setCaption( tr2i18n( "Account Preferences - WinPopup" ) );
    labelStatusMessage->setText( TQString::null );
    groupBox51->setTitle( tr2i18n( "Account Information" ) );
    label1->setText( tr2i18n( "Hos&tname:" ) );
    TQToolTip::add( label1, tr2i18n( "The hostname you would like to use to send WinPopup messages as." ) );
    TQWhatsThis::add( label1, tr2i18n( "The hostname you would like to use to send WinPopup messages as.  Note that this does not have to be the actual hostname of the machine to send messages, but it does to receive them." ) );
    TQToolTip::add( mHostName, tr2i18n( "The hostname you would like to use to send WinPopup messages as." ) );
    TQWhatsThis::add( mHostName, tr2i18n( "The hostname you would like to use to send WinPopup messages as.  Note that this does not have to be the actual hostname of the machine to send messages, but it does to receive them." ) );
    doInstallSamba->setText( tr2i18n( "I&nstall Into Samba" ) );
    TQToolTip::add( doInstallSamba, tr2i18n( "Install support into Samba to enable this service." ) );
    TQWhatsThis::add( doInstallSamba, tr2i18n( "Install support into Samba to enable this service." ) );
    groupBox22->setTitle( tr2i18n( "Information" ) );
    textLabel12->setText( tr2i18n( "To receive WinPopup messages sent from other machines, the hostname above must be set to this machine's hostname." ) );
    textLabel1_3->setText( tr2i18n( "The samba server must be configured and running." ) );
    textLabel1_2->setText( tr2i18n( "\"Install into Samba\" is a simple method to create the directory for the temporary message files and configure your samba server.<br>\n"
"However, the recommended way is to ask your administrator to create this directory ('mkdir -p -m 0777 /var/lib/winpopup') and add\n"
"'message command = _PATH_TO_/winpopup-send.sh %s %m %t &' (substitute _PATH_TO_ by the real path) to your smb.conf [global]-section." ) );
    tabWidget10->changeTab( tab, tr2i18n( "Basi&c Setup" ) );
    groupBox5->setTitle( tr2i18n( "Information" ) );
    textLabel2_2->setText( tr2i18n( "<i>These options apply to all WinPopup accounts.</i>" ) );
    groupBox4->setTitle( tr2i18n( "Protocol Preferences" ) );
    textLabel4->setText( tr2i18n( "Host check frequency:" ) );
    textLabel1->setText( tr2i18n( "Path to 'smbclient' executable:" ) );
    textLabel6->setText( tr2i18n( "second(s)" ) );
    tabWidget10->changeTab( TabPage, tr2i18n( "S&ystem" ) );
}

void WPEditAccountBase::installSamba()
{
    tqWarning( "WPEditAccountBase::installSamba(): Not implemented yet" );
}

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

TQMetaObject *WPEditAccountBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_WPEditAccountBase( "WPEditAccountBase", &WPEditAccountBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* WPEditAccountBase::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 = {"installSamba", 0, 0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "installSamba()", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"WPEditAccountBase", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_WPEditAccountBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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