mediasettings/videosettingsplugin/src/videosettingsaccesspointentry.cpp
changeset 67 72c709219fcd
parent 40 13331705e488
equal deleted inserted replaced
66:adb51f74b890 67:72c709219fcd
     9  * Initial Contributors:
     9  * Initial Contributors:
    10  * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  *
    13  *
    14  * Description:
    14  * Description: This class is HbDataFormModelItem::ToggleValueItem type item which is
       
    15  *              used to launch access point selection dialog. Toggle functionality is
       
    16  *              not used. This class type is used just because it offers correct look
       
    17  *              and offers data modify capabilities.
    15  *
    18  *
    16  */
    19  */
    17 
    20 
    18 #include "mpxvideo_debug.h"
    21 #include "mpxvideo_debug.h"
    19 #include "videosettingsaccesspointentry.h"
    22 #include "videosettingsaccesspointentry.h"
    25 // ---------------------------------------------------------------------------
    28 // ---------------------------------------------------------------------------
    26 // Constructor
    29 // Constructor
    27 // ---------------------------------------------------------------------------
    30 // ---------------------------------------------------------------------------
    28 //
    31 //
    29 VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry(
    32 VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry(
    30     CpItemDataHelper &itemDataHelper,
    33         CpItemDataHelper &itemDataHelper,
    31     const QString& text,
    34         const QString& labelText,
    32     VideoSettingsGroup *parent) :
    35         VideoSettingsGroup *parent) :
    33     CpSettingFormEntryItemData(CpSettingFormEntryItemData::ButtonEntryItem, 
    36 CpSettingFormItemData(HbDataFormModelItem::ToggleValueItem, labelText, parent),
    34         itemDataHelper, text, QString(), QString(), parent),
    37 mParent(parent)
    35     mParent(parent)
       
    36 {
    38 {
    37     MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry()"));
    39     MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::VideoSettingsAccessPointEntry()"));
    38     
    40 
    39     itemDataHelper.addConnection(this,SIGNAL(clicked()),this,SLOT(openSelectionDialogSlot()));
    41     itemDataHelper.addConnection(this, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)),
       
    42             this, SLOT(openSelectionDialogSlot()));
       
    43 
    40     mApplSettings = new CmApplSettingsUi(this);
    44     mApplSettings = new CmApplSettingsUi(this);
    41     connect(mApplSettings, SIGNAL(finished(uint)), this, SLOT(accessPointDialogFinished(uint)));
    45     connect(mApplSettings, SIGNAL(finished(uint)), this, SLOT(accessPointDialogFinished(uint)));
    42     mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod;
    46     mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod;
    43     mSelection.id = 0;
    47     mSelection.id = 0;
    44     mCmManager = new CmManagerShim();
    48     mCmManager = new CmManagerShim();    
    45 }
    49 }
    46 
    50 
    47 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    48 // Destructor
    52 // Destructor
    49 // ---------------------------------------------------------------------------
    53 // ---------------------------------------------------------------------------
    80         }
    84         }
    81     }
    85     }
    82     
    86     
    83     if(!found)
    87     if(!found)
    84     {
    88     {
    85         this->setDescription(hbTrId("txt_videos_dblist_none"));
    89         QString name(hbTrId("txt_videos_dblist_none"));
       
    90         
       
    91         // Our widget is "toggle type", so we have to store data to both fields
       
    92         // to keep it show the same value, no matter how user toggless it.
       
    93         setContentWidgetData("text", QVariant(name));
       
    94         setContentWidgetData("additionalText", QVariant(name));        
    86     }
    95     }
    87 }
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // createSettingView
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 CpBaseSettingView* VideoSettingsAccessPointEntry::createSettingView() const
       
    94 {
       
    95     MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::createSettingView()"));
       
    96     
       
    97     // does not create a new view.
       
    98     return 0;
       
    99 }
    96 }
   100 
    97 
   101 // ---------------------------------------------------------------------------
    98 // ---------------------------------------------------------------------------
   102 // getConnectionMethod
    99 // getConnectionMethod
   103 // ---------------------------------------------------------------------------
   100 // ---------------------------------------------------------------------------
   124 void VideoSettingsAccessPointEntry::setAccessPointName(CmConnectionMethodShim* connMethod)
   121 void VideoSettingsAccessPointEntry::setAccessPointName(CmConnectionMethodShim* connMethod)
   125 {
   122 {
   126     MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::setAccessPointName()"));
   123     MPX_ENTER_EXIT(_L("VideoSettingsAccessPointEntry::setAccessPointName()"));
   127     
   124     
   128     QString name = connMethod->getStringAttribute(CMManagerShim::CmName);
   125     QString name = connMethod->getStringAttribute(CMManagerShim::CmName);
   129     this->setDescription(name);
   126     
       
   127     // Our widget is "toggle type", so we have to store data to both fields
       
   128     // to keep it show the same value, no matter how user toggless it.
       
   129     setContentWidgetData("text", QVariant(name));
       
   130     setContentWidgetData("additionalText", QVariant(name));
   130 }
   131 }
   131 
   132 
   132 // ---------------------------------------------------------------------------
   133 // ---------------------------------------------------------------------------
   133 // openSelectionDialogSlot
   134 // openSelectionDialogSlot
   134 // ---------------------------------------------------------------------------
   135 // ---------------------------------------------------------------------------