Browse Source

Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer

Vojtech Bubnik 4 years ago
parent
commit
9f6bf5a835

+ 0 - 4
src/slic3r/GUI/DoubleSlider.cpp

@@ -1359,10 +1359,6 @@ void Control::OnMotion(wxMouseEvent& event)
             m_focus = fiLowerThumb;
         else if (is_point_in_rect(pos, m_rect_higher_thumb))
             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 {
             m_focus = fiTick;
             tick = get_tick_near_point(pos);

+ 0 - 4
src/slic3r/GUI/DoubleSlider.hpp

@@ -43,8 +43,6 @@ enum FocusedItem {
     fiActionIcon,
     fiLowerThumb,
     fiHigherThumb,
-    fiLowerThumbText,
-    fiHigherThumbText,
     fiTick
 };
 
@@ -373,8 +371,6 @@ private:
 
     wxRect      m_rect_lower_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_one_layer_icon;
     wxRect      m_rect_revert_icon;

+ 1 - 1
src/slic3r/GUI/NotificationManager.cpp

@@ -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)
 {
 	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);
 }
 void  NotificationManager::push_progress_bar_notification(const std::string& text, float percentage)

+ 20 - 8
src/slic3r/Utils/PresetUpdater.cpp

@@ -54,18 +54,28 @@ static const char *INDEX_FILENAME = "index.idx";
 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
 
 	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
+	boost::system::error_code ec;
 	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);
-	fs::permissions(target, perms);
+	ec.clear();
+	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
@@ -91,7 +101,9 @@ struct Update
 
 	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)
@@ -382,7 +394,7 @@ void PresetUpdater::priv::check_install_indices() const
 
 			if (! fs::exists(path_in_cache)) {
 				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 {
 				Index idx_rsrc, idx_cache;
 				idx_rsrc.load(path);
@@ -390,7 +402,7 @@ void PresetUpdater::priv::check_install_indices() const
 
 				if (idx_cache.version() < idx_rsrc.version()) {
 					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));
 			// '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.
-			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 {
 			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(),