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

Remove some buttons

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