![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2008 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: ridChooser.h,v $ $Revision: 1.12 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef ridChooser_H_ 00013 #define ridChooser_H_ 00014 00015 #include <rtiMsConfig.h> 00016 #include <rtiChooserCache.h> 00017 #include <qdialog.h> 00018 #include "addRTIInstallToChooser.h" 00019 #include <map> 00020 #include <set> 00021 #include <QtGui/QHBoxLayout> 00022 #include <Qt/qtreewidget.h> 00023 #include <Qt/qlabel.h> 00024 #include <vlutil/vlString.h> 00025 #include <vlutil/vlFilename.h> 00026 #include <vlutil/vlThreadSafe.h> 00027 #include <vlutil/vlThread.h> 00028 #include "waitForAssistantShutdown.h" 00029 00030 class Ui_ridChooserDialog; 00031 00034 class DT_DLL_CHOOSER DtRidChooser : public QDialog 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 00040 typedef std::map<QTreeWidgetItem*, DtRtiChooserCache::DtInstalledRTIInformation > DtWidgetToPathMapType; 00041 00043 DtRidChooser(const MAKRti::DtString& defaultDirectory, 00044 bool useSystem = false ); 00045 00047 virtual ~DtRidChooser(); 00048 00049 virtual void addKnownRTI( DtRtiChooserCache::DtInstalledRTIInformation& newRti, 00050 QTreeWidgetItem* location = 0 ); 00051 00052 virtual void knownRtis( 00053 std::set<DtRtiChooserCache::DtInstalledRTIInformation>& rtis ) const; 00054 00055 virtual void refreshTree() const; 00056 00057 virtual bool isDuplicateRTI( DtRtiChooserCache::DtInstalledRTIInformation info, 00058 QTreeWidgetItem** item = 0 ) const; 00059 00060 virtual void applyIcons(); 00061 00062 virtual MAKRti::DtString findCurrentRtiLibWithSpecifiedRtiDir( 00063 const MAKRti::DtString& specifiedRtiDir, bool isSystem ) const; 00064 00065 virtual MAKRti::DtString findCurrentRtiLib( MAKRti::DtString path ) const; 00066 00067 virtual MAKRti::DtString findCurrentRtiLib() const; 00068 00069 virtual bool validateSelection( DtWidgetToPathMapType::const_iterator found, 00070 bool& shouldExit ) const; 00071 virtual bool findInfoByPath(DtRtiChooserCache::DtInstalledRTIInformation& found, 00072 MAKRti::DtString path ) const; 00073 00074 virtual void removeMakEnvVars(); 00075 00076 virtual bool setSelectedAndAccept( 00077 DtRtiChooserCache::DtInstalledRTIInformation& info, bool silent = false ); 00078 00079 static void processStartupAssistant( void * owner ); 00080 00081 enum DtInstalledRtiColumns 00082 { 00083 Current = 0, 00084 InstalledPath, 00085 RidFile, 00086 RtiVersion, 00087 00088 }; 00089 00090 public slots: 00091 00092 void showEditRTIConfigDialog(); 00093 void showAddRTIConfigDialog(); 00094 void removeRTIConfig(); 00095 void showFullPaths(bool show) const; 00096 void enableDisableSaveButton(); 00097 void userSystemChanged(); 00098 void accept(bool silent = false); 00099 void reject(); 00100 void startTheAssistant(); 00101 void checkAssistantShutdownThread(); 00102 void timedOutDialogAccepted(); 00103 00104 signals: 00105 00106 00107 protected: 00108 00109 Ui_ridChooserDialog* myUiImpl; 00110 00111 00112 std::set< DtRtiChooserCache::DtInstalledRTIInformation> myInstalledRTIInfos; 00113 DtWidgetToPathMapType myTreeToInfoMap; 00114 00115 bool myDialogClosing; 00116 MAKRti::DtString myDefaultDir; 00117 bool myUseSystemPath; 00118 bool myShowingFullPaths; 00119 QTreeWidgetItem* myChosenRTITreeWidget; 00120 QIcon myCurrentRtiIcon; 00121 QIcon myInvalidCurrentRtiIcon; 00122 QDialog * myShutdownDialog; 00123 QLabel * myShutdownLabel; 00124 QHBoxLayout * myCentralLayout; 00125 00126 QDialog * myTimedOutDialog; 00127 QLabel * myTimedOutLabel; 00128 QPushButton * myTimedOutButton; 00129 QVBoxLayout * myTimedOutCentralLayout; 00130 00131 #ifdef _WIN32 00132 MAKRti::DtThreadStart* myAssistantThreadStart; 00133 MAKRti::DtThread* myAssistantThread; 00134 waitForAssistantShutdown * myWaitForAssistantShutdown; 00135 #endif 00136 00137 bool myIsSilent; 00138 bool myHasFinished; 00139 bool myShouldStartAssistant; 00140 bool myShouldAccept; 00141 std::pair< void *, void * > myProcessInfo; 00142 QTimer * myTimer; 00143 }; 00144 00145 #endif 00146