KateMainWindow *KateApp::newMainWindow (KConfig *sconfig_, const QString &sgroup_) { KConfig *sconfig = sconfig_ ? sconfig_ : KGlobal::config().data(); QString sgroup = !sgroup_.isEmpty() ? sgroup_ : "MainWindow0"; KateMainWindow *mainWindow = new KateMainWindow (sconfig, sgroup); mainWindow->show (); return mainWindow; }
void KateAppAdaptor::activate () { KateMainWindow *win = m_app->activeMainWindow(); if (!win) return; win->show(); win->activateWindow(); win->raise(); #ifdef Q_WS_X11 KWindowSystem::forceActiveWindow (win->winId ()); KWindowSystem::raiseWindow (win->winId ()); #endif }
KateMainWindow *KateApp::newMainWindow (KConfig *sconfig, const QString &sgroup) { KateMainWindow *mainWindow = new KateMainWindow (sconfig, sgroup); m_mainWindows.push_back (mainWindow); if ((mainWindows() > 1) && m_mainWindows[m_mainWindows.count()-2]->viewManager()->activeView()) mainWindow->viewManager()->activateView ( m_mainWindows[m_mainWindows.count()-2]->viewManager()->activeView()->getDoc()->documentNumber() ); else if ((mainWindows() > 1) && (m_docManager->documents() > 0)) mainWindow->viewManager()->activateView ( (m_docManager->document(m_docManager->documents()-1))->documentNumber() ); else if ((mainWindows() > 1) && (m_docManager->documents() < 1)) mainWindow->viewManager()->openURL ( KURL() ); mainWindow->show (); return mainWindow; }