Ticket #10: 0001-Renamed-window_size-property-to-window_height.patch

File 0001-Renamed-window_size-property-to-window_height.patch, 6.0 KB (added by astratto, 3 years ago)

A patch to rename window_size to window_width

  • data/guake.schemas

    From c44dd8f2fcb2581cb5739c424d5cc01c15affb44 Mon Sep 17 00:00:00 2001
    From: Stefano Tortarolo <stefano.tortarolo@gmail.com>
    Date: Mon, 20 Jul 2009 11:45:49 +0200
    Subject: [PATCH 1/3] Renamed window_size property to window_height
    
    ---
     data/guake.schemas |    4 ++--
     data/prefs.glade   |    4 ++--
     src/guake.py       |   12 ++++++------
     src/prefs.py       |   10 +++++-----
     4 files changed, 15 insertions(+), 15 deletions(-)
    
    diff --git a/data/guake.schemas b/data/guake.schemas
    index dd6065f..fb25663 100644
    a b  
    9393        </schema> 
    9494 
    9595        <schema> 
    96             <key>/schemas/apps/guake/general/window_size</key> 
    97             <applyto>/apps/guake/general/window_size</applyto> 
     96            <key>/schemas/apps/guake/general/window_height</key> 
     97            <applyto>/apps/guake/general/window_height</applyto> 
    9898            <owner>guake</owner> 
    9999            <type>int</type> 
    100100            <default>50</default> 
  • data/prefs.glade

    diff --git a/data/prefs.glade b/data/prefs.glade
    index 0c79e81..31f348d 100644
    a b  
    319319                            <property name="visible">True</property> 
    320320                            <property name="left_padding">12</property> 
    321321                            <child> 
    322                               <widget class="GtkHScale" id="window_size"> 
     322                              <widget class="GtkHScale" id="window_height"> 
    323323                                <property name="visible">True</property> 
    324324                                <property name="can_focus">True</property> 
    325325                                <property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property> 
     
    327327                                <property name="digits">0</property> 
    328328                                <property name="draw_value">False</property> 
    329329                                <property name="value_pos">GTK_POS_RIGHT</property> 
    330                                 <signal name="value_changed" handler="on_window_size_value_changed"/> 
     330                                <signal name="value_changed" handler="on_window_height_value_changed"/> 
    331331                              </widget> 
    332332                            </child> 
    333333                          </widget> 
  • src/guake.py

    diff --git a/src/guake.py b/src/guake.py
    index 4554a33..e9917fd 100644
    a b  
    9595        notify_add(KEY('/general/use_trayicon'), self.trayicon_toggled) 
    9696        notify_add(KEY('/general/window_ontop'), self.ontop_toggled) 
    9797        notify_add(KEY('/general/window_tabbar'), self.tabbar_toggled) 
    98         notify_add(KEY('/general/window_size'), self.size_changed) 
     98        notify_add(KEY('/general/window_height'), self.size_changed) 
    9999 
    100100        notify_add(KEY('/general/use_scrollbar'), self.scrollbar_toggled) 
    101101        notify_add(KEY('/general/history_size'), self.history_size_changed) 
     
    145145            self.guake.toolbar.hide() 
    146146 
    147147    def size_changed(self, client, connection_id, entry, data): 
    148         """If the gconf var window_size be changed, this method will 
     148        """If the gconf var window_height be changed, this method will 
    149149        be called and will call the resize function in guake. 
    150150        """ 
    151151        window_rect = self.guake.get_final_window_rect() 
     
    621621        if percent < 1: 
    622622            percent = 1 
    623623 
    624         self.client.set_int(KEY('/general/window_size'), int(percent)) 
     624        self.client.set_int(KEY('/general/window_height'), int(percent)) 
    625625 
    626626    def on_window_losefocus(self, window, event): 
    627627        """Hides terminal main window when it loses the focus and if 
     
    738738 
    739739    def get_final_window_rect(self): 
    740740        """Gets the final size of the main window of guake. The height 
    741         is just the window_size property. But width is calculated as 
     741        is just the window_height property. But width is calculated as 
    742742        100% of the screen and tested against the monitor geometry 
    743743        width. 
    744744        """ 
    745745        screen = self.window.get_screen() 
    746         height = self.client.get_int(KEY('/general/window_size')) 
     746        height = self.client.get_int(KEY('/general/window_height')) 
    747747 
    748748        # get the rectangle just from the first/default monitor in the 
    749749        # future we might create a field to select which monitor you 
     
    761761        self.client.notify(KEY('/general/use_trayicon')) 
    762762        self.client.notify(KEY('/general/window_tabbar')) 
    763763        self.client.notify(KEY('/general/window_ontop')) 
    764         self.client.notify(KEY('/general/window_size')) 
     764        self.client.notify(KEY('/general/window_height')) 
    765765        self.client.notify(KEY('/general/use_scrollbar')) 
    766766        self.client.notify(KEY('/general/history_size')) 
    767767        self.client.notify(KEY('/general/show_resizer')) 
  • src/prefs.py

    diff --git a/src/prefs.py b/src/prefs.py
    index 01d15e4..552fb6c 100644
    a b  
    138138        """ 
    139139        self.client.set_bool(KEY('/general/window_tabbar'), chk.get_active()) 
    140140 
    141     def on_window_size_value_changed(self, hscale): 
    142         """Changes the value of window_size in gconf 
     141    def on_window_height_value_changed(self, hscale): 
     142        """Changes the value of window_height in gconf 
    143143        """ 
    144144        val = hscale.get_value() 
    145         self.client.set_int(KEY('/general/window_size'), int(val)) 
     145        self.client.set_int(KEY('/general/window_height'), int(val)) 
    146146 
    147147    # scrolling tab 
    148148 
     
    398398        self.get_widget('window_tabbar').set_active(value) 
    399399 
    400400        # size 
    401         value = float(self.client.get_int(KEY('/general/window_size'))) 
    402         self.get_widget('window_size').set_value(value) 
     401        value = float(self.client.get_int(KEY('/general/window_height'))) 
     402        self.get_widget('window_height').set_value(value) 
    403403 
    404404        # scrollbar 
    405405        value = self.client.get_bool(KEY('/general/use_scrollbar'))