Cambios para adaptar formularios a la librería y solucionar algunos bugs

This commit is contained in:
Alejandro T. Colombini Gómez 2014-10-16 08:51:18 +02:00
parent c7e99e03d1
commit 1d545953b0
7 changed files with 197 additions and 222 deletions

View File

@ -1,16 +0,0 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<menu id='menu'>
<item>
<attribute name='label' translatable='yes'>Users</attribute>
<attribute name='action'>win.open-users</attribute>
<attribute name='accel'>F2</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>EMail</attribute>
<attribute name='action'>win.open-email</attribute>
<attribute name='accel'>F3</attribute>
</item>
</menu>
</interface>

18
data/account-menu.xml Normal file
View File

@ -0,0 +1,18 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<menu id="menu">
<item>
<attribute name="label" translatable="yes">Users</attribute>
<attribute name="action">win.open-form</attribute>
<attribute name="target">users</attribute>
<attribute name="accel">F2</attribute>
</item>
<item>
<attribute name="label" translatable="yes">EMail</attribute>
<attribute name="action">win.open-form</attribute>
<attribute name="target">email</attribute>
<attribute name="accel">F3</attribute>
</item>
</menu>
</interface>

View File

@ -16,3 +16,4 @@
</form> </form>
</form-group> </form-group>
</module> </module>

View File

@ -4,6 +4,12 @@
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<requires lib="vn" version="1.0"/> <requires lib="vn" version="1.0"/>
<object class="VnSet" id="models"> <object class="VnSet" id="models">
<child>
<object class="VnModel" id="model-alias">
<property name="sql">SELECT id, alias FROM mail_alias</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
</object>
</child>
<child> <child>
<object class="VnModel" id="model-child"> <object class="VnModel" id="model-child">
<property name="sql">SELECT parent, child FROM mail_alias_child WHERE #link</property> <property name="sql">SELECT parent, child FROM mail_alias_child WHERE #link</property>
@ -13,29 +19,6 @@
</links> </links>
</object> </object>
</child> </child>
<child>
<object class="VnModel" id="model-alias">
<property name="sql">SELECT id, alias FROM mail_alias</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
</object>
</child>
</object>
<object class="VnSet" id="iterators">
<child>
<object class="VnIterator" id="child">
<property name="model">model-child</property>
</object>
</child>
<child>
<object class="VnIterator" id="alias">
<property name="model">model-alias</property>
<child>
<object class="DbParam" id="id">
<property name="column_name">id</property>
</object>
</child>
</object>
</child>
</object> </object>
<object class="GtkBox" id="main"> <object class="GtkBox" id="main">
<property name="visible">True</property> <property name="visible">True</property>
@ -45,31 +28,33 @@
<object class="GtkAlignment" id="alignment1"> <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="top_padding">6</property> <property name="top_padding">8</property>
<property name="bottom_padding">8</property>
<property name="left_padding">6</property> <property name="left_padding">6</property>
<property name="right_padding">6</property> <property name="right_padding">6</property>
<child> <child>
<object class="GtkBox" id="box3"> <object class="GtkBox" id="box3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">4</property> <property name="spacing">5</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="VnGrid" id="grid1"> <object class="VnGrid" id="grid-alias">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="iterator">alias</property> <property name="data_model">model-alias</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="grid-selection"/> <object class="GtkTreeSelection" id="grid-selection"/>
</child> </child>
@ -96,7 +81,7 @@
<object class="VnHandler" id="handler1"> <object class="VnHandler" id="handler1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">alias</property> <property name="iterator">grid-alias</property>
<property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property> <property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property>
</object> </object>
<packing> <packing>
@ -117,17 +102,18 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow2"> <object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="VnGrid" id="grid2"> <object class="VnGrid" id="grid-child">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="iterator">child</property> <property name="data_model">model-child</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="grid-selection1"/> <object class="GtkTreeSelection" id="grid-selection1"/>
</child> </child>
@ -137,7 +123,7 @@
<property name="title" translatable="yes">Children</property> <property name="title" translatable="yes">Children</property>
<property name="column_name">child</property> <property name="column_name">child</property>
<property name="editable">True</property> <property name="editable">True</property>
<property name="model">model-alias</property> <property name="data_model">model-alias</property>
<child internal-child="cell"> <child internal-child="cell">
<object class="GtkCellRendererCombo" id="column-combo-cell1"/> <object class="GtkCellRendererCombo" id="column-combo-cell1"/>
</child> </child>
@ -156,7 +142,7 @@
<object class="VnHandler" id="handler2"> <object class="VnHandler" id="handler2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">child</property> <property name="iterator">grid-child</property>
<property name="show_flags">VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property> <property name="show_flags">VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property>
</object> </object>
<packing> <packing>
@ -182,4 +168,12 @@
</packing> </packing>
</child> </child>
</object> </object>
<object class="VnSet" id="params">
<child>
<object class="DbParam" id="id">
<property name="iterator">grid-alias</property>
<property name="column_name">id</property>
</object>
</child>
</object>
</interface> </interface>

