# 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
            'Division name', Gtk.CellRendererText(), text=0)
        self.divview.append_column(Columns[1])
        # The fields
        textcount = 1
        for field in fields:
            if fieldsdic[field]['type'] in ['combobox', 'entrybox_int']:
                Columns[field] = Gtk.TreeViewColumn(
                    field, Gtk.CellRendererText(), text=textcount)
                textcount += 1
                self.divview.append_column(Columns[field])
        #Now we populate the model with the default fields
        divmodelrows = {}
        for div in self.divisions:
            divmodelrow = self.get_divmodelrow(div)
            self.divmodel.append(divmodelrow)
        #Done there.
        self.divview.set_model(self.divmodel)
        selection = self.divview.get_selection()
        #And put it in a scrolled window, in an alignment
        divsw = Gtk.ScrolledWindow()
        divsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        divsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        divsw.add(self.divview)
        divalgn = Gtk.Alignment.new(0, 0, 1, 1)
        divalgn.add(divsw)
        #Now we put the buttons on the side.
        vbox2 = Gtk.VBox(False, 10)
        btnUP = GtkStockButton('up','Up')
        btnUP.connect('clicked', self.div_up, selection)
        vbox2.pack_start(btnUP, 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/definedivisions.py
import gi
import fstimer.gui
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton

            'Division name', Gtk.CellRendererText(), text=0)
        self.divview.append_column(Columns[1])
        # The fields
        textcount = 1
        for field in fields:
            if fieldsdic[field]['type'] in ['combobox', 'entrybox_int']:
                Columns[field] = Gtk.TreeViewColumn(
                    field, Gtk.CellRendererText(), text=textcount)
                textcount += 1
                self.divview.append_column(Columns[field])
        #Now we populate the model with the default fields
        divmodelrows = {}
        for div in self.divisions:
            divmodelrow = self.get_divmodelrow(div)
            self.divmodel.append(divmodelrow)
        #Done there.
        self.divview.set_model(self.divmodel)
        selection = self.divview.get_selection()
        #And put it in a scrolled window, in an alignment
        divsw = Gtk.ScrolledWindow()
        divsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        divsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        divsw.add(self.divview)
        divalgn = Gtk.Alignment.new(0, 0, 1, 1)
        divalgn.add(divsw)
        #Now we put the buttons on the side.
        vbox2 = Gtk.VBox(False, 10)
        btnUP = GtkStockButton('up','Up')
        btnUP.connect('clicked', self.div_up, selection)
        vbox2.pack_start(btnUP, False, False, 0)

        btnDOWN = GtkStockButton('down','Down')