Wrap code for better readability

This commit is contained in:
Simon De Backer
2020-09-07 22:03:40 +02:00
parent 8ee38fab9e
commit 5d92393ee7
202 changed files with 4031 additions and 2153 deletions

View File

@@ -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);
}