1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0029748: Samples - Inspector tool - use recently opened files in TInspectorEXE

- recently files using in open file dialog
- correction of TInspectorEXE title to show opened file path by Start
This commit is contained in:
nds
2018-05-08 20:21:08 +03:00
committed by abv
parent d0fbc7e5dd
commit 042e09aa36
14 changed files with 158 additions and 100 deletions

View File

@@ -17,6 +17,7 @@
#define TInspector_Communicator_H
#include <inspector/TInspector_Window.hxx>
#include <inspector/TInspectorAPI_PluginParameters.hxx>
#include <NCollection_List.hxx>
#include <Standard.hxx>
@@ -107,8 +108,10 @@ public:
//! \param theStream stream for output
void Dump (Standard_OStream& theStream) const { return myWindow->Dump (theStream); }
private:
//! Returns plugins parameters container
Handle(TInspectorAPI_PluginParameters) const GetPluginParameters() { return myWindow->GetPluginParameters(); }
private:
TInspector_Window* myWindow; //!< current window
};

View File

@@ -63,7 +63,7 @@ public:
{ myPreferences->SetPreferences (thePluginName, theItem); }
//! Store plugin preferences into a preferences file
void StorePreferences() { myPreferences->StorePreferences(); }
virtual void StorePreferences() Standard_OVERRIDE { myPreferences->StorePreferences(); }
//! Remove plugin preferences file
void RemovePreferences() { myPreferences->RemovePreferences(); }

View File

@@ -31,7 +31,6 @@
void TInspector_Preferences::GetPreferences (const TCollection_AsciiString& thePluginName,
TInspectorAPI_PreferencesDataMap& theItem)
{
theItem.Clear();
if (!myIsLoadedPreferences)
{
loadPreferences();

View File

@@ -366,8 +366,7 @@ bool TInspector_Window::LoadPlugin (const TCollection_AsciiString& thePluginName
// =======================================================================
void TInspector_Window::GetPreferences (TInspectorAPI_PreferencesDataMap& theItem)
{
theItem.Clear();
theItem.Bind ("geometry", TreeModel_Tools::ToString (myMainWindow->saveGeometry()).toStdString().c_str());
theItem.Bind ("geometry", TreeModel_Tools::ToString (myMainWindow->saveGeometry()).toStdString().c_str());
}
// =======================================================================
@@ -414,6 +413,7 @@ void TInspector_Window::OnStorePreferences()
if (!anInfo.myCommunicator)
continue;
aParameters->GetPreferences (anInfo.myName, aPreferences);
anInfo.myCommunicator->GetPreferences (aPreferences);
myParameters->SetPreferences (anInfo.myName, aPreferences);
}

View File

@@ -129,6 +129,10 @@ public:
//! \return path
TCollection_AsciiString GetTemporaryDirectory() const { return myParameters->GetTemporaryDirectory(); }
//! Returns plugins parameters container
//! \return instance of parameters container
Handle(TInspectorAPI_PluginParameters) GetPluginParameters() const { return myParameters; }
//! Returns plugin preferences: dock widgets state, tree view columns.
//! \param theItem container of preference elements
Standard_EXPORT void GetPreferences (TInspectorAPI_PreferencesDataMap& theItem);