From c5c0c8da5e89c8acf6254e8ccad9601bfa61ba5f Mon Sep 17 00:00:00 2001
From: "Samantha N. Bueno" <sbueno+anaconda@redhat.com>
Date: Wed, 17 Dec 2014 16:42:59 -0500
Subject: [PATCH 2/9] Fix up the z Panel in advanced storage.

This just adds functionality to the skeleton z Panel that was created
ages ago. Once z-specific devices are added (for now, just zFCP), they
should show up in the filter window. Users should be able to filter
the list by searching for the device id (CCW), LUN, or WWPN.

Once a device is selected from here, it should show up in the main
storage spoke under specialized devices.
---
 pyanaconda/ui/gui/spokes/filter.glade | 517 +++++++++++++++++++++++-----------
 pyanaconda/ui/gui/spokes/filter.py    |  91 +++++-
 pyanaconda/ui/gui/spokes/storage.py   |  11 +-
 3 files changed, 443 insertions(+), 176 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/filter.glade b/pyanaconda/ui/gui/spokes/filter.glade
index 7754148..cacae43 100644
--- a/pyanaconda/ui/gui/spokes/filter.glade
+++ b/pyanaconda/ui/gui/spokes/filter.glade
@@ -37,6 +37,8 @@
       <column type="gchararray"/>
       <!-- column-name diskCCW -->
       <column type="gchararray"/>
+      <!-- column-name diskWWPN -->
+      <column type="gchararray"/>
     </columns>
   </object>
   <object class="GtkTreeModelFilter" id="multipathModel">
@@ -356,6 +358,20 @@
                                       </object>
                                     </child>
                                     <child>
+                                      <object class="GtkTreeViewColumn" id="searchNameCol">
+                                        <property name="title" translatable="yes">Name</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="searchNameRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">3</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
                                       <object class="GtkTreeViewColumn" id="searchWWIDCol">
                                         <property name="title" translatable="yes">WWID</property>
                                         <property name="clickable">True</property>
@@ -914,6 +930,132 @@
                                   </packing>
                                 </child>
                                 <child>
+                                  <object class="GtkTreeView" id="otherTreeView">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="hexpand">True</property>
+                                    <property name="vexpand">True</property>
+                                    <property name="model">otherModel</property>
+                                    <property name="headers_clickable">False</property>
+                                    <property name="rules_hint">True</property>
+                                    <property name="enable_search">False</property>
+                                    <property name="search_column">0</property>
+                                    <property name="enable_tree_lines">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection3"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherSelectedCol">
+                                        <child>
+                                          <object class="GtkCellRendererToggle" id="otherSelectedRenderer">
+                                            <signal name="toggled" handler="on_row_toggled" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="active">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherIDCol">
+                                        <property name="title" translatable="yes">Identifier</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherIDRendererer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">10</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherCapacityCol">
+                                        <property name="title" translatable="yes">Capacity</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherCapacityRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">6</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherVendorCol">
+                                        <property name="title" translatable="yes">Vendor</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherVendorRenderer"/>
+                                          <attributes>
+                                            <attribute name="yalign">2</attribute>
+                                            <attribute name="sensitive">1</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">7</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherInterconnectCol">
+                                        <property name="title" translatable="yes">Interconnect</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherInterconnectRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">8</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">5</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="otherClearButton">
+                                    <property name="label">gtk-clear</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">4</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="otherFindButton">
+                                    <property name="label">gtk-find</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="on_find_clicked" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <object class="GtkNotebook" id="otherTypeNotebook">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
@@ -1053,127 +1195,6 @@
                                     <property name="top_attach">0</property>
                                   </packing>
                                 </child>
