00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "bookmarks_settings_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qcheckbox.h>
00018 #include <qlabel.h>
00019 #include <qspinbox.h>
00020 #include <qbuttongroup.h>
00021 #include <qradiobutton.h>
00022 #include <qlineedit.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026
00027
00028
00029
00030
00031 BookmarkSettingsBase::BookmarkSettingsBase( QWidget* parent, const char* name, WFlags fl )
00032 : QWidget( parent, name, fl )
00033 {
00034 if ( !name )
00035 setName( "BookmarkSettingsBase" );
00036 BookmarkSettingsBaseLayout = new QVBoxLayout( this, 11, 6, "BookmarkSettingsBaseLayout");
00037
00038 groupBox1 = new QGroupBox( this, "groupBox1" );
00039 groupBox1->setColumnLayout(0, Qt::Vertical );
00040 groupBox1->layout()->setSpacing( 6 );
00041 groupBox1->layout()->setMargin( 11 );
00042 groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
00043 groupBox1Layout->setAlignment( Qt::AlignTop );
00044
00045 checkBox1 = new QCheckBox( groupBox1, "checkBox1" );
00046 checkBox1->setChecked( TRUE );
00047 groupBox1Layout->addWidget( checkBox1 );
00048
00049 layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
00050
00051 textLabel1 = new QLabel( groupBox1, "textLabel1" );
00052 layout2->addWidget( textLabel1 );
00053
00054 spinBox1 = new QSpinBox( groupBox1, "spinBox1" );
00055 spinBox1->setMaxValue( 15 );
00056 spinBox1->setValue( 3 );
00057 layout2->addWidget( spinBox1 );
00058 spacer1 = new QSpacerItem( 121, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00059 layout2->addItem( spacer1 );
00060 groupBox1Layout->addLayout( layout2 );
00061 BookmarkSettingsBaseLayout->addWidget( groupBox1 );
00062
00063 buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
00064 buttonGroup1->setColumnLayout(0, Qt::Vertical );
00065 buttonGroup1->layout()->setSpacing( 6 );
00066 buttonGroup1->layout()->setMargin( 11 );
00067 buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
00068 buttonGroup1Layout->setAlignment( Qt::AlignTop );
00069
00070 radioButton1 = new QRadioButton( buttonGroup1, "radioButton1" );
00071 buttonGroup1Layout->addWidget( radioButton1 );
00072
00073 layout3 = new QHBoxLayout( 0, 0, 6, "layout3");
00074
00075 radioButton2 = new QRadioButton( buttonGroup1, "radioButton2" );
00076 radioButton2->setChecked( TRUE );
00077 layout3->addWidget( radioButton2 );
00078
00079 lineEdit1 = new QLineEdit( buttonGroup1, "lineEdit1" );
00080 layout3->addWidget( lineEdit1 );
00081 spacer3 = new QSpacerItem( 71, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00082 layout3->addItem( spacer3 );
00083 buttonGroup1Layout->addLayout( layout3 );
00084
00085 radioButton3 = new QRadioButton( buttonGroup1, "radioButton3" );
00086 buttonGroup1Layout->addWidget( radioButton3 );
00087 BookmarkSettingsBaseLayout->addWidget( buttonGroup1 );
00088 spacer2 = new QSpacerItem( 20, 240, QSizePolicy::Minimum, QSizePolicy::Expanding );
00089 BookmarkSettingsBaseLayout->addItem( spacer2 );
00090 languageChange();
00091 resize( QSize(622, 490).expandedTo(minimumSizeHint()) );
00092 clearWState( WState_Polished );
00093
00094
00095 connect( checkBox1, SIGNAL( toggled(bool) ), spinBox1, SLOT( setEnabled(bool) ) );
00096 connect( checkBox1, SIGNAL( toggled(bool) ), textLabel1, SLOT( setEnabled(bool) ) );
00097 connect( radioButton2, SIGNAL( toggled(bool) ), lineEdit1, SLOT( setEnabled(bool) ) );
00098
00099
00100 textLabel1->setBuddy( spinBox1 );
00101 }
00102
00103
00104
00105
00106 BookmarkSettingsBase::~BookmarkSettingsBase()
00107 {
00108
00109 }
00110
00111
00112
00113
00114
00115 void BookmarkSettingsBase::languageChange()
00116 {
00117 groupBox1->setTitle( tr2i18n( "Code Tooltip" ) );
00118 QWhatsThis::add( groupBox1, tr2i18n( "If checked, a tooltip will be shown when the mouse is over the bookmark, containing the text in the area surrounding it. <p> How many surrounding lines to include is decided by the value in the context box." ) );
00119 checkBox1->setText( tr2i18n( "Show code &tooltip" ) );
00120 QToolTip::add( checkBox1, QString::null );
00121 QWhatsThis::add( checkBox1, QString::null );
00122 textLabel1->setText( tr2i18n( "&Lines of context:" ) );
00123 QWhatsThis::add( textLabel1, QString::null );
00124 QToolTip::add( spinBox1, QString::null );
00125 QWhatsThis::add( spinBox1, QString::null );
00126 buttonGroup1->setTitle( tr2i18n( "Show Bookmarked Codeline in Bookmark Panel" ) );
00127 QWhatsThis::add( buttonGroup1, tr2i18n( "This decides if the bookmark panel should show the content of the bookmarked line in addition to the line number.<p>This can be made optional depending on the start of the line, typically used for only showing lines containing a comment." ) );
00128 radioButton1->setText( tr2i18n( "&Never" ) );
00129 QToolTip::add( radioButton1, QString::null );
00130 QWhatsThis::add( radioButton1, QString::null );
00131 radioButton2->setText( tr2i18n( "&Only lines beginning with the following string:" ) );
00132 QToolTip::add( radioButton2, QString::null );
00133 radioButton3->setText( tr2i18n( "&Always" ) );
00134 QToolTip::add( radioButton3, tr2i18n( "Always show the bookmarked line in addition to the line number" ) );
00135 }
00136
00137 #include "bookmarks_settings_base.moc"