Ticket #208: 0001-Added-a-checkbox-in-the-preferences-dialog-that-lets.patch

File 0001-Added-a-checkbox-in-the-preferences-dialog-that-lets.patch, 10.4 KB (added by tatofoo, 2 years ago)
  • data/guake.schemas

    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  
    245245        </schema> 
    246246 
    247247        <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> 
    248260            <key>/schemas/apps/guake/style/background/color</key> 
    249261            <applyto>/apps/guake/style/background/color</applyto> 
    250262            <owner>guake</owner> 
  • data/prefs.glade

    diff --git a/data/prefs.glade b/data/prefs.glade
    index d7b2441..6f5e7f9 100644
    a b  
    606606                            <child> 
    607607                              <widget class="GtkTable" id="table1"> 
    608608                                <property name="visible">True</property> 
    609                                 <property name="n_rows">4</property> 
     609                                <property name="n_rows">5</property> 
    610610                                <property name="n_columns">2</property> 
    611611                                <property name="column_spacing">12</property> 
    612612                                <property name="row_spacing">6</property> 
     
    622622                                  </widget> 
    623623                                  <packing> 
    624624                                    <property name="right_attach">2</property> 
     625                                    <property name="top_attach">1</property> 
     626                                    <property name="bottom_attach">2</property> 
    625627                                    <property name="x_options">GTK_FILL</property> 
    626628                                    <property name="y_options"></property> 
    627629                                  </packing> 
     
    634636                                    <property name="use_markup">True</property> 
    635637                                  </widget> 
    636638                                  <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> 
    639641                                    <property name="x_options">GTK_FILL</property> 
    640642                                    <property name="y_options"></property> 
    641643                                  </packing> 
     
    652654                                  <packing> 
    653655                                    <property name="left_attach">1</property> 
    654656                                    <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> 
    657659                                    <property name="y_options"></property> 
    658660                                  </packing> 
    659661                                </child> 
     
    665667                                    <property name="use_markup">True</property> 
    666668                                  </widget> 
    667669                                  <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> 
    670672                                    <property name="x_options">GTK_FILL</property> 
    671673                                    <property name="y_options"></property> 
    672674                                  </packing> 
     
    679681                                    <property name="use_markup">True</property> 
    680682                                  </widget> 
    681683                                  <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> 
    684686                                    <property name="x_options">GTK_FILL</property> 
    685687                                    <property name="y_options"></property> 
    686688                                  </packing> 
     
    709711                                  <packing> 
    710712                                    <property name="left_attach">1</property> 
    711713                                    <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> 
    714716                                    <property name="y_options"></property> 
    715717                                  </packing> 
    716718                                </child> 
     
    738740                                  <packing> 
    739741                                    <property name="left_attach">1</property> 
    740742                                    <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> 
    743760                                    <property name="y_options"></property> 
    744761                                  </packing> 
    745762                                </child> 
  • src/guake.py

    diff --git a/src/guake.py b/src/guake.py
    index d477c49..a825fca 100644
    a b  
    125125        notify_add(KEY('/general/scroll_output'), self.keystroke_output) 
    126126        notify_add(KEY('/general/scroll_keystroke'), self.keystroke_toggled) 
    127127 
     128        notify_add(KEY('/style/font/allow_bold'), self.allow_bold_toggled) 
    128129        notify_add(KEY('/general/use_default_font'), self.default_font_toggled) 
    129130        notify_add(KEY('/style/font/style'), self.fstyle_changed) 
    130131        notify_add(KEY('/style/font/color'), self.fcolor_changed) 
     
    224225        for i in self.guake.term_list: 
    225226            i.set_scroll_on_keystroke(entry.value.get_bool()) 
    226227 
     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 
    227235    def default_font_toggled(self, client, connection_id, entry, data): 
    228236        """If the gconf var use_default_font be changed, this method 
    229237        will be called and will change the font style to the gnome 
     
    853861        self.client.notify(KEY('/style/font/style')) 
    854862        self.client.notify(KEY('/style/font/color')) 
    855863        self.client.notify(KEY('/style/font/palette')) 
     864        self.client.notify(KEY('/style/font/allow_bold')) 
    856865        self.client.notify(KEY('/style/background/color')) 
    857866        self.client.notify(KEY('/style/background/image')) 
    858867        self.client.notify(KEY('/style/background/transparency')) 
  • src/prefs.py

    diff --git a/src/prefs.py b/src/prefs.py
    index b0a69bf..d50acac 100644
    a b  
    206206 
    207207    # appearance tab 
    208208 
     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 
    209214    def on_use_default_font_toggled(self, chk): 
    210215        """Changes the activity of use_default_font in gconf 
    211216        """ 
     
    492497        value = self.client.get_bool(KEY('/general/scroll_keystroke')) 
    493498        self.get_widget('scroll_keystroke').set_active(value) 
    494499 
     500        # allow bold 
     501        value = self.client.get_bool(KEY('/style/font/allow_bold')) 
     502        self.get_widget('allow_bold').set_active(value) 
     503 
    495504        # default font 
    496505        value = self.client.get_bool(KEY('/general/use_default_font')) 
    497506        self.get_widget('use_default_font').set_active(value)