29 #include <qdebug.h> |
29 #include <qdebug.h> |
30 #include <qgraphicswidget.h> |
30 #include <qgraphicswidget.h> |
31 #include <qdir.h> |
31 #include <qdir.h> |
32 #include"settingswidget.h" |
32 #include"settingswidget.h" |
33 |
33 |
34 const char *WIZARD_VIEW = "tocView"; |
|
35 |
|
36 // --------------------------------------------------------------------------- |
34 // --------------------------------------------------------------------------- |
37 // SearchSettingsState::SearchSettingsState |
35 // SearchSettingsState::SearchSettingsState |
38 // --------------------------------------------------------------------------- |
36 // --------------------------------------------------------------------------- |
39 // |
37 // |
40 SearchSettingsState::SearchSettingsState(QState *parent) : |
38 SearchSettingsState::SearchSettingsState(QState *parent) : |
41 QState(parent), mDocumentLoader(NULL) |
39 QState(parent), mDocumentLoader(NULL) |
42 { |
40 { |
43 minitialCount = true; |
41 minitialCount = true; |
44 mWidget = new SettingsWidget(); |
42 mWidget = new SettingsWidget(); |
45 |
43 |
46 connect(mWidget, SIGNAL(settingsEvent(bool)), this, SLOT(handleBackEvent(bool))); |
44 connect(mWidget, SIGNAL(settingsEvent(bool)), this, |
|
45 SLOT(handleBackEvent(bool))); |
47 |
46 |
48 connect(mWidget, SIGNAL(selectedItemCategory(int, bool)), this, |
47 connect(mWidget, SIGNAL(selectedItemCategory(int, bool)), this, |
49 SLOT(getItemCategory(int, bool))); |
48 SLOT(getItemCategory(int, bool))); |
50 |
49 |
51 } |
50 } |
52 // --------------------------------------------------------------------------- |
|
53 // SearchSettingsState::_selectedcategory |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 void SearchSettingsState::getItemCategory(int str, bool avalue) |
|
57 { |
|
58 emit publishSelectedCategory(str, avalue); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
51 // --------------------------------------------------------------------------- |
62 // SearchSettingsState::~SearchSettingsState |
52 // SearchSettingsState::~SearchSettingsState |
63 // --------------------------------------------------------------------------- |
53 // --------------------------------------------------------------------------- |
64 // |
54 // |
65 SearchSettingsState::~SearchSettingsState() |
55 SearchSettingsState::~SearchSettingsState() |
66 { |
56 { |
67 delete mDocumentLoader; |
57 delete mDocumentLoader; |
68 // delete mWidget; |
58 delete mWidget; |
69 |
59 |
70 } |
60 } |
71 |
61 // --------------------------------------------------------------------------- |
|
62 // SearchSettingsState::getItemCategory |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 void SearchSettingsState::getItemCategory(int str, bool avalue) |
|
66 { |
|
67 emit publishSelectedCategory(str, avalue); |
|
68 } |
72 // --------------------------------------------------------------------------- |
69 // --------------------------------------------------------------------------- |
73 // SearchSettingsState::onEntry |
70 // SearchSettingsState::onEntry |
74 // --------------------------------------------------------------------------- |
71 // --------------------------------------------------------------------------- |
75 // |
72 // |
76 void SearchSettingsState::onEntry(QEvent *event) |
73 void SearchSettingsState::onEntry(QEvent *event) |
77 { |
74 { |
78 qDebug() << "search:SearchSettingsState::onEntry"; |
75 qDebug() << "search:SearchSettingsState::onEntry"; |
79 QState::onEntry(event); |
76 QState::onEntry(event); |
80 if (minitialCount) |
77 if (minitialCount) |
81 { |
78 { |
82 mWidget->loadSettingsFrominiFile(); |
79 mWidget->loadBaseSettings(); |
|
80 mWidget->loadDeviceSettings(); |
83 isInternetOn(); |
81 isInternetOn(); |
84 minitialCount = false; |
82 minitialCount = false; |
85 emit backEventTriggered(); |
83 emit backEventTriggered(); |
86 } |
84 } |
87 else |
85 else |
88 { |
86 { |
89 |
87 |
90 mWidget->launchSettingWidget(); |
88 mWidget->launchSettingWidget(); |
91 } |
89 } |
92 } |
90 } |
93 |
|
94 // --------------------------------------------------------------------------- |
91 // --------------------------------------------------------------------------- |
95 // SearchSettingsState::onExit |
92 // SearchSettingsState::onExit |
96 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
97 // |
94 // |
98 void SearchSettingsState::onExit(QEvent *event) |
95 void SearchSettingsState::onExit(QEvent *event) |
99 { |
96 { |
100 QState::onExit(event); |
97 QState::onExit(event); |
101 |
98 |
102 } |
99 } |
103 |
100 // --------------------------------------------------------------------------- |
|
101 // SearchSettingsState::handleBackEvent |
|
102 // --------------------------------------------------------------------------- |
|
103 // |
104 void SearchSettingsState::handleBackEvent(bool aStatus) |
104 void SearchSettingsState::handleBackEvent(bool aStatus) |
105 { |
105 { |
106 emit backEventTriggered(); |
106 emit backEventTriggered(); |
107 if (mWidget) |
107 if (mWidget) |
108 { |
108 { |
109 isInternetOn(); |
109 isInternetOn(); |
110 emit clickstatus(aStatus); |
110 emit clickstatus(aStatus); |
111 } |
111 } |
112 } |
112 } |
113 // --------------------------------------------------------------------------- |
113 // --------------------------------------------------------------------------- |
114 // SearchSettingsState::isInternetOn |
114 // SearchSettingsState::isInternetOn |
115 // --------------------------------------------------------------------------- |
115 // --------------------------------------------------------------------------- |
116 // |
116 // |