00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "addicondlg.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <kurlrequester.h>
00017 #include <klineedit.h>
00018 #include <kactivelabel.h>
00019 #include <kicondialog.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023
00024
00025
00026
00027
00028
00029
00030
00031 AddIconDlg::AddIconDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00032 : QDialog( parent, name, modal, fl )
00033 {
00034 if ( !name )
00035 setName( "AddIconDlg" );
00036 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
00037 setSizeGripEnabled( TRUE );
00038 AddIconDlgLayout = new QGridLayout( this, 1, 1, 11, 6, "AddIconDlgLayout");
00039
00040 m_prog = new KURLRequester( this, "m_prog" );
00041
00042 AddIconDlgLayout->addWidget( m_prog, 4, 0 );
00043
00044 m_tip = new KLineEdit( this, "m_tip" );
00045
00046 AddIconDlgLayout->addWidget( m_tip, 2, 0 );
00047
00048 kActiveLabel2 = new KActiveLabel( this, "kActiveLabel2" );
00049
00050 AddIconDlgLayout->addWidget( kActiveLabel2, 3, 0 );
00051
00052 kActiveLabel1 = new KActiveLabel( this, "kActiveLabel1" );
00053
00054 AddIconDlgLayout->addWidget( kActiveLabel1, 1, 0 );
00055
00056 layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
00057
00058 buttonHelp = new QPushButton( this, "buttonHelp" );
00059 buttonHelp->setAutoDefault( TRUE );
00060 layout1->addWidget( buttonHelp );
00061 Horizontal_Spacing2 = new QSpacerItem( 283, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00062 layout1->addItem( Horizontal_Spacing2 );
00063
00064 buttonOk = new QPushButton( this, "buttonOk" );
00065 buttonOk->setAutoDefault( TRUE );
00066 buttonOk->setDefault( TRUE );
00067 layout1->addWidget( buttonOk );
00068
00069 buttonCancel = new QPushButton( this, "buttonCancel" );
00070 buttonCancel->setAutoDefault( TRUE );
00071 layout1->addWidget( buttonCancel );
00072
00073 AddIconDlgLayout->addLayout( layout1, 5, 0 );
00074
00075 layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
00076
00077 m_icon = new KIconButton( this, "m_icon" );
00078 m_icon->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, m_icon->sizePolicy().hasHeightForWidth() ) );
00079 m_icon->setMinimumSize( QSize( 72, 72 ) );
00080 layout2->addWidget( m_icon );
00081
00082 kActiveLabel3 = new KActiveLabel( this, "kActiveLabel3" );
00083 layout2->addWidget( kActiveLabel3 );
00084
00085 AddIconDlgLayout->addLayout( layout2, 0, 0 );
00086 languageChange();
00087 resize( QSize(532, 276).expandedTo(minimumSizeHint()) );
00088 clearWState( WState_Polished );
00089
00090
00091 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
00092 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00093 }
00094
00095
00096
00097
00098 AddIconDlg::~AddIconDlg()
00099 {
00100
00101 }
00102
00103
00104
00105
00106
00107 void AddIconDlg::languageChange()
00108 {
00109 setCaption( tr2i18n( "Add an Icon" ) );
00110 kActiveLabel2->setText( tr2i18n( "Program :" ) );
00111 kActiveLabel1->setText( tr2i18n( "ToolTip :" ) );
00112 buttonHelp->setText( tr2i18n( "&Help" ) );
00113 buttonHelp->setAccel( QKeySequence( tr2i18n( "F1" ) ) );
00114 buttonOk->setText( tr2i18n( "&OK" ) );
00115 buttonOk->setAccel( QKeySequence( QString::null ) );
00116 buttonCancel->setText( tr2i18n( "&Cancel" ) );
00117 buttonCancel->setAccel( QKeySequence( QString::null ) );
00118 m_icon->setText( QString::null );
00119 }
00120
00121 #include "addicondlg.moc"