1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#ifndef _FETCH_SCHEMA_CONTENTS_PAGE_H_
#define _FETCH_SCHEMA_CONTENTS_PAGE_H_
#include "grtui/wizard_progress_page.h"
class FetchSchemaContentsProgressPage : public WizardProgressPage
{
public:
FetchSchemaContentsProgressPage(WizardForm *form, const char *name= "fetchSchema")
: WizardProgressPage(form, name, true)
{
set_title(_("Retrieve and Reverse Engineer Schema Objects"));
set_short_title(_("Retrieve Objects"));
add_async_task(_("Retrieve Objects from Selected Schemata"),
boost::bind(&FetchSchemaContentsProgressPage::perform_fetch, this),
_("Retrieving object lists from selected schemata..."));
add_task(_("Check Results"),
boost::bind(&FetchSchemaContentsProgressPage::perform_check, this),
_("Checking Retrieved data..."));
end_adding_tasks(_("Retrieval Completed Successfully"));
set_status_text("");
}
bool perform_fetch()
{
execute_grt_task(boost::bind(&FetchSchemaContentsProgressPage::do_fetch, this, _1),
false);
return true;
}
bool perform_check()
{
_finished= true;
return true;
}
grt::ValueRef do_fetch(grt::GRT *grt)
{
grt::StringListRef selection(grt::StringListRef::cast_from(values().get("selectedSchemata")));
std::vector<std::string> names;
for (grt::StringListRef::const_iterator iter= selection.begin();
iter != selection.end(); ++iter)
names.push_back(*iter);
// tell the backend about the selection
_dbplugin->schemata_selection(names, true);
_dbplugin->load_db_objects(Db_plugin::dbotTable);
_dbplugin->load_db_objects(Db_plugin::dbotView);
if (!values().get_int("SkipRoutines"))
_dbplugin->load_db_objects(Db_plugin::dbotRoutine);
if (!values().get_int("SkipTriggers"))
_dbplugin->load_db_objects(Db_plugin::dbotTrigger);
return grt::ValueRef();
}
virtual void enter(bool advancing)
{
if (advancing)
{
_finished= false;
reset_tasks();
}
WizardProgressPage::enter(advancing);
}
virtual bool allow_next()
{
return _finished;
}
void set_db_plugin(Db_plugin *dbplugin)
{
_dbplugin= dbplugin;
}
private:
Db_plugin *_dbplugin;
bool _finished;
};
#endif /* _FETCH_SCHEMA_CONTENTS_PAGE_H_ */
|