~ubuntu-branches/ubuntu/utopic/ginkgocadx/utopic-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/gui/import/selectimagesimportation.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2012-01-29 12:02:54 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120129120254-nu7giync5p156icb
Tags: 2.8.0.4602-1
New upstream version (adapted patch, removed patch applied upstream)
Closes: #657827

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  
3
 
 *  $Id: selectimagesimportation.cpp 4403 2011-11-14 10:59:24Z tovar $
 
3
 *  $Id: selectimagesimportation.cpp 4602 2012-01-26 07:23:02Z tovar $
4
4
 *  Ginkgo CADx Project
5
5
 *
6
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
43
43
#include "selectimagesimportation.h"
44
44
#include <api/icontextoestudio.h>
45
45
#include <resources/ginkgoresourcemanager.h>
 
46
#include <main/controllers/controladorlog.h>
46
47
 
47
48
#include <vtkImageData.h>
48
49
#include <vtkUnsignedCharArray.h>
526
527
 
527
528
                void SelectImagesImportation::UnCheckAll()
528
529
                {
529
 
                        for (int i = 1; i < m_pButtonsBar->GetToolCount(); i++) {
 
530
                        for (unsigned int i = 1; i < m_pButtonsBar->GetToolCount(); i++) {
530
531
                                //uncheck ubicaciones
531
532
                                m_pButtonsBar->ToggleTool(i, false);
532
533
                        }
592
593
                {
593
594
                        GNC::GCS::IEntorno::MapaUbicaciones& mapa = GNC::Entorno::Instance()->GetUbicaciones();
594
595
                        GNC::GCS::IEntorno::MapaUbicaciones::iterator it = mapa.begin();
595
 
                        for (int i = 1; i < m_pButtonsBar->GetToolCount() && it != mapa.end(); i++, ++it) {
 
596
                        for (unsigned int i = 1; i < m_pButtonsBar->GetToolCount() && it != mapa.end(); i++, ++it) {
596
597
                                if (m_pButtonsBar->GetToolToggled(i)) {
597
598
                                        return &(*it).second;
598
599
                                }
610
611
                                GNC::GCS::ConfigurationController::Instance()->readStringUser("/GinkgoCore/Importacion", "LastLocation", lastLocation);
611
612
                                GNC::GCS::IEntorno::MapaUbicaciones& mapa = GNC::Entorno::Instance()->GetUbicaciones();
612
613
                                GNC::GCS::IEntorno::MapaUbicaciones::iterator it = mapa.begin();
613
 
                                int id = 1;
 
614
                                unsigned int id = 1;
614
615
                                for (; id < m_pButtonsBar->GetToolCount() && it != mapa.end(); id++, ++it) {
615
616
                                        if ((*it).first == lastLocation) {
616
617
                                                break;
704
705
                                                //si existe se busca uno que no exista
705
706
                                                nombreImagenTemporal= wxDirTmp + wxFileName::GetPathSeparator() + fileName.GetName() + wxString::Format(wxT("%d"),rand()) + wxT(".jpg");
706
707
                                        }
707
 
                                        wxCopyFile((*it), nombreImagenTemporal);
 
708
                                        if (!wxCopyFile((*it), nombreImagenTemporal)) {
 
709
                                                LOG_ERROR("SelectImagesImportation", "Error copying images from " << (*it).ToUTF8() << " TO " << nombreImagenTemporal.ToUTF8());
 
710
                                        }
708
711
                                        std::string path(TOPATH(nombreImagenTemporal));
709
712
                                        m_pListaFicheros->push_back(path);                                      
710
713
                                } else {