Ticket #5875: mythui_mythweather.2.diff
File mythui_mythweather.2.diff, 2.1 KB (added by , 15 years ago) |
---|
-
mythweather/mythweather/weatherSetup.cpp
572 572 573 573 menuPopup->SetReturnEvent(this, "units"); 574 574 575 menuPopup->AddButton(tr("English Units"), si);576 menuPopup->AddButton(tr("SI Units"), si);575 menuPopup->AddButton(tr("English Units"), qVariantFromValue(si)); 576 menuPopup->AddButton(tr("SI Units"), qVariantFromValue(si)); 577 577 } 578 578 579 579 void ScreenSetup::deleteScreen() … … 602 602 603 603 if (resultid == "options") 604 604 { 605 MythUIButtonListItem *item = (MythUIButtonListItem *)dce->GetResultData();606 ScreenListInfo *si = (ScreenListInfo *) item->getData();605 MythUIButtonListItem *item = qVariantValue<MythUIButtonListItem *>(dce->GetData()); 606 ScreenListInfo *si = qVariantValue<ScreenListInfo *>(item->GetData()); 607 607 608 608 if (buttonnum == 0) 609 609 { … … 629 629 } 630 630 else if (resultid == "units") 631 631 { 632 ScreenListInfo *si = (ScreenListInfo *)dce->GetResultData(); 633 if (buttonnum == 0) 632 if (buttonnum > -1) 634 633 { 635 si->units = ENG_UNITS; 634 ScreenListInfo *si = qVariantValue<ScreenListInfo *>(dce->GetData()); 635 if (buttonnum == 0) 636 { 637 si->units = ENG_UNITS; 638 } 639 else if (buttonnum == 1) 640 { 641 si->units = SI_UNITS; 642 } 643 doLocationDialog(si); 636 644 } 637 else if (buttonnum == 1)638 {639 si->units = SI_UNITS;640 }641 doLocationDialog(si);642 645 } 643 646 else if (resultid == "location") 644 647 { 645 ScreenListInfo *si = (ScreenListInfo *)dce->GetResultData();648 ScreenListInfo *si = qVariantValue<ScreenListInfo *>(dce->GetData()); 646 649 Q3DictIterator<TypeListInfo> it(si->types); 647 650 for (; it.current(); ++it) 648 651 {