copy/paste rules between data files

This commit is contained in:
Vadim Kurland
2008-08-19 16:41:26 +00:00
parent 9ffdb59e1f
commit 61e603723a
4 changed files with 26 additions and 5 deletions
+9
View File
@@ -1,3 +1,12 @@
2008-08-19 Vadim Kurland <vadim@vk.crocodile.org>
* RuleSetView.cpp (RuleSetView::pasteRuleAbove): Permit copy/paste
of individual rules between two data files. When a rule is copied
this way, all objects used in this rule are copied as well.
* FWWindow.cpp (FWWindow::recreateWindowsMenu): fixed typo in the
main menu item name
2008-08-18 Vadim Kurland <vadim@vk.crocodile.org>
* Compiler.cpp (Compiler::complexMatch): (change in libfwbuilder)
+1 -1
View File
@@ -1528,7 +1528,7 @@ void FWWindow::recreateWindowsMenu ()
m_mainWindow->menuWindow->clear();
QAction * close = m_mainWindow->menuWindow->addAction ("Close");
QAction * closeAll = m_mainWindow->menuWindow->addAction ("Close All");
QAction * title = m_mainWindow->menuWindow->addAction ("Title");
QAction * title = m_mainWindow->menuWindow->addAction ("Tile");
QAction * cascade = m_mainWindow->menuWindow->addAction ("Cascade");
QAction * next = m_mainWindow->menuWindow->addAction ("Next");
QAction * previous = m_mainWindow->menuWindow->addAction ("Previous");
+5 -2
View File
@@ -1772,8 +1772,11 @@ FWObject* ObjectManipulator::duplicateWithDependencies(FWObject *target,
nobj->ref();
//if renew_id == true creates new object ID
nobj->duplicate(obj, true);
makeNameUnique(target, nobj);
target->add( nobj );
if (target)
{
makeNameUnique(target, nobj);
target->add( nobj );
}
map_ids[obj->getId()] = nobj->getId();
+11 -2
View File
@@ -4319,9 +4319,18 @@ void RuleSetView::pasteRuleAbove()
for (i= FWObjectClipboard::obj_clipboard->rbegin();
i!=FWObjectClipboard::obj_clipboard->rend(); ++i)
{
FWObject *co= m_project->db()->findInIndex(i->first);
ProjectPanel *proj_p = i->second;
FWObject *co = proj_p->db()->findInIndex(i->first);
if (!Rule::cast(co)) continue;
insertRule( firstSelectedRow, co);
if (proj_p==m_project)
{
insertRule( firstSelectedRow, co);
} else
{
// rule is being copied from another project file
co = m_project->m_panel->om->duplicateWithDependencies(NULL, co);
insertRule( firstSelectedRow, co);
}
}
changingRules = false;