From 1d545953b04f71dfe1d897859f94d7e07e06fbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20T=2E=20Colombini=20G=C3=B3mez?= Date: Thu, 16 Oct 2014 08:51:18 +0200 Subject: [PATCH] =?UTF-8?q?Cambios=20para=20adaptar=20formularios=20a=20la?= =?UTF-8?q?=20librer=C3=ADa=20y=20solucionar=20algunos=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/account-menu.glade | 16 --- data/account-menu.xml | 18 +++ data/account.xml | 1 + data/email.glade | 58 ++++---- data/users.glade | 305 ++++++++++++++++++++-------------------- src/account.vala | 19 --- src/users.vala | 2 - 7 files changed, 197 insertions(+), 222 deletions(-) delete mode 100644 data/account-menu.glade create mode 100644 data/account-menu.xml diff --git a/data/account-menu.glade b/data/account-menu.glade deleted file mode 100644 index f84aa18..0000000 --- a/data/account-menu.glade +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Users - win.open-users - F2 - - - EMail - win.open-email - F3 - - - - diff --git a/data/account-menu.xml b/data/account-menu.xml new file mode 100644 index 0000000..58876f5 --- /dev/null +++ b/data/account-menu.xml @@ -0,0 +1,18 @@ + + + + + Users + win.open-form + users + F2 + + + EMail + win.open-form + email + F3 + + + + diff --git a/data/account.xml b/data/account.xml index 11a8c3b..6ed0dee 100644 --- a/data/account.xml +++ b/data/account.xml @@ -16,3 +16,4 @@ + diff --git a/data/email.glade b/data/email.glade index b263bf0..bd7ec5d 100644 --- a/data/email.glade +++ b/data/email.glade @@ -4,6 +4,12 @@ + + + SELECT id, alias FROM mail_alias + DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE + + SELECT parent, child FROM mail_alias_child WHERE #link @@ -13,29 +19,6 @@ - - - SELECT id, alias FROM mail_alias - DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE - - - - - - - model-child - - - - - model-alias - - - id - - - - True @@ -45,31 +28,33 @@ True False - 6 + 8 + 8 6 6 True False - 4 + 5 True True False vertical + 8 True True in - + True True False - alias + model-alias @@ -96,7 +81,7 @@ True False - alias + grid-alias VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD @@ -117,17 +102,18 @@ True False vertical + 8 True True in - + True True False - child + model-child @@ -137,7 +123,7 @@ Children child True - model-alias + model-alias @@ -156,7 +142,7 @@ True False - child + grid-child VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD @@ -182,4 +168,12 @@ + + + + grid-alias + id + + + diff --git a/data/users.glade b/data/users.glade index e3b61fc..3247e14 100644 --- a/data/users.glade +++ b/data/users.glade @@ -5,40 +5,11 @@ - - SELECT id, name FROM `group` - - - - - SELECT user_id, group_id, uid, last_change, expire -FROM account -WHERE #link + + SELECT u.id, u.name, u.mysql_user_id, m.user, u.active +FROM `user` u + JOIN mysql_user m ON u.mysql_user_id = m.id DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE - - - - - - - - SELECT mail_alias_id, user_id -FROM mail_alias_account -WHERE #link - DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE - - - - - - - - SELECT id, user FROM mysql_user - - - - - SELECT id, alias FROM mail_alias @@ -53,39 +24,47 @@ WHERE #link - - SELECT u.id, u.name, u.mysql_user_id, m.user, u.active -FROM `user` u - JOIN mysql_user m ON u.mysql_user_id = m.id + + SELECT id, alias FROM mail_alias + + + + + SELECT id, user FROM mysql_user + + + + + SELECT mail_alias_id, user_id +FROM mail_alias_account +WHERE #link DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE + + + + + + + + SELECT user_id, group_id, uid, last_change, expire +FROM account +WHERE #link + DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE + + + + + + + + SELECT id, name FROM `group` - - - users-model - - - id - - - - - - - sip-model - on-iter - - - - - alias-model - - - account-model + account-model on-iter @@ -94,10 +73,16 @@ FROM `user` u + + + sip-model + on-iter + + True - False + True 6 vertical 6 @@ -107,12 +92,12 @@ FROM `user` u True in - + True True False 1 - users + users-model @@ -163,10 +148,10 @@ FROM `user` u - + True - False - users + True + users-grid VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD @@ -182,23 +167,23 @@ FROM `user` u start left - + True - False + True 15 vertical 20 True - False + True 6 6 True True - False + True 1 Name: @@ -210,7 +195,7 @@ FROM `user` u True - False + True 1 Password: @@ -222,7 +207,7 @@ FROM `user` u True - False + True 1 MySQL user: @@ -234,7 +219,7 @@ FROM `user` u True - False + True 1 Enabled: @@ -247,7 +232,7 @@ FROM `user` u 130 True - False + True 1 Identifier: @@ -261,7 +246,7 @@ FROM `user` u 170 True False - users + users-grid id False @@ -279,11 +264,11 @@ FROM `user` u True False - users + users-grid name - False + True @@ -295,10 +280,15 @@ FROM `user` u True - False - users + True + users-grid mysql_user_id - user-combo-model + user-combo-model + + + False + + 1 @@ -323,7 +313,7 @@ FROM `user` u True False - users + users-grid active @@ -351,10 +341,10 @@ FROM `user` u - + 100 True - False + True User @@ -362,16 +352,16 @@ FROM `user` u - + True - False + True 15 vertical 20 True - False + True 6 6 True @@ -381,7 +371,7 @@ FROM `user` u False account group_id - account-combo-model + account-combo-model False @@ -402,7 +392,7 @@ FROM `user` u uid - False + True @@ -415,7 +405,7 @@ FROM `user` u 130 True - False + True 1 UID: @@ -427,7 +417,7 @@ FROM `user` u True - False + True 1 Main group: @@ -439,12 +429,12 @@ FROM `user` u True - False + True account last_change - False + True False @@ -462,7 +452,7 @@ FROM `user` u expire - False + True False @@ -475,7 +465,7 @@ FROM `user` u True - False + True 1 Last change: @@ -487,7 +477,7 @@ FROM `user` u True - False + True 1 Expires: @@ -504,9 +494,9 @@ FROM `user` u - + True - False + True account True @@ -522,10 +512,10 @@ FROM `user` u - + 100 True - False + True Account @@ -534,9 +524,9 @@ FROM `user` u - + True - False + True 15 vertical 6 @@ -547,11 +537,11 @@ FROM `user` u True in - + True True False - alias + alias-model @@ -560,7 +550,7 @@ FROM `user` u Alias mail_alias_id True - alias-combo-model + alias-combo-model @@ -576,10 +566,10 @@ FROM `user` u - + True - False - alias + True + alias-grid VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD @@ -594,10 +584,10 @@ FROM `user` u - + 100 True - False + True Mail alias @@ -606,16 +596,16 @@ FROM `user` u - + True - False + True 15 vertical 58 True - False + True start 6 6 @@ -624,7 +614,7 @@ FROM `user` u 130 True - False + True 1 Extension: @@ -636,7 +626,7 @@ FROM `user` u True - False + True 1 Secret: @@ -648,7 +638,7 @@ FROM `user` u True - False + True 1 Identifier: @@ -666,7 +656,7 @@ FROM `user` u extension - False + True @@ -683,7 +673,7 @@ FROM `user` u secret - False + True @@ -700,7 +690,7 @@ FROM `user` u callerid - False + True @@ -717,9 +707,9 @@ FROM `user` u - + True - False + True sip True @@ -735,10 +725,10 @@ FROM `user` u - + 100 True - False + True SIP @@ -754,14 +744,22 @@ FROM `user` u + + + + users-grid + id + + + - + - False + True 5 Change password False @@ -772,16 +770,34 @@ FROM `user` u - False + True vertical 2 + + + True + end + + + + + + + + + False + True + end + 2 + + True - False + True - False + True 5 vertical end @@ -797,13 +813,13 @@ FROM `user` u - False + True 8 8 True - False + True False @@ -828,14 +844,14 @@ FROM `user` u True - False + True 6 6 6 True - False + True 1 Password: @@ -847,7 +863,7 @@ FROM `user` u True - False + True 1 Repeat password: @@ -859,10 +875,10 @@ FROM `user` u True - False + True - False + True False @@ -876,10 +892,11 @@ FROM `user` u True - False + True - False + True + True False @@ -897,24 +914,6 @@ FROM `user` u 1 - - - False - end - - - - - - - - - False - True - end - 2 - - diff --git a/src/account.vala b/src/account.vala index f21e8e9..143697e 100644 --- a/src/account.vala +++ b/src/account.vala @@ -26,23 +26,4 @@ public class Vn.Management : Vn.Mod public override void activate () { } - - // Actions - - const GLib.ActionEntry[] actions = - { - {"open-form", open_form} - ,{"test-set-action", test_set_action} - }; - - void open_form (GLib.SimpleAction a, GLib.Variant? p) - {} - - void test_set_action (GLib.SimpleAction a, GLib.Variant? p) - {} - - public override unowned GLib.ActionEntry[] get_actions () - { - return actions; - } } diff --git a/src/users.vala b/src/users.vala index c8e572a..e8b7334 100644 --- a/src/users.vala +++ b/src/users.vala @@ -18,14 +18,12 @@ public class Vn.Users : Vn.Form { - private unowned Gvn.Param user_id; private unowned Gtk.Dialog password_dialog; private unowned Vn.Entry password_entry; private unowned Vn.Entry repeat_password; public override void open () { - user_id = get ("user-id") as Gvn.Param; password_entry = get ("password-entry") as Vn.Entry; repeat_password = get ("repeat-password") as Vn.Entry; password_dialog = get ("password-dialog") as Gtk.Dialog;