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