X-Git-Url: https://git.sur5r.net/?p=minitube;a=blobdiff_plain;f=src%2Fstandardfeedsview.cpp;h=4bfeee628e6a58aebdb6191c32171fbe49238867;hp=1aae3e370edf0ce5651c04b1c489f6cbe85f19f5;hb=7cdd5bd476021ec84d54c4ec5be02280e1e9e548;hpb=a8e005af0aa72f809f823bbd741bb3d0def00ced diff --git a/src/standardfeedsview.cpp b/src/standardfeedsview.cpp index 1aae3e3..4bfeee6 100644 --- a/src/standardfeedsview.cpp +++ b/src/standardfeedsview.cpp @@ -1,16 +1,35 @@ +/* $BEGIN_LICENSE + +This file is part of Minitube. +Copyright 2009, Flavio Tordini + +Minitube is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Minitube is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Minitube. If not, see . + +$END_LICENSE */ + #include "standardfeedsview.h" #include "videosourcewidget.h" #include "ytcategories.h" #include "ytstandardfeed.h" #include "ytregions.h" #include "mainwindow.h" +#include "painterutils.h" namespace The { QHash* globalActions(); } -static const int cols = 5; - StandardFeedsView::StandardFeedsView(QWidget *parent) : QWidget(parent), layout(0) { QPalette p = palette(); @@ -76,6 +95,7 @@ void StandardFeedsView::addVideoSourceWidget(VideoSource *videoSource) { connect(w, SIGNAL(activated(VideoSource*)), SIGNAL(activated(VideoSource*))); int i = layout->count(); + static const int cols = 5; layout->addWidget(w, i / cols, i % cols); } @@ -83,18 +103,21 @@ QList StandardFeedsView::getMainFeeds() { QList feeds; feeds << buildStardardFeed("most_popular", tr("Most Popular")) - << buildStardardFeed("recently_featured", tr("Featured")) + // << buildStardardFeed("recently_featured", tr("Featured")) << buildStardardFeed("most_shared", tr("Most Shared")) << buildStardardFeed("most_discussed", tr("Most Discussed")) - << buildStardardFeed("top_rated", tr("Top Rated")); + << buildStardardFeed("top_rated", tr("Top Rated")) + << buildStardardFeed("most_popular", tr("All Time Popular"), "all_time"); return feeds; } -YTStandardFeed* StandardFeedsView::buildStardardFeed(QString feedId, QString label) { +YTStandardFeed* StandardFeedsView::buildStardardFeed( + QString feedId, QString label, QString time) { YTStandardFeed *feed = new YTStandardFeed(this); feed->setFeedId(feedId); feed->setLabel(label); + if (!time.isEmpty()) feed->setTime(time); feed->setRegionId(YTRegions::currentRegionId()); return feed; } @@ -121,4 +144,8 @@ void StandardFeedsView::selectLocalRegion() { load(); } +void StandardFeedsView::paintEvent(QPaintEvent *event) { + QWidget::paintEvent(event); + PainterUtils::topShadow(this); +}