Commit 0e243ee7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve simple/double quote selection interface

parent ea35021c
Pipeline #63240 passed with stage
in 10 minutes and 27 seconds
......@@ -166,11 +166,11 @@ void AutoCorrectionWidget::loadAutoCorrectionAndException()
{
/* tab 2 - Custom Quotes */
d->m_singleQuotes = d->mAutoCorrection->typographicSingleQuotes();
d->ui->singleQuote1->setText(d->m_singleQuotes.begin);
d->ui->singleQuote2->setText(d->m_singleQuotes.end);
d->ui->simpleQuoteBeginReplace->setText(d->m_singleQuotes.begin);
d->ui->simpleQuoteEndReplace->setText(d->m_singleQuotes.end);
d->m_doubleQuotes = d->mAutoCorrection->typographicDoubleQuotes();
d->ui->doubleQuote1->setText(d->m_doubleQuotes.begin);
d->ui->doubleQuote2->setText(d->m_doubleQuotes.end);
d->ui->doubleQuoteBeginReplace->setText(d->m_doubleQuotes.begin);
d->ui->doubleQuoteEndReplace->setText(d->m_doubleQuotes.end);
enableSingleQuotes(d->ui->typographicSingleQuotes->isChecked());
enableDoubleQuotes(d->ui->typographicDoubleQuotes->isChecked());
......@@ -277,7 +277,7 @@ void AutoCorrectionWidget::selectSingleQuoteCharOpen()
dlg->autoInsertChar();
if (dlg->exec()) {
d->m_singleQuotes.begin = dlg->currentChar();
d->ui->singleQuote1->setText(d->m_singleQuotes.begin);
d->ui->simpleQuoteBeginReplace->setText(d->m_singleQuotes.begin);
emitChanged();
}
delete dlg;
......@@ -291,7 +291,7 @@ void AutoCorrectionWidget::selectSingleQuoteCharClose()
dlg->autoInsertChar();
if (dlg->exec()) {
d->m_singleQuotes.end = dlg->currentChar();
d->ui->singleQuote2->setText(d->m_singleQuotes.end);
d->ui->simpleQuoteEndReplace->setText(d->m_singleQuotes.end);
emitChanged();
}
delete dlg;
......@@ -300,8 +300,8 @@ void AutoCorrectionWidget::selectSingleQuoteCharClose()
void AutoCorrectionWidget::setDefaultSingleQuotes()
{
d->m_singleQuotes = d->mAutoCorrection->typographicDefaultSingleQuotes();
d->ui->singleQuote1->setText(d->m_singleQuotes.begin);
d->ui->singleQuote2->setText(d->m_singleQuotes.end);
d->ui->simpleQuoteBeginReplace->setText(d->m_singleQuotes.begin);
d->ui->simpleQuoteEndReplace->setText(d->m_singleQuotes.end);
emitChanged();
}
......@@ -313,7 +313,7 @@ void AutoCorrectionWidget::selectDoubleQuoteCharOpen()
dlg->autoInsertChar();
if (dlg->exec()) {
d->m_doubleQuotes.begin = dlg->currentChar();
d->ui->doubleQuote1->setText(d->m_doubleQuotes.begin);
d->ui->doubleQuoteBeginReplace->setText(d->m_doubleQuotes.begin);
emitChanged();
}
delete dlg;
......@@ -327,7 +327,7 @@ void AutoCorrectionWidget::selectDoubleQuoteCharClose()
dlg->autoInsertChar();
if (dlg->exec()) {
d->m_doubleQuotes.end = dlg->currentChar();
d->ui->doubleQuote2->setText(d->m_doubleQuotes.end);
d->ui->doubleQuoteEndReplace->setText(d->m_doubleQuotes.end);
emitChanged();
}
delete dlg;
......@@ -336,8 +336,8 @@ void AutoCorrectionWidget::selectDoubleQuoteCharClose()
void AutoCorrectionWidget::setDefaultDoubleQuotes()
{
d->m_doubleQuotes = d->mAutoCorrection->typographicDefaultDoubleQuotes();
d->ui->doubleQuote1->setText(d->m_doubleQuotes.begin);
d->ui->doubleQuote2->setText(d->m_doubleQuotes.end);
d->ui->doubleQuoteBeginReplace->setText(d->m_doubleQuotes.begin);
d->ui->doubleQuoteEndReplace->setText(d->m_doubleQuotes.end);
emitChanged();
}
......
......@@ -32,10 +32,41 @@
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="exportAutoCorrection">
<property name="text">
<string>Export...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="importAutoCorrection">
<property name="text">
<string>Import...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>469</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_1">
<attribute name="title">
......@@ -140,118 +171,245 @@
<attribute name="title">
<string>Custom &amp;Quotes</string>
</attribute>
<layout class="QGridLayout" name="_3">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="typographicSingleQuotes">
<property name="text">
<string>Replace &amp;single quotes with typographical quotes</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QCheckBox" name="typographicDoubleQuotes">
<property name="text">
<string>Replace &amp;double quotes with typographical quotes</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="_4">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<item>
<widget class="QPushButton" name="doubleQuote1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="doubleQuote2">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="doubleDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="2">
<widget class="QLabel" name="doubleQuoteBeginReplace">
<property name="text">
<string>By Default</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="doubleQuote1">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&quot;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="doubleQuote2">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&quot;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Ending Quote:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="doubleQuoteEndReplace">
<property name="text">
<string>By Default</string>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Opening Quote:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>50</number>
</property>
</spacer>
<item>
<widget class="QPushButton" name="doubleDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<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>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="_6">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
<item>
<widget class="QCheckBox" name="typographicSingleQuotes">
<property name="text">
<string>Replace &amp;single quotes with typographical quotes</string>
</property>
<item>
<widget class="QPushButton" name="singleQuote1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="singleQuote2">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QPushButton" name="singleDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="3" rowspan="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="singleQuote1">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>'</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="singleQuote2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>'</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Opening Quote:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="simpleQuoteBeginReplace">
<property name="text">
<string>By Default</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Ending Quotes:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="simpleQuoteEndReplace">
<property name="text">
<string>By Default</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>50</number>
</property>
</spacer>
<item>
<widget class="QPushButton" name="singleDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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>
</item>
<item row="5" column="1">
<item>
<widget class="QCheckBox" name="addNonBreakingSpaceInFrench">
<property name="text">
<string>Add non breaking space before specific punctuation marks in French text</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -264,13 +422,6 @@
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="addNonBreakingSpaceInFrench">
<property name="text">
<string>Add non breaking space before specific punctuation marks in French text</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
......@@ -530,37 +681,6 @@
</widget>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="exportAutoCorrection">
<property name="text">
<string>Export...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="importAutoCorrection">
<property name="text">
<string>Import...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>469</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
......@@ -594,8 +714,6 @@
<tabstop>autoSuperScript</tabstop>
<tabstop>typographicDoubleQuotes</tabstop>
<tabstop>doubleQuote1</tabstop>
<tabstop>doubleQuote2</tabstop>
<tabstop>doubleDefault</tabstop>
<tabstop>typographicSingleQuotes</tabstop>
<tabstop>singleQuote1</tabstop>
<tabstop>singleQuote2</tabstop>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment