7 #include "uiIO/action/SFolderSelector.hpp" 9 #include <fwCom/Signal.hxx> 11 #include <fwData/location/Folder.hpp> 13 #include <fwGui/dialog/LocationDialog.hpp> 15 #include <fwServices/macros.hpp> 24 const ::fwCom::Signals::SignalKeyType SFolderSelector::s_FOLDER_SELECTED_SIG =
"folderSelected";
28 SFolderSelector::SFolderSelector( ) noexcept
30 newSignal< FolderSelectedSignalType >( s_FOLDER_SELECTED_SIG );
35 SFolderSelector::~SFolderSelector() noexcept
44 m_dialogTitle = config.get(
"dialogTitle",
"Select a folder");
57 static ::boost::filesystem::path _sDefaultPath(
"");
61 dialogFile.
setOption(::fwGui::dialog::ILocationDialog::READ);
62 dialogFile.
setType(::fwGui::dialog::ILocationDialog::FOLDER);
64 ::fwData::location::Folder::sptr result;
65 result = ::fwData::location::Folder::dynamicCast( dialogFile.
show() );
68 auto sig = this->signal<FolderSelectedSignalType>(s_FOLDER_SELECTED_SIG);
69 sig->asyncEmit(result->getFolder());
UIIO_API void starting() override
Do nothing.
UIIO_API void updating() override
Show the dialog and send the signal with the chosen directory.
Raise a pop-up dialog to select a directory, then send it via a signal.
virtual FWGUI_API void setDefaultLocation(::fwData::location::ILocation::sptr loc) override
Set the initial location for the dialog.
FWGUI_API::fwGui::dialog::ILocationDialog & setOption(::fwGui::dialog::ILocationDialog::Options option) override
allow to set option to the file dialog mode=READ/WRITE, check=FILE_MUST_EXIST
FWGUI_API::fwData::location::ILocation::sptr show() override
Display the dialog.
Defines the service interface managing the menu items.
Base class for each data object.
UIIO_API void configuring() override
Do nothing.
FWGUI_API void setTitle(const std::string &title) override
Set the title for the dialog.
Defines the generic file/folder selector dialog for IHM.
UIIO_API void stopping() override
Do nothing.
FWGUI_API void setType(::fwGui::dialog::ILocationDialog::Types type) override
Set the type of location for the dialog (SINGLE_FILE, FORLDER, MULTI_FILES)
The namespace uiIO contains a simple service to manipulate IO with IHM..
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.