"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dvb/dvbepgdialog.cpp" between
kaffeine-2.0.16.tar.gz and kaffeine-2.0.17.tar.gz

About: Kaffeine is a full featured Multimedia-Player for KDE (default backend is xine).

dvbepgdialog.cpp  (kaffeine-2.0.16):dvbepgdialog.cpp  (kaffeine-2.0.17)
skipping to change at line 26 skipping to change at line 26
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "../log.h" #include "../log.h"
#include <KConfigGroup> #include <KConfigGroup>
#include <QAction> #include <QAction>
#include <QBoxLayout> #include <QBoxLayout>
#include <QCheckBox>
#include <QComboBox> #include <QComboBox>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QHeaderView> #include <QHeaderView>
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QLocale> #include <QLocale>
#include <QPushButton> #include <QPushButton>
#include <QScrollArea> #include <QScrollArea>
#include <QVBoxLayout> #include <QVBoxLayout>
skipping to change at line 110 skipping to change at line 111
QString languageString; QString languageString;
if (IsoCodes::getLanguage(currentLanguage, &languageString)) if (IsoCodes::getLanguage(currentLanguage, &languageString))
languageLabel->setText(languageString); languageLabel->setText(languageString);
else if (currentLanguage.isEmpty()) else if (currentLanguage.isEmpty())
languageLabel->setText(i18n("Any language")); languageLabel->setText(i18n("Any language"));
else else
languageLabel->setText(""); languageLabel->setText("");
rightLayout->addLayout(langLayout); rightLayout->addLayout(langLayout);
QHBoxLayout *showLayout = new QHBoxLayout();
showLayout->addWidget(new QLabel(i18n("Show channels with empty EPG data"
)));
showBox = new QCheckBox(widget);
showLayout->addWidget(showBox, Qt::AlignLeft);
rightLayout->addLayout(showLayout);
connect(showBox, SIGNAL(clicked()), this, SLOT(changeShowMode()));
QAction *scheduleAction = new QAction(QIcon::fromTheme(QLatin1String("med ia-record"), QIcon(":media-record")), QAction *scheduleAction = new QAction(QIcon::fromTheme(QLatin1String("med ia-record"), QIcon(":media-record")),
i18nc("@action:inmenu tv show", "Record Show"), this); i18nc("@action:inmenu tv show", "Record Show"), this);
connect(scheduleAction, SIGNAL(triggered()), this, SLOT(scheduleProgram() )); connect(scheduleAction, SIGNAL(triggered()), this, SLOT(scheduleProgram() ));
QPushButton *pushButton = QPushButton *pushButton =
new QPushButton(scheduleAction->icon(), scheduleAction->text(), w idget); new QPushButton(scheduleAction->icon(), scheduleAction->text(), w idget);
connect(pushButton, SIGNAL(clicked()), this, SLOT(scheduleProgram())); connect(pushButton, SIGNAL(clicked()), this, SLOT(scheduleProgram()));
boxLayout->addWidget(pushButton); boxLayout->addWidget(pushButton);
boxLayout->addWidget(new QLabel(i18nc("@label:textbox", "Search:"), widge t)); boxLayout->addWidget(new QLabel(i18nc("@label:textbox", "Search:"), widge t));
skipping to change at line 259 skipping to change at line 267
void DvbEpgDialog::scheduleProgram() void DvbEpgDialog::scheduleProgram()
{ {
const DvbSharedEpgEntry &entry = epgTableModel->value(epgView->currentInd ex()); const DvbSharedEpgEntry &entry = epgTableModel->value(epgView->currentInd ex());
if (entry.isValid()) { if (entry.isValid()) {
manager->getEpgModel()->scheduleProgram(entry, manager->getBeginM argin(), manager->getEpgModel()->scheduleProgram(entry, manager->getBeginM argin(),
manager->getEndMargin()); manager->getEndMargin());
} }
} }
void DvbEpgDialog::changeShowMode()
{
epgChannelTableModel->setViewMode(showBox->isChecked());
}
bool DvbEpgEntryLessThan::operator()(const DvbSharedEpgEntry &x, const DvbShared EpgEntry &y) const bool DvbEpgEntryLessThan::operator()(const DvbSharedEpgEntry &x, const DvbShared EpgEntry &y) const
{ {
if (x->channel != y->channel) { if (x->channel != y->channel) {
return (x->channel->name.localeAwareCompare(y->channel->name) < 0 ); return (x->channel->name.localeAwareCompare(y->channel->name) < 0 );
} }
if (x->begin != y->begin) { if (x->begin != y->begin) {
return (x->begin < y->begin); return (x->begin < y->begin);
} }
skipping to change at line 297 skipping to change at line 310
DvbEpgChannelTableModel::DvbEpgChannelTableModel(QObject *parent) : DvbEpgChannelTableModel::DvbEpgChannelTableModel(QObject *parent) :
TableModel<DvbEpgChannelTableModelHelper>(parent) TableModel<DvbEpgChannelTableModelHelper>(parent)
{ {
} }
DvbEpgChannelTableModel::~DvbEpgChannelTableModel() DvbEpgChannelTableModel::~DvbEpgChannelTableModel()
{ {
} }
void DvbEpgChannelTableModel::setManager(DvbManager *manager) void DvbEpgChannelTableModel::setViewMode(bool enableEmptyEpgChannels)
{
if (enableEmptyEpgChannels) {
DvbChannelModel *channelModel = manager->getChannelModel();
reset(channelModel->getChannels());
} else {
DvbEpgModel *epgModel = manager->getEpgModel();
resetFromKeys(epgModel->getEpgChannels());
}
}
void DvbEpgChannelTableModel::setManager(DvbManager *_manager)
{ {
manager = _manager;
DvbEpgModel *epgModel = manager->getEpgModel(); DvbEpgModel *epgModel = manager->getEpgModel();
connect(epgModel, SIGNAL(epgChannelAdded(DvbSharedChannel)), connect(epgModel, SIGNAL(epgChannelAdded(DvbSharedChannel)),
this, SLOT(epgChannelAdded(DvbSharedChannel))); this, SLOT(epgChannelAdded(DvbSharedChannel)));
connect(epgModel, SIGNAL(epgChannelRemoved(DvbSharedChannel)), connect(epgModel, SIGNAL(epgChannelRemoved(DvbSharedChannel)),
this, SLOT(epgChannelRemoved(DvbSharedChannel))); this, SLOT(epgChannelRemoved(DvbSharedChannel)));
// theoretically we should monitor the channel model for updated channels , // theoretically we should monitor the channel model for updated channels ,
// but it's very unlikely that this has practical relevance // but it's very unlikely that this has practical relevance
QHeaderView *headerView = manager->getChannelView()->header(); QHeaderView *headerView = manager->getChannelView()->header();
DvbChannelLessThan::SortOrder sortOrder; DvbChannelLessThan::SortOrder sortOrder;
skipping to change at line 325 skipping to change at line 350
} }
} else { } else {
if (headerView->sortIndicatorSection() == 0) { if (headerView->sortIndicatorSection() == 0) {
sortOrder = DvbChannelLessThan::ChannelNameDescending; sortOrder = DvbChannelLessThan::ChannelNameDescending;
} else { } else {
sortOrder = DvbChannelLessThan::ChannelNumberDescending; sortOrder = DvbChannelLessThan::ChannelNumberDescending;
} }
} }
internalSort(sortOrder); internalSort(sortOrder);
resetFromKeys(epgModel->getEpgChannels());
setViewMode(false);
} }
QVariant DvbEpgChannelTableModel::data(const QModelIndex &index, int role) const QVariant DvbEpgChannelTableModel::data(const QModelIndex &index, int role) const
{ {
const DvbSharedChannel &channel = value(index); const DvbSharedChannel &channel = value(index);
if (channel.isValid() && (role == Qt::DisplayRole) && (index.column() == 0)) { if (channel.isValid() && (role == Qt::DisplayRole) && (index.column() == 0)) {
return channel->name; return channel->name;
} }
 End of changes. 6 change blocks. 
2 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)