Skip to content

Commit

Permalink
v34.42 added search and search to "Bible Chat" gui
Browse files Browse the repository at this point in the history
  • Loading branch information
eliranwong committed Mar 14, 2023
1 parent c999f78 commit d28740e
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 20 deletions.
2 changes: 1 addition & 1 deletion UniqueBibleAppVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
34.41
34.42
4 changes: 4 additions & 0 deletions lang/language_de.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Neuer Chat",
"saveChat": "Chat speichern",
"printChat": "Chat drucken",
"replace": "Ersetzen",
"replaceWith": "Ersetzen durch",
"replaceAll": "Alle ersetzen",
"searchFor": "Suchen nach",
}
4 changes: 4 additions & 0 deletions lang/language_el.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Νέα συνομιλία",
"saveChat": "Αποθήκευση συνομιλίας",
"printChat": "Εκτύπωση συνομιλίας",
"replace": "Αντικατάσταση '",
"replaceWith": "Αντικατάσταση με:",
"replaceAll": "Αντικατάσταση ALL",
"searchFor": "Αναζήτηση για:",
}
4 changes: 4 additions & 0 deletions lang/language_en_GB.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "New Chat",
"saveChat": "Save Chat",
"printChat": "Print Chat",
"replace": "Replace",
"replaceWith": "Replace with",
"replaceAll": "Replace ALL",
"searchFor": "Search for",
}
4 changes: 4 additions & 0 deletions lang/language_en_US.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "New Chat",
"saveChat": "Save Chat",
"printChat": "Print Chat",
"replace": "Replace",
"replaceWith": "Replace with",
"replaceAll": "Replace ALL",
"searchFor": "Search for",
}
4 changes: 4 additions & 0 deletions lang/language_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Nuevo chat",
"saveChat": "Guardar conversación",
"printChat": "Imprimir chat",
"replace": "Sustituir",
"replaceWith": "Sustituir por",
"replaceAll": "Sustituir TODOS",
"searchFor": "Buscar",
}
4 changes: 4 additions & 0 deletions lang/language_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Nouvelle discussion",
"saveChat": "Enregistrer la discussion",
"printChat": "Imprimer la discussion",
"replace": "Remplacer",
"replaceWith": "Remplacer par",
"replaceAll": "Remplacer TOUTES",
"searchFor": "Rechercher pour",
}
4 changes: 4 additions & 0 deletions lang/language_hi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "नया चैट",
"saveChat": "चैट सहेजें",
"printChat": "प्रिंट चैट",
"replace": "बदलें",
"replaceWith": "के साथ बदलें",
"replaceAll": "सभी बदलें",
"searchFor": "ढूंढें के लिए",
}
4 changes: 4 additions & 0 deletions lang/language_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Nuova Chat",
"saveChat": "Salva Chat",
"printChat": "Conversazione Stampa",
"replace": "Sostituire",
"replaceWith": "Sostituire con",
"replaceAll": "Sostituire ALL",
"searchFor": "Ricerca per",
}
4 changes: 4 additions & 0 deletions lang/language_ja.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "新規チャット",
"saveChat": "チャットの保存",
"printChat": "チャットの印刷",
"replace": "置換",
"replaceWith": "置換",
"replaceAll": "すべて置換",
"searchFor": "検索対象",
}
4 changes: 4 additions & 0 deletions lang/language_ko.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "새 대화",
"saveChat": "대화 저장",
"printChat": "인쇄 대화",
"replace": "바꾸기",
"replaceWith": "로 바꾸기",
"replaceAll": "모두 바꾸기",
"searchFor": "검색",
}
4 changes: 4 additions & 0 deletions lang/language_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "പുതിയ ചതുരം",
"saveChat": "Chat സൂക്ഷിക്കുക",
"printChat": "Chat അച്ചടിയ്ക്കുക",
"replace": "മാറ്റുക",
"replaceWith": "പകരം മാറ്റുക",
"replaceAll": "ALL മാറ്റുക",
"searchFor": "തെരയുക",
}
4 changes: 4 additions & 0 deletions lang/language_ro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Nou Chat",
"saveChat": "Salvează Chat",
"printChat": "Print Chat",
"replace": "Înlocuiește",
"replaceWith": "Înlocuiește cu",
"replaceAll": "Înlocuiește TOATE",
"searchFor": "Caută după",
}
4 changes: 4 additions & 0 deletions lang/language_ru.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "Новый разговор",
"saveChat": "Сохранить разговор",
"printChat": "Печать чата",
"replace": "Заменить",
"replaceWith": "Заменить на",
"replaceAll": "Заменить ALL",
"searchFor": "Поиск",
}
4 changes: 4 additions & 0 deletions lang/language_zh_HANS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "新建交谈",
"saveChat": "保存交谈",
"printChat": "打印交谈",
"replace": "替换",
"replaceWith": "替换为",
"replaceAll": "替换所有",
"searchFor": "搜索",
}
4 changes: 4 additions & 0 deletions lang/language_zh_HANT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,8 @@
"newChat": "新建會談",
"saveChat": "儲存會談",
"printChat": "列印會談",
"replace": "取代",
"replaceWith": "取代為",
"replaceAll": "取代全部",
"searchFor": "搜尋",
}
3 changes: 3 additions & 0 deletions latest_changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Changes in 34.42:
* added search and search to "Bible Chat" gui

