Changeset d146fa2a10d3abe97ba77c21c22165e06c5e9425

Show
Ignore:
Timestamp:
06/19/08 03:24:54 (4 years ago)
Author:
Lincoln de Sousa <lincoln@…>
Children:
f594ad2997b55e779f6fcdad3cdacaba080bf9ff
Parents:
87f3ecca764cb401db1b017dfe5a319ac77788f7
git-committer:
Lincoln de Sousa <lincoln@…> (06/19/08 03:24:54)
Message:

Setting (and adding configuration) to delete and backspace
compatibility bindings

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r87f3ecc rd146fa2  
     12008-06-19  Lincoln de Sousa  <lincoln@minaslivre.org> 
     2 
     3        * data/prefs.glade: Added compatibility tab (stolen from 
     4        gnome-terminal =) 
     5 
     6        * data/guake.schemas: Added two new keys (compat_backspace, 
     7        compat_delete). 
     8 
     9        * src/guake.py (Guake, PrefsDialog): Setting delete and backspace 
     10        compatibility bindings as in gnome-terminal. Thanks so much 
     11        gnome-terminal guys) 
     12 
    1132008-06-18  Lincoln de Sousa  <lincoln@minaslivre.org> 
    214 
  • data/guake.schemas

    r87f3ecc rd146fa2  
    117117 
    118118        <schema> 
     119            <key>/schemas/apps/guake/general/compat_backspace</key> 
     120            <applyto>/apps/guake/general/compat_backspace</applyto> 
     121            <owner>guake</owner> 
     122            <type>string</type> 
     123            <default>ascii-delete</default> 
     124            <locale name="C"> 
     125                <short>Backspace Compatibility</short> 
     126                <long>Defines the behavior of backscape key.</long> 
     127            </locale> 
     128        </schema> 
     129 
     130        <schema> 
     131            <key>/schemas/apps/guake/general/compat_delete</key> 
     132            <applyto>/apps/guake/general/compat_delete</applyto> 
     133            <owner>guake</owner> 
     134            <type>string</type> 
     135            <default>delete-sequence</default> 
     136            <locale name="C"> 
     137                <short>Delete Compatibility</short> 
     138                <long>Defines the behavior of delete key.</long> 
     139            </locale> 
     140        </schema> 
     141 
     142        <schema> 
    119143            <key>/schemas/apps/guake/style/font/style</key> 
    120144            <applyto>/apps/guake/style/font/style</applyto> 
  • data/prefs.glade

    r23e5b55 rd146fa2  
    337337                                <property name="row_spacing">6</property> 
    338338                                <child> 
    339                                   <widget class="GtkImage" id="image1"> 
    340                                     <property name="visible">True</property> 
    341                                     <property name="xalign">0</property> 
    342                                     <property name="stock">gtk-missing-image</property> 
    343                                   </widget> 
    344                                 </child> 
    345                                 <child> 
    346                                   <widget class="GtkImage" id="image2"> 
    347                                     <property name="visible">True</property> 
    348                                     <property name="xalign">0</property> 
    349                                     <property name="stock">gtk-missing-image</property> 
    350                                   </widget> 
    351                                   <packing> 
    352                                     <property name="left_attach">1</property> 
    353                                     <property name="right_attach">2</property> 
     339                                  <widget class="GtkRadioButton" id="tabbottom-radiobutton"> 
     340                                    <property name="visible">True</property> 
     341                                    <property name="label" translatable="yes">Bottom</property> 
     342                                    <property name="use_underline">True</property> 
     343                                    <property name="response_id">0</property> 
     344                                    <property name="active">True</property> 
     345                                    <property name="draw_indicator">True</property> 
     346                                    <signal name="toggled" handler="on_tabbottom_radiobutton_toggled"/> 
     347                                  </widget> 
     348                                  <packing> 
     349                                    <property name="top_attach">1</property> 
     350                                    <property name="bottom_attach">2</property> 
    354351                                  </packing> 
    355352                                </child> 
     
    373370                                </child> 
    374371                                <child> 
    375                                   <widget class="GtkRadioButton" id="tabbottom-radiobutton"> 
    376                                     <property name="visible">True</property> 
    377                                     <property name="label" translatable="yes">Bottom</property> 
    378                                     <property name="use_underline">True</property> 
    379                                     <property name="response_id">0</property> 
    380                                     <property name="active">True</property> 
    381                                     <property name="draw_indicator">True</property> 
    382                                     <signal name="toggled" handler="on_tabbottom_radiobutton_toggled"/> 
    383                                   </widget> 
    384                                   <packing> 
    385                                     <property name="top_attach">1</property> 
    386                                     <property name="bottom_attach">2</property> 
    387                                   </packing> 
     372                                  <widget class="GtkImage" id="image2"> 
     373                                    <property name="visible">True</property> 
     374                                    <property name="xalign">0</property> 
     375                                    <property name="stock">gtk-missing-image</property> 
     376                                  </widget> 
     377                                  <packing> 
     378                                    <property name="left_attach">1</property> 
     379                                    <property name="right_attach">2</property> 
     380                                  </packing> 
     381                                </child> 
     382                                <child> 
     383                                  <widget class="GtkImage" id="image1"> 
     384                                    <property name="visible">True</property> 
     385                                    <property name="xalign">0</property> 
     386                                    <property name="stock">gtk-missing-image</property> 
     387                                  </widget> 
    388388                                </child> 
    389389                              </widget> 
     
    444444                                <property name="homogeneous">True</property> 
    445445                                <child> 
    446                                   <widget class="GtkColorButton" id="font-colorbutton"> 
    447                                     <property name="visible">True</property> 
    448                                     <property name="response_id">0</property> 
    449                                     <property name="title" translatable="yes">Choose some color</property> 
    450                                     <signal name="color_set" handler="on_font_colorbutton_color_set"/> 
    451                                   </widget> 
    452                                   <packing> 
    453                                     <property name="left_attach">1</property> 
    454                                     <property name="right_attach">2</property> 
    455                                     <property name="top_attach">1</property> 
    456                                     <property name="bottom_attach">2</property> 
    457                                   </packing> 
    458                                 </child> 
    459                                 <child> 
    460                                   <widget class="GtkFontButton" id="fontbutton"> 
    461                                     <property name="visible">True</property> 
    462                                     <property name="focus_on_click">False</property> 
    463                                     <property name="response_id">0</property> 
    464                                     <property name="title" translatable="yes">Choose some font</property> 
    465                                     <signal name="font_set" handler="on_fontbutton_font_set"/> 
    466                                   </widget> 
    467                                   <packing> 
    468                                     <property name="left_attach">1</property> 
    469                                     <property name="right_attach">2</property> 
    470                                   </packing> 
     446                                  <widget class="GtkLabel" id="label10"> 
     447                                    <property name="visible">True</property> 
     448                                    <property name="xalign">0</property> 
     449                                    <property name="label" translatable="yes">Style:</property> 
     450                                    <property name="use_markup">True</property> 
     451                                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
     452                                    <property name="single_line_mode">True</property> 
     453                                  </widget> 
    471454                                </child> 
    472455                                <child> 
     
    485468                                </child> 
    486469                                <child> 
    487                                   <widget class="GtkLabel" id="label10"> 
    488                                     <property name="visible">True</property> 
    489                                     <property name="xalign">0</property> 
    490                                     <property name="label" translatable="yes">Style:</property> 
    491                                     <property name="use_markup">True</property> 
    492                                     <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
    493                                     <property name="single_line_mode">True</property> 
    494                                   </widget> 
     470                                  <widget class="GtkFontButton" id="fontbutton"> 
     471                                    <property name="visible">True</property> 
     472                                    <property name="focus_on_click">False</property> 
     473                                    <property name="response_id">0</property> 
     474                                    <property name="title" translatable="yes">Choose some font</property> 
     475                                    <signal name="font_set" handler="on_fontbutton_font_set"/> 
     476                                  </widget> 
     477                                  <packing> 
     478                                    <property name="left_attach">1</property> 
     479                                    <property name="right_attach">2</property> 
     480                                  </packing> 
     481                                </child> 
     482                                <child> 
     483                                  <widget class="GtkColorButton" id="font-colorbutton"> 
     484                                    <property name="visible">True</property> 
     485                                    <property name="response_id">0</property> 
     486                                    <property name="title" translatable="yes">Choose some color</property> 
     487                                    <signal name="color_set" handler="on_font_colorbutton_color_set"/> 
     488                                  </widget> 
     489                                  <packing> 
     490                                    <property name="left_attach">1</property> 
     491                                    <property name="right_attach">2</property> 
     492                                    <property name="top_attach">1</property> 
     493                                    <property name="bottom_attach">2</property> 
     494                                  </packing> 
    495495                                </child> 
    496496                              </widget> 
     
    533533                                <property name="homogeneous">True</property> 
    534534                                <child> 
     535                                  <widget class="GtkLabel" id="label3"> 
     536                                    <property name="visible">True</property> 
     537                                    <property name="xalign">0</property> 
     538                                    <property name="label" translatable="yes">Color:</property> 
     539                                    <property name="use_markup">True</property> 
     540                                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
     541                                    <property name="single_line_mode">True</property> 
     542                                  </widget> 
     543                                </child> 
     544                                <child> 
     545                                  <widget class="GtkLabel" id="label4"> 
     546                                    <property name="visible">True</property> 
     547                                    <property name="xalign">0</property> 
     548                                    <property name="label" translatable="yes">Image:</property> 
     549                                    <property name="use_markup">True</property> 
     550                                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
     551                                    <property name="single_line_mode">True</property> 
     552                                  </widget> 
     553                                  <packing> 
     554                                    <property name="top_attach">1</property> 
     555                                    <property name="bottom_attach">2</property> 
     556                                  </packing> 
     557                                </child> 
     558                                <child> 
     559                                  <widget class="GtkLabel" id="label14"> 
     560                                    <property name="visible">True</property> 
     561                                    <property name="xalign">0</property> 
     562                                    <property name="label" translatable="yes">Desaturation:</property> 
     563                                    <property name="use_markup">True</property> 
     564                                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
     565                                    <property name="single_line_mode">True</property> 
     566                                  </widget> 
     567                                  <packing> 
     568                                    <property name="top_attach">2</property> 
     569                                    <property name="bottom_attach">3</property> 
     570                                  </packing> 
     571                                </child> 
     572                                <child> 
     573                                  <widget class="GtkLabel" id="label2"> 
     574                                    <property name="visible">True</property> 
     575                                    <property name="xalign">0</property> 
     576                                    <property name="label" translatable="yes">Background Transparent:</property> 
     577                                    <property name="use_markup">True</property> 
     578                                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
     579                                    <property name="single_line_mode">True</property> 
     580                                  </widget> 
     581                                  <packing> 
     582                                    <property name="top_attach">3</property> 
     583                                    <property name="bottom_attach">4</property> 
     584                                  </packing> 
     585                                </child> 
     586                                <child> 
     587                                  <widget class="GtkColorButton" id="bg-colorbutton"> 
     588                                    <property name="visible">True</property> 
     589                                    <property name="response_id">0</property> 
     590                                    <property name="title" translatable="yes">Choose some color</property> 
     591                                    <signal name="color_set" handler="on_bg_colorbutton_color_set"/> 
     592                                  </widget> 
     593                                  <packing> 
     594                                    <property name="left_attach">1</property> 
     595                                    <property name="right_attach">2</property> 
     596                                  </packing> 
     597                                </child> 
     598                                <child> 
     599                                  <widget class="GtkFileChooserButton" id="bgimage-filechooserbutton"> 
     600                                    <property name="visible">True</property> 
     601                                    <signal name="selection_changed" handler="on_bgimage_filechooserbutton_selection_changed"/> 
     602                                  </widget> 
     603                                  <packing> 
     604                                    <property name="left_attach">1</property> 
     605                                    <property name="right_attach">2</property> 
     606                                    <property name="top_attach">1</property> 
     607                                    <property name="bottom_attach">2</property> 
     608                                  </packing> 
     609                                </child> 
     610                                <child> 
     611                                  <widget class="GtkHScale" id="transparency-hscale"> 
     612                                    <property name="visible">True</property> 
     613                                    <property name="can_focus">True</property> 
     614                                    <property name="adjustment">0 0 100 1 10 10</property> 
     615                                    <property name="draw_value">False</property> 
     616                                    <property name="value_pos">GTK_POS_RIGHT</property> 
     617                                    <signal name="value_changed" handler="on_transparency_hscale_value_changed"/> 
     618                                  </widget> 
     619                                  <packing> 
     620                                    <property name="left_attach">1</property> 
     621                                    <property name="right_attach">2</property> 
     622                                    <property name="top_attach">2</property> 
     623                                    <property name="bottom_attach">3</property> 
     624                                  </packing> 
     625                                </child> 
     626                                <child> 
    535627                                  <widget class="GtkCheckButton" id="chk_bg_transparent"> 
    536628                                    <property name="visible">True</property> 
     
    550642                                    <property name="bottom_attach">4</property> 
    551643                                  </packing> 
    552                                 </child> 
    553                                 <child> 
    554                                   <widget class="GtkHScale" id="transparency-hscale"> 
    555                                     <property name="visible">True</property> 
    556                                     <property name="can_focus">True</property> 
    557                                     <property name="adjustment">0 0 100 1 10 10</property> 
    558                                     <property name="draw_value">False</property> 
    559                                     <property name="value_pos">GTK_POS_RIGHT</property> 
    560                                     <signal name="value_changed" handler="on_transparency_hscale_value_changed"/> 
    561                                   </widget> 
    562                                   <packing> 
    563                                     <property name="left_attach">1</property> 
    564                                     <property name="right_attach">2</property> 
    565                                     <property name="top_attach">2</property> 
    566                                     <property name="bottom_attach">3</property> 
    567                                   </packing> 
    568                                 </child> 
    569                                 <child> 
    570                                   <widget class="GtkFileChooserButton" id="bgimage-filechooserbutton"> 
    571                                     <property name="visible">True</property> 
    572                                     <signal name="selection_changed" handler="on_bgimage_filechooserbutton_selection_changed"/> 
    573                                   </widget> 
    574                                   <packing> 
    575                                     <property name="left_attach">1</property> 
    576                                     <property name="right_attach">2</property> 
    577                                     <property name="top_attach">1</property> 
    578                                     <property name="bottom_attach">2</property> 
    579                                   </packing> 
    580                                 </child> 
    581                                 <child> 
    582                                   <widget class="GtkColorButton" id="bg-colorbutton"> 
    583                                     <property name="visible">True</property> 
    584                                     <property name="response_id">0</property> 
    585                                     <property name="title" translatable="yes">Choose some color</property> 
    586                                     <signal name="color_set" handler="on_bg_colorbutton_color_set"/> 
    587                                   </widget> 
    588                                   <packing> 
    589                                     <property name="left_attach">1</property> 
    590                                     <property name="right_attach">2</property> 
    591                                   </packing> 
    592                                 </child> 
    593                                 <child> 
    594                                   <widget class="GtkLabel" id="label2"> 
    595                                     <property name="visible">True</property> 
    596                                     <property name="xalign">0</property> 
    597                                     <property name="label" translatable="yes">Background Transparent:</property> 
    598                                     <property name="use_markup">True</property> 
    599                                     <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
    600                                     <property name="single_line_mode">True</property> 
    601                                   </widget> 
    602                                   <packing> 
    603                                     <property name="top_attach">3</property> 
    604                                     <property name="bottom_attach">4</property> 
    605                                   </packing> 
    606                                 </child> 
    607                                 <child> 
    608                                   <widget class="GtkLabel" id="label14"> 
    609                                     <property name="visible">True</property> 
    610                                     <property name="xalign">0</property> 
    611                                     <property name="label" translatable="yes">Desaturation:</property> 
    612                                     <property name="use_markup">True</property> 
    613                                     <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
    614                                     <property name="single_line_mode">True</property> 
    615                                   </widget> 
    616                                   <packing> 
    617                                     <property name="top_attach">2</property> 
    618                                     <property name="bottom_attach">3</property> 
    619                                   </packing> 
    620                                 </child> 
    621                                 <child> 
    622                                   <widget class="GtkLabel" id="label4"> 
    623                                     <property name="visible">True</property> 
    624                                     <property name="xalign">0</property> 
    625                                     <property name="label" translatable="yes">Image:</property> 
    626                                     <property name="use_markup">True</property> 
    627                                     <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
    628                                     <property name="single_line_mode">True</property> 
    629                                   </widget> 
    630                                   <packing> 
    631                                     <property name="top_attach">1</property> 
    632                                     <property name="bottom_attach">2</property> 
    633                                   </packing> 
    634                                 </child> 
    635                                 <child> 
    636                                   <widget class="GtkLabel" id="label3"> 
    637                                     <property name="visible">True</property> 
    638                                     <property name="xalign">0</property> 
    639                                     <property name="label" translatable="yes">Color:</property> 
    640                                     <property name="use_markup">True</property> 
    641                                     <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> 
    642                                     <property name="single_line_mode">True</property> 
    643                                   </widget> 
    644644                                </child> 
    645645                              </widget> 
     
    714714                    <property name="type">tab</property> 
    715715                    <property name="position">2</property> 
     716                    <property name="tab_fill">False</property> 
     717                  </packing> 
     718                </child> 
     719                <child> 
     720                  <widget class="GtkFrame" id="frame3"> 
     721                    <property name="visible">True</property> 
     722                    <property name="border_width">10</property> 
     723                    <property name="label_xalign">0</property> 
     724                    <property name="shadow_type">GTK_SHADOW_NONE</property> 
     725                    <child> 
     726                      <widget class="GtkAlignment" id="alignment3"> 
     727                        <property name="visible">True</property> 
     728                        <property name="left_padding">12</property> 
     729                        <child> 
     730                          <widget class="GtkVBox" id="vbox7"> 
     731                            <property name="visible">True</property> 
     732                            <property name="spacing">6</property> 
     733                            <child> 
     734                              <widget class="GtkLabel" id="label51"> 
     735                                <property name="visible">True</property> 
     736                                <property name="xalign">0</property> 
     737                                <property name="yalign">7.4505801528346183e-09</property> 
     738                                <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; These options may cause some applications to behave incorrectly.  They are only here to allow you to work around certain applications and operating systems that expect different terminal behavior.&lt;/i&gt;&lt;/small&gt;</property> 
     739                                <property name="use_markup">True</property> 
     740                                <property name="wrap">True</property> 
     741                              </widget> 
     742                              <packing> 
     743                                <property name="expand">False</property> 
     744                              </packing> 
     745                            </child> 
     746                            <child> 
     747                              <widget class="GtkTable" id="table30"> 
     748                                <property name="visible">True</property> 
     749                                <property name="n_rows">2</property> 
     750                                <property name="n_columns">3</property> 
     751                                <property name="column_spacing">12</property> 
     752                                <property name="row_spacing">6</property> 
     753                                <child> 
     754                                  <widget class="GtkComboBox" id="delete-binding-combobox"> 
     755                                    <property name="visible">True</property> 
     756                                    <property name="items" translatable="yes">ASCII DEL 
     757Escape sequence 
     758Control-H</property> 
     759                                    <signal name="changed" handler="on_delete_binding_combobox_changed"/> 
     760                                  </widget> 
     761                                  <packing> 
     762                                    <property name="left_attach">1</property> 
     763                                    <property name="right_attach">3</property> 
     764                                    <property name="top_attach">1</property> 
     765                                    <property name="bottom_attach">2</property> 
     766                                    <property name="y_options">GTK_FILL</property> 
     767                                  </packing> 
     768                                </child> 
     769                                <child> 
     770                                  <widget class="GtkComboBox" id="backspace-binding-combobox"> 
     771                                    <property name="visible">True</property> 
     772                                    <property name="items" translatable="yes">ASCII DEL 
     773Escape sequence 
     774Control-H</property> 
     775                                    <signal name="changed" handler="on_backspace_binding_combobox_changed"/> 
     776                                  </widget> 
     777                                  <packing> 
     778                                    <property name="left_attach">1</property> 
     779                                    <property name="right_attach">3</property> 
     780                                    <property name="y_options">GTK_FILL</property> 
     781                                  </packing> 
     782                                </child> 
     783                                <child> 
     784                                  <widget class="GtkLabel" id="backspace-binding-combobox-label"> 
     785                                    <property name="visible">True</property> 
     786                                    <property name="xalign">0</property> 
     787                                    <property name="label" translatable="yes">_Backspace key generates:</property> 
     788                                    <property name="use_underline">True</property> 
     789                                    <property name="justify">GTK_JUSTIFY_CENTER</property> 
     790                                    <property name="mnemonic_widget">backspace-binding-combobox</property> 
     791                                  </widget> 
     792                                  <packing> 
     793                                    <property name="x_options">GTK_FILL</property> 
     794                                    <property name="y_options"></property> 
     795                                  </packing> 
     796                                </child> 
     797                                <child> 
     798                                  <widget class="GtkLabel" id="delete-binding-combobox-label"> 
     799                                    <property name="visible">True</property> 
     800                                    <property name="xalign">0</property> 
     801                                    <property name="label" translatable="yes">_Delete key generates:</property> 
     802                                    <property name="use_underline">True</property> 
     803                                    <property name="justify">GTK_JUSTIFY_CENTER</property> 
     804                                    <property name="mnemonic_widget">delete-binding-combobox</property> 
     805                                  </widget> 
     806                                  <packing> 
     807                                    <property name="top_attach">1</property> 
     808                                    <property name="bottom_attach">2</property> 
     809                                    <property name="x_options">GTK_FILL</property> 
     810                                    <property name="y_options"></property> 
     811                                  </packing> 
     812                                </child> 
     813                              </widget> 
     814                              <packing> 
     815                                <property name="expand">False</property> 
     816                                <property name="position">1</property> 
     817                              </packing> 
     818                            </child> 
     819                            <child> 
     820                              <widget class="GtkAlignment" id="alignment010101"> 
     821                                <property name="visible">True</property> 
     822                                <property name="xalign">1.1175900205273592e-08</property> 
     823                                <property name="xscale">0</property> 
     824                                <property name="yscale">0</property> 
     825                                <child> 
     826                                  <widget class="GtkButton" id="reset-compat-defaults-button"> 
     827                                    <property name="visible">True</property> 
     828                                    <property name="can_focus">True</property> 
     829                                    <property name="label" translatable="yes">_Reset Compatibility Options to Defaults</property> 
     830                                    <property name="use_underline">True</property> 
     831                                    <property name="response_id">0</property> 
     832                                    <signal name="clicked" handler="on_reset_compat_defaults_button_clicked"/> 
     833                                  </widget> 
     834                                </child> 
     835                              </widget> 
     836                              <packing> 
     837                                <property name="expand">False</property> 
     838                                <property name="fill">False</property> 
     839                                <property name="position">2</property> 
     840                              </packing> 
     841                            </child> 
     842                          </widget> 
     843                        </child> 
     844                      </widget> 
     845                    </child> 
     846                    <child> 
     847                      <widget class="GtkLabel" id="label5"> 
     848                        <property name="visible">True</property> 
     849                        <property name="ypad">6</property> 
     850                        <property name="label" translatable="yes">&lt;b&gt;Keyboard compatibility&lt;/b&gt;</property> 
     851                        <property name="use_markup">True</property> 
     852                      </widget> 
     853                      <packing> 
     854                        <property name="type">label_item</property> 
     855                      </packing> 
     856                    </child> 
     857                  </widget> 
     858                  <packing> 
     859                    <property name="position">3</property> 
     860                  </packing> 
     861                </child> 
     862                <child> 
     863                  <widget class="GtkLabel" id="label1"> 
     864                    <property name="visible">True</property> 
     865                    <property name="label" translatable="yes">Compatibility</property> 
     866                  </widget> 
     867                  <packing> 
     868                    <property name="type">tab</property> 
     869                    <property name="position">3</property> 
    716870                    <property name="tab_fill">False</property> 
    717871                  </packing> 
  • src/guake.py

    r316c9b7 rd146fa2  
    6666) 
    6767 
     68# translating our types to vte types 
     69 
     70ERASE_BINDINGS = {'ASCII DEL': 'ascii-delete', 
     71                  'Escape sequence': 'delete-sequence', 
     72                  'Control-H': 'ascii-backspace'} 
     73 
    6874class KeyEntry(object): 
    6975    def __init__(self, keyval, keycode, mask): 
     
    176182    def hide(self): 
    177183        self.get_widget('config-window').hide() 
    178          
     184 
     185    def reload_erase_combos(self): 
     186        # backspace erase binding 
     187        combo = self.get_widget('backspace-binding-combobox') 
     188        binding = self.client.get_string(GCONF_PATH+'general/compat_backspace') 
     189        model = combo.get_model() 
     190        bindex = ERASE_BINDINGS.values().index(binding) 
     191        for i in model: 
     192            value = model.get_value(i.iter, 0) 
     193            if ERASE_BINDINGS.keys().index(value) == bindex: 
     194                combo.set_active_iter(i.iter) 
     195 
     196        # delete erase binding 
     197        combo = self.get_widget('delete-binding-combobox') 
     198        binding = self.client.get_string(GCONF_PATH+'general/compat_delete') 
     199        model = combo.get_model() 
     200        bindex = ERASE_BINDINGS.values().index(binding) 
     201        for i in model: 
     202            value = model.get_value(i.iter, 0) 
     203            if ERASE_BINDINGS.keys().index(value) == bindex: 
     204                combo.set_active_iter(i.iter) 
     205 
    179206    def load_configs(self): 
    180207        # shells list 
     
    246273        val = self.client.get_int(GCONF_PATH+'style/background/transparency') 
    247274        self.get_widget('transparency-hscale').set_value(val) 
     275 
     276        # it's a separated method, to be reused. 
     277        self.reload_erase_combos() 
    248278 
    249279        # the terminal window can be opened and the user *must* see this window 
     
    380410                int(val)) 
    381411        self.guake.set_alpha() 
     412 
     413    def on_backspace_binding_combobox_changed(self, combo): 
     414        val = combo.get_active_text() 
     415        self.client.set_string(GCONF_PATH+'general/compat_backspace', 
     416                               ERASE_BINDINGS[val]) 
     417        self.guake.set_erasebindings() 
     418 
     419    def on_delete_binding_combobox_changed(self, combo): 
     420        val = combo.get_active_text() 
     421        self.client.set_string(GCONF_PATH+'general/compat_delete', 
     422                               ERASE_BINDINGS[val]) 
     423        self.guake.set_erasebindings() 
     424 
     425    def on_reset_compat_defaults_button_clicked(self, bnt): 
     426        # default values were defined in guake.schemas file 
     427        self.client.unset(GCONF_PATH+'general/compat_backspace') 
     428        self.client.unset(GCONF_PATH+'general/compat_delete') 
     429        self.reload_erase_combos() 
     430        self.guake.set_erasebindings() 
    382431 
    383432    def on_key_edited(self, renderer, path, keyval, mask, keycode, model): 
     
    695744        self.set_alpha() 
    696745        self.set_tabpos() 
     746        self.set_erasebindings() 
    697747 
    698748    def load_accelerators(self): 
     
    835885            self.mainframe.reorder_child(self.notebook, 1) 
    836886            self.notebook.set_tab_pos(gtk.POS_TOP) 
    837             
     887 
     888    def set_erasebindings(self): 
     889        backspace = self.client.get_string(GCONF_PATH+'general/compat_backspace') 
     890        delete = self.client.get_string(GCONF_PATH+'general/compat_delete') 
     891        for i in self.term_list: 
     892            i.set_backspace_binding(backspace) 
     893            i.set_delete_binding(delete) 
     894 
    838895    # -- callbacks -- 
    839896