mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Edited data of terminal strip can be applied
This commit is contained in:
parent
edfb23be23
commit
8084fa8f29
@ -27,9 +27,9 @@
|
||||
#include "terminalstripeditorwindow.h"
|
||||
#include "terminalstriptreedockwidget.h"
|
||||
|
||||
static int EMPTY_PAGE = 0;
|
||||
static int FREE_TERMINAL_PAGE = 1;
|
||||
static int TERMINAL_STRIP_PAGE = 2;
|
||||
static const int EMPTY_PAGE = 0;
|
||||
static const int FREE_TERMINAL_PAGE = 1;
|
||||
static const int TERMINAL_STRIP_PAGE = 2;
|
||||
/**
|
||||
* @brief TerminalStripEditorWindow::TerminalStripEditorWindow
|
||||
* @param project
|
||||
@ -149,3 +149,31 @@ void TerminalStripEditorWindow::on_m_reload_triggered() {
|
||||
m_free_terminal_editor->reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripEditorWindow::on_m_button_box_clicked
|
||||
* Action when user click on the apply/reset button
|
||||
* @param button
|
||||
*/
|
||||
void TerminalStripEditorWindow::on_m_button_box_clicked(QAbstractButton *button)
|
||||
{
|
||||
auto role_{ui->m_button_box->buttonRole(button)};
|
||||
|
||||
if (role_ == QDialogButtonBox::ApplyRole)
|
||||
{
|
||||
switch (ui->m_stacked_widget->currentIndex()) {
|
||||
case FREE_TERMINAL_PAGE:
|
||||
break;
|
||||
case TERMINAL_STRIP_PAGE:
|
||||
m_terminal_strip_editor->apply();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (role_ == QDialogButtonBox::ResetRole)
|
||||
{
|
||||
m_terminal_strip_editor->reload();
|
||||
m_free_terminal_editor->reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ class TerminalStripTreeDockWidget;
|
||||
class TerminalStrip;
|
||||
class FreeTerminalEditor;
|
||||
class TerminalStripEditor;
|
||||
class QAbstractButton;
|
||||
|
||||
namespace Ui {
|
||||
class TerminalStripEditorWindow;
|
||||
@ -42,6 +43,7 @@ class TerminalStripEditorWindow : public QMainWindow
|
||||
void on_m_add_terminal_strip_triggered();
|
||||
void on_m_remove_terminal_triggered();
|
||||
void on_m_reload_triggered();
|
||||
void on_m_button_box_clicked(QAbstractButton *button);
|
||||
|
||||
private:
|
||||
void addTreeDockWidget();
|
||||
|
@ -19,9 +19,9 @@
|
||||
<widget class="QStackedWidget" name="m_stacked_widget"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<widget class="QDialogButtonBox" name="m_button_box">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Reset</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user