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

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

#include "newssourcedlg.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <klineedit.h>
#include <kcombobox.h>
#include <knuminput.h>
#include <ntqcheckbox.h>
#include <kurlrequester.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

static const char* const image0_data[] = { 
"16 16 89 2",
"Qt c None",
".3 c #000000",
"#o c #000400",
"#n c #080408",
".Q c #181c18",
".# c #202010",
".E c #202420",
".L c #292429",
"#j c #292c29",
".w c #312c31",
"#w c #313031",
".4 c #393839",
".e c #393c39",
".d c #413c41",
".k c #414041",
".J c #414441",
".A c #4a4429",
".I c #4a444a",
".z c #524429",
".j c #5a5000",
".c c #625000",
".K c #6a656a",
"#k c #6a696a",
".P c #6a6d6a",
".a c #736d39",
".T c #737173",
".D c #7b757b",
".C c #7b797b",
"#e c #7b7d7b",
".t c #837510",
".y c #837518",
".B c #837d83",
"## c #838183",
".o c #8b7920",
".b c #8b7d29",
".6 c #8b858b",
".Y c #8b898b",
".W c #8b8d8b",
".X c #948d94",
".S c #949194",
".O c #949594",
".H c #9c959c",
".N c #9c999c",
".F c #9c9d9c",
".G c #a49da4",
".x c #a4a1a4",
".f c #ac9941",
".s c #ac9d41",
".i c #aca162",
"#d c #b4b2b4",
".9 c #bdae94",
".r c #bdb673",
"#. c #bdb6bd",
".v c #bdbebd",
"#m c #c59d73",
"#v c #c5a173",
"#i c #c5a17b",
"#g c #c5a583",
"#c c #c5aa8b",
"#t c #c5ae8b",
"#r c #c5b6a4",
".2 c #c5b6b4",
".5 c #c5bec5",
".u c #c5c2c5",
"#u c #cdaa83",
"#s c #cdb29c",
"#q c #cdbeac",
"#p c #cdbeb4",
".V c #cdcacd",
".h c #d5ce94",
".R c #d5d2d5",
".q c #dece94",
".M c #ded6de",
".n c #dedede",
".1 c #e6dede",
".m c #e6dee6",
".l c #e6e2e6",
"#l c #eecaa4",
"#h c #eed2ac",
"#f c #f6dabd",
"#b c #f6dec5",
".8 c #f6e6d5",
".7 c #f6eade",
"#a c #ffeade",
".0 c #fff2ee",
".p c #fff6de",
".Z c #fff6f6",
".U c #fffaf6",
".g c #ffffff",
"QtQtQtQtQt.#.a.b.cQtQtQtQtQtQtQt",
"Qt.d.e.d.e.f.g.h.i.j.e.d.e.dQtQt",
".k.l.m.n.o.p.q.r.s.t.c.u.u.v.wQt",
".e.m.x.x.y.j.j.z.A.A.A.B.C.D.EQt",
".d.n.x.F.G.H.I.J.I.J.I.J.I.K.LQt",
".e.M.N.N.O.H.J.l.n.l.n.l.P.J.QQt",
".d.R.N.H.H.S.I.m.g.g.g.g.T.U.IQt",
".e.V.S.S.W.X.J.l.g.g.g.g.T.T.k.J",
".d.u.S.W.X.Y.I.m.g.g.g.Z.0.1.2.3",
".4.5.Y.Y.6.6.J.l.g.g.Z.0.7.8.9.3",
".e#..Y.6.6##.I.m.g.Z.0#a.8#b#c.3",
".4#d#####e##.J.l.Z.0.7.8#b#f#g.3",
".4#d###e.B.C.I.m.0#a.8#b#f#h#i.3",
"#j#k#k.P#k#k.J.l.7.8#b#f#h#l#m.3",
"Qt.3#n.3#n#o.I#p#q#r#s#t#u#v#m.3",
"QtQtQtQtQtQt.J.3.3.3.3.3.3.3.3#w"};

