# Path: kano/gtk3/cursor.py
# def hand_cursor(button, event):
# def arrow_cursor(button, event):
# def attach_cursor_events(button):
# 
# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_widget(widget, path):
# 
#     if not os.path.exists(path):
#         sys.exit('{} CSS file missing!'.format(path))
# 
#     provider = Gtk.CssProvider()
#     provider.load_from_path(path)
#     styleContext = widget.get_style_context()
#     styleContext.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
# 
# def apply_colours_to_widget(widget):
#     path = os.path.join(common_css_dir, "colours.css")
#     apply_styling_to_widget(widget, path)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


import os
import sys
from gi import require_version
from gi.repository import Gtk
from kano.gtk3 import cursor
from kano.gtk3.apply_styles import apply_styling_to_widget, apply_colours_to_widget
from kano.paths import common_css_dir
        if self.is_spinning:
            return

        # Keep old dimensions with box
        allocation = self.get_allocation()
        self.remove(self.internal_box)
        self.add(self.spinner)
        self.set_size_request(allocation.width, allocation.height)

        # Stops background going grey on making kano button insensitive,
        # and controls styling of spinner
        self.get_style_context().add_class("loading_kano_button")

        self.is_spinning = True
        self.show_all()
        self.spinner.start()

    # Replace content of button with original content and stop spinner spinning
    def stop_spinner(self):
        if not self.is_spinning:
            return

        self.spinner.stop()
        self.remove(self.spinner)
        self.add(self.internal_box)
        self.get_style_context().remove_class("loading_kano_button")
        self.is_spinning = False


class OrangeButton(GenericButton):

# Path: kano/gtk3/cursor.py
# def hand_cursor(button, event):
# def arrow_cursor(button, event):
# def attach_cursor_events(button):
# 
# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_widget(widget, path):
# 
#     if not os.path.exists(path):
#         sys.exit('{} CSS file missing!'.format(path))
# 
#     provider = Gtk.CssProvider()
#     provider.load_from_path(path)
#     styleContext = widget.get_style_context()
#     styleContext.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
# 
# def apply_colours_to_widget(widget):
#     path = os.path.join(common_css_dir, "colours.css")
#     apply_styling_to_widget(widget, path)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


# Path: kano/gtk3/buttons.py
import os
import sys
from gi import require_version
from gi.repository import Gtk
from kano.gtk3 import cursor
from kano.gtk3.apply_styles import apply_styling_to_widget, apply_colours_to_widget
from kano.paths import common_css_dir

        if self.is_spinning:
            return

        # Keep old dimensions with box
        allocation = self.get_allocation()
        self.remove(self.internal_box)
        self.add(self.spinner)
        self.set_size_request(allocation.width, allocation.height)

        # Stops background going grey on making kano button insensitive,
        # and controls styling of spinner
        self.get_style_context().add_class("loading_kano_button")

        self.is_spinning = True
        self.show_all()
        self.spinner.start()

    # Replace content of button with original content and stop spinner spinning
    def stop_spinner(self):
        if not self.is_spinning:
            return

        self.spinner.stop()
        self.remove(self.spinner)
        self.add(self.internal_box)
        self.get_style_context().remove_class("loading_kano_button")
        self.is_spinning = False


class OrangeButton(GenericButton):

    BUTTON_CSS = os.path.join(common_css_dir, 'small_orange_button.css')