Back to index

texmacs  1.0.7.15
QTMGuiHelper.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003  * MODULE     : QTMGuiHelper.cpp
00004  * DESCRIPTION: QT Gui helper class. Infrastructure for delayed menu installation 
00005  * COPYRIGHT  : (C) 2008 Massimiliano Gubinelli
00006  *******************************************************************************
00007  * This software falls under the GNU general public license version 3 or later.
00008  * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009  * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010  ******************************************************************************/
00011 
00012 
00013 #include "QTMGuiHelper.hpp"
00014 #include "qt_tm_widget.hpp"
00015 
00016 void
00017 QTMGuiHelper::aboutToShowMainMenu() {
00018     //cout << "Show :" << menu_count << LF;
00019   menu_count++;
00020 }
00021 
00022 void 
00023 QTMGuiHelper::aboutToHideMainMenu() {
00024   menu_count--;
00025     //cout << "Hide :" << menu_count << " " << N(waiting_widgets) <<  LF;
00026   if (menu_count <= 0) {
00027     menu_count = 0;
00028     QTimer::singleShot (0, the_gui->gui_helper, SLOT (doPopWaitingWidgets ()));
00029   }
00030 }
00031 
00032 void 
00033 QTMGuiHelper::doPopWaitingWidgets() {
00034   if (!is_nil(waiting_widgets)) {
00035     if (DEBUG_QT)
00036       cout << "Installing postponed menu" << LF;
00037     waiting_widgets->item->install_main_menu();
00038     waiting_widgets = waiting_widgets->next;
00039   }
00040 }
00041