korganizer

kogroupwareprefspage.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './kogroupwareprefspage.ui'
00005 **
00006 ** Created: Fr Okt 16 12:52:33 2009
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "kogroupwareprefspage.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qtabwidget.h>
00016 #include <qlabel.h>
00017 #include <qcheckbox.h>
00018 #include <qspinbox.h>
00019 #include <qbuttongroup.h>
00020 #include <qlineedit.h>
00021 #include <qframe.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include "./kogroupwareprefspage.ui.h"
00026 
00027 /*
00028  *  Constructs a KOGroupwarePrefsPage as a child of 'parent', with the
00029  *  name 'name' and widget flags set to 'f'.
00030  */
00031 KOGroupwarePrefsPage::KOGroupwarePrefsPage( QWidget* parent, const char* name, WFlags fl )
00032     : QWidget( parent, name, fl )
00033 {
00034     if ( !name )
00035     setName( "KOGroupwarePrefsPage" );
00036     KOGroupwarePrefsPageLayout = new QVBoxLayout( this, 11, 6, "KOGroupwarePrefsPageLayout"); 
00037 
00038     groupwareTab = new QTabWidget( this, "groupwareTab" );
00039     groupwareTab->setEnabled( TRUE );
00040 
00041     tab = new QWidget( groupwareTab, "tab" );
00042     tabLayout = new QVBoxLayout( tab, 11, 6, "tabLayout"); 
00043 
00044     TextLabel1 = new QLabel( tab, "TextLabel1" );
00045     TextLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00046     tabLayout->addWidget( TextLabel1 );
00047 
00048     publishEnable = new QCheckBox( tab, "publishEnable" );
00049     tabLayout->addWidget( publishEnable );
00050 
00051     layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); 
00052 
00053     publishDelayLabel = new QLabel( tab, "publishDelayLabel" );
00054     layout8->addWidget( publishDelayLabel );
00055 
00056     publishDelay = new QSpinBox( tab, "publishDelay" );
00057     publishDelay->setMinValue( 1 );
00058     layout8->addWidget( publishDelay );
00059     tabLayout->addLayout( layout8 );
00060 
00061     Layout16 = new QHBoxLayout( 0, 0, 6, "Layout16"); 
00062 
00063     TextLabel3 = new QLabel( tab, "TextLabel3" );
00064     Layout16->addWidget( TextLabel3 );
00065 
00066     publishDays = new QSpinBox( tab, "publishDays" );
00067     publishDays->setMaxValue( 366 );
00068     publishDays->setMinValue( 1 );
00069     publishDays->setValue( 60 );
00070     Layout16->addWidget( publishDays );
00071 
00072     TextLabel4 = new QLabel( tab, "TextLabel4" );
00073     Layout16->addWidget( TextLabel4 );
00074     Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00075     Layout16->addItem( Spacer3 );
00076     tabLayout->addLayout( Layout16 );
00077 
00078     ButtonGroup2 = new QButtonGroup( tab, "ButtonGroup2" );
00079     ButtonGroup2->setColumnLayout(0, Qt::Vertical );
00080     ButtonGroup2->layout()->setSpacing( 6 );
00081     ButtonGroup2->layout()->setMargin( 11 );
00082     ButtonGroup2Layout = new QGridLayout( ButtonGroup2->layout() );
00083     ButtonGroup2Layout->setAlignment( Qt::AlignTop );
00084 
00085     publishUrl = new QLineEdit( ButtonGroup2, "publishUrl" );
00086     publishUrl->setEnabled( TRUE );
00087 
00088     ButtonGroup2Layout->addWidget( publishUrl, 3, 1 );
00089 
00090     publishSavePassword = new QCheckBox( ButtonGroup2, "publishSavePassword" );
00091 
00092     ButtonGroup2Layout->addMultiCellWidget( publishSavePassword, 7, 7, 0, 1 );
00093 
00094     textLabel2 = new QLabel( ButtonGroup2, "textLabel2" );
00095 
00096     ButtonGroup2Layout->addWidget( textLabel2, 6, 0 );
00097 
00098     publishPassword = new QLineEdit( ButtonGroup2, "publishPassword" );
00099     publishPassword->setEchoMode( QLineEdit::Password );
00100 
00101     ButtonGroup2Layout->addWidget( publishPassword, 6, 1 );
00102 
00103     publishUser = new QLineEdit( ButtonGroup2, "publishUser" );
00104     publishUser->setMinimumSize( QSize( 120, 0 ) );
00105 
00106     ButtonGroup2Layout->addWidget( publishUser, 5, 1 );
00107 
00108     TextLabel6 = new QLabel( ButtonGroup2, "TextLabel6" );
00109 
00110     ButtonGroup2Layout->addWidget( TextLabel6, 5, 0 );
00111 
00112     frame5 = new QFrame( ButtonGroup2, "frame5" );
00113     frame5->setFrameShape( QFrame::HLine );
00114     frame5->setFrameShadow( QFrame::Sunken );
00115 
00116     ButtonGroup2Layout->addMultiCellWidget( frame5, 4, 4, 0, 1 );
00117 
00118     TextLabel7 = new QLabel( ButtonGroup2, "TextLabel7" );
00119 
00120     ButtonGroup2Layout->addWidget( TextLabel7, 3, 0 );
00121     tabLayout->addWidget( ButtonGroup2 );
00122     spacer3 = new QSpacerItem( 21, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
00123     tabLayout->addItem( spacer3 );
00124     groupwareTab->insertTab( tab, QString::fromLatin1("") );
00125 
00126     tab_2 = new QWidget( groupwareTab, "tab_2" );
00127     tabLayout_2 = new QVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 
00128 
00129     TextLabel2 = new QLabel( tab_2, "TextLabel2" );
00130     TextLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00131     tabLayout_2->addWidget( TextLabel2 );
00132 
00133     retrieveEnable = new QCheckBox( tab_2, "retrieveEnable" );
00134     tabLayout_2->addWidget( retrieveEnable );
00135 
00136     fullDomainRetrieval = new QCheckBox( tab_2, "fullDomainRetrieval" );
00137     fullDomainRetrieval->setEnabled( TRUE );
00138     tabLayout_2->addWidget( fullDomainRetrieval );
00139 
00140     ButtonGroup2_2 = new QButtonGroup( tab_2, "ButtonGroup2_2" );
00141     ButtonGroup2_2->setColumnLayout(0, Qt::Vertical );
00142     ButtonGroup2_2->layout()->setSpacing( 6 );
00143     ButtonGroup2_2->layout()->setMargin( 11 );
00144     ButtonGroup2_2Layout = new QVBoxLayout( ButtonGroup2_2->layout() );
00145     ButtonGroup2_2Layout->setAlignment( Qt::AlignTop );
00146 
00147     Layout7_2 = new QHBoxLayout( 0, 0, 6, "Layout7_2"); 
00148 
00149     TextLabel7_2 = new QLabel( ButtonGroup2_2, "TextLabel7_2" );
00150     Layout7_2->addWidget( TextLabel7_2 );
00151 
00152     retrieveUrl = new QLineEdit( ButtonGroup2_2, "retrieveUrl" );
00153     retrieveUrl->setEnabled( TRUE );
00154     Layout7_2->addWidget( retrieveUrl );
00155     ButtonGroup2_2Layout->addLayout( Layout7_2 );
00156 
00157     frame7 = new QFrame( ButtonGroup2_2, "frame7" );
00158     frame7->setFrameShape( QFrame::HLine );
00159     frame7->setFrameShadow( QFrame::Sunken );
00160     ButtonGroup2_2Layout->addWidget( frame7 );
00161 
00162     layout13 = new QGridLayout( 0, 1, 1, 0, 6, "layout13"); 
00163 
00164     retrieveUser = new QLineEdit( ButtonGroup2_2, "retrieveUser" );
00165 
00166     layout13->addWidget( retrieveUser, 0, 1 );
00167 
00168     textLabel3 = new QLabel( ButtonGroup2_2, "textLabel3" );
00169 
00170     layout13->addWidget( textLabel3, 0, 0 );
00171 
00172     textLabel4 = new QLabel( ButtonGroup2_2, "textLabel4" );
00173 
00174     layout13->addWidget( textLabel4, 1, 0 );
00175 
00176     retrievePassword = new QLineEdit( ButtonGroup2_2, "retrievePassword" );
00177     retrievePassword->setEchoMode( QLineEdit::Password );
00178 
00179     layout13->addWidget( retrievePassword, 1, 1 );
00180     ButtonGroup2_2Layout->addLayout( layout13 );
00181 
00182     retrieveSavePassword = new QCheckBox( ButtonGroup2_2, "retrieveSavePassword" );
00183     retrieveSavePassword->setEnabled( TRUE );
00184     ButtonGroup2_2Layout->addWidget( retrieveSavePassword );
00185     tabLayout_2->addWidget( ButtonGroup2_2 );
00186     spacer2 = new QSpacerItem( 20, 160, QSizePolicy::Minimum, QSizePolicy::Expanding );
00187     tabLayout_2->addItem( spacer2 );
00188     groupwareTab->insertTab( tab_2, QString::fromLatin1("") );
00189     KOGroupwarePrefsPageLayout->addWidget( groupwareTab );
00190     languageChange();
00191     resize( QSize(496, 548).expandedTo(minimumSizeHint()) );
00192     clearWState( WState_Polished );
00193 
00194     // signals and slots connections
00195     connect( publishDays, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
00196     connect( publishUrl, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00197     connect( publishUser, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00198     connect( publishPassword, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00199     connect( publishSavePassword, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00200     connect( retrieveEnable, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00201     connect( retrieveUser, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00202     connect( retrievePassword, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00203     connect( retrieveSavePassword, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00204     connect( retrieveUrl, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
00205     connect( publishDelay, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
00206     connect( fullDomainRetrieval, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00207     connect( publishEnable, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00208 
00209     // tab order
00210     setTabOrder( groupwareTab, publishEnable );
00211     setTabOrder( publishEnable, publishDelay );
00212     setTabOrder( publishDelay, publishDays );
00213     setTabOrder( publishDays, publishUrl );
00214     setTabOrder( publishUrl, publishUser );
00215     setTabOrder( publishUser, publishPassword );
00216     setTabOrder( publishPassword, publishSavePassword );
00217     setTabOrder( publishSavePassword, retrieveEnable );
00218     setTabOrder( retrieveEnable, fullDomainRetrieval );
00219     setTabOrder( fullDomainRetrieval, retrieveUrl );
00220     setTabOrder( retrieveUrl, retrieveUser );
00221     setTabOrder( retrieveUser, retrievePassword );
00222     setTabOrder( retrievePassword, retrieveSavePassword );
00223 
00224     // buddies
00225     textLabel3->setBuddy( retrieveUser );
00226     textLabel4->setBuddy( retrievePassword );
00227 }
00228 
00229 /*
00230  *  Destroys the object and frees any allocated resources
00231  */
00232 KOGroupwarePrefsPage::~KOGroupwarePrefsPage()
00233 {
00234     // no need to delete child widgets, Qt does it all for us
00235 }
00236 
00237 /*
00238  *  Sets the strings of the subwidgets using the current
00239  *  language.
00240  */
00241 void KOGroupwarePrefsPage::languageChange()
00242 {
00243     TextLabel1->setText( tr2i18n( "By publishing Free/Busy information, you allow others to take your calendar into account when inviting you for a meeting. Only the times you have already busy are published, not why they are busy. For Kolab2 Server leave this disabled (the information is generated on the server)." ) );
00244     publishEnable->setText( tr2i18n( "Publish your free/&busy information automatically" ) );
00245     QWhatsThis::add( publishEnable, tr2i18n( "Check this box to upload your Free/Busy information automatically.\n"
00246 "It is possible to skip this option and mail or upload your Free/Busy information using the Schedule menu of KOrganizer.\n"
00247 "Note: If KOrganizer is acting as a KDE Kolab client, this is not required, as the Kolab2 server taking care of publishing your Free/Busy information and manages the access to it from other users." ) );
00248     publishDelayLabel->setText( tr2i18n( "Minimum time between uploads (in minutes):" ) );
00249     QWhatsThis::add( publishDelayLabel, tr2i18n( "Configure minimum the interval of time in minutes between each upload here. This configuration is only effective in case you choose to publish your information automatically." ) );
00250     QWhatsThis::add( publishDelay, tr2i18n( "Configure minimum the interval of time in minutes between each upload here. This configuration is only effective in case you choose to publish your information automatically." ) );
00251     TextLabel3->setText( tr2i18n( "Publish" ) );
00252     QWhatsThis::add( TextLabel3, tr2i18n( "Configure the number of calendar days you wish to be published and available to others here." ) );
00253     QWhatsThis::add( publishDays, tr2i18n( "Configure the number of calendar days you wish to be published and available to others here." ) );
00254     TextLabel4->setText( tr2i18n( "days of free/busy information" ) );
00255     QWhatsThis::add( TextLabel4, tr2i18n( "Configure the number of calendar days you wish to be published and available to others here." ) );
00256     ButtonGroup2->setTitle( tr2i18n( "Server Information" ) );
00257     QWhatsThis::add( publishUrl, tr2i18n( "Enter the URL for the server on which your Free/Busy information shall be published here.\n"
00258 "Ask the server administrator for this information." ) );
00259     publishSavePassword->setText( tr2i18n( "Remember p&assword" ) );
00260     QWhatsThis::add( publishSavePassword, tr2i18n( "Check this box to make KOrganizer remember your password and skip asking you each time it uploads your Free/Busy information, by storing it in the configuration file.\n"
00261 "For security reasons, it is not recommended to store your password in the configuration file." ) );
00262     textLabel2->setText( tr2i18n( "Password:" ) );
00263     QWhatsThis::add( textLabel2, tr2i18n( "Enter your groupware server login password here." ) );
00264     QWhatsThis::add( publishPassword, tr2i18n( "Enter your groupware server login password here." ) );
00265     QWhatsThis::add( publishUser, tr2i18n( "Enter the login information relative to your account on the server here.\n"
00266 "\n"
00267 "A Kolab2 server specificity: Registered your UID (Unique IDentifier). By default your UID would be your email address on the Kolab2 server but it may also be different. In the last case enter your UID." ) );
00268     TextLabel6->setText( tr2i18n( "Username:" ) );
00269     QWhatsThis::add( TextLabel6, tr2i18n( "Enter the login information relative to your account on the server here.\n"
00270 "\n"
00271 "A Kolab2 server specificity: Registered your UID (Unique IDentifier). By default your UID would be your email address on the Kolab2 server but it may also be different. In the last case enter your UID." ) );
00272     TextLabel7->setText( tr2i18n( "Server URL:" ) );
00273     QWhatsThis::add( TextLabel7, tr2i18n( "Enter the URL for the server on which your Free/Busy information shall be published here.\n"
00274 "Ask the server administrator for this information." ) );
00275     groupwareTab->changeTab( tab, tr2i18n( "P&ublish" ) );
00276     TextLabel2->setText( tr2i18n( "By retrieving Free/Busy information that others have published, you can take their calendar into account when inviting them to a meeting." ) );
00277     retrieveEnable->setText( tr2i18n( "Retrieve other peoples' free/&busy information automatically" ) );
00278     QWhatsThis::add( retrieveEnable, tr2i18n( "Check this box to retrieve other peoples' Free/Busy information automatically. Note that you have to fill the correct server information to make this possible." ) );
00279     fullDomainRetrieval->setText( tr2i18n( "Use full email &address for retrieval" ) );
00280     QToolTip::add( fullDomainRetrieval, tr2i18n( "Set this to retrieve user@domain.ifb instead of user.ifb from the server" ) );
00281     QWhatsThis::add( fullDomainRetrieval, tr2i18n( "Check this box to download a free/busy file in the format \"user@domain.ifb\" (for example joe@company.com.ifb). Otherwise, it will download a free/busy file in the format user.ifb (for example joe.ifb). Ask the server Administrator if you are not sure about how to configure this option." ) );
00282     ButtonGroup2_2->setTitle( tr2i18n( "Server Information" ) );
00283     TextLabel7_2->setText( tr2i18n( "Server URL:" ) );
00284     QWhatsThis::add( TextLabel7_2, tr2i18n( "Enter the URL for the server on which the Free/Busy information is published here.\n"
00285 "Ask the server administrator for this information.\n"
00286 "Here is a Kolab2 Server URL example: \"https://kolab2.example.com/freebusy/\"" ) );
00287     QWhatsThis::add( retrieveUrl, tr2i18n( "Enter the URL for the server on which the Free/Busy information is published here.\n"
00288 "Ask the server administrator for this information.\n"
00289 "Here is a Kolab2 Server URL example: \"https://kolab2.example.com/freebusy/\"" ) );
00290     QWhatsThis::add( retrieveUser, tr2i18n( "Enter the login information relative to your account on the server here.\n"
00291 "\n"
00292 "A Kolab2 server specificity: Registered your UID (Unique IDentifier). By default your UID would be your email address on the Kolab2 server but it may also be different. In the last case enter your UID." ) );
00293     textLabel3->setText( tr2i18n( "User&name:" ) );
00294     QWhatsThis::add( textLabel3, tr2i18n( "Enter the login information relative to your account on the server here.\n"
00295 "\n"
00296 "A Kolab2 server specificity: Registered your UID (Unique IDentifier). By default your UID would be your email address on the Kolab2 server but it may also be different. In the last case enter your UID." ) );
00297     textLabel4->setText( tr2i18n( "Passwor&d:" ) );
00298     QWhatsThis::add( textLabel4, tr2i18n( "Enter your groupware server login password here." ) );
00299     QWhatsThis::add( retrievePassword, tr2i18n( "Enter your groupware server login password here." ) );
00300     retrieveSavePassword->setText( tr2i18n( "Re&member password" ) );
00301     QWhatsThis::add( retrieveSavePassword, tr2i18n( "Check this box to make KOrganizer remember your password and skip asking you each time it uploads your Free/Busy information, by storing it in the configuration file.\n"
00302 "For security reasons, it is not recommended to store your password in the configuration file." ) );
00303     groupwareTab->changeTab( tab_2, tr2i18n( "&Retrieve" ) );
00304 }
00305 
00306 #include "kogroupwareprefspage.moc"