• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Buildtool Widgets Library
 

KDevelop Buildtool Widgets Library

  • buildtools
  • lib
  • widgets
subclassesdlg.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library 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 library 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 Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #include <tqlistbox.h>
20 #include <kurlrequester.h>
21 
22 #include "subclassesdlg.h"
23 #include "subclassesdlg.moc"
24 SubclassesDlg::SubclassesDlg(TQString form, DomUtil::PairList &config, TQString projectDir, TQWidget* parent, const char* name, bool modal, WFlags fl)
25 : SubclassesDlgBase(parent,name, modal,fl), m_form(form), m_config(config), m_projectDir(projectDir)
26 {
27  subclass_url->setEnabled(false);
28 
29  DomUtil::PairList::iterator it;
30  for ( it = config.begin(); it != config.end(); ++it )
31  {
32  if ((*it).second == form)
33  subclasses_box->insertItem(projectDir + (*it).first);
34  }
35 }
36 
37 SubclassesDlg::~SubclassesDlg()
38 {
39 }
40 
41 /*$SPECIALIZATION$*/
42 void SubclassesDlg::accept()
43 {
44  TQPtrList<DomUtil::Pair> pairsToRemove;
45 
46  DomUtil::PairList::iterator it;
47  for ( it = m_config.begin(); it != m_config.end(); ++it )
48  {
49  if ((*it).second == m_form)
50  {
51  pairsToRemove.append(&(*it));
52  }
53  }
54 
55  DomUtil::Pair *pair;
56  for ( pair = pairsToRemove.first(); pair; pair = pairsToRemove.next() )
57  {
58  m_config.remove(*pair);
59  }
60 
61  for (int i = 0; i < (int)subclasses_box->count(); ++i)
62  {
63  m_config << DomUtil::Pair(subclasses_box->text(i).remove(0,m_projectDir.length()), m_form);
64  }
65 
66  SubclassesDlgBase::accept();
67 }
68 
69 
70 void SubclassesDlg::newRelation()
71 {
72  subclasses_box->setFocus();
73  subclasses_box->insertItem("");
74  subclasses_box->setCurrentItem(subclasses_box->count()-1);
75  subclass_url->setEnabled(true);
76  subclass_url->setURL("");
77  subclass_url->setFocus();
78 }
79 
80 void SubclassesDlg::removeRelation()
81 {
82  if (subclasses_box->currentItem() > -1)
83  {
84  TQListBoxItem *item = subclasses_box->item(subclasses_box->currentItem());
85  int itemIdx = subclasses_box->currentItem();
86 
87  if (item->prev())
88  {
89  subclasses_box->setCurrentItem(item->prev());
90  subclass_url->setURL(item->prev()->text());
91  }
92  else if (item->next())
93  {
94  subclasses_box->setCurrentItem(item->next());
95  subclass_url->setURL(item->next()->text());
96  }
97  else
98  {
99  subclass_url->setEnabled(false);
100  subclass_url->setURL("");
101  }
102  subclasses_box->removeItem(itemIdx);
103  }
104 }
105 
106 void SubclassesDlg::changeCurrentURL(const TQString &str)
107 {
108  if ( subclasses_box->currentItem() > -1 )
109  {
110  subclasses_box->changeItem(str, subclasses_box->currentItem());
111  }
112 }
113 
114 void SubclassesDlg::currentRelationChanged( TQListBoxItem * item )
115 {
116  if (item)
117  {
118  subclass_url->setEnabled(true);
119  subclass_url->setURL(item->text());
120  }
121 }
122 

KDevelop Buildtool Widgets Library

Skip menu "KDevelop Buildtool Widgets Library"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Buildtool Widgets Library

Skip menu "KDevelop Buildtool Widgets Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Buildtool Widgets Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.