mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Change the way to add new element in a diagram.
Drag & drop an element in a diagram and click left to add it, click right to finish git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3803 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -168,6 +168,27 @@ QETProject::~QETProject() {
|
||||
delete undo_stack_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETProject::integrateElementToProject
|
||||
* Return true if we must to integarte the element to the project otherwise false
|
||||
* @param location : element location
|
||||
* @param project : project to test
|
||||
* @return
|
||||
*/
|
||||
bool QETProject::integrateElementToProject(const ElementsLocation &location, const QETProject *project)
|
||||
{
|
||||
//Integration element must be enable
|
||||
bool auto_integration_enabled = QETApp::settings().value("diagrameditor/integrate-elements", true).toBool();
|
||||
|
||||
//the element belongs there a project and if so, is this another project of the project given by parameter?
|
||||
bool elmt_from_project = location.project();
|
||||
bool elmt_from_another_project = elmt_from_project && location.project() != project;
|
||||
|
||||
bool must_integrate_element = (elmt_from_another_project || (auto_integration_enabled && !elmt_from_project));
|
||||
|
||||
return(must_integrate_element);
|
||||
}
|
||||
|
||||
/**
|
||||
Cette methode peut etre utilisee pour tester la bonne ouverture d'un projet
|
||||
@return l'etat du projet
|
||||
|
||||
Reference in New Issue
Block a user