mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Improve code style, Wrap code for better readability
This commit is contained in:
@@ -21,12 +21,12 @@
|
||||
#include "ui_renamedialog.h"
|
||||
|
||||
RenameDialog::RenameDialog(QString path, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::RenameDialog),
|
||||
m_path(std::move(path))
|
||||
QDialog(parent),
|
||||
ui(new Ui::RenameDialog),
|
||||
m_path(std::move(path))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_name = m_path.split("/").last();
|
||||
ui->setupUi(this);
|
||||
m_name = m_path.split("/").last();
|
||||
if (m_name.endsWith(".elmt")) m_name.remove(".elmt");
|
||||
ui->m_label->setText(tr("L'élément « %1 » existe déjà. Que souhaitez-vous faire ?").arg(m_path));
|
||||
ui->lineEdit->setText(m_name + QDate::currentDate().toString("dd-MM-yy"));
|
||||
@@ -34,14 +34,14 @@ RenameDialog::RenameDialog(QString path, QWidget *parent) :
|
||||
|
||||
RenameDialog::~RenameDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RenameDialog::on_lineEdit_textEdited(const QString &arg1)
|
||||
{
|
||||
if (arg1.isEmpty() || (arg1 == m_name))
|
||||
if (arg1.isEmpty() || (arg1 == m_name))
|
||||
ui->m_rename_pb->setDisabled(true);
|
||||
else
|
||||
else
|
||||
ui->m_rename_pb->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,25 +27,25 @@ namespace Ui {
|
||||
|
||||
class RenameDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RenameDialog(QString path, QWidget *parent = nullptr);
|
||||
~RenameDialog() override;
|
||||
public:
|
||||
explicit RenameDialog(QString path, QWidget *parent = nullptr);
|
||||
~RenameDialog() override;
|
||||
|
||||
QString newName() const {return m_new_name;}
|
||||
QET::Action selectedAction() const {return m_action;}
|
||||
|
||||
private slots:
|
||||
void on_lineEdit_textEdited(const QString &arg1);
|
||||
private slots:
|
||||
void on_lineEdit_textEdited(const QString &arg1);
|
||||
void on_m_erase_pb_clicked();
|
||||
void on_m_rename_pb_clicked();
|
||||
void on_m_cancel_pb_clicked();
|
||||
|
||||
private:
|
||||
Ui::RenameDialog *ui;
|
||||
QString m_path;
|
||||
QString m_name;
|
||||
Ui::RenameDialog *ui;
|
||||
QString m_path;
|
||||
QString m_name;
|
||||
QString m_new_name;
|
||||
QET::Action m_action;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user