[eog-plugins] fullscreenbg: Fix whitespace indentation
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog-plugins] fullscreenbg: Fix whitespace indentation
- Date: Thu, 9 Feb 2012 20:38:39 +0000 (UTC)
commit d3f03511352b805ab0843c26da8e71ba097e42c2
Author: Felix Riemann <friemann gnome org>
Date: Thu Feb 9 21:37:01 2012 +0100
fullscreenbg: Fix whitespace indentation
The plugin only used 2 whitespace chars per indentation level.
Python people seem to be settled on 4 chars instead.
plugins/fullscreenbg/fullscreenbg.py | 96 ++++++++++++++++++----------------
1 files changed, 50 insertions(+), 46 deletions(-)
---
diff --git a/plugins/fullscreenbg/fullscreenbg.py b/plugins/fullscreenbg/fullscreenbg.py
index 5aff5b6..6928921 100644
--- a/plugins/fullscreenbg/fullscreenbg.py
+++ b/plugins/fullscreenbg/fullscreenbg.py
@@ -20,60 +20,64 @@
from gi.repository import GObject, Gdk, Gio, Gtk, Eog, Peas, PeasGtk
from os.path import join
-class BackgroundChanger(GObject.Object, Eog.WindowActivatable,\
+
+class BackgroundChanger(GObject.Object, Eog.WindowActivatable, \
PeasGtk.Configurable):
- """Class implementing custom background in fullscreen mode"""
- BASE_KEY = 'org.gnome.eog.plugins.fullscreenbg'
- window = GObject.property(type=Eog.Window)
- preferences_dialog_created = False
+ """Class implementing custom background in fullscreen mode"""
+ BASE_KEY = 'org.gnome.eog.plugins.fullscreenbg'
+ window = GObject.property(type=Eog.Window)
+ preferences_dialog_created = False
- def __init__(self):
- GObject.Object.__init__(self)
- self.settings = Gio.Settings.new(self.BASE_KEY)
+ def __init__(self):
+ GObject.Object.__init__(self)
+ self.settings = Gio.Settings.new(self.BASE_KEY)
- def do_activate(self):
- self.state_handler_id = \
- self.window.connect('window-state-event', self.state_changed_cb)
+ def do_activate(self):
+ self.state_handler_id = \
+ self.window.connect('window-state-event', self.state_changed_cb)
- def do_deactivate(self):
- self.window.disconnect(self.state_handler_id)
+ def do_deactivate(self):
+ self.window.disconnect(self.state_handler_id)
- def state_changed_cb(self, window, event):
- scroll_view = self.window.get_view()
- mode = self.window.get_mode()
- if self.settings.get_boolean('use-custom'):
- color = Gdk.Color.parse(self.settings.get_string('background-color'))[1]
- else:
- color = scroll_view.get_property('background-color')
+ def state_changed_cb(self, window, event):
+ scroll_view = self.window.get_view()
+ mode = self.window.get_mode()
+ if self.settings.get_boolean('use-custom'):
+ color = Gdk.Color.parse(self.settings.get_string('background-color'))[1]
+ else:
+ color = scroll_view.get_property('background-color')
- if mode == Eog.WindowMode(Eog.WindowMode.FULLSCREEN)\
- or mode == Eog.WindowMode(Eog.WindowMode.SLIDESHOW):
- scroll_view.override_bg_color(color)
+ if mode == Eog.WindowMode(Eog.WindowMode.FULLSCREEN)\
+ or mode == Eog.WindowMode(Eog.WindowMode.SLIDESHOW):
+ scroll_view.override_bg_color(color)
- def do_create_configure_widget(self):
- # Create preference dialog
- if not self.preferences_dialog_created:
- signals = {'use_global_settings_cb': self.use_global_settings_cb,
- 'hide_colorbutton_cb': self.hide_colorbutton_cb}
- builder = Gtk.Builder()
- builder.add_from_file(join(self.plugin_info.get_data_dir(), 'preferences_dialog.ui'))
- builder.connect_signals(signals)
+ def do_create_configure_widget(self):
+ # Create preference dialog
+ if not self.preferences_dialog_created:
+ signals = {'use_global_settings_cb': self.use_global_settings_cb,
+ 'hide_colorbutton_cb': self.hide_colorbutton_cb}
+ builder = Gtk.Builder()
+ builder.add_from_file(join(self.plugin_info.get_data_dir(), \
+ 'preferences_dialog.ui'))
+ builder.connect_signals(signals)
- self.use_global_checkbutton = builder.get_object('use_global_settings_checkbutton')
- self.choose_color = builder.get_object('background_color_colorbutton')
- self.preferences_dialog = builder.get_object('preferences_box')
- # Restore values
- self.use_global_checkbutton.set_active(\
- self.settings.get_boolean('use-custom'))
- self.choose_color.set_color(\
- Gdk.Color.parse(self.settings.get_string('background-color'))[1])
- self.preferences_dialog_created = True
+ self.use_global_checkbutton = builder.get_object( \
+ 'use_global_settings_checkbutton')
+ self.choose_color = builder.get_object('background_color_colorbutton')
+ self.preferences_dialog = builder.get_object('preferences_box')
+ # Restore values
+ self.use_global_checkbutton.set_active( \
+ self.settings.get_boolean('use-custom'))
+ self.choose_color.set_color( \
+ Gdk.Color.parse(self.settings.get_string('background-color'))[1])
+ self.preferences_dialog_created = True
- return self.preferences_dialog
+ return self.preferences_dialog
- def use_global_settings_cb(self, data):
- self.settings.set_boolean('use-custom', self.use_global_checkbutton.get_active())
+ def use_global_settings_cb(self, data):
+ self.settings.set_boolean('use-custom', \
+ self.use_global_checkbutton.get_active())
- def hide_colorbutton_cb(self, data):
- self.settings.set_string('background-color',\
- self.choose_color.get_color().to_string())
+ def hide_colorbutton_cb(self, data):
+ self.settings.set_string('background-color', \
+ self.choose_color.get_color().to_string())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]