From 17a19a21b63a70b38f504069c69362d755522226 Mon Sep 17 00:00:00 2001
From: Eduardo Grajeda <tatofoo@gmail.com>
Date: Fri, 2 Apr 2010 19:21:14 -0600
Subject: [PATCH] Added a checkbox in the preferences dialog that lets you choose wheter
you want to use bold text or not.
---
data/guake.schemas | 12 ++++++++++++
data/prefs.glade | 43 ++++++++++++++++++++++++++++++-------------
src/guake.py | 9 +++++++++
src/prefs.py | 9 +++++++++
4 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/data/guake.schemas b/data/guake.schemas
index 3d26c6d..4bb1851 100644
|
a
|
b
|
|
| 245 | 245 | </schema> |
| 246 | 246 | |
| 247 | 247 | <schema> |
| | 248 | <key>/schemas/apps/guake/style/font/allow_bold</key> |
| | 249 | <applyto>/apps/guake/style/font/allow_bold</applyto> |
| | 250 | <owner>guake</owner> |
| | 251 | <type>bool</type> |
| | 252 | <default>true</default> |
| | 253 | <locale name="C"> |
| | 254 | <short>Allow bold text.</short> |
| | 255 | <long>Enable or disable the bold text in the terminal.</long> |
| | 256 | </locale> |
| | 257 | </schema> |
| | 258 | |
| | 259 | <schema> |
| 248 | 260 | <key>/schemas/apps/guake/style/background/color</key> |
| 249 | 261 | <applyto>/apps/guake/style/background/color</applyto> |
| 250 | 262 | <owner>guake</owner> |
diff --git a/data/prefs.glade b/data/prefs.glade
index d7b2441..6f5e7f9 100644
|
a
|
b
|
|
| 606 | 606 | <child> |
| 607 | 607 | <widget class="GtkTable" id="table1"> |
| 608 | 608 | <property name="visible">True</property> |
| 609 | | <property name="n_rows">4</property> |
| | 609 | <property name="n_rows">5</property> |
| 610 | 610 | <property name="n_columns">2</property> |
| 611 | 611 | <property name="column_spacing">12</property> |
| 612 | 612 | <property name="row_spacing">6</property> |
| … |
… |
|
| 622 | 622 | </widget> |
| 623 | 623 | <packing> |
| 624 | 624 | <property name="right_attach">2</property> |
| | 625 | <property name="top_attach">1</property> |
| | 626 | <property name="bottom_attach">2</property> |
| 625 | 627 | <property name="x_options">GTK_FILL</property> |
| 626 | 628 | <property name="y_options"></property> |
| 627 | 629 | </packing> |
| … |
… |
|
| 634 | 636 | <property name="use_markup">True</property> |
| 635 | 637 | </widget> |
| 636 | 638 | <packing> |
| 637 | | <property name="top_attach">1</property> |
| 638 | | <property name="bottom_attach">2</property> |
| | 639 | <property name="top_attach">2</property> |
| | 640 | <property name="bottom_attach">3</property> |
| 639 | 641 | <property name="x_options">GTK_FILL</property> |
| 640 | 642 | <property name="y_options"></property> |
| 641 | 643 | </packing> |
| … |
… |
|
| 652 | 654 | <packing> |
| 653 | 655 | <property name="left_attach">1</property> |
| 654 | 656 | <property name="right_attach">2</property> |
| 655 | | <property name="top_attach">1</property> |
| 656 | | <property name="bottom_attach">2</property> |
| | 657 | <property name="top_attach">2</property> |
| | 658 | <property name="bottom_attach">3</property> |
| 657 | 659 | <property name="y_options"></property> |
| 658 | 660 | </packing> |
| 659 | 661 | </child> |
| … |
… |
|
| 665 | 667 | <property name="use_markup">True</property> |
| 666 | 668 | </widget> |
| 667 | 669 | <packing> |
| 668 | | <property name="top_attach">2</property> |
| 669 | | <property name="bottom_attach">3</property> |
| | 670 | <property name="top_attach">3</property> |
| | 671 | <property name="bottom_attach">4</property> |
| 670 | 672 | <property name="x_options">GTK_FILL</property> |
| 671 | 673 | <property name="y_options"></property> |
| 672 | 674 | </packing> |
| … |
… |
|
| 679 | 681 | <property name="use_markup">True</property> |
| 680 | 682 | </widget> |
| 681 | 683 | <packing> |
| 682 | | <property name="top_attach">3</property> |
| 683 | | <property name="bottom_attach">4</property> |
| | 684 | <property name="top_attach">4</property> |
| | 685 | <property name="bottom_attach">5</property> |
| 684 | 686 | <property name="x_options">GTK_FILL</property> |
| 685 | 687 | <property name="y_options"></property> |
| 686 | 688 | </packing> |
| … |
… |
|
| 709 | 711 | <packing> |
| 710 | 712 | <property name="left_attach">1</property> |
| 711 | 713 | <property name="right_attach">2</property> |
| 712 | | <property name="top_attach">2</property> |
| 713 | | <property name="bottom_attach">3</property> |
| | 714 | <property name="top_attach">3</property> |
| | 715 | <property name="bottom_attach">4</property> |
| 714 | 716 | <property name="y_options"></property> |
| 715 | 717 | </packing> |
| 716 | 718 | </child> |
| … |
… |
|
| 738 | 740 | <packing> |
| 739 | 741 | <property name="left_attach">1</property> |
| 740 | 742 | <property name="right_attach">2</property> |
| 741 | | <property name="top_attach">3</property> |
| 742 | | <property name="bottom_attach">4</property> |
| | 743 | <property name="top_attach">4</property> |
| | 744 | <property name="bottom_attach">5</property> |
| | 745 | <property name="y_options"></property> |
| | 746 | </packing> |
| | 747 | </child> |
| | 748 | <child> |
| | 749 | <widget class="GtkCheckButton" id="allow_bold"> |
| | 750 | <property name="label" translatable="yes">Allow bold text</property> |
| | 751 | <property name="visible">True</property> |
| | 752 | <property name="can_focus">True</property> |
| | 753 | <property name="receives_default">False</property> |
| | 754 | <property name="draw_indicator">True</property> |
| | 755 | <signal name="toggled" handler="on_allow_bold_toggled"/> |
| | 756 | </widget> |
| | 757 | <packing> |
| | 758 | <property name="right_attach">2</property> |
| | 759 | <property name="x_options">GTK_FILL</property> |
| 743 | 760 | <property name="y_options"></property> |
| 744 | 761 | </packing> |
| 745 | 762 | </child> |
diff --git a/src/guake.py b/src/guake.py
index d477c49..a825fca 100644
|
a
|
b
|
|
| 125 | 125 | notify_add(KEY('/general/scroll_output'), self.keystroke_output) |
| 126 | 126 | notify_add(KEY('/general/scroll_keystroke'), self.keystroke_toggled) |
| 127 | 127 | |
| | 128 | notify_add(KEY('/style/font/allow_bold'), self.allow_bold_toggled) |
| 128 | 129 | notify_add(KEY('/general/use_default_font'), self.default_font_toggled) |
| 129 | 130 | notify_add(KEY('/style/font/style'), self.fstyle_changed) |
| 130 | 131 | notify_add(KEY('/style/font/color'), self.fcolor_changed) |
| … |
… |
|
| 224 | 225 | for i in self.guake.term_list: |
| 225 | 226 | i.set_scroll_on_keystroke(entry.value.get_bool()) |
| 226 | 227 | |
| | 228 | def allow_bold_toggled(self, client, connection_id, entry, data): |
| | 229 | """If the gconf var allow_bold be changed, this method will |
| | 230 | be called and will enable/disable the bold text in all terminals |
| | 231 | """ |
| | 232 | for i in self.guake.term_list: |
| | 233 | i.set_allow_bold(entry.value.get_bool()) |
| | 234 | |
| 227 | 235 | def default_font_toggled(self, client, connection_id, entry, data): |
| 228 | 236 | """If the gconf var use_default_font be changed, this method |
| 229 | 237 | will be called and will change the font style to the gnome |
| … |
… |
|
| 853 | 861 | self.client.notify(KEY('/style/font/style')) |
| 854 | 862 | self.client.notify(KEY('/style/font/color')) |
| 855 | 863 | self.client.notify(KEY('/style/font/palette')) |
| | 864 | self.client.notify(KEY('/style/font/allow_bold')) |
| 856 | 865 | self.client.notify(KEY('/style/background/color')) |
| 857 | 866 | self.client.notify(KEY('/style/background/image')) |
| 858 | 867 | self.client.notify(KEY('/style/background/transparency')) |
diff --git a/src/prefs.py b/src/prefs.py
index b0a69bf..d50acac 100644
|
a
|
b
|
|
| 206 | 206 | |
| 207 | 207 | # appearance tab |
| 208 | 208 | |
| | 209 | def on_allow_bold_toggled(self, chk): |
| | 210 | """Changes the activity of allow_bold in gconf |
| | 211 | """ |
| | 212 | self.client.set_bool(KEY('/style/font/allow_bold'), chk.get_active()) |
| | 213 | |
| 209 | 214 | def on_use_default_font_toggled(self, chk): |
| 210 | 215 | """Changes the activity of use_default_font in gconf |
| 211 | 216 | """ |
| … |
… |
|
| 492 | 497 | value = self.client.get_bool(KEY('/general/scroll_keystroke')) |
| 493 | 498 | self.get_widget('scroll_keystroke').set_active(value) |
| 494 | 499 | |
| | 500 | # allow bold |
| | 501 | value = self.client.get_bool(KEY('/style/font/allow_bold')) |
| | 502 | self.get_widget('allow_bold').set_active(value) |
| | 503 | |
| 495 | 504 | # default font |
| 496 | 505 | value = self.client.get_bool(KEY('/general/use_default_font')) |
| 497 | 506 | self.get_widget('use_default_font').set_active(value) |