-                                <child>
-                                  <object class="GtkTreeView" id="otherTreeView">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="vexpand">True</property>
-                                    <property name="model">otherModel</property>
-                                    <property name="headers_clickable">False</property>
-                                    <property name="rules_hint">True</property>
-                                    <property name="enable_search">False</property>
-                                    <property name="search_column">0</property>
-                                    <property name="enable_tree_lines">True</property>
-                                    <child internal-child="selection">
-                                      <object class="GtkTreeSelection" id="treeview-selection3"/>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherSelectedCol">
-                                        <child>
-                                          <object class="GtkCellRendererToggle" id="otherSelectedRenderer">
-                                            <signal name="toggled" handler="on_row_toggled" swapped="no"/>
-                                          </object>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="active">1</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherIDCol">
-                                        <property name="title" translatable="yes">Identifier</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherIDRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">10</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherCapacityCol">
-                                        <property name="title" translatable="yes">Capacity</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherCapacityRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">6</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherVendorCol">
-                                        <property name="title" translatable="yes">Vendor</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherVendorRenderer"/>
-                                          <attributes>
-                                            <attribute name="yalign">2</attribute>
-                                            <attribute name="sensitive">1</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">7</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherInterconnectCol">
-                                        <property name="title" translatable="yes">Interconnect</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherInterconnectRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">8</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="width">5</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="otherClearButton">
-                                    <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|Other">_Clear</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="use_underline">True</property>
-                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">4</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="otherFindButton">
-                                    <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|Other">_Find</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="use_underline">True</property>
-                                    <signal name="clicked" handler="on_find_clicked" swapped="no"/>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
                               </object>
                             </child>
                           </object>
@@ -1221,7 +1242,6 @@
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|zSeries">_Filter By:</property>
                                     <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">zFilterCombo</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
@@ -1229,29 +1249,16 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="zFilterTypeLabel">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|zSeries">_Label</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">zFilterEntry</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="zGoButton">
-                                    <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|zSeries">_Go</property>
+                                  <object class="GtkButton" id="zFindButton">
+                                    <property name="label" translatable="yes" context="GUI|Installation Destination|Filter|zSeries">_Find</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="use_underline">True</property>
+                                    <signal name="clicked" handler="on_find_clicked" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">4</property>
+                                    <property name="left_attach">3</property>
                                     <property name="top_attach">0</property>
                                   </packing>
                                 </child>
@@ -1262,32 +1269,10 @@
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="use_underline">True</property>
+                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">5</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkEntry" id="zFilterEntry">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="invisible_char">●</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkComboBox" id="zFilterCombo">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="hexpand">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
+                                    <property name="left_attach">4</property>
                                     <property name="top_attach">0</property>
                                   </packing>
                                 </child>
@@ -1301,9 +1286,6 @@
                                     <property name="rules_hint">True</property>
                                     <property name="enable_search">False</property>
                                     <property name="enable_tree_lines">True</property>
-                                    <child internal-child="selection">
-                                      <object class="GtkTreeSelection" id="treeview-selection4"/>
-                                    </child>
                                     <child>
                                       <object class="GtkTreeViewColumn" id="zSelectedCol">
                                         <child>
@@ -1333,6 +1315,20 @@
                                       </object>
                                     </child>
                                     <child>
+                                      <object class="GtkTreeViewColumn" id="zNameCol">
+                                        <property name="title" translatable="yes">Name</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="zNameRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">3</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
                                       <object class="GtkTreeViewColumn" id="zTypeCol">
                                         <property name="title" translatable="yes">Type</property>
                                         <property name="clickable">True</property>
@@ -1369,7 +1365,7 @@
                                           <attributes>
                                             <attribute name="sensitive">2</attribute>
                                             <attribute name="visible">0</attribute>
-                                            <attribute name="text">10</attribute>
+                                            <attribute name="text">16</attribute>
                                           </attributes>
                                         </child>
                                       </object>
@@ -1388,13 +1384,198 @@
                                         </child>
                                       </object>
                                     </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="zPortCol">
+                                        <property name="title" translatable="yes">Port</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="zPortRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">12</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
                                     <property name="top_attach">1</property>
-                                    <property name="width">6</property>
+                                    <property name="width">5</property>
                                   </packing>
                                 </child>
+                                <child>
+                                  <object class="GtkNotebook" id="zTypeNotebook">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="no_show_all">True</property>
+                                    <property name="hexpand">True</property>
+                                    <property name="show_tabs">False</property>
+                                    <child>
+                                      <object class="GtkLabel" id="label19">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="hexpand">True</property>
+                                      </object>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zCCWBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label23">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_CCW:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zCCWEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zCCWEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">???</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zWWPNBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label24">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_WWPN:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zWWPNEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zWWPNEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">???</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zLUNBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label22">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_LUN:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zLUNEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zLUNEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">???</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBoxText" id="zTypeCombo">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="entry_text_column">0</property>
+                                    <property name="id_column">1</property>
+                                    <items>
+                                      <item translatable="yes">None</item>
+                                      <item translatable="yes">CCW</item>
+                                      <item translatable="yes">WWPN</item>
+                                      <item translatable="yes">LUN</item>
+                                    </items>
+                                    <signal name="changed" handler="on_z_type_combo_changed" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                     <property name="height">1</property>
+                                   </packing>
+                                 </child>
                               </object>
                             </child>
                           </object>
diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
index 21e9737..0b6a9ca 100644
--- a/pyanaconda/ui/gui/spokes/filter.py
+++ b/pyanaconda/ui/gui/spokes/filter.py
@@ -33,6 +33,7 @@ from pyanaconda.ui.lib.disks import getDisks, isLocalDisk
 from pyanaconda.ui.gui.spokes import NormalSpoke
 from pyanaconda.ui.gui.spokes.advstorage.fcoe import FCoEDialog
 from pyanaconda.ui.gui.spokes.advstorage.iscsi import ISCSIDialog
+from pyanaconda.ui.gui.spokes.advstorage.zfcp import ZFCPDialog
 from pyanaconda.ui.gui.spokes.advstorage.dasd import DASDDialog
 from pyanaconda.ui.gui.spokes.lib.cart import SelectedDisksDialog
 from pyanaconda.ui.categories.system import SystemCategory
@@ -43,7 +44,7 @@ DiskStoreRow = namedtuple("DiskStoreRow", ["visible", "selected", "mutable",
                                            "name", "type", "model", "capacity",
                                            "vendor", "interconnect", "serial",
                                            "wwid", "paths", "port", "target",
-                                           "lun", "ccw"])
+                                           "lun", "ccw", "wwpn"])
 
 class FilterPage(object):
     """A FilterPage is the logic behind one of the notebook tabs on the filter
@@ -244,7 +245,7 @@ class MultipathPage(FilterPage):
                           disk.name, "", disk.model, str(disk.size),
                           disk.vendor, disk.bus, disk.serial,
                           disk.wwid, "\n".join(paths), "", "",
-                          "", ""])
+                          "", "", ""])
             if not disk.vendor in vendors:
                 vendors.append(disk.vendor)
 
@@ -304,6 +305,7 @@ class OtherPage(FilterPage):
         interconnects = []
 
         for disk in disks:
+            paths = [d.name for d in disk.parents]
             selected = disk.name in selectedNames
 
             if hasattr(disk, "node"):
@@ -317,7 +319,7 @@ class OtherPage(FilterPage):
                           disk.name, "", disk.model, str(disk.size),
                           disk.vendor, disk.bus, disk.serial,
                           self._long_identifier(disk), "", port, getattr(disk, "initiator", ""),
-                          lun, ""])
+                          lun, "", ""])
 
             if not disk.vendor in vendors:
                 vendors.append(disk.vendor)
@@ -366,19 +368,74 @@ class ZPage(FilterPage):
         self.model = self.builder.get_object("zModel")
         self.model.set_visible_func(self.visible_func)
 
+        self._ccwEntry = self.builder.get_object("zCCWEntry")
+        self._wwpnEntry = self.builder.get_object("zWWPNEntry")
+        self._lunEntry = self.builder.get_object("zLUNEntry")
+
         self._isS390 = arch.isS390()
 
+    def clear(self):
+        self._lunEntry.set_text("")
+        self._ccwEntry.set_text("")
+        self._wwpnEntry.set_text("")
+
     def ismember(self, device):
         return isinstance(device, ZFCPDiskDevice) or isinstance(device, DASDDevice)
 
     def setup(self, store, selectedNames, disks):
+        """ Set up our Z-page, but only if we're running on s390x. """
         if not self._isS390:
             return
