24#include <tqsplitter.h>
25#include <tqmetaobject.h>
29#include <tdepopupmenu.h>
30#include <tdemessagebox.h>
31#include <tdeaccelmanager.h>
35#include "objecttree.h"
36#include "formmanager.h"
38#include "widgetlibrary.h"
41#include "widgetpropertyset.h"
42#include "widgetwithsubpropertiesinterface.h"
43#include <koproperty/property.h>
62PropertyCommand::PropertyCommand(WidgetPropertySet *set,
const TQCString &
wname,
63 const TQVariant &
oldValue,
const TQVariant &value,
const TQCString &property)
64 :
Command(), m_propSet(set), m_value(value), m_property(property)
69PropertyCommand::PropertyCommand(WidgetPropertySet *set,
const TQMap<TQCString, TQVariant> &
oldvalues,
70 const TQVariant &value,
const TQCString &property)
71 :
Command(), m_propSet(set), m_value(value), m_oldvalues(
oldvalues), m_property(property)
87PropertyCommand::setValue(
const TQVariant &value)
94PropertyCommand::execute()
97 m_propSet->setUndoing(
true);
99 TQMap<TQCString, TQVariant>::ConstIterator
endIt = m_oldvalues.constEnd();
100 for(TQMap<TQCString, TQVariant>::ConstIterator
it = m_oldvalues.constBegin();
it !=
endIt; ++
it)
108 (*m_propSet)[m_property] = m_value;
109 m_propSet->setUndoing(
false);
113PropertyCommand::unexecute()
116 m_propSet->setUndoing(
true);
118 TQMap<TQCString, TQVariant>::ConstIterator
endIt = m_oldvalues.constEnd();
119 for(TQMap<TQCString, TQVariant>::ConstIterator
it = m_oldvalues.constBegin();
it !=
endIt; ++
it)
124 TQWidget *
widg = item->widget();
130 if (-1!=
subWidget->metaObject()->findProperty( m_property,
true ))
134 (*m_propSet)[m_property] = m_oldvalues.begin().data();
135 m_propSet->setUndoing(
false);
139PropertyCommand::name()
const
141 if(m_oldvalues.count() >= 2)
142 return i18n(
"Change \"%1\" property for multiple widgets" ).arg(TQString(m_property));
144 return i18n(
"Change \"%1\" property for widget \"%2\"" ).arg(TQString(m_property)).arg(TQString(m_oldvalues.begin().key()));
148PropertyCommand::debug()
150 kdDebug() <<
"PropertyCommand: name=\"" << name() <<
"\" widgets=" << m_oldvalues.keys()
151 <<
" value=" << m_value <<
" oldValues=" << m_oldvalues.values() <<
endl;
156GeometryPropertyCommand::GeometryPropertyCommand(WidgetPropertySet *set,
157 const TQStringList &names,
const TQPoint&
oldPos)
158 :
Command(), m_propSet(set), m_names(names), m_oldPos(
oldPos)
163GeometryPropertyCommand::execute()
165 m_propSet->setUndoing(
true);
166 int dx = m_pos.x() - m_oldPos.x();
167 int dy = m_pos.y() - m_oldPos.y();
169 TQStringList::ConstIterator
endIt = m_names.constEnd();
171 for(TQStringList::ConstIterator
it = m_names.constBegin();
it !=
endIt; ++
it)
176 TQWidget *
w = item->widget();
177 w->move(
w->x() +
dx,
w->y() +
dy);
179 m_propSet->setUndoing(
false);
183GeometryPropertyCommand::unexecute()
185 m_propSet->setUndoing(
true);
186 int dx = m_pos.x() - m_oldPos.x();
187 int dy = m_pos.y() - m_oldPos.y();
189 TQStringList::ConstIterator
endIt = m_names.constEnd();
191 for(TQStringList::ConstIterator
it = m_names.constBegin();
it !=
endIt; ++
it)
196 TQWidget *
w = item->widget();
197 w->move(
w->x() -
dx,
w->y() -
dy);
199 m_propSet->setUndoing(
false);
203GeometryPropertyCommand::setPos(
const TQPoint&
pos)
210GeometryPropertyCommand::name()
const
212 return i18n(
"Move multiple widgets");
216GeometryPropertyCommand::debug()
218 kdDebug() <<
"GeometryPropertyCommand: pos=" << m_pos <<
" oldPos=" << m_oldPos
219 <<
" widgets=" << m_names <<
endl;
224AlignWidgetsCommand::AlignWidgetsCommand(
int type,
WidgetList &list,
Form *form)
225:
Command(), m_form(form), m_type(type)
227 for(TQWidget *
w = list.first();
w;
w = list.next())
228 m_pos.insert(
w->name(),
w->pos());
232AlignWidgetsCommand::execute()
243 TQMap<TQCString, TQPoint>::ConstIterator
endIt = m_pos.constEnd();
244 for(TQMap<TQCString, TQPoint>::ConstIterator
it = m_pos.constBegin();
it !=
endIt; ++
it)
247 if(item && item->widget())
248 list.append(item->widget());
255 for(TQWidget *
w = list.first();
w;
w = list.next())
269 for(TQWidget *
w = list.first();
w;
w = list.next())
275 for(TQWidget *
w = list.first();
w;
w = list.next())
283 for(TQWidget *
w = list.first();
w;
w = list.next())
285 if(
w->x() +
w->width() >
tmpx)
286 tmpx =
w->x() +
w->width();
289 for(TQWidget *
w = list.first();
w;
w = list.next())
290 w->move(
tmpx -
w->width(),
w->y());
297 for(TQWidget *
w = list.first();
w;
w = list.next())
303 for(TQWidget *
w = list.first();
w;
w = list.next())
311 for(TQWidget *
w = list.first();
w;
w = list.next())
313 if(
w->y() +
w->height() >
tmpy)
314 tmpy =
w->y() +
w->height();
317 for(TQWidget *
w = list.first();
w;
w = list.next())
318 w->move(
w->x(),
tmpy -
w->height());
327 for(TQWidget *
w = list.first();
w;
w = list.next())
332AlignWidgetsCommand::unexecute()
337 TQMap<TQCString, TQPoint>::ConstIterator
endIt = m_pos.constEnd();
338 for(TQMap<TQCString, TQPoint>::ConstIterator
it = m_pos.constBegin();
it !=
endIt; ++
it)
341 if(item && item->widget())
342 item->widget()->move( m_pos[item->widget()->name()] );
348AlignWidgetsCommand::name()
const
353 return i18n(
"Align Widgets to Grid");
355 return i18n(
"Align Widgets to Left");
357 return i18n(
"Align Widgets to Right");
359 return i18n(
"Align Widgets to Top");
361 return i18n(
"Align Widgets to Bottom");
368AlignWidgetsCommand::debug()
370 kdDebug() <<
"AlignWidgetsCommand: name=\"" << name() <<
"\" form=" << m_form->
widget()->name()
371 <<
" widgets=" << m_pos.keys() <<
endl;
376AdjustSizeCommand::AdjustSizeCommand(
int type,
WidgetList &list,
Form *form)
377:
Command(), m_form(form), m_type(type)
379 for(TQWidget *
w = list.first();
w;
w = list.next())
381 if(
w->parentWidget() &&
w->parentWidget()->isA(
"TQWidgetStack"))
383 w =
w->parentWidget();
384 if(
w->parentWidget() &&
w->parentWidget()->inherits(
"TQTabWidget"))
385 w =
w->parentWidget();
388 m_sizes.insert(
w->name(),
w->size());
389 if(m_type == SizeToGrid)
390 m_pos.insert(
w->name(),
w->pos());
395AdjustSizeCommand::execute()
405 TQMap<TQCString, TQSize>::ConstIterator
endIt = m_sizes.constEnd();
406 for(TQMap<TQCString, TQSize>::ConstIterator
it = m_sizes.constBegin();
it !=
endIt; ++
it)
409 if(item && item->widget())
410 list.append(item->widget());
419 for(TQWidget *
w = list.first();
w;
w = list.next())
428 if((
tmpw !=
w->width()) || (
tmph !=
w->height()))
436 for(TQWidget *
w = list.first();
w;
w = list.next()) {
438 if(item && !item->children()->isEmpty()) {
443 s = getSizeFromChildren(item);
451 if(type == Container::HFlow)
452 s.setWidth(
s.width() + 5);
453 else if(type == Container::VFlow)
454 s.setHeight(
s.height() + 5);
460 TQSize sizeHint(
w->sizeHint());
461 if (sizeHint.isValid())
468 case SizeToSmallWidth:
470 for(TQWidget *
w = list.first();
w;
w = list.next())
476 for(TQWidget *
w = list.first();
w;
w = list.next())
478 if(
tmpw !=
w->width())
479 w->resize(
tmpw,
w->height());
486 for(TQWidget *
w = list.first();
w;
w = list.next())
488 if(
w->width() >
tmpw)
492 for(TQWidget *
w = list.first();
w;
w = list.next())
494 if(
tmpw !=
w->width())
495 w->resize(
tmpw,
w->height());
500 case SizeToSmallHeight:
502 for(TQWidget *
w = list.first();
w;
w = list.next())
508 for(TQWidget *
w = list.first();
w;
w = list.next())
510 if(
tmph !=
w->height())
511 w->resize(
w->width(),
tmph);
516 case SizeToBigHeight:
518 for(TQWidget *
w = list.first();
w;
w = list.next())
520 if(
w->height() >
tmph)
524 for(TQWidget *
w = list.first();
w;
w = list.next())
526 if(
tmph !=
w->height())
527 w->resize(
w->width(),
tmph);
537 for(TQWidget *
w = list.first();
w;
w = list.next())
549 s =
s.expandedTo(getSizeFromChildren(
tree));
561 return TQSize(
tmpw,
tmph) + TQSize(10, 10);
565AdjustSizeCommand::unexecute()
570 TQMap<TQCString, TQSize>::ConstIterator
endIt = m_sizes.constEnd();
571 for(TQMap<TQCString, TQSize>::ConstIterator
it = m_sizes.constBegin();
it !=
endIt; ++
it)
574 if(item && item->widget())
576 item->widget()->resize( m_sizes[item->widget()->name()] );
577 if(m_type == SizeToGrid)
578 item->widget()->move( m_pos[item->widget()->name()] );
585AdjustSizeCommand::name()
const
590 return i18n(
"Resize Widgets to Grid");
592 return i18n(
"Resize Widgets to Fit Contents");
593 case SizeToSmallWidth:
594 return i18n(
"Resize Widgets to Narrowest");
596 return i18n(
"Resize Widgets to Widest");
597 case SizeToSmallHeight:
598 return i18n(
"Resize Widgets to Shortest");
599 case SizeToBigHeight:
600 return i18n(
"Resize Widgets to Tallest");
607AdjustSizeCommand::debug()
609 kdDebug() <<
"AdjustSizeCommand: name=\"" << name() <<
"\" form=" << m_form->
widget()->name()
610 <<
" widgets=" << m_sizes.keys() <<
endl;
615LayoutPropertyCommand::LayoutPropertyCommand(WidgetPropertySet *
buf,
const TQCString &
wname,
616 const TQVariant &
oldValue,
const TQVariant &value)
626 m_geometries.insert(
it->name().latin1(),
it->widget()->geometry());
630LayoutPropertyCommand::execute()
632 PropertyCommand::execute();
636LayoutPropertyCommand::unexecute()
642 m_container->
setLayout(Container::NoLayout);
644 TQMap<TQCString,TQRect>::ConstIterator
endIt = m_geometries.constEnd();
645 for(TQMap<TQCString,TQRect>::ConstIterator
it = m_geometries.constBegin();
it !=
endIt; ++
it)
649 tree->widget()->setGeometry(
it.data());
652 PropertyCommand::unexecute();
656LayoutPropertyCommand::name()
const
658 return i18n(
"Change layout of widget \"%1\"").arg(TQString(m_oldvalues.begin().key()));
662LayoutPropertyCommand::debug()
664 kdDebug() <<
"LayoutPropertyCommand: name=\"" << name() <<
"\" oldValue=" << m_oldvalues.keys()
665 <<
" value=" << m_value <<
endl;
673 m_containername = container->
widget()->name();
674 m_form = container->
form();
676 m_insertRect = container->m_insertRect;
677 m_point = container->m_insertBegin;
679 container->
form()->
library()->namePrefix(m_class).latin1(),
false);
684 const TQCString& className,
const TQPoint&
pos,
const TQCString& namePrefix)
687 m_containername = container->
widget()->name();
688 m_form = container->
form();
692 if (namePrefix.isEmpty()) {
694 container->
form()->
library()->namePrefix(m_class).latin1() );
712 if (m_container->
form()->
library()->internalProperty(m_class,
"orientationSelectionPopup")==
"1") {
713 if(m_insertRect.isValid()) {
714 if (m_insertRect.width() < m_insertRect.height()) {
718 else if (m_insertRect.width() > m_insertRect.height()) {
726 m_class, m_container->m_container,
727 m_container->
form()->
widget()->mapToGlobal(m_point));
736 m_container, options);
742 i18n(
"Could not insert widget of type \"%1\". A problem with widget's creation encountered.")
744 kdWarning() <<
"InsertWidgetCommand::execute() ERROR: widget creation failed" <<
endl;
747#if TDE_VERSION >= TDE_MAKE_VERSION(3,4,0)
751 TDEAcceleratorManager::setNoAccel(
w);
756 if(( (m_insertRect.width() < 21) && (m_insertRect.height() < 21)))
758 TQSize
s =
w->sizeHint();
763 if(m_insertRect.isValid())
765 x = m_insertRect.x();
766 y = m_insertRect.y();
773 m_insertRect = TQRect(
x,
y,
s.width() + 16,
776 w->move(m_insertRect.x(), m_insertRect.y());
777 w->resize(m_insertRect.width()-1, m_insertRect.height()-1);
778 w->setStyle(&(m_container->
widget()->style()));
779 w->setBackgroundOrigin(TQWidget::ParentOrigin);
799 TQValueList<TQCString> list(m_container->
form()->
library()->autoSaveProperties(
w->className()));
801 TQValueList<TQCString>::ConstIterator
endIt = list.constEnd();
802 for(TQValueList<TQCString>::ConstIterator
it = list.constBegin();
it !=
endIt; ++
it)
808 if (m_container->
form()->
library()->internalProperty(
w->className(),
809 "dontStartEditingOnInserting").isEmpty())
815 kdDebug() <<
"Container::eventFilter(): widget added " <<
this <<
endl;
819InsertWidgetCommand::unexecute()
824 TQWidget *m_widget =
titem->widget();
830InsertWidgetCommand::name()
const
832 if(!m_name.isEmpty())
833 return i18n(
"Insert widget \"%1\"").arg(TQString(m_name));
835 return i18n(
"Insert widget");
839InsertWidgetCommand::debug()
841 kdDebug() <<
"InsertWidgetCommand: name=\"" << name() <<
"\" generatedName=" << m_name
842 <<
" container=" << m_containername
843 <<
" form=" << m_form->
widget()->name() <<
" class=" << m_class
844 <<
" rect=" << m_insertRect <<
" pos=" << m_point <<
endl;
849CreateLayoutCommand::CreateLayoutCommand(
int layoutType,
WidgetList &list,
Form *form)
850 : m_form(form), m_type(layoutType)
855 case Container::HBox:
856 case Container::Grid:
857 case Container::HSplitter:
858 case Container::HFlow:
860 case Container::VBox:
861 case Container::VSplitter:
862 case Container::VFlow:
865 for(TQWidget *
w = list.first();
w;
w = list.next())
869 for(TQWidget *
w = m_list->first();
w;
w = m_list->next())
870 m_pos.insert(
w->name(),
w->geometry());
873 m_containername = item->parent()->name();
890 case Container::HSplitter:
case Container::VSplitter:
899 TQWidget *
w =
lib->createWidget(
classname, container->
widget(), m_name.latin1(), container);
900#if TDE_VERSION >= TDE_MAKE_VERSION(3,4,0)
905 TDEAcceleratorManager::setNoAccel(
w);
914 w->move(m_pos.begin().data().topLeft());
916 if(m_type == Container::HFlow)
917 w->resize( TQSize(700, 20) );
918 else if(m_type == Container::VFlow)
919 w->resize( TQSize(20, 700));
923 TQMap<TQCString,TQRect>::ConstIterator
endIt = m_pos.constEnd();
924 for(TQMap<TQCString,TQRect>::ConstIterator
it = m_pos.constBegin();
it !=
endIt; ++
it)
927 if(item && item->widget())
929 item->widget()->reparent(
w, item->widget()->pos(),
true);
935 if(m_type == Container::HSplitter)
937 else if(m_type == Container::VSplitter)
939 else if(
tree->container()) {
940 tree->container()->setLayout((Container::LayoutType)m_type);
941 w->resize(
tree->container()->layout()->sizeHint());
949CreateLayoutCommand::unexecute()
956 TQMap<TQCString,TQRect>::ConstIterator
endIt = m_pos.constEnd();
957 for(TQMap<TQCString,TQRect>::ConstIterator
it = m_pos.constBegin();
it !=
endIt; ++
it)
960 if(item && item->widget())
962 item->widget()->reparent(parent->widget(), TQPoint(0,0),
true);
964 if(m_pos[
it.key()].isValid())
965 item->widget()->setGeometry(m_pos[
it.key()]);
975 TQWidget *
w =
titem->widget();
981CreateLayoutCommand::name()
const
985 case Container::HBox:
986 return i18n(
"Group Widgets Horizontally");
987 case Container::VBox:
988 return i18n(
"Group Widgets Vertically");
989 case Container::Grid:
990 return i18n(
"Group Widgets in a Grid");
991 case Container::HSplitter:
992 return i18n(
"Group Widgets Horizontally in a Splitter");
993 case Container::VSplitter:
994 return i18n(
"Group Widgets Vertically in a Splitter");
995 case Container::HFlow:
996 return i18n(
"Group Widgets By Rows");
997 case Container::VFlow:
998 return i18n(
"Group Widgets Vertically By Columns");
1000 return i18n(
"Group widgets");
1005CreateLayoutCommand::debug()
1007 kdDebug() <<
"CreateLayoutCommand: name=\"" << name() <<
"\" generatedName=" << m_name
1008 <<
" widgets=" << m_pos.keys() <<
" container=" << m_containername
1009 <<
" form=" << m_form->
widget()->name() <<
endl;
1018 m_name = container->
widget()->name();
1019 m_form = container->
form();
1024 TQRect
r(container->
widget()->mapTo(container->
widget()->parentWidget(),
tree->widget()->pos()),
tree->widget()->size());
1025 m_pos.insert(
tree->widget()->name(),
r);
1030BreakLayoutCommand::execute()
1032 CreateLayoutCommand::unexecute();
1036BreakLayoutCommand::unexecute()
1042BreakLayoutCommand::name()
const
1044 return i18n(
"Break Layout: \"%1\"").arg(m_name);
1048BreakLayoutCommand::debug()
1050 kdDebug() <<
"BreakLayoutCommand: name=\"" << name()
1051 <<
" widgets=" << m_pos.keys() <<
" container=" << m_containername
1052 <<
" form=" << m_form->
widget()->name() <<
endl;
1057PasteWidgetCommand::PasteWidgetCommand(TQDomDocument &
domDoc,
Container *container,
const TQPoint&
p)
1060 m_data =
domDoc.toCString();
1061 m_containername = container->
widget()->name();
1062 m_form = container->
form();
1064 if(
domDoc.namedItem(
"UI").firstChild().nextSibling().toElement().tagName() !=
"widget")
1070 if(
n.toElement().tagName() !=
"widget")
1077 if((
n.toElement().tagName() ==
"property") && (
n.toElement().attribute(
"name") ==
"geometry"))
1078 rect =
n.firstChild().toElement();
1086 int rx =
x.text().toInt();
1087 int ry =
y.text().toInt();
1088 int rw =
wi.text().toInt();
1089 int rh =
h.text().toInt();
1098PasteWidgetCommand::execute()
1107 TQDomDocument
domDoc(
"UI");
1120 if(!
domDoc.namedItem(
"UI").hasChildNodes())
1122 if(
domDoc.namedItem(
"UI").firstChild().nextSibling().toElement().tagName() !=
"widget")
1126 if(m_point.isNull())
1132 FormIO::loadWidget(container,
el);
1135 else for(
TQDomNode n =
domDoc.namedItem(
"UI").firstChild(); !
n.isNull();
n =
n.nextSibling())
1137 if(
n.toElement().tagName() !=
"widget")
1141 if(!m_point.isNull())
1142 moveWidgetBy(
el, container, m_point);
1145 kdDebug() <<
"jdkjfldfksmfkdfjmqdsklfjdkkfmsqfksdfsm" <<
endl;
1149 FormIO::loadWidget(container,
el);
1158 if(
n.toElement().tagName() !=
"widget")
1160 for(
TQDomNode m =
n.firstChild(); !
m.isNull();
n =
m.nextSibling())
1162 if((
m.toElement().tagName() ==
"property") && (
m.toElement().attribute(
"name") ==
"name"))
1164 m_names.append(
m.toElement().text());
1171 TQStringList::ConstIterator
endIt = m_names.constEnd();
1172 for(TQStringList::ConstIterator
it = m_names.constBegin();
it !=
endIt; ++
it)
1181PasteWidgetCommand::unexecute()
1188 TQStringList::ConstIterator
endIt = m_names.constEnd();
1189 for(TQStringList::ConstIterator
it = m_names.constBegin();
it !=
endIt; ++
it)
1194 TQWidget *
w =
titem->widget();
1200PasteWidgetCommand::name()
const
1202 return i18n(
"Paste");
1214 if((
n.toElement().tagName() ==
"property") && (
n.toElement().attribute(
"name") ==
"geometry"))
1215 rect =
n.firstChild().toElement();
1219 x.removeChild(
x.firstChild());
1224 y.removeChild(
y.firstChild());
1278 moveWidgetBy(
el, container, TQPoint(0, 0));
1287 if((
n.toElement().tagName() ==
"property") && (
n.toElement().attribute(
"name") ==
"geometry"))
1288 rect =
n.firstChild().toElement();
1296 int rx =
x.text().toInt();
1297 int ry =
y.text().toInt();
1298 int rw =
wi.text().toInt();
1299 int rh =
h.text().toInt();
1301 kdDebug() <<
"Moving widget by " <<
p <<
" from " <<
rx <<
" " <<
ry <<
" to " <<
r.topLeft() <<
endl;
1303 TQWidget *
w = m_form->
widget()->childAt(
r.x() + 6,
r.y() + 6,
false);
1305 while(
w && (
w->geometry() ==
r))
1307 w = m_form->
widget()->childAt(
w->x() + 16,
w->y() + 16,
false);
1314 else if(
r.right() > container->
widget()->width())
1315 r.moveLeft(container->
widget()->width() -
r.width());
1319 else if(
r.bottom() > container->
widget()->height())
1320 r.moveTop(container->
widget()->height() -
r.height());
1334 if((
n.toElement().tagName() ==
"property") && (
n.toElement().attribute(
"name") ==
"name"))
1336 wname =
n.toElement().text();
1346 if(
wname !=
n.toElement().text())
1348 n.removeChild(
n.firstChild());
1351 type.appendChild(
valueE);
1352 n.toElement().appendChild(type);
1356 if(
n.toElement().tagName() ==
"widget")
1365PasteWidgetCommand::debug()
1367 kdDebug() <<
"PasteWidgetCommand: pos=" << m_point
1368 <<
" widgets=" << m_names <<
" container=" << m_containername
1369 <<
" form=" << m_form->
widget()->name()
1370 <<
" data=\"" << m_data.left(80) <<
"...\"" <<
endl;
1375DeleteWidgetCommand::DeleteWidgetCommand(
WidgetList &list,
Form *form)
1378 m_domDoc = TQDomDocument(
"UI");
1379 m_domDoc.appendChild(m_domDoc.createElement(
"UI"));
1381 TQDomElement parent = m_domDoc.namedItem(
"UI").toElement();
1403 m_containers.insert(item->name().latin1(), m_form->
parentContainer(item->widget())->
widget()->name());
1404 m_parents.insert(item->name().latin1(), item->parent()->name().latin1());
1405 FormIO::saveWidget(item, parent, m_domDoc);
1406 form->connectionBuffer()->saveAllConnectionsForWidget(item->widget()->name(), m_domDoc);
1409 FormIO::cleanClipboard(parent);
1413DeleteWidgetCommand::execute()
1417 TQMap<TQCString,TQCString>::ConstIterator
endIt = m_containers.constEnd();
1418 for(TQMap<TQCString,TQCString>::ConstIterator
it = m_containers.constBegin();
it !=
endIt; ++
it)
1421 if (!item || !item->widget())
1435DeleteWidgetCommand::unexecute()
1439 for(
TQDomNode n = m_domDoc.namedItem(
"UI").firstChild(); !
n.isNull();
n =
n.nextSibling())
1441 if(
n.toElement().tagName() ==
"connections")
1442 m_form->connectionBuffer()->load(
n);
1443 if(
n.toElement().tagName() !=
"widget")
1446 for(
TQDomNode m =
n.firstChild(); !
m.isNull();
n =
m.nextSibling())
1448 if((
m.toElement().tagName() ==
"property") && (
m.toElement().attribute(
"name") ==
"name"))
1450 wname =
m.toElement().text().latin1();
1462 FormIO::loadWidget(
cont,
widg, parent->widget());
1470DeleteWidgetCommand::name()
const
1472 return i18n(
"Delete widget");
1476DeleteWidgetCommand::debug()
1478 kdDebug() <<
"DeleteWidgetCommand: containers=" << m_containers.keys()
1479 <<
" parents=" << m_parents.keys() <<
" form=" << m_form->
widget()->name() <<
endl;
1489CutWidgetCommand::execute()
1491 DeleteWidgetCommand::execute();
1497CutWidgetCommand::unexecute()
1499 DeleteWidgetCommand::unexecute();
1504CutWidgetCommand::name()
const
1510CutWidgetCommand::debug()
1512 kdDebug() <<
"CutWidgetCommand: containers=" << m_containers.keys()
1513 <<
" parents=" << m_parents.keys() <<
" form=" << m_form->
widget()->name()
1514 <<
" data=\"" << m_data.left(80) <<
"...\"" <<
endl;
1520class CommandGroup::SubCommands :
public KMacroCommand
1523 SubCommands(
const TQString & name )
1524 : KMacroCommand(name)
1531CommandGroup::CommandGroup(
const TQString & name, WidgetPropertySet *
propSet )
1533 , m_subCommands(
new SubCommands(name))
1538CommandGroup::~CommandGroup()
1540 delete m_subCommands;
1545 return m_subCommands->commands();
1553 m_subCommands->addCommand(
command);
1563 it.current()->execute();
1571 m_subCommands->unexecute();
1575TQString CommandGroup::name()
const
1577 return m_subCommands->name();
1586CommandGroup::debug()
1588 kdDebug() <<
"*CommandGroup: name=\"" << name() <<
"\" #=" << m_subCommands->commands().count() <<
endl;
1593 if (
dynamic_cast<Command*
>(
it.current()))
1594 dynamic_cast<Command*
>(
it.current())->debug();