2019-12-04 17:16:40 +03:00
|
|
|
import gi
|
2019-12-26 15:20:50 +03:00
|
|
|
from mods.utils import disable_widget, enable_widget
|
2019-12-04 17:16:40 +03:00
|
|
|
gi.require_version('Gtk', '3.0')
|
|
|
|
from gi.repository import Gtk, GObject, Gdk
|
2020-01-27 11:07:22 +03:00
|
|
|
from mods.db import db, Reception, Patient, ReceptionDiagnosis, ReceptionAnamnesis, ReceptionObserve
|
2019-12-26 15:20:50 +03:00
|
|
|
from mods.files import new_reception_win_file, reception_row_ui_str, reception_list_settings_win_file, open_reception_win_file, diagnosis_row_ui_str
|
2020-01-27 11:07:22 +03:00
|
|
|
from mods.files import anamnesis_row_ui_str, observe_row_ui_str
|
2019-12-12 19:47:08 +03:00
|
|
|
from mods.settings import s_get_reception_list, s_set_reception_list
|
2019-12-26 15:20:50 +03:00
|
|
|
from mods.diagnosis import create_choose_diagnosis_win, get_giagnosis
|
2020-01-27 11:07:22 +03:00
|
|
|
from mods.lists import get_listrecord, get_list_by_system_id, create_open_list_win, ANAMNEZ_LIST, OBSERVE_LIST
|
2019-12-12 19:47:08 +03:00
|
|
|
from mods.root import builder
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
2019-12-12 20:48:46 +03:00
|
|
|
def add_reception(patient_id, reception_dt):
|
|
|
|
with db.atomic():
|
|
|
|
patient = Patient.get_by_id(patient_id)
|
|
|
|
return Reception.create(patient=patient, time=reception_dt)
|
|
|
|
|
2019-12-12 19:47:08 +03:00
|
|
|
def get_reception_timelist(rec_date):
|
|
|
|
s = s_get_reception_list()
|
|
|
|
dstart = datetime(rec_date.year, rec_date.month, rec_date.day, s.day_start[0], s.day_start[1])
|
|
|
|
dend = datetime(rec_date.year, rec_date.month, rec_date.day, s.day_end[0], s.day_end[1])
|
|
|
|
work_day_minutes_total = (dend.hour - dstart.hour) * 60 + dend.minute - dstart.minute
|
|
|
|
shift_minutes_range = range(0, work_day_minutes_total, s.interval)
|
|
|
|
return [dstart + timedelta(minutes=x) for x in shift_minutes_range]
|
2019-12-04 17:16:40 +03:00
|
|
|
|
|
|
|
class ReceptionRow(Gtk.ListBoxRow):
|
|
|
|
@GObject.Property
|
|
|
|
def db_id(self):
|
|
|
|
return self._db_id
|
|
|
|
@db_id.setter
|
|
|
|
def db_id_setter(self, value):
|
|
|
|
self._db_id = value
|
|
|
|
@GObject.Property
|
|
|
|
def datetime(self):
|
|
|
|
return self._datetime
|
|
|
|
@datetime.setter
|
|
|
|
def datetime_setter(self, value):
|
|
|
|
self._datetime = value
|
|
|
|
@GObject.Property
|
|
|
|
def scheduled(self):
|
|
|
|
return self._scheduled
|
|
|
|
@scheduled.setter
|
|
|
|
def scheduled_setter(self, value):
|
|
|
|
self._scheduled = value
|
2019-12-12 19:47:08 +03:00
|
|
|
class NewReceptionPatientLabel(Gtk.Label):
|
|
|
|
@GObject.Property
|
2019-12-12 20:48:46 +03:00
|
|
|
def db_id(self):
|
|
|
|
return self._db_id
|
|
|
|
@db_id.setter
|
2019-12-12 19:47:08 +03:00
|
|
|
def db_id_setter(self, value):
|
2019-12-12 20:48:46 +03:00
|
|
|
self._db_id = value
|
2019-12-26 15:20:50 +03:00
|
|
|
class ReceptionDiagnosisRow(Gtk.ListBoxRow):
|
|
|
|
@GObject.Property
|
|
|
|
def db_id(self):
|
|
|
|
return self._db_id
|
|
|
|
@db_id.setter
|
|
|
|
def db_id_setter(self, value):
|
|
|
|
self._db_id = value
|
2020-01-23 10:50:59 +03:00
|
|
|
class ReceptionAnamnesisRow(Gtk.ListBoxRow):
|
|
|
|
@GObject.Property
|
|
|
|
def db_id(self):
|
|
|
|
return self._db_id
|
|
|
|
@db_id.setter
|
|
|
|
def db_id_setter(self, value):
|
|
|
|
self._db_id = value
|
2020-01-27 11:07:22 +03:00
|
|
|
class ReceptionObserveRow(Gtk.ListBoxRow):
|
|
|
|
@GObject.Property
|
|
|
|
def db_id(self):
|
|
|
|
return self._db_id
|
|
|
|
@db_id.setter
|
|
|
|
def db_id_setter(self, value):
|
|
|
|
self._db_id = value
|
2019-12-04 17:16:40 +03:00
|
|
|
|
2019-12-13 23:42:46 +03:00
|
|
|
def get_reception(reception_id):
|
|
|
|
with db.atomic():
|
|
|
|
return Reception.get_by_id(reception_id)
|
2020-01-27 11:07:22 +03:00
|
|
|
def get_reception_diagnosis_items(reception):
|
2019-12-26 15:20:50 +03:00
|
|
|
with db.atomic():
|
|
|
|
return ReceptionDiagnosis.select().where(ReceptionDiagnosis.reception == reception)
|
2020-01-27 11:07:22 +03:00
|
|
|
def get_reception_anamnesis_items(reception):
|
2020-01-23 10:02:47 +03:00
|
|
|
with db.atomic():
|
|
|
|
return ReceptionAnamnesis.select().where(ReceptionAnamnesis.reception == reception)
|
2020-01-27 11:07:22 +03:00
|
|
|
def get_reception_observe_items(reception):
|
|
|
|
with db.atomic():
|
|
|
|
return ReceptionObserve.select().where(ReceptionObserve.reception == reception)
|
2020-01-23 10:02:47 +03:00
|
|
|
def delete_reception_diagnosisses(reception, diag_id_list):
|
2019-12-26 15:20:50 +03:00
|
|
|
if not len(diag_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
ReceptionDiagnosis.delete().where((ReceptionDiagnosis.reception == reception) & (ReceptionDiagnosis.diagnosis.in_(diag_id_list))).execute()
|
2020-01-23 10:02:47 +03:00
|
|
|
def delete_reception_anamnesisses(reception, anam_id_list):
|
|
|
|
if not len(anam_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
ReceptionAnamnesis.delete().where((ReceptionAnamnesis.reception == reception) & (ReceptionAnamnesis.anamnesis.in_(anam_id_list))).execute()
|
2020-01-27 11:07:22 +03:00
|
|
|
def delete_reception_observe_symptoms(reception, observe_id_list):
|
|
|
|
if not len(observe_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
ReceptionObserve.delete().where((ReceptionObserve.reception == reception) & (ReceptionObserve.symptom.in_(observe_id_list))).execute()
|
2020-01-23 10:02:47 +03:00
|
|
|
def add_reception_diagnosisses(reception, diag_id_list):
|
2019-12-26 15:20:50 +03:00
|
|
|
if not len(diag_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
inserts = list(map(lambda x: {'reception': reception, 'diagnosis': get_giagnosis(x)}, diag_id_list))
|
|
|
|
_ = ReceptionDiagnosis.insert_many(inserts).execute()
|
2020-01-23 10:02:47 +03:00
|
|
|
def add_reception_anamnesisses(reception, anam_id_list):
|
|
|
|
if not len(anam_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
inserts = list(map(lambda x: {'reception': reception, 'anamnesis': get_listrecord(x)}, anam_id_list))
|
|
|
|
_ = ReceptionAnamnesis.insert_many(inserts).execute()
|
2020-01-27 11:07:22 +03:00
|
|
|
def add_reception_observe_symptoms(reception, observe_id_list):
|
|
|
|
if not len(observe_id_list): return
|
|
|
|
with db.atomic():
|
|
|
|
inserts = list(map(lambda x: {'reception': reception, 'symptom': get_listrecord(x)}, observe_id_list))
|
|
|
|
_ = ReceptionObserve.insert_many(inserts).execute()
|
2020-01-23 10:02:47 +03:00
|
|
|
def save_reception_diagnosisses(reception, diag_id_list):
|
2020-01-27 11:07:22 +03:00
|
|
|
exist_diags = set(map(lambda x: x.diagnosis.id, get_reception_diagnosis_items(reception)))
|
2019-12-26 15:20:50 +03:00
|
|
|
new_diags = set(diag_id_list)
|
|
|
|
to_del = list(exist_diags - new_diags)
|
|
|
|
to_add = list(new_diags - exist_diags)
|
2020-01-23 10:02:47 +03:00
|
|
|
delete_reception_diagnosisses(reception, to_del)
|
|
|
|
add_reception_diagnosisses(reception, to_add)
|
|
|
|
def save_reception_anamnesisses(reception, anam_id_list):
|
2020-01-27 11:07:22 +03:00
|
|
|
exist_anams = set(map(lambda x: x.anamnesis.id, get_reception_anamnesis_items(reception)))
|
2020-01-23 10:02:47 +03:00
|
|
|
new_anams = set(anam_id_list)
|
|
|
|
to_del = list(exist_anams - new_anams)
|
|
|
|
to_add = list(new_anams - exist_anams)
|
|
|
|
delete_reception_anamnesisses(reception, to_del)
|
|
|
|
add_reception_anamnesisses(reception, to_add)
|
2020-01-27 11:07:22 +03:00
|
|
|
def save_reception_observe(reception, observe_id_list):
|
|
|
|
exist_symptoms = set(map(lambda x: x.symptom.id, get_reception_observe_items(reception)))
|
|
|
|
new_symptoms = set(observe_id_list)
|
|
|
|
to_del = list(exist_symptoms - new_symptoms)
|
|
|
|
to_add = list(new_symptoms - exist_symptoms)
|
|
|
|
delete_reception_observe_symptoms(reception, to_del)
|
|
|
|
add_reception_observe_symptoms(reception, to_add)
|
2019-12-13 23:42:46 +03:00
|
|
|
|
2019-12-26 15:20:50 +03:00
|
|
|
##################################################################################
|
2019-12-04 17:16:40 +03:00
|
|
|
def build_reception_row(reception_datetime):
|
|
|
|
b = Gtk.Builder()
|
|
|
|
b.add_from_string(reception_row_ui_str)
|
|
|
|
win = b.get_object('win')
|
|
|
|
box = b.get_object('reception_box')
|
|
|
|
b.get_object('hour').set_text(reception_datetime.strftime('%H'))
|
|
|
|
b.get_object('minute').set_text(reception_datetime.strftime('%M'))
|
|
|
|
with db.atomic():
|
2019-12-12 20:48:46 +03:00
|
|
|
q = Reception.select().where(Reception.time == reception_datetime)
|
2019-12-04 17:16:40 +03:00
|
|
|
row = ReceptionRow()
|
2019-12-12 20:48:46 +03:00
|
|
|
if len(q):
|
|
|
|
reception = q.get()
|
2019-12-04 17:16:40 +03:00
|
|
|
row.props.scheduled = True
|
|
|
|
row.props.db_id = reception.id
|
|
|
|
reception_cont = b.get_object('reception_cont')
|
|
|
|
reception_cont.props.border_width = 2
|
2019-12-13 15:17:21 +03:00
|
|
|
reception_cont.override_background_color(Gtk.StateFlags(0), Gdk.RGBA(red=0.6, green=0.8, blue=0.6, alpha=1.0))
|
2019-12-04 17:16:40 +03:00
|
|
|
reception_patient = Gtk.Label()
|
2019-12-13 15:17:21 +03:00
|
|
|
reception_patient.set_markup(f'<span size="xx-large">{" ".join([reception.patient.last_name, reception.patient.first_name, reception.patient.middle_name])}</span>')
|
|
|
|
#reception_patient.set_text(' '.join([reception.patient.last_name, reception.patient.first_name, reception.patient.middle_name]))
|
2019-12-04 17:16:40 +03:00
|
|
|
reception_cont.add(reception_patient)
|
|
|
|
else:
|
|
|
|
row.props.scheduled = False
|
|
|
|
win.remove(win.get_children()[0])
|
|
|
|
row.props.datetime = reception_datetime
|
|
|
|
row.add(box)
|
|
|
|
return row
|
2019-12-26 15:20:50 +03:00
|
|
|
def build_reception_diagnosis_row(diagnosis):
|
|
|
|
b = Gtk.Builder()
|
|
|
|
b.add_from_string(diagnosis_row_ui_str)
|
|
|
|
win = b.get_object('win')
|
|
|
|
box = b.get_object('diagnosis_box')
|
|
|
|
b.get_object('title').set_text(f'{diagnosis.code:<8} {diagnosis.title}')
|
|
|
|
win.remove(win.get_children()[0])
|
|
|
|
row = ReceptionDiagnosisRow()
|
|
|
|
row.props.db_id = diagnosis.id
|
|
|
|
row.add(box)
|
|
|
|
return row
|
2020-01-23 10:50:59 +03:00
|
|
|
def build_reception_anamnesis_row(anamnesis):
|
|
|
|
b = Gtk.Builder()
|
|
|
|
b.add_from_string(anamnesis_row_ui_str)
|
|
|
|
win = b.get_object('win')
|
|
|
|
box = b.get_object('anamnesis_box')
|
|
|
|
b.get_object('title').set_text(f'{anamnesis.text}')
|
|
|
|
win.remove(win.get_children()[0])
|
|
|
|
row = ReceptionAnamnesisRow()
|
|
|
|
row.props.db_id = anamnesis.id
|
|
|
|
row.add(box)
|
|
|
|
return row
|
2020-01-27 11:07:22 +03:00
|
|
|
def build_reception_observe_row(observe):
|
|
|
|
b = Gtk.Builder()
|
|
|
|
b.add_from_string(observe_row_ui_str)
|
|
|
|
win = b.get_object('win')
|
|
|
|
box = b.get_object('observe_box')
|
|
|
|
b.get_object('title').set_text(f'{observe.text}')
|
|
|
|
win.remove(win.get_children()[0])
|
|
|
|
row = ReceptionObserveRow()
|
|
|
|
row.props.db_id = observe.id
|
|
|
|
row.add(box)
|
|
|
|
return row
|
2019-12-13 23:42:46 +03:00
|
|
|
def create_open_reception_win():
|
|
|
|
b = Gtk.Builder()
|
|
|
|
reception_list = builder.get_object('reception_list')
|
|
|
|
reception_row = reception_list.get_selected_row()
|
|
|
|
reception = get_reception(reception_row.props.db_id)
|
|
|
|
class OpenReceptionWinHandler:
|
2019-12-25 20:15:21 +03:00
|
|
|
def show_choose_diagnosis_win(self, button):
|
2019-12-26 15:20:50 +03:00
|
|
|
choose_diagnosis_win = create_choose_diagnosis_win(b)
|
2019-12-25 20:15:21 +03:00
|
|
|
choose_diagnosis_win.show_all()
|
2020-01-23 13:23:27 +03:00
|
|
|
def show_choose_anamnesis_win(self, button):
|
|
|
|
anam_db_list = get_list_by_system_id(ANAMNEZ_LIST)
|
|
|
|
choose_anamnesis_win = create_open_list_win(anam_db_list.id, choose=True, parent_list=reception_anam_list)
|
|
|
|
choose_anamnesis_win.show_all()
|
2020-01-27 11:07:22 +03:00
|
|
|
def show_choose_observe_win(self, button):
|
|
|
|
observe_db_list = get_list_by_system_id(OBSERVE_LIST)
|
|
|
|
choose_symptom_win = create_open_list_win(observe_db_list.id, choose=True, parent_list=reception_observe_list)
|
|
|
|
choose_symptom_win.show_all()
|
2019-12-26 15:20:50 +03:00
|
|
|
def remove_diagnosis(self, button):
|
|
|
|
row = reception_diag_list.get_selected_row()
|
|
|
|
reception_diag_list.remove(row)
|
|
|
|
disable_widget([remove_diag_button])
|
|
|
|
reception_diag_list.show_all()
|
2020-01-23 10:50:59 +03:00
|
|
|
def remove_anamnesis(self, button):
|
|
|
|
row = reception_anam_list.get_selected_row()
|
|
|
|
reception_anam_list.remove(row)
|
|
|
|
disable_widget([remove_anam_button])
|
|
|
|
reception_anam_list.show_all()
|
2020-01-27 11:07:22 +03:00
|
|
|
def remove_observe(self, button):
|
|
|
|
row = reception_observe_list.get_selected_row()
|
|
|
|
reception_observe_list.remove(row)
|
|
|
|
disable_widget([remove_observe_button])
|
|
|
|
reception_observe_list.show_all()
|
2019-12-26 15:20:50 +03:00
|
|
|
def diagnosis_selected(self, *s):
|
|
|
|
enable_widget([remove_diag_button])
|
2020-01-23 10:50:59 +03:00
|
|
|
def anamnesis_selected(self, *a):
|
|
|
|
enable_widget([remove_anam_button])
|
2020-01-27 11:07:22 +03:00
|
|
|
def observe_selected(self, *a):
|
|
|
|
enable_widget([remove_observe_button])
|
2019-12-26 15:20:50 +03:00
|
|
|
def save(self, button):
|
|
|
|
# Диагнозы
|
|
|
|
diag_id_list = list(map(lambda x: x.props.db_id, reception_diag_list.get_children()))
|
2020-01-23 10:02:47 +03:00
|
|
|
save_reception_diagnosisses(reception, diag_id_list)
|
2019-12-26 15:20:50 +03:00
|
|
|
#######
|
2020-01-23 10:50:59 +03:00
|
|
|
# Анамнез
|
|
|
|
anam_id_list = list(map(lambda x: x.props.db_id, reception_anam_list.get_children()))
|
|
|
|
save_reception_anamnesisses(reception, anam_id_list)
|
2019-12-26 15:20:50 +03:00
|
|
|
#######
|
2020-01-27 11:07:22 +03:00
|
|
|
# Осмотр
|
|
|
|
observe_id_list = list(map(lambda x: x.props.db_id, reception_observe_list.get_children()))
|
|
|
|
save_reception_observe(reception, observe_id_list)
|
|
|
|
#######
|
2019-12-26 15:20:50 +03:00
|
|
|
w.destroy()
|
2019-12-13 23:42:46 +03:00
|
|
|
b.add_from_file(open_reception_win_file)
|
|
|
|
b.connect_signals(OpenReceptionWinHandler())
|
|
|
|
#
|
|
|
|
patient_fio = b.get_object('patient_fio')
|
|
|
|
patient_fio.set_markup(f'<span size="x-large">{" ".join([reception.patient.last_name, reception.patient.first_name, reception.patient.middle_name])}</span>')
|
|
|
|
reception_dt = b.get_object('reception_datetime')
|
|
|
|
reception_dt.set_markup(f'<span size="x-large">{reception_row.props.datetime.strftime("%d.%m.%Y - %H:%M")}</span>')
|
2019-12-26 15:20:50 +03:00
|
|
|
reception_diag_list = b.get_object('diagnosis_list')
|
2020-01-23 10:50:59 +03:00
|
|
|
reception_anam_list = b.get_object('anamnesis_list')
|
2020-01-27 11:07:22 +03:00
|
|
|
reception_observe_list = b.get_object('observe_list')
|
2019-12-26 15:20:50 +03:00
|
|
|
remove_diag_button = b.get_object('remove_diag_button')
|
2020-01-23 10:50:59 +03:00
|
|
|
remove_anam_button = b.get_object('remove_anam_button')
|
2020-01-27 11:07:22 +03:00
|
|
|
remove_observe_button = b.get_object('remove_observe_button')
|
|
|
|
# Анамнез
|
|
|
|
for ra in [x.anamnesis for x in get_reception_anamnesis_items(reception)]:
|
2020-01-23 10:50:59 +03:00
|
|
|
reception_anam_list.add(build_reception_anamnesis_row(ra))
|
2020-01-23 10:02:47 +03:00
|
|
|
#
|
2020-01-27 11:07:22 +03:00
|
|
|
# Осмотр
|
|
|
|
for ro in [x.symptom for x in get_reception_observe_items(reception)]:
|
|
|
|
reception_observe_list.add(build_reception_observe_row(ro))
|
|
|
|
#
|
2019-12-26 15:20:50 +03:00
|
|
|
# Диагнозы
|
2020-01-27 11:07:22 +03:00
|
|
|
for rd in [x.diagnosis for x in get_reception_diagnosis_items(reception)]:
|
2019-12-26 15:20:50 +03:00
|
|
|
reception_diag_list.add(build_reception_diagnosis_row(rd))
|
2019-12-13 23:42:46 +03:00
|
|
|
#
|
|
|
|
w = b.get_object('open_reception_window')
|
|
|
|
return w
|
2019-12-12 19:47:08 +03:00
|
|
|
def create_new_reception_win():
|
2019-12-04 17:16:40 +03:00
|
|
|
b = Gtk.Builder()
|
2019-12-12 19:47:08 +03:00
|
|
|
reception_list = builder.get_object('reception_list')
|
|
|
|
row = reception_list.get_selected_row()
|
2019-12-04 17:16:40 +03:00
|
|
|
class NewReceptionWinHandler:
|
2019-12-12 19:47:08 +03:00
|
|
|
def show_choose_patient_win(self, button):
|
|
|
|
from mods.patients import create_choose_patient_win
|
|
|
|
choose_patient_win = create_choose_patient_win(b)
|
|
|
|
choose_patient_win.show_all()
|
2019-12-12 20:48:46 +03:00
|
|
|
def save_reception(self, button):
|
|
|
|
pat_label = patient_cont.get_children()[0]
|
|
|
|
if pat_label.props.db_id < 0:
|
|
|
|
return
|
2019-12-13 23:42:46 +03:00
|
|
|
_ = add_reception(pat_label.props.db_id, row.props.datetime)
|
2019-12-12 20:48:46 +03:00
|
|
|
w.destroy()
|
|
|
|
redraw_reception_list(row.props.datetime)
|
2019-12-04 17:16:40 +03:00
|
|
|
b.add_from_file(new_reception_win_file)
|
|
|
|
b.connect_signals(NewReceptionWinHandler())
|
2019-12-12 19:47:08 +03:00
|
|
|
#####
|
|
|
|
patient_label = NewReceptionPatientLabel()
|
2019-12-12 20:48:46 +03:00
|
|
|
patient_label.props.db_id = -1
|
2019-12-12 19:47:08 +03:00
|
|
|
#patient_label.set_markup('<span size="xx-large">test</span>')
|
|
|
|
#####
|
|
|
|
patient_cont = b.get_object('patient')
|
|
|
|
patient_cont.pack_start(patient_label, True, True, 0)
|
|
|
|
patient_cont.reorder_child(patient_label, 0)
|
2019-12-04 17:16:40 +03:00
|
|
|
w = b.get_object('new_reception_window')
|
2019-12-12 19:47:08 +03:00
|
|
|
dt_label = b.get_object('datetime')
|
2019-12-13 23:42:46 +03:00
|
|
|
dt_label.set_text(row.props.datetime.strftime('%d.%m.%Y - %H:%M'))
|
2019-12-04 17:16:40 +03:00
|
|
|
return w
|
2019-12-12 19:47:08 +03:00
|
|
|
def create_reception_list_settings_win():
|
|
|
|
b = Gtk.Builder()
|
|
|
|
class ReceptionListSettingsHandler:
|
2019-12-13 15:17:21 +03:00
|
|
|
def leading_zeroes(self, entry):
|
|
|
|
adj = entry.get_adjustment()
|
|
|
|
val = int(adj.get_value())
|
|
|
|
entry.set_text(f'{val:02d}')
|
|
|
|
return True
|
2019-12-12 19:47:08 +03:00
|
|
|
def save_settings(self, *a):
|
|
|
|
start_hour = int(b.get_object('start_hour').get_value())
|
|
|
|
start_minute = int(b.get_object('start_minute').get_value())
|
|
|
|
end_hour = int(b.get_object('end_hour').get_value())
|
|
|
|
end_minute = int(b.get_object('end_minute').get_value())
|
|
|
|
interval = int(b.get_object('interval').get_value())
|
|
|
|
s_set_reception_list([start_hour, start_minute], [end_hour, end_minute], interval)
|
2019-12-25 20:15:21 +03:00
|
|
|
cal = builder.get_object('reception_cal')
|
|
|
|
cal_date = cal.get_date()
|
|
|
|
d = datetime(cal_date.year, cal_date.month + 1, cal_date.day)
|
|
|
|
redraw_reception_list(d)
|
2019-12-12 19:47:08 +03:00
|
|
|
b.get_object('reception_list_settings_win').close()
|
|
|
|
b.add_from_file(reception_list_settings_win_file)
|
|
|
|
b.connect_signals(ReceptionListSettingsHandler())
|
|
|
|
s = s_get_reception_list()
|
|
|
|
b.get_object('start_hour').set_value(s.day_start[0])
|
|
|
|
b.get_object('start_minute').set_value(s.day_start[1])
|
|
|
|
b.get_object('end_hour').set_value(s.day_end[0])
|
|
|
|
b.get_object('end_minute').set_value(s.day_end[1])
|
|
|
|
b.get_object('interval').set_value(s.interval)
|
|
|
|
w = b.get_object('reception_list_settings_win')
|
|
|
|
return w
|
|
|
|
def redraw_reception_list(selected_date):
|
|
|
|
reception_timelist = get_reception_timelist(selected_date)
|
|
|
|
reception_list = builder.get_object('reception_list')
|
|
|
|
for c in reception_list.get_children():
|
|
|
|
reception_list.remove(c)
|
|
|
|
for d in reception_timelist:
|
|
|
|
reception_list.add(build_reception_row(d))
|
|
|
|
reception_list.show_all()
|
|
|
|
|