Ticket #2594: multiselect_mythtv_r11685.patch
File multiselect_mythtv_r11685.patch, 48.2 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/channeleditor.cpp
246 246 src->addChild(source); 247 247 src->addChild(del); 248 248 249 sort->set Value(sort->getValueIndex(list->getSortMode()));250 source->set Value(source->getValueIndex(list->getSourceID()));249 sort->setCurrentValue(list->getSortMode()); 250 source->setCurrentValue(list->getSourceID()); 251 251 hide->setValue(list->getHideMode()); 252 252 253 253 addChild(sort); -
libs/libmythtv/playgroup.cpp
239 239 240 240 void PlayGroupEditor::doDelete(void) 241 241 { 242 QString name = get Value();242 QString name = getSelectionValues().first(); 243 243 if (name.isEmpty() || name == "Default") 244 244 return; 245 245 … … 259 259 if (!query.exec()) 260 260 MythContext::DBError("PlayGroupEditor::doDelete", query); 261 261 262 int lastIndex = get ValueIndex(name);262 int lastIndex = getSelectionIndices().first(); 263 263 lastValue = ""; 264 264 load(); 265 set Value(lastIndex);265 setCurrent(lastIndex); 266 266 } 267 267 268 268 setFocus(); … … 282 282 283 283 addSelection(tr("(Create new group)"), ""); 284 284 285 set Value(lastValue);285 setCurrentValue(lastValue); 286 286 } 287 287 288 288 int PlayGroupEditor::exec() { -
libs/libmythtv/scanwizardhelpers.h
721 721 722 722 void SetDefaultFormat(QString d) 723 723 { 724 int val = atsc_format->getValueIndex(d); 725 atsc_format->setValue(val); 724 atsc_format->setCurrentValue(d); 726 725 } 727 726 728 727 protected: -
libs/libmythtv/videosource.cpp
1637 1637 1638 1638 QString CardInput::getSourceName(void) const 1639 1639 { 1640 return sourceid->getSelectionLabel ();1640 return sourceid->getSelectionLabels().first(); 1641 1641 } 1642 1642 1643 1643 void CardInput::SetChildCardID(uint ccid) … … 1771 1771 else 1772 1772 { 1773 1773 load(); // new 1774 cardid->set Value(QString::number(_cardid));1774 cardid->setCurrentLabel(QString::number(_cardid)); 1775 1775 inputname->setValue(_inputname); 1776 1776 } 1777 1777 } -
libs/libmythtv/diseqcsettings.cpp
54 54 55 55 virtual void load(void) 56 56 { 57 QString tmp = QString::number((uint) m_device.GetDeviceType()); 58 setValue(getValueIndex(tmp)); 57 setCurrentValue(QString::number((uint) m_device.GetDeviceType())); 59 58 } 60 59 61 60 virtual void save(void) … … 154 153 155 154 virtual void load(void) 156 155 { 157 set Value(getValueIndex(QString::number((uint) m_switch.GetType())));156 setCurrentValue(QString::number((uint) m_switch.GetType())); 158 157 } 159 158 160 159 virtual void save(void) … … 251 250 252 251 virtual void load(void) 253 252 { 254 set Value(getValueIndex(QString::number((uint)m_rotor.GetType())));253 setCurrentValue(QString::number((uint)m_rotor.GetType())); 255 254 } 256 255 257 256 virtual void save(void) … … 394 393 395 394 void RotorPosMap::PopulateList(void) 396 395 { 397 int old_sel = get ValueIndex(getValue());396 int old_sel = getSelectionIndices().first(); 398 397 clearSelections(); 399 398 uint num_pos = 64; 400 399 for (uint pos = 1; pos < num_pos; pos++) … … 407 406 addSelection(DeviceTree::tr("Position #%1 (%2)").arg(pos).arg(posval), 408 407 QString::number(pos)); 409 408 } 410 setCurrent Item(old_sel);409 setCurrent(old_sel); 411 410 } 412 411 413 412 //////////////////////////////////////// RotorPosConfig … … 556 555 557 556 virtual void load(void) 558 557 { 559 set Value(FindPreset(m_lnb));558 setCurrent(FindPreset(m_lnb)); 560 559 } 561 560 562 561 virtual void save(void) … … 590 589 591 590 virtual void load(void) 592 591 { 593 set Value(getValueIndex(QString::number((uint) m_lnb.GetType())));592 setCurrentValue(QString::number((uint) m_lnb.GetType())); 594 593 } 595 594 596 595 virtual void save(void) … … 758 757 } 759 758 else 760 759 { 761 m_type->setValue(m_type->getValueIndex( 762 QString::number((uint)preset.type))); 760 m_type->setCurrentValue(QString::number((uint)preset.type)); 763 761 m_lof_switch->setValue(QString::number(preset.lof_sw / 1000)); 764 762 m_lof_lo->setValue(QString::number(preset.lof_lo / 1000)); 765 763 m_lof_hi->setValue(QString::number(preset.lof_hi / 1000)); … … 987 985 988 986 void DeviceTree::PopulateTree(void) 989 987 { 990 int old_sel = get ValueIndex(getValue());988 int old_sel = getSelectionIndices().first(); 991 989 clearSelections(); 992 990 PopulateTree(m_tree.Root()); 993 setCurrent Item(old_sel);991 setCurrent(old_sel); 994 992 } 995 993 996 994 void DeviceTree::PopulateTree(DiSEqCDevDevice *node, … … 1062 1060 virtual void load(void) 1063 1061 { 1064 1062 double value = m_settings.GetValue(m_node.GetDeviceID()); 1065 set Value((uint)value);1063 setCurrent((uint)value); 1066 1064 } 1067 1065 1068 1066 virtual void save(void) … … 1100 1098 addSelection(AngleToString(*it), QString::number(*it)); 1101 1099 1102 1100 double angle = m_settings.GetValue(m_node.GetDeviceID()); 1103 set Value(getValueIndex(QString::number(angle)));1101 setCurrentValue(QString::number(angle)); 1104 1102 } 1105 1103 1106 1104 virtual void save(void) -
libs/libmythtv/channelsettings.cpp
62 62 { 63 63 uint which = sourceid_to_index[default_sourceid]; 64 64 if (which) 65 set Value(which);65 setCurrent(which); 66 66 } 67 67 }; 68 68 -
libs/libmythtv/recordingprofile.cpp
130 130 MPEG2audBitrateL1(const RecordingProfile& parent): 131 131 CodecParam(parent, "mpeg2audbitratel1") { 132 132 setLabel(QObject::tr("Bitrate")); 133 133 134 134 addSelection("32 kbps", "32"); 135 135 addSelection("64 kbps", "64"); 136 136 addSelection("96 kbps", "96"); … … 145 145 addSelection("384 kbps", "384"); 146 146 addSelection("416 kbps", "416"); 147 147 addSelection("448 kbps", "448"); 148 set Value(13);148 setCurrent(13); 149 149 setHelpText(QObject::tr("Sets the audio bitrate")); 150 150 }; 151 151 }; … … 155 155 MPEG2audBitrateL2(const RecordingProfile& parent): 156 156 CodecParam(parent, "mpeg2audbitratel2") { 157 157 setLabel(QObject::tr("Bitrate")); 158 158 159 159 addSelection("32 kbps", "32"); 160 160 addSelection("48 kbps", "48"); 161 161 addSelection("56 kbps", "56"); … … 170 170 addSelection("256 kbps", "256"); 171 171 addSelection("320 kbps", "320"); 172 172 addSelection("384 kbps", "384"); 173 set Value(13);173 setCurrent(13); 174 174 setHelpText(QObject::tr("Sets the audio bitrate")); 175 175 }; 176 176 }; … … 212 212 audbr->setLabel("Layer II"); 213 213 addTarget("Layer II", audbr); 214 214 audType->addSelection("Layer II"); 215 audType->set Value(1);215 audType->setCurrent(1); 216 216 }; 217 217 }; 218 218 … … 228 228 addSelection(QObject::tr("SAP Language"), "1"); 229 229 addSelection(QObject::tr("Dual"), "2"); 230 230 231 set Value(0);231 setCurrent(0); 232 232 setHelpText(QObject::tr( 233 233 "Chooses the language(s) to record when " 234 234 "two languages are broadcast. Only Layer II " … … 505 505 MPEG2streamType(const RecordingProfile& parent): 506 506 CodecParam(parent, "mpeg2streamtype") { 507 507 setLabel(QObject::tr("Stream Type")); 508 508 509 509 addSelection("MPEG-2 PS"); 510 510 addSelection("MPEG-2 TS"); 511 511 addSelection("MPEG-1 VCD"); … … 515 515 addSelection("DVD"); 516 516 addSelection("DVD-Special 1"); 517 517 addSelection("DVD-Special 2"); 518 set Value(0);518 setCurrent(0); 519 519 setHelpText(QObject::tr("Sets the type of stream generated by " 520 520 "your PVR.")); 521 521 }; … … 526 526 MPEG2aspectRatio(const RecordingProfile& parent): 527 527 CodecParam(parent, "mpeg2aspectratio") { 528 528 setLabel(QObject::tr("Aspect Ratio")); 529 529 530 530 addSelection(QObject::tr("Square"), "Square"); 531 531 addSelection("4:3"); 532 532 addSelection("16:9"); 533 533 addSelection("2.21:1"); 534 set Value(1);534 setCurrent(1); 535 535 setHelpText(QObject::tr("Sets the aspect ratio of stream generated " 536 536 "by your PVR.")); 537 537 }; … … 555 555 addSelection("1"); 556 556 addSelection("2"); 557 557 addSelection("4"); 558 set Value(2);558 setCurrent(2); 559 559 }; 560 560 }; 561 561 … … 567 567 addSelection("1"); 568 568 addSelection("2"); 569 569 addSelection("4"); 570 set Value(2);570 setCurrent(2); 571 571 }; 572 572 }; 573 573 … … 741 741 addSelection(QObject::tr("Normal"), "all"); 742 742 addSelection(QObject::tr("TV Only"), "tv"); 743 743 addSelection(QObject::tr("Audio Only"), "audio"); 744 set Value(0);744 setCurrent(0); 745 745 }; 746 746 }; 747 747 -
libs/libmythtv/scheduledrecording.cpp
628 628 case kChannelRecord: 629 629 label = QString("%1 on channel %2") 630 630 .arg(sr.title->getValue()) 631 .arg(sr.channel->getSelectionLabel ());631 .arg(sr.channel->getSelectionLabels().first()); 632 632 break; 633 633 case kWeekslotRecord: 634 634 weekly = QDate(sr.startDate->dateValue()).toString("dddd")+"s "; 635 635 case kTimeslotRecord: 636 636 label = QString("%1 on channel %2 (%3%4 - %5)") 637 637 .arg(sr.title->getValue()) 638 .arg(sr.channel->getSelectionLabel ())638 .arg(sr.channel->getSelectionLabels().first()) 639 639 .arg(weekly) 640 640 .arg(sr.startTime->timeValue().toString()) 641 641 .arg(sr.endTime->timeValue().toString()); … … 645 645 case kDontRecord: 646 646 label = QString("%1 on channel %2 (%3 %4 - %5)") 647 647 .arg(sr.title->getValue()) 648 .arg(sr.channel->getSelectionLabel ())648 .arg(sr.channel->getSelectionLabels().first()) 649 649 .arg(sr.startDate->dateValue().toString()) 650 650 .arg(sr.startTime->timeValue().toString()) 651 651 .arg(sr.endTime->timeValue().toString()); … … 755 755 title->setValue(""); 756 756 subtitle->setValue(""); 757 757 description->setValue(""); 758 channel->setValue(""); 758 channel->setCurrent(0); 759 channel->setState(0, false); 759 760 station->setValue(""); 760 761 QDate date = QDate::currentDate(); 761 762 QTime time = QTime::currentTime(); … … 825 826 title->setValue(proginfo->title); 826 827 subtitle->setValue(proginfo->subtitle); 827 828 description->setValue(proginfo->description); 828 channel->set Value(proginfo->chanid);829 channel->setCurrentValue(proginfo->chanid); 829 830 station->setValue(proginfo->chansign); 830 831 startDate->setValue(proginfo->startts.date()); 831 832 startTime->setValue(proginfo->startts.time()); -
libs/libmythtv/scanwizardhelpers.cpp
184 184 185 185 if (sourceid > -1) 186 186 { 187 set Value(which);187 setCurrent(which); 188 188 setEnabled(false); 189 189 } 190 190 } … … 472 472 parent, SLOT(captureCard(const QString&))); 473 473 } 474 474 475 LogList::LogList() : n(0)475 LogList::LogList() : ListBoxSetting(MythListBox::NoSelection), n(0) 476 476 { 477 setSelectionMode(MythListBox::NoSelection);478 477 } 479 478 480 479 void LogList::updateText(const QString& status) 481 480 { 482 481 addSelection(status,QString::number(n)); 483 setCurrent Item(n);482 setCurrent(n); 484 483 n++; 485 484 } -
libs/libmyth/settings.cpp
361 361 triggerMap[triggerValue] = target; 362 362 } 363 363 364 void SelectSetting::addSelection(const QString& label, QString value, bool select) { 364 void SelectSetting::addSelection(const QString& label, QString value, bool state) 365 { 365 366 if (value == QString::null) 366 367 value = label; 367 368 bool found = false;369 for(unsigned i = 0 ; i < values.size() ; ++i)370 if ((values[i] == value) &&371 (labels[i] == label)) {372 found = true;373 break;374 }375 368 376 if (!found) 369 int index = labels.findIndex(label); 370 371 if (index == -1) 377 372 { 378 labels.push_back(label); 379 values.push_back(value); 380 381 emit selectionAdded(label, value); 382 383 if (select || !isSet) 384 setValue(value); 373 labels.append(label); 374 values.append(value); 375 states.append(state); 376 377 emit selectionAdded(label, value, state); 378 379 if (state) 380 { 381 selectionIndices.append(states.count() - 1); 382 selectionLabels.append(label); 383 selectionValues.append(value); 384 updateValue(); 385 } 385 386 } 387 else 388 { 389 setState(index, state); 390 } 386 391 } 387 392 388 393 void SelectSetting::fillSelectionsFromDir(const QDir& dir, bool absPath) { … … 400 405 addSelection(fi->fileName()); 401 406 } 402 407 403 void SelectSetting::clearSelections(void) { 408 void SelectSetting::clearSelections() 409 { 404 410 labels.clear(); 405 411 values.clear(); 406 isSet = false; 412 states.clear(); 413 selectionIndices.clear(); 414 selectionLabels.clear(); 415 selectionValues.clear(); 416 updateValue(); 407 417 emit selectionsCleared(); 408 418 } 409 419 410 void SelectSetting::setValue(const QString& newValue) { 411 bool found = false; 412 for(unsigned i = 0 ; i < values.size() ; ++i) 413 if (values[i] == newValue) { 414 current = i; 415 found = true; 416 isSet = true; 417 break; 420 void SelectSetting::setCurrent(uint which) 421 { 422 if (which < labels.count()) 423 { 424 for(uint i = 0 ; i < states.size() ; ++i) 425 states[i] = false; 426 selectionIndices.clear(); 427 selectionLabels.clear(); 428 selectionValues.clear(); 429 selectionIndices.append(which); 430 selectionLabels.append(labels[which]); 431 selectionValues.append(values[which]); 432 states[which] = true; 433 updateValue(); 434 } 435 else 436 { 437 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrent(%2) - invalid value") 438 .arg(getName()) 439 .arg(which)); 440 } 441 } 442 443 void SelectSetting::setCurrentLabel(const QString& label) 444 { 445 int index = labels.findIndex(label); 446 447 if (index == -1) 448 { 449 if (expand) 450 { 451 for(uint j = 0 ; j < states.size() ; ++j) 452 states[j] = false; 453 selectionIndices.clear(); 454 selectionLabels.clear(); 455 selectionValues.clear(); 456 457 addSelection(label, label, true); 418 458 } 419 if (found) 420 Setting::setValue(newValue); 459 else 460 { 461 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrentLabel(%2) - invalid label") 462 .arg(getName()) 463 .arg(label)); 464 } 465 } 421 466 else 422 addSelection(newValue, newValue, true); 467 { 468 setCurrent(index); 469 } 423 470 } 424 471 425 void SelectSetting::set Value(int which)472 void SelectSetting::setCurrentValue(const QString& value) 426 473 { 427 if ((unsigned)which > values.size()-1 || which < 0) { 428 VERBOSE(VB_IMPORTANT, 429 "SelectSetting::setValue(): invalid index " << which); 430 return; 474 int index = values.findIndex(value); 475 476 if (index == -1) 477 { 478 if (expand) 479 { 480 for(uint j = 0 ; j < states.size() ; ++j) 481 states[j] = false; 482 selectionIndices.clear(); 483 selectionLabels.clear(); 484 selectionValues.clear(); 485 486 addSelection(value, value, true); 487 } 488 else 489 { 490 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setCurrent(%2) - invalid value") 491 .arg(getName()) 492 .arg(value)); 493 } 431 494 } 432 current = which; 433 isSet = true; 434 Setting::setValue(values[current]); 495 else 496 { 497 setCurrent(index); 498 } 435 499 } 436 500 501 void SelectSetting::setState(uint which, bool state) 502 { 503 if (which < labels.count()) 504 { 505 if (states[which] != state) 506 { 507 states[which] = state; 508 if (!states[which]) 509 { 510 selectionIndices.remove(which); 511 selectionLabels.remove(labels[which]); 512 selectionValues.remove(values[which]); 513 } 514 else 515 { 516 selectionIndices.append(which); 517 selectionLabels.append(labels[which]); 518 selectionValues.append(values[which]); 519 } 520 updateValue(); 521 } 522 } 523 else 524 { 525 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setState(%2, %3) - invalid value") 526 .arg(getName()) 527 .arg(which) 528 .arg(state)); 529 } 530 } 531 532 void SelectSetting::setStateLabel(const QString& label, bool state) 533 { 534 int index = labels.findIndex(label); 535 536 if (index == -1) 537 { 538 if (expand) 539 { 540 addSelection(label, label, true); 541 } 542 else 543 { 544 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setStateLabel(%2, %3) - invalid label") 545 .arg(getName()) 546 .arg(label) 547 .arg(state)); 548 } 549 } 550 else 551 { 552 setState(index, state); 553 } 554 } 555 556 void SelectSetting::setStateValue(const QString& value, bool state) 557 { 558 int index = values.findIndex(value); 559 560 if (index == -1) 561 { 562 if (expand) 563 { 564 addSelection(value, value, true); 565 } 566 else 567 { 568 VERBOSE(VB_IMPORTANT, QString("SelectSetting(%1)::setStateValue(%2, %3) - invalid value") 569 .arg(getName()) 570 .arg(value) 571 .arg(state)); 572 } 573 } 574 else 575 { 576 setState(index, state); 577 } 578 } 579 580 void SelectSetting::setValue(const QString& newValue) 581 { 582 for(uint i = 0 ; i < states.size() ; ++i) 583 states[i] = false; 584 selectionIndices.clear(); 585 selectionLabels.clear(); 586 selectionValues.clear(); 587 588 selectionValues = QStringList::split(';', newValue); 589 590 for (QStringList::iterator iter = selectionValues.begin(); iter != selectionValues.end(); iter++) 591 { 592 int index = values.findIndex(*iter); 593 594 if (index == -1) 595 { 596 if (expand) 597 { 598 labels.append(*iter); 599 values.append(*iter); 600 states.append(true); 601 602 emit selectionAdded(*iter, *iter, true); 603 604 selectionIndices.append(states.count() - 1); 605 selectionLabels.append(*iter); 606 } 607 else 608 { 609 VERBOSE(VB_IMPORTANT, 610 "SelectSetting(" << getName() << ")::setValue(" << *iter << "): invalid value "); 611 iter = selectionValues.erase(iter); 612 iter--; 613 } 614 } 615 else 616 { 617 selectionIndices.append(index); 618 selectionLabels.append(labels[index]); 619 states[index] = true; 620 } 621 } 622 623 updateValue(); 624 } 625 626 void SelectSetting::updateValue() 627 { 628 QString newValue(""); 629 for (QStringList::const_iterator iter = selectionValues.begin(); iter != selectionValues.end(); iter++) 630 { 631 if (!newValue.isEmpty()) 632 newValue.append(';'); 633 newValue.append(*iter); 634 } 635 Setting::setValue(newValue); 636 emit selectionChanged(); 637 } 638 437 639 QWidget* LabelSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 438 640 const char* widgetName) { 439 641 (void)cg; … … 635 837 } 636 838 637 839 QLabel* value = new QLabel(widget); 638 value->setText( labels[current]);840 value->setText(getValue()); 639 841 value->setBackgroundOrigin(QWidget::WindowOrigin); 640 842 641 843 connect(this, SIGNAL(valueChanged(const QString&)), … … 644 846 return widget; 645 847 } 646 848 849 ComboBoxSetting::ComboBoxSetting(bool _rw, int _step) : 850 SelectSetting(_rw), 851 rw(_rw), 852 widget(NULL), 853 step(_step) 854 { 855 connect(this, SIGNAL(selectionAdded(const QString&, const QString&, bool)), 856 this, SLOT(selectionAdded(const QString&, const QString&, bool))); 857 connect(this, SIGNAL(selectionChanged()), 858 this, SLOT(selectionChanged())); 859 } 860 647 861 QWidget* ComboBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 648 862 const char* widgetName) { 649 863 QHBox* box; … … 672 886 box->setStretchFactor(widget, 1); 673 887 674 888 for(unsigned int i = 0 ; i < labels.size() ; ++i) 889 { 675 890 widget->insertItem(labels[i]); 891 if (states[i]) 892 widget->setCurrentItem(i); 893 } 676 894 677 if (isSet) 678 widget->setCurrentItem(current); 895 setState(widget->currentItem(), true); 679 896 680 897 if (1 < step) 681 898 widget->setStep(step); 682 899 683 if (rw) 684 connect(widget, SIGNAL(highlighted(const QString &)), 685 this, SLOT(setValue(const QString &))); 686 else 687 connect(widget, SIGNAL(highlighted(int)), 688 this, SLOT(setValue(int))); 689 900 connect(widget, SIGNAL(highlighted(const QString &)), 901 this, SLOT(setCurrentLabel(const QString &))); 690 902 connect(widget, SIGNAL(destroyed()), 691 903 this, SLOT(widgetDestroyed())); 692 904 connect(this, SIGNAL(selectionsCleared()), … … 719 931 } 720 932 } 721 933 722 void ComboBoxSetting::se tValue(QString newValue)934 void ComboBoxSetting::selectionAdded(const QString& label, const QString&, bool) 723 935 { 724 if ( !rw)936 if (widget) 725 937 { 726 VERBOSE(VB_IMPORTANT, "ComboBoxSetting::setValue(QString): " 727 "BUG: attempted to set value of read-only ComboBox"); 728 return; 938 widget->insertItem(label); 729 939 } 730 Setting::setValue(newValue); 731 if (widget) 732 widget->setCurrentItem(current); 733 }; 940 } 734 941 735 void ComboBoxSetting::se tValue(int which)942 void ComboBoxSetting::selectionChanged() 736 943 { 737 944 if (widget) 738 widget->setCurrentItem(which); 739 SelectSetting::setValue(which); 740 }; 945 { 946 widget->setCurrentItem(getSelectionIndices().first()); 947 } 948 } 741 949 742 950 void HostRefreshRateComboBox::ChangeResolution(const QString& resolution) 743 951 { 744 952 clearSelections(); 745 953 746 954 const vector<short> list = GetRefreshRates(resolution); 747 955 addSelection(QObject::tr("Any"), "0"); 748 956 int hz50 = -1, hz60 = -1; 749 957 for (uint i=0; i<list.size(); ++i) 750 { 958 { 751 959 QString sel = QString::number(list[i]); 752 960 addSelection(sel+" Hz", sel); 753 961 hz50 = (50 == list[i]) ? i : hz50; 754 962 hz60 = (60 == list[i]) ? i : hz60; 755 963 } 756 757 setValue(0); 964 758 965 if ("640x480" == resolution || "720x480" == resolution) 759 setValue(hz60+1); 760 if ("640x576" == resolution || "720x576" == resolution) 761 setValue(hz50+1); 762 966 setCurrent(hz60 + 1); 967 else if ("640x576" == resolution || "720x576" == resolution) 968 setCurrent(hz50 + 1); 969 else 970 setCurrent(0); 971 763 972 setEnabled(list.size()); 764 973 } 765 974 … … 839 1048 QRadioButton* button = new QRadioButton(widget, NULL); 840 1049 button->setBackgroundOrigin(QWidget::WindowOrigin); 841 1050 button->setText(labels[i]); 842 if ( isSet && i == current)1051 if (states[i]) 843 1052 button->setDown(true); 844 1053 } 845 1054 1055 setState(widget->selectedId(), true); 1056 846 1057 cg = cg; 847 1058 848 1059 return widget; … … 1118 1329 save(table); 1119 1330 } 1120 1331 1121 void ListBoxSetting::setEnabled(bool b) 1332 1333 ListBoxSetting::ListBoxSetting(MythListBox::SelectionMode mode) : 1334 selectionMode(mode), 1335 widget(NULL) 1122 1336 { 1123 Configurable::setEnabled(b); 1124 if (widget) 1125 widget->setEnabled(b); 1337 connect(this, SIGNAL(selectionAdded(const QString&, const QString&, bool)), 1338 this, SLOT(selectionAdded(const QString&, const QString&, bool))); 1339 connect(this, SIGNAL(selectionChanged()), 1340 this, SLOT(selectionChanged())); 1126 1341 } 1127 1342 1128 1343 QWidget* ListBoxSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, … … 1139 1354 1140 1355 widget = new MythListBox(box); 1141 1356 widget->setBackgroundOrigin(QWidget::WindowOrigin); 1357 widget->setSelectionMode(selectionMode); 1142 1358 widget->setHelpText(getHelpText()); 1143 1359 1144 for(u nsignedint i = 0 ; i < labels.size() ; ++i) {1360 for(uint i = 0 ; i < labels.size() ; ++i) { 1145 1361 widget->insertItem(labels[i]); 1146 if (isSet && current == i) 1147 widget->setCurrentItem(i); 1362 widget->setSelected(i, states[i]); 1148 1363 } 1149 1364 1150 1365 connect(widget, SIGNAL(destroyed()), … … 1159 1374 this, SIGNAL(editButtonPressed(int))); 1160 1375 connect(widget, SIGNAL(deleteButtonPressed(int)), 1161 1376 this, SIGNAL(deleteButtonPressed(int))); 1162 connect(this, SIGNAL(valueChanged(const QString&)), 1163 widget, SLOT(setCurrentItem(const QString&))); 1164 connect(widget, SIGNAL(highlighted(int)), 1165 this, SLOT(setValueByIndex(int))); 1377 connect(widget, SIGNAL(selectionChanged()), 1378 this, SLOT(updateSelection())); 1166 1379 1167 1380 if (cg) 1168 1381 connect(widget, SIGNAL(changeHelpText(QString)), cg, 1169 1382 SIGNAL(changeHelpText(QString))); 1170 1383 1171 1384 widget->setFocus(); 1172 widget->setSelectionMode(selectionMode);1173 1385 1174 1386 return box; 1175 1387 } 1176 1388 1177 void ListBoxSetting::set SelectionMode(MythListBox::SelectionMode mode)1389 void ListBoxSetting::setEnabled(bool b) 1178 1390 { 1179 selectionMode = mode;1180 if (widget)1181 widget->setSelectionMode(selectionMode);1391 Configurable::setEnabled(b); 1392 if (widget) 1393 widget->setEnabled(b); 1182 1394 } 1183 1395 1184 void ListBoxSetting::se tValueByIndex(int index)1396 void ListBoxSetting::selectionAdded(const QString& label, const QString&, bool) 1185 1397 { 1186 if (((uint)index) < values.size()) 1187 setValue(values[index]); 1398 if (widget) 1399 { 1400 widget->insertItem(label); 1401 } 1188 1402 } 1189 1403 1190 void ImageSelectSetting::addImageSelection(const QString& label, 1191 QImage* image, 1192 QString value, 1193 bool select) { 1194 images.push_back(image); 1195 addSelection(label, value, select); 1404 void ListBoxSetting::selectionChanged() 1405 { 1406 if (widget) 1407 for (uint i = 0; i < states[i]; ++i) 1408 widget->setSelected(i, states[i]); 1196 1409 } 1197 1410 1198 ImageSelectSetting::~ImageSelectSetting() { 1199 while (images.size() > 0){1200 delete images.back();1201 images.pop_back();1202 }1411 void ListBoxSetting::updateSelection() 1412 { 1413 if (widget) 1414 for (uint i = 0; i < widget->count(); ++i) 1415 setState(i, widget->item(i)->isSelected()); 1203 1416 } 1204 1417 1205 void ImageSelectSetting::imageSet(int num) 1418 1419 ImageSelectSetting::ImageSelectSetting() : 1420 imagelabel(NULL) 1206 1421 { 1207 if (num >= (int)images.size()) 1208 return; 1209 1210 if (!images[current]) 1211 return; 1212 1213 QImage temp = *(images[current]); 1214 temp = temp.smoothScale((int)(184 * m_hmult), (int)(138 * m_hmult), 1215 QImage::ScaleMin); 1216 1217 QPixmap tmppix(temp); 1218 imagelabel->setPixmap(tmppix); 1422 images.setAutoDelete(true); 1219 1423 } 1220 1424 1221 1425 QWidget* ImageSelectSetting::configWidget(ConfigurationGroup *cg, … … 1226 1430 1227 1431 gContext->GetScreenSettings(width, m_wmult, height, m_hmult); 1228 1432 1229 QHBox* box; 1230 if (labelAboveWidget) 1231 { 1232 box = dynamic_cast<QHBox*>(new QVBox(parent, widgetName)); 1233 box->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, 1234 QSizePolicy::Maximum)); 1235 } 1236 else 1237 box = new QHBox(parent, widgetName); 1238 1433 QHBox* box = new QHBox(parent, widgetName); 1239 1434 box->setBackgroundOrigin(QWidget::WindowOrigin); 1435 box->setSpacing(100); 1240 1436 1241 if (getLabel() != "") 1242 { 1243 QLabel* label = new QLabel(box); 1244 label->setText(getLabel() + ":"); 1245 label->setBackgroundOrigin(QWidget::WindowOrigin); 1246 } 1437 ComboBoxSetting::configWidget(cg, box); 1247 1438 1248 MythComboBox *widget = new MythComboBox(false, box);1249 widget->setBackgroundOrigin(QWidget::WindowOrigin);1250 1251 QLabel *testlabel = new QLabel(box);1252 testlabel->setText(" ");1253 testlabel->setBackgroundOrigin(QWidget::WindowOrigin);1254 1255 1439 imagelabel = new QLabel(box); 1256 1440 imagelabel->setBackgroundOrigin(QWidget::WindowOrigin); 1257 1441 1258 for (unsigned int i = 0 ; i < images.size() ; ++i) 1259 widget->insertItem(labels[i]); 1442 selectionChanged(); 1260 1443 1261 if (isSet) 1262 widget->setCurrentItem(current); 1263 else 1264 current = 0; 1444 connect(widget, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1265 1445 1266 if (images.size() != 0 && current < images.size() && images[current]) 1267 { 1268 QImage temp = *(images[current]); 1269 temp = temp.smoothScale((int)(184 * m_hmult), (int)(138 * m_hmult), 1270 QImage::ScaleMin); 1271 1272 QPixmap tmppix(temp); 1273 imagelabel->setPixmap(tmppix); 1446 return box; 1447 } 1448 1449 void ImageSelectSetting::addSelection(const QString& label, 1450 QImage* image, 1451 QString value, 1452 bool select) 1453 { 1454 if (labels.find(label) == labels.end()) 1455 { 1456 images.append(image); 1457 SelectSetting::addSelection(label, value, select); 1274 1458 } 1275 else 1459 } 1460 1461 void ImageSelectSetting::imageSet(int num) 1462 { 1463 if (imagelabel) 1276 1464 { 1277 1465 QPixmap tmppix((int)(184 * m_hmult), (int)(138 * m_hmult)); 1278 tmppix.fill(black);1279 1466 1467 if (num < (int)images.count() && images.at(num)) 1468 tmppix = images.at(num)->smoothScale((int)(184 * m_hmult), 1469 (int)(138 * m_hmult), 1470 QImage::ScaleMin); 1471 else 1472 tmppix.fill(black); 1473 1280 1474 imagelabel->setPixmap(tmppix); 1281 1475 } 1476 } 1282 1477 1283 connect(widget, SIGNAL(highlighted(int)), this, SLOT(setValue(int))); 1284 connect(widget, SIGNAL(highlighted(int)), this, SLOT(imageSet(int))); 1478 void ImageSelectSetting::selectionChanged() 1479 { 1480 imageSet(getSelectionIndices().first()); 1481 ComboBoxSetting::selectionChanged(); 1482 } 1285 1483 1286 connect(this, SIGNAL(selectionsCleared()),1287 widget, SLOT(clear()));1288 1484 1289 if (cg)1290 connect(widget, SIGNAL(changeHelpText(QString)), cg,1291 SIGNAL(changeHelpText(QString)));1292 1293 return box;1294 }1295 1296 1485 HostnameSetting::HostnameSetting(void) { 1297 1486 setVisible(false); 1298 1487 -
libs/libmyth/dbsettings.cpp
81 81 { 82 82 setLabel(QObject::tr("Database Configuration") + " 1/2"); 83 83 setUseLabel(false); 84 84 85 85 info = new TransLabelSetting(); 86 86 87 87 MSqlQuery query(MSqlQuery::InitCon()); … … 93 93 "Please verify your database settings " 94 94 "below.")); 95 95 addChild(info); 96 96 97 97 dbHostName = new TransLineEditSetting(true); 98 98 dbHostName->setLabel(QObject::tr("Host name")); 99 99 dbHostName->setHelpText(QObject::tr("The host name or IP address of " … … 107 107 "on, if it's not the default database " 108 108 "port.")); 109 109 addChild(dbPort); 110 110 111 111 dbName = new TransLineEditSetting(true); 112 112 dbName->setLabel(QObject::tr("Database")); 113 113 dbName->setHelpText(QObject::tr("The name of the database. " … … 120 120 "connecting to the database. " 121 121 "This information is required.")); 122 122 addChild(dbUserName); 123 123 124 124 dbPassword = new TransLineEditSetting(true); 125 125 dbPassword->setLabel(QObject::tr("Password")); 126 126 dbPassword->setHelpText(QObject::tr("The password to use while " 127 127 "connecting to the database. " 128 128 "This information is required.")); 129 129 addChild(dbPassword); 130 130 131 131 dbType = new TransComboBoxSetting(false); 132 132 dbType->setLabel(QObject::tr("Database type")); 133 133 dbType->addSelection(QObject::tr("MySQL"), "QMYSQL3"); 134 134 //dbType->addSelection(QObject::tr("PostgreSQL"), "QPSQL7"); 135 dbType->set Value(0);135 dbType->setCurrent(0); 136 136 dbType->setHelpText(QObject::tr("The database implementation used " 137 137 "for your server.")); 138 138 addChild(dbType); … … 212 212 void MythDbSettings1::load() 213 213 { 214 214 DatabaseParams params = gContext->GetDatabaseParams(); 215 215 216 216 if (params.dbHostName.isEmpty() || 217 217 params.dbUserName.isEmpty() || 218 218 params.dbPassword.isEmpty() || 219 219 params.dbName.isEmpty()) 220 220 info->setValue(info->getValue() + "\nRequired fields are marked " 221 221 "with an asterisk (*)."); 222 222 223 223 dbHostName->setValue(params.dbHostName); 224 224 if (params.dbHostName.isEmpty()) 225 225 dbHostName->setLabel("* " + dbHostName->getLabel()); … … 236 236 dbName->setValue(params.dbName); 237 237 if (params.dbName.isEmpty()) 238 238 dbName->setLabel("* " + dbName->getLabel()); 239 239 240 240 if (params.dbType == "QMYSQL3") 241 dbType->set Value(0);241 dbType->setCurrent(0); 242 242 else if (params.dbType == "QPSQL7") 243 dbType->set Value(1);243 dbType->setCurrent(1); 244 244 } 245 245 246 246 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
359 359 class MPUBLIC SelectSetting: virtual public Setting { 360 360 Q_OBJECT 361 361 protected: 362 SelectSetting() { isSet = false; }; 362 SelectSetting(bool _expand = false) : expand(_expand) { }; 363 363 364 public: 364 365 virtual void addSelection(const QString& label, 365 QString value =QString::null,366 bool s elect=false);366 QString value = QString::null, 367 bool state = false); 367 368 368 virtual void clearSelections(void); 369 virtual const QValueList<uint> getSelectionIndices() const {return selectionIndices;} 370 virtual const QStringList& getSelectionLabels() const {return selectionLabels;} 371 virtual const QStringList& getSelectionValues() const {return selectionValues;} 369 372 373 virtual void clearSelections(); 374 370 375 virtual void fillSelectionsFromDir(const QDir& dir, bool absPath=true); 371 376 372 377 signals: 373 void selectionAdded(const QString& label, QString value); 374 void selectionsCleared(void); 378 void selectionAdded(const QString& label, const QString& value, bool state); 379 void selectionChanged(); 380 void selectionsCleared(); 375 381 376 382 public slots: 383 virtual void setCurrent(uint which); 384 virtual void setCurrentLabel(const QString& label); 385 virtual void setCurrentValue(const QString& value); 386 virtual void setState(uint which, bool state); 387 virtual void setStateLabel(const QString& label, bool state); 388 virtual void setStateValue(const QString& value, bool state); 377 389 390 private slots: 378 391 virtual void setValue(const QString& newValue); 379 virtual void setValue(int which);380 392 381 virtual QString getSelectionLabel(void) const { 382 if (!isSet) 383 return QString::null; 384 return labels[current]; 385 }; 393 protected: 394 virtual void updateValue(); 386 395 387 virtual int getValueIndex(QString value) {388 selectionList::iterator iter = values.begin();389 int ret = 0;390 while (iter != values.end()) {391 if (*iter == value) {392 return ret;393 } else {394 ret++;395 iter++;396 }397 }398 return 0;399 };400 401 396 protected: 402 typedef vector<QString> selectionList; 403 selectionList labels; 404 selectionList values; 405 unsigned current; 406 bool isSet; 397 bool expand; // whether to expand selections via 'set' calls 398 QStringList labels; // strings that are displayed 399 QStringList values; // strings that are used internally 400 QValueList<bool> states; // states of possible selections 401 QValueList<uint> selectionIndices; // indices of currently selected items 402 QStringList selectionLabels; // labels of currently selected items 403 QStringList selectionValues; // values of currently selected items 407 404 }; 408 405 409 406 class MPUBLIC SelectLabelSetting: public LabelSetting, public SelectSetting { … … 419 416 Q_OBJECT 420 417 421 418 protected: 422 ComboBoxSetting(bool _rw = false, int _step = 1) { 423 rw = _rw; 424 step = _step; 425 widget = NULL; 426 } 419 ComboBoxSetting(bool _rw = false, int _step = 1); 427 420 428 421 public: 429 virtual void setValue(QString newValue);430 virtual void setValue(int which);431 432 422 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 433 423 const char* widgetName = 0); 434 424 … … 437 427 virtual void setEnabled(bool b); 438 428 virtual void setVisible(bool b); 439 429 440 public slots:441 void addSelection(const QString& label,442 QString value=QString::null,443 bool select=false) {444 if (widget != NULL)445 widget->insertItem(label);446 SelectSetting::addSelection(label, value, select);447 };448 430 protected slots: 431 virtual void selectionAdded(const QString& label, const QString&, bool state); 432 virtual void selectionChanged(); 449 433 void widgetDestroyed() { widget=NULL; }; 450 434 451 pr ivate:435 protected: 452 436 bool rw; 453 437 MythComboBox *widget; 454 455 protected:456 438 int step; 457 439 }; 458 440 459 441 class MPUBLIC ListBoxSetting: public SelectSetting { 460 442 Q_OBJECT 443 444 protected: 445 ListBoxSetting(MythListBox::SelectionMode mode = MythListBox::Single); 446 461 447 public: 462 ListBoxSetting(): widget(NULL), selectionMode(MythListBox::Single) { }463 448 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 464 449 const char* widgetName = 0); 465 450 466 451 void setFocus() { if (widget) widget->setFocus(); } 467 void setSelectionMode(MythListBox::SelectionMode mode);468 void setCurrentItem(int i) { if (widget) widget->setCurrentItem(i); }469 void setCurrentItem(const QString& str) { if (widget) widget->setCurrentItem(str); }470 452 471 453 virtual void setEnabled(bool b); 472 454 … … 477 459 void deleteButtonPressed(int); 478 460 479 461 protected slots: 480 void setValueByIndex(int index); 481 void addSelection(const QString& label, 482 QString value=QString::null, 483 bool select=false) { 484 SelectSetting::addSelection(label, value, select); 485 if (widget != NULL) 486 widget->insertItem(label); 487 }; 462 virtual void selectionAdded(const QString& label, const QString&, bool state); 463 virtual void selectionChanged(); 464 virtual void updateSelection(); 488 465 void widgetDestroyed() { widget=NULL; }; 466 489 467 protected: 490 MythListBox* widget;491 468 MythListBox::SelectionMode selectionMode; 469 MythListBox* widget; 492 470 }; 493 471 494 472 class MPUBLIC RadioSetting: public SelectSetting { … … 497 475 const char* widgetName = 0); 498 476 }; 499 477 500 class MPUBLIC ImageSelectSetting: public SelectSetting {478 class MPUBLIC ImageSelectSetting: public ComboBoxSetting { 501 479 Q_OBJECT 480 481 protected: 482 ImageSelectSetting(); 483 502 484 public: 503 virtual ~ImageSelectSetting();504 485 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 505 486 const char* widgetName = 0); 506 487 507 virtual void addImageSelection(const QString& label, 508 QImage* image, 509 QString value=QString::null, 510 bool select=false); 488 virtual void addSelection(const QString& label, 489 QImage* image, 490 QString value = QString::null, 491 bool select = false); 492 private: 493 virtual void addSelection(const QString&, QString, bool) {} 494 511 495 protected slots: 496 virtual void selectionChanged(); 512 497 void imageSet(int); 513 498 514 499 protected: 515 vector<QImage*> images;516 QLabel *imagelabel;500 QPtrList<QImage> images; 501 QLabel* imagelabel; 517 502 float m_hmult, m_wmult; 518 503 }; 519 504 … … 918 903 HostSetting(name) { } 919 904 }; 920 905 906 class MPUBLIC HostListBox: public ListBoxSetting, public HostSetting { 907 public: 908 HostListBox(const QString &name, MythListBox::SelectionMode mode = MythListBox::Single) : 909 ListBoxSetting(mode), 910 HostSetting(name) { } 911 }; 912 921 913 class MPUBLIC HostImageSelect: public ImageSelectSetting, public HostSetting { 922 914 public: 923 915 HostImageSelect(const QString &name) : -
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
539 539 "shows to delete first. LiveTV recordings " 540 540 "will always expire before normal " 541 541 "recordings.")); 542 bc->set Value(1);542 bc->setCurrent(1); 543 543 return bc; 544 544 } 545 545 … … 698 698 for (int i = 0; i < 4; i++) 699 699 gc->addSelection(str[i], QString::number(i)); 700 700 701 gc->set Value(1);701 gc->setCurrent(1); 702 702 gc->setHelpText(help); 703 703 704 704 return gc; … … 1444 1444 gc->addSelection(QString::number(i), QString::number(i)); 1445 1445 gc->addSelection(QObject::tr("All"), QString::number(-1)); 1446 1446 gc->setLabel(QObject::tr("Xinerama screen")); 1447 gc->set Value(0);1447 gc->setCurrent(0); 1448 1448 gc->setHelpText(QObject::tr("Run on the specified screen or " 1449 1449 "spanning all screens.")); 1450 1450 return gc; … … 1623 1623 DisplayResScreen dscr(w, h, -1, -1, -1.0, 0); 1624 1624 short rate = -1; 1625 1625 int i = DisplayResScreen::FindBestMatch(scr, dscr, rate); 1626 gc->set Value((i >= 0) ? i : scr.size()-1);1626 gc->setCurrent((i >= 0) ? i : scr.size()-1); 1627 1627 } 1628 1628 1629 1629 return gc; … … 1923 1923 continue; 1924 1924 } 1925 1925 1926 add ImageSelection(theme->fileName(), previewImage);1926 addSelection(theme->fileName(), previewImage); 1927 1927 } 1928 1928 1929 set Value("G.A.N.T.");1929 setCurrent(0); 1930 1930 } 1931 1931 1932 1932 class StyleSetting: public HostComboBox { … … 1967 1967 gc->addSelection(QObject::tr("callsign"), "<sign>"); 1968 1968 gc->addSelection(QObject::tr("name"), "<name>"); 1969 1969 gc->setHelpText(QObject::tr("Your preferred channel format.")); 1970 gc->set Value(1);1970 gc->setCurrent(1); 1971 1971 return gc; 1972 1972 } 1973 1973 … … 1981 1981 gc->addSelection(QObject::tr("callsign"), "<sign>"); 1982 1982 gc->addSelection(QObject::tr("name"), "<name>"); 1983 1983 gc->setHelpText(QObject::tr("Your preferred long channel format.")); 1984 gc->set Value(2);1984 gc->setCurrent(2); 1985 1985 return gc; 1986 1986 } 1987 1987 -
programs/mythfrontend/main.cpp
505 505 themename = themelist[rand() % themelist.size()]; 506 506 507 507 ThemeSelector Theme; 508 Theme.set Value(themename);508 Theme.setCurrentValue(themename); 509 509 Theme.save(); 510 510 511 511 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 "