void game_cache_options::purge_cache_callback() { if(purge_cache()) { show_message( _("Cache Purged"), _("The game data cache has been purged.")); } else { show_error_message(_("The game data cache could not be purged.")); } update_cache_size_display(); }
void game_cache_options::clean_cache_callback() { if(clean_cache()) { show_message( _("Cache Cleaned"), _("The game data cache has been cleaned.")); } else { show_error_message(_("The game data cache could not be completely cleaned.")); } update_cache_size_display(); }
void tgame_cache_options::pre_show(twindow& window) { clean_button_ = &find_widget<tbutton>(&window, "clean", false); purge_button_ = &find_widget<tbutton>(&window, "purge", false); size_label_ = &find_widget<tlabel>(&window, "size", false); update_cache_size_display(); ttext_& path_box = find_widget<ttext_>(&window, "path", false); path_box.set_value(cache_path_); path_box.set_active(false); tbutton& copy = find_widget<tbutton>(&window, "copy", false); connect_signal_mouse_left_click(copy, boost::bind(&tgame_cache_options::copy_to_clipboard_callback, this)); if (!desktop::clipboard::available()) { copy.set_active(false); copy.set_tooltip(_("Clipboard support not found, contact your packager")); } tbutton& browse = find_widget<tbutton>(&window, "browse", false); connect_signal_mouse_left_click(browse, boost::bind(&tgame_cache_options::browse_cache_callback, this)); connect_signal_mouse_left_click(*clean_button_, boost::bind(&tgame_cache_options::clean_cache_callback, this, boost::ref(window.video()))); connect_signal_mouse_left_click(*purge_button_, boost::bind(&tgame_cache_options::purge_cache_callback, this, boost::ref(window.video()))); }