Log management ok
This commit is contained in:
parent
099a07b08b
commit
62681cc80f
|
|
@ -44,14 +44,18 @@ class Logs_Management(Widget):
|
||||||
|
|
||||||
def adjust_column_widths(self):
|
def adjust_column_widths(self):
|
||||||
"""Adjust the widths of columns to fit their content."""
|
"""Adjust the widths of columns to fit their content."""
|
||||||
# Assuming self.crud has an attribute 'table' that is a QTableWidget or QTableView
|
# Ensure that Crud has db_tw which is a QTableWidget
|
||||||
if hasattr(self.crud, 'table') and isinstance(self.crud.table, (QTableWidget,)):
|
if hasattr(self.crud, 'db_tw') and isinstance(self.crud.db_tw, QTableWidget):
|
||||||
self.crud.table.resizeColumnsToContents()
|
# Optionally, resize all columns to fit their contents initially
|
||||||
|
self.crud.db_tw.resizeColumnsToContents()
|
||||||
|
|
||||||
|
# Set a specific column width for columns; for example, set 'Info' column
|
||||||
|
for column in range(self.crud.db_tw.columnCount()):
|
||||||
|
self.crud.db_tw.setColumnWidth(column, 200) # Set width to 300 pixels
|
||||||
|
|
||||||
def row_filter(self, row, row_number, crud):
|
def row_filter(self, row, row_number, crud):
|
||||||
try:
|
try:
|
||||||
if row["info_type"] != "Download":
|
|
||||||
return False, None, False
|
|
||||||
|
|
||||||
log_entry = log.generate(
|
log_entry = log.generate(
|
||||||
id=row["id"],
|
id=row["id"],
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Logs_Management</class>
|
<class>Users_Management</class>
|
||||||
<widget class="QWidget" name="Users_Management">
|
<widget class="QWidget" name="Users_Management">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::WindowModal</enum>
|
||||||
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user