void ZLQtApplicationWindow::onRefresh() { for (std::list<ZLQtAction*>::const_iterator it = myMenuActions.begin(); it != myMenuActions.end(); ++it) { ZLQtAction *action = *it; action->setVisible(application().isActionVisible(action->Id)); action->setEnabled(application().isActionEnabled(action->Id)); } for (std::list<ZLQtMenu*>::const_iterator it = mySubmenuList.begin(); it != mySubmenuList.end(); ++it) { ZLQtMenu *menu = *it; shared_ptr<ZLPopupData> data = application().popupData(menu->Id); if (data.isNull() || data->generation() == menu->Generation) { continue; } menu->Generation = data->generation(); menu->clear(); const size_t count = data->count(); for (size_t i = 0; i < count; ++i) { ZLQtAction *action = new ZLQtAction(application(), menu->Id, menu); action->setActionIndex(i); action->setText(::qtString(data->text(i))); menu->addAction(action); } } refreshToolbar(); qApp->processEvents(); }
//These two functions enable us to listen for messages about //updating ourselves ... which we then pass to refresh bool EV_BeOSToolbar::bindListenerToView(AV_View * pView) { _releaseListener(); m_pViewListener = new EV_BeOSToolbar_ViewListener(this,pView); UT_ASSERT(m_pViewListener); AV_ListenerId lid; bool bResult = pView->addListener(static_cast<AV_Listener *>(m_pViewListener),&lid); UT_ASSERT(bResult); if (pView->isDocumentPresent()) refreshToolbar(pView, AV_CHG_ALL); return true; }
IdealIRC::IdealIRC(QWidget *parent) : QMainWindow(parent), ui(new Ui::IdealIRC), firstShow(true), windowIsActive(true), confDlg(NULL), favourites(NULL), chanlist(NULL), scriptManager(NULL), connectionsRemaining(-1), preventSocketAction(false), reconnect(NULL), scriptParent(this, this, &conf, &conlist, &winlist, &activeWid, &activeConn) { ui->setupUi(this); connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(applicationFocusChanged(QWidget*,QWidget*))); ui->menuIIRC->addAction(ui->actionConnect); ui->menuIIRC->addAction(ui->actionOptions); ui->menuTools->addAction(ui->actionChannel_favourites); ui->menuTools->addAction(ui->actionChannels_list); ui->menuTools->addAction(ui->actionScript_Manager); QString version = QString("IdealIRC %1").arg(VERSION_STRING); setWindowTitle(version); trayicon.setToolTip(version); trayicon.setIcon( QIcon(":/gfx/icon16x16.png") ); trayicon.setVisible(true); conf.rehash(); setGeometry(conf.mainWinGeo); if (conf.maximized) setWindowState(Qt::WindowMaximized); ui->toolBar->setVisible(conf.showToolBar); connect(&vc, SIGNAL(gotVersion()), this, SLOT(versionReceived())); if (conf.checkVersion) vc.runChecker(); QFont f(conf.fontName); f.setPixelSize(conf.fontSize); ui->treeWidget->setFont(f); updateTreeViewColor(); connect(&scriptParent, SIGNAL(RequestWindow(QString,int,int,bool)), this, SLOT(CreateSubWindow(QString,int,int,bool))); connect(&trayicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onTrayActivated(QSystemTrayIcon::ActivationReason))); connect(&wsw, SIGNAL(windowSwitched(int)), this, SLOT(switchWindows(int))); connect(&wsw, SIGNAL(windowClosed(int)), this, SLOT(subWinClosed(int))); connect(&scriptParent, SIGNAL(refreshToolbar()), this, SLOT(rebuildCustomToolbar())); toolBtnMap = new QSignalMapper(this); connect(toolBtnMap, SIGNAL(mapped(QString)), this, SLOT(customToolBtnClick(QString))); }
void ZLApplicationWindow::refresh() { refreshToolbar(WINDOW_TOOLBAR); refreshToolbar(FULLSCREEN_TOOLBAR); processAllEvents(); }