Ticket #2594: multiselect_mythtv_r11817.patch
File multiselect_mythtv_r11817.patch, 49.6 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/channeleditor.cpp
251 251 src->addChild(source); 252 252 src->addChild(del); 253 253 254 sort->set Value(sort->getValueIndex(list->getSortMode()));255 source->set Value(source->getValueIndex(list->getSourceID()));254 sort->setCurrentValue(list->getSortMode()); 255 source->setCurrentValue(list->getSourceID()); 256 256 hide->setValue(list->getHideMode()); 257 257 258 258 addChild(sort); -
libs/libmythtv/playgroup.cpp
254 254 255 255 void PlayGroupEditor::doDelete(void) 256 256 { 257 QString name = listbox->getValue(); 257 QString name = listbox->getSelectionValues().first(); 258 258 259 if (name.isEmpty() || name == "Default") 259 260 return; 260 261 … … 274 275 if (!query.exec()) 275 276 MythContext::DBError("PlayGroupEditor::doDelete", query); 276 277 277 int lastIndex = listbox->get ValueIndex(name);278 int lastIndex = listbox->getSelectionIndices().first(); 278 279 lastValue = ""; 279 280 load(); 280 listbox->set Value(lastIndex);281 listbox->setCurrent(lastIndex); 281 282 } 282 283 283 284 listbox->setFocus(); … … 298 299 299 300 listbox->addSelection(tr("(Create new group)"), ""); 300 301 301 listbox->set Value(lastValue);302 listbox->setCurrentValue(lastValue); 302 303 } 303 304 304 305 int PlayGroupEditor::exec(void) -
libs/libmythtv/scanwizardhelpers.h
754 754 755 755 void SetDefaultATSCFormat(const QString &d) 756 756 { 757 int val = atsc_format->getValueIndex(d); 758 atsc_format->setValue(val); 757 atsc_format->setCurrentValue(d); 759 758 } 760 759 761 760 protected: … … 812 811 813 812 void SetDefaultATSCFormat(const QString &d) 814 813 { 815 int val = atsc_format->getValueIndex(d); 816 atsc_format->setValue(val); 814 atsc_format->setCurrentValue(d); 817 815 } 818 816 819 817 void SetSourceID(uint sourceid) … … 857 855 858 856 void SetDefaultATSCFormat(const QString &d) 859 857 { 860 int val = atsc_format->getValueIndex(d); 861 atsc_format->setValue(val); 858 atsc_format->setCurrentValue(d); 862 859 } 863 860 864 861 private: -
libs/libmythtv/videosource.cpp
99 99 100 100 if (initial_sourceid) 101 101 { 102 if (cnt) 103 setValue(sel); 102 setCurrent(sel); 104 103 setEnabled(false); 105 104 } 106 105 } … … 197 196 198 197 void TransFreqTableSelector::load(void) 199 198 { 200 int idx = getValueIndex(gContext->GetSetting("FreqTable")); 201 if (idx >= 0) 202 setValue(idx); 199 setCurrentValue(gContext->GetSetting("FreqTable")); 203 200 204 201 if (!sourceid) 205 202 return; … … 225 222 if (!loaded_freq_table.isEmpty() && 226 223 (loaded_freq_table.lower() != "default")) 227 224 { 228 int idx = getValueIndex(loaded_freq_table); 229 if (idx >= 0) 230 setValue(idx); 225 setCurrentValue(loaded_freq_table); 231 226 } 232 227 } 233 228 } … … 1834 1829 1835 1830 QString CardInput::getSourceName(void) const 1836 1831 { 1837 return sourceid->getSelectionLabel ();1832 return sourceid->getSelectionLabels().first(); 1838 1833 } 1839 1834 1840 1835 void CardInput::SetChildCardID(uint ccid) … … 1970 1965 else 1971 1966 { 1972 1967 cfgGrp->load(); // new 1973 cardid->set Value(QString::number(_cardid));1968 cardid->setCurrentLabel(QString::number(_cardid)); 1974 1969 inputname->setValue(_inputname); 1975 1970 } 1976 1971 } -
libs/libmythtv/diseqcsettings.cpp
55 55 56 56 virtual void load(void) 57 57 { 58 QString tmp = QString::number((uint) m_device.GetDeviceType()); 59 setValue(getValueIndex(tmp)); 58 setCurrentValue(QString::number((uint) m_device.GetDeviceType())); 60 59 } 61 60 62 61 virtual void save(void) … … 163 162 164 163 virtual void load(void) 165 164 { 166 set Value(getValueIndex(QString::number((uint) m_switch.GetType())));165 setCurrentValue(QString::number((uint) m_switch.GetType())); 167 166 } 168 167 169 168 virtual void save(void) … … 266 265 267 266 virtual void load(void) 268 267 { 269 set Value(getValueIndex(QString::number((uint)m_rotor.GetType())));268 setCurrentValue(QString::number((uint)m_rotor.GetType())); 270 269 } 271 270 272 271 virtual void save(void) … … 418 417 419 418 void RotorPosMap::PopulateList(void) 420 419 { 421 int old_sel = get ValueIndex(getValue());420 int old_sel = getSelectionIndices().first(); 422 421 clearSelections(); 423 422 uint num_pos = 64; 424 423 for (uint pos = 1; pos < num_pos; pos++) … … 431 430 addSelection(DeviceTree::tr("Position #%1 (%2)").arg(pos).arg(posval), 432 431 QString::number(pos)); 433 432 } 434 setCurrent Item(old_sel);433 setCurrent(old_sel); 435 434 } 436 435 437 436 //////////////////////////////////////// RotorPosConfig … … 583 582 584 583 virtual void load(void) 585 584 { 586 set Value(FindPreset(m_lnb));585 setCurrent(FindPreset(m_lnb)); 587 586 } 588 587 589 588 virtual void save(void) … … 621 620 622 621 virtual void load(void) 623 622 { 624 set Value(getValueIndex(QString::number((uint) m_lnb.GetType())));623 setCurrentValue(QString::number((uint) m_lnb.GetType())); 625 624 } 626 625 627 626 virtual void save(void) … … 800 799 } 801 800 else 802 801 { 803 m_type->setValue(m_type->getValueIndex( 804 QString::number((uint)preset.type))); 802 m_type->setCurrentValue(QString::number((uint)preset.type)); 805 803 m_lof_switch->setValue(QString::number(preset.lof_sw / 1000)); 806 804 m_lof_lo->setValue(QString::number(preset.lof_lo / 1000)); 807 805 m_lof_hi->setValue(QString::number(preset.lof_hi / 1000)); … … 1030 1028 1031 1029 void DeviceTree::PopulateTree(void) 1032 1030 { 1033 int old_sel = get ValueIndex(getValue());1031 int old_sel = getSelectionIndices().first(); 1034 1032 clearSelections(); 1035 1033 PopulateTree(m_tree.Root()); 1036 setCurrent Item(old_sel);1034 setCurrent(old_sel); 1037 1035 } 1038 1036 1039 1037 void DeviceTree::PopulateTree(DiSEqCDevDevice *node, … … 1107 1105 virtual void load(void) 1108 1106 { 1109 1107 double value = m_settings.GetValue(m_node.GetDeviceID()); 1110 set Value((uint)value);1108 setCurrent((uint)value); 1111 1109 } 1112 1110 1113 1111 virtual void save(void) … … 1147 1145 addSelection(AngleToString(*it), QString::number(*it)); 1148 1146 1149 1147 double angle = m_settings.GetValue(m_node.GetDeviceID()); 1150 set Value(getValueIndex(QString::number(angle)));1148 setCurrentValue(QString::number(angle)); 1151 1149 } 1152 1150 1153 1151 virtual void save(void) -
libs/libmythtv/channelsettings.cpp
68 68 { 69 69 uint which = sourceid_to_index[default_sourceid]; 70 70 if (which) 71 set Value(which);71 setCurrent(which); 72 72 } 73 73 } 74 74 -
libs/libmythtv/recordingprofile.cpp
150 150 CodecParamStorage(this, parent, "mpeg2audbitratel1") 151 151 { 152 152 setLabel(QObject::tr("Bitrate")); 153 153 154 154 addSelection("32 kbps", "32"); 155 155 addSelection("64 kbps", "64"); 156 156 addSelection("96 kbps", "96"); … … 165 165 addSelection("384 kbps", "384"); 166 166 addSelection("416 kbps", "416"); 167 167 addSelection("448 kbps", "448"); 168 set Value(13);168 setCurrent(13); 169 169 setHelpText(QObject::tr("Sets the audio bitrate")); 170 170 }; 171 171 }; … … 178 178 CodecParamStorage(this, parent, "mpeg2audbitratel2") 179 179 { 180 180 setLabel(QObject::tr("Bitrate")); 181 181 182 182 addSelection("32 kbps", "32"); 183 183 addSelection("48 kbps", "48"); 184 184 addSelection("56 kbps", "56"); … … 193 193 addSelection("256 kbps", "256"); 194 194 addSelection("320 kbps", "320"); 195 195 addSelection("384 kbps", "384"); 196 set Value(13);196 setCurrent(13); 197 197 setHelpText(QObject::tr("Sets the audio bitrate")); 198 198 }; 199 199 }; … … 236 236 audbr->setLabel("Layer II"); 237 237 addTarget("Layer II", audbr); 238 238 audType->addSelection("Layer II"); 239 audType->set Value(1);239 audType->setCurrent(1); 240 240 }; 241 241 }; 242 242 … … 252 252 addSelection(QObject::tr("SAP Language"), "1"); 253 253 addSelection(QObject::tr("Dual"), "2"); 254 254 255 set Value(0);255 setCurrent(0); 256 256 setHelpText(QObject::tr( 257 257 "Chooses the language(s) to record when " 258 258 "two languages are broadcast. Only Layer II " … … 566 566 CodecParamStorage(this, parent, "mpeg2streamtype") 567 567 { 568 568 setLabel(QObject::tr("Stream Type")); 569 569 570 570 addSelection("MPEG-2 PS"); 571 571 addSelection("MPEG-2 TS"); 572 572 addSelection("MPEG-1 VCD"); … … 576 576 addSelection("DVD"); 577 577 addSelection("DVD-Special 1"); 578 578 addSelection("DVD-Special 2"); 579 set Value(0);579 setCurrent(0); 580 580 setHelpText(QObject::tr("Sets the type of stream generated by " 581 581 "your PVR.")); 582 582 }; … … 590 590 CodecParamStorage(this, parent, "mpeg2aspectratio") 591 591 { 592 592 setLabel(QObject::tr("Aspect Ratio")); 593 593 594 594 addSelection(QObject::tr("Square"), "Square"); 595 595 addSelection("4:3"); 596 596 addSelection("16:9"); 597 597 addSelection("2.21:1"); 598 set Value(1);598 setCurrent(1); 599 599 setHelpText(QObject::tr("Sets the aspect ratio of stream generated " 600 600 "by your PVR.")); 601 601 }; … … 625 625 addSelection("1"); 626 626 addSelection("2"); 627 627 addSelection("4"); 628 set Value(2);628 setCurrent(2); 629 629 }; 630 630 }; 631 631 … … 640 640 addSelection("1"); 641 641 addSelection("2"); 642 642 addSelection("4"); 643 set Value(2);643 setCurrent(2); 644 644 }; 645 645 }; 646 646 … … 821 821 addSelection(QObject::tr("Normal"), "all"); 822 822 addSelection(QObject::tr("TV Only"), "tv"); 823 823 addSelection(QObject::tr("Audio Only"), "audio"); 824 set Value(0);824 setCurrent(0); 825 825 }; 826 826 }; 827 827 -
libs/libmythtv/scheduledrecording.cpp
630 630 case kChannelRecord: 631 631 label = QString("%1 on channel %2") 632 632 .arg(sr.title->getValue()) 633 .arg(sr.channel->getSelectionLabel ());633 .arg(sr.channel->getSelectionLabels().first()); 634 634 break; 635 635 case kWeekslotRecord: 636 636 weekly = QDate(sr.startDate->dateValue()).toString("dddd")+"s "; 637 637 case kTimeslotRecord: 638 638 label = QString("%1 on channel %2 (%3%4 - %5)") 639 639 .arg(sr.title->getValue()) 640 .arg(sr.channel->getSelectionLabel ())640 .arg(sr.channel->getSelectionLabels().first()) 641 641 .arg(weekly) 642 642 .arg(sr.startTime->timeValue().toString()) 643 643 .arg(sr.endTime->timeValue().toString()); … … 647 647 case kDontRecord: 648 648 label = QString("%1 on channel %2 (%3 %4 - %5)") 649 649 .arg(sr.title->getValue()) 650 .arg(sr.channel->getSelectionLabel ())650 .arg(sr.channel->getSelectionLabels().first()) 651 651 .arg(sr.startDate->dateValue().toString()) 652 652 .arg(sr.startTime->timeValue().toString()) 653 653 .arg(sr.endTime->timeValue().toString()); … … 794 794 title->setValue(""); 795 795 subtitle->setValue(""); 796 796 description->setValue(""); 797 channel->setValue(""); 797 channel->setCurrent(0); 798 channel->setState(0, false); 798 799 station->setValue(""); 799 800 startDate->setValue(date); 800 801 startTime->setValue(time); … … 860 861 title->setValue(proginfo->title); 861 862 subtitle->setValue(proginfo->subtitle); 862 863 description->setValue(proginfo->description); 863 channel->set Value(proginfo->chanid);864 channel->setCurrentValue(proginfo->chanid); 864 865 station->setValue(proginfo->chansign); 865 866 startDate->setValue(proginfo->startts.date()); 866 867 startTime->setValue(proginfo->startts.time()); -
libs/libmythtv/scanwizardhelpers.cpp
291 291 } 292 292 293 293 if (cnt) 294 set Value(which);294 setCurrent(which); 295 295 } 296 296 297 297 void InputSelector::SetSourceID(const QString &_sourceid) … … 767 767 return scanConfig->GetATSCFormat(dfl); 768 768 } 769 769 770 LogList::LogList() : ListBoxSetting(this ), n(0)770 LogList::LogList() : ListBoxSetting(this, MythListBox::NoSelection), n(0) 771 771 { 772 setSelectionMode(MythListBox::NoSelection);773 772 } 774 773 775 774 void LogList::updateText(const QString& status) 776 775 { 777 776 addSelection(status,QString::number(n)); 778 setCurrentItem(n); 779 n++; 777 setCurrent(n++); 780 778 } -
libs/libmyth/settings.cpp
505 505 return widget; 506 506 } 507 507 508 void SelectSetting::addSelection(const QString& label, QString value, bool select) { 508 void SelectSetting::addSelection(const QString& label, QString value, bool state) 509 { 509 510 if (value == QString::null) 510 511 value = label; 511 512 bool found = false;513 for(unsigned i = 0 ; i < values.size() ; ++i)514 if ((values[i] == value) &&515 (labels[i] == label)) {516 found = true;517 break;518 }519 512 520 if (!found) 513 int index = values.findIndex(value); 514 515 if (index == -1) 521 516 { 522 labels.push_back(label); 523 values.push_back(value); 524 525 emit selectionAdded(label, value); 526 527 if (select || !isSet) 528 setValue(value); 517 labels.append(label); 518 values.append(value); 519 states.append(state); 520 521 emit selectionAdded(label, value, state); 522 523 if (state) 524 { 525 selectionIndices.append(states.count() - 1); 526 selectionLabels.append(label); 527 selectionValues.append(value); 528 updateValue(); 529 } 529 530 } 531 else 532 { 533 setState(index, state); 534 } 530 535 } 531 536 532 537 void SelectSetting::fillSelectionsFromDir(const QDir& dir, bool absPath) { … … 544 549 addSelection(fi->fileName()); 545 550 } 546 551 547 void SelectSetting::clearSelections(void) { 552 void SelectSetting::clearSelections() 553 { 548 554 labels.clear(); 549 555 values.clear(); 550 isSet = false; 556 states.clear(); 557 selectionIndices.clear(); 558 selectionLabels.clear(); 559 selectionValues.clear(); 560 updateValue(); 551 561 emit selectionsCleared(); 552 562 } 553 563 554 void SelectSetting::setValue(const QString& newValue) { 555 bool found = false; 556 for(unsigned i = 0 ; i < values.size() ; ++i) 557 if (values[i] == newValue) { 558 current = i; 559 found = true; 560 isSet = true; 561 break; 564 void SelectSetting::setCurrent(uint which) 565 { 566 if (which < labels.count()) 567 { 568 for(uint i = 0 ; i < states.size() ; ++i) 569 states[i] = false; 570 selectionIndices.clear(); 571 selectionLabels.clear(); 572 selectionValues.clear(); 573 selectionIndices.append(which); 574 selectionLabels.append(labels[which]); 575 selectionValues.append(values[which]); 576 states[which] = true; 577 updateValue(); 578 } 579 else 580 { 581 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrent(%2) - invalid value") 582 .arg(getName()) 583 .arg(which)); 584 } 585 } 586 587 void SelectSetting::setCurrentLabel(const QString& label) 588 { 589 int index = labels.findIndex(label); 590 591 if (index == -1) 592 { 593 if (expand) 594 { 595 for(uint j = 0 ; j < states.size() ; ++j) 596 states[j] = false; 597 selectionIndices.clear(); 598 selectionLabels.clear(); 599 selectionValues.clear(); 600 601 addSelection(label, label, true); 562 602 } 563 if (found) 564 Setting::setValue(newValue); 603 else 604 { 605 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrentLabel(%2) - invalid label") 606 .arg(getName()) 607 .arg(label)); 608 } 609 } 565 610 else 566 addSelection(newValue, newValue, true); 611 { 612 setCurrent(index); 613 } 567 614 } 568 615 569 void SelectSetting::set Value(int which)616 void SelectSetting::setCurrentValue(const QString& value) 570 617 { 571 if ((unsigned)which > values.size()-1 || which < 0) { 572 VERBOSE(VB_IMPORTANT, 573 "SelectSetting::setValue(): invalid index " << which); 574 return; 618 int index = values.findIndex(value); 619 620 if (index == -1) 621 { 622 if (expand) 623 { 624 for(uint j = 0 ; j < states.size() ; ++j) 625 states[j] = false; 626 selectionIndices.clear(); 627 selectionLabels.clear(); 628 selectionValues.clear(); 629 630 addSelection(value, value, true); 631 } 632 else 633 { 634 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrent(%2) - invalid value") 635 .arg(getName()) 636 .arg(value)); 637 } 575 638 } 576 current = which; 577 isSet = true; 578 Setting::setValue(values[current]); 639 else 640 { 641 setCurrent(index); 642 } 579 643 } 580 644 645 void SelectSetting::setState(uint which, bool state) 646 { 647 if (which < labels.count()) 648 { 649 if (states[which] != state) 650 { 651 states[which] = state; 652 if (!states[which]) 653 { 654 selectionIndices.remove(which); 655 selectionLabels.remove(labels[which]); 656 selectionValues.remove(values[which]); 657 } 658 else 659 { 660 selectionIndices.append(which); 661 selectionLabels.append(labels[which]); 662 selectionValues.append(values[which]); 663 } 664 updateValue(); 665 } 666 } 667 else 668 { 669 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setState(%2, %3) - invalid value") 670 .arg(getName()) 671 .arg(which) 672 .arg(state)); 673 } 674 } 675 676 void SelectSetting::setStateLabel(const QString& label, bool state) 677 { 678 int index = labels.findIndex(label); 679 680 if (index == -1) 681 { 682 if (expand) 683 { 684 addSelection(label, label, true); 685 } 686 else 687 { 688 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setStateLabel(%2, %3) - invalid label") 689 .arg(getName()) 690 .arg(label) 691 .arg(state)); 692 } 693 } 694 else 695 { 696 setState(index, state); 697 } 698 } 699 700 void SelectSetting::setStateValue(const QString& value, bool state) 701 { 702 int index = values.findIndex(value); 703 704 if (index == -1) 705 { 706 if (expand) 707 { 708 addSelection(value, value, true); 709 } 710 else 711 { 712 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setStateValue(%2, %3) - invalid value") 713 .arg(getName()) 714 .arg(value) 715 .arg(state)); 716 } 717 } 718 else 719 { 720 setState(index, state); 721 } 722 } 723 724 void SelectSetting::setValue(const QString& newValue) 725 { 726 for(uint i = 0 ; i < states.size() ; ++i) 727 states[i] = false; 728 selectionIndices.clear(); 729 selectionLabels.clear(); 730 selectionValues.clear(); 731 732 selectionValues = QStringList::split(';', newValue); 733 734 for (QStringList::iterator iter = selectionValues.begin(); iter != selectionValues.end(); iter++) 735 { 736 int index = values.findIndex(*iter); 737 738 if (index == -1) 739 { 740 if (expand) 741 { 742 labels.append(*iter); 743 values.append(*iter); 744 states.append(true); 745 746 emit selectionAdded(*iter, *iter, true); 747 748 selectionIndices.append(states.count() - 1); 749 selectionLabels.append(*iter); 750 } 751 else 752 { 753 VERBOSE(VB_IMPORTANT, 754 "SelectSetting(" << getName() << ")::setValue(" << *iter << "): invalid value "); 755 iter = selectionValues.erase(iter); 756 iter--; 757 } 758 } 759 else 760 { 761 selectionIndices.append(index); 762 selectionLabels.append(labels[index]); 763 states[index] = true; 764 } 765 } 766 767 updateValue(); 768 } 769 770 void SelectSetting::updateValue() 771 { 772 QString newValue(""); 773 for (QStringList::const_iterator iter = selectionValues.begin(); iter != selectionValues.end(); iter++) 774 { 775 if (!newValue.isEmpty()) 776 newValue.append(';'); 777 newValue.append(*iter); 778 } 779 Setting::setValue(newValue); 780 emit selectionChanged(); 781 } 782 581 783 QWidget* LabelSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 582 784 const char* widgetName) { 583 785 (void)cg; … … 779 981 } 780 982 781 983 QLabel* value = new QLabel(widget); 782 value->setText( labels[current]);984 value->setText(getValue()); 783 985 value->setBackgroundOrigin(QWidget::WindowOrigin); 784 986 785 987 connect(this, SIGNAL(valueChanged(const QString&)), … … 788 990 return widget; 789 991 } 790 992 993 ComboBoxSetting::ComboBoxSetting(Storage *_storage, bool _rw, int _step) : 994 SelectSetting(_storage, _rw), 995 rw(_rw), 996 widget(NULL), 997 step(_step) 998 { 999 connect(this, SIGNAL(selectionAdded(const QString&, const QString&, bool)), 1000 this, SLOT(selectionAdded(const QString&, const QString&, bool))); 1001 connect(this, SIGNAL(selectionChanged()), 1002 this, SLOT(selectionChanged())); 1003 } 1004 791 1005 QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 792 1006 const char* widgetName) { 793 1007 QHBox* box; … … 816 1030 box->setStretchFactor(widget, 1); 817 1031 818 1032 for(unsigned int i = 0 ; i < labels.size() ; ++i) 1033 { 819 1034 widget->insertItem(labels[i]); 1035 if (states[i]) 1036 widget->setCurrentItem(i); 1037 } 820 1038 821 if (isSet) 822 widget->setCurrentItem(current); 1039 setState(widget->currentItem(), true); 823 1040 824 1041 if (1 < step) 825 1042 widget->setStep(step); 826 1043 827 if (rw) 828 connect(widget, SIGNAL(highlighted(const QString &)), 829 this, SLOT(setValue(const QString &))); 830 else 831 connect(widget, SIGNAL(highlighted(int)), 832 this, SLOT(setValue(int))); 833 1044 connect(widget, SIGNAL(highlighted(const QString &)), 1045 this, SLOT(setCurrentLabel(const QString &))); 834 1046 connect(widget, SIGNAL(destroyed()), 835 1047 this, SLOT(widgetDestroyed())); 836 1048 connect(this, SIGNAL(selectionsCleared()), … … 863 1075 } 864 1076 } 865 1077 866 void ComboBoxSetting::se tValue(QString newValue)1078 void ComboBoxSetting::selectionAdded(const QString& label, const QString&, bool) 867 1079 { 868 if ( !rw)1080 if (widget) 869 1081 { 870 VERBOSE(VB_IMPORTANT, "ComboBoxSetting::setValue(QString): " 871 "BUG: attempted to set value of read-only ComboBox"); 872 return; 1082 widget->insertItem(label); 873 1083 } 874 Setting::setValue(newValue); 875 if (widget) 876 widget->setCurrentItem(current); 877 }; 1084 } 878 1085 879 void ComboBoxSetting::se tValue(int which)1086 void ComboBoxSetting::selectionChanged() 880 1087 { 881 1088 if (widget) 882 widget->setCurrentItem(which); 883 SelectSetting::setValue(which); 884 }; 1089 { 1090 widget->setCurrentItem(getSelectionIndices().first()); 1091 } 1092 } 885 1093 886 1094 void HostRefreshRateComboBox::ChangeResolution(const QString& resolution) 887 1095 { 888 1096 clearSelections(); 889 1097 890 1098 const vector<short> list = GetRefreshRates(resolution); 891 1099 addSelection(QObject::tr("Any"), "0"); 892 1100 int hz50 = -1, hz60 = -1; 893 1101 for (uint i=0; i<list.size(); ++i) 894 { 1102 { 895 1103 QString sel = QString::number(list[i]); 896 1104 addSelection(sel+" Hz", sel); 897 1105 hz50 = (50 == list[i]) ? i : hz50; 898 1106 hz60 = (60 == list[i]) ? i : hz60; 899 1107 } 900 901 setValue(0); 1108 902 1109 if ("640x480" == resolution || "720x480" == resolution) 903 setValue(hz60+1); 904 if ("640x576" == resolution || "720x576" == resolution) 905 setValue(hz50+1); 906 1110 setCurrent(hz60 + 1); 1111 else if ("640x576" == resolution || "720x576" == resolution) 1112 setCurrent(hz50 + 1); 1113 else 1114 setCurrent(0); 1115 907 1116 setEnabled(list.size()); 908 1117 } 909 1118 … … 983 1192 QRadioButton* button = new QRadioButton(widget, NULL); 984 1193 button->setBackgroundOrigin(QWidget::WindowOrigin); 985 1194 button->setText(labels[i]); 986 if ( isSet && i == current)1195 if (states[i]) 987 1196 button->setDown(true); 988 1197 } 989 1198 1199 setState(widget->selectedId(), true); 1200 990 1201 cg = cg; 991 1202 992 1203 return widget; … … 1280 1491 save(table); 1281 1492 } 1282 1493 1283 void ListBoxSetting::setEnabled(bool b) 1494 1495 ListBoxSetting::ListBoxSetting(Storage *_storage, MythListBox::SelectionMode mode) : 1496 SelectSetting(_storage), 1497 selectionMode(mode), 1498 widget(NULL) 1284 1499 { 1285 Configurable::setEnabled(b); 1286 if (widget) 1287 widget->setEnabled(b); 1500 connect(this, SIGNAL(selectionAdded(const QString&, const QString&, bool)), 1501 this, SLOT(selectionAdded(const QString&, const QString&, bool))); 1502 connect(this, SIGNAL(selectionChanged()), 1503 this, SLOT(selectionChanged())); 1288 1504 } 1289 1505 1290 1506 void ListBoxSetting::addSelection( … … 1309 1525 1310 1526 widget = new MythListBox(box); 1311 1527 widget->setBackgroundOrigin(QWidget::WindowOrigin); 1528 widget->setSelectionMode(selectionMode); 1312 1529 widget->setHelpText(getHelpText()); 1313 1530 1314 for(u nsignedint i = 0 ; i < labels.size() ; ++i) {1531 for(uint i = 0 ; i < labels.size() ; ++i) { 1315 1532 widget->insertItem(labels[i]); 1316 if (isSet && current == i) 1317 widget->setCurrentItem(i); 1533 widget->setSelected(i, states[i]); 1318 1534 } 1319 1535 1320 1536 connect(widget, SIGNAL(destroyed()), … … 1329 1545 this, SIGNAL(editButtonPressed(int))); 1330 1546 connect(widget, SIGNAL(deleteButtonPressed(int)), 1331 1547 this, SIGNAL(deleteButtonPressed(int))); 1332 connect(this, SIGNAL(valueChanged(const QString&)), 1333 widget, SLOT(setCurrentItem(const QString&))); 1334 connect(widget, SIGNAL(highlighted(int)), 1335 this, SLOT(setValueByIndex(int))); 1548 connect(widget, SIGNAL(selectionChanged()), 1549 this, SLOT(updateSelection())); 1336 1550 1337 1551 if (cg) 1338 1552 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1339 1553 SIGNAL(changeHelpText(QString))); 1340 1554 1341 1555 widget->setFocus(); 1342 widget->setSelectionMode(selectionMode);1343 1556 1344 1557 return box; 1345 1558 } 1346 1559 1347 void ListBoxSetting::set SelectionMode(MythListBox::SelectionMode mode)1560 void ListBoxSetting::setEnabled(bool b) 1348 1561 { 1349 selectionMode = mode;1350 if (widget)1351 widget->setSelectionMode(selectionMode);1562 Configurable::setEnabled(b); 1563 if (widget) 1564 widget->setEnabled(b); 1352 1565 } 1353 1566 1354 void ListBoxSetting::se tValueByIndex(int index)1567 void ListBoxSetting::selectionAdded(const QString& label, const QString&, bool) 1355 1568 { 1356 if (((uint)index) < values.size()) 1357 setValue(values[index]); 1569 if (widget) 1570 { 1571 widget->insertItem(label); 1572 } 1358 1573 } 1359 1574 1360 void ImageSelectSetting::addImageSelection(const QString& label, 1361 QImage* image, 1362 QString value, 1363 bool select) { 1364 images.push_back(image); 1365 addSelection(label, value, select); 1575 void ListBoxSetting::selectionChanged() 1576 { 1577 if (widget) 1578 for (uint i = 0; i < states[i]; ++i) 1579 widget->setSelected(i, states[i]); 1366 1580 } 1367 1581 1368 ImageSelectSetting::~ImageSelectSetting() { 1369 while (images.size() > 0){1370 delete images.back();1371 images.pop_back();1372 }1582 void ListBoxSetting::updateSelection() 1583 { 1584 if (widget) 1585 for (uint i = 0; i < widget->count(); ++i) 1586 setState(i, widget->item(i)->isSelected()); 1373 1587 } 1374 1588 1375 void ImageSelectSetting::imageSet(int num) 1589 1590 ImageSelectSetting::ImageSelectSetting(Storage *_storage) : 1591 ComboBoxSetting(_storage), 1592 imagelabel(NULL) 1376 1593 { 1377 if (num >= (int)images.size()) 1378 return; 1379 1380 if (!images[current]) 1381 return; 1382 1383 QImage temp = *(images[current]); 1384 temp = temp.smoothScale((int)(184 * m_hmult), (int)(138 * m_hmult), 1385 QImage::ScaleMin); 1386 1387 QPixmap tmppix(temp); 1388 imagelabel->setPixmap(tmppix); 1594 images.setAutoDelete(true); 1389 1595 } 1390 1596 1391 1597 QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, … … 1396 1602 1397 1603 gContext->GetScreenSettings(width, m_wmult, height, m_hmult); 1398 1604 1399 QHBox* box; 1400 if (labelAboveWidget) 1401 { 1402 box = dynamic_cast<QHBox*>(new QVBox(parent, widgetName)); 1403 box->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, 1404 QSizePolicy::Maximum)); 1405 } 1406 else 1407 box = new QHBox(parent, widgetName); 1408 1605 QHBox* box = new QHBox(parent, widgetName); 1409 1606 box->setBackgroundOrigin(QWidget::WindowOrigin); 1607 box->setSpacing(100); 1410 1608 1411 if (getLabel() != "") 1412 { 1413 QLabel* label = new QLabel(box); 1414 label->setText(getLabel() + ":"); 1415 label->setBackgroundOrigin(QWidget::WindowOrigin); 1416 } 1609 ComboBoxSetting::configWidget(cg, box); 1417 1610 1418 MythComboBox *widget = new MythComboBox(false, box);1419 widget->setBackgroundOrigin(QWidget::WindowOrigin);1420 1421 QLabel *testlabel = new QLabel(box);1422 testlabel->setText(" ");1423 testlabel->setBackgroundOrigin(QWidget::WindowOrigin);1424 1425 1611 imagelabel = new QLabel(box); 1426 1612 imagelabel->setBackgroundOrigin(QWidget::WindowOrigin); 1427 1613 1428 for (unsigned int i = 0 ; i < images.size() ; ++i) 1429 widget->insertItem(labels[i]); 1614 selectionChanged(); 1430 1615 1431 if (isSet) 1432 widget->setCurrentItem(current); 1433 else 1434 current = 0; 1616 connect(widget, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1435 1617 1436 if (images.size() != 0 && current < images.size() && images[current]) 1437 { 1438 QImage temp = *(images[current]); 1439 temp = temp.smoothScale((int)(184 * m_hmult), (int)(138 * m_hmult), 1440 QImage::ScaleMin); 1441 1442 QPixmap tmppix(temp); 1443 imagelabel->setPixmap(tmppix); 1618 return box; 1619 } 1620 1621 void ImageSelectSetting::addSelection(const QString& label, 1622 QImage* image, 1623 QString value, 1624 bool select) 1625 { 1626 if (labels.find(label) == labels.end()) 1627 { 1628 images.append(image); 1629 SelectSetting::addSelection(label, value, select); 1444 1630 } 1445 else 1631 } 1632 1633 void ImageSelectSetting::imageSet(int num) 1634 { 1635 if (imagelabel) 1446 1636 { 1447 1637 QPixmap tmppix((int)(184 * m_hmult), (int)(138 * m_hmult)); 1448 tmppix.fill(black);1449 1638 1639 if (num < (int)images.count() && images.at(num)) 1640 tmppix = images.at(num)->smoothScale((int)(184 * m_hmult), 1641 (int)(138 * m_hmult), 1642 QImage::ScaleMin); 1643 else 1644 tmppix.fill(black); 1645 1450 1646 imagelabel->setPixmap(tmppix); 1451 1647 } 1648 } 1452 1649 1453 connect(widget, SIGNAL(highlighted(int)), this, SLOT(setValue(int))); 1454 connect(widget, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1650 void ImageSelectSetting::selectionChanged() 1651 { 1652 imageSet(getSelectionIndices().first()); 1653 ComboBoxSetting::selectionChanged(); 1654 } 1455 1655 1456 connect(this, SIGNAL(selectionsCleared()),1457 widget, SLOT(clear()));1458 1656 1459 if (cg)1460 connect(widget, SIGNAL(changeHelpText(QString)), cg,1461 SIGNAL(changeHelpText(QString)));1462 1463 return box;1464 }1465 1466 1657 HostnameSetting::HostnameSetting(Storage *storage) : Setting(storage) 1467 1658 { 1468 1659 setVisible(false); -
libs/libmyth/dbsettings.cpp
74 74 VerticalConfigurationGroup(false, true, false, false) 75 75 { 76 76 setLabel(QObject::tr("Database Configuration") + " 1/2"); 77 77 78 78 info = new TransLabelSetting(); 79 79 80 80 MSqlQuery query(MSqlQuery::InitCon()); … … 86 86 "Please verify your database settings " 87 87 "below.")); 88 88 addChild(info); 89 89 90 90 dbHostName = new TransLineEditSetting(true); 91 91 dbHostName->setLabel(QObject::tr("Host name")); 92 92 dbHostName->setHelpText(QObject::tr("The host name or IP address of " … … 100 100 "on, if it's not the default database " 101 101 "port.")); 102 102 addChild(dbPort); 103 103 104 104 dbName = new TransLineEditSetting(true); 105 105 dbName->setLabel(QObject::tr("Database")); 106 106 dbName->setHelpText(QObject::tr("The name of the database. " … … 113 113 "connecting to the database. " 114 114 "This information is required.")); 115 115 addChild(dbUserName); 116 116 117 117 dbPassword = new TransLineEditSetting(true); 118 118 dbPassword->setLabel(QObject::tr("Password")); 119 119 dbPassword->setHelpText(QObject::tr("The password to use while " 120 120 "connecting to the database. " 121 121 "This information is required.")); 122 122 addChild(dbPassword); 123 123 124 124 dbType = new TransComboBoxSetting(false); 125 125 dbType->setLabel(QObject::tr("Database type")); 126 126 dbType->addSelection(QObject::tr("MySQL"), "QMYSQL3"); 127 127 //dbType->addSelection(QObject::tr("PostgreSQL"), "QPSQL7"); 128 dbType->set Value(0);128 dbType->setCurrent(0); 129 129 dbType->setHelpText(QObject::tr("The database implementation used " 130 130 "for your server.")); 131 131 addChild(dbType); … … 203 203 void MythDbSettings1::load() 204 204 { 205 205 DatabaseParams params = gContext->GetDatabaseParams(); 206 206 207 207 if (params.dbHostName.isEmpty() || 208 208 params.dbUserName.isEmpty() || 209 209 params.dbPassword.isEmpty() || 210 210 params.dbName.isEmpty()) 211 211 info->setValue(info->getValue() + "\nRequired fields are marked " 212 212 "with an asterisk (*)."); 213 213 214 214 dbHostName->setValue(params.dbHostName); 215 215 if (params.dbHostName.isEmpty()) 216 216 dbHostName->setLabel("* " + dbHostName->getLabel()); … … 227 227 dbName->setValue(params.dbName); 228 228 if (params.dbName.isEmpty()) 229 229 dbName->setLabel("* " + dbName->getLabel()); 230 230 231 231 if (params.dbType == "QMYSQL3") 232 dbType->set Value(0);232 dbType->setCurrent(0); 233 233 else if (params.dbType == "QPSQL7") 234 dbType->set Value(1);234 dbType->setCurrent(1); 235 235 } 236 236 237 237 void MythDbSettings2::load() -
libs/libmyth/mythwidgets.cpp
1242 1242 void MythListBox::polish(void) 1243 1243 { 1244 1244 QListBox::polish(); 1245 1245 1246 1246 QPalette pal = palette(); 1247 1247 QColorGroup::ColorRole role = QColorGroup::Highlight; 1248 1248 pal.setColor(QPalette::Active, role, pal.active().button()); 1249 1249 pal.setColor(QPalette::Inactive, role, pal.active().button()); 1250 1250 pal.setColor(QPalette::Disabled, role, pal.active().button()); 1251 1251 1252 1252 setPalette(pal); 1253 1253 } 1254 1254 … … 1287 1287 } 1288 1288 } 1289 1289 else 1290 { 1290 { 1291 1291 if (text(i).lower() == matchText.lower()) 1292 1292 { 1293 1293 setCurrentItem(i); 1294 1294 break; 1295 1295 } 1296 } 1296 } 1297 1297 } 1298 } 1298 } 1299 1299 } 1300 1300 1301 1301 void MythListBox::keyPressEvent(QKeyEvent* e) … … 1320 1320 handled = true; 1321 1321 continue; 1322 1322 } 1323 1323 1324 1324 key = Key_Up; 1325 1325 } 1326 1326 else if (action == "DOWN") … … 1332 1332 handled = true; 1333 1333 continue; 1334 1334 } 1335 1335 1336 1336 key = Key_Down; 1337 1337 } 1338 1338 else if (action == "LEFT") 1339 1339 { 1340 focusNextPrevChild(false); 1340 if (selectionMode() == Multi) 1341 toggleCurrentItem(); 1341 1342 handled = true; 1342 1343 continue; 1343 1344 } 1344 1345 else if (action == "RIGHT") 1345 1346 { 1346 focusNextPrevChild(true); 1347 if (selectionMode() == Multi) 1348 toggleCurrentItem(); 1347 1349 handled = true; 1348 1350 continue; 1349 1351 } … … 1375 1377 1376 1378 void MythListBox::focusOutEvent(QFocusEvent *e) 1377 1379 { 1380 if (selectionMode() == Single) 1381 setSelected(currentItem(), false); 1382 1378 1383 QPalette pal = palette(); 1379 1384 QColorGroup::ColorRole role = QColorGroup::Highlight; 1380 1385 pal.setColor(QPalette::Active, role, pal.active().button()); 1381 1386 pal.setColor(QPalette::Inactive, role, pal.active().button()); 1382 1387 pal.setColor(QPalette::Disabled, role, pal.active().button()); 1383 1388 1384 1389 setPalette(pal); 1385 1390 QListBox::focusOutEvent(e); 1386 1391 } … … 1388 1393 void MythListBox::focusInEvent(QFocusEvent *e) 1389 1394 { 1390 1395 this->unsetPalette(); 1391 1396 1392 1397 emit changeHelpText(helptext); 1393 1398 QListBox::focusInEvent(e); 1399 1400 if (selectionMode() == Single) 1401 setSelected(currentItem(), true); 1394 1402 } 1395 1403 1396 1404 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
libs/libmyth/settings.h
287 287 { 288 288 Q_OBJECT 289 289 290 291 SelectSetting(Storage *_storage ) :292 Setting(_storage), current(0), isSet(false) { }290 protected: 291 SelectSetting(Storage *_storage, bool _expand = false) : 292 Setting(_storage), expand(_expand) { }; 293 293 294 294 public: 295 295 virtual void addSelection(const QString& label, 296 QString value =QString::null,297 bool s elect=false);296 QString value = QString::null, 297 bool state = false); 298 298 299 virtual void clearSelections(void); 299 virtual const QValueList<uint> getSelectionIndices() const {return selectionIndices;} 300 virtual const QStringList& getSelectionLabels() const {return selectionLabels;} 301 virtual const QStringList& getSelectionValues() const {return selectionValues;} 300 302 303 virtual void clearSelections(); 304 301 305 virtual void fillSelectionsFromDir(const QDir& dir, bool absPath=true); 302 306 303 307 signals: 304 void selectionAdded(const QString& label, QString value); 305 void selectionsCleared(void); 308 void selectionAdded(const QString& label, const QString& value, bool state); 309 void selectionChanged(); 310 void selectionsCleared(); 306 311 307 312 public slots: 313 virtual void setCurrent(uint which); 314 virtual void setCurrentLabel(const QString& label); 315 virtual void setCurrentValue(const QString& value); 316 virtual void setState(uint which, bool state); 317 virtual void setStateLabel(const QString& label, bool state); 318 virtual void setStateValue(const QString& value, bool state); 308 319 320 private slots: 309 321 virtual void setValue(const QString& newValue); 310 virtual void setValue(int which);311 322 312 virtual QString getSelectionLabel(void) const { 313 if (!isSet) 314 return QString::null; 315 return labels[current]; 316 }; 323 protected: 324 virtual void updateValue(); 317 325 318 virtual int getValueIndex(QString value) {319 selectionList::iterator iter = values.begin();320 int ret = 0;321 while (iter != values.end()) {322 if (*iter == value) {323 return ret;324 } else {325 ret++;326 iter++;327 }328 }329 return 0;330 };331 332 326 protected: 333 typedef vector<QString> selectionList; 334 selectionList labels; 335 selectionList values; 336 unsigned current; 337 bool isSet; 327 bool expand; // whether to expand selections via 'set' calls 328 QStringList labels; // strings that are displayed 329 QStringList values; // strings that are used internally 330 QValueList<bool> states; // states of possible selections 331 QValueList<uint> selectionIndices; // indices of currently selected items 332 QStringList selectionLabels; // labels of currently selected items 333 QStringList selectionValues; // values of currently selected items 338 334 }; 339 335 340 336 class MPUBLIC SelectLabelSetting : public SelectSetting … … 350 346 class MPUBLIC ComboBoxSetting: public SelectSetting { 351 347 Q_OBJECT 352 348 353 protected:354 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1) :355 SelectSetting(_storage), rw(_rw), widget(NULL), step(_step) { }356 357 349 public: 358 virtual void setValue(QString newValue); 359 virtual void setValue(int which); 350 ComboBoxSetting(Storage *_storage, bool _rw = false, int _step = 1); 360 351 352 public: 361 353 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 362 354 const char* widgetName = 0); 363 355 … … 366 358 virtual void setEnabled(bool b); 367 359 virtual void setVisible(bool b); 368 360 369 public slots:370 void addSelection(const QString& label,371 QString value=QString::null,372 bool select=false) {373 if (widget != NULL)374 widget->insertItem(label);375 SelectSetting::addSelection(label, value, select);376 };377 361 protected slots: 362 virtual void selectionAdded(const QString& label, const QString&, bool state); 363 virtual void selectionChanged(); 378 364 void widgetDestroyed() { widget=NULL; }; 379 365 380 pr ivate:366 protected: 381 367 bool rw; 382 368 MythComboBox *widget; 383 384 protected:385 369 int step; 386 370 }; 387 371 388 372 class MPUBLIC ListBoxSetting: public SelectSetting { 389 373 Q_OBJECT 374 390 375 public: 391 ListBoxSetting(Storage *_storage) : 392 SelectSetting(_storage), widget(NULL), 393 selectionMode(MythListBox::Single) { } 376 ListBoxSetting(Storage *_storage, MythListBox::SelectionMode mode = MythListBox::Single); 394 377 378 public: 395 379 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 396 380 const char* widgetName = 0); 397 381 398 382 void setFocus() { if (widget) widget->setFocus(); } 399 void setSelectionMode(MythListBox::SelectionMode mode);400 void setCurrentItem(int i) { if (widget) widget->setCurrentItem(i); }401 void setCurrentItem(const QString& str) { if (widget) widget->setCurrentItem(str); }402 383 403 384 virtual void setEnabled(bool b); 404 385 … … 414 395 bool select = false); 415 396 416 397 protected slots: 417 void setValueByIndex(int index); 398 virtual void selectionAdded(const QString& label, const QString&, bool state); 399 virtual void selectionChanged(); 400 virtual void updateSelection(); 401 418 402 void widgetDestroyed() { widget=NULL; }; 403 419 404 protected: 420 MythListBox* widget;421 405 MythListBox::SelectionMode selectionMode; 406 MythListBox* widget; 422 407 }; 423 408 424 409 class MPUBLIC RadioSetting : public SelectSetting … … 429 414 const char* widgetName = 0); 430 415 }; 431 416 432 class MPUBLIC ImageSelectSetting: public SelectSetting {417 class MPUBLIC ImageSelectSetting: public ComboBoxSetting { 433 418 Q_OBJECT 419 420 protected: 421 ImageSelectSetting(Storage *_storage); 422 434 423 public: 435 ImageSelectSetting(Storage *_storage) : SelectSetting(_storage) { }436 virtual ~ImageSelectSetting();437 424 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 438 425 const char* widgetName = 0); 439 426 440 virtual void addImageSelection(const QString& label, 441 QImage* image, 442 QString value=QString::null, 443 bool select=false); 427 virtual void addSelection(const QString& label, 428 QImage* image, 429 QString value = QString::null, 430 bool select = false); 431 private: 432 virtual void addSelection(const QString&, QString, bool) {} 433 444 434 protected slots: 435 virtual void selectionChanged(); 445 436 void imageSet(int); 446 437 447 438 protected: 448 vector<QImage*> images;449 QLabel *imagelabel;439 QPtrList<QImage> images; 440 QLabel* imagelabel; 450 441 float m_hmult, m_wmult; 451 442 }; 452 443 … … 738 729 LineEditSetting(this, rw), HostDBStorage(this, name) { } 739 730 }; 740 731 732 class MPUBLIC HostListBox: public ListBoxSetting, public HostDBStorage 733 { 734 public: 735 HostListBox(const QString &name, MythListBox::SelectionMode mode = MythListBox::Single) : 736 ListBoxSetting(this, mode), HostDBStorage(this, name) { } 737 }; 738 741 739 class MPUBLIC HostImageSelect : public ImageSelectSetting, public HostDBStorage 742 740 { 743 741 public: -
libs/libmyth/mythwidgets.h
356 356 void focusInEvent(QFocusEvent *e); 357 357 }; 358 358 359 class MPUBLIC MythListBox: public QListBox { 359 class MPUBLIC MythListBox: public QListBox 360 { 360 361 Q_OBJECT 361 362 public: 362 363 MythListBox(QWidget* parent); -
programs/mythfrontend/globalsettings.cpp
541 541 "shows to delete first. LiveTV recordings " 542 542 "will always expire before normal " 543 543 "recordings.")); 544 bc->set Value(1);544 bc->setCurrent(1); 545 545 return bc; 546 546 } 547 547 … … 700 700 for (int i = 0; i < 4; i++) 701 701 gc->addSelection(str[i], QString::number(i)); 702 702 703 gc->set Value(1);703 gc->setCurrent(1); 704 704 gc->setHelpText(help); 705 705 706 706 return gc; … … 1446 1446 gc->addSelection(QString::number(i), QString::number(i)); 1447 1447 gc->addSelection(QObject::tr("All"), QString::number(-1)); 1448 1448 gc->setLabel(QObject::tr("Xinerama screen")); 1449 gc->set Value(0);1449 gc->setCurrent(0); 1450 1450 gc->setHelpText(QObject::tr("Run on the specified screen or " 1451 1451 "spanning all screens.")); 1452 1452 return gc; … … 1625 1625 DisplayResScreen dscr(w, h, -1, -1, -1.0, 0); 1626 1626 short rate = -1; 1627 1627 int i = DisplayResScreen::FindBestMatch(scr, dscr, rate); 1628 gc->set Value((i >= 0) ? i : scr.size()-1);1628 gc->setCurrent((i >= 0) ? i : scr.size()-1); 1629 1629 } 1630 1630 1631 1631 return gc; … … 1924 1924 continue; 1925 1925 } 1926 1926 1927 add ImageSelection(theme->fileName(), previewImage);1927 addSelection(theme->fileName(), previewImage); 1928 1928 } 1929 1929 1930 set Value("G.A.N.T.");1930 setCurrent(0); 1931 1931 } 1932 1932 1933 1933 class StyleSetting: public HostComboBox { … … 1968 1968 gc->addSelection(QObject::tr("callsign"), "<sign>"); 1969 1969 gc->addSelection(QObject::tr("name"), "<name>"); 1970 1970 gc->setHelpText(QObject::tr("Your preferred channel format.")); 1971 gc->set Value(1);1971 gc->setCurrent(1); 1972 1972 return gc; 1973 1973 } 1974 1974 … … 1982 1982 gc->addSelection(QObject::tr("callsign"), "<sign>"); 1983 1983 gc->addSelection(QObject::tr("name"), "<name>"); 1984 1984 gc->setHelpText(QObject::tr("Your preferred long channel format.")); 1985 gc->set Value(2);1985 gc->setCurrent(2); 1986 1986 return gc; 1987 1987 } 1988 1988 -
programs/mythfrontend/main.cpp
506 506 themename = themelist[rand() % themelist.size()]; 507 507 508 508 ThemeSelector Theme; 509 Theme.set Value(themename);509 Theme.setCurrentValue(themename); 510 510 Theme.save(); 511 511 512 512 return themename; -
programs/mythtv-setup/backendsettings.cpp
227 227 GlobalComboBox *gc = new GlobalComboBox("EITTimeOffset"); 228 228 gc->setLabel(QObject::tr("Time offset for EIT listings")); 229 229 init_time_offsets(gc); 230 gc->set Value(1);230 gc->setCurrent(1); 231 231 QString helptext = QObject::tr( 232 232 "Adjust the relative timezone of the EIT EPG data. " 233 233 "'Auto' converts the EIT time to local time using your "