Skip to content

Commit

Permalink
Added File->Close menu item in the dialog inspector
Browse files Browse the repository at this point in the history
During installation it's not possible to close a window
using the window manager. After opening the dialog inspector
you could not go back to the installer.

The dummy (not implemented) "Export" menu item has been removed.
  • Loading branch information
lslezak committed Feb 10, 2021
1 parent b657532 commit 830deb8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions libyui/src/YDialogSpy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ class YDialogSpyPrivate
YPushButton * downButton;
YReplacePoint * propReplacePoint;
YTable * propTable;
YMenuItem * exportMenu;
// YMenuItem * exportMenu;
YMenuItem * closeItem;


YWidget * selectedWidget();
Expand Down Expand Up @@ -233,8 +234,10 @@ YDialogSpy::YDialogSpy( YDialog * targetDialog )
auto fileMenu = fac->createMenuButton( alignment, "&File" );

YItemCollection items;
priv->exportMenu = new YMenuItem( "Export (TODO)" );
items.push_back( priv->exportMenu );
// priv->exportMenu = new YMenuItem( "Export (TODO)" );
// items.push_back( priv->exportMenu );
priv->closeItem = new YMenuItem( "Close" );
items.push_back( priv->closeItem );
fileMenu->addItems( items );

auto minSize = fac->createMinSize( vbox, TREE_WIDTH, TREE_HEIGHT );
Expand Down Expand Up @@ -518,7 +521,10 @@ void YDialogSpy::exec()
YMenuItem * menu_item = dynamic_cast<YMenuItem *>(event->item());

// TODO: handle the export menu item
if (menu_item == priv->exportMenu) continue;
// if (menu_item == priv->exportMenu) continue;

// closing from menu
if (menu_item == priv->closeItem) break;

// handle all unhandled menu items as "Add" menu items, this is much
// simpler than comparing it with the huge amount of menu item pointers
Expand Down

0 comments on commit 830deb8

Please sign in to comment.