kpilot Library API Documentation

resolutionDialog.cc

00001 /* resolutionDialog.h                   KPilot
00002 **
00003 ** Copyright (C) 2002 by Reinhold Kainhofer
00004 **
00005 ** See the .cc file for an explanation of what this file is for.
00006 */
00007 
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU General Public License as published by
00011 ** the Free Software Foundation; either version 2 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00022 ** MA 02111-1307, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 #include "options.h"
00030 #include "resolutionDialog.moc"
00031 
00032 #include <qcheckbox.h>
00033 #include <qtimer.h>
00034 #include <qlayout.h>
00035 #include <qvbuttongroup.h>
00036 #include <qlabel.h>
00037 #include <qradiobutton.h>
00038 
00039 #include <kpilotlink.h>
00040 
00041 ResolutionDlg::ResolutionDlg( QWidget* parent, KPilotDeviceLink*fH, QString caption, QString Text, QStringList lst, QString remember) :
00042         KDialogBase( parent, "resolutiondlg", true, caption, Ok|Cancel, Ok, true ), ResolutionButtonGroup(0L), rememberCheck(0L), tickleTimer(0L), fHandle(fH)
00043 {
00044         QWidget *page = new QWidget( this );
00045         setMainWidget(page);
00046 
00047         setSizeGripEnabled( TRUE );
00048         QGridLayout* topLayout = new QGridLayout( page, 5, 3, 11, 6, "MyDialogLayout");
00049 
00050         QLabel* label = new QLabel(Text, page, "TextLabel1" );
00051 //      TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)2, (QSizePolicy::SizeType)5, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
00052         label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, label->sizePolicy().hasHeightForWidth() ) );
00053         label->setAlignment(WordBreak);
00054         topLayout->addMultiCellWidget( label, 0, 0, 0, 2 );
00055 
00056         QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00057         topLayout->addItem( spacer, 1, 0 );
00058         ResolutionButtonGroup = new QVButtonGroup(page, "ResolutionButtonGroup" );
00059         topLayout->addMultiCellWidget( ResolutionButtonGroup, 1,1, 1,1 );
00060         for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
00061                 new QRadioButton(*it, ResolutionButtonGroup);
00062         }
00063         ResolutionButtonGroup->setButton(0);
00064         spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00065         topLayout->addItem( spacer, 1, 2 );
00066 
00067 //      QLineEdit* ed=new QLineEdit(page);
00068 //      topLayout->addMultiCellWidget( ed, 1,1, 2,3);
00069 
00070 
00071         spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
00072         topLayout->addItem( spacer, 2, 1 );
00073 
00074         if (!remember.isEmpty() )
00075         {
00076                 rememberCheck = new QCheckBox( remember, this, "rememberCheck" );
00077                 rememberCheck->setChecked( TRUE );
00078                 topLayout->addMultiCellWidget( rememberCheck, 3, 3, 0, 2 );
00079         }
00080 
00081 //      topLayout->addStretch(10);
00082                 // tab order
00083 //      setTabOrder( RadioButton1, RadioButton1_2 );
00084 //      setTabOrder( RadioButton1_2, RadioButton1_2_2 );
00085 //      setTabOrder( RadioButton1_2_2, buttonOk );
00086 //      setTabOrder( buttonOk, buttonCancel );
00087 //      setTabOrder( buttonCancel, buttonHelp );
00088         adjustSize();
00089         resize(size());
00090 
00091 
00092         if (fHandle)
00093                 tickleTimer=new QTimer(this, "TickleTimer");
00094 
00095         if (tickleTimer)
00096         {
00097                 connect( tickleTimer, SIGNAL(timeout()), this, SLOT(_tickle()) );
00098                 tickleTimer->start( 10000 ); // tickle the palm every 10 seconds to prevent a timeout until the sync is really finished.
00099         }
00100 
00101 }
00102 
00103 void ResolutionDlg::_tickle()
00104 {
00105         if (fHandle)
00106                 fHandle->tickle();
00107 }
00108 
00109 /*
00110  *  Destroys the object and frees any allocated resources
00111  */
00112 ResolutionDlg::~ResolutionDlg()
00113 {
00114     // no need to delete child widgets, Qt does it all for us
00115 }
00116 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:44 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001