3
* $Id: pacsuploadtool.cpp $
6
* Copyright 2008-12 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
14
#include "pacsuploadtool.h"
15
#include <wx/dialog.h>
16
#include <main/gui/toolsystem/wxmenuitemtool.h>
18
#include <api/internationalization/internationalization.h>
19
#include <export/contracts/iviewcontract.h>
20
#include <api/ivista.h>
21
#include <api/controllers/icontroladorlog.h>
22
#include <main/gui/pacsupload/pacsuploaddialog.h>
23
#include <main/entorno.h>
24
#include <api/istudycontext.h>
25
#include <commands/sendpacscommand.h>
26
#include <main/controllers/commandcontroller.h>
28
//----------------------------------------------------------------------
30
GNC::GCS::ITool* GNC::PACSUploadTool::NewTool()
32
return new GNC::PACSUploadTool();
35
GNC::PACSUploadTool::PACSUploadTool()
38
GNC::PACSUploadTool::~PACSUploadTool()
42
bool GNC::PACSUploadTool::ExecuteAction()
44
std::list<long> viewSeries;
45
viewSeries.insert(viewSeries.begin(), ViewContract->GetView()->GetEstudio()->OpenedSeries.begin(), ViewContract->GetView()->GetEstudio()->OpenedSeries.end());
47
GNC::GUI::PACSUploadDialog dlg(ViewContract->GetView()->GetWindow(), viewSeries);
49
if (dlg.ShowModal() == wxID_OK) {
50
std::list<long> listOfSeries;
51
listOfSeries = dlg.GetSelectedSeries();
52
if (!listOfSeries.empty()) {
53
GADAPI::SendPACSCommand* pCmd = new GADAPI::SendPACSCommand(dlg.GetSelectedServer(), "", listOfSeries);
54
GNC::GCS::ICommandController::Instance()->ProcessAsync(_Std("Send to PACS..."),pCmd, NULL);
61
void GNC::PACSUploadTool::AppendToolIn(wxEvtHandler* pParent, wxMenu* pMenu)
63
if (AppendsInMenu()) {
64
GNC::GUI::wxDefaultEvtHandlerTool* evtHandler = new GNC::GUI::wxDefaultEvtHandlerTool(pParent, this);
65
pMenu->Append(new GNC::GUI::wxMenuItemTool(pMenu, ID, wxString::FromUTF8(Name.c_str()),Icon, evtHandler));