00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "cvsoptionswidgetbase.h"
00013
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qgroupbox.h>
00018 #include <qlabel.h>
00019 #include <qlineedit.h>
00020 #include <qcheckbox.h>
00021 #include <knuminput.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025
00026
00027
00028
00029
00030 CvsOptionsWidgetBase::CvsOptionsWidgetBase( QWidget* parent, const char* name, WFlags fl )
00031 : QWidget( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "cvsOptionsWidget" );
00035 cvsOptionsWidgetLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "cvsOptionsWidgetLayout");
00036
00037 groupBox4 = new QGroupBox( this, "groupBox4" );
00038 groupBox4->setColumnLayout(0, Qt::Vertical );
00039 groupBox4->layout()->setSpacing( KDialog::spacingHint() );
00040 groupBox4->layout()->setMargin( KDialog::marginHint() );
00041 groupBox4Layout = new QVBoxLayout( groupBox4->layout() );
00042 groupBox4Layout->setAlignment( Qt::AlignTop );
00043
00044 m_rshLabel = new QLabel( groupBox4, "m_rshLabel" );
00045 m_rshLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, m_rshLabel->sizePolicy().hasHeightForWidth() ) );
00046 groupBox4Layout->addWidget( m_rshLabel );
00047
00048 cvsRshEnvVarEdit = new QLineEdit( groupBox4, "cvsRshEnvVarEdit" );
00049 groupBox4Layout->addWidget( cvsRshEnvVarEdit );
00050
00051 textLabel1_2 = new QLabel( groupBox4, "textLabel1_2" );
00052 groupBox4Layout->addWidget( textLabel1_2 );
00053
00054 serverLocationEdit = new QLineEdit( groupBox4, "serverLocationEdit" );
00055 groupBox4Layout->addWidget( serverLocationEdit );
00056 cvsOptionsWidgetLayout->addWidget( groupBox4 );
00057
00058 groupBox1 = new QGroupBox( this, "groupBox1" );
00059 groupBox1->setColumnLayout(0, Qt::Vertical );
00060 groupBox1->layout()->setSpacing( KDialog::spacingHint() );
00061 groupBox1->layout()->setMargin( KDialog::marginHint() );
00062 groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
00063 groupBox1Layout->setAlignment( Qt::AlignTop );
00064
00065 createNewDirWhenUpdateCheck = new QCheckBox( groupBox1, "createNewDirWhenUpdateCheck" );
00066 groupBox1Layout->addWidget( createNewDirWhenUpdateCheck );
00067
00068 pruneEmptyDirWhenUpdateCheck = new QCheckBox( groupBox1, "pruneEmptyDirWhenUpdateCheck" );
00069 groupBox1Layout->addWidget( pruneEmptyDirWhenUpdateCheck );
00070
00071 recursiveWhenUpdateCheck = new QCheckBox( groupBox1, "recursiveWhenUpdateCheck" );
00072 groupBox1Layout->addWidget( recursiveWhenUpdateCheck );
00073 cvsOptionsWidgetLayout->addWidget( groupBox1 );
00074
00075 groupBox2 = new QGroupBox( this, "groupBox2" );
00076 groupBox2->setColumnLayout(0, Qt::Vertical );
00077 groupBox2->layout()->setSpacing( KDialog::spacingHint() );
00078 groupBox2->layout()->setMargin( KDialog::marginHint() );
00079 groupBox2Layout = new QVBoxLayout( groupBox2->layout() );
00080 groupBox2Layout->setAlignment( Qt::AlignTop );
00081
00082 recursiveWhenCommitRemoveCheck = new QCheckBox( groupBox2, "recursiveWhenCommitRemoveCheck" );
00083 groupBox2Layout->addWidget( recursiveWhenCommitRemoveCheck );
00084 cvsOptionsWidgetLayout->addWidget( groupBox2 );
00085
00086 groupBox3 = new QGroupBox( this, "groupBox3" );
00087 groupBox3->setColumnLayout(0, Qt::Vertical );
00088 groupBox3->layout()->setSpacing( KDialog::spacingHint() );
00089 groupBox3->layout()->setMargin( KDialog::marginHint() );
00090 groupBox3Layout = new QGridLayout( groupBox3->layout() );
00091 groupBox3Layout->setAlignment( Qt::AlignTop );
00092
00093 diffOptionsEdit = new QLineEdit( groupBox3, "diffOptionsEdit" );
00094 diffOptionsEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, diffOptionsEdit->sizePolicy().hasHeightForWidth() ) );
00095
00096 groupBox3Layout->addWidget( diffOptionsEdit, 1, 0 );
00097
00098 m_diffLabel = new QLabel( groupBox3, "m_diffLabel" );
00099 m_diffLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, m_diffLabel->sizePolicy().hasHeightForWidth() ) );
00100
00101 groupBox3Layout->addWidget( m_diffLabel, 0, 0 );
00102
00103 contextLinesInput = new KIntNumInput( groupBox3, "contextLinesInput" );
00104 contextLinesInput->setValue( 3 );
00105 contextLinesInput->setMinValue( 0 );
00106 contextLinesInput->setMaxValue( 65535 );
00107
00108 groupBox3Layout->addWidget( contextLinesInput, 1, 1 );
00109
00110 textLabel1 = new QLabel( groupBox3, "textLabel1" );
00111 textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
00112
00113 groupBox3Layout->addWidget( textLabel1, 0, 1 );
00114 cvsOptionsWidgetLayout->addWidget( groupBox3 );
00115 languageChange();
00116 resize( QSize(500, 507).expandedTo(minimumSizeHint()) );
00117 clearWState( WState_Polished );
00118
00119
00120 m_rshLabel->setBuddy( cvsRshEnvVarEdit );
00121 textLabel1_2->setBuddy( serverLocationEdit );
00122 m_diffLabel->setBuddy( diffOptionsEdit );
00123 textLabel1->setBuddy( contextLinesInput );
00124 }
00125
00126
00127
00128
00129 CvsOptionsWidgetBase::~CvsOptionsWidgetBase()
00130 {
00131
00132 }
00133
00134
00135
00136
00137
00138 void CvsOptionsWidgetBase::languageChange()
00139 {
00140 setCaption( tr2i18n( "CVS Options" ) );
00141 groupBox4->setTitle( tr2i18n( "Common Settings" ) );
00142 m_rshLabel->setText( tr2i18n( "&Remote shell (CVS_RSH environment variable):" ) );
00143 QToolTip::add( cvsRshEnvVarEdit, tr2i18n( "sets the CVS_RSH variable" ) );
00144 QWhatsThis::add( cvsRshEnvVarEdit, tr2i18n( "Set this option to \"ssh\" to use ssh as remote shell for CVS. Note that you need password-less login (see the ssh documentation for how to generate a public/private key pair) otherwise CVS will just hang forever." ) );
00145 textLabel1_2->setText( tr2i18n( "CVS server &location:" ) );
00146 groupBox1->setTitle( tr2i18n( "When Updating" ) );
00147 createNewDirWhenUpdateCheck->setText( tr2i18n( "Create &new directories (if any)" ) );
00148 pruneEmptyDirWhenUpdateCheck->setText( tr2i18n( "&Prune empty directories" ) );
00149 recursiveWhenUpdateCheck->setText( tr2i18n( "&Update subdirectories too" ) );
00150 groupBox2->setTitle( tr2i18n( "When Committing/Removing" ) );
00151 recursiveWhenCommitRemoveCheck->setText( tr2i18n( "&Be recursive" ) );
00152 groupBox3->setTitle( tr2i18n( "When Creating Diffs" ) );
00153 m_diffLabel->setText( tr2i18n( "Use these e&xtra options:" ) );
00154 textLabel1->setText( tr2i18n( "Con&text lines:" ) );
00155 }
00156
00157 #include "cvsoptionswidgetbase.moc"