# Path: fstimer/gui/util_classes.py
# class GtkStockButton(Gtk.Button):
#     
#     def __init__(self, icon_name, label_text):
#         #Init a regular Gtk.Button
#         Gtk.Button.__init__(self)
#         #Add the icon and the label.
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         btnIcon = Gtk.Image.new_from_file(fname)
#         btnLabel = Gtk.Label(label_text+' ')
#         #pack 'em into an HBox
#         btnHbox = Gtk.HBox(False, 0)
#         btnHbox.pack_start(btnIcon, False, False, 0)
#         btnHbox.pack_start(btnLabel, True, True, 0)
#         self.add(btnHbox)
#         return


import gi
import fstimer.gui
import os, json
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton
        fname = os.path.abspath(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                '../data/icon.png'))
        self.set_icon_from_file(fname)
        self.set_title('fsTimer - Project '+os.path.basename(self.path))
        self.set_position(Gtk.WindowPosition.CENTER)
        self.connect('delete_event', lambda b, jnk: self.hide())
        self.set_border_width(10)
        # Start with some intro text.
        btnFILE = Gtk.Button('Choose file')
        btnFILE.connect('clicked', self.choose_timingdict)
        self.pretimefilelabel = Gtk.Label(label='')
        self.pretimefilelabel.set_markup('<span color="blue">Select a timing dictionary.</span>')
        self.entry1 = Gtk.Entry()
        self.entry1.set_max_length(6)
        self.entry1.set_text('0')
        label2 = Gtk.Label('Specify a "pass" ID, not assigned to any racer')
        self.timebtncombobox = Gtk.ComboBoxText()
        self.timebtnlist = [' ', '.', '/']
        timebtndescr = ['Spacebar (" ")', 'Period (".")', 'Forward slash ("/")']
        for descr in timebtndescr:
          self.timebtncombobox.append_text(descr)
        self.timebtncombobox.set_active(0)
        label3 = Gtk.Label(label='Specify the key for marking times. It must not be in any of the IDs.')
        hbox3 = Gtk.HBox(False, 10)
        hbox3.pack_start(self.timebtncombobox, False, False, 8)
        hbox3.pack_start(label3, False, False, 8)
        btnCANCEL = GtkStockButton('close',"Close")
        btnCANCEL.connect('clicked', lambda b: self.hide())

# Path: fstimer/gui/util_classes.py
# class GtkStockButton(Gtk.Button):
#     
#     def __init__(self, icon_name, label_text):
#         #Init a regular Gtk.Button
#         Gtk.Button.__init__(self)
#         #Add the icon and the label.
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         btnIcon = Gtk.Image.new_from_file(fname)
#         btnLabel = Gtk.Label(label_text+' ')
#         #pack 'em into an HBox
#         btnHbox = Gtk.HBox(False, 0)
#         btnHbox.pack_start(btnIcon, False, False, 0)
#         btnHbox.pack_start(btnLabel, True, True, 0)
#         self.add(btnHbox)
#         return


# Path: fstimer/gui/pretime.py
import gi
import fstimer.gui
import os, json
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton

        fname = os.path.abspath(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                '../data/icon.png'))
        self.set_icon_from_file(fname)
        self.set_title('fsTimer - Project '+os.path.basename(self.path))
        self.set_position(Gtk.WindowPosition.CENTER)
        self.connect('delete_event', lambda b, jnk: self.hide())
        self.set_border_width(10)
        # Start with some intro text.
        btnFILE = Gtk.Button('Choose file')
        btnFILE.connect('clicked', self.choose_timingdict)
        self.pretimefilelabel = Gtk.Label(label='')
        self.pretimefilelabel.set_markup('<span color="blue">Select a timing dictionary.</span>')
        self.entry1 = Gtk.Entry()
        self.entry1.set_max_length(6)
        self.entry1.set_text('0')
        label2 = Gtk.Label('Specify a "pass" ID, not assigned to any racer')
        self.timebtncombobox = Gtk.ComboBoxText()
        self.timebtnlist = [' ', '.', '/']
        timebtndescr = ['Spacebar (" ")', 'Period (".")', 'Forward slash ("/")']
        for descr in timebtndescr:
          self.timebtncombobox.append_text(descr)
        self.timebtncombobox.set_active(0)
        label3 = Gtk.Label(label='Specify the key for marking times. It must not be in any of the IDs.')
        hbox3 = Gtk.HBox(False, 10)
        hbox3.pack_start(self.timebtncombobox, False, False, 8)
        hbox3.pack_start(label3, False, False, 8)
        btnCANCEL = GtkStockButton('close',"Close")
        btnCANCEL.connect('clicked', lambda b: self.hide())

        pretimebtnOK = GtkStockButton('ok',"OK")