00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "snippetsettingsbase.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qcheckbox.h>
00018 #include <qbuttongroup.h>
00019 #include <qradiobutton.h>
00020 #include <qlabel.h>
00021 #include <klineedit.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025
00026
00027
00028
00029
00030 SnippetSettingsBase::SnippetSettingsBase( QWidget* parent, const char* name, WFlags fl )
00031 : QWidget( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "SnippetSettingsBase" );
00035 SnippetSettingsBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "SnippetSettingsBaseLayout");
00036
00037 groupBox1 = new QGroupBox( this, "groupBox1" );
00038
00039 cbToolTip = new QCheckBox( groupBox1, "cbToolTip" );
00040 cbToolTip->setGeometry( QRect( 11, 19, 556, 18 ) );
00041 cbToolTip->setChecked( TRUE );
00042
00043 SnippetSettingsBaseLayout->addWidget( groupBox1, 0, 0 );
00044
00045 buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
00046 buttonGroup1->setColumnLayout(0, Qt::Vertical );
00047 buttonGroup1->layout()->setSpacing( 6 );
00048 buttonGroup1->layout()->setMargin( 11 );
00049 buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00050 buttonGroup1Layout->setAlignment( Qt::AlignTop );
00051
00052 btnGroup = new QButtonGroup( buttonGroup1, "btnGroup" );
00053 btnGroup->setColumnLayout(0, Qt::Vertical );
00054 btnGroup->layout()->setSpacing( 6 );
00055 btnGroup->layout()->setMargin( 11 );
00056 btnGroupLayout = new QGridLayout( btnGroup->layout() );
00057 btnGroupLayout->setAlignment( Qt::AlignTop );
00058
00059 rbSingle = new QRadioButton( btnGroup, "rbSingle" );
00060 rbSingle->setChecked( TRUE );
00061
00062 btnGroupLayout->addWidget( rbSingle, 0, 0 );
00063
00064 rbAll = new QRadioButton( btnGroup, "rbAll" );
00065 rbAll->setChecked( FALSE );
00066
00067 btnGroupLayout->addWidget( rbAll, 1, 0 );
00068
00069 buttonGroup1Layout->addWidget( btnGroup, 1, 0 );
00070
00071 layout1 = new QHBoxLayout( 0, 0, 6, "layout1");
00072
00073 textLabel1 = new QLabel( buttonGroup1, "textLabel1" );
00074 layout1->addWidget( textLabel1 );
00075
00076 leDelimiter = new KLineEdit( buttonGroup1, "leDelimiter" );
00077 leDelimiter->setMaximumSize( QSize( 40, 32767 ) );
00078 leDelimiter->setMaxLength( 1 );
00079 layout1->addWidget( leDelimiter );
00080 spacer3 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00081 layout1->addItem( spacer3 );
00082
00083 buttonGroup1Layout->addLayout( layout1, 0, 0 );
00084
00085 SnippetSettingsBaseLayout->addWidget( buttonGroup1, 1, 0 );
00086 spacer2 = new QSpacerItem( 20, 120, QSizePolicy::Minimum, QSizePolicy::Expanding );
00087 SnippetSettingsBaseLayout->addItem( spacer2, 2, 0 );
00088 languageChange();
00089 resize( QSize(600, 398).expandedTo(minimumSizeHint()) );
00090 clearWState( WState_Polished );
00091 }
00092
00093
00094
00095
00096 SnippetSettingsBase::~SnippetSettingsBase()
00097 {
00098
00099 }
00100
00101
00102
00103
00104
00105 void SnippetSettingsBase::languageChange()
00106 {
00107 setCaption( tr2i18n( "Snippet Settings" ) );
00108 groupBox1->setTitle( tr2i18n( "Tooltips" ) );
00109 cbToolTip->setText( tr2i18n( "Show snippet's text in &tooltip" ) );
00110 QToolTip::add( cbToolTip, tr2i18n( "Decides if a tooltip should be shown containing text from the bookmarked line" ) );
00111 buttonGroup1->setTitle( tr2i18n( "Variables" ) );
00112 btnGroup->setTitle( tr2i18n( "Input Method for Variables" ) );
00113 rbSingle->setText( tr2i18n( "Single dialog for each variable within a snippet" ) );
00114 rbSingle->setAccel( QKeySequence( QString::null ) );
00115 QToolTip::add( rbSingle, tr2i18n( "An input dialog will be displayed for every variable within a snippet" ) );
00116 rbAll->setText( tr2i18n( "One dialog for all variables within a snippet" ) );
00117 rbAll->setAccel( QKeySequence( QString::null ) );
00118 QToolTip::add( rbAll, tr2i18n( "A single dialog will be displayed where you can enter the values for all variables within a snippet" ) );
00119 textLabel1->setText( tr2i18n( "Delimiter:" ) );
00120 }
00121
00122 #include "snippetsettingsbase.moc"