summaryrefslogtreecommitdiffstats
path: root/src/toplevel.cpp
blob: cecfa36d10ef00a55f4f26e07715e08c10c9281f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <kxmlguiclient.h>
#include <kapplication.h>
#include <kconfig.h>


#include "toplevel.h"
#include "core.h"

#include "simplemainwindow.h"

KDevMainWindow *TopLevel::s_instance = 0;

bool TopLevel::mainWindowValid()
{
  return s_instance != 0;
}

KDevMainWindow *TopLevel::getInstance()
{
  if (!s_instance)
  {
    SimpleMainWindow *mainWindow = new SimpleMainWindow(0, "SimpleMainWindow");
    s_instance = mainWindow;
    mainWindow->init();
    kapp->setMainWidget(mainWindow);
  }

  return s_instance;
}

void TopLevel::tqinvalidateInstance(KDevMainWindow *instance)
{
  if ( s_instance == instance )
    s_instance = 0;
}