Commit c10439cb authored by Mathieu Faverge's avatar Mathieu Faverge

Move the palette to common directory and cleanuop some spaces

parent c4506771
......@@ -42,13 +42,14 @@
#
SET(VITE_HDRS
common/common.hpp
common/Message.hpp
common/Errors.hpp
common/Tools.hpp
common/Info.hpp
common/Session.hpp
common/Memory.hpp
common/Message.hpp
common/Palette.hpp
common/Session.hpp
common/Tools.hpp
common/common.hpp
# Data structure headers
trace/values/Color.hpp
trace/values/Date.hpp
......@@ -83,7 +84,6 @@ SET(VITE_HDRS
trace/Trace.hpp
trace/IntervalOfContainer.hpp
# Render headers
render/Palette.hpp
render/Render.hpp
render/Geometry.hpp
render/Hook_event.hpp
......@@ -145,12 +145,13 @@ SET(VITE_UIS
SET(VITE_SRCS
# Messages & Errors
common/Message.cpp
common/Errors.cpp
common/Tools.cpp
common/Info.cpp
common/Session.cpp
common/Memory.cpp
common/Message.cpp
common/Palette.cpp
common/Session.cpp
common/Tools.cpp
# Data structure code files
trace/values/Color.cpp
trace/values/Date.cpp
......@@ -177,7 +178,6 @@ SET(VITE_SRCS
trace/Trace.cpp
trace/IntervalOfContainer.cpp
# Render code files
render/Palette.cpp
render/Geometry.cpp
render/Hook_event.cpp
render/Render.hpp
......
......@@ -31,7 +31,7 @@ Color *Palette::get_color(const std::string &state_name) {
bool Palette::is_visible(const std::string &state_name){
return _visible[state_name];
}
}
void Palette::add_state(const std::string &state, Color &c, bool visible) {
if(_pairs.find(state) != _pairs.end()) {
......
......@@ -60,7 +60,7 @@
/* -- */
#include "trace/values/Value.hpp"
#include "trace/values/Color.hpp"
#include "render/Palette.hpp"
#include "common/Palette.hpp"
#include "common/Session.hpp"
using namespace std;
......@@ -77,11 +77,13 @@ int Session::Minimap::pen_size;
QColor Session::Minimap::pen_color;
QColor Session::Minimap::brush_color;
bool Session::Minimap::is_closed;
Palette *Session::_palette = NULL;
Palette *Session::_link_types = NULL;
Palette *Session::_event_types = NULL;
bool Session::_use_palettes= false;
bool Session::_use_palettes_is_set=false;
QSettings *Session::settings = NULL;
Session::Session() {
......
......@@ -119,7 +119,7 @@ private:
public:
static QSettings *settings;
static Palette *_palette;
// static Palette *_palette;
static Palette * _link_types;
static Palette * _event_types;
......
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
#include <iostream>
#include <string>
......@@ -104,8 +104,6 @@ Settings_window::Settings_window(Core *c, QWidget *parent) : QWidget(parent), _c
// Need to load the types
fill_link_types_table(current);
link_types_palette_list->setCurrentIndex(link_types_palette_list->findText(QString::fromStdString(current))); // Set the combobox at the good index.
}
Settings_window::~Settings_window() {
......@@ -296,7 +294,7 @@ QString Settings_window::copy_palette(QTableWidget* , QComboBox* list, const std
return text;
}
}
void Settings_window::on_copy_palette_btn_clicked() {
QString text= copy_palette(states_table, palette_list, "palette");
......@@ -326,7 +324,6 @@ void Settings_window::on_reload_states_btn_clicked(){
map<string, Color *> colors;
int row = 0;
if(_c->get_trace()) { // Need a trace loaded
_c->get_trace()->get_states_colors(colors);
}
......@@ -533,7 +530,6 @@ void Settings_window::fill_link_types_table(const string &palette_name) {
link_types_table->removeRow(0);
}
int row = 0;
Palette* p= Session::get_palette("link_types",palette_name);
map<string, Color *> colors = p->get_map();
......@@ -791,7 +787,7 @@ void Settings_window::on_apply_clicked() {
void Settings_window::on_use_palette_cb_stateChanged(){
_changed=true;
}
}
void Settings_window::on_cancel_clicked() {
hide();
......@@ -801,4 +797,4 @@ void Settings_window::on_ok_clicked(){
if(_changed)on_apply_clicked();
hide();
}
}
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