# 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, csv, json
import datetime
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton
        fieldsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        fieldsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        fieldsw.add(self.fieldview)
        fieldalgn = Gtk.Alignment.new(0, 0, 1, 1)
        fieldalgn.add(fieldsw)
        # a text buffer for errors
        textbuffer2 = Gtk.TextBuffer()
        try:
            textbuffer2.create_tag("red", foreground="red")
            textbuffer2.create_tag("blue", foreground="blue")
        except TypeError:
            pass
        textview = Gtk.TextView()
        textview.set_buffer(textbuffer2)
        textview.set_editable(False)
        textview.set_cursor_visible(False)
        # hbox for the buttons
        hbox = Gtk.HBox(False, 0)
        btnCANCEL = GtkStockButton('close',"Cancel")
        btnCANCEL.connect('clicked', self.advanced_import_cancel, textbuffer1)
        btnOK = GtkStockButton('ok',"OK")
        btnOK.connect('clicked', self.advanced_import_ok, textbuffer1, textbuffer2)
        alignOK = Gtk.Alignment.new(1, 0, 0, 0)
        alignOK.add(btnOK)
        hbox.pack_start(btnCANCEL, False, True, 0)
        hbox.pack_start(alignOK, True, True, 0)
        # populate
        vbox = Gtk.VBox(False, 10)
        vbox.pack_start(toplabel, False, False, 0)
        vbox.pack_start(fieldalgn, True, True, 0)

# 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/importprereg.py
import gi
import fstimer.gui
import os, csv, json
import datetime
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton

        fieldsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        fieldsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        fieldsw.add(self.fieldview)
        fieldalgn = Gtk.Alignment.new(0, 0, 1, 1)
        fieldalgn.add(fieldsw)
        # a text buffer for errors
        textbuffer2 = Gtk.TextBuffer()
        try:
            textbuffer2.create_tag("red", foreground="red")
            textbuffer2.create_tag("blue", foreground="blue")
        except TypeError:
            pass
        textview = Gtk.TextView()
        textview.set_buffer(textbuffer2)
        textview.set_editable(False)
        textview.set_cursor_visible(False)
        # hbox for the buttons
        hbox = Gtk.HBox(False, 0)
        btnCANCEL = GtkStockButton('close',"Cancel")
        btnCANCEL.connect('clicked', self.advanced_import_cancel, textbuffer1)
        btnOK = GtkStockButton('ok',"OK")
        btnOK.connect('clicked', self.advanced_import_ok, textbuffer1, textbuffer2)
        alignOK = Gtk.Alignment.new(1, 0, 0, 0)
        alignOK.add(btnOK)
        hbox.pack_start(btnCANCEL, False, True, 0)
        hbox.pack_start(alignOK, True, True, 0)
        # populate
        vbox = Gtk.VBox(False, 10)
        vbox.pack_start(toplabel, False, False, 0)
        vbox.pack_start(fieldalgn, True, True, 0)

        vbox.pack_start(textview, False, False, 0)