Native gui: implement data lists for all modules
This commit is contained in:
+7
-1
@@ -8,10 +8,11 @@ SPDX-License-Identifier: WTFPL
|
||||
import os
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib, Gtk, Gdk
|
||||
from yms import gtkutils
|
||||
|
||||
class View:
|
||||
|
||||
def __init__(self, context, title, ui_file):
|
||||
self.context = context
|
||||
self.db = context.db
|
||||
@@ -25,6 +26,11 @@ class View:
|
||||
self.topwidget = builder.get_object("topobject")
|
||||
gtkutils.init_named_controls(self, builder)
|
||||
|
||||
def format_date(self, dateval):
|
||||
if dateval is None:
|
||||
return ''
|
||||
return dateval.strftime(self.context.datefmt)
|
||||
|
||||
def on_textview_keypress(self, widget, event):
|
||||
# Generic limit length function
|
||||
if event.state & Gdk.ModifierType.CONTROL_MASK:
|
||||
|
||||
Reference in New Issue
Block a user