1 // Copyright (C) 2014 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 "XTPluginGUI.h"
22 #include "XTPlugin_ImportDlg.h"
25 #include <SUIT_Desktop.h>
26 #include <SUIT_MessageBox.h>
27 #include <SalomeApp_Application.h>
28 #include <SALOME_ListIteratorOfListIO.hxx>
29 #include <LightApp_SelectionMgr.h>
32 #include <GeometryGUI.h>
34 //=======================================================================
35 // function : XTPluginGUI()
36 // purpose : Constructor
37 //=======================================================================
38 XTPluginGUI::XTPluginGUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
42 //=======================================================================
43 // function : ~XTPluginGUI
44 // purpose : Destructor
45 //=======================================================================
46 XTPluginGUI::~XTPluginGUI()
50 //=======================================================================
51 // function : OnGUIEvent()
53 //=======================================================================
54 bool XTPluginGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
56 switch ( theCommandID ) {
58 return OnGUIEvent("Import_XT", parent);
60 return OnGUIEvent("", parent);
65 //=======================================================================
66 // function : OnGUIEvent()
68 //=======================================================================
69 bool XTPluginGUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
71 SalomeApp_Application* app = getGeometryGUI()->getApp();
72 if (!app) return false;
74 getGeometryGUI()->EmitSignalDeactivateDialog();
76 SUIT_FileDlg* dialog = NULL;
77 if (theCommandID == "Import_XT") {
78 dialog = new XTPlugin_ImportDlg( parent );
81 if( dialog->exec() == QDialog::Accepted )
85 app->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
91 //=====================================================================================
93 //=====================================================================================
97 __declspec( dllexport )
99 GEOMGUI* GetLibGUI( GeometryGUI* parent )
101 return new XTPluginGUI( parent );