Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (11)
Showing
with 227 additions and 170 deletions
......@@ -36,8 +36,8 @@ ModalDialog {
function ask(text, acceptCb, rejectCb, buttons) {
//TODO: use a Promise here when dropping support of Qt 5.11
var okTxt = i18n.qtr("OK")
var cancelTxt = i18n.qtr("cancel")
var okTxt = I18n.qtr("OK")
var cancelTxt = I18n.qtr("cancel")
if (buttons) {
if (buttons.cancel) {
cancelTxt = buttons.cancel
......
......@@ -37,7 +37,7 @@ Item {
//---------------------------------------------------------------------------------------------
// Private
property var _model: dialogModel.model
property var _model: DialogModel.model
//---------------------------------------------------------------------------------------------
// Signal
......@@ -53,10 +53,10 @@ Item {
Component.onDestruction: {
if (questionDialog.dialogId !== undefined) {
dialogModel.dismiss(questionDialog.dialogId)
DialogModel.dismiss(questionDialog.dialogId)
questionDialog.dialogId = undefined
} if (loginDialog.dialogId !== undefined) {
dialogModel.dismiss(loginDialog.dialogId)
DialogModel.dismiss(loginDialog.dialogId)
loginDialog.dialogId = undefined
}
}
......@@ -75,7 +75,7 @@ Item {
Connections
{
target: dialogModel
target: DialogModel
onLogin: {
loginDialog.dialogId = dialogId
......@@ -106,13 +106,13 @@ Item {
if (questionDialog.dialogId === dialogId) {
questionDialog.close()
questionDialog.dialogId = undefined
dialogModel.dismiss(dialogId)
DialogModel.dismiss(dialogId)
} else if (loginDialog.dialogId === dialogId) {
loginDialog.close()
loginDialog.dialogId = undefined
dialogModel.dismiss(dialogId)
DialogModel.dismiss(dialogId)
} else {
dialogModel.dismiss(dialogId)
DialogModel.dismiss(dialogId)
}
}
}
......@@ -199,7 +199,7 @@ Item {
columns: 2
Text {
text: i18n.qtr("User")
text: I18n.qtr("User")
color: VLCStyle.colors.text
font.pixelSize: VLCStyle.fontSize_normal
}
......@@ -219,7 +219,7 @@ Item {
}
Text {
text: i18n.qtr("Password")
text: I18n.qtr("Password")
color: VLCStyle.colors.text
font.pixelSize: VLCStyle.fontSize_normal
}
......@@ -238,7 +238,7 @@ Item {
}
Text {
text: i18n.qtr("Save password")
text: I18n.qtr("Save password")
color: VLCStyle.colors.text
font.pixelSize: VLCStyle.fontSize_normal
}
......@@ -268,7 +268,7 @@ Item {
Widgets.TextToolButton {
id: loginCancel
Layout.fillWidth: true
text: i18n.qtr("cancel")
text: I18n.qtr("cancel")
Navigation.upItem: savePassword
Navigation.rightItem: loginOk
......@@ -284,7 +284,7 @@ Item {
Widgets.TextToolButton {
id: loginOk
Layout.fillWidth: true
text: i18n.qtr("Ok")
text: I18n.qtr("Ok")
focus: true
Navigation.upItem: savePassword
......@@ -303,13 +303,13 @@ Item {
onAccepted: {
if (loginDialog.dialogId !== undefined) {
dialogModel.post_login(loginDialog.dialogId, username.text, password.text, savePassword.checked)
DialogModel.post_login(loginDialog.dialogId, username.text, password.text, savePassword.checked)
loginDialog.dialogId = undefined
}
}
onRejected: {
if (loginDialog.dialogId !== undefined) {
dialogModel.dismiss(loginDialog.dialogId)
DialogModel.dismiss(loginDialog.dialogId)
loginDialog.dialogId = undefined
}
}
......@@ -363,7 +363,7 @@ Item {
Keys.onPressed: Navigation.defaultKeyAction(event)
onClicked: {
dialogModel.dismiss(questionDialog.dialogId)
DialogModel.dismiss(questionDialog.dialogId)
questionDialog.dialogId = undefined
questionDialog.close()
}
......@@ -382,7 +382,7 @@ Item {
Keys.onPressed: Navigation.defaultKeyAction(event)
onClicked: {
dialogModel.post_action1(questionDialog.dialogId)
DialogModel.post_action1(questionDialog.dialogId)
questionDialog.dialogId = undefined
questionDialog.close()
}
......@@ -399,7 +399,7 @@ Item {
Keys.onPressed: Navigation.defaultKeyAction(event)
onClicked: {
dialogModel.post_action2(questionDialog.dialogId)
DialogModel.post_action2(questionDialog.dialogId)
questionDialog.dialogId = undefined
questionDialog.close()
}
......@@ -429,7 +429,7 @@ Item {
}
Connections {
target: dialogProvider
target: DialogsProvider
onShowToolbarEditorDialog: {
toolbarEditorDialogLoader.active = true
......
......@@ -35,7 +35,6 @@ Window {
width: VLCStyle.appWidth * 0.75
height: VLCStyle.appHeight * 0.85
title: i18n.qtr("Dialog")
color: VLCStyle.colors.bg
property alias contentComponent: loader.sourceComponent
......
......@@ -28,7 +28,7 @@ FocusScope {
property alias columnLayout: columnLayout
Navigation.onActionCancel: {
history.previous()
History.previous()
}
AboutModel {
......@@ -56,7 +56,7 @@ FocusScope {
Widgets.TextToolButton {
id: authorsBtn
text: i18n.qtr("Authors")
text: I18n.qtr("Authors")
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
onClicked: {
checked = true
......@@ -69,7 +69,7 @@ FocusScope {
Widgets.TextToolButton {
id: licenseBtn
text: i18n.qtr("License")
text: I18n.qtr("License")
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
onClicked: textArea.text = about.license
KeyNavigation.down: creditBtn
......@@ -78,7 +78,7 @@ FocusScope {
Widgets.TextToolButton {
id: creditBtn
text: i18n.qtr("Credit")
text: I18n.qtr("Credit")
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
KeyNavigation.down: backBtn
KeyNavigation.right: textScroll
......@@ -97,12 +97,12 @@ FocusScope {
id: backBtn
size: VLCStyle.icon_large
iconText: VLCIcons.exit
text: i18n.qtr("Back")
text: I18n.qtr("Back")
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
KeyNavigation.right: textScroll
onClicked: {
history.previous()
History.previous()
}
}
}
......@@ -124,7 +124,7 @@ FocusScope {
Text {
id: text1
text: i18n.qtr("VLC Media Player")
text: I18n.qtr("VLC Media Player")
color: VLCStyle.colors.text
font.pixelSize: VLCStyle.fontSize_xxxlarge
}
......
......@@ -73,19 +73,19 @@ Rectangle{
TextMetrics {
id: leftMetric
text: i18n.qtr("L E F T")
text: I18n.qtr("L E F T")
font.pixelSize: VLCStyle.fontSize_xxlarge
}
TextMetrics {
id: centerMetric
text: i18n.qtr("C E N T E R")
text: I18n.qtr("C E N T E R")
font.pixelSize: VLCStyle.fontSize_xxlarge
}
TextMetrics {
id: rightMetric
text: i18n.qtr("R I G H T")
text: I18n.qtr("R I G H T")
font.pixelSize: VLCStyle.fontSize_xxlarge
}
......@@ -245,7 +245,7 @@ Rectangle{
Widgets.MenuCaption {
Layout.margins: VLCStyle.margin_xxsmall
text: i18n.qtr("Drag items below to add them above: ")
text: I18n.qtr("Drag items below to add them above: ")
}
ToolbarEditorButtonList {
......
......@@ -34,7 +34,7 @@ WindowDialog {
minimumHeight: 400
modal: true
title: i18n.qtr("Toolbar Editor")
title: I18n.qtr("Toolbar Editor")
signal unload()
......@@ -72,7 +72,7 @@ WindowDialog {
Widgets.MenuLabel {
Layout.fillWidth: true
text: i18n.qtr("Select profile:")
text: I18n.qtr("Select profile:")
}
Widgets.ComboBoxExt {
......@@ -124,18 +124,18 @@ WindowDialog {
MainCtx.controlbarProfileModel.selectedProfile = currentIndex
}
Accessible.name: i18n.qtr("Profiles")
Accessible.name: I18n.qtr("Profiles")
}
Widgets.IconToolButton {
text: i18n.qtr("New Profile")
text: I18n.qtr("New Profile")
iconText: VLCIcons.profile_new
onClicked: {
var npDialog = dialogProvider.getTextDialog(null,
i18n.qtr("Profile Name"),
i18n.qtr("Please enter the new profile name:"),
i18n.qtr("Profile %1").arg(comboBox.count + 1))
var npDialog = DialogsProvider.getTextDialog(null,
I18n.qtr("Profile Name"),
I18n.qtr("Please enter the new profile name:"),
I18n.qtr("Profile %1").arg(comboBox.count + 1))
if (!npDialog.ok)
return
......@@ -149,7 +149,7 @@ WindowDialog {
Widgets.IconToolButton {
id: useDefaultButton
text: i18n.qtr("Use Default")
text: I18n.qtr("Use Default")
iconText: VLCIcons.history
onClicked: {
......@@ -160,7 +160,7 @@ WindowDialog {
}
Widgets.IconToolButton {
text: i18n.qtr("Delete the current profile")
text: I18n.qtr("Delete the current profile")
iconText: VLCIcons.del
onClicked: {
......
......@@ -62,6 +62,61 @@ using namespace vlc::playlist;
namespace {
template<class T>
class SingletonRegisterHelper
{
static QObject* m_instance;
static QQmlEngine::ObjectOwnership m_ownership;
static void connect()
{
QObject::connect(m_instance, &QObject::destroyed, []() {
m_instance = nullptr;
});
}
public:
static QObject* callback(QQmlEngine *engine, QJSEngine *)
{
assert(m_instance);
engine->setObjectOwnership(m_instance, m_ownership);
return m_instance;
}
template<typename... Args>
static auto getCallback(Args&&... args)
{
if (!m_instance)
{
m_ownership = QQmlEngine::ObjectOwnership::JavaScriptOwnership;
m_instance = new T(args...);
assert(!m_instance->parent());
connect();
}
else
assert(sizeof...(args) == 0);
return callback;
}
static void setInstance(T& instance)
{
assert(!m_instance);
m_ownership = QQmlEngine::ObjectOwnership::CppOwnership;
m_instance = &instance;
connect();
}
static auto getInstance()
{
return m_instance;
}
};
template<class T>
QQmlEngine::ObjectOwnership SingletonRegisterHelper<T>::m_ownership = QQmlEngine::ObjectOwnership::JavaScriptOwnership;
template<class T>
QObject* SingletonRegisterHelper<T>::m_instance = nullptr;
template<class T>
void registerAnonymousType( const char *uri, int versionMajor )
{
......@@ -74,7 +129,7 @@ void registerAnonymousType( const char *uri, int versionMajor )
#endif
}
MainCtx* g_mainCtx = nullptr;
class InterfaceWindow : public QWindow { };
} // anonymous namespace
......@@ -89,15 +144,28 @@ MainUI::MainUI(qt_intf_t *p_intf, MainCtx *mainCtx, QWindow* interfaceWindow, Q
assert(m_mainCtx);
assert(m_interfaceWindow);
assert(g_mainCtx == nullptr);
g_mainCtx = mainCtx;
SingletonRegisterHelper<MainCtx>::setInstance(*mainCtx);
assert(m_intf->p_mainPlayerController);
SingletonRegisterHelper<PlayerController>::setInstance(*m_intf->p_mainPlayerController);
SingletonRegisterHelper<InterfaceWindow>::setInstance(*static_cast<InterfaceWindow*>(m_interfaceWindow));
assert(DialogsProvider::getInstance());
SingletonRegisterHelper<DialogsProvider>::setInstance(*DialogsProvider::getInstance());
if (m_mainCtx->hasMediaLibrary())
{
assert(m_mainCtx->getMediaLibrary());
SingletonRegisterHelper<MediaLib>::setInstance(*m_mainCtx->getMediaLibrary());
}
registerQMLTypes();
}
MainUI::~MainUI()
{
g_mainCtx = nullptr;
}
bool MainUI::setup(QQmlEngine* engine)
......@@ -105,21 +173,6 @@ bool MainUI::setup(QQmlEngine* engine)
engine->setOutputWarningsToStandardError(false);
connect(engine, &QQmlEngine::warnings, this, &MainUI::onQmlWarning);
QQmlContext *rootCtx = engine->rootContext();
rootCtx->setContextProperty( "history", new NavigationHistory(this) );
rootCtx->setContextProperty( "player", m_intf->p_mainPlayerController );
rootCtx->setContextProperty( "i18n", new I18n(this) );
rootCtx->setContextProperty( "topWindow", m_interfaceWindow);
rootCtx->setContextProperty( "dialogProvider", DialogsProvider::getInstance());
rootCtx->setContextProperty( "systemPalette", new SystemPalette(this));
rootCtx->setContextProperty( "dialogModel", new DialogModel(m_intf, this));
if (m_mainCtx->hasMediaLibrary())
rootCtx->setContextProperty( "medialib", m_mainCtx->getMediaLibrary() );
else
rootCtx->setContextProperty( "medialib", nullptr );
m_component = new QQmlComponent(engine, QStringLiteral("qrc:/main/MainInterface.qml"), QQmlComponent::PreferSynchronous, engine);
if (m_component->isLoading())
{
......@@ -174,7 +227,15 @@ void MainUI::registerQMLTypes()
const int versionMajor = 0;
const int versionMinor = 1;
qmlRegisterSingletonType<MainCtx>(uri, versionMajor, versionMinor, "MainCtx", MainUI::getMainCtxInstance);
qmlRegisterSingletonType<MainCtx>(uri, versionMajor, versionMinor, "MainCtx", SingletonRegisterHelper<MainCtx>::callback);
qmlRegisterSingletonType<NavigationHistory>(uri, versionMajor, versionMinor, "History", SingletonRegisterHelper<NavigationHistory>::getCallback());
qmlRegisterSingletonType<PlayerController>(uri, versionMajor, versionMinor, "Player", SingletonRegisterHelper<PlayerController>::callback);
qmlRegisterSingletonType<I18n>(uri, versionMajor, versionMinor, "I18n", SingletonRegisterHelper<I18n>::getCallback());
qmlRegisterSingletonType<InterfaceWindow>(uri, versionMajor, versionMinor, "IntfWindow", SingletonRegisterHelper<InterfaceWindow>::callback);
qmlRegisterSingletonType<DialogsProvider>(uri, versionMajor, versionMinor, "DialogsProvider", SingletonRegisterHelper<DialogsProvider>::callback);
qmlRegisterSingletonType<SystemPalette>(uri, versionMajor, versionMinor, "SystemPalette", SingletonRegisterHelper<SystemPalette>::getCallback());
qmlRegisterSingletonType<DialogModel>(uri, versionMajor, versionMinor, "DialogModel", SingletonRegisterHelper<DialogModel>::getCallback(m_intf));
qmlRegisterSingletonType<QmlKeyHelper>(uri, versionMajor, versionMinor, "KeyHelper", SingletonRegisterHelper<QmlKeyHelper>::getCallback());
qRegisterMetaType<VLCTick>();
qmlRegisterUncreatableType<VLCTick>(uri, versionMajor, versionMinor, "VLCTick", "");
......@@ -192,14 +253,11 @@ void MainUI::registerQMLTypes()
qmlRegisterType<MLFoldersModel>( uri, versionMajor, versionMinor, "MLFolderModel");
qmlRegisterType<ImageLuminanceExtractor>( uri, versionMajor, versionMinor, "ImageLuminanceExtractor");
qmlRegisterUncreatableType<NavigationHistory>(uri, versionMajor, versionMinor, "History", "Type of global variable history" );
qmlRegisterUncreatableType<TrackListModel>(uri, versionMajor, versionMinor, "TrackListModel", "available tracks of a media (audio/video/sub)" );
qmlRegisterUncreatableType<TitleListModel>(uri, versionMajor, versionMinor, "TitleListModel", "available titles of a media" );
qmlRegisterUncreatableType<ChapterListModel>(uri, versionMajor, versionMinor, "ChapterListModel", "available titles of a media" );
qmlRegisterUncreatableType<ProgramListModel>(uri, versionMajor, versionMinor, "ProgramListModel", "available programs of a media" );
qmlRegisterUncreatableType<VLCVarChoiceModel>(uri, versionMajor, versionMinor, "VLCVarChoiceModel", "generic variable with choice model" );
qmlRegisterUncreatableType<PlayerController>(uri, versionMajor, versionMinor, "PlayerController", "player controller" );
qRegisterMetaType<PlaylistPtr>();
qRegisterMetaType<PlaylistItem>();
......@@ -209,7 +267,6 @@ void MainUI::registerQMLTypes()
qmlRegisterType<AboutModel>( uri, versionMajor, versionMinor, "AboutModel" );
qmlRegisterUncreatableType<DialogModel>(uri, versionMajor, versionMinor, "DialogModel", "");
qmlRegisterUncreatableType<DialogErrorModel>( uri, versionMajor, versionMinor, "DialogErrorModel", "");
qRegisterMetaType<DialogId>();
......@@ -234,7 +291,6 @@ void MainUI::registerQMLTypes()
qRegisterMetaType<QList<QQmlError>>("QList<QQmlError>");
qmlRegisterUncreatableType<NavigationAttached>( uri, versionMajor, versionMinor, "Navigation", "Navigation is only available via attached properties");
qmlRegisterSingletonType<QmlKeyHelper>(uri, versionMajor, versionMinor, "KeyHelper", &QmlKeyHelper::getSingletonInstance);
}
{
......@@ -253,6 +309,8 @@ void MainUI::registerQMLTypes()
const int versionMajor = 0;
const int versionMinor = 1;
qmlRegisterSingletonType<MediaLib>(uri, versionMajor, versionMinor, "MediaLib", SingletonRegisterHelper<MediaLib>::callback);
qRegisterMetaType<MLItemId>();
qmlRegisterType<MLAlbumModel>( uri, versionMajor, versionMinor, "MLAlbumModel" );
qmlRegisterType<MLArtistModel>( uri, versionMajor, versionMinor, "MLArtistModel" );
......@@ -298,8 +356,3 @@ void MainUI::onQmlWarning(const QList<QQmlError>& qmlErrors)
}
}
QObject* MainUI::getMainCtxInstance(QQmlEngine *, QJSEngine *)
{
assert(g_mainCtx != nullptr);
return g_mainCtx;
}
......@@ -130,12 +130,12 @@ FocusScope {
id: history_back
size: VLCStyle.banner_icon_size
iconText: VLCIcons.topbar_previous
text: i18n.qtr("Previous")
text: I18n.qtr("Previous")
height: VLCStyle.bannerButton_height
width: VLCStyle.bannerButton_width
colorDisabled: VLCStyle.colors.textDisabled
onClicked: history.previous()
enabled: !history.previousEmpty
onClicked: History.previous()
enabled: !History.previousEmpty
Navigation.parentItem: root
Navigation.rightItem: globalMenuGroup
......@@ -254,7 +254,7 @@ FocusScope {
height: VLCStyle.bannerButton_height
size: VLCStyle.banner_icon_size
iconText: MainCtx.gridView ? VLCIcons.list : VLCIcons.grid
text: i18n.qtr("List/Grid")
text: I18n.qtr("List/Grid")
onClicked: MainCtx.gridView = !MainCtx.gridView
enabled: true
}
......@@ -397,7 +397,7 @@ FocusScope {
size: VLCStyle.banner_icon_size
iconText: VLCIcons.playlist
text: i18n.qtr("Playlist")
text: I18n.qtr("Playlist")
width: VLCStyle.bannerButton_width
height: VLCStyle.bannerButton_height
highlighted: MainCtx.playlistVisible
......@@ -410,7 +410,7 @@ FocusScope {
size: VLCStyle.banner_icon_size
iconText: VLCIcons.ellipsis
text: i18n.qtr("Menu")
text: I18n.qtr("Menu")
width: VLCStyle.bannerButton_width
height: VLCStyle.bannerButton_height
......
......@@ -19,13 +19,14 @@ import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import QtGraphicalEffects 1.0
import org.videolan.vlc 0.1
import "qrc:///style/"
import "qrc:///main/" as Main
import "qrc:///widgets/" as Widgets
import "qrc:///playlist/" as PL
import "qrc:///player/" as Player
import "qrc:///player/" as P
import "qrc:///util/Helpers.js" as Helpers
......@@ -50,9 +51,9 @@ FocusScope {
Component.onCompleted: {
loadView()
if (medialib && !MainCtx.hasFirstrun)
if (MainCtx.mediaLibraryAvailable && !MainCtx.hasFirstrun)
// asynchronous call
medialib.reload()
MainCtx.mediaLibrary.reload()
}
function loadView() {
......@@ -83,12 +84,12 @@ FocusScope {
return e.name === stackView.currentItem.view
})
if (player.hasVideoOutput && MainCtx.hasEmbededVideo)
if (Player.hasVideoOutput && MainCtx.hasEmbededVideo)
_showMiniPlayer = true
}
Navigation.cancelAction: function() {
history.previous()
History.previous()
}
Keys.onPressed: {
......@@ -103,32 +104,32 @@ FocusScope {
readonly property var pageModel: [
{
listed: !!medialib,
displayText: i18n.qtr("Video"),
listed: MainCtx.mediaLibraryAvailable,
displayText: I18n.qtr("Video"),
icon: VLCIcons.topbar_video,
name: "video",
url: "qrc:///medialibrary/VideoDisplay.qml"
}, {
listed: !!medialib,
displayText: i18n.qtr("Music"),
listed: MainCtx.mediaLibraryAvailable,
displayText: I18n.qtr("Music"),
icon: VLCIcons.topbar_music,
name: "music",
url: "qrc:///medialibrary/MusicDisplay.qml"
}, {
listed: !medialib,
displayText: i18n.qtr("Home"),
listed: MainCtx.mediaLibraryAvailable,
displayText: I18n.qtr("Home"),
icon: VLCIcons.home,
name: "home",
url: "qrc:///main/NoMedialibHome.qml"
}, {
listed: true,
displayText: i18n.qtr("Browse"),
displayText: I18n.qtr("Browse"),
icon: VLCIcons.topbar_network,
name: "network",
url: "qrc:///network/NetworkDisplay.qml"
}, {
listed: true,
displayText: i18n.qtr("Discover"),
displayText: I18n.qtr("Discover"),
icon: VLCIcons.topbar_discover,
name: "discover",
url: "qrc:///network/DiscoverDisplay.qml"
......@@ -158,7 +159,7 @@ FocusScope {
function showPlayer() {
root._inhibitMiniPlayer = true
history.push(["player"])
History.push(["player"])
}
function play(backend, ids) {
......@@ -200,9 +201,9 @@ FocusScope {
var name = root.tabModel.get(index).name
selectedIndex = index
if (_oldViewProperties[name] === undefined)
history.push(["mc", name])
History.push(["mc", name])
else
history.push(["mc", name, _oldViewProperties[name]])
History.push(["mc", name, _oldViewProperties[name]])
}
Navigation.parentItem: medialibId
......@@ -245,7 +246,7 @@ FocusScope {
topMargin: VLCStyle.dp(10, VLCStyle.scale)
bottomMargin: VLCStyle.dp(10, VLCStyle.scale)
}
active: !!medialib && !medialib.idle
active: MainCtx.mediaLibraryAvailable && !MainCtx.mediaLibrary.idle
source: "qrc:///widgets/ScanProgressBar.qml"
}
}
......@@ -397,7 +398,7 @@ FocusScope {
}
}
Player.PIPPlayer {
P.PIPPlayer {
id: playerPip
anchors {
bottom: miniPlayer.top
......@@ -432,7 +433,7 @@ FocusScope {
}
Player.MiniPlayer {
P.MiniPlayer {
id: miniPlayer
Binding on state {
......@@ -457,10 +458,10 @@ FocusScope {
}
Connections {
target: player
target: Player
onHasVideoOutputChanged: {
if (player.hasVideoOutput && MainCtx.hasEmbededVideo) {
if (history.current.view !== "player")
if (Player.hasVideoOutput && MainCtx.hasEmbededVideo) {
if (History.current.view !== "player")
g_mainDisplay.showPlayer()
} else {
_showMiniPlayer = false;
......
......@@ -80,7 +80,7 @@ Rectangle {
]
function loadCurrentHistoryView() {
var current = history.current
var current = History.current
if ( !current || !current.name || !current.properties ) {
console.warn("unable to load requested view, undefined")
return
......@@ -89,20 +89,21 @@ Rectangle {
}
Connections {
target: history
target: History
onCurrentChanged: loadCurrentHistoryView()
}
function setInitialView() {
//set the initial view
var loadPlayer = !mainPlaylistController.empty;
if (medialib)
history.push(["mc", "video"], loadPlayer ? History.Stay : History.Go)
if (MainCtx.mediaLibraryAvailable)
History.push(["mc", "video"], loadPlayer ? History.Stay : History.Go)
else
history.push(["mc", "home"], loadPlayer ? History.Stay : History.Go)
History.push(["mc", "home"], loadPlayer ? History.Stay : History.Go)
if (loadPlayer)
history.push(["player"])
History.push(["player"])
}
......@@ -134,19 +135,19 @@ Rectangle {
focus: true
Connections {
target: player
target: Player
onPlayingStateChanged: {
if (player.playingState === PlayerController.PLAYING_STATE_STOPPED
&& history.current.name === "player") {
if (history.previousEmpty)
if (Player.playingState === Player.PLAYING_STATE_STOPPED
&& History.current.name === "player") {
if (History.previousEmpty)
{
if (medialib)
history.push(["mc", "video"])
if (MainCtx.mediaLibraryAvailable)
History.push(["mc", "video"])
else
history.push(["mc", "home"])
History.push(["mc", "home"])
}
else
history.previous()
History.previous()
}
}
}
......@@ -180,7 +181,7 @@ Rectangle {
active: (MainCtx.clientSideDecoration
&&
// NOTE: We don't want to steal the mouse when we are maximized or in fullscreen
!((topWindow.visibility & Window.Maximized) || MainCtx.interfaceFullScreen))
!((IntfWindow.visibility & Window.Maximized) || MainCtx.interfaceFullScreen))
source: "qrc:///widgets/CSDMouseStealer.qml"
}
......
......@@ -17,6 +17,8 @@
*****************************************************************************/
import QtQuick 2.11
import org.videolan.vlc 0.1
import "qrc:///style/"
import "qrc:///widgets/" as Widgets
......@@ -37,7 +39,7 @@ FocusScope {
Widgets.MenuLabel {
anchors .horizontalCenter: parent.horizontalCenter
text: i18n.qtr("Drag & Drop some content here!")
text: I18n.qtr("Drag & Drop some content here!")
}
}
......
......@@ -103,12 +103,12 @@ FocusScope {
Layout.fillWidth: true
Widgets.SubtitleLabel {
text: artist.name || i18n.qtr("No artist")
text: artist.name || I18n.qtr("No artist")
color: "white"
}
Widgets.MenuCaption {
text: i18n.qtr("%1 Songs").arg(artist.nb_tracks)
text: I18n.qtr("%1 Songs").arg(artist.nb_tracks)
color: "white"
opacity: .6
......@@ -129,18 +129,18 @@ FocusScope {
Widgets.ActionButtonPrimary {
id: playActionBtn
iconTxt: VLCIcons.play
text: i18n.qtr("Play all")
text: I18n.qtr("Play all")
focus: true
// NOTE: In overlay, the focus rectangle is always white.
colorFocus: VLCStyle.colors.white
onClicked: medialib.addAndPlay( artist.id )
onClicked: MediaLib.addAndPlay( artist.id )
}
Widgets.ActionButtonOverlay {
id: enqueueActionBtn
iconTxt: VLCIcons.enqueue
text: i18n.qtr("Enqueue all")
onClicked: medialib.addToPlaylist( artist.id )
text: I18n.qtr("Enqueue all")
onClicked: MediaLib.addToPlaylist( artist.id )
}
}
}
......
......@@ -17,6 +17,7 @@
*****************************************************************************/
import QtQuick 2.11
import org.videolan.vlc 0.1
import org.videolan.medialib 0.1
import "qrc:///widgets/" as Widgets
......@@ -27,14 +28,14 @@ Widgets.GridItem {
property int index: -1
image: model.cover || VLCStyle.noArtAlbum
title: model.title || i18n.qtr("Unknown title")
subtitle: model.main_artist || i18n.qtr("Unknown artist")
title: model.title || I18n.qtr("Unknown title")
subtitle: model.main_artist || I18n.qtr("Unknown artist")
pictureWidth: VLCStyle.gridCover_music_width
pictureHeight: VLCStyle.gridCover_music_height
playCoverBorderWidth: VLCStyle.gridCover_music_border
onPlayClicked: {
if ( model.id !== undefined ) {
medialib.addAndPlay( model.id )
MediaLib.addAndPlay( model.id )
}
}
}
......@@ -74,11 +74,11 @@ FocusScope {
Widgets.TabButtonExt {
id: browseButton
text: i18n.qtr("Browse")
text: I18n.qtr("Browse")
focus: true
iconTxt: VLCIcons.topbar_network
anchors.horizontalCenter: parent.horizontalCenter
onClicked: history.push(["mc", "network"])
onClicked: History.push(["mc", "network"])
width: VLCStyle.dp(84, VLCStyle.scale)
Navigation.parentItem: root
......@@ -89,7 +89,7 @@ FocusScope {
Keys.onPressed: Navigation.defaultKeyAction(event)
Keys.onReleased: {
if (KeyHelper.matchOk(event)) {
history.push(["mc", "network"])
History.push(["mc", "network"])
}
Navigation.defaultKeyReleaseAction(event)
}
......
......@@ -53,7 +53,7 @@ VideoAll {
model: MLVideoModel {
id: modelGroup
ml: medialib
ml: MediaLib
parentId: initialId
}
......
......@@ -41,9 +41,9 @@ FocusScope {
property int initialIndex: 0
property var sortModel: [
{ text: i18n.qtr("Alphabetic"), criteria: "name" },
{ text: i18n.qtr("Duration"), criteria: "duration" },
{ text: i18n.qtr("Date"), criteria: "date" }
{ text: I18n.qtr("Alphabetic"), criteria: "name" },
{ text: I18n.qtr("Duration"), criteria: "duration" },
{ text: I18n.qtr("Date"), criteria: "date" }
]
//---------------------------------------------------------------------------------------------
......@@ -111,7 +111,7 @@ FocusScope {
function _actionAtIndex() {
if (modelSelect.selectedIndexes.length > 1) {
g_mainDisplay.play(medialib, model.getIdsForIndexes(modelSelect.selectedIndexes));
g_mainDisplay.play(MediaLib, model.getIdsForIndexes(modelSelect.selectedIndexes));
} else if (modelSelect.selectedIndexes.length === 1) {
var index = modelSelect.selectedIndexes[0];
_showList(model.getDataAt(index), Qt.TabFocusReason);
......@@ -122,7 +122,7 @@ FocusScope {
{
// NOTE: If the count is 1 we consider the group is a media.
if (model.count == 1)
g_mainDisplay.play(medialib, model.id);
g_mainDisplay.play(MediaLib, model.id);
else
showList(model, reason);
}
......@@ -161,7 +161,7 @@ FocusScope {
MLGroupListModel {
id: model
ml: medialib
ml: MediaLib
onCountChanged: {
if (count === 0 || modelSelect.hasSelection)
......@@ -265,9 +265,9 @@ FocusScope {
gridView.expandIndex !== gridItem.index) ? 0.7 : 1
title: (model.name) ? model.name
: i18n.qtr("Unknown title")
: I18n.qtr("Unknown title")
labels: _getLabels(model, i18n.qtr("%1 Videos"))
labels: _getLabels(model, I18n.qtr("%1 Videos"))
// NOTE: We don't want to show the indicator for a group.
// FIXME: Sometimes MLBaseModel::getDataAt returns {} so we use 'isNew === true'.
......@@ -395,7 +395,7 @@ FocusScope {
visible: (model.count === 0)
text: i18n.qtr("No video found\nPlease try adding sources, by going to the Network tab")
text: I18n.qtr("No video found\nPlease try adding sources, by going to the Network tab")
cover: VLCStyle.noArtVideoCover
......
......@@ -31,10 +31,10 @@ FocusScope {
id: root
property var sortModel: [
{ text: i18n.qtr("Alphabetic"), criteria: "title"},
{ text: i18n.qtr("Duration"), criteria: "duration" },
{ text: i18n.qtr("Date"), criteria: "release_year" },
{ text: i18n.qtr("Artist"), criteria: "main_artist" },
{ text: I18n.qtr("Alphabetic"), criteria: "title"},
{ text: I18n.qtr("Duration"), criteria: "duration" },
{ text: I18n.qtr("Date"), criteria: "release_year" },
{ text: I18n.qtr("Artist"), criteria: "main_artist" },
]
property alias model: albumModelId
......@@ -72,9 +72,9 @@ FocusScope {
function _actionAtIndex(index) {
if (selectionModel.selectedIndexes.length > 1) {
medialib.addAndPlay( model.getIdsForIndexes( selectionModel.selectedIndexes ) )
MediaLib.addAndPlay( model.getIdsForIndexes( selectionModel.selectedIndexes ) )
} else {
medialib.addAndPlay( model.getIdForIndex(index) )
MediaLib.addAndPlay( model.getIdForIndex(index) )
}
}
......@@ -90,7 +90,7 @@ FocusScope {
MLAlbumModel {
id: albumModelId
ml: medialib
ml: MediaLib
onCountChanged: {
if (albumModelId.count > 0 && !selectionModel.hasSelection) {
......@@ -230,8 +230,8 @@ FocusScope {
headerTopPadding: VLCStyle.margin_normal
sortModel: [
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
{ criteria: "main_artist", width: VLCStyle.colWidth(Math.max(tableView_id._nbCols - 3, 1)), text: i18n.qtr("Artist") },
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: I18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
{ criteria: "main_artist", width: VLCStyle.colWidth(Math.max(tableView_id._nbCols - 3, 1)), text: I18n.qtr("Artist") },
{ criteria: "duration", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate },
]
......@@ -239,7 +239,7 @@ FocusScope {
onContextMenuButtonClicked: contextMenu.popup(selectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
onRightClick: contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
onItemDoubleClicked: medialib.addAndPlay( model.id )
onItemDoubleClicked: MediaLib.addAndPlay( model.id )
Widgets.TableColumns {
id: tableColumns
......@@ -284,7 +284,7 @@ FocusScope {
anchors.fill: parent
visible: albumModelId.count === 0
focus: visible
text: i18n.qtr("No albums found\nPlease try adding sources, by going to the Network tab")
text: I18n.qtr("No albums found\nPlease try adding sources, by going to the Network tab")
Navigation.parentItem: root
cover: VLCStyle.noArtAlbumCover
}
......
......@@ -27,6 +27,6 @@ MusicAlbums {
id: root
onCurrentIndexChanged: {
history.update(["mc","music", "albums", {"initialIndex": currentIndex}])
History.update(["mc","music", "albums", {"initialIndex": currentIndex}])
}
}
......@@ -58,9 +58,9 @@ FocusScope {
var count = Helpers.get(model, "nb_tracks", 0);
if (count < 2)
return i18n.qtr("%1 track").arg(count);
return I18n.qtr("%1 track").arg(count);
else
return i18n.qtr("%1 tracks").arg(count);
return I18n.qtr("%1 tracks").arg(count);
}
Rectangle {
......@@ -147,16 +147,16 @@ FocusScope {
id: playActionBtn
iconTxt: VLCIcons.play_outline
text: i18n.qtr("Play")
onClicked: medialib.addAndPlay( model.id )
text: I18n.qtr("Play")
onClicked: MediaLib.addAndPlay( model.id )
}
Widgets.TabButtonExt {
id: enqueueActionBtn
iconTxt: VLCIcons.enqueue
text: i18n.qtr("Enqueue")
onClicked: medialib.addToPlaylist( model.id )
text: I18n.qtr("Enqueue")
onClicked: MediaLib.addToPlaylist( model.id )
}
}
......@@ -205,7 +205,7 @@ FocusScope {
}
Widgets.CaptionLabel {
text: i18n.qtr("Title")
text: I18n.qtr("Title")
}
}
......@@ -221,7 +221,7 @@ FocusScope {
Widgets.SubtitleLabel {
id: expand_infos_title_id
text: Helpers.get(model, "title", i18n.qtr("Unknown title"))
text: Helpers.get(model, "title", I18n.qtr("Unknown title"))
Layout.fillWidth: true
}
......@@ -242,8 +242,8 @@ FocusScope {
id: expand_infos_subtitle_id
width: parent.width
text: i18n.qtr("%1 - %2 - %3 - %4")
.arg(Helpers.get(model, "main_artist", i18n.qtr("Unknown artist")))
text: I18n.qtr("%1 - %2 - %3 - %4")
.arg(Helpers.get(model, "main_artist", I18n.qtr("Unknown artist")))
.arg(Helpers.get(model, "release_year", ""))
.arg(_getStringTrack())
.arg(Helpers.msToString(Helpers.get(model, "duration", 0)))
......@@ -265,7 +265,7 @@ FocusScope {
}
sortModel: [
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(Math.max(tracks._nbCols - 1, 1)), visible: true, text: i18n.qtr("Title"), showSection: "", colDelegate: titleDelegate, headerDelegate: titleHeaderDelegate },
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(Math.max(tracks._nbCols - 1, 1)), visible: true, text: I18n.qtr("Title"), showSection: "", colDelegate: titleDelegate, headerDelegate: titleHeaderDelegate },
{ criteria: "duration", width: VLCStyle.colWidth(1), visible: true, showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
]
......
......@@ -71,7 +71,7 @@ FocusScope {
MLArtistModel {
id: artistModel
ml: medialib
ml: MediaLib
onCountChanged: {
if (artistModel.count > 0 && !selectionModel.hasSelection) {
......@@ -120,7 +120,7 @@ FocusScope {
onSelectionUpdated: selectionModel.updateSelection( keyModifiers, oldIndex, newIndex )
onActionAtIndex: {
if (selectionModel.selectedIndexes.length > 1) {
medialib.addAndPlay( artistModel.getIdsForIndexes( selectionModel.selectedIndexes ) )
MediaLib.addAndPlay( artistModel.getIdsForIndexes( selectionModel.selectedIndexes ) )
} else {
_currentView.currentIndex = index
requestArtistAlbumView(Qt.TabFocusReason)
......@@ -139,8 +139,8 @@ FocusScope {
delegate: AudioGridItem {
id: gridItem
title: model.name || i18n.qtr("Unknown artist")
subtitle: model.nb_tracks > 1 ? i18n.qtr("%1 songs").arg(model.nb_tracks) : i18n.qtr("%1 song").arg(model.nb_tracks)
title: model.name || I18n.qtr("Unknown artist")
subtitle: model.nb_tracks > 1 ? I18n.qtr("%1 songs").arg(model.nb_tracks) : I18n.qtr("%1 song").arg(model.nb_tracks)
pictureRadius: VLCStyle.artistGridCover_radius
pictureHeight: VLCStyle.artistGridCover_radius
pictureWidth: VLCStyle.artistGridCover_radius
......@@ -189,16 +189,16 @@ FocusScope {
onActionForSelection: {
if (selection.length > 1) {
medialib.addAndPlay( artistModel.getIdsForIndexes( selection ) )
MediaLib.addAndPlay( artistModel.getIdsForIndexes( selection ) )
} else if ( selection.length === 1) {
requestArtistAlbumView(Qt.TabFocusReason)
medialib.addAndPlay( artistModel.getIdForIndex( selection[0] ) )
MediaLib.addAndPlay( artistModel.getIdForIndex( selection[0] ) )
}
}
sortModel: [
{ isPrimary: true, criteria: "name", width: VLCStyle.colWidth(Math.max(artistTable._nbCols - 1, 1)), text: i18n.qtr("Name"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
{ criteria: "nb_tracks", width: VLCStyle.colWidth(1), text: i18n.qtr("Tracks") }
{ isPrimary: true, criteria: "name", width: VLCStyle.colWidth(Math.max(artistTable._nbCols - 1, 1)), text: I18n.qtr("Name"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
{ criteria: "nb_tracks", width: VLCStyle.colWidth(1), text: I18n.qtr("Tracks") }
]
onItemDoubleClicked: root.requestArtistAlbumView(Qt.MouseFocusReason)
......@@ -236,7 +236,7 @@ FocusScope {
anchors.fill: parent
visible: artistModel.count === 0
focus: artistModel.count === 0
text: i18n.qtr("No artists found\nPlease try adding sources, by going to the Network tab")
text: I18n.qtr("No artists found\nPlease try adding sources, by going to the Network tab")
Navigation.parentItem: root
cover: VLCStyle.noArtArtistCover
}
......