00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "propertieswidgetbase.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qtabwidget.h>
00017 #include <qlabel.h>
00018 #include <klineedit.h>
00019 #include <qcheckbox.h>
00020 #include <knuminput.h>
00021 #include <qcombobox.h>
00022 #include <qbuttongroup.h>
00023 #include <qradiobutton.h>
00024 #include <qlayout.h>
00025 #include <qtooltip.h>
00026 #include <qwhatsthis.h>
00027 #include "klineedit.h"
00028 #include "knuminput.h"
00029
00030
00031
00032
00033
00034 Akregator::FeedPropertiesWidgetBase::FeedPropertiesWidgetBase( QWidget* parent, const char* name, WFlags fl )
00035 : QWidget( parent, name, fl )
00036 {
00037 if ( !name )
00038 setName( "FeedPropertiesWidget" );
00039 FeedPropertiesWidgetLayout = new QVBoxLayout( this, 0, 6, "FeedPropertiesWidgetLayout");
00040
00041 tabWidget2 = new QTabWidget( this, "tabWidget2" );
00042
00043 tab = new QWidget( tabWidget2, "tab" );
00044 tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout");
00045
00046 layout8 = new QGridLayout( 0, 1, 1, 0, 6, "layout8");
00047
00048 textLabel3 = new QLabel( tab, "textLabel3" );
00049
00050 layout8->addWidget( textLabel3, 1, 0 );
00051
00052 textLabel2 = new QLabel( tab, "textLabel2" );
00053
00054 layout8->addWidget( textLabel2, 0, 0 );
00055
00056 feedNameEdit = new KLineEdit( tab, "feedNameEdit" );
00057 feedNameEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, feedNameEdit->sizePolicy().hasHeightForWidth() ) );
00058
00059 layout8->addWidget( feedNameEdit, 0, 1 );
00060
00061 urlEdit = new KLineEdit( tab, "urlEdit" );
00062
00063 layout8->addWidget( urlEdit, 1, 1 );
00064
00065 tabLayout->addLayout( layout8, 0, 0 );
00066
00067 upChkbox = new QCheckBox( tab, "upChkbox" );
00068
00069 tabLayout->addWidget( upChkbox, 1, 0 );
00070
00071 layout9 = new QHBoxLayout( 0, 0, 6, "layout9");
00072 spacer8 = new QSpacerItem( 31, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00073 layout9->addItem( spacer8 );
00074
00075 textLabel1 = new QLabel( tab, "textLabel1" );
00076 textLabel1->setEnabled( FALSE );
00077 layout9->addWidget( textLabel1 );
00078
00079 updateSpinBox = new KIntSpinBox( tab, "updateSpinBox" );
00080 updateSpinBox->setEnabled( FALSE );
00081 updateSpinBox->setMaxValue( 100000000 );
00082 updateSpinBox->setMinValue( 1 );
00083 layout9->addWidget( updateSpinBox );
00084
00085 updateComboBox = new QComboBox( FALSE, tab, "updateComboBox" );
00086 updateComboBox->setEnabled( FALSE );
00087 layout9->addWidget( updateComboBox );
00088
00089 tabLayout->addLayout( layout9, 2, 0 );
00090
00091 checkBox_useNotification = new QCheckBox( tab, "checkBox_useNotification" );
00092
00093 tabLayout->addWidget( checkBox_useNotification, 3, 0 );
00094 tabWidget2->insertTab( tab, QString::fromLatin1("") );
00095
00096 tab_2 = new QWidget( tabWidget2, "tab_2" );
00097 tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2");
00098
00099 bg_feedArchive = new QButtonGroup( tab_2, "bg_feedArchive" );
00100 bg_feedArchive->setFrameShape( QButtonGroup::NoFrame );
00101 bg_feedArchive->setExclusive( FALSE );
00102 bg_feedArchive->setColumnLayout(0, Qt::Vertical );
00103 bg_feedArchive->layout()->setSpacing( 6 );
00104 bg_feedArchive->layout()->setMargin( 0 );
00105 bg_feedArchiveLayout = new QGridLayout( bg_feedArchive->layout() );
00106 bg_feedArchiveLayout->setAlignment( Qt::AlignTop );
00107
00108 rb_keepAllArticles = new QRadioButton( bg_feedArchive, "rb_keepAllArticles" );
00109
00110 bg_feedArchiveLayout->addMultiCellWidget( rb_keepAllArticles, 1, 1, 0, 3 );
00111
00112 rb_limitArticleNumber = new QRadioButton( bg_feedArchive, "rb_limitArticleNumber" );
00113
00114 bg_feedArchiveLayout->addWidget( rb_limitArticleNumber, 2, 0 );
00115
00116 rb_limitArticleAge = new QRadioButton( bg_feedArchive, "rb_limitArticleAge" );
00117
00118 bg_feedArchiveLayout->addMultiCellWidget( rb_limitArticleAge, 3, 3, 0, 1 );
00119
00120 sb_maxArticleAge = new KIntSpinBox( bg_feedArchive, "sb_maxArticleAge" );
00121 sb_maxArticleAge->setEnabled( FALSE );
00122 sb_maxArticleAge->setMaxValue( 1000000 );
00123 sb_maxArticleAge->setMinValue( 1 );
00124 sb_maxArticleAge->setValue( 1 );
00125
00126 bg_feedArchiveLayout->addWidget( sb_maxArticleAge, 3, 2 );
00127 spacer5_2 = new QSpacerItem( 99, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00128 bg_feedArchiveLayout->addItem( spacer5_2, 3, 3 );
00129 spacer7 = new QSpacerItem( 100, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00130 bg_feedArchiveLayout->addItem( spacer7, 2, 3 );
00131
00132 sb_maxArticleNumber = new KIntSpinBox( bg_feedArchive, "sb_maxArticleNumber" );
00133 sb_maxArticleNumber->setEnabled( FALSE );
00134 sb_maxArticleNumber->setMaxValue( 1000000 );
00135 sb_maxArticleNumber->setMinValue( 1 );
00136
00137 bg_feedArchiveLayout->addMultiCellWidget( sb_maxArticleNumber, 2, 2, 1, 2 );
00138
00139 rb_disableArchiving = new QRadioButton( bg_feedArchive, "rb_disableArchiving" );
00140
00141 bg_feedArchiveLayout->addMultiCellWidget( rb_disableArchiving, 4, 4, 0, 3 );
00142
00143 rb_globalDefault = new QRadioButton( bg_feedArchive, "rb_globalDefault" );
00144 rb_globalDefault->setChecked( TRUE );
00145
00146 bg_feedArchiveLayout->addMultiCellWidget( rb_globalDefault, 0, 0, 0, 3 );
00147
00148 tabLayout_2->addWidget( bg_feedArchive, 0, 0 );
00149 tabWidget2->insertTab( tab_2, QString::fromLatin1("") );
00150
00151 TabPage = new QWidget( tabWidget2, "TabPage" );
00152 TabPageLayout = new QGridLayout( TabPage, 1, 1, 11, 6, "TabPageLayout");
00153
00154 layout4 = new QVBoxLayout( 0, 0, 6, "layout4");
00155
00156 checkBox_loadWebsite = new QCheckBox( TabPage, "checkBox_loadWebsite" );
00157 layout4->addWidget( checkBox_loadWebsite );
00158
00159 checkBox_markRead = new QCheckBox( TabPage, "checkBox_markRead" );
00160 layout4->addWidget( checkBox_markRead );
00161
00162 TabPageLayout->addLayout( layout4, 0, 0 );
00163 spacer6 = new QSpacerItem( 20, 71, QSizePolicy::Minimum, QSizePolicy::Expanding );
00164 TabPageLayout->addItem( spacer6, 1, 0 );
00165 tabWidget2->insertTab( TabPage, QString::fromLatin1("") );
00166 FeedPropertiesWidgetLayout->addWidget( tabWidget2 );
00167 languageChange();
00168 resize( QSize(355, 189).expandedTo(minimumSizeHint()) );
00169 clearWState( WState_Polished );
00170
00171
00172 connect( upChkbox, SIGNAL( toggled(bool) ), updateSpinBox, SLOT( setEnabled(bool) ) );
00173 connect( rb_limitArticleNumber, SIGNAL( toggled(bool) ), sb_maxArticleNumber, SLOT( setEnabled(bool) ) );
00174 connect( rb_limitArticleAge, SIGNAL( toggled(bool) ), sb_maxArticleAge, SLOT( setEnabled(bool) ) );
00175 connect( upChkbox, SIGNAL( toggled(bool) ), updateComboBox, SLOT( setEnabled(bool) ) );
00176 connect( updateComboBox, SIGNAL( activated(int) ), this, SLOT( slotUpdateComboBoxActivated(int) ) );
00177 connect( upChkbox, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateCheckBoxToggled(bool) ) );
00178 connect( upChkbox, SIGNAL( toggled(bool) ), textLabel1, SLOT( setEnabled(bool) ) );
00179
00180
00181 textLabel3->setBuddy( urlEdit );
00182 textLabel2->setBuddy( feedNameEdit );
00183 textLabel1->setBuddy( updateSpinBox );
00184 }
00185
00186
00187
00188
00189 Akregator::FeedPropertiesWidgetBase::~FeedPropertiesWidgetBase()
00190 {
00191
00192 }
00193
00194
00195
00196
00197
00198 void Akregator::FeedPropertiesWidgetBase::languageChange()
00199 {
00200 setCaption( tr2i18n( "Feed Properties" ) );
00201 textLabel3->setText( tr2i18n( "&URL:" ) );
00202 textLabel2->setText( tr2i18n( "&Name:" ) );
00203 QToolTip::add( feedNameEdit, tr2i18n( "Display name of RSS column" ) );
00204 upChkbox->setText( tr2i18n( "U&se a custom update interval" ) );
00205 textLabel1->setText( tr2i18n( "Update &every:" ) );
00206 updateSpinBox->setSuffix( QString::null );
00207 updateComboBox->clear();
00208 updateComboBox->insertItem( tr2i18n( "Minutes" ) );
00209 updateComboBox->insertItem( tr2i18n( "Hours" ) );
00210 updateComboBox->insertItem( tr2i18n( "Days" ) );
00211 updateComboBox->insertItem( tr2i18n( "Never" ) );
00212 checkBox_useNotification->setText( tr2i18n( "Notify when new articles arri&ve" ) );
00213 tabWidget2->changeTab( tab, tr2i18n( "&General" ) );
00214 bg_feedArchive->setTitle( QString::null );
00215 rb_keepAllArticles->setText( tr2i18n( "&Keep all articles" ) );
00216 rb_limitArticleNumber->setText( tr2i18n( "Limit archi&ve to:" ) );
00217 rb_limitArticleAge->setText( tr2i18n( "&Delete articles older than:" ) );
00218 sb_maxArticleAge->setSuffix( tr2i18n( " days" ) );
00219 sb_maxArticleAge->setSpecialValueText( tr2i18n( "1 day" ) );
00220 sb_maxArticleNumber->setSuffix( tr2i18n( " articles" ) );
00221 sb_maxArticleNumber->setSpecialValueText( tr2i18n( "1 article" ) );
00222 rb_disableArchiving->setText( tr2i18n( "Di&sable archiving" ) );
00223 rb_globalDefault->setText( tr2i18n( "&Use default settings" ) );
00224 tabWidget2->changeTab( tab_2, tr2i18n( "Ar&chive" ) );
00225 checkBox_loadWebsite->setText( tr2i18n( "Load the &full website when reading articles" ) );
00226 checkBox_markRead->setText( tr2i18n( "Mar&k articles as read when they arrive" ) );
00227 tabWidget2->changeTab( TabPage, tr2i18n( "Adva&nced" ) );
00228 }
00229
00230 #include "propertieswidgetbase.moc"