# Path: fstimer/gui/util_classes.py
# class MsgDialog(Gtk.Dialog):
#     
#     def __init__(self, parent, icon_name, buttons, title, text):
#         super(MsgDialog, self).__init__(title, parent, Gtk.DialogFlags.MODAL)
#         btn_list = []
#         for i, btn_name in enumerate(buttons):
#             icon, label, signal = dialog_buttons[btn_name]
#             btn = GtkStockButton(icon, label)
#             btn.connect('clicked', self.click_response, signal)
#             btn_list.append(btn)
#         self.set_border_width(5)
#         self.set_default_size(400, 50)
#         #Load in the icon
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         msg_icon = Gtk.Image.new_from_file(fname)
#         label = Gtk.Label(label=text)
#         #And pack
#         hbox = Gtk.HBox(False, 0)
#         hbox.pack_start(msg_icon, False, False,10)
#         hbox.pack_start(label, False, False,10)
#         vbox = Gtk.VBox(False, 0)
#         vbox.pack_start(hbox, True, True, 15)
#         # Pack in all of the buttons
#         hbox_btns = Gtk.HBox(False, 0)
#         align = Gtk.Alignment.new(1, 0, 1, 0)
#         hbox_btns.pack_start(align, True, True, 0)
#         for btn in btn_list:
#             hbox_btns.pack_start(btn, False, False, 5)
#         vbox.pack_start(hbox_btns, False, False, 0)
#         self.get_content_area().add(vbox)
#         self.show_all()
#     
#     def click_response(self, w, signal):
#         self.response(signal)
# 
# 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
from gi.repository import Gtk
from fstimer.gui.util_classes import MsgDialog
from fstimer.gui.util_classes import GtkStockButton
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                '../data/icon.png'))
        self.set_icon_from_file(fname)
        self.set_title('fsTimer - ' + os.path.basename(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.
        prereglabel1 = Gtk.Label('Give a unique number to each computer used for registration.\nSelect a pre-registration file, if available.')
        # Continue to the spinner
        preregtable = Gtk.Table(3, 2, False)
        preregtable.set_row_spacings(5)
        preregtable.set_col_spacings(5)
        preregtable.set_border_width(10)
        regid = Gtk.Adjustment(value=1, lower=1, upper=99, step_incr=1)
        regid_btn = Gtk.SpinButton(digits=0, climb_rate=0)
        regid_btn.set_adjustment(regid)
        preregtable.attach(regid_btn, 0, 1, 0, 1)
        preregtable.attach(Gtk.Label(label="This computer's registration number"), 1, 2, 0, 1)
        preregbtnFILE = Gtk.Button('Select pre-registration')
        preregbtnFILE.connect('clicked', self.file_selected)
        preregtable.attach(preregbtnFILE, 0, 1, 2, 3)
        self.preregfilelabel = Gtk.Label(label='')
        self.preregfilelabel.set_markup('<span color="blue">No pre-registration selected.</span>')
        preregtable.attach(self.preregfilelabel, 1, 2, 2, 3)
        ## buttons
        prereghbox = Gtk.HBox(True, 0)
        preregbtnOK = GtkStockButton('ok',"OK")
        preregbtnOK.connect('clicked', self.preregister_ok_cb, regid_btn, handle_registration_cb)

# Path: fstimer/gui/util_classes.py
# class MsgDialog(Gtk.Dialog):
#     
#     def __init__(self, parent, icon_name, buttons, title, text):
#         super(MsgDialog, self).__init__(title, parent, Gtk.DialogFlags.MODAL)
#         btn_list = []
#         for i, btn_name in enumerate(buttons):
#             icon, label, signal = dialog_buttons[btn_name]
#             btn = GtkStockButton(icon, label)
#             btn.connect('clicked', self.click_response, signal)
#             btn_list.append(btn)
#         self.set_border_width(5)
#         self.set_default_size(400, 50)
#         #Load in the icon
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         msg_icon = Gtk.Image.new_from_file(fname)
#         label = Gtk.Label(label=text)
#         #And pack
#         hbox = Gtk.HBox(False, 0)
#         hbox.pack_start(msg_icon, False, False,10)
#         hbox.pack_start(label, False, False,10)
#         vbox = Gtk.VBox(False, 0)
#         vbox.pack_start(hbox, True, True, 15)
#         # Pack in all of the buttons
#         hbox_btns = Gtk.HBox(False, 0)
#         align = Gtk.Alignment.new(1, 0, 1, 0)
#         hbox_btns.pack_start(align, True, True, 0)
#         for btn in btn_list:
#             hbox_btns.pack_start(btn, False, False, 5)
#         vbox.pack_start(hbox_btns, False, False, 0)
#         self.get_content_area().add(vbox)
#         self.show_all()
#     
#     def click_response(self, w, signal):
#         self.response(signal)
# 
# 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/preregister.py
import gi
import fstimer.gui
import os
from gi.repository import Gtk
from fstimer.gui.util_classes import MsgDialog
from fstimer.gui.util_classes import GtkStockButton

            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                '../data/icon.png'))
        self.set_icon_from_file(fname)
        self.set_title('fsTimer - ' + os.path.basename(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.
        prereglabel1 = Gtk.Label('Give a unique number to each computer used for registration.\nSelect a pre-registration file, if available.')
        # Continue to the spinner
        preregtable = Gtk.Table(3, 2, False)
        preregtable.set_row_spacings(5)
        preregtable.set_col_spacings(5)
        preregtable.set_border_width(10)
        regid = Gtk.Adjustment(value=1, lower=1, upper=99, step_incr=1)
        regid_btn = Gtk.SpinButton(digits=0, climb_rate=0)
        regid_btn.set_adjustment(regid)
        preregtable.attach(regid_btn, 0, 1, 0, 1)
        preregtable.attach(Gtk.Label(label="This computer's registration number"), 1, 2, 0, 1)
        preregbtnFILE = Gtk.Button('Select pre-registration')
        preregbtnFILE.connect('clicked', self.file_selected)
        preregtable.attach(preregbtnFILE, 0, 1, 2, 3)
        self.preregfilelabel = Gtk.Label(label='')
        self.preregfilelabel.set_markup('<span color="blue">No pre-registration selected.</span>')
        preregtable.attach(self.preregfilelabel, 1, 2, 2, 3)
        ## buttons
        prereghbox = Gtk.HBox(True, 0)
        preregbtnOK = GtkStockButton('ok',"OK")
        preregbtnOK.connect('clicked', self.preregister_ok_cb, regid_btn, handle_registration_cb)

        preregbtnCANCEL = GtkStockButton('close',"Close")