Skip to content

Commit

Permalink
Categories, region selection, refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio committed Jan 7, 2013
1 parent 333f655 commit 8a672c2
Show file tree
Hide file tree
Showing 309 changed files with 2,398 additions and 595 deletions.
12 changes: 11 additions & 1 deletion CHANGES
@@ -1,6 +1,16 @@
2.0
2.0 - January ?? 2013
- YouTube categories and "standard feeds": "Most Popular", "Featured", etc
- Country selection for YouTube categories and feeds
- Autoupdate on Mac and Windows
- Related videos are now appended to the video when pasting a YouTube link
- "Show 10 More" with a single click
- Play video in the playlist with a single click on its thumbnail
- OS X Mountain Lion notifications on video start
- Fixed some YouTube links not working when pasted in the searchbox
- Fixed playlist drag'n'drop
- Fixed system language settings detection
- Fixed clicking on channel names not working in some cases
- Fixed incorrect number of downloads in status bar

1.9 - September 27, 2012
- Adapted to YouTube changes
Expand Down
Binary file added flags/aa.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ad.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ae.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/af.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ai.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/al.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/am.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ao.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/aq.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/as.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/at.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/au.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/aw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ax.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/az.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/ba.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/be.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bf.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bi.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flags/bj.png
Binary file added flags/bl.png
Binary file added flags/bm.png
Binary file added flags/bn.png
Binary file added flags/bo.png
Binary file added flags/bq.png
Binary file added flags/br.png
Binary file added flags/bs.png
Binary file added flags/bt.png
Binary file added flags/bv.png
Binary file added flags/bw.png
Binary file added flags/by.png
Binary file added flags/bz.png
Binary file added flags/ca.png
Binary file added flags/cc.png
Binary file added flags/cd.png
Binary file added flags/cf.png
Binary file added flags/cg.png
Binary file added flags/ch.png
Binary file added flags/ci.png
Binary file added flags/ck.png
Binary file added flags/cl.png
Binary file added flags/cm.png
Binary file added flags/cn.png
Binary file added flags/co.png
Binary file added flags/cr.png
Binary file added flags/cu.png
Binary file added flags/cv.png
Binary file added flags/cw.png
Binary file added flags/cx.png
Binary file added flags/cy.png
Binary file added flags/cz.png
Binary file added flags/de.png
Binary file added flags/dj.png
Binary file added flags/dk.png
Binary file added flags/dm.png
Binary file added flags/do.png
Binary file added flags/dz.png
Binary file added flags/ec.png
Binary file added flags/ee.png
Binary file added flags/eg.png
Binary file added flags/eh.png
Binary file added flags/eo.png
Binary file added flags/er.png
Binary file added flags/es.png
Binary file added flags/et.png
Binary file added flags/fi.png
Binary file added flags/fj.png
Binary file added flags/fk.png
Binary file added flags/fm.png
Binary file added flags/fo.png
Binary file added flags/fr.png
Binary file added flags/ga.png
Binary file added flags/gb.png
Binary file added flags/gd.png
Binary file added flags/ge.png
Binary file added flags/gf.png
Binary file added flags/gg.png
Binary file added flags/gh.png
Binary file added flags/gi.png
Binary file added flags/gl.png
Binary file added flags/gm.png
Binary file added flags/gn.png
Binary file added flags/gp.png
Binary file added flags/gq.png
Binary file added flags/gr.png
Binary file added flags/gs.png
Binary file added flags/gt.png
Binary file added flags/gu.png
Binary file added flags/gw.png
Binary file added flags/gy.png
Binary file added flags/hk.png
Binary file added flags/hm.png
Binary file added flags/hn.png
Binary file added flags/hr.png
Binary file added flags/ht.png
Binary file added flags/hu.png
Binary file added flags/id.png
Binary file added flags/ie.png
Binary file added flags/il.png
Binary file added flags/im.png
Binary file added flags/in.png
Binary file added flags/io.png
Binary file added flags/iq.png
Binary file added flags/ir.png
Binary file added flags/is.png
Binary file added flags/it.png
Binary file added flags/je.png
Binary file added flags/jm.png
Binary file added flags/jo.png
Binary file added flags/jp.png
Binary file added flags/ke.png
Binary file added flags/kg.png
Binary file added flags/kh.png
Binary file added flags/ki.png
Binary file added flags/km.png
Binary file added flags/kn.png
Binary file added flags/kp.png
Binary file added flags/kr.png
Binary file added flags/kw.png
Binary file added flags/ky.png
Binary file added flags/kz.png
Binary file added flags/la.png
Binary file added flags/lb.png
Binary file added flags/lc.png
Binary file added flags/li.png
Binary file added flags/lk.png
Binary file added flags/lr.png
Binary file added flags/ls.png
Binary file added flags/lt.png
Binary file added flags/lu.png
Binary file added flags/lv.png
Binary file added flags/ly.png
Binary file added flags/ma.png
Binary file added flags/mc.png
Binary file added flags/md.png
Binary file added flags/me.png
Binary file added flags/mf.png
Binary file added flags/mg.png
Binary file added flags/mh.png
Binary file added flags/mk.png
Binary file added flags/ml.png
Binary file added flags/mm.png
Binary file added flags/mn.png
Binary file added flags/mo.png
Binary file added flags/mp.png
Binary file added flags/mq.png
Binary file added flags/mr.png
Binary file added flags/ms.png
Binary file added flags/mt.png
Binary file added flags/mu.png
Binary file added flags/mv.png
Binary file added flags/mw.png
Binary file added flags/mx.png
Binary file added flags/my.png
Binary file added flags/mz.png
Binary file added flags/na.png
Binary file added flags/nc.png
Binary file added flags/ne.png
Binary file added flags/nf.png
Binary file added flags/ng.png
Binary file added flags/ni.png
Binary file added flags/nl.png
Binary file added flags/no.png
Binary file added flags/np.png
Binary file added flags/nr.png
Binary file added flags/nu.png
Binary file added flags/nz.png
Binary file added flags/om.png
Binary file added flags/pa.png
Binary file added flags/pe.png
Binary file added flags/pf.png
Binary file added flags/pg.png
Binary file added flags/ph.png
Binary file added flags/pk.png
Binary file added flags/pl.png
Binary file added flags/pm.png
Binary file added flags/pn.png
Binary file added flags/pr.png
Binary file added flags/ps.png
Binary file added flags/pt.png
Binary file added flags/pw.png
Binary file added flags/py.png
Binary file added flags/qa.png
Binary file added flags/re.png
Binary file added flags/ro.png
Binary file added flags/rs.png
Binary file added flags/ru.png
Binary file added flags/rw.png
Binary file added flags/sa.png
Binary file added flags/sb.png
Binary file added flags/sc.png
Binary file added flags/sd.png
Binary file added flags/se.png
Binary file added flags/sg.png
Binary file added flags/sh.png
Binary file added flags/si.png
Binary file added flags/sj.png
Binary file added flags/sk.png
Binary file added flags/sl.png
Binary file added flags/sm.png
Binary file added flags/sn.png
Binary file added flags/so.png
Binary file added flags/sr.png
Binary file added flags/ss.png
Binary file added flags/st.png
Binary file added flags/sv.png
Binary file added flags/sx.png
Binary file added flags/sy.png
Binary file added flags/sz.png
Binary file added flags/tc.png
Binary file added flags/td.png
Binary file added flags/tf.png
Binary file added flags/tg.png
Binary file added flags/th.png
Binary file added flags/tj.png
Binary file added flags/tk.png
Binary file added flags/tl.png
Binary file added flags/tm.png
Binary file added flags/tn.png
Binary file added flags/to.png
Binary file added flags/tr.png
Binary file added flags/tt.png
Binary file added flags/tv.png
Binary file added flags/tw.png
Binary file added flags/tz.png
Binary file added flags/ua.png
Binary file added flags/ug.png
Binary file added flags/um.png
Binary file added flags/us.png
Binary file added flags/uy.png
Binary file added flags/uz.png
Binary file added flags/va.png
Binary file added flags/vc.png
Binary file added flags/ve.png
Binary file added flags/vg.png
Binary file added flags/vi.png
Binary file added flags/vn.png
Binary file added flags/vu.png
Binary file added flags/wf.png
Binary file added flags/ws.png
Binary file added flags/ye.png
Binary file added flags/yt.png
Binary file added flags/za.png
Binary file added flags/zm.png
Binary file added flags/zw.png
49 changes: 28 additions & 21 deletions minitube.pro
@@ -1,4 +1,4 @@
CONFIG += release
CONFIG += debug
TEMPLATE = app
VERSION = 2.0
DEFINES += APP_VERSION="$$VERSION"
Expand All @@ -13,15 +13,11 @@ DEFINES += QT_USE_FAST_CONCATENATION
DEFINES += QT_USE_FAST_OPERATOR_PLUS
DEFINES += QT_STRICT_ITERATORS

