-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search engine can be set to preference #2125
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Generated with glade 3.38.2 --> | ||
<!-- Generated with glade 3.40.0 --> | ||
<interface domain="guake"> | ||
<requires lib="gtk+" version="3.18"/> | ||
<object class="GtkAdjustment" id="cell_height_scale_adjustment"> | ||
|
@@ -135,7 +135,7 @@ | |
<property name="can-focus">False</property> | ||
<property name="halign">start</property> | ||
<property name="margin-top">6</property> | ||
<property name="label" translatable="yes"><span size="18000"><b>Guake properties</b></span></property> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo introduced? |
||
<property name="label" translatable="yes"><span size="18000"><b>Guakproperties</b></span></property> | ||
<property name="use-markup">True</property> | ||
</object> | ||
<packing> | ||
|
@@ -224,7 +224,7 @@ | |
<property name="can-focus">False</property> | ||
<property name="left-padding">12</property> | ||
<child> | ||
<!-- n-columns=3 n-rows=3 --> | ||
<!-- n-columns=3 n-rows=4 --> | ||
<object class="GtkGrid"> | ||
<property name="visible">True</property> | ||
<property name="can-focus">False</property> | ||
|
@@ -299,6 +299,15 @@ | |
<child> | ||
<placeholder/> | ||
</child> | ||
<child> | ||
<placeholder/> | ||
</child> | ||
<child> | ||
<placeholder/> | ||
</child> | ||
<child> | ||
<placeholder/> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
|
@@ -689,6 +698,49 @@ | |
<property name="position">2</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkBox"> | ||
<property name="visible">True</property> | ||
<property name="can-focus">False</property> | ||
<property name="spacing">4</property> | ||
<child> | ||
<object class="GtkLabel" id="lb_search_engine"> | ||
<property name="visible">True</property> | ||
<property name="can-focus">False</property> | ||
<property name="label" translatable="yes">Search Engine: </property> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally don't want to do spacing by just adding a bunch of spaces when doing UI work. I assume you did this to make a UI element line up somewhere, but if you want to do that you should use columns. The spaces are difficult for the translators to understand and match, just strip the spaces and if you want to do a re-layout that can be another pr |
||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<object class="GtkComboBoxText" id="search_engine_select"> | ||
<property name="visible">True</property> | ||
<property name="can-focus">False</property> | ||
<property name="active">0</property> | ||
<items> | ||
<item translatable="yes">Google</item> | ||
<item translatable="yes">DuckDuckGo</item> | ||
<item translatable="yes">Bing</item> | ||
<item translatable="yes">Yandex</item> | ||
</items> | ||
<signal name="changed" handler="on_search_engine_changed" swapped="no"/> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">1</property> | ||
</packing> | ||
</child> | ||
</object> | ||
<packing> | ||
<property name="expand">False</property> | ||
<property name="fill">True</property> | ||
<property name="position">3</property> | ||
</packing> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
|
@@ -698,6 +750,9 @@ | |
<property name="position">0</property> | ||
</packing> | ||
</child> | ||
<child> | ||
<placeholder/> | ||
</child> | ||
</object> | ||
</child> | ||
<child type="tab"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,6 +296,10 @@ def on_prompt_on_close_tab_changed(self, combo): | |
"""Set the `prompt_on_close_tab' property in dconf""" | ||
self.settings.general.set_int("prompt-on-close-tab", combo.get_active()) | ||
|
||
def on_search_engine_changed(self, combo): | ||
print("VALUE: ", combo.get_active()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to use the logging functions over prints so that users can control log levels |
||
self.settings.general.set_int("search-engine", combo.get_active()) | ||
|
||
def on_gtk_theme_name_changed(self, combo): | ||
"""Set the `gtk_theme_name' property in dconf""" | ||
citer = combo.get_active_iter() | ||
|
@@ -1045,6 +1049,10 @@ def load_configs(self): | |
self.get_widget("prompt_on_close_tab").set_active(value) | ||
self.get_widget("prompt_on_quit").set_sensitive(value != 2) | ||
|
||
# search engine | ||
value = self.settings.general.get_int("search-engine") | ||
self.get_widget("search_engine_select").set_active(value) | ||
|
||
# use system theme | ||
value = self.settings.general.get_boolean("gtk-use-system-default-theme") | ||
self.get_widget("gtk_use_system_default_theme").set_active(value) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dict should probably be declared outside of this function, don't need to recreate this dict every time we open a link