# 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
import re
from gi.repository import Gtk
from fstimer.gui.util_classes import MsgDialog
from fstimer.gui.util_classes import GtkStockButton
        self.filterbtnCLEAR = GtkStockButton('clear',"Clear")
        self.filterbtnCLEAR.connect('clicked', self.filter_clear)
        self.filterbtnCLEAR.set_sensitive(False)
        filterbox.pack_start(self.filterentry, False, False, 0)
        filterbox.pack_start(self.filterbtnCLEAR, False, False, 0)
        # Now the scrolled window that contains the treeview
        regsw = Gtk.ScrolledWindow()
        regsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        regsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        regsw.add(self.treeview)
        # And a message that says if we have saved or not.
        self.regstatus = Gtk.Label(label=save_label)
        # Some boxes for all the stuff on the left
        regvbox1 = Gtk.VBox(False, 8)
        regvbox1.pack_start(filterbox, False, False, 0)
        regvbox1.pack_start(regsw, True, True, 0)
        regvbox1.pack_start(self.regstatus, False, False, 0)
        vbox1align = Gtk.Alignment.new(0, 0, 1, 1)
        vbox1align.add(regvbox1)
        # And boxes/table for the buttons on the right
        regtable = Gtk.Table(2, 1, False)
        regtable.set_row_spacings(5)
        regtable.set_col_spacings(5)
        regtable.set_border_width(5)
        btnEDIT = GtkStockButton('edit',"Edit")
        btnEDIT.connect('clicked', self.edit_clicked)
        btnREMOVE = GtkStockButton('remove',"Remove")
        btnREMOVE.connect('clicked', self.rm_clicked)
        btnNEW = GtkStockButton('new',"New")
        btnNEW.connect('clicked', self.new_clicked)

# 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/register.py
import gi
import fstimer.gui
import os
import re
from gi.repository import Gtk
from fstimer.gui.util_classes import MsgDialog
from fstimer.gui.util_classes import GtkStockButton

        self.filterbtnCLEAR = GtkStockButton('clear',"Clear")
        self.filterbtnCLEAR.connect('clicked', self.filter_clear)
        self.filterbtnCLEAR.set_sensitive(False)
        filterbox.pack_start(self.filterentry, False, False, 0)
        filterbox.pack_start(self.filterbtnCLEAR, False, False, 0)
        # Now the scrolled window that contains the treeview
        regsw = Gtk.ScrolledWindow()
        regsw.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        regsw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        regsw.add(self.treeview)
        # And a message that says if we have saved or not.
        self.regstatus = Gtk.Label(label=save_label)
        # Some boxes for all the stuff on the left
        regvbox1 = Gtk.VBox(False, 8)
        regvbox1.pack_start(filterbox, False, False, 0)
        regvbox1.pack_start(regsw, True, True, 0)
        regvbox1.pack_start(self.regstatus, False, False, 0)
        vbox1align = Gtk.Alignment.new(0, 0, 1, 1)
        vbox1align.add(regvbox1)
        # And boxes/table for the buttons on the right
        regtable = Gtk.Table(2, 1, False)
        regtable.set_row_spacings(5)
        regtable.set_col_spacings(5)
        regtable.set_border_width(5)
        btnEDIT = GtkStockButton('edit',"Edit")
        btnEDIT.connect('clicked', self.edit_clicked)
        btnREMOVE = GtkStockButton('remove',"Remove")
        btnREMOVE.connect('clicked', self.rm_clicked)
        btnNEW = GtkStockButton('new',"New")
        btnNEW.connect('clicked', self.new_clicked)

        btnSAVE = GtkStockButton('save',"Save")