Skip to content

Commit

Permalink
Try button does not disable after usage now
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineclark committed May 1, 2015
1 parent 4e19cc4 commit d833cae
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions kano_settings/set_wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import os
from gi.repository import Gtk, GdkPixbuf, Gdk
from .config_file import set_setting, get_setting
from kano_settings.config_file import set_setting, get_setting
from kano_profile.badges import calculate_badges
from kano_settings.config_file import username
from kano_settings.system.wallpaper import change_wallpaper
Expand Down Expand Up @@ -62,19 +62,19 @@ def adjust_size_of_sw(self):

# This is the callback linked to the right button
def apply_changes(self, button, event):
self.set_wallpaper(button, event)

if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
self.update_config()

self.set_wallpaper(button, event)
self.table.unselect_all()
self.right_button.set_sensitive(False)

# This is the callback linked to the left button
def set_wallpaper(self, button, event):
if not hasattr(event, 'keyval') or event.keyval == Gdk.KEY_Return:
image_name = self.get_selected()
self.set_wallpaper_by_image_name(image_name)
self.table.unselect_all()
self.left_button.set_sensitive(False)
self.right_button.set_sensitive(False)

def reset_wallpaper(self):
image_name = get_setting('Wallpaper')
Expand Down Expand Up @@ -267,9 +267,12 @@ def apply_changes(self, button, event):


if __name__ == "__main__":
win = Gtk.Window()
wallpaper = FirstBootSetWallpaper()
from kano.gtk3.application_window import ApplicationWindow

win = ApplicationWindow("blah", 10, 10)
wallpaper = FirstBootSetWallpaper(win)

win.connect('delete-event', Gtk.main_quit)
win.add(wallpaper)
win.show_all()

Gtk.main()

0 comments on commit d833cae

Please sign in to comment.