15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <QtGui> |
18 #include <QtGui> |
19 #include <QDebug> |
19 #include <QDebug> |
|
20 |
|
21 //#define BUBBLETEST_ENABLE_TESTABILITY |
|
22 #ifdef BUBBLETEST_ENABLE_TESTABILITY |
|
23 #include <QtPlugin> |
|
24 #include <QPluginLoader> |
|
25 #include <QLibraryInfo> |
|
26 #include "testabilityinterface.h" |
|
27 #endif |
|
28 |
20 #include <hbaction.h> |
29 #include <hbaction.h> |
21 #include <hbtoolbar.h> |
30 #include <hbtoolbar.h> |
22 #include <bubblemanager2.h> |
31 #include <bubblemanager2.h> |
23 #include <hbmenu.h> |
32 #include <hbmenu.h> |
24 #include <hbmainwindow.h> |
33 #include <hbmainwindow.h> |
25 #include "bubbletestview.h" |
34 #include "bubbletestview.h" |
26 #include <hbeffect.h> |
35 #include <hbeffect.h> |
27 |
36 |
|
37 |
28 BubbleTestView::BubbleTestView(HbMainWindow& window, QGraphicsItem *parent) : |
38 BubbleTestView::BubbleTestView(HbMainWindow& window, QGraphicsItem *parent) : |
29 HbView (parent), mMainWindow(window), mMuted(0), mConfBubbleId(-1), |
39 HbView (parent), mMainWindow(window), mMuted(0), mConfBubbleId(-1), |
30 mProvideJoin(false) |
40 mProvideJoin(false) |
31 { |
41 { |
32 setFlags (QGraphicsItem::ItemIsFocusable); |
42 setFlags (QGraphicsItem::ItemIsFocusable); |
33 setFocusPolicy (Qt::StrongFocus); |
43 setFocusPolicy (Qt::StrongFocus); |
34 setTitle("BubbleTest2"); |
44 setTitle("BubbleTest2"); |
|
45 |
|
46 loadTestabilityPlugin(); |
35 |
47 |
36 // the widget under the test |
48 // the widget under the test |
37 mBubbleManager = new BubbleManager (this); |
49 mBubbleManager = new BubbleManager (this); |
38 setWidget(mBubbleManager); |
50 setWidget(mBubbleManager); |
39 |
51 |
360 call.callState == BubbleManager::OnHold ) { |
372 call.callState == BubbleManager::OnHold ) { |
361 bubbleManager().updateCallTime(call.bubbleId,"00:00:01"); |
373 bubbleManager().updateCallTime(call.bubbleId,"00:00:01"); |
362 } |
374 } |
363 } |
375 } |
364 } |
376 } |
365 } |
377 break; |
366 |
378 } |
|
379 |
|
380 case 'C': { // ciphering |
|
381 mCipheringOff->setChecked(!mCipheringOff->isChecked()); |
|
382 break; |
|
383 } |
|
384 |
|
385 case 'D': { // divert |
|
386 mCallDivert->setChecked(!mCallDivert->isChecked()); |
|
387 break; |
|
388 } |
|
389 |
|
390 case 'I': { // image |
|
391 mContactPicture->setChecked(!mContactPicture->isChecked()); |
|
392 break; |
|
393 } |
|
394 |
|
395 case 'N': { // remote name |
|
396 mContactName->setChecked(!mContactName->isChecked()); |
|
397 break; |
|
398 } |
|
399 |
|
400 case 'T': { // timer |
|
401 mCallTimer->setChecked(!mCallTimer->isChecked()); |
|
402 break; |
|
403 } |
|
404 |
367 default: |
405 default: |
368 break; |
406 break; |
369 } |
407 } |
370 } |
408 } |
371 |
409 |
1019 } |
1057 } |
1020 j++; |
1058 j++; |
1021 } |
1059 } |
1022 } |
1060 } |
1023 |
1061 |
|
1062 void BubbleTestView::loadTestabilityPlugin() |
|
1063 { |
|
1064 #ifdef BUBBLETEST_ENABLE_TESTABILITY |
|
1065 QString testabilityPlugin = "testability/testability"; |
|
1066 QString testabilityPluginPostfix = ".dll"; |
|
1067 |
|
1068 testabilityPlugin = QLibraryInfo::location(QLibraryInfo::PluginsPath) + |
|
1069 QObject::tr("/") + testabilityPlugin + |
|
1070 testabilityPluginPostfix; |
|
1071 |
|
1072 QPluginLoader loader(testabilityPlugin.toLatin1().data()); |
|
1073 |
|
1074 QObject *plugin = loader.instance(); |
|
1075 if (plugin) { |
|
1076 qDebug("Testability plugin loaded successfully!"); |
|
1077 mTestabilityInterface = qobject_cast<TestabilityInterface *>(plugin); |
|
1078 |
|
1079 if (mTestabilityInterface) { |
|
1080 qDebug("Testability interface obtained!"); |
|
1081 mTestabilityInterface->Initialize(); |
|
1082 } else { |
|
1083 qDebug("Failed to get testability interface!"); |
|
1084 } |
|
1085 } else { |
|
1086 qDebug("Testability plugin %s load failed with error:%s", |
|
1087 testabilityPlugin.toLatin1().data(), |
|
1088 loader.errorString().toLatin1().data()); |
|
1089 } |
|
1090 #endif |
|
1091 } |
|
1092 |