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

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

#include "smserverconfigdlg.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    confirmLogoutCheck = new TQCheckBox( topBox, "confirmLogoutCheck" );
    topBoxLayout->addWidget( confirmLogoutCheck );

    showFadeAway = new TQCheckBox( topBox, "showFadeAway" );
    showFadeAway->setEnabled( false );
    topBoxLayout->addWidget( showFadeAway );

    showFancyFadeAway = new TQCheckBox( topBox, "showFancyFadeAway" );
    showFancyFadeAway->setEnabled( false );
    topBoxLayout->addWidget( showFancyFadeAway );

    offerShutdownCheck = new TQCheckBox( topBox, "offerShutdownCheck" );
    topBoxLayout->addWidget( offerShutdownCheck );

    showLogoutStatusDialog = new TQCheckBox( topBox, "showLogoutStatusDialog" );
    topBoxLayout->addWidget( showLogoutStatusDialog );

    showUbuntuStyleDialog = new TQCheckBox( topBox, "showUbuntuStyleDialog" );
    topBoxLayout->addWidget( showUbuntuStyleDialog );
    SMServerConfigDlgLayout->addWidget( topBox );

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

    previousSessionRadio = new TQRadioButton( loginGroup, "previousSessionRadio" );
    loginGroupLayout->addWidget( previousSessionRadio );

    savedSessionRadio = new TQRadioButton( loginGroup, "savedSessionRadio" );
    loginGroupLayout->addWidget( savedSessionRadio );

    emptySessionRadio = new TQRadioButton( loginGroup, "emptySessionRadio" );
    loginGroupLayout->addWidget( emptySessionRadio );
    SMServerConfigDlgLayout->addWidget( loginGroup );

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

    logoutRadio = new TQRadioButton( sdGroup, "logoutRadio" );
    sdGroupLayout->addWidget( logoutRadio );

    haltRadio = new TQRadioButton( sdGroup, "haltRadio" );
    sdGroupLayout->addWidget( haltRadio );

    rebootRadio = new TQRadioButton( sdGroup, "rebootRadio" );
    sdGroupLayout->addWidget( rebootRadio );
    SMServerConfigDlgLayout->addWidget( sdGroup );

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

    textLabel1 = new TQLabel( advancedGroup, "textLabel1" );
    advancedGroupLayout->addWidget( textLabel1 );

    excludeLineedit = new KLineEdit( advancedGroup, "excludeLineedit" );
    advancedGroupLayout->addWidget( excludeLineedit );
    SMServerConfigDlgLayout->addWidget( advancedGroup );
    bottomSpacer = new TQSpacerItem( 20, 130, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    SMServerConfigDlgLayout->addItem( bottomSpacer );
    languageChange();
    resize( TQSize(325, 366).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( confirmLogoutCheck, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( fadeAwayConfigChanged() ) );
    connect( showFadeAway, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( fadeAwayConfigChanged() ) );
    connect( showFancyFadeAway, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( fadeAwayConfigChanged() ) );
    connect( showLogoutStatusDialog, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( configChanged() ) );
    connect( showUbuntuStyleDialog, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( configChanged() ) );
    connect( loginGroup, TQ_SIGNAL( clicked(int) ), this, TQ_SLOT( configChanged() ) );
    connect( sdGroup, TQ_SIGNAL( clicked(int) ), this, TQ_SLOT( configChanged() ) );
    connect( excludeLineedit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( configChanged() ) );
    connect( offerShutdownCheck, TQ_SIGNAL( toggled(bool) ), sdGroup, TQ_SLOT( setEnabled(bool) ) );
    connect( offerShutdownCheck, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( configChanged() ) );

    // buddies
    textLabel1->setBuddy( excludeLineedit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SMServerConfigDlg::languageChange()
{
    setCaption( tr2i18n( "Session Manager" ) );
    topBox->setTitle( tr2i18n( "General" ) );
    confirmLogoutCheck->setText( tr2i18n( "Conf&irm logout" ) );
    TQWhatsThis::add( confirmLogoutCheck, tr2i18n( "Check this option if you want the session manager to display a logout confirmation dialog box." ) );
    showFadeAway->setText( tr2i18n( "Fadeaway screen during &logout" ) );
    TQWhatsThis::add( showFadeAway, tr2i18n( "Check this option if you want screen to be faded when displaying a logout confirmation dialog box." ) );
    showFancyFadeAway->setText( tr2i18n( "Use effects for logout fadea&way" ) );
    TQWhatsThis::add( showFancyFadeAway, tr2i18n( "Check this option if you want to enable additional graphical effects for fadeaway during logout process. Namely the fadeaway will be smoothly animated and semitransparent." ) );
    offerShutdownCheck->setText( tr2i18n( "O&ffer shutdown options" ) );
    TQWhatsThis::add( offerShutdownCheck, tr2i18n( "Check this option if you want to see various options when displaying a logout confirmation dialog box." ) );
    showLogoutStatusDialog->setText( tr2i18n( "Show logout stat&us dialog" ) );
    TQWhatsThis::add( showLogoutStatusDialog, tr2i18n( "Check this option if you want to see a dialog box showing the logout status." ) );
    showUbuntuStyleDialog->setText( tr2i18n( "Use &alternative shutdown dialog layout" ) );
    TQWhatsThis::add( showUbuntuStyleDialog, tr2i18n( "Check this option if you want to use an alternative shutdown dialog, where buttons are arranged in rows rathen then columns. This layout is popular in Ubuntu and therefore it is also known as 'Ubuntu style' shutdown dialog." ) );
    loginGroup->setTitle( tr2i18n( "On Login" ) );
    TQWhatsThis::add( loginGroup, tr2i18n( "<ul>\n"
"<li><b>Restore previous session:</b> Will save all applications running on exit and restore them when they next start up</li>\n"
"<li><b>Restore manually saved session: </b> Allows the session to be saved at any time via \"Save Session\" in the TDE Menu. This means the currently started applications will reappear when they next start up.</li>\n"
"<li><b>Start with an empty session:</b> Do not save anything. Will come up with an empty desktop on next start.</li>\n"
"</ul>" ) );
    previousSessionRadio->setText( tr2i18n( "Restore &previous session" ) );
    savedSessionRadio->setText( tr2i18n( "Restore &manually saved session" ) );
    emptySessionRadio->setText( tr2i18n( "Start with an empty &session" ) );
    sdGroup->setTitle( tr2i18n( "Default Shutdown Option" ) );
    TQWhatsThis::add( sdGroup, tr2i18n( "Here you can choose what should happen by default when you log out. This only has meaning, if you logged in through TDM." ) );
    logoutRadio->setText( tr2i18n( "&End current session" ) );
    haltRadio->setText( tr2i18n( "&Turn off computer" ) );
    rebootRadio->setText( tr2i18n( "&Restart computer" ) );
    advancedGroup->setTitle( tr2i18n( "Advanced" ) );
    textLabel1->setText( tr2i18n( "Applications to be e&xcluded from sessions:" ) );
    TQWhatsThis::add( excludeLineedit, tr2i18n( "Here you can enter a comma-separated list of applications that should not be saved in sessions, and therefore will not be started when restoring a session. For example 'xterm,xconsole'." ) );
}

void SMServerConfigDlg::configChanged()
{
    tqWarning( "SMServerConfigDlg::configChanged(): Not implemented yet" );
}

void SMServerConfigDlg::fadeAwayConfigChanged()
{
    tqWarning( "SMServerConfigDlg::fadeAwayConfigChanged(): Not implemented yet" );
}

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

TQMetaObject *SMServerConfigDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SMServerConfigDlg( "SMServerConfigDlg", &SMServerConfigDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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