addtemplatedlg.cpp
Go to the documentation of this file.00001 /* $Id: addtemplatedlg.cpp,v 1.6 2003/06/22 17:28:25 mlaurent Exp $ 00002 * 00003 * Copyright (C) 2002 Roberto Raggi (roberto@kdevelop.org) 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; see the file COPYING. If not, write to 00017 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 * Boston, MA 02111-1307, USA. 00019 * 00020 */ 00021 #include "addtemplatedlg.h" 00022 #include <qcombobox.h> 00023 #include <qlineedit.h> 00024 #include <qpushbutton.h> 00025 00026 AddTemplateDialog::AddTemplateDialog( QStringList suffixesList, QWidget *parent, const char *name ) 00027 : AddTemplateDialogBase( parent, name ) 00028 { 00029 setFocusProxy( editTemplate ); 00030 comboSuffixes->insertStringList(suffixesList); 00031 connect( editTemplate, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged())); 00032 connect( editDescription, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged())); 00033 buttonOk->setEnabled(false); 00034 } 00035 00036 AddTemplateDialog::~AddTemplateDialog() 00037 { 00038 } 00039 00040 void AddTemplateDialog::textChanged() 00041 { 00042 buttonOk->setEnabled( !editTemplate->text().isEmpty() && !editDescription->text().isEmpty() ); 00043 } 00044 00045 QString AddTemplateDialog::templ() const 00046 { 00047 return editTemplate->text(); 00048 } 00049 00050 QString AddTemplateDialog::description() const 00051 { 00052 return editDescription->text(); 00053 } 00054 00055 QString AddTemplateDialog::suffixes() const 00056 { 00057 return comboSuffixes->currentText(); 00058 } 00059 00060 #include "addtemplatedlg.moc"