From 5a4b23cf2dfa3317fb658c2d067168dfa0077b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Mon, 28 Oct 2019 21:30:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=20=D0=BE=D0=BA=D0=BD=D0=BE=20=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=BF=D0=B0=D1=86=D0=B8=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 24 ++- res/ui/main_win.glade | 190 +++++++++++++++++++++ res/{ui.glade => ui/new_patient_win.glade} | 183 -------------------- 3 files changed, 211 insertions(+), 186 deletions(-) create mode 100644 res/ui/main_win.glade rename res/{ui.glade => ui/new_patient_win.glade} (58%) diff --git a/app.py b/app.py index 20ae17d..e243f93 100644 --- a/app.py +++ b/app.py @@ -4,12 +4,30 @@ gi.require_version('Gtk', '3.0') from gi.repository import Gtk resource_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res') -ui_file = os.path.join(resource_dir, 'ui.glade') +ui_dir = os.path.join(resource_dir, 'ui') +main_win_file = os.path.join(ui_dir, 'main_win.glade') +new_patient_win_file = os.path.join(ui_dir, 'new_patient_win.glade') + +def create_new_patient_win(): + class NewPatienWinHandler: + pass + b = Gtk.Builder() + b.add_from_file(new_patient_win_file) + b.connect_signals(NewPatienWinHandler()) + w = b.get_object('new_patient_window') + return w + +class MainWinHandler: + def main_win_close(self, *args): + Gtk.main_quit() + def show_new_patient_win(self, button): + new_patient_win = create_new_patient_win() + new_patient_win.show_all() builder = Gtk.Builder() -builder.add_from_file(ui_file) +builder.add_from_file(main_win_file) +builder.connect_signals(MainWinHandler()) main_win = builder.get_object('main_window') -main_win.connect("destroy", Gtk.main_quit) main_win.show_all() Gtk.main() diff --git a/res/ui/main_win.glade b/res/ui/main_win.glade new file mode 100644 index 0000000..03c0c31 --- /dev/null +++ b/res/ui/main_win.glade @@ -0,0 +1,190 @@ + + + + + + False + ElDoc + 800 + 500 + + + + + + + True + False + + + True + False + main_pages + + + False + True + 0 + + + + + True + False + + + True + False + vertical + + + True + False + both + + + True + False + Создать + Создать + True + gtk-add + + + False + True + + + + + True + False + Изменить + Изменить + True + gtk-edit + + + False + True + + + + + False + True + 0 + + + + + True + False + + + False + True + 2 + + + + + page1 + Расписание приёмов + + + + + True + False + vertical + + + True + False + icons + + + True + False + Добавить + True + gtk-add + + + + False + True + + + + + True + False + Изменить + True + gtk-edit + + + False + True + + + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + True + + + True + True + edit-find-symbolic + False + False + + + + + False + True + end + 2 + + + + + page0 + Паценты + 1 + + + + + True + True + 1 + + + + + + diff --git a/res/ui.glade b/res/ui/new_patient_win.glade similarity index 58% rename from res/ui.glade rename to res/ui/new_patient_win.glade index 0410b64..e7b4d22 100644 --- a/res/ui.glade +++ b/res/ui/new_patient_win.glade @@ -2,189 +2,6 @@ - - False - ElDoc - 800 - 500 - - - - - - True - False - - - True - False - main_pages - - - False - True - 0 - - - - - True - False - - - True - False - vertical - - - True - False - both - - - True - False - Создать - Создать - True - gtk-add - - - False - True - - - - - True - False - Изменить - Изменить - True - gtk-edit - - - False - True - - - - - False - True - 0 - - - - - True - False - - - False - True - 2 - - - - - page1 - Расписание приёмов - - - - - True - False - vertical - - - True - False - icons - - - True - False - Добавить - True - gtk-add - - - False - True - - - - - True - False - Изменить - True - gtk-edit - - - False - True - - - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - True - - - True - True - edit-find-symbolic - False - False - - - - - False - True - end - 2 - - - - - page0 - Паценты - 1 - - - - - True - True - 1 - - - - - False True