# TODO Saner string behaviour
# DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
TARGET = minitube
QT += network xml phonon declarative
QT += network xml phonon
include(src/qtsingleapplication/qtsingleapplication.pri)
HEADERS += \
src/youtubesearch.h \
src/video.h \
src/youtubestreamreader.h \
src/searchlineedit.h \
src/urllineedit.h \
src/spacer.h \
Expand All @@ -32,7 +28,6 @@ HEADERS += \
src/videomimedata.h \
src/global.h \
src/updatechecker.h \
src/playlistwidget.h \
src/searchparams.h \
src/minisplitter.h \
src/loadingwidget.h \
Expand All @@ -48,7 +43,6 @@ HEADERS += \
src/downloadmodel.h \
src/downloadlistview.h \
src/downloadsettings.h \
src/youtubesuggest.h \
src/suggester.h \
src/channelsuggest.h \
src/temporary.h \
Expand All @@ -59,17 +53,25 @@ HEADERS += \
src/sidebarwidget.h \
src/homeview.h \
src/aboutview.h \
src/listmodel.h \
src/mainwindow.h \
src/mediaview.h \
src/searchview.h \
src/view.h \
src/categoriesview.h \
src/userview.h \
src/youtubecategories.h
src/playlistmodel.h \
src/videosource.h \
src/ytsearch.h \
src/ytstandardfeed.h \
src/standardfeedsview.h \
src/ytregions.h \
src/ytcategories.h \
src/ytfeedreader.h \
src/ytsuggester.h \
src/videosourcewidget.h \
src/regionsview.h \
src/ytsinglevideosource.h \
src/sidebarheader.h
SOURCES += src/main.cpp \
src/youtubesearch.cpp \
src/youtubestreamreader.cpp \
src/searchlineedit.cpp \
src/urllineedit.cpp \
src/spacer.cpp \
Expand All @@ -78,7 +80,6 @@ SOURCES += src/main.cpp \
src/videomimedata.cpp \
src/updatechecker.cpp \
src/networkaccess.cpp \
src/playlistwidget.cpp \
src/searchparams.cpp \
src/minisplitter.cpp \
src/loadingwidget.cpp \
Expand All @@ -95,7 +96,6 @@ SOURCES += src/main.cpp \
src/downloadmodel.cpp \
src/downloadlistview.cpp \
src/downloadsettings.cpp \
src/youtubesuggest.cpp \
src/channelsuggest.cpp \
src/temporary.cpp \
src/segmentedcontrol.cpp \
Expand All @@ -106,13 +106,23 @@ SOURCES += src/main.cpp \
src/homeview.cpp \
src/mainwindow.cpp \
src/mediaview.cpp \
src/listmodel.cpp \
src/aboutview.cpp \
src/searchview.cpp \
src/categoriesview.cpp \
src/userview.cpp \
src/playlistitemdelegate.cpp \
src/youtubecategories.cpp
src/playlistmodel.cpp \
src/videosource.cpp \
src/ytsearch.cpp \
src/ytstandardfeed.cpp \
src/standardfeedsview.cpp \
src/ytregions.cpp \
src/ytcategories.cpp \
src/ytfeedreader.cpp \
src/ytsuggester.cpp \
src/videosourcewidget.cpp \
src/regionsview.cpp \
src/ytsinglevideosource.cpp \
src/sidebarheader.cpp
RESOURCES += resources.qrc
DESTDIR = build/target/
OBJECTS_DIR = build/obj/
Expand Down Expand Up @@ -174,6 +184,3 @@ unix:!mac {
icon512.files += data/512x512/minitube.png
}
mac|win32:include(local/local.pri)

