~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/quickopen/quickopenfunctionchooseform.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.net)
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or
 
5
 *  modify it under the terms of the GNU General Public
 
6
 *  License as published by the Free Software Foundation; either
 
7
 *  version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 *  Library General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; see the file COPYING.LIB.  If not, write to
 
16
 *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
 *  Boston, MA 02111-1307, USA.
 
18
 *
 
19
 */
 
20
 
 
21
#include <klistbox.h>
 
22
#include <klocale.h>
 
23
#include <kurl.h>
 
24
#include <kdevproject.h>
 
25
#include <kdevplugin.h>
 
26
#include <ksqueezedtextlabel.h>
 
27
 
 
28
#include <codemodel.h>
 
29
 
 
30
#include "quickopenfunctionchooseform.h"
 
31
#include "quickopenfunctiondialog.h"
 
32
 
 
33
QuickOpenFunctionChooseForm::QuickOpenFunctionChooseForm(QWidget* parent, const char* name, bool modal, WFlags fl)
 
34
: QuickOpenFunctionChooseFormBase(parent,name, modal,fl)
 
35
{
 
36
        setCaption( i18n("Select One Argument or File of Function %1").arg( name ) );
 
37
        slotArgsChange( 0 );
 
38
        slotFileChange( 0 );
 
39
}
 
40
 
 
41
QuickOpenFunctionChooseForm::~QuickOpenFunctionChooseForm()
 
42
{
 
43
}
 
44
 
 
45
void QuickOpenFunctionChooseForm::slotArgsChange( int id )
 
46
{
 
47
        argBox->setCurrentItem( id );
 
48
}
 
49
 
 
50
void QuickOpenFunctionChooseForm::slotFileChange( int id )
 
51
{
 
52
        fileBox->setCurrentItem( id );
 
53
        
 
54
        QuickOpenFunctionDialog *parentDlg = static_cast< QuickOpenFunctionDialog* >( parent() );
 
55
        FunctionDefinitionModel *model = ( *(parentDlg->matchingFuncList()) )[id].data();
 
56
        KURL full_url( model->fileName() );
 
57
        KURL base_url( parentDlg->part()->project()->projectDirectory()+"/" );
 
58
        KURL::relativeURL( base_url, full_url );
 
59
        filepathlabel->setText( KURL::relativeURL( base_url, full_url ) );
 
60
}
 
61
 
 
62
 
 
63
#include "quickopenfunctionchooseform.moc"
 
64