Commit 5b1e78a4 authored by Mathieu Faverge's avatar Mathieu Faverge

Remove some buttons

parent dc8434f2
......@@ -632,7 +632,7 @@ void Interface_graphic::on_reload_triggered() {
Element_pos zoom[2]={Info::Splitter::_x_min,Info::Splitter::_x_max};
if(_ui_settings != NULL){
//_ui_settings->updateTrace( _core->get_trace() );
_ui_settings->on_apply_clicked();
//_ui_settings->on_apply_clicked();
}
if(_ui_node_selection!=NULL)
_ui_node_selection->on_reset_button_clicked();
......
......@@ -517,7 +517,7 @@ Settings_tab::on_btn_reload_clicked()
}
Settings_window::Settings_window(Core *c, QWidget *parent)
: QWidget(parent), _c(c), _reload_states(false), _reload_links(false), _reload_events(false)
: QWidget(parent), _c(c)
{
QStringList palettes;
string current;
......@@ -529,20 +529,16 @@ Settings_window::Settings_window(Core *c, QWidget *parent)
_changed = false;
Session &S = Session::getSession();
// const string &tabName = tabWidget->tabText(index).toStdString();
reload_minimap_tab();
Settings_tab *tab_states = new Settings_tab( _c, "palette" );
tabWidget->insertTab(1, tab_states, "States");
_tab_states = new Settings_tab( _c, "palette" );
tabWidget->insertTab(1, _tab_states, "States");
Settings_tab *tab_events = new Settings_tab( _c, "event_types" );
tabWidget->insertTab(2, tab_events, "Events");
_tab_events = new Settings_tab( _c, "event_types" );
tabWidget->insertTab(2, _tab_events, "Events");
Settings_tab *tab_links = new Settings_tab( _c, "link_types" );
tabWidget->insertTab(3, tab_links, "Links");
_tab_links = new Settings_tab( _c, "link_types" );
tabWidget->insertTab(3, _tab_links, "Links");
}
Settings_window::~Settings_window() {
......@@ -610,59 +606,75 @@ void Settings_window::plugin_load_dirs_name() {
/*************************/
/* Global buttons click. */
/*************************/
void Settings_window::on_apply_clicked() {
Session &S = Session::getSession();
MinimapSettings &ms = Session::getSessionMinimap();
_changed=false;
// The plugin tab
QStringList dir_names;
for(int i = 0 ; i < dir_list->count() ; i ++) {
dir_names << dir_list->item(i)->text();
}
S.save_plugin_directories(dir_names);
// void Settings_window::on_btn_apply_clicked() {
// Session &S = Session::getSession();
// MinimapSettings &ms = Session::getSessionMinimap();
// _changed=false;
// // The plugin tab
// QStringList dir_names;
// for(int i = 0 ; i < dir_list->count() ; i ++) {
// dir_names << dir_list->item(i)->text();
// }
// S.save_plugin_directories(dir_names);
// // The minimap tab
// minimap_hide_cb->setChecked(ms._is_closed);
// minimap_x_sb->setValue(ms._x);
// minimap_y_sb->setValue(ms._y);
// minimap_w_sb->setValue(ms._width);
// minimap_h_sb->setValue(ms._height);
// /*cout <<minimap_x_sb->value() << " " << minimap_y_sb->value() <<" " <<
// minimap_w_sb->value() <<" " << minimap_h_sb->value() <<" " <<
// minimap_hide_cb->isChecked() << endl;*/
// ms.save( minimap_x_sb->value(),
// minimap_y_sb->value(),
// minimap_w_sb->value(),
// minimap_h_sb->value(),
// minimap_hide_cb->isChecked());
// _c->launch_action(Core::_STATE_RENDER_UPDATE);
// }
// The minimap tab
minimap_hide_cb->setChecked(ms._is_closed);
minimap_x_sb->setValue(ms._x);
minimap_y_sb->setValue(ms._y);
minimap_w_sb->setValue(ms._width);
minimap_h_sb->setValue(ms._height);
/*cout <<minimap_x_sb->value() << " " << minimap_y_sb->value() <<" " <<
minimap_w_sb->value() <<" " << minimap_h_sb->value() <<" " <<
minimap_hide_cb->isChecked() << endl;*/
ms.save( minimap_x_sb->value(),
minimap_y_sb->value(),
minimap_w_sb->value(),
minimap_h_sb->value(),
minimap_hide_cb->isChecked());
_c->launch_action(Core::_STATE_RENDER_UPDATE);
void
Settings_window::on_btn_ok_clicked()
{
if( _changed ) {
//on_apply_clicked();
// Catch by at least the interface_graphic which will dispatch it to the classes which needs
emit settings_changed();
// Catch by at least the interface_graphic which will dispatch it to the classes which needs
emit settings_changed();
_c->launch_action(Core::_STATE_RENDER_UPDATE);
}
hide();
}
void Settings_window::on_use_palette_cb_stateChanged(){
_changed = true;
void
Settings_window::on_btn_cancel_clicked()
{
hide();
}
void Settings_window::on_cancel_clicked() {
_reload_states = false;
_reload_links = false;
_reload_events = false;
void
Settings_window::on_cb_tip_currentIndexChanged(int index)
{
std::cout << "Slot pointe appelé" << std::endl;
Info::Render::_arrows_shape = index;
//_core->launch_action(Core::_STATE_RENDER_UPDATE);
}
void Settings_window::on_ok_clicked(){
if( _changed )
on_apply_clicked();
hide();
void
Settings_window::on_cb_nolinks_stateChanged(int index)
{
Info::Render::_arrows_shape = index;
//_core->launch_action(Core::_STATE_RENDER_UPDATE);
}
void Settings_window::on_pointe_currentIndexChanged(int index){
std::cout << "Slot pointe appelé" << std::endl;
void
Settings_window::on_cb_noevents_stateChanged(int index)
{
Info::Render::_arrows_shape = index;
//_core->launch_action(Core::_STATE_RENDER_UPDATE);
}
......@@ -95,15 +95,18 @@ public:
std::map<std::string, int> _changes;
std::map<std::string, int> _cancel;
public:
Settings_tab(Core *, std::string);
~Settings_tab();
void refresh();
void updateTrace();
private:
void add_table_line( int &row,
EntityValue *ev,
bool used );
void fill_table( bool used=true );
void fill_table_from_palette( std::string );
private slots:
......@@ -137,10 +140,10 @@ class Settings_window : public QWidget, protected Ui::settings {
private:
Core *_c;
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
Settings_tab *_tab_states;
Settings_tab *_tab_events;
Settings_tab *_tab_links;
bool _changed;
/*!
......@@ -148,7 +151,6 @@ private:
*/
void plugin_load_dirs_name();
/*!
* \brief Reload the general tab.
*/
......@@ -199,38 +201,26 @@ private slots:
*/
void on_add_dir_btn_clicked();
/*!
* \fn on_apply_clicked()
* \brief (Global) Called when the user click on the apply button.
* Save the informations and emit the changes.
*/
void on_apply_clicked();
/*!
* \fn on_cancel_clicked()
* \brief (Global) Called when the user click on the cancel button.
* Quit the window without saving changes.
*/
void on_cancel_clicked();
void on_btn_cancel_clicked();
/*!
* \fn on_ok_clicked()
* \brief (states tab) Called when the user click on the OK button.
* apply changes and hide the window
*/
void on_ok_clicked();
/*!
* \fn on_use_palettes_triggered()
* \brief Called when the user changes use palettes setting.
*/
void on_use_palette_cb_stateChanged();
void on_btn_ok_clicked();
/*!
*\brief A slot called when 'arrows_shape' in the menu is modified
*/
void on_pointe_currentIndexChanged(int index);
void on_cb_nolinks_stateChanged(int state);
void on_cb_noevents_stateChanged(int state);
void on_cb_tip_currentIndexChanged(int index);
signals:
void settings_changed();
......
......@@ -65,14 +65,14 @@
<number>9</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_2">
<widget class="QCheckBox" name="cb_nolinks">
<property name="text">
<string>No links</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<widget class="QCheckBox" name="cb_noevents">
<property name="text">
<string>No events</string>
</property>
......@@ -103,7 +103,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="pointe">
<widget class="QComboBox" name="cb_tip">
<property name="maxVisibleItems">
<number>3</number>
</property>
......@@ -399,23 +399,16 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancel">
<widget class="QPushButton" name="btn_ok">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="apply">
<property name="text">
<string>Apply</string>
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ok">
<widget class="QPushButton" name="btn_cancel">
<property name="text">
<string>OK</string>
<string>Cancel</string>
</property>
</widget>
</item>
......
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