wip: add InputMessageNotifier into FilesWidget

This commit is contained in:
Корней Гедерт 2024-08-30 15:47:16 +04:00
parent 3e5b5a347a
commit 8c01066e53
4 changed files with 22 additions and 0 deletions

View File

@ -40,6 +40,12 @@ FilesWidget::FilesWidget(QWidget *parent, FilesItem *item)
{
ui->setupUi(this);
ui->inputMessage->addInstance("source_file");
ui->inputMessage->addInstance("destination");
ui->inputMessage->setInstanceDetection("source_file", InputMessageNotifier::MessageNotifierType::INVISIBLE_SPACE);
ui->inputMessage->setInstanceDetection("destination", InputMessageNotifier::MessageNotifierType::INVISIBLE_SPACE);
on_actionComboBox_currentIndexChanged(ui->actionComboBox->currentIndex());
}

View File

@ -65,6 +65,7 @@ private slots:
void on_actionComboBox_currentIndexChanged(int index);
void on_destinationToolButton_clicked();
void on_sourceLineEdit_textChanged(const QString &text);
void on_destinationLineEdit_textChanged(const QString &text);
void on_sourceToolButton_clicked();
private:

View File

@ -117,6 +117,9 @@
</item>
</layout>
</item>
<item>
<widget class="preferences::InputMessageNotifier" name="inputMessage" native="true"/>
</item>
<item>
<widget class="QCheckBox" name="supressErrorsCheckBox">
<property name="text">
@ -202,6 +205,12 @@
<extends>QLineEdit</extends>
<header>common/shortcutlineedit.h</header>
</customwidget>
<customwidget>
<class>preferences::InputMessageNotifier</class>
<extends>QWidget</extends>
<header>common/inputmessagenotifier.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -103,6 +103,11 @@ void FilesWidget::on_destinationToolButton_clicked()
}
}
void FilesWidget::on_destinationLineEdit_textChanged(const QString &text)
{
ui->inputMessage->updateInstance("destination", text);
}
void FilesWidget::on_sourceLineEdit_textChanged(const QString &text)
{
if (text.contains('*') || text.contains('?'))
@ -117,6 +122,7 @@ void FilesWidget::on_sourceLineEdit_textChanged(const QString &text)
ui->destinationLabel->setText(tr("Destination file:"));
}
ui->inputMessage->updateInstance("source_file", text);
}
} // namespace preferences