From 4a1a705bffc99cd389dda1cafcdf7b5d3a4fc473 Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 2 May 2017 09:58:57 +0000 Subject: [PATCH] Only show the View menu when it's needed. --- main_window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main_window.py b/main_window.py index 33ecc80..4f1213a 100644 --- a/main_window.py +++ b/main_window.py @@ -73,9 +73,6 @@ class MainWindow( QMainWindow ) : action.setStatusTip( "Close the program." ) action.triggered.connect( self.close ) file_menu.addAction( action ) - # initialize the menu - self.view_menu = menu_bar.addMenu( "&View" ) - self.view_menu.aboutToShow.connect( self.on_about_to_show_view_menu ) # load the window settings self.resize( globals.app_settings.value( MAINWINDOW_SIZE , QSize(500,300) ) ) self.move( globals.app_settings.value( MAINWINDOW_POSITION , QPoint(200,200) ) ) @@ -130,6 +127,9 @@ class MainWindow( QMainWindow ) : # open the database db.open_database( db_fname , False ) globals.cards = db.load_cards() + # show the View menu + self.view_menu = self.menuBar().addMenu( "&View" ) + self.view_menu.aboutToShow.connect( self.on_about_to_show_view_menu ) # ask the user to add the first card self.add_card_action.setEnabled( True ) self.on_add_card()