+        else:
+            ccws = []
+            wwpns = []
+            luns = []
+
+            self._combo = self.builder.get_object("zTypeCombo")
+            self._combo.set_active(0)
+            self._combo.emit("changed")
+
+            for disk in disks:
+                paths = [d.name for d in disk.parents]
+                selected = disk.name in selectedNames
+
+                if getattr(disk, "type") == "zfcp":
+                    # remember to store all of the zfcp-related junk so we can
+                    # see it in the UI
+                    if not disk.fcp_lun in luns:
+                        luns.append(disk.fcp_lun)
+                    if not disk.wwpn in wwpns:
+                        wwpns.append(disk.wwpn)
+                    if not disk.hba_id in ccws:
+                        ccws.append(disk.hba_id)
+
+                    # now add it to our store
+                    store.append([True, selected, not disk.protected,
+                                  disk.name, "", disk.model, size_str(disk.size),
+                                  disk.vendor, disk.bus, disk.serial, "", "\n".join(paths),
+                                  "", "", disk.fcp_lun, disk.hba_id, disk.wwpn])
+
+    def _filter_func(self, device):
+        if not self.filterActive:
+            return True
+
+        filterBy = self._combo.get_active()
+
+        if filterBy == 0:
+            return True
+        elif filterBy == 1:
+            return self._ccwEntry.get_text() in device.hba_id
+        elif filterBy == 2:
+            return self._wwpnEntry.get_text() in device.wwpn
+        elif filterBy == 3:
+            return self._lunEntry.get_text() in device.fcp_lun
+
+        return False
 
     def visible_func(self, model, itr, *args):
         obj = DiskStoreRow(*model[itr])
         device = self.storage.devicetree.getDeviceByName(obj.name, hidden=True)
-        return self.ismember(device)
+        return self.ismember(device) and self._filter_func(device)
 
 class FilterSpoke(NormalSpoke):
     builderObjects = ["diskStore", "filterWindow",
@@ -464,7 +521,7 @@ class FilterSpoke(NormalSpoke):
         # these lists of disks, then call setup on each individual page.  This is
         # because there could be page-specific setup to do that requires a complete
         # view of all the disks on that page.
-        for disk in itertools.ifilterfalse(isLocalDisk, self.disks):
+        for disk in self.disks:
             if self.pages[1].ismember(disk):
                 multipathDisks.append(disk)
             elif self.pages[2].ismember(disk):
@@ -572,7 +629,15 @@ class FilterSpoke(NormalSpoke):
         self.refresh()
 
     def on_add_zfcp_clicked(self, widget, *args):
-        pass
+        dialog = ZFCPDialog(self.data, self.storage)
+
+        with enlightbox(self.window, dialog.window):
+            dialog.refresh()
+            dialog.run()
+
+        # We now need to refresh so any new disks picked up by adding advanced
+        # storage are displayed in the UI.
+        self.refresh()
 
     def on_add_dasd_clicked(self, widget, *args):
         dialog = DASDDialog(self.data, self.storage)
@@ -626,3 +691,17 @@ class FilterSpoke(NormalSpoke):
         findButton.set_sensitive(ndx != 0)
         clearButton.set_sensitive(ndx != 0)
         notebook.set_current_page(ndx)
+
+    ##
+    ## Z TAB SIGNAL HANDLERS
+    ##
+    def on_z_type_combo_changed(self, combo):
+        ndx = combo.get_active()
+
+        notebook = self.builder.get_object("zTypeNotebook")
+        findButton = self.builder.get_object("zFindButton")
+        clearButton = self.builder.get_object("zClearButton")
+
+        findButton.set_sensitive(ndx != 0)
+        clearButton.set_sensitive(ndx != 0)
+        notebook.set_current_page(ndx)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 688efa6..bf9f34a 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -484,7 +484,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         # handled here instead of refresh to take into account the user pressing
         # the rescan button on custom partitioning.
         for disk in filter(isLocalDisk, self.disks):
-            self._add_disk_overview(disk, self.local_disks_box)
+            # While technically local disks, zFCP devices are specialized
+            # storage and should not be shown here.
+            if disk.type is not "zfcp":
+                self._add_disk_overview(disk, self.local_disks_box)
 
         # Advanced disks are different.  Because there can potentially be a lot
         # of them, we do not display them in the box by default.  Instead, only
@@ -494,7 +497,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
             if name not in disk_names:
                 continue
             obj = self.storage.devicetree.getDeviceByName(name, hidden=True)
-            if isLocalDisk(obj):
+            # since zfcp devices may be detected as local disks when added
+            # manually, specifically check the disk type here to make sure
+            # we won't accidentally bypass adding zfcp devices to the disk
+            # overview
+            if isLocalDisk(obj) and obj.type is not "zfcp":
                 continue
 
             self._add_disk_overview(obj, self.specialized_disks_box)
-- 
1.8.3.1

