systemsettings/accindicatorplugin/src/accindicator.cpp
changeset 72 56a7be608841
parent 46 eea20ed08f4b
equal deleted inserted replaced
71:9352913932ef 72:56a7be608841
    94     if (type == InteractionActivated) 
    94     if (type == InteractionActivated) 
    95         {
    95         {
    96         // If it is 3-pole ( i.e., HeadSet or TTY ) and TV-Out enable the handleInteraction() to change the settings.
    96         // If it is 3-pole ( i.e., HeadSet or TTY ) and TV-Out enable the handleInteraction() to change the settings.
    97         if(mAccMode == EAccModeWiredHeadset || mAccMode == EAccModeWirelessHeadset || mAccMode == EAccModeTextDevice || mAccMode == EAccModeTVOut )
    97         if(mAccMode == EAccModeWiredHeadset || mAccMode == EAccModeWirelessHeadset || mAccMode == EAccModeTextDevice || mAccMode == EAccModeTVOut )
    98             {
    98             {
    99             QObject::connect( &mProcess, SIGNAL(error(QProcess::ProcessError)),                       
       
   100                               this, SLOT(processError(QProcess::ProcessError)));
       
   101 
    99 
   102             QVariant mode,type;
   100             QVariant mode,type;
   103             mode.setValue((int)mAccMode); 
   101             mode.setValue((int)mAccMode); 
   104             type.setValue((int)mAccType);
   102             type.setValue((int)mAccType);
   105             mArgs.append(mode.toString());
   103             mArgs.append(mode.toString());
   106             mArgs.append(type.toString());
   104             mArgs.append(type.toString());
   107             
   105             
   108             // Launch the process to show the view.
   106             // Launch the process to show the view.
   109             mProcess.start("accindicatorsettings" , mArgs);
   107             QString program("z://sys//bin//accindicatorsettings.exe");
       
   108 		        QProcess::startDetached(program,mArgs);
   110             handled = true;
   109             handled = true;
   111             }
   110             }
   112         }
   111         }
   113     return handled;
   112     return handled;
   114     }
   113     }
   126             {
   125             {
   127             QString type(mDisplayName);
   126             QString type(mDisplayName);
   128             return type;
   127             return type;
   129             }
   128             }
   130         //for displaying the icon in indicator.
   129         //for displaying the icon in indicator.
   131         case MonoDecorationNameRole:
   130         case DecorationNameRole:
   132             {
   131             {
   133             QString iconName;
   132             QString iconName;
   134             if(mAccType == KPCWired || mAccType == KPCUSB)
   133             if(mAccType == KPCWired || mAccType == KPCUSB)
   135                 {
   134                 {
   136                 iconName = QString("z:/resource/accindicator/wired_accessory.svg");
   135                 iconName = QString("z:/resource/accindicator/wired_accessory.svg");
   226             break;
   225             break;
   227         default :
   226         default :
   228             mDisplayName.append(QString("Unknown"));
   227             mDisplayName.append(QString("Unknown"));
   229         }
   228         }
   230     }
   229     }
   231 
       
   232 // ----------------------------------------------------------------------------
       
   233 // AccIndicator::processError
       
   234 // handle the error conditions reurned by the QProcess.
       
   235 // ----------------------------------------------------------------------------
       
   236 
       
   237 void AccIndicatorPlugin::processError(QProcess::ProcessError err)
       
   238     {
       
   239     switch (err) {   
       
   240         case QProcess::FailedToStart: 
       
   241         case QProcess::Crashed: 
       
   242         case QProcess::Timedout: 
       
   243         case QProcess::ReadError: 
       
   244         case QProcess::WriteError: 
       
   245         case QProcess::UnknownError:
       
   246              break;  
       
   247         default:
       
   248             break;
       
   249         }
       
   250     }