OTHER_FILES += \
qml/categories.qml
49 changes: 48 additions & 1 deletion resources.qrc
Expand Up @@ -6,6 +6,53 @@
<file>images/search-sortBy.png</file>
<file>images/search-quality.png</file>
<file>images/search-duration.png</file>
<file>qml/categories.qml</file>
<file>flags/dz.png</file>
<file>flags/ar.png</file>
<file>flags/au.png</file>
<file>flags/be.png</file>
<file>flags/br.png</file>
<file>flags/ca.png</file>
<file>flags/cl.png</file>
<file>flags/co.png</file>
<file>flags/cz.png</file>
<file>flags/eg.png</file>
<file>flags/fr.png</file>
<file>flags/de.png</file>
<file>flags/gh.png</file>
<file>flags/gr.png</file>
<file>flags/hk.png</file>
<file>flags/hu.png</file>
<file>flags/in.png</file>
<file>flags/id.png</file>
<file>flags/ie.png</file>
<file>flags/il.png</file>
<file>flags/it.png</file>
<file>flags/jp.png</file>
<file>flags/jo.png</file>
<file>flags/ke.png</file>
<file>flags/my.png</file>
<file>flags/mx.png</file>
<file>flags/ma.png</file>
<file>flags/nl.png</file>
<file>flags/nz.png</file>
<file>flags/ng.png</file>
<file>flags/pe.png</file>
<file>flags/ph.png</file>
<file>flags/pl.png</file>
<file>flags/ru.png</file>
<file>flags/sa.png</file>
<file>flags/sg.png</file>
<file>flags/za.png</file>
<file>flags/kr.png</file>
<file>flags/es.png</file>
<file>flags/se.png</file>
<file>flags/tw.png</file>
<file>flags/tn.png</file>
<file>flags/tr.png</file>
<file>flags/ug.png</file>
<file>flags/ae.png</file>
<file>flags/gb.png</file>
<file>flags/ye.png</file>
<file>style.css</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion src/downloadmodel.cpp
Expand Up @@ -2,7 +2,7 @@
#include "downloadmanager.h"
#include "downloaditem.h"
#include "video.h"
#include "listmodel.h"
#include "playlistmodel.h"

