Skip to content

Commit

Permalink
Added Bypass TTS checkBox on the Settings AceCentre#44
Browse files Browse the repository at this point in the history
  • Loading branch information
acerjay committed Jul 1, 2024
1 parent a32a407 commit 70fe0d7
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 133 deletions.
179 changes: 96 additions & 83 deletions GUI_TranslateAndTTS/form.ui
Original file line number Diff line number Diff line change
Expand Up @@ -759,36 +759,7 @@ p, li { white-space: pre-wrap; }
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;&quot;&gt;Writing Language &lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Writing Language</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_14">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Provider</string>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
Expand All @@ -810,68 +781,17 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBox_writeLang">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_provider">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBox_targetLang">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_overwritepb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QComboBox" name="comboBox_writeLang">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;&quot;&gt;Do you want to overwrite the pasteboard with the new translated string?&lt;/span&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Overwrite Pasteboard</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QStackedWidget" name="stackedWidget_provider">
<property name="font">
<font>
Expand Down Expand Up @@ -1129,6 +1049,99 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_provider">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Provider</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;&quot;&gt;Writing Language &lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Writing Language</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="comboBox_targetLang">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_overwritepb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;pre style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;&quot;&gt;Do you want to overwrite the pasteboard with the new translated string?&lt;/span&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Overwrite Pasteboard</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="bypass_tts_checkBox">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Bypass TTS</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
1 change: 1 addition & 0 deletions GUI_TranslateAndTTS/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def setupUi(self, item):
self.stackedWidget.setFrameShadow(QFrame.Raised)
self.stackedWidgetPage1 = QWidget()
self.stackedWidgetPage1.setObjectName(u"stackedWidgetPage1")
self.stackedWidgetPage1.setStyleSheet(u"background-color: rgb(255, 255, 255);")
self.gridLayout = QGridLayout(self.stackedWidgetPage1)
self.gridLayout.setSpacing(2)
self.gridLayout.setObjectName(u"gridLayout")
Expand Down
107 changes: 57 additions & 50 deletions GUI_TranslateAndTTS/ui_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Ui_Widget(object):
def setupUi(self, Widget):
if not Widget.objectName():
Widget.setObjectName(u"Widget")
Widget.resize(615, 391)
Widget.resize(619, 400)
icon = QIcon()
icon.addFile(u":/images/images/configure.ico", QSize(), QIcon.Normal, QIcon.Off)
Widget.setWindowIcon(icon)
Expand Down Expand Up @@ -460,59 +460,24 @@ def setupUi(self, Widget):
self.groupBox_translate.setCheckable(False)
self.gridLayout_2 = QGridLayout(self.groupBox_translate)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.label = QLabel(self.groupBox_translate)
self.label.setObjectName(u"label")
font3 = QFont()
font3.setBold(False)
self.label.setFont(font3)

self.gridLayout_2.addWidget(self.label, 4, 0, 1, 1)

self.label_14 = QLabel(self.groupBox_translate)
self.label_14.setObjectName(u"label_14")
self.label_14.setFont(font3)

self.gridLayout_2.addWidget(self.label_14, 2, 0, 1, 1)

self.label_2 = QLabel(self.groupBox_translate)
self.label_2.setObjectName(u"label_2")
sizePolicy5 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
sizePolicy5.setHorizontalStretch(0)
sizePolicy5.setVerticalStretch(0)
sizePolicy5.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy5)
font3 = QFont()
font3.setBold(False)
self.label_2.setFont(font3)

self.gridLayout_2.addWidget(self.label_2, 5, 0, 1, 1)
self.gridLayout_2.addWidget(self.label_2, 6, 0, 1, 1)

self.comboBox_writeLang = QComboBox(self.groupBox_translate)
self.comboBox_writeLang.setObjectName(u"comboBox_writeLang")
self.comboBox_writeLang.setFont(font3)

self.gridLayout_2.addWidget(self.comboBox_writeLang, 4, 1, 1, 1)

