790
790
//--------------------------------------------------------------------------------------------------
792
void *WBContext::do_request_password(const std::string &title, const std::string &service, std::string &account,
793
bool force_asking, std::string* ret_password)
793
* Actually triggers the password find or user querying process for the given service. The given account
794
* can be empty if the connection has no user set so we must be able to return it like the password.
795
* Both, account as well as password must be allocated by the caller and passed on via references as
796
* this function is called via the dispatcher.
797
* For the same reason is the return value passed back as pointer, even though it's a bool.
799
void* WBContext::do_request_password(const std::string &title, const std::string &service,
800
bool force_asking, std::string *account, std::string *password)
795
802
bool ret = false;
797
// ret_password must be passed as a pointer, because passing by reference
798
// will not work through the dispatcher
802
ret = mforms::Utilities::find_or_ask_for_password(title, service, account, force_asking, *ret_password);
806
ret = mforms::Utilities::credentials_for_service(title, service, *account, force_asking, *password);
804
808
catch (const std::exception &e)
851
855
std::string password_tmp;
852
856
std::string user_tmp = conn->parameterValues().get_string("userName");
854
ret = execute_in_main_thread<bool>("request connection password",
855
boost::bind(&WBContext::do_request_password, this,
856
_("Connect to MySQL Server"),
857
conn->hostIdentifier(),
857
bool need_user_name = user_tmp.empty();
862
858
void *ret = mforms::Utilities::perform_from_main_thread(
863
859
boost::bind(&WBContext::do_request_password, this,
864
860
_("Connect to MySQL Server"),
865
861
conn->hostIdentifier(),
865
if (need_user_name && !user_tmp.empty())
866
conn->parameterValues().gset("userName", user_tmp);
870
868
return password_tmp;
871
869
throw grt::user_cancelled("Canceled by user");
1677
1675
set_default(options, "DbSqlEditor:ReadTimeOut", 600); // in seconds
1678
1676
set_default(options, "DbSqlEditor:MaxQuerySizeToHistory", 65536);
1679
1677
set_default(options, "DbSqlEditor:ContinueOnError", 0); // continue running sql script bypassing failed statements
1680
set_default(options, "DbSqlEditor:AutocommitMode", 1); // when enabled, each statement will be commited immediately
1678
set_default(options, "DbSqlEditor:AutocommitMode", 1); // when enabled, each statement will be committed immediately
1681
1679
set_default(options, "DbSqlEditor:IsDataChangesCommitWizardEnabled", 1);
1682
1680
set_default(options, "DbSqlEditor:ShowSchemaTreeSchemaContents", 1);
1683
1681
set_default(options, "DbSqlEditor:SafeUpdates", 1);