- //Select DB
- long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
- std::string wc("*.txt");
- wxFileDialog* FD = new wxFileDialog( 0,
- _T("Select file"),
- _T(""),
- _T(""),
- crea::std2wx(wc),
- style,
- wxDefaultPosition);
-
- if (FD->ShowModal()==wxID_OK)
- {
- wxBusyCursor busy;
- wxArrayString afile;
- FD->GetPaths(afile);
- //get name of DB (file name)
- std::string file = crea::wx2std(afile[0]);
- size_t pos = file.find_last_of("\\");
- std::string name = file.substr(pos+1);
- std::string directory = file.substr(0,pos);
- pos = name.find_last_of(".");
- name = name.substr(0,pos);
- //get directory to store DB
- directory += "\\" + name + ".sqlite3";
- //create createDB
- mGimmick->createDB(name, file,directory);
- //create TreeHandler
- mGimmick->addDB(name, directory);
- //create TreeView
- CreateSingleTreeView(name);
- }
+ WxDescriptorPanel * DescriptorPan = new WxDescriptorPanel(this);
+ DescriptorPan->Layout();
+ if ( DescriptorPan->ShowModal() == ID_DSCP_APPLY)
+ {
+ wxBusyCursor busy;
+ std::string file(DescriptorPan->GetDescriptor());
+ if (!file.empty())
+ {
+ size_t pos = file.find_last_of("\\");
+ std::string name = file.substr(pos+1);
+ std::string directory = file.substr(0,pos);
+ pos = name.find_last_of(".");
+ name = name.substr(0,pos);
+ //get directory to store DB
+ directory += "\\" + name + ".sqlite3";
+ //create createDB
+ mGimmick->createDB(name, file,directory);
+ //create TreeHandler
+ mGimmick->addDB(name, directory);
+ //create TreeView
+ CreateSingleTreeView(name);
+ }
+ }