From acdd5716bd55dc08b5bf7b03c956f732f727c9b3 Mon Sep 17 00:00:00 2001
From: YuSanka <yusanka@gmail.com>
Date: Thu, 17 Sep 2020 15:25:05 +0200
Subject: [PATCH] SplashScreen: Fixed message text UnsavedChangesDialog:
 Disabled "Move changes to selected preset" button, when printer technology is
 changed PresetComboBox: Fixed color of the filament, if it is modified

---
 src/slic3r/GUI/GUI_App.cpp              | 2 +-
 src/slic3r/GUI/PresetComboBoxes.cpp     | 3 ++-
 src/slic3r/GUI/UnsavedChangesDialog.cpp | 9 ++++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp
index 40c8f96e5..7b6b38b5d 100644
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -183,7 +183,7 @@ public:
         copyright_string += //"Slic3r" + _L("is licensed under the") + _L("GNU Affero General Public License, version 3") + "\n\n" + 
                             _L("PrusaSlicer is based on Slic3r by Alessandro Ranellucci and the RepRap community.") + "\n\n" +
                             _L("Contributions by Henrik Brix Andersen, Nicolas Dandrimont, Mark Hindess, Petr Ledvina, Joseph Lenox, Y. Sapir, Mike Sheldrake, Vojtech Bubnik and numerous others.") + "\n\n" +
-                            _L("Splash screen could be desabled from the \"Preferences\"");
+                            _L("Splash screen can be disabled from the \"Preferences\"");
 
         word_wrap_string(copyright_string, banner_width, screen_scale);
 
diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp
index 8bc939387..8c0fefc76 100644
--- a/src/slic3r/GUI/PresetComboBoxes.cpp
+++ b/src/slic3r/GUI/PresetComboBoxes.cpp
@@ -741,7 +741,8 @@ void PlaterPresetComboBox::update()
         if (m_type == Preset::TYPE_FILAMENT)
         {
             // Assign an extruder color to the selected item if the extruder color is defined.
-            filament_rgb = preset.config.opt_string("filament_colour", 0);
+            filament_rgb = is_selected ? selected_filament_preset->config.opt_string("filament_colour", 0) : 
+                                         preset.config.opt_string("filament_colour", 0);
             extruder_rgb = (is_selected && !extruder_color.empty()) ? extruder_color : filament_rgb;
             single_bar = filament_rgb == extruder_rgb;
 
diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp
index 5a0d23a20..e7dec9fa8 100644
--- a/src/slic3r/GUI/UnsavedChangesDialog.cpp
+++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp
@@ -590,8 +590,11 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_
 
     int btn_idx = 0;
     add_btn(&m_save_btn, m_save_btn_id, "save", Action::Save, btn_idx++);
-    if (dependent_presets && (type != dependent_presets->type() ? true :
-        dependent_presets->get_edited_preset().printer_technology() == dependent_presets->find_preset(new_selected_preset)->printer_technology()))
+
+    const PresetCollection& printers = wxGetApp().preset_bundle->printers;
+    if (dependent_presets && (type == dependent_presets->type() ? 
+        dependent_presets->get_edited_preset().printer_technology() == dependent_presets->find_preset(new_selected_preset)->printer_technology() : 
+        printers.get_edited_preset().printer_technology() == printers.find_preset(new_selected_preset)->printer_technology() ) )
         add_btn(&m_move_btn, m_move_btn_id, "paste_menu", Action::Move, btn_idx++);
     add_btn(&m_continue_btn, m_continue_btn_id, "cross", Action::Continue, btn_idx, false);
 
@@ -935,7 +938,7 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
 
         }
 
-        for (const std::string& opt_key : /*presets->current_dirty_options()*/dirty_options) {
+        for (const std::string& opt_key : dirty_options) {
             const Search::Option& option = searcher.get_option(opt_key);
 
             ItemData item_data = { opt_key, option.label_local, get_string_value(opt_key, old_config), get_string_value(opt_key, new_config), type };