KDevelop API Documentation

snippetdlg.cpp

Go to the documentation of this file.
00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './snippetdlg.ui'
00005 **
00006 ** Created: Tue Feb 22 08:59:44 2005
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "snippetdlg.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <kpushbutton.h>
00017 #include <klineedit.h>
00018 #include <ktextedit.h>
00019 #include <qlabel.h>
00020 #include <qtoolbutton.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 #include <qimage.h>
00025 #include <qpixmap.h>
00026 
00027 #include "./snippetdlg.ui.h"
00028 static const char* const img0_snippetdlg[] = { 
00029 "16 18 17 1",
00030 ". c None",
00031 "b c #000000",
00032 "a c #00385a",
00033 "# c #003862",
00034 "f c #00406a",
00035 "i c #004473",
00036 "e c #00508b",
00037 "d c #005594",
00038 "o c #00599c",
00039 "c c #2981c5",
00040 "k c #2985c5",
00041 "h c #3185c5",
00042 "l c #4191cd",
00043 "j c #5299cd",
00044 "g c #6aaad5",
00045 "m c #6aaade",
00046 "n c #8bbee6",
00047 "....#a#a#abbb...",
00048 "...acdbbbdebbbb.",
00049 "..fgdbbbbahedbbb",
00050 "..ijbbbbbbakebbb",
00051 "..#cdbbb.bfldbbb",
00052 "..baedbbb.flebbb",
00053 "..bbbbbbbamdbbbb",
00054 "...bbbbbanobbbbb",
00055 "....bbbamobbbbb.",
00056 "......akebbbbb..",
00057 "......#cdbbbb...",
00058 "......bbbbbb....",
00059 "......bbbbbb....",
00060 ".......aabb.....",
00061 "......#gdbbb....",
00062 "......bbbbbb....",
00063 "......bbbbbb....",
00064 ".......bbbb....."};
00065 
00066 
00067 /*
00068  *  Constructs a SnippetDlg as a child of 'parent', with the
00069  *  name 'name' and widget flags set to 'f'.
00070  *
00071  *  The dialog will by default be modeless, unless you set 'modal' to
00072  *  TRUE to construct a modal dialog.
00073  */
00074 SnippetDlg::SnippetDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00075     : QDialog( parent, name, modal, fl ),
00076       image0( (const char **) img0_snippetdlg )
00077 {
00078     if ( !name )
00079     setName( "SnippetDlg" );
00080     SnippetDlgLayout = new QGridLayout( this, 1, 1, 11, 6, "SnippetDlgLayout"); 
00081 
00082     layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); 
00083     spacer1 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00084     layout5->addItem( spacer1 );
00085 
00086     btnAdd = new KPushButton( this, "btnAdd" );
00087     layout5->addWidget( btnAdd );
00088 
00089     btnCancel = new KPushButton( this, "btnCancel" );
00090     layout5->addWidget( btnCancel );
00091 
00092     SnippetDlgLayout->addLayout( layout5, 1, 0 );
00093 
00094     layout3 = new QGridLayout( 0, 1, 1, 0, 6, "layout3"); 
00095     spacer2 = new QSpacerItem( 20, 149, QSizePolicy::Minimum, QSizePolicy::Expanding );
00096     layout3->addItem( spacer2, 3, 0 );
00097 
00098     snippetName = new KLineEdit( this, "snippetName" );
00099     QFont snippetName_font(  snippetName->font() );
00100     snippetName_font.setFamily( "Courier" );
00101     snippetName_font.setPointSize( 11 );
00102     snippetName->setFont( snippetName_font ); 
00103 
00104     layout3->addWidget( snippetName, 0, 1 );
00105 
00106     snippetText = new KTextEdit( this, "snippetText" );
00107     QFont snippetText_font(  snippetText->font() );
00108     snippetText_font.setFamily( "Courier" );
00109     snippetText_font.setPointSize( 11 );
00110     snippetText->setFont( snippetText_font ); 
00111 
00112     layout3->addMultiCellWidget( snippetText, 1, 3, 1, 1 );
00113 
00114     textLabel2 = new QLabel( this, "textLabel2" );
00115     textLabel2->setAlignment( int( QLabel::AlignTop ) );
00116 
00117     layout3->addWidget( textLabel2, 1, 0 );
00118 
00119     textLabel1 = new QLabel( this, "textLabel1" );
00120 
00121     layout3->addWidget( textLabel1, 0, 0 );
00122 
00123     toolBtnHelp = new QToolButton( this, "toolBtnHelp" );
00124     toolBtnHelp->setIconSet( QIconSet( image0 ) );
00125 
00126     layout3->addWidget( toolBtnHelp, 2, 0 );
00127 
00128     SnippetDlgLayout->addLayout( layout3, 0, 0 );
00129     languageChange();
00130     resize( QSize(344, 285).expandedTo(minimumSizeHint()) );
00131     clearWState( WState_Polished );
00132 
00133     // signals and slots connections
00134     connect( btnAdd, SIGNAL( clicked() ), this, SLOT( accept() ) );
00135     connect( btnCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00136     connect( toolBtnHelp, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
00137 
00138     // buddies
00139     textLabel2->setBuddy( snippetText );
00140     textLabel1->setBuddy( snippetName );
00141 }
00142 
00143 /*
00144  *  Destroys the object and frees any allocated resources
00145  */
00146 SnippetDlg::~SnippetDlg()
00147 {
00148     // no need to delete child widgets, Qt does it all for us
00149 }
00150 
00151 /*
00152  *  Sets the strings of the subwidgets using the current
00153  *  language.
00154  */
00155 void SnippetDlg::languageChange()
00156 {
00157     setCaption( tr2i18n( "Add Snippet" ) );
00158     btnAdd->setText( tr2i18n( "&Add" ) );
00159     btnCancel->setText( tr2i18n( "&Cancel" ) );
00160     textLabel2->setText( tr2i18n( "&Snippet:" ) );
00161     textLabel1->setText( tr2i18n( "&Name:" ) );
00162     toolBtnHelp->setText( QString::null );
00163     QToolTip::add( toolBtnHelp, tr2i18n( "Click here to get to know how to use variables in a snippet" ) );
00164 }
00165 
00166 #include "snippetdlg.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:42 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003