~ubuntu-branches/ubuntu/trusty/ginkgocadx/trusty

« back to all changes in this revision

Viewing changes to src/cadxcore/main/tools/pacsuploadtool.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-07-21 11:58:53 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: package-import@ubuntu.com-20130721115853-44e7n1xujqglu78e
Tags: 3.4.0.928.29+dfsg-1
* New upstream release [July 2013]
  + new B-D: "libjsoncpp-dev".
  + new patch "unbundle-libjsoncpp.patch" to avoid building bundled
    "libjsoncpp-dev".
  + new patch "fix-wx.patch" to avoid FTBFS due to missing
    "-lwx_gtk2u_html-2.8".
* Removed unnecessary versioned Build-Depends.
* Removed obsolete lintian override.
* Reference get-orig-source implementation for orig.tar clean-up and
  DFSG-repackaging.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id: pacsuploadtool.cpp $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-12 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
#include "pacsuploadtool.h"
 
15
#include <wx/dialog.h>
 
16
#include <main/gui/toolsystem/wxmenuitemtool.h>
 
17
 
 
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>
 
27
 
 
28
//----------------------------------------------------------------------
 
29
 
 
30
GNC::GCS::ITool* GNC::PACSUploadTool::NewTool()
 
31
{
 
32
        return new GNC::PACSUploadTool();
 
33
}
 
34
 
 
35
GNC::PACSUploadTool::PACSUploadTool()
 
36
{
 
37
}
 
38
GNC::PACSUploadTool::~PACSUploadTool()
 
39
{
 
40
}
 
41
                
 
42
bool GNC::PACSUploadTool::ExecuteAction()
 
43
{       
 
44
        std::list<long> viewSeries;
 
45
        viewSeries.insert(viewSeries.begin(), ViewContract->GetView()->GetEstudio()->OpenedSeries.begin(), ViewContract->GetView()->GetEstudio()->OpenedSeries.end());
 
46
 
 
47
        GNC::GUI::PACSUploadDialog dlg(ViewContract->GetView()->GetWindow(), viewSeries);
 
48
 
 
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);
 
55
                }
 
56
        }
 
57
 
 
58
        return true;
 
59
}
 
60
 
 
61
void GNC::PACSUploadTool::AppendToolIn(wxEvtHandler* pParent, wxMenu* pMenu)
 
62
{
 
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));
 
66
        }
 
67
}
 
68