Commit 7f687c54 authored by Thibault Soucarre's avatar Thibault Soucarre

correct reload buttons in links and events tabs

parent 9877783e
......@@ -1344,3 +1344,11 @@ void Core::change_link_visible(std::string link, bool visible){
void Core::reload_states(){
_render_opengl->reload_states();
}
void Core::reload_links(){
_render_opengl->reload_links();
}
void Core::reload_events(){
_render_opengl->reload_events();
}
......@@ -524,6 +524,10 @@ public:
*/
void reload_states();
void reload_links();
void reload_events();
//Qt signals fo the Parsing Thread
signals:
......
......@@ -71,7 +71,7 @@
using namespace std;
Settings_window::Settings_window(Core *c, QWidget *parent) : QWidget(parent), _c(c), _reload(false) {
Settings_window::Settings_window(Core *c, QWidget *parent) : QWidget(parent), _c(c), _reload_states(false), _reload_links(false), _reload_events(false) {
setupUi(this);
plugin_load_dirs_name();
......@@ -505,13 +505,13 @@ void Settings_window::on_reload_states_btn_clicked(){
row, (*it).first.c_str(), (*it).second, true);
}
//_c->reload_states();
_reload = true;
_reload_states = true;
_states_changes.clear();
_states_visible_changes.clear();
_events_color_changes.clear();
_events_visible_changes.clear();
_links_color_changes.clear();
_links_visible_changes.clear();
//_events_color_changes.clear();
//_events_visible_changes.clear();
//_links_color_changes.clear();
//_links_visible_changes.clear();
}
void Settings_window::on_add_state_btn_clicked() {
......@@ -602,6 +602,7 @@ void Settings_window::on_reload_link_types_palette_btn_clicked() {
add_table_line(link_types_table, SLOT(link_types_color_changed(const QColor&)), SLOT(link_types_visible_changed(int)),
row, (*it).first.to_string(), color, true);
}
_reload_links = true;
}
......@@ -633,6 +634,7 @@ void Settings_window::on_reload_event_types_palette_btn_clicked() {
add_table_line(event_types_table, SLOT(event_types_color_changed(const QColor&)), SLOT(event_types_visible_changed(int)),
row, (*it).first.to_string(), color, true);
}
_reload_events = true;
}
void Settings_window::on_copy_link_types_palette_btn_clicked() {
......@@ -749,9 +751,15 @@ void Settings_window::on_apply_clicked() {
}
// emit changes. For now it is a global emit. Maybe only emits signals for what has changed using booleans?
if(_reload)
if(_reload_states)
_c->reload_states();
_reload = false;
_reload_states = false;
if(_reload_links)
_c->reload_links();
_reload_links = false;
if(_reload_events)
_c->reload_events();
_reload_events = false;
std::map<std::string, Color>::iterator it = _states_changes.begin();
std::map<std::string, bool>::iterator it2 = _states_visible_changes.begin();
Color color;
......@@ -828,7 +836,9 @@ void Settings_window::on_cancel_clicked() {
_links_visible_changes.clear();
_color_cancel.clear();
_visible_cancel.clear();
_reload = false;
_reload_states = false;
_reload_links = false;
_reload_events = false;
}
void Settings_window::on_ok_clicked(){
if( _changed )
......
......@@ -77,7 +77,9 @@ private:
std::map<std::string, bool> _events_visible_changes;
std::map<std::string, Color> _links_color_changes;
std::map<std::string, bool> _links_visible_changes;
bool _reload;
bool _reload_states;
bool _reload_links;
bool _reload_events;
//used to check if leaving the tab needs an apply first when OK button is pressed
bool _changed;
......
......@@ -1165,8 +1165,7 @@ std::map<EntityValue*, Shader*>::iterator it;
void Render_alternate::reload_states(){
std::map<EntityValue*, Shader*>::iterator it;
it = _states_shaders.begin();
std::map<EntityValue*, Shader*>::iterator it = _states_shaders.begin();
while(it != _states_shaders.end()){
if(it->first){
it->first->reload_file_color();
......@@ -1181,8 +1180,10 @@ void Render_alternate::reload_states(){
}
it++;
}
it = _events_shaders.begin();
while(it != _events_shaders.end()){
}
void Render_alternate::reload_links(){
std::map<EntityValue*, Shader*>::iterator it = _arrows_shaders.begin();
while(it != _arrows_shaders.end()){
if(it->first){
it->first->reload_file_color();
it->first->set_visible(true);
......@@ -1196,8 +1197,11 @@ void Render_alternate::reload_states(){
}
it++;
}
it = _arrows_shaders.begin();
while(it != _arrows_shaders.end()){
}
void Render_alternate::reload_events(){
std::map<EntityValue*, Shader*>::iterator it = _events_shaders.begin();
while(it != _events_shaders.end()){
if(it->first){
it->first->reload_file_color();
it->first->set_visible(true);
......@@ -1211,4 +1215,5 @@ void Render_alternate::reload_states(){
}
it++;
}
}
......@@ -576,6 +576,10 @@ public slots:
*/
void reload_states();
void reload_links();
void reload_events();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment