# 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
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton
            if fieldsdic[field]['type'] == 'entrybox':
                self.regfieldsmodel.append([field, 'Text entry', 'max characters: '+str(fieldsdic[field]['max'])])
            elif fieldsdic[field]['type'] == 'entrybox_int':
                self.regfieldsmodel.append([field, 'Number entry', 'max characters: '+str(fieldsdic[field]['max'])])
            elif fieldsdic[field]['type'] == 'combobox':
                optstr = ''
                for opt in fieldsdic[field]['options']:
                    optstr += opt + ', '
                optstr = optstr[:-2] #drop the last ', '
                self.regfieldsmodel.append([field, 'Selection box', 'options: '+optstr])
        self.regfieldview.set_model(self.regfieldsmodel)
        selection = self.regfieldview.get_selection()
        #And put it in a scrolled window, in an alignment
        regfieldsw = Gtk.ScrolledWindow()
        regfieldsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        regfieldsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        regfieldsw.add(self.regfieldview)
        regfieldalgn = Gtk.Alignment.new(0, 0, 1, 1)
        regfieldalgn.add(regfieldsw)
        #Now we put the buttons on the side.
        vbox2 = Gtk.VBox(False, 10)
        btnUP = GtkStockButton('up',"Up")
        btnUP.connect('clicked', self.regfield_up, selection)
        vbox2.pack_start(btnUP, False, False, 0)
        btnDOWN = GtkStockButton('down',"Down")
        btnDOWN.connect('clicked', self.regfield_down, selection)
        vbox2.pack_start(btnDOWN, False, False, 0)
        btnEDIT = GtkStockButton('edit',"Edit")
        btnEDIT.connect('clicked', self.regfield_edit, selection)
        vbox2.pack_start(btnEDIT, False, False, 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/definefields.py
import gi
import fstimer.gui
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton

            if fieldsdic[field]['type'] == 'entrybox':
                self.regfieldsmodel.append([field, 'Text entry', 'max characters: '+str(fieldsdic[field]['max'])])
            elif fieldsdic[field]['type'] == 'entrybox_int':
                self.regfieldsmodel.append([field, 'Number entry', 'max characters: '+str(fieldsdic[field]['max'])])
            elif fieldsdic[field]['type'] == 'combobox':
                optstr = ''
                for opt in fieldsdic[field]['options']:
                    optstr += opt + ', '
                optstr = optstr[:-2] #drop the last ', '
                self.regfieldsmodel.append([field, 'Selection box', 'options: '+optstr])
        self.regfieldview.set_model(self.regfieldsmodel)
        selection = self.regfieldview.get_selection()
        #And put it in a scrolled window, in an alignment
        regfieldsw = Gtk.ScrolledWindow()
        regfieldsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        regfieldsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        regfieldsw.add(self.regfieldview)
        regfieldalgn = Gtk.Alignment.new(0, 0, 1, 1)
        regfieldalgn.add(regfieldsw)
        #Now we put the buttons on the side.
        vbox2 = Gtk.VBox(False, 10)
        btnUP = GtkStockButton('up',"Up")
        btnUP.connect('clicked', self.regfield_up, selection)
        vbox2.pack_start(btnUP, False, False, 0)
        btnDOWN = GtkStockButton('down',"Down")
        btnDOWN.connect('clicked', self.regfield_down, selection)
        vbox2.pack_start(btnDOWN, False, False, 0)
        btnEDIT = GtkStockButton('edit',"Edit")
        btnEDIT.connect('clicked', self.regfield_edit, selection)
        vbox2.pack_start(btnEDIT, False, False, 0)

        btnREMOVE = GtkStockButton('remove',"Remove")