# 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'


from gi import require_version
from gi.repository import Gtk, GdkPixbuf
from kano.paths import common_images_dir
import os

require_version('Gtk', '3.0')


# To make an image using the pixbuf icon, use the command below:
# image.set_from_pixbuf(self.pixbuf)


def set_from_name(name):
    icon_number = 0
    if name == "green_arrow":
        icon_number = 0
    elif name == "pale_right_arrow":
        icon_number = 1
    elif name == "dark_left_arrow":
        icon_number = 2
    elif name == "dark_right_arrow":
        icon_number = 3
    elif name == "pale_left_arrow":
        icon_number = 4
    elif name == "tick":
        icon_number = 5
    elif name == "cross":
        icon_number = 6
    elif name == "dropdown_arrow":
        icon_number = 7
    # Create main window
    filename = os.path.join(common_images_dir, "icons.png")
    pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filename, 192, 24)
    subpixbuf = pixbuf.new_subpixbuf(24 * icon_number, 0, 24, 24).add_alpha(True, 255, 255, 255)

# 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/icons.py
from gi import require_version
from gi.repository import Gtk, GdkPixbuf
from kano.paths import common_images_dir
import os


require_version('Gtk', '3.0')


# To make an image using the pixbuf icon, use the command below:
# image.set_from_pixbuf(self.pixbuf)


def set_from_name(name):
    icon_number = 0
    if name == "green_arrow":
        icon_number = 0
    elif name == "pale_right_arrow":
        icon_number = 1
    elif name == "dark_left_arrow":
        icon_number = 2
    elif name == "dark_right_arrow":
        icon_number = 3
    elif name == "pale_left_arrow":
        icon_number = 4
    elif name == "tick":
        icon_number = 5
    elif name == "cross":
        icon_number = 6
    elif name == "dropdown_arrow":
        icon_number = 7
    # Create main window
    filename = os.path.join(common_images_dir, "icons.png")
    pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filename, 192, 24)
    subpixbuf = pixbuf.new_subpixbuf(24 * icon_number, 0, 24, 24).add_alpha(True, 255, 255, 255)

    image = Gtk.Image()