#include <VisFramework/VisFrameworkBase/interface/VisParamEditor.h>
Public Slots | |
virtual void | peApplyBtn_clicked () |
Apply changes. | |
virtual void | peCancelBtn_clicked () |
Cancel session with the parameter editor: close the parameter editor window. | |
virtual void | peHelpBtn_clicked () |
Give some help. | |
virtual void | peNameStr_returnPressed () |
Enable "Apply" on "Return" pressed within text field and apply the changes. | |
virtual void | peNameStr_textChanged (const QString &) |
When text changes enable "Apply" button. | |
virtual void | peOkBtn_clicked () |
Finish editing the parameter: apply changes and close the dialog. | |
virtual void | peValueStr_returnPressed () |
Enable "Apply" on "Return" pressed within text field. | |
virtual void | peValueStr_textChanged (const QString &) |
Enable "Apply" on changes of the text. | |
Public Member Functions | |
VisParamEditor (IgState *state, QWidget *parent=0, const char *name=0, WFlags fl=0) | |
~VisParamEditor () | |
Public Attributes | |
QPushButton * | peApplyBtn |
QPushButton * | peCancelBtn |
QPushButton * | peHelpBtn |
QLabel * | peNameLbl |
QLineEdit * | peNameStr |
QPushButton * | peOkBtn |
QLabel * | peValueLbl |
QLineEdit * | peValueStr |
Protected Attributes | |
QVBoxLayout * | paramEditorLayout |
QHBoxLayout * | peBtnLayout |
QVBoxLayout * | peLayout |
Private Attributes | |
IgState * | m_state |
Definition at line 14 of file VisParamEditor.h.
VisParamEditor::VisParamEditor | ( | IgState * | state, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 , |
|||
WFlags | fl = 0 | |||
) |
Definition at line 31 of file VisParamEditor.cc.
References HLT_VtxMuL3::connect, paramEditorLayout, peApplyBtn, peApplyBtn_clicked(), peBtnLayout, peCancelBtn, peCancelBtn_clicked(), peHelpBtn, peHelpBtn_clicked(), peLayout, peNameLbl, peNameStr, peNameStr_returnPressed(), peNameStr_textChanged(), peOkBtn, peOkBtn_clicked(), peValueLbl, peValueStr, peValueStr_returnPressed(), and peValueStr_textChanged().
00032 : QWidget (parent, name, fl), 00033 m_state (state) 00034 { 00035 if (!name) 00036 setName ("VisParamEditor"); 00037 resize (506, 184); 00038 setCaption (trUtf8 ("Edit Configurable Parameter")); 00039 paramEditorLayout = new QVBoxLayout (this, 11, 6, "paramEditorLayout"); 00040 00041 peLayout = new QVBoxLayout (0, 0, 6, "peLayout"); 00042 00043 peNameLbl = new QLabel (this, "peNameLbl"); 00044 peNameLbl->setText (trUtf8 ("Name")); 00045 peLayout->addWidget (peNameLbl); 00046 00047 peNameStr = new QLineEdit (this, "peNameStr"); 00048 peLayout->addWidget (peNameStr); 00049 00050 peValueLbl = new QLabel (this, "peValueLbl"); 00051 peValueLbl->setText (trUtf8 ("Value")); 00052 peLayout->addWidget (peValueLbl); 00053 00054 peValueStr = new QLineEdit (this, "peValueStr"); 00055 peLayout->addWidget (peValueStr); 00056 00057 peBtnLayout = new QHBoxLayout (0, 0, 6, "peBtnLayout"); 00058 00059 peHelpBtn = new QPushButton (this, "peHelpBtn"); 00060 peHelpBtn->setText (trUtf8 ("Help")); 00061 peBtnLayout->addWidget (peHelpBtn); 00062 00063 peApplyBtn = new QPushButton (this, "peApplyBtn"); 00064 peApplyBtn->setEnabled (false); 00065 peApplyBtn->setText (trUtf8 ("Apply")); 00066 peBtnLayout->addWidget (peApplyBtn); 00067 00068 peOkBtn = new QPushButton (this, "peOkBtn"); 00069 peOkBtn->setText (trUtf8 ("OK")); 00070 peOkBtn->setOn (false); 00071 peOkBtn->setDefault (true); 00072 peBtnLayout->addWidget (peOkBtn); 00073 00074 peCancelBtn = new QPushButton (this, "peCancelBtn"); 00075 peCancelBtn->setText (trUtf8 ("Cancel")); 00076 peBtnLayout->addWidget (peCancelBtn); 00077 peLayout->addLayout (peBtnLayout); 00078 paramEditorLayout->addLayout (peLayout); 00079 00080 // signals and slots connections 00081 connect (peHelpBtn, SIGNAL (clicked ()), this, SLOT (peHelpBtn_clicked ())); 00082 connect (peApplyBtn, SIGNAL (clicked ()), this, SLOT (peApplyBtn_clicked ())); 00083 connect (peOkBtn, SIGNAL (clicked ()), this, SLOT (peOkBtn_clicked ())); 00084 connect (peCancelBtn, SIGNAL (clicked ()), this, SLOT (peCancelBtn_clicked ())); 00085 connect (peNameStr, SIGNAL (textChanged (const QString&)), this, SLOT (peNameStr_textChanged (const QString&))); 00086 connect (peNameStr, SIGNAL (returnPressed ()), this, SLOT (peNameStr_returnPressed ())); 00087 connect (peValueStr, SIGNAL (returnPressed ()), this, SLOT (peValueStr_returnPressed ())); 00088 connect (peValueStr, SIGNAL (textChanged (const QString&)), this, SLOT (peValueStr_textChanged (const QString&))); 00089 }
VisParamEditor::~VisParamEditor | ( | ) |
void VisParamEditor::peApplyBtn_clicked | ( | ) | [virtual, slot] |
Apply changes.
Definition at line 114 of file VisParamEditor.cc.
References DBSPlugin::get(), m_state, name, peApplyBtn, peNameStr, peValueStr, value, and warning.
Referenced by peNameStr_returnPressed(), peOkBtn_clicked(), peValueStr_returnPressed(), and VisParamEditor().
00115 { 00116 if (peApplyBtn->isEnabled ()) 00117 { 00118 std::string name (peNameStr->text ().latin1 ()); 00119 std::string value (peValueStr->text ().latin1 ()); 00120 if (!name.empty ()) VisConfiguration::get (m_state)->modify (name, value); 00121 else QMessageBox::warning (this, "Warning: Empty name", 00122 "Empty name cannot be set!\n" 00123 "Please, change the name\n" 00124 "to something meaningful."); 00125 peApplyBtn->setEnabled (false); 00126 } 00127 }
void VisParamEditor::peCancelBtn_clicked | ( | ) | [virtual, slot] |
Cancel session with the parameter editor: close the parameter editor window.
Definition at line 145 of file VisParamEditor.cc.
Referenced by VisParamEditor().
void VisParamEditor::peHelpBtn_clicked | ( | ) | [virtual, slot] |
Give some help.
Definition at line 103 of file VisParamEditor.cc.
Referenced by VisParamEditor().
00104 { 00105 QMessageBox::about (this, "Configurable Parameter Editor", 00106 "Visualization configurable parameters editor\n" 00107 "Copyright 2007 CMS\n"); 00108 }
void VisParamEditor::peNameStr_returnPressed | ( | ) | [virtual, slot] |
Enable "Apply" on "Return" pressed within text field and apply the changes.
Definition at line 164 of file VisParamEditor.cc.
References peApplyBtn, and peApplyBtn_clicked().
Referenced by VisParamEditor().
00165 { 00166 peApplyBtn->setEnabled (true); 00167 peApplyBtn_clicked (); 00168 }
void VisParamEditor::peNameStr_textChanged | ( | const QString & | ) | [virtual, slot] |
When text changes enable "Apply" button.
Definition at line 154 of file VisParamEditor.cc.
References peApplyBtn.
Referenced by VisParamEditor().
00155 { 00156 peApplyBtn->setEnabled (true); 00157 }
void VisParamEditor::peOkBtn_clicked | ( | ) | [virtual, slot] |
Finish editing the parameter: apply changes and close the dialog.
Definition at line 134 of file VisParamEditor.cc.
References peApplyBtn_clicked().
Referenced by VisParamEditor().
00135 { 00136 peApplyBtn_clicked (); 00137 this->close (); 00138 }
void VisParamEditor::peValueStr_returnPressed | ( | ) | [virtual, slot] |
Enable "Apply" on "Return" pressed within text field.
Definition at line 175 of file VisParamEditor.cc.
References peApplyBtn, and peApplyBtn_clicked().
Referenced by VisParamEditor().
00176 { 00177 peApplyBtn->setEnabled (true); 00178 peApplyBtn_clicked (); 00179 }
void VisParamEditor::peValueStr_textChanged | ( | const QString & | ) | [virtual, slot] |
Enable "Apply" on changes of the text.
Definition at line 185 of file VisParamEditor.cc.
References peApplyBtn.
Referenced by VisParamEditor().
00186 { 00187 peApplyBtn->setEnabled (true); 00188 }
IgState* VisParamEditor::m_state [private] |
QVBoxLayout* VisParamEditor::paramEditorLayout [protected] |
QPushButton* VisParamEditor::peApplyBtn |
Definition at line 27 of file VisParamEditor.h.
Referenced by VisConfigEditor::configListView_doubleClicked(), VisConfigEditor::editBtn_clicked(), VisConfigEditor::newBtn_clicked(), peApplyBtn_clicked(), peNameStr_returnPressed(), peNameStr_textChanged(), peValueStr_returnPressed(), peValueStr_textChanged(), and VisParamEditor().
QHBoxLayout* VisParamEditor::peBtnLayout [protected] |
QPushButton* VisParamEditor::peCancelBtn |
QPushButton* VisParamEditor::peHelpBtn |
QVBoxLayout* VisParamEditor::peLayout [protected] |
QLabel* VisParamEditor::peNameLbl |
QLineEdit* VisParamEditor::peNameStr |
Definition at line 23 of file VisParamEditor.h.
Referenced by VisConfigEditor::configListView_doubleClicked(), VisConfigEditor::editBtn_clicked(), peApplyBtn_clicked(), and VisParamEditor().
QPushButton* VisParamEditor::peOkBtn |
Definition at line 28 of file VisParamEditor.h.
Referenced by VisConfigEditor::configListView_doubleClicked(), VisConfigEditor::editBtn_clicked(), VisConfigEditor::newBtn_clicked(), and VisParamEditor().
QLabel* VisParamEditor::peValueLbl |
QLineEdit* VisParamEditor::peValueStr |
Definition at line 25 of file VisParamEditor.h.
Referenced by VisConfigEditor::configListView_doubleClicked(), VisConfigEditor::editBtn_clicked(), peApplyBtn_clicked(), and VisParamEditor().