static const char* const image1_data[] = { 
"16 16 17 1",
". c None",
"b c #000000",
"a c #00385a",
"# c #003862",
"f c #00406a",
"i c #004473",
"e c #00508b",
"d c #005594",
"o c #00599c",
"c c #2981c5",
"k c #2985c5",
"h c #3185c5",
"l c #4191cd",
"j c #5299cd",
"g c #6aaad5",
"m c #6aaade",
"n c #8bbee6",
"....#a#a#ab.....",
"...acdbbbdebb...",
"..fgdb...ahedb..",
"..ijb.....akeb..",
"..#cdb....fldb..",
"...aedb...fleb..",
"....bbb..amdb...",
"........anob....",
".......amob.....",
"......akeb......",
"......#cdb......",
".......bb.......",
"................",
".......aa.......",
"......#gdb......",
".......bb......."};


/*
 *  Constructs a NewsSourceDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
NewsSourceDlg::NewsSourceDlg( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl ),
      image0( (const char **) image0_data ),
      image1( (const char **) image1_data )
{
    if ( !name )
	setName( "NewsSourceDlg" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)4, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setIcon( image0 );
    NewsSourceDlgLayout = new TQGridLayout( this, 1, 1, 4, 4, "NewsSourceDlgLayout"); 

    gbNewsSourceProperties = new TQGroupBox( this, "gbNewsSourceProperties" );
    gbNewsSourceProperties->setColumnLayout(0, TQt::Vertical );
    gbNewsSourceProperties->layout()->setSpacing( 6 );
    gbNewsSourceProperties->layout()->setMargin( 11 );
    gbNewsSourcePropertiesLayout = new TQGridLayout( gbNewsSourceProperties->layout() );
    gbNewsSourcePropertiesLayout->setAlignment( TQt::AlignTop );

    lName = new TQLabel( gbNewsSourceProperties, "lName" );

    gbNewsSourcePropertiesLayout->addWidget( lName, 0, 0 );

    leName = new KLineEdit( gbNewsSourceProperties, "leName" );

    gbNewsSourcePropertiesLayout->addMultiCellWidget( leName, 0, 0, 1, 5 );

    lSourceFile = new TQLabel( gbNewsSourceProperties, "lSourceFile" );

    gbNewsSourcePropertiesLayout->addWidget( lSourceFile, 1, 0 );

    lIcon = new TQLabel( gbNewsSourceProperties, "lIcon" );

    gbNewsSourcePropertiesLayout->addWidget( lIcon, 4, 0 );

    leIcon = new KLineEdit( gbNewsSourceProperties, "leIcon" );

    gbNewsSourcePropertiesLayout->addMultiCellWidget( leIcon, 4, 4, 1, 4 );

    pixmapIcon = new TQLabel( gbNewsSourceProperties, "pixmapIcon" );
    pixmapIcon->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, pixmapIcon->sizePolicy().hasHeightForWidth() ) );
    pixmapIcon->setPixmap( image1 );
    pixmapIcon->setScaledContents( true );

    gbNewsSourcePropertiesLayout->addWidget( pixmapIcon, 4, 5 );

    lCategory = new TQLabel( gbNewsSourceProperties, "lCategory" );

    gbNewsSourcePropertiesLayout->addWidget( lCategory, 3, 0 );

    comboCategory = new KComboBox( false, gbNewsSourceProperties, "comboCategory" );

    gbNewsSourcePropertiesLayout->addWidget( comboCategory, 3, 1 );
    Spacer5 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    gbNewsSourcePropertiesLayout->addItem( Spacer5, 3, 2 );

    lMaxArticles = new TQLabel( gbNewsSourceProperties, "lMaxArticles" );

    gbNewsSourcePropertiesLayout->addWidget( lMaxArticles, 3, 3 );

    sbMaxArticles = new KIntSpinBox( gbNewsSourceProperties, "sbMaxArticles" );
    sbMaxArticles->setMaxValue( 1000 );
    sbMaxArticles->setValue( 10 );

    gbNewsSourcePropertiesLayout->addMultiCellWidget( sbMaxArticles, 3, 3, 4, 5 );

    cbProgram = new TQCheckBox( gbNewsSourceProperties, "cbProgram" );

    gbNewsSourcePropertiesLayout->addMultiCellWidget( cbProgram, 2, 2, 1, 2 );

    urlSourceFile = new KURLRequester( gbNewsSourceProperties, "urlSourceFile" );

    gbNewsSourcePropertiesLayout->addMultiCellWidget( urlSourceFile, 1, 1, 1, 5 );

    NewsSourceDlgLayout->addMultiCellWidget( gbNewsSourceProperties, 0, 0, 0, 3 );

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

    NewsSourceDlgLayout->addWidget( bCancel, 1, 3 );

    bSuggest = new TQPushButton( this, "bSuggest" );
    bSuggest->setEnabled( false );

    NewsSourceDlgLayout->addWidget( bSuggest, 1, 2 );

    bOk = new TQPushButton( this, "bOk" );
    bOk->setDefault( true );

    NewsSourceDlgLayout->addWidget( bOk, 1, 1 );
    spacerButtons = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    NewsSourceDlgLayout->addItem( spacerButtons, 1, 0 );
    languageChange();
    resize( TQSize(438, 201).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( bSuggest, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotSuggestClicked() ) );
    connect( bCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotCancelClicked() ) );
    connect( leName, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotModified() ) );
    connect( comboCategory, TQ_SIGNAL( highlighted(const TQString&) ), this, TQ_SLOT( slotModified() ) );
    connect( sbMaxArticles, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotModified() ) );
    connect( leIcon, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotModified() ) );
    connect( bOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotOkClicked() ) );
    connect( urlSourceFile, TQ_SIGNAL( textChanged(const TQString &) ), this, TQ_SLOT( slotSourceFileChanged() ) );

    // tab order
    setTabOrder( leName, urlSourceFile );
    setTabOrder( urlSourceFile, cbProgram );
    setTabOrder( cbProgram, comboCategory );
    setTabOrder( comboCategory, sbMaxArticles );
    setTabOrder( sbMaxArticles, leIcon );
    setTabOrder( leIcon, bOk );
    setTabOrder( bOk, bSuggest );
    setTabOrder( bSuggest, bCancel );

    // buddies
    lName->setBuddy( leName );
    lSourceFile->setBuddy( urlSourceFile );
    lIcon->setBuddy( leIcon );
    lCategory->setBuddy( comboCategory );
    lMaxArticles->setBuddy( sbMaxArticles );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void NewsSourceDlg::languageChange()
{
    setCaption( tr2i18n( "Add News Source" ) );
    gbNewsSourceProperties->setTitle( tr2i18n( "News Source Properties" ) );
    lName->setText( tr2i18n( "&Name:" ) );
    TQToolTip::add( lName, tr2i18n( "Name of the news source" ) );
    TQWhatsThis::add( lName, tr2i18n( "Here you can enter the name of the news source.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file below." ) );
    TQToolTip::add( leName, tr2i18n( "Name of the news source" ) );
    TQWhatsThis::add( leName, tr2i18n( "Here you can enter the name of the news source.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file below." ) );
    lSourceFile->setText( tr2i18n( "Source &file:" ) );
    TQToolTip::add( lSourceFile, tr2i18n( "The source file for this news source" ) );
    TQWhatsThis::add( lSourceFile, tr2i18n( "Enter the path to the source file for the news source you want to add here. If you specified a source file here, you can use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill in the remaining values automatically." ) );
    lIcon->setText( tr2i18n( "&Icon:" ) );
    TQToolTip::add( lIcon, tr2i18n( "Path to the icon for this news source" ) );
    TQWhatsThis::add( lIcon, tr2i18n( "Here you can specify the path to an icon to be used for this news source. Icons make it easier to distinguish between multiple news sources as the headlines scroll by.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    TQToolTip::add( leIcon, tr2i18n( "Path to the icon for this news source" ) );
    TQWhatsThis::add( leIcon, tr2i18n( "Here you can specify the path to an icon to be used for this news source. Icons make it easier to distinguish between multiple news sources as the headlines scroll by.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    TQToolTip::add( pixmapIcon, tr2i18n( "Icon to be used for this news source" ) );
    TQWhatsThis::add( pixmapIcon, tr2i18n( "This is what the currently configured icon for this news source looks like. To change this icon, use the input field at the left." ) );
    lCategory->setText( tr2i18n( "Ca&tegory:" ) );
    TQToolTip::add( lCategory, tr2i18n( "Into which category does this news source belong?" ) );
    TQWhatsThis::add( lCategory, tr2i18n( "Here you can specify into which category this news source belongs. Arranging the news sources into categories makes it much easier to maintain large lists of news sources.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    TQToolTip::add( comboCategory, tr2i18n( "Into which category does this news source belong?" ) );
    TQWhatsThis::add( comboCategory, tr2i18n( "Here you can specify into which category this news source belongs. Arranging the news sources into categories makes it much easier to maintain large lists of news sources.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    lMaxArticles->setText( tr2i18n( "&Max. articles:" ) );
    TQToolTip::add( lMaxArticles, tr2i18n( "Maximum number of articles" ) );
    TQWhatsThis::add( lMaxArticles, tr2i18n( "This option lets you define how many articles KNewsTicker should cache for this news source. This value will never be exceeded.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    TQToolTip::add( sbMaxArticles, tr2i18n( "Maximum number of articles" ) );
    TQWhatsThis::add( sbMaxArticles, tr2i18n( "This option lets you define how many articles KNewsTicker should cache for this news source. This value will never be exceeded.<br>Note that you can also use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill this field automatically, after you have entered a source file above." ) );
    cbProgram->setText( tr2i18n( "The file is a &program" ) );
    TQToolTip::add( cbProgram, tr2i18n( "Is the specified source file a program?" ) );
    TQWhatsThis::add( cbProgram, tr2i18n( "Check this box to tell KNewsTicker that the file you specified in the above input field labeled <i>Source file</i> is a program and not a RDF or RSS file. KNewsTicker will then process the output (as received on <i>stdout</i>) of that program." ) );
    TQToolTip::add( urlSourceFile, tr2i18n( "The source file for this news source" ) );
    TQWhatsThis::add( urlSourceFile, tr2i18n( "Enter the path to the source file for the news source you want to add here. If you specified a source file here, you can use the button at the bottom right labeled <i>Suggest</i> to let KNewsTicker fill in the remaining values automatically." ) );
    bCancel->setText( tr2i18n( "&Cancel" ) );
    TQToolTip::add( bCancel, tr2i18n( "Cancel this configuration" ) );
    TQWhatsThis::add( bCancel, tr2i18n( "Press this button to close this dialog, discarding all entered information." ) );
    bSuggest->setText( tr2i18n( "&Suggest" ) );
    TQToolTip::add( bSuggest, tr2i18n( "Suggest suitable values" ) );
    TQWhatsThis::add( bSuggest, tr2i18n( "Press this button to make KNewsTicker guess more or less reasonable values for some of the news properties (such as the name, icon or maximum number of articles).<br>Note that you have to supply a source file in order to use this function." ) );
    bOk->setText( tr2i18n( "&OK" ) );
    TQToolTip::add( bOk, tr2i18n( "Acknowledge these values" ) );
    TQWhatsThis::add( bOk, tr2i18n( "Press this button to apply the values of this dialog and return to the previous configuration dialog." ) );
}

void NewsSourceDlg::slotOkClicked()
{
    tqWarning( "NewsSourceDlg::slotOkClicked(): Not implemented yet" );
}

void NewsSourceDlg::slotCancelClicked()
{
    tqWarning( "NewsSourceDlg::slotCancelClicked(): Not implemented yet" );
}

void NewsSourceDlg::slotModified()
{
    tqWarning( "NewsSourceDlg::slotModified(): Not implemented yet" );
}

void NewsSourceDlg::slotSourceFileChanged()
{
    tqWarning( "NewsSourceDlg::slotSourceFileChanged(): Not implemented yet" );
}

void NewsSourceDlg::slotSuggestClicked()
{
    tqWarning( "NewsSourceDlg::slotSuggestClicked(): Not implemented yet" );
}

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

TQMetaObject *NewsSourceDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_NewsSourceDlg( "NewsSourceDlg", &NewsSourceDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* NewsSourceDlg::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"slotOkClicked", 0, 0 };
    static const TQUMethod slot_2 = {"slotCancelClicked", 0, 0 };
    static const TQUMethod slot_3 = {"slotModified", 0, 0 };
    static const TQUMethod slot_4 = {"slotSourceFileChanged", 0, 0 };
    static const TQUMethod slot_5 = {"slotSuggestClicked", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotOkClicked()", &slot_1, TQMetaData::Protected },
	{ "slotCancelClicked()", &slot_2, TQMetaData::Protected },
	{ "slotModified()", &slot_3, TQMetaData::Protected },
	{ "slotSourceFileChanged()", &slot_4, TQMetaData::Protected },
	{ "slotSuggestClicked()", &slot_5, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"NewsSourceDlg", parentObject,
	slot_tbl, 6,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_NewsSourceDlg.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool NewsSourceDlg::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotOkClicked(); break;
    case 2: slotCancelClicked(); break;
    case 3: slotModified(); break;
    case 4: slotSourceFileChanged(); break;
    case 5: slotSuggestClicked(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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