DownloadModel::DownloadModel(DownloadManager *downloadManager, QObject *parent) :
QAbstractListModel(parent),
Expand Down
2 changes: 1 addition & 1 deletion src/downloadview.cpp
Expand Up @@ -4,7 +4,7 @@
#include "downloadlistview.h"
#include "downloaditem.h"
#include "downloadsettings.h"
#include "listmodel.h"
#include "playlistmodel.h"
#include "playlistitemdelegate.h"
#include "segmentedcontrol.h"

Expand Down
107 changes: 107 additions & 0 deletions src/homeview.cpp
@@ -0,0 +1,107 @@
#include "homeview.h"
#include "segmentedcontrol.h"
#include "searchview.h"
#include "standardfeedsview.h"
#include "userview.h"
#include "mainwindow.h"
#include "mediaview.h"
#include "ytstandardfeed.h"

HomeView::HomeView(QWidget *parent) : QWidget(parent) {
standardFeedsView = 0;
userView = 0;

QBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);

setupBar();
layout->addWidget(bar);

stackedWidget = new QStackedWidget();
layout->addWidget(stackedWidget);

searchView = new SearchView();
connect(searchView, SIGNAL(search(SearchParams*)),
MainWindow::instance(), SLOT(showMedia(SearchParams*)));
stackedWidget->addWidget(searchView);
}

void HomeView::setupBar() {
bar = new SegmentedControl(this);

QAction *action = new QAction(tr("Search"), this);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1));
action->setStatusTip(tr("Find videos and channels by keyword"));
connect(action, SIGNAL(triggered()), SLOT(showSearch()));
bar->addAction(action);
bar->setCheckedAction(action);

