Add "from" button in memo dialog

This commit is contained in:
Aditya Kulkarni
2018-12-03 15:08:48 -08:00
parent 4ff8400215
commit ffa6612caf
2 changed files with 42 additions and 13 deletions

View File

@@ -6,22 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>520</width>
<height>168</height>
<width>542</width>
<height>202</height>
</rect>
</property>
<property name="windowTitle">
<string>Memo</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Memo</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="0" column="2">
<widget class="QLabel" name="memoSize">
<property name="text">
<string notr="true">0 / 512</string>
@@ -31,7 +24,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="2" column="1" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -41,9 +34,40 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item row="1" column="0" colspan="3">
<widget class="QPlainTextEdit" name="memoTxt"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Memo</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnInsertFrom">
<property name="text">
<string>Add From Address</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>

View File

@@ -292,13 +292,18 @@ void MainWindow::memoButtonClicked(int number) {
});
// Insert From Address button
QObject::connect(memoDialog.btnInsertFrom, &QPushButton::clicked, [=] () {
memoDialog.memoTxt->setPlainText(memoDialog.memoTxt->toPlainText() +
"\n" + tr("From") + ":\n" + ui->inputsCombo->currentText());
});
memoDialog.memoTxt->setPlainText(currentMemo);
memoDialog.memoTxt->setFocus();
if (dialog.exec() == QDialog::Accepted) {
memoTxt->setText(memoDialog.memoTxt->toPlainText());
}
}
void MainWindow::removeExtraAddresses() {