self.comboBox_provider = QComboBox(self.groupBox_translate)
self.comboBox_provider.setObjectName(u"comboBox_provider")
self.comboBox_provider.setFont(font3)

self.gridLayout_2.addWidget(self.comboBox_provider, 2, 1, 1, 1)

self.comboBox_targetLang = QComboBox(self.groupBox_translate)
self.comboBox_targetLang.setObjectName(u"comboBox_targetLang")
sizePolicy4.setHeightForWidth(self.comboBox_targetLang.sizePolicy().hasHeightForWidth())
self.comboBox_targetLang.setSizePolicy(sizePolicy4)
self.comboBox_targetLang.setFont(font3)

self.gridLayout_2.addWidget(self.comboBox_targetLang, 5, 1, 1, 1)

self.checkBox_overwritepb = QCheckBox(self.groupBox_translate)
self.checkBox_overwritepb.setObjectName(u"checkBox_overwritepb")
sizePolicy4.setHeightForWidth(self.checkBox_overwritepb.sizePolicy().hasHeightForWidth())
self.checkBox_overwritepb.setSizePolicy(sizePolicy4)
self.checkBox_overwritepb.setFont(font3)
self.checkBox_overwritepb.setChecked(True)

self.gridLayout_2.addWidget(self.checkBox_overwritepb, 1, 0, 1, 1)
self.gridLayout_2.addWidget(self.comboBox_writeLang, 5, 1, 1, 1)

self.stackedWidget_provider = QStackedWidget(self.groupBox_translate)
self.stackedWidget_provider.setObjectName(u"stackedWidget_provider")
Expand Down Expand Up @@ -663,7 +628,48 @@ def setupUi(self, Widget):

self.stackedWidget_provider.addWidget(self.baidu)

self.gridLayout_2.addWidget(self.stackedWidget_provider, 6, 0, 1, 2)
self.gridLayout_2.addWidget(self.stackedWidget_provider, 7, 0, 1, 2)

self.comboBox_provider = QComboBox(self.groupBox_translate)
self.comboBox_provider.setObjectName(u"comboBox_provider")
self.comboBox_provider.setFont(font3)

self.gridLayout_2.addWidget(self.comboBox_provider, 3, 1, 1, 1)

self.label_14 = QLabel(self.groupBox_translate)
self.label_14.setObjectName(u"label_14")
self.label_14.setFont(font3)

self.gridLayout_2.addWidget(self.label_14, 3, 0, 1, 1)

self.label = QLabel(self.groupBox_translate)
self.label.setObjectName(u"label")
self.label.setFont(font3)

self.gridLayout_2.addWidget(self.label, 5, 0, 1, 1)

self.comboBox_targetLang = QComboBox(self.groupBox_translate)
self.comboBox_targetLang.setObjectName(u"comboBox_targetLang")
sizePolicy4.setHeightForWidth(self.comboBox_targetLang.sizePolicy().hasHeightForWidth())
self.comboBox_targetLang.setSizePolicy(sizePolicy4)
self.comboBox_targetLang.setFont(font3)

self.gridLayout_2.addWidget(self.comboBox_targetLang, 6, 1, 1, 1)

self.checkBox_overwritepb = QCheckBox(self.groupBox_translate)
self.checkBox_overwritepb.setObjectName(u"checkBox_overwritepb")
sizePolicy4.setHeightForWidth(self.checkBox_overwritepb.sizePolicy().hasHeightForWidth())
self.checkBox_overwritepb.setSizePolicy(sizePolicy4)
self.checkBox_overwritepb.setFont(font3)
self.checkBox_overwritepb.setChecked(True)

self.gridLayout_2.addWidget(self.checkBox_overwritepb, 1, 0, 1, 1)

self.bypass_tts_checkBox = QCheckBox(self.groupBox_translate)
self.bypass_tts_checkBox.setObjectName(u"bypass_tts_checkBox")
self.bypass_tts_checkBox.setFont(font3)