action = new QAction(tr("Categories"), this);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2));
action->setStatusTip(tr("Browse videos by category"));
connect(action, SIGNAL(triggered()), SLOT(showStandardFeeds()));
bar->addAction(action);

/*
action = new QAction(tr("User"), this);
action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3));
action->setStatusTip(tr("Your favorite videos, subscriptions and playlists"));
connect(action, SIGNAL(triggered()), SLOT(showUser()));
bar->addAction(action);
*/

foreach (QAction* action, bar->actions()) {
// action->setEnabled(false);
addAction(action);
action->setAutoRepeat(false);
if (!action->shortcut().isEmpty())
action->setStatusTip(
action->statusTip() + " (" +
action->shortcut().toString(QKeySequence::NativeText) + ")");
}
}

void HomeView::showWidget(QWidget *widget) {
QWidget* currentWidget = stackedWidget->currentWidget();
if (currentWidget == widget) return;
QMetaObject::invokeMethod(currentWidget, "disappear");
currentWidget->setEnabled(false);
stackedWidget->setCurrentWidget(widget);
widget->setEnabled(true);
QMetaObject::invokeMethod(widget, "appear");
bar->setCheckedAction(stackedWidget->currentIndex());
// autoChosenView = false;
widget->setFocus();
}

void HomeView::appear() {
QMetaObject::invokeMethod(stackedWidget->currentWidget(), "appear");
}

void HomeView::disappear() {
QMetaObject::invokeMethod(stackedWidget->currentWidget(), "disappear");
}

void HomeView::showSearch() {
showWidget(searchView);
}

void HomeView::showStandardFeeds() {
if (!standardFeedsView) {
standardFeedsView = new StandardFeedsView();
connect(standardFeedsView, SIGNAL(activated(VideoSource*)),
MainWindow::instance(),
SLOT(showMedia(VideoSource*)));
stackedWidget->addWidget(standardFeedsView);
}
showWidget(standardFeedsView);
}

void HomeView::showUser() {
if (!userView) {
userView = new UserView(this);
stackedWidget->addWidget(userView);
}
showWidget(userView);
}
40 changes: 40 additions & 0 deletions src/homeview.h
@@ -0,0 +1,40 @@
#ifndef HOMEVIEW_H
#define HOMEVIEW_H

#include <QtGui>
#include "view.h"

class SegmentedControl;
class SearchView;
class StandardFeedsView;
class UserView;

class HomeView : public QWidget, public View {

Q_OBJECT

public:
HomeView(QWidget *parent = 0);
void appear();
void disappear();
void showWidget(QWidget *widget);
SearchView* getSearchView() { return searchView; }
StandardFeedsView* getStandardFeedsView() { return standardFeedsView; }

public slots:
void showSearch();
void showStandardFeeds();
void showUser();

private:
void setupBar();
SegmentedControl *bar;
QStackedWidget *stackedWidget;

SearchView *searchView;
StandardFeedsView *standardFeedsView;
UserView* userView;

};

#endif // HOMEVIEW_H
15 changes: 9 additions & 6 deletions src/main.cpp
Expand Up @@ -36,13 +36,16 @@ int main(int argc, char **argv) {

#ifndef Q_WS_X11
Extra::appSetup(&app);
#else
QFile cssFile(":/style.css");
cssFile.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(cssFile.readAll());
app.setStyleSheet(styleSheet);
#endif

const QString locale = QLocale::system().name();

// qt translations
QTranslator qtTranslator;
qtTranslator.load("qt_" + locale,
qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);

Expand All @@ -52,13 +55,13 @@ int main(int argc, char **argv) {
#else
QString dataDir = "";
#endif
QString localeDir = qApp->applicationDirPath() + QDir::separator() + "locale";
QString localeDir = qApp->applicationDirPath() + "/locale";
if (!QDir(localeDir).exists()) {
localeDir = dataDir + QDir::separator() + "locale";
localeDir = dataDir + "/locale";
}
// qDebug() << "Using locale dir" << localeDir << locale;
QTranslator translator;
translator.load(locale, localeDir);
translator.load(QLocale::system(), localeDir);
app.installTranslator(&translator);
QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));

Expand Down

0 comments on commit 8a672c2

Please sign in to comment.