mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-06 05:10:52 +01:00
Wrap code for better readability
This commit is contained in:
@@ -39,13 +39,15 @@ TitleBlockTemplateLocationSaver::TitleBlockTemplateLocationSaver(
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
TitleBlockTemplateLocationSaver::~TitleBlockTemplateLocationSaver() {
|
||||
TitleBlockTemplateLocationSaver::~TitleBlockTemplateLocationSaver()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return the currently selected/entered name
|
||||
*/
|
||||
QString TitleBlockTemplateLocationSaver::name() const {
|
||||
QString TitleBlockTemplateLocationSaver::name() const
|
||||
{
|
||||
int template_index = templates_ -> currentIndex();
|
||||
return(template_index ? templates_ -> currentText() : new_name_ -> text());
|
||||
}
|
||||
@@ -74,17 +76,19 @@ void TitleBlockTemplateLocationSaver::setLocation(const TitleBlockTemplateLocati
|
||||
Initialize this widget.
|
||||
@param location Initial location displayed by the widget
|
||||
*/
|
||||
void TitleBlockTemplateLocationSaver::init() {
|
||||
void TitleBlockTemplateLocationSaver::init()
|
||||
{
|
||||
new_name_ = new QLineEdit();
|
||||
connect(templates_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateNewName()));
|
||||
form_layout_ -> addRow(tr("ou nouveau nom", "used in save as form"), new_name_);
|
||||
form_layout_ -> addRow(tr("ou nouveau nom", "used in save as form"), new_name_);
|
||||
updateTemplates();
|
||||
}
|
||||
|
||||
/**
|
||||
Update the templates list according to the selected collection.
|
||||
*/
|
||||
void TitleBlockTemplateLocationSaver::updateTemplates() {
|
||||
void TitleBlockTemplateLocationSaver::updateTemplates()
|
||||
{
|
||||
TitleBlockTemplatesCollection *current_collection = collection();
|
||||
if (!current_collection) return;
|
||||
|
||||
@@ -99,7 +103,8 @@ void TitleBlockTemplateLocationSaver::updateTemplates() {
|
||||
Enable or diable the "new name" text field depending of the selected
|
||||
template.
|
||||
*/
|
||||
void TitleBlockTemplateLocationSaver::updateNewName() {
|
||||
void TitleBlockTemplateLocationSaver::updateNewName()
|
||||
{
|
||||
int template_index = templates_ -> currentIndex();
|
||||
new_name_ -> setEnabled(!template_index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user