mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-26 16:22:00 +08:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_splitted_vbuffer
This commit is contained in:
commit
17c9358b0b
@ -1359,10 +1359,6 @@ void Control::OnMotion(wxMouseEvent& event)
|
|||||||
m_focus = fiLowerThumb;
|
m_focus = fiLowerThumb;
|
||||||
else if (is_point_in_rect(pos, m_rect_higher_thumb))
|
else if (is_point_in_rect(pos, m_rect_higher_thumb))
|
||||||
m_focus = fiHigherThumb;
|
m_focus = fiHigherThumb;
|
||||||
else if (is_point_in_rect(pos, m_rect_lower_thumb_text))
|
|
||||||
m_focus = fiLowerThumbText;
|
|
||||||
else if (is_point_in_rect(pos, m_rect_higher_thumb_text))
|
|
||||||
m_focus = fiHigherThumbText;
|
|
||||||
else {
|
else {
|
||||||
m_focus = fiTick;
|
m_focus = fiTick;
|
||||||
tick = get_tick_near_point(pos);
|
tick = get_tick_near_point(pos);
|
||||||
|
@ -43,8 +43,6 @@ enum FocusedItem {
|
|||||||
fiActionIcon,
|
fiActionIcon,
|
||||||
fiLowerThumb,
|
fiLowerThumb,
|
||||||
fiHigherThumb,
|
fiHigherThumb,
|
||||||
fiLowerThumbText,
|
|
||||||
fiHigherThumbText,
|
|
||||||
fiTick
|
fiTick
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -373,8 +371,6 @@ private:
|
|||||||
|
|
||||||
wxRect m_rect_lower_thumb;
|
wxRect m_rect_lower_thumb;
|
||||||
wxRect m_rect_higher_thumb;
|
wxRect m_rect_higher_thumb;
|
||||||
mutable wxRect m_rect_lower_thumb_text;
|
|
||||||
mutable wxRect m_rect_higher_thumb_text;
|
|
||||||
wxRect m_rect_tick_action;
|
wxRect m_rect_tick_action;
|
||||||
wxRect m_rect_one_layer_icon;
|
wxRect m_rect_one_layer_icon;
|
||||||
wxRect m_rect_revert_icon;
|
wxRect m_rect_revert_icon;
|
||||||
|
@ -1153,7 +1153,7 @@ void NotificationManager::remove_slicing_warnings_of_released_objects(const std:
|
|||||||
void NotificationManager::push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
|
void NotificationManager::push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
|
||||||
{
|
{
|
||||||
close_notification_of_type(NotificationType::ExportFinished);
|
close_notification_of_type(NotificationType::ExportFinished);
|
||||||
NotificationData data{ NotificationType::ExportFinished, NotificationLevel::RegularNotification, 0, _u8L("Exporting finished.") + "\n" + path };
|
NotificationData data{ NotificationType::ExportFinished, NotificationLevel::RegularNotification, on_removable ? 0 : 20, _u8L("Exporting finished.") + "\n" + path };
|
||||||
push_notification_data(std::make_unique<NotificationManager::ExportFinishedNotification>(data, m_id_provider, m_evt_handler, on_removable, path, dir_path), 0);
|
push_notification_data(std::make_unique<NotificationManager::ExportFinishedNotification>(data, m_id_provider, m_evt_handler, on_removable, path, dir_path), 0);
|
||||||
}
|
}
|
||||||
void NotificationManager::push_progress_bar_notification(const std::string& text, float percentage)
|
void NotificationManager::push_progress_bar_notification(const std::string& text, float percentage)
|
||||||
|
@ -54,18 +54,28 @@ static const char *INDEX_FILENAME = "index.idx";
|
|||||||
static const char *TMP_EXTENSION = ".download";
|
static const char *TMP_EXTENSION = ".download";
|
||||||
|
|
||||||
|
|
||||||
void copy_file_fix(const fs::path &source, const fs::path &target)
|
//void copy_file_fix(const fs::path &source, const fs::path &target)
|
||||||
|
void copy_file_fix(const fs::path& source, const fs::path& target,const std::string& caller_function_name)
|
||||||
{
|
{
|
||||||
static const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read; // aka 644
|
static const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read; // aka 644
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << format("PresetUpdater: Copying %1% -> %2%", source, target);
|
BOOST_LOG_TRIVIAL(debug) << format("PresetUpdater: Copying %1% -> %2%", source, target);
|
||||||
|
|
||||||
// Make sure the file has correct permission both before and after we copy over it
|
// Make sure the file has correct permission both before and after we copy over it
|
||||||
|
boost::system::error_code ec;
|
||||||
if (fs::exists(target)) {
|
if (fs::exists(target)) {
|
||||||
fs::permissions(target, perms);
|
fs::permissions(target, perms, ec);
|
||||||
|
if(ec)
|
||||||
|
throw Slic3r::CriticalException((boost::format(_utf8(L("Copying of file %1% to %2% failed. Permissions fail at target file before copying.\nError message : %3%\n This error happend during %4% phase."))) % source % target % ec.message() % caller_function_name).str());
|
||||||
}
|
}
|
||||||
fs::copy_file(source, target, fs::copy_option::overwrite_if_exists);
|
ec.clear();
|
||||||
fs::permissions(target, perms);
|
fs::copy_file(source, target, fs::copy_option::overwrite_if_exists, ec);
|
||||||
|
if (ec)
|
||||||
|
throw Slic3r::CriticalException((boost::format(_utf8(L("Copying of file %1% to %2% failed.\nError message : %3%\n Copying was triggered by function: %4%"))) % source % target % ec.message() % caller_function_name).str());
|
||||||
|
ec.clear();
|
||||||
|
fs::permissions(target, perms, ec);
|
||||||
|
if (ec)
|
||||||
|
throw Slic3r::CriticalException((boost::format(_utf8(L("Copying of file %1% to %2% failed. Permissions fail at target file after copying.\nError message : %3%\n Copying was triggered by function: %4%"))) % source % target % ec.message() % caller_function_name).str());
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Update
|
struct Update
|
||||||
@ -91,7 +101,9 @@ struct Update
|
|||||||
|
|
||||||
void install() const
|
void install() const
|
||||||
{
|
{
|
||||||
copy_file_fix(source, target);
|
std::string error_message;
|
||||||
|
copy_file_fix(source, target, _utf8(L("install")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator<<(std::ostream& os, const Update &self)
|
friend std::ostream& operator<<(std::ostream& os, const Update &self)
|
||||||
@ -382,7 +394,7 @@ void PresetUpdater::priv::check_install_indices() const
|
|||||||
|
|
||||||
if (! fs::exists(path_in_cache)) {
|
if (! fs::exists(path_in_cache)) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "Install index from resources: " << path.filename();
|
BOOST_LOG_TRIVIAL(info) << "Install index from resources: " << path.filename();
|
||||||
copy_file_fix(path, path_in_cache);
|
copy_file_fix(path, path_in_cache, _utf8(L("checking install indices")));
|
||||||
} else {
|
} else {
|
||||||
Index idx_rsrc, idx_cache;
|
Index idx_rsrc, idx_cache;
|
||||||
idx_rsrc.load(path);
|
idx_rsrc.load(path);
|
||||||
@ -390,7 +402,7 @@ void PresetUpdater::priv::check_install_indices() const
|
|||||||
|
|
||||||
if (idx_cache.version() < idx_rsrc.version()) {
|
if (idx_cache.version() < idx_rsrc.version()) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "Update index from resources: " << path.filename();
|
BOOST_LOG_TRIVIAL(info) << "Update index from resources: " << path.filename();
|
||||||
copy_file_fix(path, path_in_cache);
|
copy_file_fix(path, path_in_cache, _utf8(L("checking install indices")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -570,7 +582,7 @@ Updates PresetUpdater::priv::get_config_updates(const Semver &old_slic3r_version
|
|||||||
updates.updates.emplace_back(std::move(new_update));
|
updates.updates.emplace_back(std::move(new_update));
|
||||||
// 'Install' the index in the vendor directory. This is used to memoize
|
// 'Install' the index in the vendor directory. This is used to memoize
|
||||||
// offered updates and to not offer the same update again if it was cancelled by the user.
|
// offered updates and to not offer the same update again if it was cancelled by the user.
|
||||||
copy_file_fix(bundle_path_idx_to_install, bundle_path_idx);
|
copy_file_fix(bundle_path_idx_to_install, bundle_path_idx, _utf8(L("getting config updates")));
|
||||||
} else {
|
} else {
|
||||||
BOOST_LOG_TRIVIAL(warning) << format("Index for vendor %1% indicates update (%2%) but the new bundle was found neither in cache nor resources",
|
BOOST_LOG_TRIVIAL(warning) << format("Index for vendor %1% indicates update (%2%) but the new bundle was found neither in cache nor resources",
|
||||||
idx.vendor(),
|
idx.vendor(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user