Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

newtaskdlg.cpp

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C) Opie Team <opie-devel@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022 :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 */
00030 
00031 #include "newtaskdlg.h"
00032 
00033 #include <qbuttongroup.h>
00034 #include <qcombobox.h>
00035 #include <qlayout.h>
00036 #include <qradiobutton.h>
00037 
00038 NewTaskDlg::NewTaskDlg( const QStringList &templates, QWidget *parent )
00039     : QDialog( parent, QString::null, true, WStyle_ContextHelp )
00040 {
00041     setCaption( tr( "New Task" ) );
00042 
00043     QButtonGroup *bg = new QButtonGroup( this );
00044     bg->hide();
00045 
00046     QVBoxLayout *layout = new QVBoxLayout( this, 10, 3 );
00047 
00048     QRadioButton *btn = new QRadioButton( tr( "Blank task" ), this );
00049     btn->setChecked( true );
00050     bg->insert( btn );
00051     layout->addWidget( btn );
00052 
00053     layout->addStretch();
00054 
00055     m_useTemplate = new QRadioButton( tr( "Using template:" ), this );
00056     connect( m_useTemplate, SIGNAL(toggled(bool)), this, SLOT(slotUseTemplate(bool)) );
00057     bg->insert( m_useTemplate );
00058     layout->addWidget( m_useTemplate );
00059 
00060     m_templateList = new QComboBox( this );
00061     m_templateList->insertStringList( templates );
00062     m_templateList->setEnabled( false );
00063     layout->addWidget( m_templateList );
00064 
00065     layout->addStretch();
00066 }
00067 
00068 QString NewTaskDlg::tempSelected() {
00069     QString tempStr;
00070     if ( m_useTemplate->isChecked() )
00071         tempStr = m_templateList->currentText();
00072 
00073     return tempStr;
00074 }
00075 
00076 void NewTaskDlg::slotUseTemplate( bool on ) {
00077     m_templateList->setEnabled( on );
00078     if ( on )
00079         m_templateList->setFocus();
00080 }

Generated on Sat Nov 5 16:15:55 2005 for OPIE by  doxygen 1.4.2