15
15
#include <main/entorno.h>
16
16
#include <wx/thread.h>
17
17
#include <eventos/progresocomando.h>
18
#include <main/controllers/controladorcomandos.h>
18
#include <main/controllers/commandcontroller.h>
19
19
#include <main/controllers/controladoreventos.h>
21
21
#define TAMANIO_MAX_PILA 10
65
65
m_petitions.push_back(TPetition(pNotifier, file_pk));
66
66
if (m_pCmd == NULL) {
67
67
m_pCmd = new GADAPI::ThumbnailsCommand(file_pk, pNotifier);
68
GNC::GCS::IControladorComandos::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
68
GNC::GCS::ICommandController::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
70
70
m_pCriticalSection->Leave();
75
75
m_pCriticalSection->Enter();
76
76
if (!m_petitions.empty()) {
77
77
if (m_petitions.front().m_pNotifier == pNotifier && m_pCmd != NULL) {
78
GNC::GCS::IControladorComandos::Instance()->AbortarComandosDeOwner(this);
78
GNC::GCS::ICommandController::Instance()->AbortarComandosDeOwner(this);
80
//to start with next...
80
//to start with next it has to be synchronized with gui so call timer...
101
101
TListPetitions::iterator it = m_petitions.begin();
102
102
if (it != m_petitions.end()) {
103
103
m_pCmd = new GADAPI::ThumbnailsCommand((*it).m_file_pk, (*it).m_pNotifier);
104
GNC::GCS::IControladorComandos::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
104
GNC::GCS::ICommandController::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
107
107
m_pCriticalSection->Leave();
116
116
switch (pEvt->GetTipo()) {
117
case GNC::GCS::Events::EventoProgresoComando::TEP_Iniciado:
119
case GNC::GCS::Events::EventoProgresoComando::TEP_Progreso:
121
case GNC::GCS::Events::EventoProgresoComando::TEP_Finalizado:
123
m_pCriticalSection->Enter();
124
m_petitions.pop_front();
125
TListPetitions::iterator it = m_petitions.begin();
126
if (it != m_petitions.end()) {
127
m_pCmd = new GADAPI::ThumbnailsCommand((*it).m_file_pk, (*it).m_pNotifier);
128
GNC::GCS::IControladorComandos::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
132
m_pCriticalSection->Leave();
135
case GNC::GCS::Events::EventoProgresoComando::TEP_Unknown:
117
case GNC::GCS::Events::EventoProgresoComando::TEP_Iniciado:
119
case GNC::GCS::Events::EventoProgresoComando::TEP_Progreso:
121
case GNC::GCS::Events::EventoProgresoComando::TEP_Finalizado:
123
m_pCriticalSection->Enter();
124
m_petitions.pop_front();
125
TListPetitions::iterator it = m_petitions.begin();
126
if (it != m_petitions.end() && !m_pCmd->EstaAbortado()) {
127
m_pCmd = new GADAPI::ThumbnailsCommand((*it).m_file_pk, (*it).m_pNotifier);
128
GNC::GCS::ICommandController::Instance()->ProcessAsync("Generating thumbnails...", m_pCmd, this);
132
m_pCriticalSection->Leave();
135
case GNC::GCS::Events::EventoProgresoComando::TEP_Unknown: