Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 130 → Rev 131

/branches/BR-0.3/basico/data/ui/basico.ui
157,7 → 157,7
<property name="vexpand">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkToggleButton" id="tgbShowMenuView">
<object class="GtkToggleButton" id="tgbShowMenuView2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
298,7 → 298,7
</packing>
</child>
<child>
<object class="GtkBox" id="box14">
<object class="GtkBox" id="boxVisor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
305,24 → 305,12
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box33">
<object class="GtkScrolledWindow" id="scrVisor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="min_content_width">200</property>
<child>
<object class="GtkViewport" id="viewport3">
<object class="GtkViewport" id="vwpVisor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
352,7 → 340,7
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
</object>
/branches/BR-0.3/basico/gui.py
98,8 → 98,11
parent.remove(child)
parent.add(widget)
del (child)
except:
except IndexError:
parent.add(widget)
except Exception as error:
self.print_traceback()
 
widget.show_all()
 
 
/branches/BR-0.3/basico/sapnoteview.py
106,7 → 106,7
 
# Component key
self.renderer_compkey = Gtk.CellRendererText()
self.renderer_compkey.set_property('background', 'Lemon Chiffon')
#~ self.renderer_compkey.set_property('background', 'Lemon Chiffon')
self.column_component = Gtk.TreeViewColumn('SAP Notes', self.renderer_compkey, markup=3)
self.column_component.set_visible(True)
self.column_component.set_sizing(Gtk.TreeViewColumnSizing.AUTOSIZE)
/branches/BR-0.3/basico/sapnoteviewrow.py
28,9 → 28,9
def __init__(self, app, sid):
Gtk.HBox.__init__(self)
self.app = app
#~ LOG_FILE = self.app.get_file('LOG')
#~ LOG_NAME = self.__class__.__name__
#~ self.log = get_logger(__name__, '/tmp/basico.log')
LOG_FILE = self.app.get_file('LOG')
LOG_NAME = self.__class__.__name__
self.log = get_logger(LOG_NAME, LOG_FILE)
self.get_services()
self.setup_row(sid)
 
61,6 → 61,11
toggled = visor.get_toggled()
bag = visor.get_bag()
lblSelectedNotes.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
 
reveal = self.revealer.get_reveal_child()
self.revealer.set_reveal_child(not reveal)
self.revealer.set_visible(True)
 
#~ self.log.debug("Toggled rows: %d" % len(toggled))
 
 
82,15 → 87,21
def setup_row(self, sid):
self.sid = sid
sapnote = self.get_node_sapnote(sid)
vbox = Gtk.VBox()
hboxup = Gtk.HBox()
hboxdown = Gtk.HBox()
 
self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
#~ self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
self.set_hexpand(True)
hboxup.set_hexpand(True)
hboxdown.set_hexpand(True)
vbox.set_vexpand(False)
 
# row items widgets
# CHECKBOX BUTTON
self.checkbox = Gtk.CheckButton()
self.checkbox.connect('toggled', self.toggle_checkbox)
self.pack_start(self.checkbox, False, False, 6)
hboxup.pack_start(self.checkbox, False, False, 6)
 
# BOOKMARK BUTTON
icon = self.im.get_pixbuf_icon('bookmark_off', 16, 16)
107,7 → 118,7
self.bookmark_image.set_from_pixbuf(icon)
self.bookmark.add(self.bookmark_image)
self.bookmark.connect('toggled', self.bookmark_switch)
self.pack_start(self.bookmark, False, False, 6)
hboxup.pack_start(self.bookmark, False, False, 0)
 
# SAP NOTE ID
btnsid = Gtk.Button()
119,7 → 130,7
title = "<b>%10s</b>" % str(int(sid))
lblsid.set_markup("%10s" % title)
btnsid.add(lblsid)
self.pack_start(btnsid, False, False, 6)
hboxup.pack_start(btnsid, False, False, 0)
 
# SAP NOTE TITLE
lblsid = Gtk.Label()
128,84 → 139,93
lblsid.set_justify(Gtk.Justification.LEFT)
lblsid.set_xalign(0.0)
lblsid.set_selectable(True)
lblsid.set_hexpand(False)
lblsid.set_hexpand(True)
lblsid.set_property('ellipsize', Pango.EllipsizeMode.MIDDLE)
lblsid.modify_font(Pango.FontDescription('Monospace 10'))
self.pack_start(lblsid, True, True, 0)
hboxup.pack_start(lblsid, True, True, 0)
 
# SAP NOTE INFO
try:
# Popover button
icon = self.im.get_pixbuf_icon('info', 16, 16)
img = Gtk.Image()
img.set_from_pixbuf(icon)
button = Gtk.Button()
button.add(img)
button.set_relief(Gtk.ReliefStyle.NONE)
button.set_alignment (0.0, 0.0)
button.set_hexpand(False)
self.popover = Gtk.Popover.new(button)
button.connect('clicked', self.cb.show_popover, self.popover)
self.pack_start(button, False, False, 6)
# Popover button
icon = self.im.get_pixbuf_icon('info', 16, 16)
img = Gtk.Image()
img.set_from_pixbuf(icon)
button = Gtk.Button()
button.add(img)
button.set_relief(Gtk.ReliefStyle.NONE)
button.set_alignment (0.0, 0.0)
button.set_hexpand(False)
self.popover = Gtk.Popover.new(button)
button.connect('clicked', self.cb.show_popover, self.popover)
hboxup.pack_start(button, False, False, 6)
 
# Popover body
box = Gtk.Box(spacing = 0, orientation="vertical")
vboxfs = Gtk.Box(spacing = 3, orientation="vertical")
# Popover body
box = Gtk.Box(spacing = 0, orientation="vertical")
vboxfs = Gtk.Box(spacing = 3, orientation="vertical")
 
