42 /*! |
42 /*! |
43 USBIndicator::handleInteraction |
43 USBIndicator::handleInteraction |
44 */ |
44 */ |
45 bool USBIndicator::handleInteraction(InteractionType type) |
45 bool USBIndicator::handleInteraction(InteractionType type) |
46 { |
46 { |
|
47 myDebug() << ">>> USBIndicator::handleInteraction"; |
47 bool handled = false; |
48 bool handled = false; |
48 TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), |
49 TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), |
49 TUid::Uid(KUSBUIUid)); |
50 TUid::Uid(KUSBUIUid)); |
50 if (type == InteractionActivated) { |
51 if (type == InteractionActivated) { |
51 RProcess usbUiProcess; |
52 RProcess usbUiProcess; |
54 usbUiProcess.Resume(); |
55 usbUiProcess.Resume(); |
55 } |
56 } |
56 usbUiProcess.Close(); |
57 usbUiProcess.Close(); |
57 handled = true; |
58 handled = true; |
58 } |
59 } |
|
60 myDebug() << "<<< USBIndicator::handleInteraction"; |
59 return handled; |
61 return handled; |
60 } |
62 } |
61 |
63 |
62 /*! |
64 /*! |
63 USBIndicator::indicatorData |
65 USBIndicator::indicatorData |
64 returns the data and icon that needs to be displayed in the universal pop up and indicator menu |
66 returns the data and icon that needs to be displayed in the universal pop up and indicator menu |
65 */ |
67 */ |
66 QVariant USBIndicator::indicatorData(int role) const |
68 QVariant USBIndicator::indicatorData(int role) const |
67 { |
69 { |
|
70 myDebug() << ">>> USBIndicator::indicatorData, role is " << role; |
68 switch(role) { |
71 switch(role) { |
69 case PrimaryTextRole: |
72 case PrimaryTextRole: |
70 { |
73 { |
71 QString text = QString(hbTrId("txt_usb_dblist_usb_connected")); |
74 QString text = QString(hbTrId("txt_usb_dblist_usb_connected")); |
72 return text; |
75 return text; |
73 } |
76 } |
74 case SecondaryTextRole: |
77 case SecondaryTextRole: |
75 { |
78 { |
76 return mSecDisplayName; |
79 return mSecDisplayName; |
77 } |
80 } |
78 case DecorationNameRole: |
81 case DecorationNameRole: |
79 { |
82 { |
80 QString iconName(KUsbIconFile); |
83 QString iconName(KUsbIconFile); |
81 return iconName; |
84 return iconName; |
82 } |
85 } |
83 default: |
86 default: |
84 return QVariant(); |
87 return QVariant(); |
85 } |
88 } |
86 } |
89 } |
87 |
90 |
88 /*! |
91 /*! |
89 USBIndicator::handleClientRequest |
92 USBIndicator::handleClientRequest |
90 handles client's activate and deactivate request |
93 handles client's activate and deactivate request |
91 */ |
94 */ |
92 bool USBIndicator::handleClientRequest( RequestType type, |
95 bool USBIndicator::handleClientRequest( RequestType type, |
93 const QVariant ¶meter) |
96 const QVariant ¶meter) |
94 { |
97 { |
|
98 myDebug() << ">>> USBIndicator::handleClientRequest"; |
95 switch (type) { |
99 switch (type) { |
96 case RequestActivate: |
100 case RequestActivate: |
97 { |
101 { |
98 QString friendlyName = parameter.toString(); |
102 QString friendlyName = parameter.toString(); |
99 friendlyName.replace( QChar(' '), QChar('_') ); |
103 friendlyName.replace( QChar(' '), QChar('_') ); |