Added custom search engine input #2088 - #2134
Conversation
Davidy22
left a comment
There was a problem hiding this comment.
Works great and mostly looks good, just one spot that could probably be adjusted for safety
|
|
||
| selected = self.settings.general.get_int("search-engine") | ||
| # if custom search is selected, get the engine from the 'custom-search-engine' setting | ||
| if selected == 4: |
There was a problem hiding this comment.
The check for the custom option should be checking to see if it's the last index. Hardcoding to 4 can generate unexpected bugs if the list of preset search engines changes length in the future.
| custom_search.set_text(self.settings.general.get_string("custom-search-engine")) | ||
| self.get_widget("search_engine_select").set_active(value) | ||
| # if 'Custom' is selected make the search engine input editable | ||
| if value == 4: |
|
I can't find anyway to get the length of the ComboBox. Do you know of a method to do that? |
|
You can query the length of a combobox if you already have a pointer to it, but to my knowledge it's a bit ugly getting that when the combobox is nestled deep in a glade layout because there's no get element by id equivalent, but we also have the |
… Neeva search engine
|
Alright that's what I was thinking. Thanks! |
Added input on the general menu to add a custom search engine.