# Properties
propview = Gtk.TreeView()
model = Gtk.ListStore(str, str, str)
#~ ## key
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Lemon Chiffon')
column = Gtk.TreeViewColumn('Id', renderer, text=0)
column.set_visible(False)
column.set_clickable(False)
column.set_sort_indicator(False)
propview.append_column(column)
# Properties
propview = Gtk.TreeView()
model = Gtk.ListStore(str, str, str)
#~ ## key
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Lemon Chiffon')
column = Gtk.TreeViewColumn('Id', renderer, text=0)
column.set_visible(False)
column.set_clickable(False)
column.set_sort_indicator(False)
propview.append_column(column)
 
# Property
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Light Steel Blue')
renderer.set_alignment(1.0, 0.5)
column = Gtk.TreeViewColumn('Property', renderer, markup=1)
column.set_visible(True)
column.set_expand(False)
column.set_clickable(False)
#~ column.set_sort_indicator(True)
propview.append_column(column)
# Property
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Light Steel Blue')
renderer.set_alignment(1.0, 0.5)
column = Gtk.TreeViewColumn('Property', renderer, markup=1)
column.set_visible(True)
column.set_expand(False)
column.set_clickable(False)
#~ column.set_sort_indicator(True)
propview.append_column(column)
 
# Value
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'White Smoke')
renderer.set_alignment(0.0, 0.5)
column = Gtk.TreeViewColumn('Value', renderer, markup=2)
column.set_visible(True)
column.set_expand(True)
column.set_clickable(True)
#~ column.set_sort_indicator(True)
propview.append_column(column)
propview.show_all()
# Value
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'White Smoke')
renderer.set_alignment(0.0, 0.5)
column = Gtk.TreeViewColumn('Value', renderer, markup=2)
column.set_visible(True)
column.set_expand(True)
column.set_clickable(True)
#~ column.set_sort_indicator(True)
propview.append_column(column)
propview.show_all()
 
propview.set_headers_visible(True)
propview.set_enable_search(False)
propview.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
#~ propview.set_search_column(2)
#~ trvprops.connect('row-activated', self.double_click)
selection = propview.get_selection()
selection.set_mode(Gtk.SelectionMode.SINGLE)
propview.set_headers_visible(True)
propview.set_enable_search(False)
propview.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
#~ propview.set_search_column(2)
#~ trvprops.connect('row-activated', self.double_click)
selection = propview.get_selection()
selection.set_mode(Gtk.SelectionMode.SINGLE)
 
for prop in ["id", "title", "componentkey", "componenttxt", "category", "priority", "type", "language", "releaseon", "version", "feedupdate"]:
model.append([prop, "<b>%s</b>" % prop.capitalize(), "%s" % sapnote[prop]])
for prop in ["id", "title", "componentkey", "componenttxt", "category", "priority", "type", "language", "releaseon", "version", "feedupdate"]:
model.append([prop, "<b>%s</b>" % prop.capitalize(), "%s" % sapnote[prop]])
 
propview.set_model(model)
vboxfs.pack_start(propview, False, False, 0)
box.add(vboxfs)
self.popover.add(box)
except Exception as error:
raise
propview.set_model(model)
vboxfs.pack_start(propview, False, False, 0)
box.add(vboxfs)
self.popover.add(box)
 
#VBox down
self.revealer = Gtk.Revealer()
label = Gtk.Label("Label in a Revealer")
self.revealer.add(label)
self.revealer.set_reveal_child(False)
self.revealer.set_visible(False)
hboxdown.pack_start(self.revealer, False, False, 0)
 
vbox.pack_start(hboxup, True, True, 0)
vbox.pack_start(hboxdown, True, True, 0)
self.pack_start(vbox, True, True, 0)
self.show_all()
#~ self.log.debug("Adios")
 
#~ self.bookmark.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION)
 
/branches/BR-0.3/basico/sapnoteviewvisor.py
54,6 → 54,10
def prepare(self):
self.set_hexpand(True)
self.set_property('fill', True)
self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
for widget_name in ['boxVisor', 'scrVisor', 'vwpVisor']:
widget = self.gui.get_widget(widget_name)
widget.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
 
 
def get_node_sapnote(self, sid):
90,7 → 94,7
 
# row widget
row = Gtk.HBox()
#~ row.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("Gold"))
row.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("Gold"))
row.set_hexpand(True)
 
# row items widgets
164,8 → 168,9
 
container.pack_start(row, False, False, 0)
container.pack_start(infobox, False, False, 0)
container.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("Gray"))
 
#~ container.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("Red"))
 
return container
 
 
233,8 → 238,8
row = SAPNoteViewRow(self.app, sid)
flowbox.add(row)
 
lblcount = self.gui.get_widget("lblSAPNoteViewCount")
self.log.debug("lblcount: %s (%s)"% (str(lblcount), str(type(lblcount))))
#~ lblcount = self.gui.get_widget("lblSAPNoteViewCount")
#~ self.log.debug("lblcount: %s (%s)"% (str(lblcount), str(type(lblcount))))
#~ lblcount.set_markup("<span size=\"30000\">%d</span>" % len(bag))
self.gui.swap_widget(self, flowbox)
 
/branches/BR-0.3/basico/window.py
107,6 → 107,11
rhbox = Gtk.HBox() # Right side of title bar
 
# Left side titlebar
button = self.gui.add_widget('tgbShowMenuView', Gtk.ToggleButton())
icon = self.im.get_image_icon('gtk-select-color')
button.add(icon)
lhbox.pack_start(button, False, False, 3)
 
menuviews = self.gui.add_widget('mnuBtnViews', Gtk.MenuButton())
hbox = Gtk.HBox()
label = self.gui.add_widget('lblViewCurrent', Gtk.Label())