1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include "XAOPlugin_GUI.h"
22 #include "XAOPlugin_ExportDlg.h"
23 #include "XAOPlugin_ImportDlg.h"
26 #include <SUIT_Desktop.h>
27 #include <SalomeApp_Application.h>
30 #include "GeometryGUI.h"
32 //=======================================================================
33 // function : XAOPlugin_GUI()
34 // purpose : Constructor
35 //=======================================================================
36 XAOPlugin_GUI::XAOPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
40 //=======================================================================
41 // function : ~XAOPlugin_GUI
42 // purpose : Destructor
43 //=======================================================================
44 XAOPlugin_GUI::~XAOPlugin_GUI()
48 //=======================================================================
49 // function : OnGUIEvent()
51 //=======================================================================
52 bool XAOPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
54 switch ( theCommandID ) {
56 return OnGUIEvent("Export_XAO", parent);
58 return OnGUIEvent("Import_XAO", parent);
60 return OnGUIEvent("", parent);
65 //=======================================================================
66 // function : OnGUIEvent()
68 //=======================================================================
69 bool XAOPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
71 SalomeApp_Application* app = getGeometryGUI()->getApp();
72 if (!app) return false;
74 getGeometryGUI()->EmitSignalDeactivateDialog();
76 QDialog* dialog = NULL;
77 if( theCommandID == "Export_XAO" )
78 dialog = new XAOPlugin_ExportDlg(getGeometryGUI(), parent);
79 else if( theCommandID == "Import_XAO" )
80 dialog = new XAOPlugin_ImportDlg(getGeometryGUI(), parent);
82 app->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
90 //=====================================================================================
92 //=====================================================================================
96 __declspec( dllexport )
98 GEOMGUI* GetLibGUI(GeometryGUI* parent)
100 return new XAOPlugin_GUI(parent);