Changes in 34.41:
* Improved "Bible Chat" plugin:
* support open, create and save as database files
Expand Down
38 changes: 19 additions & 19 deletions patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1352,24 +1352,24 @@
(34.39, "folder", "marvelData/chats")
(34.39, "file", "marvelData/chats/Readme.md")
(34.40, "file", "util/LocalCliHandler.py")
(34.41, "file", "lang/language_de.py")
(34.41, "file", "lang/language_el.py")
(34.41, "file", "lang/language_es.py")
(34.41, "file", "lang/language_fr.py")
(34.41, "file", "lang/language_hi.py")
(34.41, "file", "lang/language_it.py")
(34.41, "file", "lang/language_ja.py")
(34.41, "file", "lang/language_ko.py")
(34.41, "file", "lang/language_ml.py")
(34.41, "file", "lang/language_ro.py")
(34.41, "file", "lang/language_ru.py")
(34.41, "file", "lang/language_zh_HANS.py")
(34.41, "file", "lang/language_zh_HANT.py")
(34.41, "file", "lang/language_en_GB.py")
(34.41, "file", "lang/language_en_US.py")
(34.41, "file", "gui/Worker.py")
(34.41, "file", "plugins/menu/Bible Chat.py")
(34.41, "file", "util/ConfigUtil.py")
(34.41, "file", "UniqueBibleAppVersion.txt")
(34.41, "file", "latest_changes.txt")
(34.41, "file", "patches.txt")
(34.42, "file", "lang/language_de.py")
(34.42, "file", "lang/language_el.py")
(34.42, "file", "lang/language_es.py")
(34.42, "file", "lang/language_fr.py")
(34.42, "file", "lang/language_hi.py")
(34.42, "file", "lang/language_it.py")
(34.42, "file", "lang/language_ja.py")
(34.42, "file", "lang/language_ko.py")
(34.42, "file", "lang/language_ml.py")
(34.42, "file", "lang/language_ro.py")
(34.42, "file", "lang/language_ru.py")
(34.42, "file", "lang/language_zh_HANS.py")
(34.42, "file", "lang/language_zh_HANT.py")
(34.42, "file", "lang/language_en_GB.py")
(34.42, "file", "lang/language_en_US.py")
(34.42, "file", "plugins/menu/Bible Chat.py")
(34.42, "file", "UniqueBibleAppVersion.txt")
(34.42, "file", "latest_changes.txt")
(34.42, "file", "patches.txt")
25 changes: 25 additions & 0 deletions plugins/menu/Bible Chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ def setupUI(self):
layout000.addWidget(splitter)

#widgets on the right
self.searchInput = QLineEdit()
self.searchInput.setToolTip("Note: regular expression is enabled")
self.searchInput.setClearButtonEnabled(True)
self.replaceInput = QLineEdit()
self.replaceInput.setClearButtonEnabled(True)
self.userInput = QLineEdit()
self.userInput.setPlaceholderText(config.thisTranslation["messageHere"])
self.userInput.mousePressEvent = lambda _ : self.userInput.selectAll()
Expand All @@ -270,6 +275,9 @@ def setupUI(self):
button_height = text_rect.height() + 10
self.multilineButton.setFixedSize(button_width, button_height)
sendButton = QPushButton(config.thisTranslation["send"])
searchLabel = QLabel(config.thisTranslation["searchFor"])
replaceLabel = QLabel(config.thisTranslation["replaceWith"])
searchReplaceButton = QPushButton(config.thisTranslation["replace"])
self.apiModels = QComboBox()
self.apiModels.addItems([config.thisTranslation["chat"], config.thisTranslation["image"]])
self.apiModels.setCurrentIndex(0)
Expand Down Expand Up @@ -313,6 +321,13 @@ def setupUI(self):
layout000Rt.addWidget(self.contentView)
layout000Rt.addWidget(self.progressBar)
self.progressBar.hide()
searchReplaceLayout = QHBoxLayout()
searchReplaceLayout.addWidget(searchLabel)
searchReplaceLayout.addWidget(self.searchInput)
searchReplaceLayout.addWidget(replaceLabel)
searchReplaceLayout.addWidget(self.replaceInput)
searchReplaceLayout.addWidget(searchReplaceButton)
layout000Rt.addLayout(searchReplaceLayout)
rtControlLayout = QHBoxLayout()
rtControlLayout.addWidget(apiKeyButton)
rtControlLayout.addWidget(temperatureLabel)
Expand Down Expand Up @@ -379,9 +394,19 @@ def setupUI(self):
self.apiModels.currentIndexChanged.connect(self.updateApiModel)
self.fontSize.currentIndexChanged.connect(self.setFontSize)
self.temperature.currentIndexChanged.connect(self.updateTemperature)
searchReplaceButton.clicked.connect(self.searchReplace)
self.replaceInput.returnPressed.connect(self.searchReplace)

self.setFontSize()

def searchReplace(self):
search = self.searchInput.text()
if search:
replace = self.replaceInput.text()
content = self.contentView.toPlainText()
newContent = re.sub(search, replace, content, flags=re.M)
self.contentView.setPlainText(newContent)

def multilineButtonClicked(self):
if self.userInput.isVisible():
self.userInput.hide()
Expand Down

0 comments on commit d28740e

Please sign in to comment.