19 #include "cpmainview.h" |
19 #include "cpmainview.h" |
20 #include <cpplugininterface.h> |
20 #include <cpplugininterface.h> |
21 #include <cpcategorysettingformitemdata.h> |
21 #include <cpcategorysettingformitemdata.h> |
22 #include <hbapplication.h> |
22 #include <hbapplication.h> |
23 #include <cpevent.h> |
23 #include <cpevent.h> |
24 |
24 #include <QTimer> |
25 //CpMainWindow implementation |
25 //CpMainWindow implementation |
26 CpMainWindow::CpMainWindow(QWidget *parent /*= 0*/, Hb::WindowFlags windowFlags /*= Hb::WindowFlagNone*/) |
26 CpMainWindow::CpMainWindow(QWidget *parent /*= 0*/, Hb::WindowFlags windowFlags /*= Hb::WindowFlagNone*/) |
27 : HbMainWindow(parent,windowFlags) |
27 : HbMainWindow(parent,windowFlags),mStartupTimer(0) |
28 { |
28 { |
|
29 // start a zero interval timer to identify the startup of control panel is finished. |
|
30 mStartupTimer = new QTimer(this); |
|
31 connect(mStartupTimer, SIGNAL(timeout()), this, SLOT(onStartupFininshed())); |
|
32 mStartupTimer->start(); |
29 } |
33 } |
30 |
34 |
31 CpMainWindow::~CpMainWindow() |
35 CpMainWindow::~CpMainWindow() |
32 { |
36 { |
33 |
37 CpMainView *mainView = qobject_cast<CpMainView *>(views().first()); |
|
38 if(mainView != 0) { |
|
39 mainView->saveActivity(); |
|
40 } |
|
41 if(mStartupTimer != 0) { |
|
42 delete mStartupTimer; |
|
43 } |
34 } |
44 } |
35 |
45 |
36 bool CpMainWindow::event(QEvent *e) |
46 bool CpMainWindow::event(QEvent *e) |
37 { |
47 { |
38 if (e->type() == (QEvent::Type)(CpCreatePluginItemDataEvent::CreatePluginItemData)) { |
48 if (e->type() == (QEvent::Type)(CpCreatePluginItemDataEvent::CreatePluginItemData)) { |