View File

@ -5,40 +5,11 @@
<requires lib="vn" version="1.0"/> <requires lib="vn" version="1.0"/>
<object class="VnSet" id="models"> <object class="VnSet" id="models">
<child> <child>
<object class="VnModel" id="account-combo-model"> <object class="VnModel" id="users-model">
<property name="sql">SELECT id, name FROM `group`</property> <property name="sql">SELECT u.id, u.name, u.mysql_user_id, m.user, u.active
</object> FROM `user` u
</child> JOIN mysql_user m ON u.mysql_user_id = m.id</property>
<child>
<object class="VnModel" id="account-model">
<property name="sql">SELECT user_id, group_id, uid, last_change, expire
FROM account
WHERE #link</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property> <property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
<links>
<link field="account.user_id" param="id" linked="True"/>
</links>
</object>
</child>
<child>
<object class="VnModel" id="alias-model">
<property name="sql">SELECT mail_alias_id, user_id
FROM mail_alias_account
WHERE #link</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
<links>
<link field="mail_alias_account.user_id" param="user-id" linked="True"/>
</links>
</object>
</child>
<child>
<object class="VnModel" id="user-combo-model">
<property name="sql">SELECT id, user FROM mysql_user</property>
</object>
</child>
<child>
<object class="VnModel" id="alias-combo-model">
<property name="sql">SELECT id, alias FROM mail_alias</property>
</object> </object>
</child> </child>
<child> <child>
@ -53,39 +24,47 @@ WHERE #link</property>
</object> </object>
</child> </child>
<child> <child>
<object class="VnModel" id="users-model"> <object class="VnModel" id="alias-combo-model">
<property name="sql">SELECT u.id, u.name, u.mysql_user_id, m.user, u.active <property name="sql">SELECT id, alias FROM mail_alias</property>
FROM `user` u </object>
JOIN mysql_user m ON u.mysql_user_id = m.id</property> </child>
<child>
<object class="VnModel" id="user-combo-model">
<property name="sql">SELECT id, user FROM mysql_user</property>
</object>
</child>
<child>
<object class="VnModel" id="alias-model">
<property name="sql">SELECT mail_alias_id, user_id
FROM mail_alias_account
WHERE #link</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property> <property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
<links>
<link field="mail_alias_account.user_id" param="user-id" linked="True"/>
</links>
</object>
</child>
<child>
<object class="VnModel" id="account-model">
<property name="sql">SELECT user_id, group_id, uid, last_change, expire
FROM account
WHERE #link</property>
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
<links>
<link field="account.user_id" param="id" linked="True"/>
</links>
</object>
</child>
<child>
<object class="VnModel" id="account-combo-model">
<property name="sql">SELECT id, name FROM `group`</property>
</object> </object>
</child> </child>
</object> </object>
<object class="VnSet" id="iterators"> <object class="VnSet" id="iterators">
<child>
<object class="VnIterator" id="users">
<property name="model">users-model</property>
<child>
<object class="DbParam" id="id">
<property name="column_name">id</property>
</object>
</child>
</object>
</child>
<child>
<object class="VnIterator" id="sip">
<property name="model">sip-model</property>
<property name="mode">on-iter</property>
</object>
</child>
<child>
<object class="VnIterator" id="alias">
<property name="model">alias-model</property>
</object>
</child>
<child> <child>
<object class="VnIterator" id="account"> <object class="VnIterator" id="account">
<property name="model">account-model</property> <property name="data_model">account-model</property>
<property name="mode">on-iter</property> <property name="mode">on-iter</property>
<child> <child>
<object class="DbParam" id="user-id"> <object class="DbParam" id="user-id">
@ -94,10 +73,16 @@ FROM `user` u
</child> </child>
</object> </object>
</child> </child>
<child>
<object class="VnIterator" id="sip">
<property name="data_model">sip-model</property>
<property name="mode">on-iter</property>
</object>
</child>
</object> </object>
<object class="GtkBox" id="main"> <object class="GtkBox" id="main">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
@ -107,12 +92,12 @@ FROM `user` u
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="VnGrid" id="grid"> <object class="VnGrid" id="users-grid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="search_column">1</property> <property name="search_column">1</property>
<property name="iterator">users</property> <property name="data_model">users-model</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="grid-selection"/> <object class="GtkTreeSelection" id="grid-selection"/>
</child> </child>
@ -163,10 +148,10 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="VnHandler" id="handler1"> <object class="VnHandler" id="users-handler">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">users</property> <property name="iterator">users-grid</property>
<property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property> <property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property>
</object> </object>
<packing> <packing>
@ -182,23 +167,23 @@ FROM `user` u
<property name="valign">start</property> <property name="valign">start</property>
<property name="tab_pos">left</property> <property name="tab_pos">left</property>
<child> <child>
<object class="GtkBox" id="box4"> <object class="GtkBox" id="user-tab">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">15</property> <property name="border_width">15</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">20</property> <property name="spacing">20</property>
<child> <child>
<object class="GtkGrid" id="grid2"> <object class="GtkGrid" id="grid2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
<property name="row_homogeneous">True</property> <property name="row_homogeneous">True</property>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">Name:</property>
</object> </object>
@ -210,7 +195,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label4"> <object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Password:</property> <property name="label" translatable="yes">Password:</property>
</object> </object>
@ -222,7 +207,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label5"> <object class="GtkLabel" id="label5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">MySQL user:</property> <property name="label" translatable="yes">MySQL user:</property>
</object> </object>
@ -234,7 +219,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label6"> <object class="GtkLabel" id="label6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Enabled:</property> <property name="label" translatable="yes">Enabled:</property>
</object> </object>
@ -247,7 +232,7 @@ FROM `user` u
<object class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="width_request">130</property> <property name="width_request">130</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Identifier:</property> <property name="label" translatable="yes">Identifier:</property>
</object> </object>
@ -261,7 +246,7 @@ FROM `user` u
<property name="width_request">170</property> <property name="width_request">170</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">users</property> <property name="iterator">users-grid</property>
<property name="column_name">id</property> <property name="column_name">id</property>
<property name="editable">False</property> <property name="editable">False</property>
<child internal-child="widget"> <child internal-child="widget">
@ -279,11 +264,11 @@ FROM `user` u
<object class="VnEntry" id="entry1"> <object class="VnEntry" id="entry1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">users</property> <property name="iterator">users-grid</property>
<property name="column_name">name</property> <property name="column_name">name</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget1"> <object class="GtkEntry" id="entry-widget1">
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -295,10 +280,15 @@ FROM `user` u
<child> <child>
<object class="VnCombo" id="combo1"> <object class="VnCombo" id="combo1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">users</property> <property name="iterator">users-grid</property>
<property name="column_name">mysql_user_id</property> <property name="column_name">mysql_user_id</property>
<property name="model">user-combo-model</property> <property name="data_model">user-combo-model</property>
<child internal-child="widget">
<object class="GtkComboBox" id="combo-widget1">
<property name="can_focus">False</property>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -323,7 +313,7 @@ FROM `user` u
<object class="VnCheck" id="check1"> <object class="VnCheck" id="check1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">users</property> <property name="iterator">users-grid</property>
<property name="column_name">active</property> <property name="column_name">active</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkCheckButton" id="check-widget1"> <object class="GtkCheckButton" id="check-widget1">
@ -351,10 +341,10 @@ FROM `user` u
</object> </object>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label19"> <object class="GtkLabel" id="user-tab-label">
<property name="width_request">100</property> <property name="width_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">User</property> <property name="label" translatable="yes">User</property>
</object> </object>
<packing> <packing>
@ -362,16 +352,16 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box2"> <object class="GtkBox" id="account-tab">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">15</property> <property name="border_width">15</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">20</property> <property name="spacing">20</property>
<child> <child>
<object class="GtkGrid" id="grid3"> <object class="GtkGrid" id="grid3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
<property name="row_homogeneous">True</property> <property name="row_homogeneous">True</property>
@ -381,7 +371,7 @@ FROM `user` u
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="iterator">account</property> <property name="iterator">account</property>
<property name="column_name">group_id</property> <property name="column_name">group_id</property>
<property name="model">account-combo-model</property> <property name="data_model">account-combo-model</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkComboBox" id="combo-widget2"> <object class="GtkComboBox" id="combo-widget2">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -402,7 +392,7 @@ FROM `user` u
<property name="column_name">uid</property> <property name="column_name">uid</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkSpinButton" id="spin-widget2"> <object class="GtkSpinButton" id="spin-widget2">
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -415,7 +405,7 @@ FROM `user` u
<object class="GtkLabel" id="label10"> <object class="GtkLabel" id="label10">
<property name="width_request">130</property> <property name="width_request">130</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">UID:</property> <property name="label" translatable="yes">UID:</property>
</object> </object>
@ -427,7 +417,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label11"> <object class="GtkLabel" id="label11">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Main group:</property> <property name="label" translatable="yes">Main group:</property>
</object> </object>
@ -439,12 +429,12 @@ FROM `user` u
<child> <child>
<object class="VnDateChooser" id="date-chooser1"> <object class="VnDateChooser" id="date-chooser1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">account</property> <property name="iterator">account</property>
<property name="column_name">last_change</property> <property name="column_name">last_change</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkToggleButton" id="date-chooser-widget1"> <object class="GtkToggleButton" id="date-chooser-widget1">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
</object> </object>
</child> </child>
@ -462,7 +452,7 @@ FROM `user` u
<property name="column_name">expire</property> <property name="column_name">expire</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkToggleButton" id="date-chooser-widget2"> <object class="GtkToggleButton" id="date-chooser-widget2">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
</object> </object>
</child> </child>
@ -475,7 +465,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label12"> <object class="GtkLabel" id="label12">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Last change:</property> <property name="label" translatable="yes">Last change:</property>
</object> </object>
@ -487,7 +477,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label13"> <object class="GtkLabel" id="label13">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Expires:</property> <property name="label" translatable="yes">Expires:</property>
</object> </object>
@ -504,9 +494,9 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="VnHandler" id="handler2"> <object class="VnHandler" id="account-handler">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">account</property> <property name="iterator">account</property>
<property name="simple_record">True</property> <property name="simple_record">True</property>
</object> </object>
@ -522,10 +512,10 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label20"> <object class="GtkLabel" id="account-tab-label">
<property name="width_request">100</property> <property name="width_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Account</property> <property name="label" translatable="yes">Account</property>
</object> </object>
<packing> <packing>
@ -534,9 +524,9 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box6"> <object class="GtkBox" id="alias-tab">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">15</property> <property name="border_width">15</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
@ -547,11 +537,11 @@ FROM `user` u
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="VnGrid" id="grid5"> <object class="VnGrid" id="alias-grid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="iterator">alias</property> <property name="data_model">alias-model</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="grid-selection2"/> <object class="GtkTreeSelection" id="grid-selection2"/>
</child> </child>
@ -560,7 +550,7 @@ FROM `user` u
<property name="title" translatable="yes">Alias</property> <property name="title" translatable="yes">Alias</property>
<property name="column_name">mail_alias_id</property> <property name="column_name">mail_alias_id</property>
<property name="editable">True</property> <property name="editable">True</property>
<property name="model">alias-combo-model</property> <property name="data_model">alias-combo-model</property>
<child internal-child="cell"> <child internal-child="cell">
<object class="GtkCellRendererCombo" id="column-combo-cell1"/> <object class="GtkCellRendererCombo" id="column-combo-cell1"/>
</child> </child>
@ -576,10 +566,10 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="VnHandler" id="handler4"> <object class="VnHandler" id="alias-handler">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">alias</property> <property name="iterator">alias-grid</property>
<property name="show_flags">VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property> <property name="show_flags">VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property>
</object> </object>
<packing> <packing>
@ -594,10 +584,10 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label8"> <object class="GtkLabel" id="alias-tab-label">
<property name="width_request">100</property> <property name="width_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Mail alias</property> <property name="label" translatable="yes">Mail alias</property>
</object> </object>
<packing> <packing>
@ -606,16 +596,16 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box3"> <object class="GtkBox" id="sip-tab">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">15</property> <property name="border_width">15</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">58</property> <property name="spacing">58</property>
<child> <child>
<object class="GtkGrid" id="grid4"> <object class="GtkGrid" id="grid4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
@ -624,7 +614,7 @@ FROM `user` u
<object class="GtkLabel" id="label15"> <object class="GtkLabel" id="label15">
<property name="width_request">130</property> <property name="width_request">130</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Extension:</property> <property name="label" translatable="yes">Extension:</property>
</object> </object>
@ -636,7 +626,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label16"> <object class="GtkLabel" id="label16">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Secret:</property> <property name="label" translatable="yes">Secret:</property>
</object> </object>
@ -648,7 +638,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label17"> <object class="GtkLabel" id="label17">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Identifier:</property> <property name="label" translatable="yes">Identifier:</property>
</object> </object>
@ -666,7 +656,7 @@ FROM `user` u
<property name="column_name">extension</property> <property name="column_name">extension</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget2"> <object class="GtkEntry" id="entry-widget2">
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -683,7 +673,7 @@ FROM `user` u
<property name="column_name">secret</property> <property name="column_name">secret</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget3"> <object class="GtkEntry" id="entry-widget3">
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -700,7 +690,7 @@ FROM `user` u
<property name="column_name">callerid</property> <property name="column_name">callerid</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget4"> <object class="GtkEntry" id="entry-widget4">
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
</child> </child>
</object> </object>
@ -717,9 +707,9 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child> <child>
<object class="VnHandler" id="handler3"> <object class="VnHandler" id="sip-handler">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="iterator">sip</property> <property name="iterator">sip</property>
<property name="simple_record">True</property> <property name="simple_record">True</property>
</object> </object>
@ -735,10 +725,10 @@ FROM `user` u
</packing> </packing>
</child> </child>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label21"> <object class="GtkLabel" id="sip-tab-label">
<property name="width_request">100</property> <property name="width_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">SIP</property> <property name="label" translatable="yes">SIP</property>
</object> </object>
<packing> <packing>
@ -754,14 +744,22 @@ FROM `user` u
</packing> </packing>
</child> </child>
</object> </object>
<object class="VnSet" id="params">
<child>
<object class="DbParam" id="id">
<property name="iterator">users-grid</property>
<property name="column_name">id</property>
</object>
</child>
</object>
<object class="VnBatch" id="password-batch"> <object class="VnBatch" id="password-batch">
<items> <items>
<item id="user" param="user-id"/> <item id="user" param="id"/>
<item id="pass" param="password-entry"/> <item id="pass" param="password-entry"/>
</items> </items>
</object> </object>
<object class="GtkDialog" id="password-dialog"> <object class="GtkDialog" id="password-dialog">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Change password</property> <property name="title" translatable="yes">Change password</property>
<property name="resizable">False</property> <property name="resizable">False</property>
@ -772,16 +770,34 @@ FROM `user` u
<signal name="response" handler="vn_users_on_dialog_response" swapped="no"/> <signal name="response" handler="vn_users_on_dialog_response" swapped="no"/>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2"> <object class="GtkBox" id="dialog-vbox2">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area2">
<property name="can_focus">True</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
<child> <child>
<object class="GtkInfoBar" id="password-infobar"> <object class="GtkInfoBar" id="password-infobar">
<property name="app_paintable">True</property> <property name="app_paintable">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="infobar-action_area1"> <object class="GtkButtonBox" id="infobar-action_area1">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
@ -797,13 +813,13 @@ FROM `user` u
</child> </child>
<child internal-child="content_area"> <child internal-child="content_area">
<object class="GtkBox" id="infobar-content_area1"> <object class="GtkBox" id="infobar-content_area1">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">8</property> <property name="border_width">8</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkLabel" id="password-error"> <object class="GtkLabel" id="password-error">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -828,14 +844,14 @@ FROM `user` u
<child> <child>
<object class="GtkGrid" id="grid6"> <object class="GtkGrid" id="grid6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
<child> <child>
<object class="GtkLabel" id="label23"> <object class="GtkLabel" id="label23">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Password:</property> <property name="label" translatable="yes">Password:</property>
</object> </object>
@ -847,7 +863,7 @@ FROM `user` u
<child> <child>
<object class="GtkLabel" id="label22"> <object class="GtkLabel" id="label22">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="label" translatable="yes">Repeat password:</property> <property name="label" translatable="yes">Repeat password:</property>
</object> </object>
@ -859,10 +875,10 @@ FROM `user` u
<child> <child>
<object class="VnEntry" id="password-entry"> <object class="VnEntry" id="password-entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget5"> <object class="GtkEntry" id="entry-widget5">
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="visibility">False</property> <property name="visibility">False</property>
<property name="invisible_char">●</property> <property name="invisible_char">●</property>
</object> </object>
@ -876,10 +892,11 @@ FROM `user` u
<child> <child>
<object class="VnEntry" id="repeat-password"> <object class="VnEntry" id="repeat-password">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<child internal-child="widget"> <child internal-child="widget">
<object class="GtkEntry" id="entry-widget"> <object class="GtkEntry" id="entry-widget">
<property name="can_focus">False</property> <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property> <property name="visibility">False</property>
<property name="invisible_char">●</property> <property name="invisible_char">●</property>
</object> </object>
@ -897,24 +914,6 @@ FROM `user` u
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area2">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>

View File

@ -26,23 +26,4 @@ public class Vn.Management : Vn.Mod
public override void activate () 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;
}
} }

View File

@ -18,14 +18,12 @@
public class Vn.Users : Vn.Form public class Vn.Users : Vn.Form
{ {
private unowned Gvn.Param user_id;
private unowned Gtk.Dialog password_dialog; private unowned Gtk.Dialog password_dialog;
private unowned Vn.Entry password_entry; private unowned Vn.Entry password_entry;
private unowned Vn.Entry repeat_password; private unowned Vn.Entry repeat_password;
public override void open () public override void open ()
{ {
user_id = get ("user-id") as Gvn.Param;
password_entry = get ("password-entry") as Vn.Entry; password_entry = get ("password-entry") as Vn.Entry;
repeat_password = get ("repeat-password") as Vn.Entry; repeat_password = get ("repeat-password") as Vn.Entry;
password_dialog = get ("password-dialog") as Gtk.Dialog; password_dialog = get ("password-dialog") as Gtk.Dialog;