ENH: Limit GetPrintTask API in 2Second
JIRA: none Change-Id: I285c21bb55cc6783741ec9193cc28396b5586753
This commit is contained in:
parent
e55e061a28
commit
addb29a7d2
|
@ -4394,7 +4394,7 @@ std::string GUI_App::handle_web_request(std::string cmd)
|
|||
else if (command_str.compare("homepage_printhistory_get")==0)
|
||||
{
|
||||
CallAfter([this] {
|
||||
if (mainframe && mainframe->m_webview) { mainframe->m_webview->ShowUserPrintTask(true); }
|
||||
if (mainframe && mainframe->m_webview) { mainframe->m_webview->ShowUserPrintTask(true,true); }
|
||||
});
|
||||
}
|
||||
else if (command_str.compare("homepage_leftmenu_change_width") == 0) {
|
||||
|
|
|
@ -818,7 +818,7 @@ wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *pa
|
|||
if (param == "show_print_history") {
|
||||
auto show_history = app_config->get_bool("show_print_history");
|
||||
if (show_history == true) {
|
||||
if (wxGetApp().mainframe && wxGetApp().mainframe->m_webview) { wxGetApp().mainframe->m_webview->ShowUserPrintTask(true); }
|
||||
if (wxGetApp().mainframe && wxGetApp().mainframe->m_webview) { wxGetApp().mainframe->m_webview->ShowUserPrintTask(true,true); }
|
||||
} else {
|
||||
if (wxGetApp().mainframe && wxGetApp().mainframe->m_webview) { wxGetApp().mainframe->m_webview->ShowUserPrintTask(false); }
|
||||
}
|
||||
|
|
|
@ -1134,7 +1134,7 @@ int WebViewPanel::get_model_mall_detail_url(std::string *url, std::string id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void WebViewPanel::ShowUserPrintTask(bool bShow)
|
||||
void WebViewPanel::ShowUserPrintTask(bool bShow, bool bForce)
|
||||
{
|
||||
std::string phShow = wxGetApp().app_config->get("app", "show_print_history");
|
||||
if (bShow && phShow == "false") bShow = false;
|
||||
|
@ -1148,7 +1148,7 @@ void WebViewPanel::ShowUserPrintTask(bool bShow)
|
|||
auto now = std::chrono::system_clock::now();
|
||||
long long TmpMs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
|
||||
long long nInterval = TmpMs - PrintTaskMs;
|
||||
if (nInterval < 2000) return;
|
||||
if (!bForce && nInterval < 1000 * 60 * 10) return;
|
||||
PrintTaskMs = TmpMs;
|
||||
|
||||
BBL::TaskQueryParams task_query_params;
|
||||
|
|
|
@ -154,7 +154,7 @@ public:
|
|||
std::string m_TaskInfo;
|
||||
bool m_printhistoryfirst; // print history first load
|
||||
wxString m_print_history_LastUrl;
|
||||
void ShowUserPrintTask(bool bShow);
|
||||
void ShowUserPrintTask(bool bShow, bool bForce=false);
|
||||
|
||||
//
|
||||
bool GetJumpUrl(bool login, wxString ticket, wxString targeturl, wxString &finalurl);
|
||||
|
|
Loading…
Reference in New Issue