Ticket #3334: importicons.patch
File importicons.patch, 6.6 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/channeleditor.cpp
19 19 #include "sourceutil.h" 20 20 21 21 #include "scanwizard.h" 22 #include "importicons.h" 22 23 23 24 ChannelWizard::ChannelWizard(int id, int default_sourceid) 24 25 : ConfigurationWizard() { … … 110 111 return 0; 111 112 } 112 113 113 voidChannelListSetting::fillSelections(void)114 int ChannelListSetting::fillSelections(void) 114 115 { 115 116 QString currentValue = getValue(); 116 117 clearSelections(); 117 118 addSelection(QObject::tr("(New Channel)")); 118 119 bool fAllSources = true; 120 int nCount = 0; 119 121 120 122 QString querystr = "SELECT channel.name,channum,chanid "; 121 123 … … 184 186 name += " (" + sourceid + ")"; 185 187 186 188 addSelection(name, chanid, (chanid == currentValue) ? true : false); 189 nCount++; 187 190 } 188 191 } 192 return nCount; 189 193 } 190 194 191 195 class SourceSetting : public ComboBoxSetting, public Storage … … 268 272 buttonScan->setHelpText(QObject::tr("Starts the channel scanner.")); 269 273 buttonScan->setEnabled(SourceUtil::IsAnySourceScanable()); 270 274 275 buttonImportIcon = new TransButtonSetting(); 276 buttonImportIcon->setLabel(QObject::tr("Icon Import")); 277 buttonImportIcon->setHelpText(QObject::tr("Starts the icon importer")); 278 271 279 buttonTransportEditor = new TransButtonSetting(); 272 280 buttonTransportEditor->setLabel(QObject::tr("Transport Editor")); 273 281 buttonTransportEditor->setHelpText( … … 279 287 HorizontalConfigurationGroup *h = 280 288 new HorizontalConfigurationGroup(false, false); 281 289 h->addChild(buttonScan); 290 h->addChild(buttonImportIcon); 282 291 h->addChild(buttonTransportEditor); 283 292 addChild(h); 284 293 … … 294 303 this, SLOT(menu(int))); 295 304 connect(buttonScan, SIGNAL(pressed()), 296 305 this, SLOT(scan())); 306 connect(buttonImportIcon, SIGNAL(pressed()), 307 this, SLOT(channelIconImport())); 297 308 connect(buttonTransportEditor, SIGNAL(pressed()), 298 309 this, SLOT(transportEditor())); 299 310 connect(del, SIGNAL(pressed()), … … 355 366 if (!query.exec()) 356 367 MythContext::DBError("ChannelEditor Delete Channels", query); 357 368 358 list->fillSelections();369 buttonImportIcon->setEnabled(list->fillSelections()==0 ? false:true); 359 370 } 360 371 361 372 MythDialog* ChannelEditor::dialogWidget(MythMainWindow* parent, … … 379 390 ChannelWizard cw(id, source->getValue().toUInt()); 380 391 cw.exec(); 381 392 382 list->fillSelections();393 buttonImportIcon->setEnabled(list->fillSelections()==0 ? false:true); 383 394 list->setFocus(); 384 395 } 385 396 … … 406 417 if (!query.exec() || !query.isActive()) 407 418 MythContext::DBError("ChannelEditor Delete Channel", query); 408 419 409 list->fillSelections();420 buttonImportIcon->setEnabled(list->fillSelections()==0 ? false:true); 410 421 } 411 422 } 412 423 … … 441 452 scanwizard->exec(false, true); 442 453 scanwizard->deleteLater(); 443 454 444 list->fillSelections();455 buttonImportIcon->setEnabled(list->fillSelections()==0 ? false:true); 445 456 list->setFocus(); 446 457 #else 447 458 VERBOSE(VB_IMPORTANT, "You must compile the backend " … … 457 468 editor->exec(); 458 469 editor->deleteLater(); 459 470 460 list->fillSelections();471 buttonImportIcon->setEnabled(list->fillSelections()==0 ? false:true); 461 472 list->setFocus(); 462 473 } 474 475 void ChannelEditor::channelIconImport(void) 476 { 477 int val = MythPopupBox::show2ButtonPopup(gContext->GetMainWindow(), 478 "", 479 tr("Channel Icon Import"), 480 tr("Import all icons.."), 481 tr("Rescan for missing icons.."), 482 0); 483 484 if (val == 0) 485 emit iconImportFull(); 486 else if (val == 1) 487 emit iconImportRescan(); 488 else 489 list->setFocus(); 490 } 491 492 void ChannelEditor::iconImportFull(void) 493 { 494 ImportIconsWizard box(false); 495 if (!box.initialise()) 496 return; 497 box.exec(); 498 } 499 500 void ChannelEditor::iconImportRescan(void) 501 { 502 ImportIconsWizard box(true); 503 if (!box.initialise()) 504 return; 505 box.exec(); 506 } -
libs/libmythtv/libmythtv.pro
148 148 HEADERS += playgroup.h progdetails.h 149 149 HEADERS += channeleditor.h channelsettings.h 150 150 HEADERS += previewgenerator.h transporteditor.h 151 HEADERS += importicons.h 151 152 152 153 SOURCES += programinfo.cpp proglist.cpp 153 154 SOURCES += storagegroup.cpp … … 170 171 SOURCES += progdetails.cpp 171 172 SOURCES += channeleditor.cpp channelsettings.cpp 172 173 SOURCES += previewgenerator.cpp transporteditor.cpp 174 SOURCES += importicons.cpp 173 175 174 176 # DiSEqC 175 177 HEADERS += diseqc.h diseqcsettings.h -
libs/libmythtv/channeleditor.h
22 22 void edit(); 23 23 void edit(int); 24 24 void scan(void); 25 void transportEditor(); 26 void deleteChannels(); 25 void transportEditor(void); 26 void channelIconImport(void); 27 void deleteChannels(void); 28 void iconImportFull(void); 29 void iconImportRescan(void); 27 30 28 31 private: 29 32 int id; 30 33 SourceSetting *source; 31 34 ChannelListSetting *list; 32 35 TransButtonSetting *buttonScan; 36 TransButtonSetting *buttonImportIcon; 33 37 TransButtonSetting *buttonTransportEditor; 34 38 }; 35 39 … … 68 72 bool getHideMode() { return currentHideMode; }; 69 73 70 74 public slots: 71 voidfillSelections(void);75 int fillSelections(void); 72 76 void setSortMode(const QString& sort) { 73 77 if (currentSortMode != sort) { 74 78 currentSortMode = sort; -
libs/libmyth/settings.h
658 658 special_value_text), TransientStorage() { } 659 659 }; 660 660 661 class MPUBLIC TransListBoxSetting : 662 public ListBoxSetting, public TransientStorage 663 { 664 public: 665 TransListBoxSetting() : ListBoxSetting(this), TransientStorage() { } 666 }; 667 661 668 /////////////////////////////////////////////////////////////////////////////// 662 669 663 670 class MPUBLIC HostSlider : public SliderSetting, public HostDBStorage