X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f85e6b00bd29ddff6067db8c6d4c56f53bcf4c0b..ee2cb3d6c26ae319d20bde28f415393e96611ece:/Constructor/src/constructor.cpp?ds=sidebyside diff --git a/Constructor/src/constructor.cpp b/Constructor/src/constructor.cpp index 2120573..3447a2e 100644 --- a/Constructor/src/constructor.cpp +++ b/Constructor/src/constructor.cpp @@ -108,13 +108,7 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr::iterator i = listaItems.begin(); - while ( i != listaItems.end() ){ - CItem *temp = *i; - listaItems.erase(i); - delete temp; - i = listaItems.begin(); - } + Constructor::on_edit_menu_delete_all(); } void Constructor::on_btn_canio_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time) @@ -188,22 +182,28 @@ void Constructor::on_main_menu_save() } void Constructor::on_edit_menu_del() -{ // OJO que borra al primero que encuentra con el mismo nombre!!! +{ + workplace->delete_item(WorkPlace::pointed); +} + +void Constructor::on_edit_menu_delete_all() +{ std::list::iterator i = listaItems.begin(); - Glib::ustring pointed = combo_entry->get_text(); - while ( i != listaItems.end() ){ - CItem *temp = *i; - if ( temp->get_name() == pointed ){ - workplace->delete_item(temp->get_id()); - break; - } - i++; + while ( i != listaItems.end() ) { + (*i)->workplace->delete_item((*i)->get_id()); + i = listaItems.begin(); + } + i = lista_logic_Items.begin(); + while ( i != lista_logic_Items.end() ) { + (*i)->workplace->delete_item((*i)->get_id()); + i=lista_logic_Items.begin(); } } void Constructor::on_chk_btn_clicked() { logica = !logica; + CItem::logic_connect = !CItem::logic_connect; } void Constructor::on_load_from_xml() @@ -272,6 +272,7 @@ void Constructor::on_load_from_xml() } std::cout << "CARGA COMPLETA" << std::endl; file_open_selection->hide(); + id = listaItems.size()+lista_logic_Items.size()+1; } void Constructor::on_btn_file_ok_clicked() { @@ -727,4 +728,3 @@ Splitter *Constructor::loadCodo(xmlNodePtr nodo) return p; } -