self.gridLayout_2.addWidget(self.bypass_tts_checkBox, 2, 0, 1, 1)


self.verticalLayout_15.addWidget(self.groupBox_translate)
Expand Down Expand Up @@ -856,19 +862,10 @@ def retranslateUi(self, Widget):
#endif // QT_CONFIG(tooltip)
self.checkBox_translate.setText(QCoreApplication.translate("Widget", u"Translate", None))
self.groupBox_translate.setTitle(QCoreApplication.translate("Widget", u"Translate Settings", None))
#if QT_CONFIG(tooltip)
self.label.setToolTip(QCoreApplication.translate("Widget", u"<html><head/><body><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;\"><span style=\" font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;\">Writing Language </span></pre><p><br/></p></body></html>", None))
#endif // QT_CONFIG(tooltip)
self.label.setText(QCoreApplication.translate("Widget", u"Writing Language", None))
self.label_14.setText(QCoreApplication.translate("Widget", u"Provider", None))
#if QT_CONFIG(tooltip)
self.label_2.setToolTip(QCoreApplication.translate("Widget", u"Target Language for Translattion", None))
#endif // QT_CONFIG(tooltip)
self.label_2.setText(QCoreApplication.translate("Widget", u"Target Language", None))
#if QT_CONFIG(tooltip)
self.checkBox_overwritepb.setToolTip(QCoreApplication.translate("Widget", u"<html><head/><body><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;\"><span style=\" font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;\">Do you want to overwrite the pasteboard with the new translated string?</span></pre></body></html>", None))
#endif // QT_CONFIG(tooltip)
self.checkBox_overwritepb.setText(QCoreApplication.translate("Widget", u"Overwrite Pasteboard", None))
self.mymemory_secret_key.setPlaceholderText(QCoreApplication.translate("Widget", u"MyMemory's secret access key", None))
#if QT_CONFIG(tooltip)
self.email_mymemory.setToolTip(QCoreApplication.translate("Widget", u"Valid email allows 50000 chars/day.", None))
Expand All @@ -889,6 +886,16 @@ def retranslateUi(self, Widget):
self.qcri_secret_key.setPlaceholderText(QCoreApplication.translate("Widget", u"QCRI's secret access key", None))
self.baidu_appid.setPlaceholderText(QCoreApplication.translate("Widget", u"Baidu Cloud App ID", None))
self.baidu_secret_key.setPlaceholderText(QCoreApplication.translate("Widget", u"QCRI's secret access key", None))
self.label_14.setText(QCoreApplication.translate("Widget", u"Provider", None))
#if QT_CONFIG(tooltip)
self.label.setToolTip(QCoreApplication.translate("Widget", u"<html><head/><body><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;\"><span style=\" font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;\">Writing Language </span></pre><p><br/></p></body></html>", None))
#endif // QT_CONFIG(tooltip)
self.label.setText(QCoreApplication.translate("Widget", u"Writing Language", None))
#if QT_CONFIG(tooltip)
self.checkBox_overwritepb.setToolTip(QCoreApplication.translate("Widget", u"<html><head/><body><pre style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:19px; background-color:#1f1f1f;\"><span style=\" font-family:'Consolas','Courier New','monospace'; font-size:14px; color:#6a9955;\">Do you want to overwrite the pasteboard with the new translated string?</span></pre></body></html>", None))
#endif // QT_CONFIG(tooltip)
self.checkBox_overwritepb.setText(QCoreApplication.translate("Widget", u"Overwrite Pasteboard", None))
self.bypass_tts_checkBox.setText(QCoreApplication.translate("Widget", u"Bypass TTS", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.TranslationSettings), QCoreApplication.translate("Widget", u"Tab 2", None))
self.label_15.setText(QCoreApplication.translate("Widget", u"Application Cache Threshold: ", None))
self.spinBox_threshold.setSuffix(QCoreApplication.translate("Widget", u" day(s)", None))
Expand Down

0 comments on commit 70fe0d7

Please sign in to comment.