quickopenfunctionchooseform.cpp
Go to the documentation of this file.00001 /* 00002 * Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.net) 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 * Boston, MA 02111-1307, USA. 00018 * 00019 */ 00020 00021 #include <klistbox.h> 00022 #include <klocale.h> 00023 #include <kurl.h> 00024 #include <kdevproject.h> 00025 #include <kdevplugin.h> 00026 #include <ksqueezedtextlabel.h> 00027 00028 #include <codemodel.h> 00029 00030 #include "quickopenfunctionchooseform.h" 00031 #include "quickopenfunctiondialog.h" 00032 00033 QuickOpenFunctionChooseForm::QuickOpenFunctionChooseForm(QWidget* parent, const char* name, bool modal, WFlags fl) 00034 : QuickOpenFunctionChooseFormBase(parent,name, modal,fl) 00035 { 00036 setCaption( i18n("Select One Argument or File of Function %1").arg( name ) ); 00037 slotArgsChange( 0 ); 00038 slotFileChange( 0 ); 00039 } 00040 00041 QuickOpenFunctionChooseForm::~QuickOpenFunctionChooseForm() 00042 { 00043 } 00044 00045 void QuickOpenFunctionChooseForm::slotArgsChange( int id ) 00046 { 00047 argBox->setCurrentItem( id ); 00048 } 00049 00050 void QuickOpenFunctionChooseForm::slotFileChange( int id ) 00051 { 00052 fileBox->setCurrentItem( id ); 00053 00054 QuickOpenFunctionDialog *parentDlg = static_cast< QuickOpenFunctionDialog* >( parent() ); 00055 FunctionDefinitionModel *model = ( *(parentDlg->matchingFuncList()) )[id].data(); 00056 KURL full_url( model->fileName() ); 00057 KURL base_url( parentDlg->part()->project()->projectDirectory()+"/" ); 00058 KURL::relativeURL( base_url, full_url ); 00059 filepathlabel->setText( KURL::relativeURL( base_url, full_url ) ); 00060 } 00061 00062 00063 #include "quickopenfunctionchooseform.moc" 00064