+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>Dialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>Dialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="64px"
- height="64px"
- id="svg2816"
- version="1.1"
- inkscape:version="0.47 r22583"
- sodipodi:docname="Maemo_VLC_remote.svg"
- inkscape:export-filename="/home/eugene/Downloads/likalo/icons/Maemo_VLC_remote.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs2818">
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3979">
- <stop
- style="stop-color:#e6eff7;stop-opacity:1;"
- offset="0"
- id="stop3981" />
- <stop
- style="stop-color:#e6eff7;stop-opacity:0;"
- offset="1"
- id="stop3983" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3791">
- <stop
- style="stop-color:#8b8b8b;stop-opacity:1"
- offset="0"
- id="stop3793" />
- <stop
- style="stop-color:#050505;stop-opacity:1"
- offset="1"
- id="stop3795" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- id="linearGradient3687">
- <stop
- style="stop-color:#f2f2f2;stop-opacity:1;"
- offset="0"
- id="stop3689" />
- <stop
- style="stop-color:#f2f2f2;stop-opacity:0;"
- offset="1"
- id="stop3691" />
- </linearGradient>
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 32 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="64 : 32 : 1"
- inkscape:persp3d-origin="32 : 21.333333 : 1"
- id="perspective2824" />
- <filter
- inkscape:collect="always"
- id="filter3756"
- x="-0.1344"
- width="1.2688"
- y="-0.336"
- height="1.672">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="1.68"
- id="feGaussianBlur3758" />
- </filter>
- <inkscape:perspective
- id="perspective3840"
- inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
- inkscape:vp_z="1 : 0.5 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_x="0 : 0.5 : 1"
- sodipodi:type="inkscape:persp3d" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3687"
- id="linearGradient3854"
- gradientUnits="userSpaceOnUse"
- x1="32"
- y1="22"
- x2="32"
- y2="52.066593"
- gradientTransform="matrix(1.111111,0,0,1,-3.5555554,-1)" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3791"
- id="linearGradient3865"
- gradientUnits="userSpaceOnUse"
- spreadMethod="pad"
- x1="44"
- y1="-30"
- x2="48"
- y2="-32" />
- <filter
- inkscape:collect="always"
- id="filter3949"
- x="-0.17035383"
- width="1.3407077"
- y="-0.045646171"
- height="1.0912923">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="0.91101842"
- id="feGaussianBlur3951" />
- </filter>
- <filter
- inkscape:collect="always"
- id="filter3959"
- x="-0.055835792"
- width="1.1116716"
- y="-0.34203537"
- height="1.6840707">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="0.11718901"
- id="feGaussianBlur3961" />
- </filter>
- <filter
- inkscape:collect="always"
- id="filter3969">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="0.32"
- id="feGaussianBlur3971" />
- </filter>
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3979"
- id="radialGradient3987"
- cx="34.5"
- cy="32.5"
- fx="26.331987"
- fy="28.26091"
- r="20.5"
- gradientTransform="matrix(1.0286932,-0.00554309,4.8548147e-4,0.09009624,-1.0056937,29.763108)"
- gradientUnits="userSpaceOnUse" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3979"
- id="radialGradient3991"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.62725195,-0.00554309,2.9602529e-4,0.09009624,23.850187,10.763108)"
- cx="34.5"
- cy="32.5"
- fx="26.331987"
- fy="28.26091"
- r="20.5" />
- <filter
- inkscape:collect="always"
- id="filter4001"
- x="-0.024585366"
- width="1.0491707"
- y="-1.008"
- height="3.016">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="0.42"
- id="feGaussianBlur4003" />
- </filter>
- <filter
- inkscape:collect="always"
- id="filter4009"
- x="-0.624"
- width="2.248"
- y="-0.02496"
- height="1.04992">
- <feGaussianBlur
- inkscape:collect="always"
- stdDeviation="0.26"
- id="feGaussianBlur4011" />
- </filter>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3687"
- id="linearGradient4020"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.111111,0,0,1,0.4444446,-1)"
- x1="32"
- y1="22"
- x2="32"
- y2="52.066593" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3791"
- id="linearGradient4026"
- gradientUnits="userSpaceOnUse"
- spreadMethod="pad"
- x1="44"
- y1="-30"
- x2="48"
- y2="-32"
- gradientTransform="translate(0,-4)" />
- <inkscape:perspective
- id="perspective2875"
- inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
- inkscape:vp_z="1 : 0.5 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_x="0 : 0.5 : 1"
- sodipodi:type="inkscape:persp3d" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3791"
- id="linearGradient2937"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(0,-4)"
- spreadMethod="pad"
- x1="44"
- y1="-30"
- x2="48"
- y2="-32" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3687"
- id="linearGradient2939"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.111111,0,0,1,0.4444446,-1)"
- x1="32"
- y1="22"
- x2="32"
- y2="52.066593" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3979"
- id="radialGradient2941"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.0286932,-0.00554309,4.8548147e-4,0.09009624,-1.0056937,29.763108)"
- cx="34.5"
- cy="32.5"
- fx="26.331987"
- fy="28.26091"
- r="20.5" />
- <radialGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3979"
- id="radialGradient2943"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(0.62725195,-0.00554309,2.9602529e-4,0.09009624,23.850187,10.763108)"
- cx="34.5"
- cy="32.5"
- fx="26.331987"
- fy="28.26091"
- r="20.5" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="9.671875"
- inkscape:cx="28.015642"
- inkscape:cy="25.696712"
- inkscape:current-layer="layer1"
- showgrid="true"
- inkscape:document-units="px"
- inkscape:grid-bbox="true"
- showguides="true"
- inkscape:guide-bbox="true"
- inkscape:snap-global="true"
- inkscape:window-width="1640"
- inkscape:window-height="1027"
- inkscape:window-x="36"
- inkscape:window-y="-4"
- inkscape:window-maximized="1">
- <sodipodi:guide
- orientation="1,0"
- position="4,52.545455"
- id="guide2826" />
- <sodipodi:guide
- orientation="1,0"
- position="60,40"
- id="guide2828" />
- <sodipodi:guide
- orientation="0,1"
- position="31,61"
- id="guide2830" />
- <sodipodi:guide
- orientation="0,1"
- position="45.454545,4"
- id="guide2832" />
- <inkscape:grid
- type="xygrid"
- id="grid2836" />
- </sodipodi:namedview>
- <metadata
- id="metadata2821">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- id="layer1"
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- <g
- id="g2912"
- transform="matrix(0.99828455,0,0,1.016587,0.00669673,-0.97863428)"
- inkscape:export-filename="/home/schutz/programmation/git-vlc-remote/vlc-remote.png"
- inkscape:export-xdpi="116"
- inkscape:export-ydpi="116">
- <path
- id="path3885"
- d="m 29.124008,4 -18.030258,49.555556 -6.010086,0 c -0.6536613,0 -1.1798942,0.526232 -1.1798942,1.179894 l 0,1.179894 c 0,0.653661 0.5262329,1.179895 1.1798942,1.179895 l 4.7195768,0 42.4761912,0 4.719576,0 c 0.653661,0 1.179894,-0.526234 1.179894,-1.179895 l 0,-1.179894 c 0,-0.653662 -0.526233,-1.179894 -1.179894,-1.179894 l -6.08383,0 L 32,4 29.124008,4 z"
- style="fill:#e97f02;stroke:none" />
- <path
- sodipodi:nodetypes="cccccccccc"
- id="path3913"
- d="M 31,4 34.1875,54 35,57 57.46875,57 c 0.423766,-0.178644 0.71875,-0.603504 0.71875,-1.09375 l 0,-1.15625 c 0,-0.653662 -0.533839,-1.1875 -1.1875,-1.1875 l -6.09375,0 L 32,4 31,4 z"
- style="fill:#eb6841;stroke:none" />
- <path
- sodipodi:nodetypes="cccc"
- id="path3963"
- d="M 32,6 48,54 43,54 32,6 z"
- style="fill:#cc333f;stroke:none;filter:url(#filter3969)" />
- <path
- id="rect3908"
- d="m 3.90625,55.657986 0,0.62145 c 0,0.44824 0.5338387,0.814314 1.1875,0.814314 l 4.71875,0 42.46875,0 4.71875,0 c 0.653661,0 1.1875,-0.366074 1.1875,-0.814314 l 0,-0.62145 -54.28125,0 z"
- style="fill:#8e6c11;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <path
- style="fill:#f8ca00;fill-opacity:1;fill-rule:nonzero;stroke:none"
- d="m 27.562279,9 -1.683727,5 9.579819,0 -1.770816,-5 -6.125276,0 z M 24.165796,19 22.482071,24 39,24 37.229184,19 24.165796,19 z m -3.36745,10 -1.683725,5 23.427008,0 -1.770813,-5 -19.97247,0 z"
- id="path3906" />
- <path
- sodipodi:nodetypes="cccc"
- id="path3918"
- d="M 29.053312,6.1001616 16.218589,54 24,54 29.053312,6.1001616 z"
- style="fill:#f0db92;stroke:none;filter:url(#filter3949)" />
- <path
- id="rect3896"
- d="m 27.961923,9 -1.477687,5 8.407527,0 -1.554119,-5 -5.375721,0 z M 24.981072,19 23.503386,24 38,24 36.445881,19 24.981072,19 z m -2.955373,10 -1.477686,5 20.560224,0 -1.554118,-5 -17.52842,0 z"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <path
- id="path3953"
- d="M 4.9628433,54.177706 10,54.177706 9.779667,55 5,55 4.9628433,54.177706 z"
- style="fill:#f8ca00;stroke:none;filter:url(#filter3959)" />
- <g
- id="g4028">
- <g
- id="g2889">
- <rect
- transform="matrix(0,1,-1,0,0,0)"
- ry="2"
- rx="2"
- y="-60"
- x="31"
- height="48"
- width="28"
- id="rect2834"
- style="fill:url(#linearGradient2937);fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <rect
- ry="1"
- rx="1"
- transform="matrix(0,1,-1,0,0,0)"
- style="fill:#4a4a4a;fill-opacity:1;fill-rule:nonzero;stroke:none"
- id="rect3610"
- width="26"
- height="46"
- x="32"
- y="-59" />
- <rect
- ry="2"
- rx="2.181818"
- y="-58"
- x="-57"
- height="44"
- width="24"
- id="rect3676"
- style="fill:#050505;fill-opacity:1;fill-rule:nonzero;stroke:none"
- transform="matrix(0,-1,-1,0,0,0)" />
- <rect
- y="-55"
- x="-55"
- height="38"
- width="20"
- id="rect3711"
- style="fill:#303030;fill-opacity:1;fill-rule:nonzero;stroke:none"
- transform="matrix(0,-1,-1,0,0,0)" />
- <path
- id="path3726"
- d="M 16,34 16,46.21875 56,39.78125 56,34 16,34 z"
- style="opacity:0.5;fill:url(#linearGradient2939);fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <path
- style="fill:#69d2e7;fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter3756)"
- d="m 34,41 0,12 6,-6 -6,-6 z m -13,3 0,5 2,0 0,-5 -2,0 z m 3,0 0,5 2,0 0,-5 -2,0 z m 22,0 0,5 5,0 0,-5 -5,0 z"
- id="path3742" />
- <path
- id="rect3719"
- d="m 34,41 0,12 6,-6 -6,-6 z m -13,3 0,5 2,0 0,-5 -2,0 z m 3,0 0,5 2,0 0,-5 -2,0 z m 22,0 0,5 5,0 0,-5 -5,0 z"
- style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <path
- id="rect3768"
- d="m 29.125,38 0,17 0.875,0 0,-17 -0.875,0 z M 43,38 l 0,17 0.875,0 0,-17 L 43,38 z"
- style="fill:#1a1a21;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <rect
- y="35"
- x="17"
- height="1.0000023"
- width="38"
- id="rect3867"
- style="opacity:0.5;fill:#1a1a21;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <rect
- y="32"
- x="14"
- height="1"
- width="41"
- id="rect3977"
- style="opacity:0.5;fill:url(#radialGradient2941);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter4001)" />
- <rect
- transform="matrix(0,1,1,0,-0.31017771,0)"
- style="fill:url(#radialGradient2943);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter4009)"
- id="rect3989"
- width="25"
- height="1"
- x="33"
- y="13" />
- <rect
- y="31.48435"
- x="17"
- height="1.5156504"
- width="6.0000005"
- id="rect3773"
- style="fill:#bdbdbd;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- <rect
- y="34"
- x="16"
- height="2"
- width="2"
- id="rect3713"
- style="fill:#69d2e7;fill-opacity:1;fill-rule:nonzero;stroke:none" />
- </g>
- </g>
- </g>
- </g>
-</svg>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "aboutdialog.h"
-#include "ui_aboutdialog.h"
-
-AboutDialog::AboutDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::AboutDialog)
-{
- ui->setupUi(this);
-}
-
-AboutDialog::~AboutDialog()
-{
- delete ui;
-}
-
-void AboutDialog::changeEvent(QEvent *e)
-{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef ABOUTDIALOG_H
-#define ABOUTDIALOG_H
-
-#include <QDialog>
-
-namespace Ui {
- class AboutDialog;
-}
-
-class AboutDialog : public QDialog {
- Q_OBJECT
-public:
- explicit AboutDialog(QWidget *parent = 0);
- ~AboutDialog();
-
-protected:
- void changeEvent(QEvent *e);
-
-private:
- Ui::AboutDialog *ui;
-};
-
-#endif // ABOUTDIALOG_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application by Sacha schutz </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>AboutDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>AboutDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "accountdialog.h"
-#include "ui_accountdialog.h"
-#include "newaccountdialog.h"
-#include <QDebug>
-#include <QInputDialog>
-#include <QSettings>
-#include <QTcpSocket>
-#include <QFuture>
-#include <QtConcurrentMap>
-
-
-
-QListWidgetItem asyncTestItem(const QListWidgetItem &item)
-{
-
- QListWidgetItem item2= item;
- item2.setText("boby");
-
- return item;
-
-}
-
-
-
-
-AccountDialog::AccountDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::AccountDialog)
-{
- ui->setupUi(this);
-
- mFuturWatcher = new QFutureWatcher<QListWidgetItem>(this);
- connect(mFuturWatcher,SIGNAL(resultReadyAt(int)),this,SLOT(setAsyncItem(int)));
-
- connect(ui->addButton,SIGNAL(clicked()),this,SLOT(add()));
- connect(ui->editButton,SIGNAL(clicked()),this,SLOT(edit()));
- connect(ui->remButton,SIGNAL(clicked()),this,SLOT(rem()));
- connect(ui->useButton,SIGNAL(clicked()),this,SLOT(use()));
- connect(ui->listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(enableUi()));
-
- load();
-
-}
-
-AccountDialog::~AccountDialog()
-{
- delete ui;
-}
-
-void AccountDialog::add()
-{
-
- NewAccountDialog *dialog = new NewAccountDialog(this);
- dialog->exec();
- load();
-}
-QString AccountDialog::currentIp()
-{
-
- QSettings settings;
- QString useKey = settings.value("config/currentKey").toString();
- QString useIp ;
- if ( !useKey.isEmpty())
- useIp = settings.value("account/"+useKey).toString();
-
- else return QString();
-
- return useIp;
-}
-
-void AccountDialog::load()
-{
- ui->editButton->setEnabled(false);
- ui->remButton->setEnabled(false);
- ui->useButton->setEnabled(false);
- ui->listWidget->clear(); // tjr effacer , sinon on rajoute
-
- QSettings settings;
-
- QString useKey = settings.value("config/currentKey").toString();
-
- QList <QListWidgetItem> asycItems;
-
- settings.beginGroup("account");
- foreach ( QString key, settings.allKeys())
- {
- QListWidgetItem * item = new QListWidgetItem;
-
- item->setText(key);
- item->setData(Qt::UserRole, settings.value(key));
- if (useKey == key) {
- QFont font = item->font();
- font.setBold(true);
- item->setFont(font);
- }
- ui->listWidget->addItem(item);
- asycItems.append(*item);
- }
- settings.endGroup();
-
-
- // ... create and add in the list widget
-
- // QFuture<QListWidgetItem> itemFutur = QtConcurrent::mapped(asycItems, asyncTestItem);
-
-
- mFuturWatcher->setFuture(QtConcurrent::mapped(asycItems, asyncTestItem));
-}
-
-QListWidgetItem AccountDialog::asyncTestItem(const QListWidgetItem& item)
-{
- //==========> NEED TO USE POINTER TO AVOID setAsyncItem! But I don't know how;..
- QListWidgetItem newItem = item;
-
- QTcpSocket * socket = new QTcpSocket;
- QSettings settings;
- QString host = settings.value("account/"+item.text()).toString();
-
- if(host.contains(":"))
- {
- QStringList hostSplit = host.split(":");
- QString ip = hostSplit.at(0);
- QString port = hostSplit.at(1);
- socket->connectToHost(ip,port.toInt());
- }
-
- else
- socket->connectToHost(host,8080);
-
- if (socket->waitForConnected(1000))
- newItem.setIcon(QIcon::fromTheme("widgets_tickmark_list"));
- else
- newItem.setIcon(QIcon::fromTheme("statusarea_presence_busy_error"));
-
- return newItem;
-
-
-}
-
-
-
-void AccountDialog::setAsyncItem(int row) // EDIT THE ROW AFTER ASYNC FUNCTION FINISHED
-{
- QListWidgetItem newItem = mFuturWatcher->resultAt(row);
- QListWidgetItem * item = ui->listWidget->item(row);
-
- item->setIcon(newItem.icon());
-
-
-
-}
-
-
-
-void AccountDialog::edit()
-{
- QString currentIp = ui->listWidget->currentItem()->data(Qt::UserRole).toString();
- QString currentKey = ui->listWidget->currentItem()->text();
-
- NewAccountDialog *dialog = new NewAccountDialog(this);
- dialog->edit(currentKey, currentIp);
- dialog->exec();
-
- load();
-}
-
-void AccountDialog::rem()
-{
- QString key = ui->listWidget->currentItem()->text();
-
- QSettings settings;
- settings.beginGroup("account");
- settings.remove(key);
- settings.endGroup();
-
- load(); // On recharge les compte
-}
-
-void AccountDialog::use()
-{
- QString currentKey = ui->listWidget->currentItem()->text();
- QSettings settings;
- settings.setValue("config/currentKey", currentKey);
- load();
- emit accept();
-}
-
-void AccountDialog::enableUi()
-{
- ui->editButton->setEnabled(true);
- ui->remButton->setEnabled(true);
- ui->useButton->setEnabled(true);
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef ACCOUNTDIALOG_H
-#define ACCOUNTDIALOG_H
-
-#include <QDialog>
-#include <QListWidget>
-#include <QFutureWatcher>
-namespace Ui {
- class AccountDialog;
-}
-
-class AccountDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit AccountDialog(QWidget *parent = 0);
- ~AccountDialog();
- static QListWidgetItem asyncTestItem(const QListWidgetItem& item);
-
-
-static QString currentIp();
-
-public slots:
- void add();
- void edit();
- void rem();
- void use();
- void load();
- void enableUi();
- void setAsyncItem(int row);
-private:
- Ui::AccountDialog *ui;
- QFutureWatcher <QListWidgetItem> * mFuturWatcher;
-};
-
-#endif // ACCOUNTDIALOG_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AccountDialog</class>
- <widget class="QDialog" name="AccountDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Accounts</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QListWidget" name="listWidget">
- <item>
- <property name="text">
- <string>test</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QPushButton" name="addButton">
- <property name="text">
- <string>Add</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Edit</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="remButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Remove</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2"/>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="useButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Use</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>320</width>
- <height>240</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Dialog</string>
- </property>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>200</y>
- <width>301</width>
- <height>32</height>
- </rect>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>Dialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel" >
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>Dialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel" >
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include <QStringList>
-#include "appsettings.h"
-
-AppSettings::AppSettings() {
-}
-
-AppSettings::~AppSettings() {
- ;
-}
-
-QString AppSettings::getCurrentKey() {
- QSettings sets;
- return sets.value("config/currentKey", "").toString();
-}
-QString AppSettings::getCurrentIp() {
- QSettings sets;
- return sets.value("account/" + getCurrentKey(), "").toString();
-}
-VlcDirectory AppSettings::getHomeDirectory() {
- QSettings sets;
- VlcDirectory home;
- home.name = sets.value("config/accounts/" + getCurrentKey() + "/homeDirName", "Default").toString();
- home.path = sets.value("config/accounts/" + getCurrentKey() + "/homeDirPath", "~/").toString();
- return home;
-}
-bool AppSettings::setHomeDirectory(VlcDirectory dir) {
- QSettings sets;
- sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirName", dir.name);
- sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirPath", dir.path);
- return true;
-}
-QList<VlcDirectory>* AppSettings::getFavourites() {
- QSettings sets;
- QList<VlcDirectory> * favourites = new QList<VlcDirectory>();
-
- sets.beginGroup("config/accounts/" + getCurrentKey() + "/favourites");
- foreach ( QString key, sets.allKeys())
- {
- VlcDirectory dir;
- // key is name
- dir.name = key;
- // value is path
- dir.path = sets.value(key, "~/").toString();
- favourites->append(dir);
- }
- sets.endGroup();
- return favourites;
-}
-bool AppSettings::addFavourite(VlcDirectory dir) {
- QSettings sets;
- // should check for existing first otherwise it overwrites
- if (0 < sets.value("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name, "").toString().length()) {
- dir.name = "_" + dir.name;
- return addFavourite(dir);
- }
- sets.setValue("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name, dir.path);
- return true;
-}
-bool AppSettings::deleteFavourite(VlcDirectory dir) {
- QSettings sets;
- sets.remove("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name);
- return true;
-}
-Orientation AppSettings::setOrientation(Orientation orientation) {
- QSettings sets;
- sets.setValue("config/orientation", (int)orientation);
- return orientation;
-}
-Orientation AppSettings::getOrientation() {
- QSettings sets;
- return (Orientation)(sets.value("config/orientation", AUTO_ROTATE).toInt());
-}
-
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef APPSETTINGS_H
-#define APPSETTINGS_H
-#include <QSettings>
-
-struct VlcDirectory {
- QString name;
- QString path;
-};
-enum Orientation {
- AUTO_ROTATE = 0,
- LANDSCAPE,
- PORTRAIT
-};
-
-class AppSettings {
-public:
- explicit AppSettings();
- ~AppSettings();
- static QString getCurrentKey();
- static QString getCurrentIp();
- static VlcDirectory getHomeDirectory();
- static QList<VlcDirectory>* getFavourites();
- static bool addFavourite(VlcDirectory dir);
- static bool deleteFavourite(VlcDirectory dir);
- static bool setHomeDirectory(VlcDirectory dir);
- static Orientation setOrientation(Orientation orientation);
- static Orientation getOrientation();
-//private:
- //static QSettings settings;
-};
-
-#endif // APPSETTINGS_H
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "browsemainwindow.h"
-#include "ui_browsemainwindow.h"
-#include <QSettings>
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-#include <QMaemo5InformationBox>
-#endif
-#include "configdialog.h"
-#include "aboutdialog.h"
-#include "vlcbrowseelement.h"
-#include "appsettings.h"
-#include "favouritesmainwindow.h"
-
-BrowseMainWindow::BrowseMainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::BrowseMainWindow)
-{
-
- ui->setupUi(this);
- mFavouritesMainWindow = new FavouritesMainWindow;
- mCurrentDir = "~/"; //AppSettings::getHomeDirectory().path; // This works on win as well as linux, would guess mac too.
- setWindowTitle("Vlc remote");
-
-
- mNetManager = new QNetworkAccessManager(this);
-
- mContents = new QList<VlcBrowseElement>();
-
- ui->listWidget->setTextElideMode(Qt::ElideMiddle);
- ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
- ui->playButton->setIcon(QIcon::fromTheme("camera_playback"));
- ui->addButton->setIcon(QIcon::fromTheme("general_add"));
- ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
- ui->browseButton->setDisabled(true);
- ui->playButton->setDisabled(true);
- ui->addButton->setDisabled(true);
-
-
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-
- mFavouritesMainWindow->setParent(this);
- mFavouritesMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
- setAttribute(Qt::WA_Maemo5StackedWindow, true);
- mFavouritesMainWindow->setWindowFlags(mFavouritesMainWindow->windowFlags() | Qt::Window);
-
-#endif
-
- connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
- connect(ui->addButton,SIGNAL(clicked()),this,SLOT(onAddToPlaylist()));
- connect(ui->playButton,SIGNAL(clicked()),this,SLOT(onPlay()));
- connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
-
- connect(ui->actionGoUserHome, SIGNAL(triggered()), this, SLOT(showUserHomeFolder()));
- connect(ui->actionGoHome, SIGNAL(triggered()), this, SLOT(showHomeFolder()));
- connect(ui->actionSetHome, SIGNAL(triggered()), this, SLOT(setHomeFolder()));
- connect(ui->actionViewFavourites, SIGNAL(triggered()), this, SLOT(showFavourites()));
- connect(ui->actionSetFavourite, SIGNAL(triggered()), this, SLOT(setFavourite()));
-
- connect(this->mFavouritesMainWindow, SIGNAL(browseDirectory(QString)), this, SLOT(browseDirectory(QString)));
-
- init();
-
-
-}
-void BrowseMainWindow::init() // THIS METHOD IS CALLED WHEN CONFIG CHANGED...
-{
- mIp = AppSettings::getCurrentIp(); // AccountDialog::currentIp();
- setHomeDirectory();
-}
-void BrowseMainWindow::setHomeDirectory()
-{
- mCurrentDir = AppSettings::getHomeDirectory().path;
-}
-void BrowseMainWindow::showCurrentDirectory() // THIS METHOD IS CALLED WHEN WINDOW IS OPENED...
-{
- browseDirectory(mCurrentDir);
-}
-
-BrowseMainWindow::~BrowseMainWindow()
-{
- delete ui;
-}
-
-void BrowseMainWindow::changeEvent(QEvent *e)
-{
- QMainWindow::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void BrowseMainWindow::showHomeFolder() {
- browseDirectory(AppSettings::getHomeDirectory().path);
-}
-void BrowseMainWindow::showUserHomeFolder() {
- browseDirectory("~/");
-}
-void BrowseMainWindow::setHomeFolder() {
- if (0 < mCurrentElement.name.length() && (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type))) {
- VlcDirectory dir;
- dir.name = mCurrentElement.name;
- dir.path = mCurrentElement.path;
- AppSettings::setHomeDirectory(dir);
- }
- else if (0 < mCurrentDir.length()) {
- VlcDirectory dir;
- QString name = mCurrentDir;
- int idx = mCurrentDir.lastIndexOf('/');
- if (0 > idx) idx = mCurrentDir.lastIndexOf('\\');
- if (0 < idx) {
- name = mCurrentDir.right(mCurrentDir.length() - (idx + 1));
- }
- dir.name = name;
- dir.path = mCurrentDir;
- AppSettings::setHomeDirectory(dir);
- }
-}
-void BrowseMainWindow::showFavourites() {
- mFavouritesMainWindow->show();
- mFavouritesMainWindow->init();
-}
-void BrowseMainWindow::setFavourite() {
- if (0 < mCurrentElement.name.length() && (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type))) {
- VlcDirectory dir;
- dir.name = mCurrentElement.name;
- dir.path = mCurrentElement.path;
- AppSettings::addFavourite(dir);
- }
- else if (0 < mCurrentDir.length()) {
- VlcDirectory dir;
- QString name = mCurrentDir;
- int idx = mCurrentDir.lastIndexOf('/');
- if (0 > idx) idx = mCurrentDir.lastIndexOf('\\');
- if (0 < idx) {
- name = mCurrentDir.right(mCurrentDir.length() - (idx + 1));
- }
- dir.name = name;
- dir.path = mCurrentDir;
- AppSettings::addFavourite(dir);
- }
-}
-
-void BrowseMainWindow::onListSelectionChanged() {
- QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
- if (0 < items.count()) {
- mCurrentElement = getElementFromText(items.at(0)->text());
- // are we up dir?
- if (0 == QString::compare("..", mCurrentElement.name)) {
- ui->browseButton->setDisabled(true);
- ui->playButton->setDisabled(true);
- ui->addButton->setDisabled(true);
- mCurrentDir = mCurrentElement.path;
- browseDirectory(mCurrentDir);
- }
- else {
- // can we browse?
- if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
- ui->browseButton->setDisabled(false);
- }
- else {
- ui->browseButton->setDisabled(true);
- }
- // can we play?
- ui->playButton->setDisabled(false);
- // can we playlist?
- ui->addButton->setDisabled(false);
- }
- }
-}
-
-VlcBrowseElement BrowseMainWindow::getElementFromText(QString text) {
- for (int idx = 0; idx < mContents->count(); ++idx) {
- if (0 == QString::compare(text, mContents->at(idx).name)) {
- return mContents->at(idx);
- }
- }
- return *(new VlcBrowseElement());
-}
-
-void BrowseMainWindow::onBrowse() {
- // check for directory
- if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
- // call browseDirectory
- mCurrentDir = mCurrentElement.path;
- browseDirectory(mCurrentDir);
- }
- else {
- ui->browseButton->setDisabled(true);
- }
-}
-
-void BrowseMainWindow::onAddToPlaylist() {
- QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue");
- url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
- mNetManager->get(QNetworkRequest(url));
- //mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
-}
-
-void BrowseMainWindow::onPlay() {
- QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_play");
- url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
- mNetManager->get(QNetworkRequest(url));
- //mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_play&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
-}
-
-void BrowseMainWindow::browseDirectory(QString dir) {
- if (mFavouritesMainWindow) {
- setParent(this->parentWidget());
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- setAttribute(Qt::WA_Maemo5StackedWindow, true);
-#endif
- mFavouritesMainWindow->hide();
- }
- mResponse.clear();
- QUrl url = QUrl("http://"+mIp+"/requests/browse.xml");
- url.addEncodedQueryItem(QByteArray("dir"), QUrl::toPercentEncoding(dir));
- QNetworkReply * reply = mNetManager->get(QNetworkRequest(url));
- //QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir.replace("&", "%26").replace("\\", "\\\\"))));
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
-#endif
- connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
- connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
- connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
-}
-void BrowseMainWindow::error(QNetworkReply::NetworkError code) {
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
-#endif
- qDebug() << code;
-}
-void BrowseMainWindow::readReady() {
- QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
- // append to buffer
- mResponse += reply->readAll();
-}
-void BrowseMainWindow::finished(QNetworkReply * reply) {
- // now we can call parseXmlDirectory to process the full buffers
- this->parseXmlDirectory();
- // only interested in finished signals
- disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
-#endif
- delete reply;
-}
-void BrowseMainWindow::parseXmlDirectory() {
- QDomDocument doc;
- doc.setContent(this->mResponse);
- QDomElement docElem = doc.documentElement();
- QDomNodeList elements = docElem.elementsByTagName("element");
- // we can sort by folders then files alphabetically by running to lists and appending them at the end
- // vlc alpha sorts everything in the incoming stream, we just need to seperate files from folders.
- if (0 < elements.count()) {
- QList<VlcBrowseElement>* files = new QList<VlcBrowseElement>();
- int idx = 0;
- mContents->clear();
- do {
- QDomNode node = elements.at(idx);
- VlcBrowseElement* dir = new VlcBrowseElement();
- dir->type = node.attributes().namedItem("type").nodeValue();
- dir->size = node.attributes().namedItem("size").nodeValue().toInt();
- dir->date = QDate::fromString(node.attributes().namedItem("date").nodeValue());
- dir->path = node.attributes().namedItem("path").nodeValue();
- dir->name = node.attributes().namedItem("name").nodeValue();
- dir->extension = getExtension(dir->path, node.attributes().namedItem("extension").nodeValue());
- ++idx;
- if (0 != QString::compare("directory", dir->type) && 0 != QString::compare("dir", dir->type)) {
- files->append(*dir);
- }
- else if (0 == QString::compare("..", dir->name)) {
- this->mContents->prepend(*dir);
- }
- else {
- this->mContents->append(*dir);
- }
- delete dir;
- } while (idx < elements.count());
- if (0 < files->count()) {
- mContents->append(*files);
- }
- delete files;
- // Update UI
- this->updateList();
- }
- else {
- // alert user of error / empty directory
- qDebug() << "can't browse dir: " << mCurrentDir;
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- QMaemo5InformationBox::information(this, tr("Directory could not be browsed!"), QMaemo5InformationBox::DefaultTimeout);
-#endif
- }
- mResponse.clear();
-
-}
-
-QString BrowseMainWindow::getExtension(QString path, QString extension) {
- // return extension if exists
- if (!extension.isNull() && !extension.isEmpty()) return extension;
- // return blank if no path
- if (path.isNull() || path.isEmpty()) return "";
- // otherwise extract the extension
- int dot_pos = path.lastIndexOf('.');
- if (0 < dot_pos) {
- return path.right(path.length() - (dot_pos + 1));
- }
- else { // no dot
- return "";
- }
-}
-
-void BrowseMainWindow::updateList() {
- ui->listWidget->clear();
- int ct = this->mContents->count();
- if (0 < ct) {
- QIcon icon_up = QIcon::fromTheme("filemanager_folder_up");
- QIcon icon_folder = QIcon::fromTheme("general_folder");
- QIcon icon_audio = QIcon::fromTheme("general_audio_file");
- QIcon icon_video = QIcon::fromTheme("general_video_file");
- QIcon icon_image = QIcon::fromTheme("general_image");
- QIcon icon_flash = QIcon::fromTheme("filemanager_flash_file");
- QIcon icon_real = QIcon::fromTheme("filemanager_real_music");
- QIcon icon_playl = QIcon::fromTheme("filemanager_playlist");
- QIcon icon_unknown= QIcon::fromTheme("filemanager_unknown_file");
- for (int idx = 0; idx < ct; ++idx) {
- VlcBrowseElement dir = mContents->at(idx);
- QListWidgetItem* item;
- bool item_good = false;
- if (0 == QString::compare("directory", dir.type) || 0 == QString::compare("dir", dir.type)) {
- if (0 == QString::compare("..", dir.name)) {
- item = new QListWidgetItem(icon_up, dir.name, ui->listWidget, 0);
- item_good = true;
- }
- else {
- item = new QListWidgetItem(icon_folder, dir.name, ui->listWidget, 0);
- item_good = true;
- }
- }
- else if (0 == QString::compare("file", dir.type)) {
- if ( 0 == QString::compare(dir.extension, "jpg") ||
- 0 == QString::compare(dir.extension, "jpeg") ||
- 0 == QString::compare(dir.extension, "gif") ||
- 0 == QString::compare(dir.extension, "png") ||
- 0 == QString::compare(dir.extension, "bmp") ) {
- item_good = true;
- item = new QListWidgetItem(icon_image, dir.name, ui->listWidget, 0); // .jpg, .jpeg, .gif, .png, .bmp
- }
- else if ( 0 == QString::compare(dir.extension, "mp3") ||
- 0 == QString::compare(dir.extension, "m4a") ||
- 0 == QString::compare(dir.extension, "ogg") ||
- 0 == QString::compare(dir.extension, "oga") ||
- 0 == QString::compare(dir.extension, "wav") ||
- 0 == QString::compare(dir.extension, "flac") ) {
- item_good = true;
- item = new QListWidgetItem(icon_audio, dir.name, ui->listWidget, 0); // .mp3, .m4a, .ogg, .oga, .wav, .flac
- }
- else if ( 0 == QString::compare(dir.extension, "m3u") ||
- 0 == QString::compare(dir.extension, "wpl") ||
- 0 == QString::compare(dir.extension, "pls") ||
- 0 == QString::compare(dir.extension, "asx") ||
- 0 == QString::compare(dir.extension, "xspf") ||
- 0 == QString::compare(dir.extension, "cmml") ) {
- item_good = true;
- item = new QListWidgetItem(icon_playl, dir.name, ui->listWidget, 0); // .m3u, .wpl, .pls, .asx, .xspf, .cmml
- }
- else if ( 0 == QString::compare(dir.extension, "avi") ||
- 0 == QString::compare(dir.extension, "mpeg") ||
- 0 == QString::compare(dir.extension, "mpg") ||
- 0 == QString::compare(dir.extension, "mov") ||
- 0 == QString::compare(dir.extension, "mp4") ||
- 0 == QString::compare(dir.extension, "m4v") ||
- 0 == QString::compare(dir.extension, "wmv") ||
- 0 == QString::compare(dir.extension, "mkv") ||
- 0 == QString::compare(dir.extension, "ogv") ) {
- item_good = true;
- item = new QListWidgetItem(icon_video, dir.name, ui->listWidget, 0); // .avi, .mpg, .mpeg, .mov, .mp4, .m4v, .wmv, .mkv, .ogv
- }
- else if ( 0 == QString::compare(dir.extension, "rm") ||
- 0 == QString::compare(dir.extension, "ra") ||
- 0 == QString::compare(dir.extension, "ram") ) {
- item = new QListWidgetItem(icon_real, dir.name, ui->listWidget, 0); // .ram, 'rm, 'ra
- }
- else if ( 0 == QString::compare(dir.extension, "flv") ) {
- item_good = true;
- item = new QListWidgetItem(icon_flash, dir.name, ui->listWidget, 0); // .flv
- }
- else {
- if (dir.name.startsWith("Flash")) {
- item_good = true;
- item = new QListWidgetItem(icon_flash, dir.name, ui->listWidget, 0);
- }
- else {
- item_good = false;
- //item = new QListWidgetItem(icon_unknown, dir.name, ui->listWidget, 0);
- }
- }
- }
- if (item_good) {
- ui->listWidget->addItem(item);
- }
- // other types ignored
- }
- }
-}
-
-
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef BROWSEMAINWINDOW_H
-#define BROWSEMAINWINDOW_H
-
-#include <QMainWindow>
-#include <QtNetwork>
-#include <QtXml>
-#include <QListWidgetItem>
-#include "vlcbrowseelement.h"
-#include "favouritesmainwindow.h"
-
-namespace Ui {
- class BrowseMainWindow;
-}
-
-class BrowseMainWindow : public QMainWindow {
- Q_OBJECT
-public:
- explicit BrowseMainWindow(QWidget *parent = 0);
- ~BrowseMainWindow();
-
-public slots:
- void init();
- void browseDirectory(QString);
- void onBrowse();
- void onPlay();
- void onAddToPlaylist();
- void onListSelectionChanged();
- void finished(QNetworkReply * reply);
- void readReady();
- void error(QNetworkReply::NetworkError code);
- void showCurrentDirectory();
- void setHomeFolder();
- void showHomeFolder();
- void showUserHomeFolder();
- void setFavourite();
- void showFavourites();
- void setHomeDirectory();
-
-protected slots:
- void parseXmlDirectory();
- void updateList();
-
-protected:
- void changeEvent(QEvent *e);
- VlcBrowseElement getElementFromText(QString text);
- QString getExtension(QString path, QString extension);
-
-private:
- Ui::BrowseMainWindow *ui;
- FavouritesMainWindow *mFavouritesMainWindow;
- QNetworkAccessManager * mNetManager;
- QString mCurrentDir;
- QString mIp;
- QList<VlcBrowseElement>* mContents;
- VlcBrowseElement mCurrentElement;
- QByteArray mResponse;
-};
-
-#endif // BROWSEMAINWINDOW_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>BrowseMainWindow</class>
- <widget class="QMainWindow" name="BrowseMainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QListWidget" name="listWidget">
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="playButton">
- <property name="text">
- <string>Play</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="addButton">
- <property name="text">
- <string>Enqueue</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="browseButton">
- <property name="text">
- <string>Browse</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>27</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuMenu">
- <property name="title">
- <string>menu</string>
- </property>
- </widget>
- <addaction name="actionGoUserHome"/>
- <addaction name="actionGoHome"/>
- <addaction name="actionSetHome"/>
- <addaction name="actionViewFavourites"/>
- <addaction name="actionSetFavourite"/>
- </widget>
- <action name="actionGoUserHome">
- <property name="text">
- <string>User Folder</string>
- </property>
- </action>
- <action name="actionGoHome">
- <property name="text">
- <string>Home</string>
- </property>
- </action>
- <action name="actionSetHome">
- <property name="text">
- <string>Set as Home</string>
- </property>
- </action>
- <action name="actionViewFavourites">
- <property name="text">
- <string>Favourites</string>
- </property>
- </action>
- <action name="actionSetFavourite">
- <property name="text">
- <string>Add to Favourite</string>
- </property>
- </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "configdialog.h"
-#include "ui_configdialog.h"
-#include <QSettings>
-
-ConfigDialog::ConfigDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::ConfigDialog)
-{
- ui->setupUi(this);
- load();
- connect(ui->buttonBox,SIGNAL(accepted()),this,SLOT(save()));
-}
-
-ConfigDialog::~ConfigDialog()
-{
- delete ui;
-}
-
-void ConfigDialog::changeEvent(QEvent *e)
-{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-void ConfigDialog::load()
-{
- QSettings settings;
- ui->lineEdit->setText(settings.value("ip").toString());
-
-}
-
-void ConfigDialog::save()
-{
-
- QSettings settings;
- settings.setValue("ip",ui->lineEdit->text());
-
- emit accept();
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef CONFIGDIALOG_H
-#define CONFIGDIALOG_H
-
-#include <QDialog>
-
-namespace Ui {
- class ConfigDialog;
-}
-
-class ConfigDialog : public QDialog {
- Q_OBJECT
-public:
- explicit ConfigDialog(QWidget *parent = 0);
- ~ConfigDialog();
-public slots:
-void load();
-void save();
-protected:
- void changeEvent(QEvent *e);
-
-private:
- Ui::ConfigDialog *ui;
-};
-
-#endif // CONFIGDIALOG_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ConfigDialog</class>
- <widget class="QDialog" name="ConfigDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>442</width>
- <height>304</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter IP of VLC server. </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Example : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Be sure you have properly configured Vlc</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and allows connection by adding this IP in /vlc/http/.hosts</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">More information on my blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>ConfigDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>295</x>
- <y>284</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "favouritesmainwindow.h"
-#include "ui_favouritesmainwindow.h"
-#include <QSettings>
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-#include <QMaemo5InformationBox>
-#endif
-#include "appsettings.h"
-//#include "browsemainwindow.h"
-
-FavouritesMainWindow::FavouritesMainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::FavouritesMainWindow)
-{
-
- ui->setupUi(this);
-
- setWindowTitle("Vlc remote");
- mCurrentItemIndex = -1;
-
- ui->listWidget->setTextElideMode(Qt::ElideMiddle);
- ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
- ui->deleteButton->setIcon(QIcon::fromTheme("general_delete"));
- ui->editButton->setIcon(QIcon::fromTheme("general_sketch"));
- ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
- ui->saveButton->setIcon(QIcon::fromTheme("notes_save"));
- ui->browseButton->setDisabled(true);
- ui->editButton->setDisabled(true);
- ui->deleteButton->setDisabled(true);
- ui->actionSetHome->setDisabled(true);
- ui->label->setVisible(false);
- ui->lineEdit->setVisible(false);
- ui->saveButton->setVisible(false);
- ui->saveButton->setDisabled(true);
-
- connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
- connect(ui->deleteButton,SIGNAL(clicked()),this,SLOT(onDelete()));
- connect(ui->editButton,SIGNAL(clicked()),this,SLOT(onEdit()));
- connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
- connect(ui->actionSetHome, SIGNAL(triggered()), this, SLOT(setHomeFolder()));
- connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(onEditSave()));
- connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(onLineEditTextChanged(QString)));
-
- init();
-
-
-}
-void FavouritesMainWindow::init() // THIS METHOD IS CALLED WHEN CONFIG CHANGED AND WINDOW SHOWN...
-{
- mFavourites = AppSettings::getFavourites();
- updateList();
-}
-
-FavouritesMainWindow::~FavouritesMainWindow()
-{
- delete mFavourites;
- delete ui;
-}
-
-void FavouritesMainWindow::changeEvent(QEvent *e)
-{
- QMainWindow::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-void FavouritesMainWindow::updateList() {
- ui->listWidget->clear();
- if (NULL != mFavourites && 0 < mFavourites->count()) {
- for (int idx = 0; idx < mFavourites->count(); ++idx) {
- QListWidgetItem* item = new QListWidgetItem(QIcon::fromTheme("imageviewer_favourite"), mFavourites->at(idx).name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + idx);
- ui->listWidget->addItem(item);
- }
- }
-}
-void FavouritesMainWindow::setHomeFolder() {
- if (-1 < mCurrentItemIndex) {
- AppSettings::setHomeDirectory(mCurrentFavourite);
- }
-}
-void FavouritesMainWindow::onListSelectionChanged() {
- ui->label->setVisible(false);
- ui->lineEdit->setVisible(false);
- ui->saveButton->setVisible(false);
- ui->saveButton->setDisabled(true);
- QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
- if (0 < items.count()) {
- mCurrentItemIndex = ui->listWidget->currentIndex().row();
- mCurrentFavourite = mFavourites->at(items.at(0)->type() - LIST_ITEM_TYPE_OFFSET); // Qt reserves types up to 1000, we use an offset beyond that for index tracking. May prove to be too hacky!
- ui->browseButton->setDisabled(false);
- ui->editButton->setDisabled(false);
- ui->deleteButton->setDisabled(false);
- ui->actionSetHome->setDisabled(false);
- }
- else {
- mCurrentItemIndex = -1;
- ui->browseButton->setDisabled(true);
- ui->editButton->setDisabled(true);
- ui->deleteButton->setDisabled(true);
- ui->actionSetHome->setDisabled(true);
- }
-}
-void FavouritesMainWindow::onLineEditTextChanged(QString text) {
- if (0 < text.length()) {
- ui->saveButton->setDisabled(false);
- }
- else {
- ui->saveButton->setDisabled(true);
- }
-}
-void FavouritesMainWindow::onEditSave() {
- if (-1 < mCurrentItemIndex && 0 < ui->lineEdit->text().length()) {
- ui->label->setVisible(false);
- ui->lineEdit->setVisible(false);
- ui->saveButton->setVisible(false);
- ui->saveButton->setDisabled(true);
- AppSettings::deleteFavourite(mCurrentFavourite);
- mCurrentFavourite.name = ui->lineEdit->text();
- AppSettings::addFavourite(mCurrentFavourite);
- ui->lineEdit->setText("");
- ui->listWidget->itemAt(mCurrentItemIndex, 0)->setText(mCurrentFavourite.name);
- init();
- }
-}
-void FavouritesMainWindow::onEdit() {
- if (-1 < mCurrentItemIndex) {
- ui->label->setVisible(true);
- ui->lineEdit->setVisible(true);
- ui->saveButton->setVisible(true);
- ui->saveButton->setDisabled(false);
- ui->lineEdit->setText(mCurrentFavourite.name);
- ui->browseButton->setDisabled(true);
- ui->editButton->setDisabled(true);
- ui->deleteButton->setDisabled(true);
- }
-}
-void FavouritesMainWindow::onBrowse() {
- if (-1 < mCurrentItemIndex) {
- emit browseDirectory(mCurrentFavourite.path);
- //this->close();
- //((BrowseMainWindow *)this->parent())->browseDirectory(mCurrentFavourite.path);
- }
-}
-void FavouritesMainWindow::onDelete() {
- if (-1 < mCurrentItemIndex) {
- AppSettings::deleteFavourite(mCurrentFavourite);
- init();
- }
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef FAVOURITESMAINWINDOW_H
-#define FAVOURITESMAINWINDOW_H
-
-#include <QMainWindow>
-#include <QtNetwork>
-#include <QtXml>
-#include <QListWidgetItem>
-#include "appsettings.h"
-
-#ifndef LIST_ITEM_TYPE_OFFSET
-#define LIST_ITEM_TYPE_OFFSET 1000
-#endif
-
-namespace Ui {
- class FavouritesMainWindow;
-}
-
-class FavouritesMainWindow : public QMainWindow {
- Q_OBJECT
-public:
- explicit FavouritesMainWindow(QWidget *parent = 0);
- ~FavouritesMainWindow();
-
-public slots:
- void init();
- void onListSelectionChanged();
- void onLineEditTextChanged(QString text);
- void onBrowse();
- void onEdit();
- void onDelete();
- void setHomeFolder();
- void onEditSave();
-
-protected slots:
-
-signals:
- void browseDirectory(QString path);
-
-protected:
- void changeEvent(QEvent *e);
- void updateList();
-
-private:
- Ui::FavouritesMainWindow *ui;
- int mCurrentItemIndex;
- QList<VlcDirectory>* mFavourites;
- VlcDirectory mCurrentFavourite;
-};
-
-#endif // FAVOURITESMAINWINDOW_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>FavouritesMainWindow</class>
- <widget class="QMainWindow" name="FavouritesMainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>798</width>
- <height>598</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QListWidget" name="listWidget"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="saveButton">
- <property name="text">
- <string>Save</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="deleteButton">
- <property name="text">
- <string>Delete</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editButton">
- <property name="text">
- <string>Edit</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="browseButton">
- <property name="text">
- <string>Browse</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>798</width>
- <height>20</height>
- </rect>
- </property>
- <addaction name="actionSetHome"/>
- </widget>
- <action name="actionSetHome">
- <property name="text">
- <string>Set as Home</string>
- </property>
- </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include <QtGui/QApplication>
-#include <QSettings>
-#include <QLocale>
-#include <QTextCodec>
-#include <QTranslator>
-#include <QDebug>
-#include "playermainwindow.h"
-#include "appsettings.h"
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
-
- QCoreApplication::setOrganizationName("Omed");
- QCoreApplication::setOrganizationDomain("medsoft.blogspot.com/");
- QCoreApplication::setApplicationName("Maemo VLC remote");
-
- QString locale = QLocale::system().name();
- QTranslator translator;
- translator.load(QString(":/languages/vlcremote_") + locale);
- a.installTranslator(&translator);
-
- QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
-
-
- qDebug() << AppSettings::getCurrentIp();
-
-
- PlayerMainWindow * mainwindow = new PlayerMainWindow;
-
- //mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
- //mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
- //mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
-
- mainwindow->showMaximized();
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- Orientation o = AppSettings::getOrientation();
- switch (o) {
- case AUTO_ROTATE:
- mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- break;
- case LANDSCAPE:
- mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
- break;
- case PORTRAIT:
- mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
- break;
- default:
- mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- break;
- }
-#endif
- return a.exec();
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "newaccountdialog.h"
-#include <QFormLayout>
-#include <QDebug>
-#include <QSettings>
-//#include <QMaemo5InformationBox>
-
-NewAccountDialog::NewAccountDialog(QWidget *parent)
-{
- Q_UNUSED(parent);
- this->setWindowTitle(tr("Add account"));
-
- mKeyLineEdit = new QLineEdit;
- mIpLineEdit = new QLineEdit;
- mPortLineEdit = new QLineEdit;
- mPortLineEdit->setText("8080");
- mPortLineEdit->setReadOnly(false);
-
- mButtonBox = new QDialogButtonBox;
- mButtonBox->addButton(QDialogButtonBox::Save);
- mButtonBox->addButton(QDialogButtonBox::Cancel);
-
- connect(mButtonBox, SIGNAL(accepted()), this, SLOT(save()));
- connect(mButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
-
- QFormLayout *layout = new QFormLayout;
- layout->expandingDirections();
- layout->addRow(tr("Name:"), mKeyLineEdit);
- layout->addRow(tr("Ip:"), mIpLineEdit);
- layout->addRow(tr("Port:"), mPortLineEdit);
- layout->addWidget(mButtonBox);
-
- setLayout(layout);
-}
-
-void NewAccountDialog::save()
-{
- QString myKey = mKeyLineEdit->text();
- QString myIp = mIpLineEdit->text();
- QString myPort = mPortLineEdit->text();
-
- QSettings settings;
- settings.beginGroup("account");
- if (!mEditKey.isEmpty()) {
- settings.remove(mEditKey);
- }
-
- if (!myIp.isEmpty() && !myKey.isEmpty()) {
- if (myPort.isEmpty()) {
- myPort = "8080";
- }
- settings.setValue(myKey, myIp+":"+myPort);
- // Rajouter des tests pour vérifier qu'on est sur Maemo
- //QMaemo5InformationBox::information(this, tr("Account saved"), QMaemo5InformationBox::DefaultTimeout);
- }
- settings.endGroup();
-
- emit accept();
-}
-
-void NewAccountDialog::edit(QString &key, QString &ip)
-{
- Q_UNUSED(ip);
- this->setWindowTitle(tr("Edit account"));
-
- QSettings settings;
- settings.beginGroup("account");
- QString value = settings.value(key).toString();
- settings.endGroup();
-
- QStringList values = value.split(":");
-
- mEditKey = key;
- mEditIp = values.first();
- mEditPort = values.last();
-
- mKeyLineEdit->setText(mEditKey);
- mKeyLineEdit->setDisabled(true);
- mIpLineEdit->setText(mEditIp);
- mPortLineEdit->setText(mEditPort);
-}
-
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef NEWACCOUNTDIALOG_H
-#define NEWACCOUNTDIALOG_H
-
-#include <QDialog>
-#include <QLineEdit>
-#include <QLabel>
-#include <QDialogButtonBox>
-
-class NewAccountDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit NewAccountDialog(QWidget *parent = 0);
- void edit(QString &key, QString &ip);
-
-public slots:
- void save();
-
-private:
- QLineEdit *mKeyLineEdit;
- QLineEdit *mIpLineEdit;
- QLineEdit *mPortLineEdit;
- QPushButton *mSavePushButton;
- QPushButton *mCancelPushButton;
- QDialogButtonBox *mButtonBox;
-
- QString mEditKey;
- QString mEditIp;
- QString mEditPort;
-};
-
-#endif // NEWACCOUNTDIALOG_H
+++ /dev/null
- /* VLC-REMOTE for MAEMO 5
- * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * or (at your option) any later version, as published by the Free
- * Software Foundation
- *
- * This program 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 this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
- #include <QDebug>
- #include <QTime>
- #include <QtGui>
- #include "playermainwindow.h"
- #include "ui_playermainwindow.h"
- #include "configdialog.h"
- #include "aboutdialog.h"
- #include "accountdialog.h"
- #include "appsettings.h"
- //#include "vlcstatus.h"
-
- PlayerMainWindow::PlayerMainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::PlayerMainWindow)
- {
- ui->setupUi(this);
- setWindowTitle("Vlc remote");
-
-
-
- mTimer = new QTimer(this);
- mNetManager = new QNetworkAccessManager(this);
- mPlayListMainWindow = new PlayListMainWindow;
- mBrowserMainWindow = new BrowseMainWindow;
-
- mVolume = 100;
- mMuted = false;
-
- mIsLandscape = true;
-
- ui->playlistButton->setIcon(QIcon::fromTheme("notes_bullets"));
- ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
-
- ui->previousButton->setIcon(QIcon::fromTheme("pdf_viewer_first_page"));
- ui->nextButton->setIcon(QIcon::fromTheme("pdf_viewer_last_page"));
- ui->playpauseButton->setIcon(QIcon::fromTheme("camera_playback"));
- ui->stopButton->setIcon(QIcon::fromTheme("camera_video_stop"));
- //ui->pauseButton->setIcon(QIcon::fromTheme("camera_video_pause"));
- ui->fullscreenButton->setIcon(QIcon::fromTheme("general_fullsize"));
- ui->volDown->setIcon(QIcon::fromTheme("statusarea_volumelevel1"));
- ui->volUp->setIcon(QIcon::fromTheme("statusarea_volumelevel4"));
- ui->volMute->setIcon(QIcon::fromTheme("statusarea_volume_mute"));
-
- ui->labelArtPortrait->setVisible(false);
- ui->labelArtLandscape->setVisible(false);
-
- ui->labelTitle->setTextFormat(Qt::RichText);
- ui->labelArtist->setTextFormat(Qt::RichText);
- ui->labelAlbum->setTextFormat(Qt::RichText);
-
-
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-
- mPlayListMainWindow->setParent(this);
- mPlayListMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
- setAttribute(Qt::WA_Maemo5StackedWindow, true);
- mPlayListMainWindow->setWindowFlags(mPlayListMainWindow->windowFlags() | Qt::Window);
-
- mBrowserMainWindow->setParent(this);
- mBrowserMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
- setAttribute(Qt::WA_Maemo5StackedWindow, true);
- mBrowserMainWindow->setWindowFlags(mBrowserMainWindow->windowFlags() | Qt::Window);
-
- connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
-
- #endif
-
- connect(mTimer,SIGNAL(timeout()),this,SLOT(askStatus()));
- connect(ui->actionConfiguration,SIGNAL(triggered()),this,SLOT(showConfig()));
- connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout()));
- connect(ui->actionPortrait,SIGNAL(triggered()),this,SLOT(setPortrait()));
- connect(ui->actionLandscape,SIGNAL(triggered()),this,SLOT(setLandscape()));
- connect(ui->actionAutoRotate,SIGNAL(triggered()),this,SLOT(setAutoRotate()));
- connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(show()));
- connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(showPlayList()));
- connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(show()));
- connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(showCurrentDirectory()));
-
- connect(ui->playpauseButton,SIGNAL(clicked()),this,SLOT(playpause()));
- connect(ui->stopButton,SIGNAL(clicked()),this,SLOT(stop()));
- connect(ui->previousButton,SIGNAL(clicked()),this,SLOT(previous()));
- connect(ui->nextButton,SIGNAL(clicked()),this,SLOT(next()));
- connect(ui->fullscreenButton,SIGNAL(clicked()),this,SLOT(fullscreen()));
- connect(ui->volUp,SIGNAL(clicked()),this,SLOT(volUp()));
- connect(ui->volDown,SIGNAL(clicked()),this,SLOT(volDown()));
- connect(ui->volMute,SIGNAL(clicked()),this,SLOT(volMute()));
- connect(ui->slider,SIGNAL(sliderMoved(int)),this,SLOT(slide(int)));
-
- connect(mPlayListMainWindow, SIGNAL(idUpdated(int,bool,QString)), this, SLOT(playlistIdUpdated(int, bool, QString)));
-
-
- // check if last used connection is still valid or showConfig
- QSettings settings;
- QString last_ip = AccountDialog::currentIp();
- if (!last_ip.isNull() && !last_ip.isEmpty()) {
- QTcpSocket * socket = new QTcpSocket;
- if(last_ip.contains(":"))
- {
- QStringList hostSplit = last_ip.split(":");
- QString ip = hostSplit.at(0);
- QString port = hostSplit.at(1);
- socket->connectToHost(ip,port.toInt());
- }
- else {
- socket->connectToHost(last_ip,8080);
- }
- if (!socket->waitForConnected(1000)) {
- showConfig();
- }
- else {
- mIp= last_ip;
-
- mPlayListMainWindow->init();
- mBrowserMainWindow->init();
- mTimer->start(5000);
- askStatus();
- }
- delete socket;
- }
- else {
- showConfig();
- }
-
-
- }
-
-
- PlayerMainWindow::~PlayerMainWindow()
- {
- delete ui;
- }
-
- void PlayerMainWindow::changeEvent(QEvent *e)
- {
- QMainWindow::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
- }
-
- void PlayerMainWindow::setPortrait()
- {
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- AppSettings::setOrientation(PORTRAIT);
- this->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
- #endif
- }
-
- void PlayerMainWindow::setLandscape()
- {
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- AppSettings::setOrientation(LANDSCAPE);
- this->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
- #endif
- }
-
- void PlayerMainWindow::setAutoRotate()
- {
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- AppSettings::setOrientation(AUTO_ROTATE);
- this->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- #endif
- }
-
- void PlayerMainWindow::orientationChanged() {
- QRect screenGeometry = QApplication::desktop()->screenGeometry();
- mIsLandscape = (screenGeometry.width() > screenGeometry.height());
- if (mHasImage) {
- if (mIsLandscape) {
- ui->labelArtPortrait->setVisible(false);
- ui->labelArtLandscape->setVisible(true);
- }
- else {
- ui->labelArtLandscape->setVisible(false);
- ui->labelArtPortrait->setVisible(true);
- }
- }
- else {
- ui->labelArtLandscape->setVisible(false);
- ui->labelArtPortrait->setVisible(false);
- }
- }
-
- void PlayerMainWindow::playpause()
- {
- // NB. There is no guarentee that our current state is the real current state.
- // This is due to the polling frequency and possibility of user interaction directly on the server.
- // Still this is probably better than nothing and our next real poll will set us straight again.
- if (PAUSED == mCurrentStatus.state) {
- mCurrentStatus.state = PLAYING;
- pause();
- updateUiWithCurrentStatus();
- }
- else if (PLAYING == mCurrentStatus.state) {
- mCurrentStatus.state = PAUSED;
- pause();
- updateUiWithCurrentStatus();
- }
- else {
- // could be STOP or UNKNOWN, either way there is no guarentee we will enter a playing state next.
- // So don't update the current state or UI
- // Ideally we would try to find a way to check the current state again but this could lead to an infinite loop!
- play();
- }
- }
- void PlayerMainWindow::play()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_play")));
- }
- void PlayerMainWindow::stop()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_stop")));
- }
- void PlayerMainWindow::pause()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_pause")));
- }
- void PlayerMainWindow::previous()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_previous")));
- }
- void PlayerMainWindow::next()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_next")));
- }
- void PlayerMainWindow::fullscreen()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=fullscreen")));
- }
- void PlayerMainWindow::volUp()
- {
- QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=volume");
- url.addEncodedQueryItem(QByteArray("val"), QByteArray("%2B10"));
- mNetManager->get(QNetworkRequest(url));
- }
- void PlayerMainWindow::volDown()
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val=-10")));
- }
- void PlayerMainWindow::volMute()
- {
- this->mMuted = !this->mMuted;
- if (this->mMuted) {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val=0")));
- }
- else {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val="+QString::number(this->mVolume))));
- }
- }
- void PlayerMainWindow::slide(int value)
- {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=seek&val="+QString::number(value)+"%25")));
- }
-
- void PlayerMainWindow::showConfig()
- {
- mTimer->stop();
- AccountDialog * dialog = new AccountDialog;
- dialog->exec();
-
- mIp= AccountDialog::currentIp();
-
- mPlayListMainWindow->init();
- mBrowserMainWindow->init();
- mTimer->start(5000);
- askStatus();
- }
- void PlayerMainWindow::showAbout()
- {
-
- AboutDialog * dialog = new AboutDialog;
- dialog->exec();
-
- }
-
- void PlayerMainWindow::askStatus()
- {
- //qDebug() << "Status requested. at:" << QTime::currentTime().toString("hh::mm:ss");
- QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml")));
- connect(reply,SIGNAL(readyRead()),this,SLOT(parseXmlStatus()));
- }
-
- void PlayerMainWindow::parseXmlStatus()
- {
- QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
- QDomDocument doc;
- doc.setContent(reply->readAll());
- delete reply;
- QDomElement docElem = doc.documentElement();
- // Get the raw values
- int volume = docElem.namedItem("volume").toElement().text().toInt();
- int length = docElem.namedItem("length").toElement().text().toInt();
- int time = docElem.namedItem("time").toElement().text().toInt();
- int position = docElem.namedItem("position").toElement().text().toInt();
- int random = docElem.namedItem("random").toElement().text().toInt();
- int loop = docElem.namedItem("loop").toElement().text().toInt();
- int repeat = docElem.namedItem("repeat").toElement().text().toInt();
- QString state = docElem.namedItem("state").toElement().text();
- QDomNode infoNode = docElem.namedItem("information");
- QDomNode metaInfoNode = infoNode.namedItem("meta-information");
- QString title = metaInfoNode.namedItem("title").toElement().text().replace("\\\\", "\\");
- // if it's a file style title fix it up
- if (40 < title.length()) {
- if (0 < title.lastIndexOf("\\")) {
- title = title.right(title.length() - (title.lastIndexOf("\\") + 1));
- }
- else if (0 < title.lastIndexOf("/")) {
- title = title.right(title.length() - (title.lastIndexOf("/") + 1));
- }
- }
- QString artist = metaInfoNode.namedItem("artist").toElement().text();
- QString album = metaInfoNode.namedItem("album").toElement().text();
- QString now_playing = metaInfoNode.namedItem("now_playing").toElement().text();
- QString art_url = metaInfoNode.namedItem("art_url").toElement().text();
- //metaInfoNode.clear();
- //infoNode.clear();
- //docElem.clear();
- //doc.clear();
- // Populate the current status structure
- // now would be a good time to work out if we are a new track / file or not.
- // key if we are going to look for album art later
- // for now we check length and title this will require further examination later
- mCurrentStatus.newtrack = true;
- if (mCurrentStatus.length == length && !mCurrentStatus.title.isNull() && 0 == QString::compare(mCurrentStatus.title, title)) {
- mCurrentStatus.newtrack = false;
- }
- mCurrentStatus.volume = volume;
- mCurrentStatus.length = length;
- mCurrentStatus.time = time;
- mCurrentStatus.position = position;
- mCurrentStatus.random = (1 == random);
- mCurrentStatus.loop = (1 == loop);
- mCurrentStatus.repeat = (1 == repeat);
- mCurrentStatus.title = title;
- mCurrentStatus.artist = artist;
- mCurrentStatus.album = album;
- mCurrentStatus.nowplaying = now_playing;
- mCurrentStatus.hasart = (!art_url.isNull() && !art_url.isEmpty());
- if (!state.isNull() && !state.isEmpty()) {
- if (0 == QString::compare("playing", state, Qt::CaseInsensitive)) {
- mCurrentStatus.state = PLAYING;
- }
- else if (0 == QString::compare("paused", state, Qt::CaseInsensitive)) {
- mCurrentStatus.state = PAUSED;
- }
- else if (0 == QString::compare("stop", state, Qt::CaseInsensitive)) {
- mCurrentStatus.state = STOP;
- }
- else {
- mCurrentStatus.state = UNKNOWN;
- }
- }
- else {
- mCurrentStatus.state = UNKNOWN;
- }
- // What's our mute status?
- if (0 < mCurrentStatus.volume) {
- this->mVolume = mCurrentStatus.volume;
- this->mMuted = false;
- }
- else {
- this->mMuted = true;
- }
- // Update the UI
- updateUiWithCurrentStatus();
-
- }
-
- void PlayerMainWindow::updateUiWithCurrentStatus() {
- // position
- QTime timePosition(0,0,0) ;
- timePosition = timePosition.addSecs(mCurrentStatus.time);
-
- ui->timeLabel->setText(timePosition.toString("h:mm:ss"));
-
- // duration
- if (0 < mCurrentStatus.length) {
- QTime timeDuration(0,0,0) ;
- timeDuration = timeDuration.addSecs(mCurrentStatus.length);
-
- ui->durationLabel->setText(timeDuration.toString("h:mm:ss"));
- }
- else {
- ui->durationLabel->setText("0:00:00");
- }
-
-
- if (mCurrentStatus.position >= 0 && mCurrentStatus.position <= 100) {
- ui->slider->blockSignals(true);
- ui->slider->setValue(mCurrentStatus.position);
- ui->slider->blockSignals(false);
- }
-
- ui->labelTitle->setText(mCurrentStatus.title);
- ui->labelArtist->setText(mCurrentStatus.artist);
- ui->labelAlbum->setText(mCurrentStatus.album);
-
- if (PLAYING == mCurrentStatus.state) {
- ui->playpauseButton->setIcon(QIcon::fromTheme("camera_video_pause"));
- }
- else {
- ui->playpauseButton->setIcon(QIcon::fromTheme("camera_playback"));
- }
-
- if (mCurrentStatus.newtrack) {
- // potential actions:
- // rebuild display layout
- // retrieve album art
- mHasImage = false;
- QTimer::singleShot(500, mPlayListMainWindow, SLOT(requestPlayList()));
- }
- // Update the buttons on the playlist window
- if (NULL != this->mPlayListMainWindow) {
- this->mPlayListMainWindow->updateUiWithCurrentStatus(& mCurrentStatus);
- }
-
- }
- void PlayerMainWindow::playlistIdUpdated(int id, bool hasart, QString extension) {
- Q_UNUSED(extension);
- if (hasart) {
- getCoverArt(id);
- }
- else {
- ui->labelArtLandscape->setVisible(false);
- ui->labelArtPortrait->setVisible(false);
- // could use a default graphic from extension here!
- // setCoverArtFromPixmap();
- }
- }
- void PlayerMainWindow::error(QNetworkReply::NetworkError code) {
- qDebug() << "Error Code: " << code;
- }
- void PlayerMainWindow::readReady() {
- QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
- // append to buffer
- mResponse += reply->readAll();
- }
- void PlayerMainWindow::finished(QNetworkReply * reply) {
- // now we can call setCoverArt to process the full buffers
- this->setCoverArt(mResponse);
- // only interested in finished signals
- disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
- delete reply;
- }
- void PlayerMainWindow::getCoverArt(int id) {
- qDebug() << "getCoverArt id=!" << id;
- mResponse.clear();
- QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/art?id=" + QString::number(id))));
- connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
- connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
- connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
-
- }
- void PlayerMainWindow::setCoverArt(const QByteArray data) {
- QPixmap* image = new QPixmap();
- if (image->loadFromData(data)) {
- mHasImage = true;
- ui->labelArtLandscape->setPixmap(image->scaledToHeight(120, Qt::SmoothTransformation));
- ui->labelArtPortrait->setPixmap(image->scaledToHeight(310, Qt::SmoothTransformation));
- if (mIsLandscape) {
- ui->labelArtPortrait->setVisible(false);
- ui->labelArtLandscape->setVisible(true);
- }
- else {
- ui->labelArtLandscape->setVisible(false);
- ui->labelArtPortrait->setVisible(true);
- }
- }
- else {
- qDebug() << "image load failed!";
- qDebug() << "data.length" << data.length();
- ui->labelArtPortrait->setVisible(false);
- ui->labelArtLandscape->setVisible(false);
- }
- delete image;
- }
- void PlayerMainWindow::setCoverArtFromPixmap(QPixmap image) {
- mHasImage = true;
- ui->labelArtLandscape->setPixmap(image.scaledToHeight(120, Qt::SmoothTransformation));
- ui->labelArtPortrait->setPixmap(image.scaledToHeight(320, Qt::SmoothTransformation));
- if (mIsLandscape) {
- ui->labelArtPortrait->setVisible(false);
- ui->labelArtLandscape->setVisible(true);
- }
- else {
- ui->labelArtLandscape->setVisible(false);
- ui->labelArtPortrait->setVisible(true);
- }
- }
-
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef PLAYERMAINWINDOW_H
-#define PLAYERMAINWINDOW_H
-
-#include <QMainWindow>
-#include <QtNetwork>
-#include <QtXml>
-#include <QTimer>
-#include "playlistmainwindow.h"
-#include "browsemainwindow.h"
-#include "vlcstatus.h"
-
-namespace Ui {
- class PlayerMainWindow;
-}
-
-class PlayerMainWindow : public QMainWindow {
- Q_OBJECT
-public:
- explicit PlayerMainWindow(QWidget *parent = 0);
- ~PlayerMainWindow();
-
-public slots:
- void askStatus();
- void showConfig();
- void showAbout();
- void play();
- void playpause();
- void stop();
- void pause();
- void previous();
- void next();
- void fullscreen();
- void volUp();
- void volDown();
- void volMute();
- void slide(int value);
- void updateUiWithCurrentStatus();
- void setCoverArt(const QByteArray data);
- void setCoverArtFromPixmap(QPixmap image);
- void getCoverArt(int id);
- void finished(QNetworkReply * reply);
- void error(QNetworkReply::NetworkError code);
- void readReady();
- void orientationChanged();
- void setPortrait();
- void setLandscape();
- void setAutoRotate();
- void playlistIdUpdated(int id, bool hasart, QString extension);
-
-
-protected slots:
- void parseXmlStatus();
-protected:
- void changeEvent(QEvent *e);
-
-
-private:
- Ui::PlayerMainWindow *ui;
- PlayListMainWindow * mPlayListMainWindow;
- BrowseMainWindow * mBrowserMainWindow;
- QNetworkAccessManager * mNetManager;
- QString mIp;
- QTimer * mTimer;
- int mVolume;
- int mMuted;
- VlcStatus mCurrentStatus;
- QByteArray mResponse;
- bool mIsLandscape;
- bool mHasImage;
-
-};
-
-#endif // PLAYERMAINWINDOW_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PlayerMainWindow</class>
- <widget class="QMainWindow" name="PlayerMainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>796</width>
- <height>631</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Vlc-Remote</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="labelArtPortrait">
- <property name="minimumSize">
- <size>
- <width>380</width>
- <height>350</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>380</width>
- <height>350</height>
- </size>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayoutDetails">
- <item>
- <layout class="QVBoxLayout" name="verticalLayoutDetails">
- <item>
- <widget class="QLabel" name="labelTitle">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>30</height>
- </size>
- </property>
- <property name="text">
- <string>Information</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="labelArtist">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>30</height>
- </size>
- </property>
- <property name="text">
- <string>Information</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="labelAlbum">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>30</height>
- </size>
- </property>
- <property name="text">
- <string>Information</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="labelArtLandscape">
- <property name="minimumSize">
- <size>
- <width>140</width>
- <height>140</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>140</width>
- <height>140</height>
- </size>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>100</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayoutTime">
- <item>
- <widget class="QLabel" name="timeLabel">
- <property name="styleSheet">
- <string notr="true">color: rgb(201, 201, 201);</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="durationLabel">
- <property name="styleSheet">
- <string notr="true">color: rgb(201, 201, 201);</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QSlider" name="slider">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QToolButton" name="previousButton">
- <property name="text">
- <string><</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="playpauseButton">
- <property name="text">
- <string>Play/Pause</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="nextButton">
- <property name="text">
- <string>></string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="stopButton">
- <property name="text">
- <string>Stop</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer1">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="fullscreenButton">
- <property name="text">
- <string>FS</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="volUp">
- <property name="text">
- <string>V+</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="volDown">
- <property name="text">
- <string>V-</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="volMute">
- <property name="text">
- <string>Mute</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QPushButton" name="playlistButton">
- <property name="text">
- <string>PlayList</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="browseButton">
- <property name="text">
- <string>Browse</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>796</width>
- <height>20</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuMenu">
- <property name="title">
- <string>menu</string>
- </property>
- <addaction name="actionConfiguration"/>
- <addaction name="actionAbout"/>
- <addaction name="actionPortrait"/>
- <addaction name="actionLandscape"/>
- <addaction name="actionAutoRotate"/>
- </widget>
- <addaction name="menuMenu"/>
- </widget>
- <action name="actionConfiguration">
- <property name="text">
- <string>Configuration</string>
- </property>
- </action>
- <action name="actionAbout">
- <property name="text">
- <string>About</string>
- </property>
- </action>
- <action name="actionPortrait">
- <property name="text">
- <string>Portrait Mode</string>
- </property>
- </action>
- <action name="actionLandscape">
- <property name="text">
- <string>Landscape Mode</string>
- </property>
- </action>
- <action name="actionAutoRotate">
- <property name="text">
- <string>Auto Rotate</string>
- </property>
- </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
- * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * or (at your option) any later version, as published by the Free
- * Software Foundation
- *
- * This program 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 this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-#include "playlistmainwindow.h"
-#include "ui_playlistmainwindow.h"
-#include <QPushButton>
-#include <QSettings>
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-#include <QMaemo5InformationBox>
-#endif
-#include "configdialog.h"
-#include "aboutdialog.h"
-#include "appsettings.h"
-//#include "vlcstatus.h"
-
-PlayListMainWindow::PlayListMainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::PlayListMainWindow)
-{
-
- ui->setupUi(this);
- mTimer = new QTimer(this);
- setWindowTitle("Vlc remote");
-
- mCurrentDepth = 0;
- mCurrentVlcIndex = 0;
-
-
- mNetManager = new QNetworkAccessManager(this);
-
- mContents = new QList<VlcPlayListElementSimple>();
-
- ui->listWidget->setTextElideMode(Qt::ElideLeft);
- ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
- ui->playButton->setIcon(QIcon::fromTheme("camera_playback"));
- ui->clearButton->setIcon(QIcon::fromTheme("general_delete"));
- ui->shuffleButton->setIcon(QIcon::fromTheme("mediaplayer_default_shuffle"));
- ui->loopButton->setIcon(QIcon::fromTheme("general_refresh"));
- ui->repeatButton->setIcon(QIcon::fromTheme("general_redo"));
- ui->removeButton->setIcon(QIcon::fromTheme("general_close"));
-
- ui->clearButton->setDisabled(false);
- ui->shuffleButton->setDisabled(false);
- ui->loopButton->setDisabled(false);
- ui->repeatButton->setDisabled(false);
- ui->removeButton->setDisabled(true);
- ui->playButton->setDisabled(true);
-
- connect(ui->playButton,SIGNAL(clicked()),this,SLOT(onPlay()));
- connect(ui->removeButton,SIGNAL(clicked()),this,SLOT(onRemove()));
- connect(ui->repeatButton,SIGNAL(clicked()),this,SLOT(onRepeat()));
- connect(ui->loopButton,SIGNAL(clicked()),this,SLOT(onLoop()));
- connect(ui->shuffleButton,SIGNAL(clicked()),this,SLOT(onShuffle()));
- connect(ui->clearButton,SIGNAL(clicked()),this,SLOT(onClear()));
- connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
-
- init();
-
-}
-void PlayListMainWindow::init() // CALL WHEN CONFIG CHANGES
-{
- mIp = AppSettings::getCurrentIp(); // AccountDialog::currentIp();
-}
-void PlayListMainWindow::showPlayList() // CALL WHEN SHOWN
-{
- requestPlayList();
-}
-
-PlayListMainWindow::~PlayListMainWindow()
-{
- delete ui;
-}
-
-void PlayListMainWindow::changeEvent(QEvent *e)
-{
- QMainWindow::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void PlayListMainWindow::onListSelectionChanged() {
- QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
- if (0 < items.count()) {
- // TODO VLC doesn't seem to support removing nodes!
- // Playing nodes works fine, however.
- // should check to see if it is a leaf or not and disable the remove button
- mCurrentVlcIndex = items.at(0)->type() - LIST_ITEM_TYPE_OFFSET; // Qt reserves types up to 1000, we use an offset beyond that for index tracking. May prove to be too hacky!
- mCurrentElement = getElementFromId(mCurrentVlcIndex);
- if (0 == QString::compare("node", mCurrentElement.type)) {
- ui->removeButton->setDisabled(true);
- ui->playButton->setDisabled(false);
- }
- else {
- ui->removeButton->setDisabled(false);
- ui->playButton->setDisabled(false);
- }
- }
- else {
- mCurrentVlcIndex = 0;
- ui->removeButton->setDisabled(true);
- ui->playButton->setDisabled(true);
- }
-}
-
-void PlayListMainWindow::onRemove() {
- if (0 < this->mCurrentVlcIndex) {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_delete&id=" + QString::number(this->mCurrentVlcIndex))));
- //connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
- // don't refresh just clear the item!
- delete ui->listWidget->takeItem(ui->listWidget->currentRow());
- }
-}
-void PlayListMainWindow::onPlay() {
- if (0 < this->mCurrentVlcIndex) {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_play&id=" + QString::number(this->mCurrentVlcIndex))));
- }
-}
-void PlayListMainWindow::onRepeat() {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_repeat")));
-}
-void PlayListMainWindow::onLoop() {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_loop")));
-}
-void PlayListMainWindow::onShuffle() {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_random")));
-}
-void PlayListMainWindow::onClear() {
- mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_empty")));
- mContents->clear();
- ui->listWidget->clear();
- //connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
-}
-void PlayListMainWindow::requestPlayList() {
- mResponse.clear();
- ui->removeButton->setDisabled(true);
- ui->playButton->setDisabled(true);
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
-#endif
- QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/playlist.xml")));
- disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
- connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
- connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
- connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
-}
-void PlayListMainWindow::error(QNetworkReply::NetworkError code) {
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
-#endif
- qDebug() << code;
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- QMaemo5InformationBox::information(this, tr("Playlist could not be retrieved."), QMaemo5InformationBox::DefaultTimeout);
-#endif
-}
-void PlayListMainWindow::readReady() {
- QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
- // append to buffer
- mResponse += reply->readAll();
-}
-void PlayListMainWindow::finished(QNetworkReply * reply) {
- // now we can call parseXmlList to process the full buffers
- this->parseXmlPlayList();
- // only interested in finished signals
- disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
-#endif
- delete reply;
-}
-
-void PlayListMainWindow::parseXmlPlayList() {
- mContents->clear();
- QDomDocument doc;
- doc.setContent(this->mResponse);
- QDomElement docElem = doc.documentElement();
- QDomNodeList nodes = docElem.elementsByTagName("node");
- int depth = 0;
-
- int currentLeafId = 0;
- bool hasArt = false;
- QString extension = "";
-
- int ct = nodes.count();
- for (int idx = 0; idx < ct; ++idx) {
- QDomNode node = nodes.at(idx);
- QString current = "";
- //QString name = node.attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
- int id = node.attributes().namedItem("id").nodeValue().toInt();
- if (4 > id && 0 == QString::compare(node.attributes().namedItem("ro").nodeValue(), "ro")) {
- // got the main playlist, let's build it up
- if (node.hasChildNodes()) {
- QDomNodeList leafs = node.childNodes();
- int leafct = leafs.count();
- if (0 < leafct) {
- depth = 1;
- for (int jdx = 0; jdx < leafct; ++jdx) {
- QDomNode leaf = leafs.at(jdx);
- parsePlayListItem(&leaf, &extension, &hasArt, ¤tLeafId, 1);
- }
- }
- }
-
- }
- }
-
- mResponse.clear();
-
- emit this->idUpdated(currentLeafId, hasArt, extension);
- this->updateList();
-
-
-}
-
-
-int PlayListMainWindow::parsePlayListItem(QDomNode *node, QString *extension, bool *hasArt, int *currentLeafId, int depth) {
- int leafCt = 0;
- if (NULL != node) {
- QString current;
- VlcPlayListElementSimple* el = new VlcPlayListElementSimple();
- el->id = node->attributes().namedItem("id").nodeValue().toInt();
- el->path = node->attributes().namedItem("uri").nodeValue();
- el->name = node->attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
- current = node->attributes().namedItem("current").nodeValue();
- el->playing = (0 < current.length());
- el->depth = depth;
- if (0 != QString::compare(node->nodeName(), "node")) {
- el->type = "leaf";
- el->extension = getExtension(el->path, NULL);
- if (el->playing) {
- *currentLeafId = el->id;
- QString art = node->toElement().namedItem("art_url").toElement().text();
- *hasArt = (!art.isNull() && !art.isEmpty());
- *extension = getExtension(el->path, NULL);
- }
- QString title = node->toElement().namedItem("title").toElement().text();
- QString artist = node->toElement().namedItem("artist").toElement().text();
- QString album = node->toElement().namedItem("album").toElement().text();
- if (0 < artist.length() || 0 < album.length()) {
- el->name = "" + title + "\n" + artist + " - " + album;
- }
- this->mContents->append(*el);
- ++leafCt;
- delete el;
- }
- else {
- el->type = "node";
- el->extension = getExtension(el->path, NULL);
- // empty nodes appear in the playlist when they can't be played!
- if (node->hasChildNodes()) {
- this->mContents->append(*el);
- ++leafCt;
- }
- delete el;
- // now parse the child nodes as leaf.
- if (node->hasChildNodes()) {
- QDomNodeList items = node->childNodes();
- int itemct = items.count();
- int added = 0;
- if (0 < itemct) {
- ++depth;
- for (int kdx = 0; kdx < itemct; ++kdx) {
- QDomNode item = items.at(kdx);
- added += parsePlayListItem(&item, extension, hasArt, currentLeafId, depth);
- }
- if (1 > added) {
- // should remove the last PlayListElement
- this->mContents->removeLast();
- --leafCt;
- }
- else {
- leafCt += added;
- }
- }
- }
- }
- }
- return leafCt;
-}
-
-QString PlayListMainWindow::getExtension(QString path, QString extension) {
- // return extension if exists
- if (!extension.isNull() && !extension.isEmpty()) return extension;
- // return blank if no path
- if (path.isNull() || path.isEmpty()) return "";
- // otherwise extract the extension
- int dot_pos = path.lastIndexOf('.');
- if (0 < dot_pos) {
- return path.right(path.length() - (dot_pos + 1));
- }
- else { // no dot
- return "";
- }
-}
-
-VlcPlayListElementSimple PlayListMainWindow::getElementFromId(int id) {
- //if (0 != QString::compare("", text)) {
- for (int idx = 0; idx < mContents->count(); ++idx) {
- if (0 < id && (id == mContents->at(idx).id)) {
- return mContents->at(idx);
- }
- }
- //}
- return *(new VlcPlayListElementSimple());
-}
-
-void PlayListMainWindow::updateList() {
- ui->listWidget->clear();
- int ct = this->mContents->count();
- if (0 < ct) {
- QIcon icon_audio = QIcon::fromTheme("general_audio_file");
- QIcon icon_video = QIcon::fromTheme("general_video_file");
- QIcon icon_image = QIcon::fromTheme("general_image");
- QIcon icon_flash = QIcon::fromTheme("filemanager_flash_file");
- QIcon icon_media = QIcon::fromTheme("filemanager_media_folder");
- QIcon icon_real = QIcon::fromTheme("filemanager_real_music");
- QIcon icon_playl = QIcon::fromTheme("filemanager_playlist");
- QIcon icon_unknown= QIcon::fromTheme("filemanager_unknown_file");
- for (int idx = 0; idx < ct; ++idx) {
- VlcPlayListElementSimple el = mContents->at(idx);
- QListWidgetItem* item;
- if (0 == QString::compare("node", el.type)) {
- item = new QListWidgetItem(icon_media, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
- }
- else {
- if ( 0 == QString::compare(el.extension, "jpg") ||
- 0 == QString::compare(el.extension, "jpeg") ||
- 0 == QString::compare(el.extension, "gif") ||
- 0 == QString::compare(el.extension, "png") ||
- 0 == QString::compare(el.extension, "bmp") ) {
- item = new QListWidgetItem(icon_image, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .jpg, .jpeg, .gif, .png, .bmp
- }
- else if ( 0 == QString::compare(el.extension, "mp3") ||
- 0 == QString::compare(el.extension, "m4a") ||
- 0 == QString::compare(el.extension, "ogg") ||
- 0 == QString::compare(el.extension, "oga") ||
- 0 == QString::compare(el.extension, "wav") ||
- 0 == QString::compare(el.extension, "flac") ) {
- item = new QListWidgetItem(icon_audio, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .mp3, .m4a, .ogg, .oga, .wav, .flac
- }
- else if ( 0 == QString::compare(el.extension, "m3u") ||
- 0 == QString::compare(el.extension, "wpl") ||
- 0 == QString::compare(el.extension, "pls") ||
- 0 == QString::compare(el.extension, "asx") ||
- 0 == QString::compare(el.extension, "xspf") ||
- 0 == QString::compare(el.extension, "cmml") ) {
- item = new QListWidgetItem(icon_playl, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .m3u, .wpl, .pls, .asx, .xspf, .cmml
- }
- else if ( 0 == QString::compare(el.extension, "avi") ||
- 0 == QString::compare(el.extension, "mpeg") ||
- 0 == QString::compare(el.extension, "mpg") ||
- 0 == QString::compare(el.extension, "mov") ||
- 0 == QString::compare(el.extension, "mp4") ||
- 0 == QString::compare(el.extension, "m4v") ||
- 0 == QString::compare(el.extension, "wmv") ||
- 0 == QString::compare(el.extension, "mkv") ||
- 0 == QString::compare(el.extension, "ogv") ) {
- item = new QListWidgetItem(icon_video, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .avi, .mpg, .mpeg, .mov, .m4v, .mp4, .wmv, .mkv, .ogv
- }
- else if ( 0 == QString::compare(el.extension, "rm") ||
- 0 == QString::compare(el.extension, "ra") ||
- 0 == QString::compare(el.extension, "ram") ) {
- item = new QListWidgetItem(icon_real, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .ram, 'rm, 'ra
- }
- else if ( 0 == QString::compare(el.extension, "flv") ) {
- item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
- }
- //else if ( 0 == QString::compare(el.extension, "") ) {
- // item = new QListWidgetItem(icon_unknown, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
- //}
- else {
- if (el.name.contains("Flash")) {
- item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
- }
- else {
- item = new QListWidgetItem(icon_media, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
- }
- }
- }
- item->setSelected(el.playing);
- ui->listWidget->addItem(item);
- if (el.playing) {
- ui->listWidget->scrollToItem(item, QAbstractItemView::PositionAtCenter);
- }
- }
- }
-}
-void PlayListMainWindow::updateUiWithCurrentStatus(VlcStatus * status) {
- ui->loopButton->setChecked(status->loop);
- ui->repeatButton->setChecked(status->repeat);
- ui->shuffleButton->setChecked(status->random);
-}
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef PLAYLISTMAINWINDOW_H
-#define PLAYLISTMAINWINDOW_H
-
-#include <QMainWindow>
-#include <QTimer>
-#include <QtNetwork>
-#include <QtXml>
-#include "vlcplaylistelementsimple.h"
-#include "vlcstatus.h"
-
-#ifndef LIST_ITEM_TYPE_OFFSET
-#define LIST_ITEM_TYPE_OFFSET 1000
-#endif
-
-namespace Ui {
- class PlayListMainWindow;
-}
-
-class PlayListMainWindow : public QMainWindow {
- Q_OBJECT
-public:
- explicit PlayListMainWindow(QWidget *parent = 0);
- ~PlayListMainWindow();
- void init();
-public slots:
- void onClear();
- void onShuffle();
- void onLoop();
- void onPlay();
- void onRepeat();
- void onRemove();
- void requestPlayList();
- void onListSelectionChanged();
- void finished(QNetworkReply * reply);
- void readReady();
- void error(QNetworkReply::NetworkError code);
- void showPlayList();
- void updateUiWithCurrentStatus(VlcStatus * status);
-
-protected slots:
- void parseXmlPlayList();
- void updateList();
- int parsePlayListItem(QDomNode *node, QString *extension, bool *hasArt, int *currentLeafId, int depth);
-
-signals:
- void idUpdated(int id, bool hasArt, QString extension);
-
-protected:
- void changeEvent(QEvent *e);
- VlcPlayListElementSimple getElementFromId(int id);
- QString getExtension(QString path, QString extension);
-
-private:
- Ui::PlayListMainWindow *ui;
- QTimer * mTimer;
- QString mIp;
- QNetworkAccessManager * mNetManager;
- QList<VlcPlayListElementSimple>* mContents;
- VlcPlayListElementSimple mCurrentElement;
- int mCurrentVlcIndex;
- int mCurrentDepth;
- QByteArray mResponse;
-};
-
-#endif // PLAYLISTMAINWINDOW_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PlayListMainWindow</class>
- <widget class="QMainWindow" name="PlayListMainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Playlist</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QListWidget" name="listWidget">
- <item>
- <property name="text">
- <string>not yet done</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>not yet done</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>not yet done</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QToolButton" name="playButton">
- <property name="text">
- <string>Play</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="shuffleButton">
- <property name="text">
- <string>Shuffle</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="loopButton">
- <property name="text">
- <string>Loop</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="repeatButton">
- <property name="text">
- <string>Repeat</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QPushButton" name="clearButton">
- <property name="text">
- <string>Clear all</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="removeButton">
- <property name="text">
- <string>Remove</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>25</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuMenu">
- <property name="title">
- <string>menu</string>
- </property>
- </widget>
- <addaction name="menuMenu"/>
- </widget>
- <action name="actionPortrait">
- <property name="text">
- <string>Portrait Mode</string>
- </property>
- </action>
- <action name="actionLandscape">
- <property name="text">
- <string>Landscape Mode</string>
- </property>
- </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<RCC>
- <qresource prefix="/">
- <file>config-vlc.jpg</file>
- </qresource>
-</RCC>
+++ /dev/null
-<RCC>
- <qresource prefix="/languages">
- <file>vlcremote_fr_FR.qm</file>
- </qresource>
-</RCC>
+++ /dev/null
-#include "scanipdialog.h"
-#include "ui_scanipdialog.h"
-
-ScanIPDialog::ScanIPDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::ScanIPDialog)
-{
- ui->setupUi(this);
-}
-
-ScanIPDialog::~ScanIPDialog()
-{
- delete ui;
-}
-
-void ScanIPDialog::changeEvent(QEvent *e)
-{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
+++ /dev/null
-#ifndef SCANIPDIALOG_H
-#define SCANIPDIALOG_H
-
-#include <QDialog>
-
-namespace Ui {
- class ScanIPDialog;
-}
-
-class ScanIPDialog : public QDialog {
- Q_OBJECT
-public:
- explicit ScanIPDialog(QWidget *parent = 0);
- ~ScanIPDialog();
-
-protected:
- void changeEvent(QEvent *e);
-
-private:
- Ui::ScanIPDialog *ui;
-};
-
-#endif // SCANIPDIALOG_H
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ScanIPDialog</class>
- <widget class="QDialog" name="ScanIPDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>422</width>
- <height>360</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>name</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>IP</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="lineEdit_2"/>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QListWidget" name="listWidget"/>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="pushButton_2">
- <property name="text">
- <string>Scan</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton">
- <property name="text">
- <string>Done</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg2816"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="Maemo_VLC_remote.svg"
+ inkscape:export-filename="/home/eugene/Downloads/likalo/icons/Maemo_VLC_remote.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs2818">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3979">
+ <stop
+ style="stop-color:#e6eff7;stop-opacity:1;"
+ offset="0"
+ id="stop3981" />
+ <stop
+ style="stop-color:#e6eff7;stop-opacity:0;"
+ offset="1"
+ id="stop3983" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3791">
+ <stop
+ style="stop-color:#8b8b8b;stop-opacity:1"
+ offset="0"
+ id="stop3793" />
+ <stop
+ style="stop-color:#050505;stop-opacity:1"
+ offset="1"
+ id="stop3795" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3687">
+ <stop
+ style="stop-color:#f2f2f2;stop-opacity:1;"
+ offset="0"
+ id="stop3689" />
+ <stop
+ style="stop-color:#f2f2f2;stop-opacity:0;"
+ offset="1"
+ id="stop3691" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 32 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="64 : 32 : 1"
+ inkscape:persp3d-origin="32 : 21.333333 : 1"
+ id="perspective2824" />
+ <filter
+ inkscape:collect="always"
+ id="filter3756"
+ x="-0.1344"
+ width="1.2688"
+ y="-0.336"
+ height="1.672">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.68"
+ id="feGaussianBlur3758" />
+ </filter>
+ <inkscape:perspective
+ id="perspective3840"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3687"
+ id="linearGradient3854"
+ gradientUnits="userSpaceOnUse"
+ x1="32"
+ y1="22"
+ x2="32"
+ y2="52.066593"
+ gradientTransform="matrix(1.111111,0,0,1,-3.5555554,-1)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3791"
+ id="linearGradient3865"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="pad"
+ x1="44"
+ y1="-30"
+ x2="48"
+ y2="-32" />
+ <filter
+ inkscape:collect="always"
+ id="filter3949"
+ x="-0.17035383"
+ width="1.3407077"
+ y="-0.045646171"
+ height="1.0912923">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.91101842"
+ id="feGaussianBlur3951" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter3959"
+ x="-0.055835792"
+ width="1.1116716"
+ y="-0.34203537"
+ height="1.6840707">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.11718901"
+ id="feGaussianBlur3961" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter3969">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.32"
+ id="feGaussianBlur3971" />
+ </filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3979"
+ id="radialGradient3987"
+ cx="34.5"
+ cy="32.5"
+ fx="26.331987"
+ fy="28.26091"
+ r="20.5"
+ gradientTransform="matrix(1.0286932,-0.00554309,4.8548147e-4,0.09009624,-1.0056937,29.763108)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3979"
+ id="radialGradient3991"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.62725195,-0.00554309,2.9602529e-4,0.09009624,23.850187,10.763108)"
+ cx="34.5"
+ cy="32.5"
+ fx="26.331987"
+ fy="28.26091"
+ r="20.5" />
+ <filter
+ inkscape:collect="always"
+ id="filter4001"
+ x="-0.024585366"
+ width="1.0491707"
+ y="-1.008"
+ height="3.016">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.42"
+ id="feGaussianBlur4003" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4009"
+ x="-0.624"
+ width="2.248"
+ y="-0.02496"
+ height="1.04992">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.26"
+ id="feGaussianBlur4011" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3687"
+ id="linearGradient4020"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.111111,0,0,1,0.4444446,-1)"
+ x1="32"
+ y1="22"
+ x2="32"
+ y2="52.066593" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3791"
+ id="linearGradient4026"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="pad"
+ x1="44"
+ y1="-30"
+ x2="48"
+ y2="-32"
+ gradientTransform="translate(0,-4)" />
+ <inkscape:perspective
+ id="perspective2875"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3791"
+ id="linearGradient2937"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,-4)"
+ spreadMethod="pad"
+ x1="44"
+ y1="-30"
+ x2="48"
+ y2="-32" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3687"
+ id="linearGradient2939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.111111,0,0,1,0.4444446,-1)"
+ x1="32"
+ y1="22"
+ x2="32"
+ y2="52.066593" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3979"
+ id="radialGradient2941"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.0286932,-0.00554309,4.8548147e-4,0.09009624,-1.0056937,29.763108)"
+ cx="34.5"
+ cy="32.5"
+ fx="26.331987"
+ fy="28.26091"
+ r="20.5" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3979"
+ id="radialGradient2943"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.62725195,-0.00554309,2.9602529e-4,0.09009624,23.850187,10.763108)"
+ cx="34.5"
+ cy="32.5"
+ fx="26.331987"
+ fy="28.26091"
+ r="20.5" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.671875"
+ inkscape:cx="28.015642"
+ inkscape:cy="25.696712"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:snap-global="true"
+ inkscape:window-width="1640"
+ inkscape:window-height="1027"
+ inkscape:window-x="36"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1">
+ <sodipodi:guide
+ orientation="1,0"
+ position="4,52.545455"
+ id="guide2826" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="60,40"
+ id="guide2828" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="31,61"
+ id="guide2830" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="45.454545,4"
+ id="guide2832" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid2836" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata2821">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <g
+ id="g2912"
+ transform="matrix(0.99828455,0,0,1.016587,0.00669673,-0.97863428)"
+ inkscape:export-filename="/home/schutz/programmation/git-vlc-remote/vlc-remote.png"
+ inkscape:export-xdpi="116"
+ inkscape:export-ydpi="116">
+ <path
+ id="path3885"
+ d="m 29.124008,4 -18.030258,49.555556 -6.010086,0 c -0.6536613,0 -1.1798942,0.526232 -1.1798942,1.179894 l 0,1.179894 c 0,0.653661 0.5262329,1.179895 1.1798942,1.179895 l 4.7195768,0 42.4761912,0 4.719576,0 c 0.653661,0 1.179894,-0.526234 1.179894,-1.179895 l 0,-1.179894 c 0,-0.653662 -0.526233,-1.179894 -1.179894,-1.179894 l -6.08383,0 L 32,4 29.124008,4 z"
+ style="fill:#e97f02;stroke:none" />
+ <path
+ sodipodi:nodetypes="cccccccccc"
+ id="path3913"
+ d="M 31,4 34.1875,54 35,57 57.46875,57 c 0.423766,-0.178644 0.71875,-0.603504 0.71875,-1.09375 l 0,-1.15625 c 0,-0.653662 -0.533839,-1.1875 -1.1875,-1.1875 l -6.09375,0 L 32,4 31,4 z"
+ style="fill:#eb6841;stroke:none" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3963"
+ d="M 32,6 48,54 43,54 32,6 z"
+ style="fill:#cc333f;stroke:none;filter:url(#filter3969)" />
+ <path
+ id="rect3908"
+ d="m 3.90625,55.657986 0,0.62145 c 0,0.44824 0.5338387,0.814314 1.1875,0.814314 l 4.71875,0 42.46875,0 4.71875,0 c 0.653661,0 1.1875,-0.366074 1.1875,-0.814314 l 0,-0.62145 -54.28125,0 z"
+ style="fill:#8e6c11;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <path
+ style="fill:#f8ca00;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ d="m 27.562279,9 -1.683727,5 9.579819,0 -1.770816,-5 -6.125276,0 z M 24.165796,19 22.482071,24 39,24 37.229184,19 24.165796,19 z m -3.36745,10 -1.683725,5 23.427008,0 -1.770813,-5 -19.97247,0 z"
+ id="path3906" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3918"
+ d="M 29.053312,6.1001616 16.218589,54 24,54 29.053312,6.1001616 z"
+ style="fill:#f0db92;stroke:none;filter:url(#filter3949)" />
+ <path
+ id="rect3896"
+ d="m 27.961923,9 -1.477687,5 8.407527,0 -1.554119,-5 -5.375721,0 z M 24.981072,19 23.503386,24 38,24 36.445881,19 24.981072,19 z m -2.955373,10 -1.477686,5 20.560224,0 -1.554118,-5 -17.52842,0 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <path
+ id="path3953"
+ d="M 4.9628433,54.177706 10,54.177706 9.779667,55 5,55 4.9628433,54.177706 z"
+ style="fill:#f8ca00;stroke:none;filter:url(#filter3959)" />
+ <g
+ id="g4028">
+ <g
+ id="g2889">
+ <rect
+ transform="matrix(0,1,-1,0,0,0)"
+ ry="2"
+ rx="2"
+ y="-60"
+ x="31"
+ height="48"
+ width="28"
+ id="rect2834"
+ style="fill:url(#linearGradient2937);fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <rect
+ ry="1"
+ rx="1"
+ transform="matrix(0,1,-1,0,0,0)"
+ style="fill:#4a4a4a;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect3610"
+ width="26"
+ height="46"
+ x="32"
+ y="-59" />
+ <rect
+ ry="2"
+ rx="2.181818"
+ y="-58"
+ x="-57"
+ height="44"
+ width="24"
+ id="rect3676"
+ style="fill:#050505;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ transform="matrix(0,-1,-1,0,0,0)" />
+ <rect
+ y="-55"
+ x="-55"
+ height="38"
+ width="20"
+ id="rect3711"
+ style="fill:#303030;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ transform="matrix(0,-1,-1,0,0,0)" />
+ <path
+ id="path3726"
+ d="M 16,34 16,46.21875 56,39.78125 56,34 16,34 z"
+ style="opacity:0.5;fill:url(#linearGradient2939);fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <path
+ style="fill:#69d2e7;fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter3756)"
+ d="m 34,41 0,12 6,-6 -6,-6 z m -13,3 0,5 2,0 0,-5 -2,0 z m 3,0 0,5 2,0 0,-5 -2,0 z m 22,0 0,5 5,0 0,-5 -5,0 z"
+ id="path3742" />
+ <path
+ id="rect3719"
+ d="m 34,41 0,12 6,-6 -6,-6 z m -13,3 0,5 2,0 0,-5 -2,0 z m 3,0 0,5 2,0 0,-5 -2,0 z m 22,0 0,5 5,0 0,-5 -5,0 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <path
+ id="rect3768"
+ d="m 29.125,38 0,17 0.875,0 0,-17 -0.875,0 z M 43,38 l 0,17 0.875,0 0,-17 L 43,38 z"
+ style="fill:#1a1a21;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <rect
+ y="35"
+ x="17"
+ height="1.0000023"
+ width="38"
+ id="rect3867"
+ style="opacity:0.5;fill:#1a1a21;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <rect
+ y="32"
+ x="14"
+ height="1"
+ width="41"
+ id="rect3977"
+ style="opacity:0.5;fill:url(#radialGradient2941);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter4001)" />
+ <rect
+ transform="matrix(0,1,1,0,-0.31017771,0)"
+ style="fill:url(#radialGradient2943);fill-opacity:1;fill-rule:nonzero;stroke:none;filter:url(#filter4009)"
+ id="rect3989"
+ width="25"
+ height="1"
+ x="33"
+ y="13" />
+ <rect
+ y="31.48435"
+ x="17"
+ height="1.5156504"
+ width="6.0000005"
+ id="rect3773"
+ style="fill:#bdbdbd;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <rect
+ y="34"
+ x="16"
+ height="2"
+ width="2"
+ id="rect3713"
+ style="fill:#69d2e7;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "aboutdialog.h"
+#include "ui_aboutdialog.h"
+
+AboutDialog::AboutDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::AboutDialog)
+{
+ ui->setupUi(this);
+}
+
+AboutDialog::~AboutDialog()
+{
+ delete ui;
+}
+
+void AboutDialog::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef ABOUTDIALOG_H
+#define ABOUTDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+ class AboutDialog;
+}
+
+class AboutDialog : public QDialog {
+ Q_OBJECT
+public:
+ explicit AboutDialog(QWidget *parent = 0);
+ ~AboutDialog();
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::AboutDialog *ui;
+};
+
+#endif // ABOUTDIALOG_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application by Sacha schutz </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "accountdialog.h"
+#include "ui_accountdialog.h"
+#include "newaccountdialog.h"
+#include <QDebug>
+#include <QInputDialog>
+#include <QSettings>
+#include <QTcpSocket>
+#include <QFuture>
+#include <QtConcurrentMap>
+
+
+
+QListWidgetItem asyncTestItem(const QListWidgetItem &item)
+{
+
+ QListWidgetItem item2= item;
+ item2.setText("boby");
+
+ return item;
+
+}
+
+
+
+
+AccountDialog::AccountDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::AccountDialog)
+{
+ ui->setupUi(this);
+
+ mFuturWatcher = new QFutureWatcher<QListWidgetItem>(this);
+ connect(mFuturWatcher,SIGNAL(resultReadyAt(int)),this,SLOT(setAsyncItem(int)));
+
+ connect(ui->addButton,SIGNAL(clicked()),this,SLOT(add()));
+ connect(ui->editButton,SIGNAL(clicked()),this,SLOT(edit()));
+ connect(ui->remButton,SIGNAL(clicked()),this,SLOT(rem()));
+ connect(ui->useButton,SIGNAL(clicked()),this,SLOT(use()));
+ connect(ui->listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(enableUi()));
+
+ load();
+
+}
+
+AccountDialog::~AccountDialog()
+{
+ delete ui;
+}
+
+void AccountDialog::add()
+{
+
+ NewAccountDialog *dialog = new NewAccountDialog(this);
+ dialog->exec();
+ load();
+}
+QString AccountDialog::currentIp()
+{
+
+ QSettings settings;
+ QString useKey = settings.value("config/currentKey").toString();
+ QString useIp ;
+ if ( !useKey.isEmpty())
+ useIp = settings.value("account/"+useKey).toString();
+
+ else return QString();
+
+ return useIp;
+}
+
+void AccountDialog::load()
+{
+ ui->editButton->setEnabled(false);
+ ui->remButton->setEnabled(false);
+ ui->useButton->setEnabled(false);
+ ui->listWidget->clear(); // tjr effacer , sinon on rajoute
+
+ QSettings settings;
+
+ QString useKey = settings.value("config/currentKey").toString();
+
+ QList <QListWidgetItem> asycItems;
+
+ settings.beginGroup("account");
+ foreach ( QString key, settings.allKeys())
+ {
+ QListWidgetItem * item = new QListWidgetItem;
+
+ item->setText(key);
+ item->setData(Qt::UserRole, settings.value(key));
+ if (useKey == key) {
+ QFont font = item->font();
+ font.setBold(true);
+ item->setFont(font);
+ }
+ ui->listWidget->addItem(item);
+ asycItems.append(*item);
+ }
+ settings.endGroup();
+
+
+ // ... create and add in the list widget
+
+ // QFuture<QListWidgetItem> itemFutur = QtConcurrent::mapped(asycItems, asyncTestItem);
+
+
+ mFuturWatcher->setFuture(QtConcurrent::mapped(asycItems, asyncTestItem));
+}
+
+QListWidgetItem AccountDialog::asyncTestItem(const QListWidgetItem& item)
+{
+ //==========> NEED TO USE POINTER TO AVOID setAsyncItem! But I don't know how;..
+ QListWidgetItem newItem = item;
+
+ QTcpSocket * socket = new QTcpSocket;
+ QSettings settings;
+ QString host = settings.value("account/"+item.text()).toString();
+
+ if(host.contains(":"))
+ {
+ QStringList hostSplit = host.split(":");
+ QString ip = hostSplit.at(0);
+ QString port = hostSplit.at(1);
+ socket->connectToHost(ip,port.toInt());
+ }
+
+ else
+ socket->connectToHost(host,8080);
+
+ if (socket->waitForConnected(1000))
+ newItem.setIcon(QIcon::fromTheme("widgets_tickmark_list"));
+ else
+ newItem.setIcon(QIcon::fromTheme("statusarea_presence_busy_error"));
+
+ return newItem;
+
+
+}
+
+
+
+void AccountDialog::setAsyncItem(int row) // EDIT THE ROW AFTER ASYNC FUNCTION FINISHED
+{
+ QListWidgetItem newItem = mFuturWatcher->resultAt(row);
+ QListWidgetItem * item = ui->listWidget->item(row);
+
+ item->setIcon(newItem.icon());
+
+
+
+}
+
+
+
+void AccountDialog::edit()
+{
+ QString currentIp = ui->listWidget->currentItem()->data(Qt::UserRole).toString();
+ QString currentKey = ui->listWidget->currentItem()->text();
+
+ NewAccountDialog *dialog = new NewAccountDialog(this);
+ dialog->edit(currentKey, currentIp);
+ dialog->exec();
+
+ load();
+}
+
+void AccountDialog::rem()
+{
+ QString key = ui->listWidget->currentItem()->text();
+
+ QSettings settings;
+ settings.beginGroup("account");
+ settings.remove(key);
+ settings.endGroup();
+
+ load(); // On recharge les compte
+}
+
+void AccountDialog::use()
+{
+ QString currentKey = ui->listWidget->currentItem()->text();
+ QSettings settings;
+ settings.setValue("config/currentKey", currentKey);
+ load();
+ emit accept();
+}
+
+void AccountDialog::enableUi()
+{
+ ui->editButton->setEnabled(true);
+ ui->remButton->setEnabled(true);
+ ui->useButton->setEnabled(true);
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef ACCOUNTDIALOG_H
+#define ACCOUNTDIALOG_H
+
+#include <QDialog>
+#include <QListWidget>
+#include <QFutureWatcher>
+namespace Ui {
+ class AccountDialog;
+}
+
+class AccountDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit AccountDialog(QWidget *parent = 0);
+ ~AccountDialog();
+ static QListWidgetItem asyncTestItem(const QListWidgetItem& item);
+
+
+static QString currentIp();
+
+public slots:
+ void add();
+ void edit();
+ void rem();
+ void use();
+ void load();
+ void enableUi();
+ void setAsyncItem(int row);
+private:
+ Ui::AccountDialog *ui;
+ QFutureWatcher <QListWidgetItem> * mFuturWatcher;
+};
+
+#endif // ACCOUNTDIALOG_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AccountDialog</class>
+ <widget class="QDialog" name="AccountDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Accounts</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QListWidget" name="listWidget">
+ <item>
+ <property name="text">
+ <string>test</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="addButton">
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="editButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="remButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2"/>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="useButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Use</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<ui version="4.0" >
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>240</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>200</y>
+ <width>301</width>
+ <height>32</height>
+ </rect>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include <QStringList>
+#include "appsettings.h"
+
+AppSettings::AppSettings() {
+}
+
+AppSettings::~AppSettings() {
+ ;
+}
+
+QString AppSettings::getCurrentKey() {
+ QSettings sets;
+ return sets.value("config/currentKey", "").toString();
+}
+QString AppSettings::getCurrentIp() {
+ QSettings sets;
+ return sets.value("account/" + getCurrentKey(), "").toString();
+}
+VlcDirectory AppSettings::getHomeDirectory() {
+ QSettings sets;
+ VlcDirectory home;
+ home.name = sets.value("config/accounts/" + getCurrentKey() + "/homeDirName", "Default").toString();
+ home.path = sets.value("config/accounts/" + getCurrentKey() + "/homeDirPath", "~/").toString();
+ return home;
+}
+bool AppSettings::setHomeDirectory(VlcDirectory dir) {
+ QSettings sets;
+ sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirName", dir.name);
+ sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirPath", dir.path);
+ return true;
+}
+QList<VlcDirectory>* AppSettings::getFavourites() {
+ QSettings sets;
+ QList<VlcDirectory> * favourites = new QList<VlcDirectory>();
+
+ sets.beginGroup("config/accounts/" + getCurrentKey() + "/favourites");
+ foreach ( QString key, sets.allKeys())
+ {
+ VlcDirectory dir;
+ // key is name
+ dir.name = key;
+ // value is path
+ dir.path = sets.value(key, "~/").toString();
+ favourites->append(dir);
+ }
+ sets.endGroup();
+ return favourites;
+}
+bool AppSettings::addFavourite(VlcDirectory dir) {
+ QSettings sets;
+ // should check for existing first otherwise it overwrites
+ if (0 < sets.value("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name, "").toString().length()) {
+ dir.name = "_" + dir.name;
+ return addFavourite(dir);
+ }
+ sets.setValue("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name, dir.path);
+ return true;
+}
+bool AppSettings::deleteFavourite(VlcDirectory dir) {
+ QSettings sets;
+ sets.remove("config/accounts/" + getCurrentKey() + "/favourites/" + dir.name);
+ return true;
+}
+Orientation AppSettings::setOrientation(Orientation orientation) {
+ QSettings sets;
+ sets.setValue("config/orientation", (int)orientation);
+ return orientation;
+}
+Orientation AppSettings::getOrientation() {
+ QSettings sets;
+ return (Orientation)(sets.value("config/orientation", AUTO_ROTATE).toInt());
+}
+
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef APPSETTINGS_H
+#define APPSETTINGS_H
+#include <QSettings>
+
+struct VlcDirectory {
+ QString name;
+ QString path;
+};
+enum Orientation {
+ AUTO_ROTATE = 0,
+ LANDSCAPE,
+ PORTRAIT
+};
+
+class AppSettings {
+public:
+ explicit AppSettings();
+ ~AppSettings();
+ static QString getCurrentKey();
+ static QString getCurrentIp();
+ static VlcDirectory getHomeDirectory();
+ static QList<VlcDirectory>* getFavourites();
+ static bool addFavourite(VlcDirectory dir);
+ static bool deleteFavourite(VlcDirectory dir);
+ static bool setHomeDirectory(VlcDirectory dir);
+ static Orientation setOrientation(Orientation orientation);
+ static Orientation getOrientation();
+//private:
+ //static QSettings settings;
+};
+
+#endif // APPSETTINGS_H
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "browsemainwindow.h"
+#include "ui_browsemainwindow.h"
+#include <QSettings>
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+#include <QMaemo5InformationBox>
+#endif
+#include "configdialog.h"
+#include "aboutdialog.h"
+#include "vlcbrowseelement.h"
+#include "appsettings.h"
+#include "favouritesmainwindow.h"
+
+BrowseMainWindow::BrowseMainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::BrowseMainWindow)
+{
+
+ ui->setupUi(this);
+ mFavouritesMainWindow = new FavouritesMainWindow;
+ mCurrentDir = "~/"; //AppSettings::getHomeDirectory().path; // This works on win as well as linux, would guess mac too.
+ setWindowTitle("Vlc remote");
+
+
+ mNetManager = new QNetworkAccessManager(this);
+
+ mContents = new QList<VlcBrowseElement>();
+
+ ui->listWidget->setTextElideMode(Qt::ElideMiddle);
+ ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ ui->playButton->setIcon(QIcon::fromTheme("camera_playback"));
+ ui->addButton->setIcon(QIcon::fromTheme("general_add"));
+ ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
+ ui->browseButton->setDisabled(true);
+ ui->playButton->setDisabled(true);
+ ui->addButton->setDisabled(true);
+
+
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+
+ mFavouritesMainWindow->setParent(this);
+ mFavouritesMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ mFavouritesMainWindow->setWindowFlags(mFavouritesMainWindow->windowFlags() | Qt::Window);
+
+#endif
+
+ connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
+ connect(ui->addButton,SIGNAL(clicked()),this,SLOT(onAddToPlaylist()));
+ connect(ui->playButton,SIGNAL(clicked()),this,SLOT(onPlay()));
+ connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
+
+ connect(ui->actionGoUserHome, SIGNAL(triggered()), this, SLOT(showUserHomeFolder()));
+ connect(ui->actionGoHome, SIGNAL(triggered()), this, SLOT(showHomeFolder()));
+ connect(ui->actionSetHome, SIGNAL(triggered()), this, SLOT(setHomeFolder()));
+ connect(ui->actionViewFavourites, SIGNAL(triggered()), this, SLOT(showFavourites()));
+ connect(ui->actionSetFavourite, SIGNAL(triggered()), this, SLOT(setFavourite()));
+
+ connect(this->mFavouritesMainWindow, SIGNAL(browseDirectory(QString)), this, SLOT(browseDirectory(QString)));
+
+ init();
+
+
+}
+void BrowseMainWindow::init() // THIS METHOD IS CALLED WHEN CONFIG CHANGED...
+{
+ mIp = AppSettings::getCurrentIp(); // AccountDialog::currentIp();
+ setHomeDirectory();
+}
+void BrowseMainWindow::setHomeDirectory()
+{
+ mCurrentDir = AppSettings::getHomeDirectory().path;
+}
+void BrowseMainWindow::showCurrentDirectory() // THIS METHOD IS CALLED WHEN WINDOW IS OPENED...
+{
+ browseDirectory(mCurrentDir);
+}
+
+BrowseMainWindow::~BrowseMainWindow()
+{
+ delete ui;
+}
+
+void BrowseMainWindow::changeEvent(QEvent *e)
+{
+ QMainWindow::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void BrowseMainWindow::showHomeFolder() {
+ browseDirectory(AppSettings::getHomeDirectory().path);
+}
+void BrowseMainWindow::showUserHomeFolder() {
+ browseDirectory("~/");
+}
+void BrowseMainWindow::setHomeFolder() {
+ if (0 < mCurrentElement.name.length() && (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type))) {
+ VlcDirectory dir;
+ dir.name = mCurrentElement.name;
+ dir.path = mCurrentElement.path;
+ AppSettings::setHomeDirectory(dir);
+ }
+ else if (0 < mCurrentDir.length()) {
+ VlcDirectory dir;
+ QString name = mCurrentDir;
+ int idx = mCurrentDir.lastIndexOf('/');
+ if (0 > idx) idx = mCurrentDir.lastIndexOf('\\');
+ if (0 < idx) {
+ name = mCurrentDir.right(mCurrentDir.length() - (idx + 1));
+ }
+ dir.name = name;
+ dir.path = mCurrentDir;
+ AppSettings::setHomeDirectory(dir);
+ }
+}
+void BrowseMainWindow::showFavourites() {
+ mFavouritesMainWindow->show();
+ mFavouritesMainWindow->init();
+}
+void BrowseMainWindow::setFavourite() {
+ if (0 < mCurrentElement.name.length() && (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type))) {
+ VlcDirectory dir;
+ dir.name = mCurrentElement.name;
+ dir.path = mCurrentElement.path;
+ AppSettings::addFavourite(dir);
+ }
+ else if (0 < mCurrentDir.length()) {
+ VlcDirectory dir;
+ QString name = mCurrentDir;
+ int idx = mCurrentDir.lastIndexOf('/');
+ if (0 > idx) idx = mCurrentDir.lastIndexOf('\\');
+ if (0 < idx) {
+ name = mCurrentDir.right(mCurrentDir.length() - (idx + 1));
+ }
+ dir.name = name;
+ dir.path = mCurrentDir;
+ AppSettings::addFavourite(dir);
+ }
+}
+
+void BrowseMainWindow::onListSelectionChanged() {
+ QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
+ if (0 < items.count()) {
+ mCurrentElement = getElementFromText(items.at(0)->text());
+ // are we up dir?
+ if (0 == QString::compare("..", mCurrentElement.name)) {
+ ui->browseButton->setDisabled(true);
+ ui->playButton->setDisabled(true);
+ ui->addButton->setDisabled(true);
+ mCurrentDir = mCurrentElement.path;
+ browseDirectory(mCurrentDir);
+ }
+ else {
+ // can we browse?
+ if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
+ ui->browseButton->setDisabled(false);
+ }
+ else {
+ ui->browseButton->setDisabled(true);
+ }
+ // can we play?
+ ui->playButton->setDisabled(false);
+ // can we playlist?
+ ui->addButton->setDisabled(false);
+ }
+ }
+}
+
+VlcBrowseElement BrowseMainWindow::getElementFromText(QString text) {
+ for (int idx = 0; idx < mContents->count(); ++idx) {
+ if (0 == QString::compare(text, mContents->at(idx).name)) {
+ return mContents->at(idx);
+ }
+ }
+ return *(new VlcBrowseElement());
+}
+
+void BrowseMainWindow::onBrowse() {
+ // check for directory
+ if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
+ // call browseDirectory
+ mCurrentDir = mCurrentElement.path;
+ browseDirectory(mCurrentDir);
+ }
+ else {
+ ui->browseButton->setDisabled(true);
+ }
+}
+
+void BrowseMainWindow::onAddToPlaylist() {
+ QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue");
+ url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
+ mNetManager->get(QNetworkRequest(url));
+ //mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
+}
+
+void BrowseMainWindow::onPlay() {
+ QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_play");
+ url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
+ mNetManager->get(QNetworkRequest(url));
+ //mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_play&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
+}
+
+void BrowseMainWindow::browseDirectory(QString dir) {
+ if (mFavouritesMainWindow) {
+ setParent(this->parentWidget());
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ setAttribute(Qt::WA_Maemo5StackedWindow, true);
+#endif
+ mFavouritesMainWindow->hide();
+ }
+ mResponse.clear();
+ QUrl url = QUrl("http://"+mIp+"/requests/browse.xml");
+ url.addEncodedQueryItem(QByteArray("dir"), QUrl::toPercentEncoding(dir));
+ QNetworkReply * reply = mNetManager->get(QNetworkRequest(url));
+ //QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir.replace("&", "%26").replace("\\", "\\\\"))));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+#endif
+ connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
+ connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
+ connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+}
+void BrowseMainWindow::error(QNetworkReply::NetworkError code) {
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
+ qDebug() << code;
+}
+void BrowseMainWindow::readReady() {
+ QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
+ // append to buffer
+ mResponse += reply->readAll();
+}
+void BrowseMainWindow::finished(QNetworkReply * reply) {
+ // now we can call parseXmlDirectory to process the full buffers
+ this->parseXmlDirectory();
+ // only interested in finished signals
+ disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
+ delete reply;
+}
+void BrowseMainWindow::parseXmlDirectory() {
+ QDomDocument doc;
+ doc.setContent(this->mResponse);
+ QDomElement docElem = doc.documentElement();
+ QDomNodeList elements = docElem.elementsByTagName("element");
+ // we can sort by folders then files alphabetically by running to lists and appending them at the end
+ // vlc alpha sorts everything in the incoming stream, we just need to seperate files from folders.
+ if (0 < elements.count()) {
+ QList<VlcBrowseElement>* files = new QList<VlcBrowseElement>();
+ int idx = 0;
+ mContents->clear();
+ do {
+ QDomNode node = elements.at(idx);
+ VlcBrowseElement* dir = new VlcBrowseElement();
+ dir->type = node.attributes().namedItem("type").nodeValue();
+ dir->size = node.attributes().namedItem("size").nodeValue().toInt();
+ dir->date = QDate::fromString(node.attributes().namedItem("date").nodeValue());
+ dir->path = node.attributes().namedItem("path").nodeValue();
+ dir->name = node.attributes().namedItem("name").nodeValue();
+ dir->extension = getExtension(dir->path, node.attributes().namedItem("extension").nodeValue());
+ ++idx;
+ if (0 != QString::compare("directory", dir->type) && 0 != QString::compare("dir", dir->type)) {
+ files->append(*dir);
+ }
+ else if (0 == QString::compare("..", dir->name)) {
+ this->mContents->prepend(*dir);
+ }
+ else {
+ this->mContents->append(*dir);
+ }
+ delete dir;
+ } while (idx < elements.count());
+ if (0 < files->count()) {
+ mContents->append(*files);
+ }
+ delete files;
+ // Update UI
+ this->updateList();
+ }
+ else {
+ // alert user of error / empty directory
+ qDebug() << "can't browse dir: " << mCurrentDir;
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ QMaemo5InformationBox::information(this, tr("Directory could not be browsed!"), QMaemo5InformationBox::DefaultTimeout);
+#endif
+ }
+ mResponse.clear();
+
+}
+
+QString BrowseMainWindow::getExtension(QString path, QString extension) {
+ // return extension if exists
+ if (!extension.isNull() && !extension.isEmpty()) return extension;
+ // return blank if no path
+ if (path.isNull() || path.isEmpty()) return "";
+ // otherwise extract the extension
+ int dot_pos = path.lastIndexOf('.');
+ if (0 < dot_pos) {
+ return path.right(path.length() - (dot_pos + 1));
+ }
+ else { // no dot
+ return "";
+ }
+}
+
+void BrowseMainWindow::updateList() {
+ ui->listWidget->clear();
+ int ct = this->mContents->count();
+ if (0 < ct) {
+ QIcon icon_up = QIcon::fromTheme("filemanager_folder_up");
+ QIcon icon_folder = QIcon::fromTheme("general_folder");
+ QIcon icon_audio = QIcon::fromTheme("general_audio_file");
+ QIcon icon_video = QIcon::fromTheme("general_video_file");
+ QIcon icon_image = QIcon::fromTheme("general_image");
+ QIcon icon_flash = QIcon::fromTheme("filemanager_flash_file");
+ QIcon icon_real = QIcon::fromTheme("filemanager_real_music");
+ QIcon icon_playl = QIcon::fromTheme("filemanager_playlist");
+ QIcon icon_unknown= QIcon::fromTheme("filemanager_unknown_file");
+ for (int idx = 0; idx < ct; ++idx) {
+ VlcBrowseElement dir = mContents->at(idx);
+ QListWidgetItem* item;
+ bool item_good = false;
+ if (0 == QString::compare("directory", dir.type) || 0 == QString::compare("dir", dir.type)) {
+ if (0 == QString::compare("..", dir.name)) {
+ item = new QListWidgetItem(icon_up, dir.name, ui->listWidget, 0);
+ item_good = true;
+ }
+ else {
+ item = new QListWidgetItem(icon_folder, dir.name, ui->listWidget, 0);
+ item_good = true;
+ }
+ }
+ else if (0 == QString::compare("file", dir.type)) {
+ if ( 0 == QString::compare(dir.extension, "jpg") ||
+ 0 == QString::compare(dir.extension, "jpeg") ||
+ 0 == QString::compare(dir.extension, "gif") ||
+ 0 == QString::compare(dir.extension, "png") ||
+ 0 == QString::compare(dir.extension, "bmp") ) {
+ item_good = true;
+ item = new QListWidgetItem(icon_image, dir.name, ui->listWidget, 0); // .jpg, .jpeg, .gif, .png, .bmp
+ }
+ else if ( 0 == QString::compare(dir.extension, "mp3") ||
+ 0 == QString::compare(dir.extension, "m4a") ||
+ 0 == QString::compare(dir.extension, "ogg") ||
+ 0 == QString::compare(dir.extension, "oga") ||
+ 0 == QString::compare(dir.extension, "wav") ||
+ 0 == QString::compare(dir.extension, "flac") ) {
+ item_good = true;
+ item = new QListWidgetItem(icon_audio, dir.name, ui->listWidget, 0); // .mp3, .m4a, .ogg, .oga, .wav, .flac
+ }
+ else if ( 0 == QString::compare(dir.extension, "m3u") ||
+ 0 == QString::compare(dir.extension, "wpl") ||
+ 0 == QString::compare(dir.extension, "pls") ||
+ 0 == QString::compare(dir.extension, "asx") ||
+ 0 == QString::compare(dir.extension, "xspf") ||
+ 0 == QString::compare(dir.extension, "cmml") ) {
+ item_good = true;
+ item = new QListWidgetItem(icon_playl, dir.name, ui->listWidget, 0); // .m3u, .wpl, .pls, .asx, .xspf, .cmml
+ }
+ else if ( 0 == QString::compare(dir.extension, "avi") ||
+ 0 == QString::compare(dir.extension, "mpeg") ||
+ 0 == QString::compare(dir.extension, "mpg") ||
+ 0 == QString::compare(dir.extension, "mov") ||
+ 0 == QString::compare(dir.extension, "mp4") ||
+ 0 == QString::compare(dir.extension, "m4v") ||
+ 0 == QString::compare(dir.extension, "wmv") ||
+ 0 == QString::compare(dir.extension, "mkv") ||
+ 0 == QString::compare(dir.extension, "ogv") ) {
+ item_good = true;
+ item = new QListWidgetItem(icon_video, dir.name, ui->listWidget, 0); // .avi, .mpg, .mpeg, .mov, .mp4, .m4v, .wmv, .mkv, .ogv
+ }
+ else if ( 0 == QString::compare(dir.extension, "rm") ||
+ 0 == QString::compare(dir.extension, "ra") ||
+ 0 == QString::compare(dir.extension, "ram") ) {
+ item = new QListWidgetItem(icon_real, dir.name, ui->listWidget, 0); // .ram, 'rm, 'ra
+ }
+ else if ( 0 == QString::compare(dir.extension, "flv") ) {
+ item_good = true;
+ item = new QListWidgetItem(icon_flash, dir.name, ui->listWidget, 0); // .flv
+ }
+ else {
+ if (dir.name.startsWith("Flash")) {
+ item_good = true;
+ item = new QListWidgetItem(icon_flash, dir.name, ui->listWidget, 0);
+ }
+ else {
+ item_good = false;
+ //item = new QListWidgetItem(icon_unknown, dir.name, ui->listWidget, 0);
+ }
+ }
+ }
+ if (item_good) {
+ ui->listWidget->addItem(item);
+ }
+ // other types ignored
+ }
+ }
+}
+
+
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef BROWSEMAINWINDOW_H
+#define BROWSEMAINWINDOW_H
+
+#include <QMainWindow>
+#include <QtNetwork>
+#include <QtXml>
+#include <QListWidgetItem>
+#include "vlcbrowseelement.h"
+#include "favouritesmainwindow.h"
+
+namespace Ui {
+ class BrowseMainWindow;
+}
+
+class BrowseMainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ explicit BrowseMainWindow(QWidget *parent = 0);
+ ~BrowseMainWindow();
+
+public slots:
+ void init();
+ void browseDirectory(QString);
+ void onBrowse();
+ void onPlay();
+ void onAddToPlaylist();
+ void onListSelectionChanged();
+ void finished(QNetworkReply * reply);
+ void readReady();
+ void error(QNetworkReply::NetworkError code);
+ void showCurrentDirectory();
+ void setHomeFolder();
+ void showHomeFolder();
+ void showUserHomeFolder();
+ void setFavourite();
+ void showFavourites();
+ void setHomeDirectory();
+
+protected slots:
+ void parseXmlDirectory();
+ void updateList();
+
+protected:
+ void changeEvent(QEvent *e);
+ VlcBrowseElement getElementFromText(QString text);
+ QString getExtension(QString path, QString extension);
+
+private:
+ Ui::BrowseMainWindow *ui;
+ FavouritesMainWindow *mFavouritesMainWindow;
+ QNetworkAccessManager * mNetManager;
+ QString mCurrentDir;
+ QString mIp;
+ QList<VlcBrowseElement>* mContents;
+ VlcBrowseElement mCurrentElement;
+ QByteArray mResponse;
+};
+
+#endif // BROWSEMAINWINDOW_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BrowseMainWindow</class>
+ <widget class="QMainWindow" name="BrowseMainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QListWidget" name="listWidget">
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="playButton">
+ <property name="text">
+ <string>Play</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="addButton">
+ <property name="text">
+ <string>Enqueue</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="browseButton">
+ <property name="text">
+ <string>Browse</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuMenu">
+ <property name="title">
+ <string>menu</string>
+ </property>
+ </widget>
+ <addaction name="actionGoUserHome"/>
+ <addaction name="actionGoHome"/>
+ <addaction name="actionSetHome"/>
+ <addaction name="actionViewFavourites"/>
+ <addaction name="actionSetFavourite"/>
+ </widget>
+ <action name="actionGoUserHome">
+ <property name="text">
+ <string>User Folder</string>
+ </property>
+ </action>
+ <action name="actionGoHome">
+ <property name="text">
+ <string>Home</string>
+ </property>
+ </action>
+ <action name="actionSetHome">
+ <property name="text">
+ <string>Set as Home</string>
+ </property>
+ </action>
+ <action name="actionViewFavourites">
+ <property name="text">
+ <string>Favourites</string>
+ </property>
+ </action>
+ <action name="actionSetFavourite">
+ <property name="text">
+ <string>Add to Favourite</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "configdialog.h"
+#include "ui_configdialog.h"
+#include <QSettings>
+
+ConfigDialog::ConfigDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ConfigDialog)
+{
+ ui->setupUi(this);
+ load();
+ connect(ui->buttonBox,SIGNAL(accepted()),this,SLOT(save()));
+}
+
+ConfigDialog::~ConfigDialog()
+{
+ delete ui;
+}
+
+void ConfigDialog::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+void ConfigDialog::load()
+{
+ QSettings settings;
+ ui->lineEdit->setText(settings.value("ip").toString());
+
+}
+
+void ConfigDialog::save()
+{
+
+ QSettings settings;
+ settings.setValue("ip",ui->lineEdit->text());
+
+ emit accept();
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef CONFIGDIALOG_H
+#define CONFIGDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+ class ConfigDialog;
+}
+
+class ConfigDialog : public QDialog {
+ Q_OBJECT
+public:
+ explicit ConfigDialog(QWidget *parent = 0);
+ ~ConfigDialog();
+public slots:
+void load();
+void save();
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::ConfigDialog *ui;
+};
+
+#endif // CONFIGDIALOG_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ConfigDialog</class>
+ <widget class="QDialog" name="ConfigDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>442</width>
+ <height>304</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter IP of VLC server. </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Example : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Be sure you have properly configured Vlc</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and allows connection by adding this IP in /vlc/http/.hosts</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">More information on my blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ConfigDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>295</x>
+ <y>284</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "favouritesmainwindow.h"
+#include "ui_favouritesmainwindow.h"
+#include <QSettings>
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+#include <QMaemo5InformationBox>
+#endif
+#include "appsettings.h"
+//#include "browsemainwindow.h"
+
+FavouritesMainWindow::FavouritesMainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::FavouritesMainWindow)
+{
+
+ ui->setupUi(this);
+
+ setWindowTitle("Vlc remote");
+ mCurrentItemIndex = -1;
+
+ ui->listWidget->setTextElideMode(Qt::ElideMiddle);
+ ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ ui->deleteButton->setIcon(QIcon::fromTheme("general_delete"));
+ ui->editButton->setIcon(QIcon::fromTheme("general_sketch"));
+ ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
+ ui->saveButton->setIcon(QIcon::fromTheme("notes_save"));
+ ui->browseButton->setDisabled(true);
+ ui->editButton->setDisabled(true);
+ ui->deleteButton->setDisabled(true);
+ ui->actionSetHome->setDisabled(true);
+ ui->label->setVisible(false);
+ ui->lineEdit->setVisible(false);
+ ui->saveButton->setVisible(false);
+ ui->saveButton->setDisabled(true);
+
+ connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
+ connect(ui->deleteButton,SIGNAL(clicked()),this,SLOT(onDelete()));
+ connect(ui->editButton,SIGNAL(clicked()),this,SLOT(onEdit()));
+ connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
+ connect(ui->actionSetHome, SIGNAL(triggered()), this, SLOT(setHomeFolder()));
+ connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(onEditSave()));
+ connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(onLineEditTextChanged(QString)));
+
+ init();
+
+
+}
+void FavouritesMainWindow::init() // THIS METHOD IS CALLED WHEN CONFIG CHANGED AND WINDOW SHOWN...
+{
+ mFavourites = AppSettings::getFavourites();
+ updateList();
+}
+
+FavouritesMainWindow::~FavouritesMainWindow()
+{
+ delete mFavourites;
+ delete ui;
+}
+
+void FavouritesMainWindow::changeEvent(QEvent *e)
+{
+ QMainWindow::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+void FavouritesMainWindow::updateList() {
+ ui->listWidget->clear();
+ if (NULL != mFavourites && 0 < mFavourites->count()) {
+ for (int idx = 0; idx < mFavourites->count(); ++idx) {
+ QListWidgetItem* item = new QListWidgetItem(QIcon::fromTheme("imageviewer_favourite"), mFavourites->at(idx).name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + idx);
+ ui->listWidget->addItem(item);
+ }
+ }
+}
+void FavouritesMainWindow::setHomeFolder() {
+ if (-1 < mCurrentItemIndex) {
+ AppSettings::setHomeDirectory(mCurrentFavourite);
+ }
+}
+void FavouritesMainWindow::onListSelectionChanged() {
+ ui->label->setVisible(false);
+ ui->lineEdit->setVisible(false);
+ ui->saveButton->setVisible(false);
+ ui->saveButton->setDisabled(true);
+ QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
+ if (0 < items.count()) {
+ mCurrentItemIndex = ui->listWidget->currentIndex().row();
+ mCurrentFavourite = mFavourites->at(items.at(0)->type() - LIST_ITEM_TYPE_OFFSET); // Qt reserves types up to 1000, we use an offset beyond that for index tracking. May prove to be too hacky!
+ ui->browseButton->setDisabled(false);
+ ui->editButton->setDisabled(false);
+ ui->deleteButton->setDisabled(false);
+ ui->actionSetHome->setDisabled(false);
+ }
+ else {
+ mCurrentItemIndex = -1;
+ ui->browseButton->setDisabled(true);
+ ui->editButton->setDisabled(true);
+ ui->deleteButton->setDisabled(true);
+ ui->actionSetHome->setDisabled(true);
+ }
+}
+void FavouritesMainWindow::onLineEditTextChanged(QString text) {
+ if (0 < text.length()) {
+ ui->saveButton->setDisabled(false);
+ }
+ else {
+ ui->saveButton->setDisabled(true);
+ }
+}
+void FavouritesMainWindow::onEditSave() {
+ if (-1 < mCurrentItemIndex && 0 < ui->lineEdit->text().length()) {
+ ui->label->setVisible(false);
+ ui->lineEdit->setVisible(false);
+ ui->saveButton->setVisible(false);
+ ui->saveButton->setDisabled(true);
+ AppSettings::deleteFavourite(mCurrentFavourite);
+ mCurrentFavourite.name = ui->lineEdit->text();
+ AppSettings::addFavourite(mCurrentFavourite);
+ ui->lineEdit->setText("");
+ ui->listWidget->itemAt(mCurrentItemIndex, 0)->setText(mCurrentFavourite.name);
+ init();
+ }
+}
+void FavouritesMainWindow::onEdit() {
+ if (-1 < mCurrentItemIndex) {
+ ui->label->setVisible(true);
+ ui->lineEdit->setVisible(true);
+ ui->saveButton->setVisible(true);
+ ui->saveButton->setDisabled(false);
+ ui->lineEdit->setText(mCurrentFavourite.name);
+ ui->browseButton->setDisabled(true);
+ ui->editButton->setDisabled(true);
+ ui->deleteButton->setDisabled(true);
+ }
+}
+void FavouritesMainWindow::onBrowse() {
+ if (-1 < mCurrentItemIndex) {
+ emit browseDirectory(mCurrentFavourite.path);
+ //this->close();
+ //((BrowseMainWindow *)this->parent())->browseDirectory(mCurrentFavourite.path);
+ }
+}
+void FavouritesMainWindow::onDelete() {
+ if (-1 < mCurrentItemIndex) {
+ AppSettings::deleteFavourite(mCurrentFavourite);
+ init();
+ }
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef FAVOURITESMAINWINDOW_H
+#define FAVOURITESMAINWINDOW_H
+
+#include <QMainWindow>
+#include <QtNetwork>
+#include <QtXml>
+#include <QListWidgetItem>
+#include "appsettings.h"
+
+#ifndef LIST_ITEM_TYPE_OFFSET
+#define LIST_ITEM_TYPE_OFFSET 1000
+#endif
+
+namespace Ui {
+ class FavouritesMainWindow;
+}
+
+class FavouritesMainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ explicit FavouritesMainWindow(QWidget *parent = 0);
+ ~FavouritesMainWindow();
+
+public slots:
+ void init();
+ void onListSelectionChanged();
+ void onLineEditTextChanged(QString text);
+ void onBrowse();
+ void onEdit();
+ void onDelete();
+ void setHomeFolder();
+ void onEditSave();
+
+protected slots:
+
+signals:
+ void browseDirectory(QString path);
+
+protected:
+ void changeEvent(QEvent *e);
+ void updateList();
+
+private:
+ Ui::FavouritesMainWindow *ui;
+ int mCurrentItemIndex;
+ QList<VlcDirectory>* mFavourites;
+ VlcDirectory mCurrentFavourite;
+};
+
+#endif // FAVOURITESMAINWINDOW_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>FavouritesMainWindow</class>
+ <widget class="QMainWindow" name="FavouritesMainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>798</width>
+ <height>598</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QListWidget" name="listWidget"/>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="saveButton">
+ <property name="text">
+ <string>Save</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="deleteButton">
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="editButton">
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="browseButton">
+ <property name="text">
+ <string>Browse</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>798</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <addaction name="actionSetHome"/>
+ </widget>
+ <action name="actionSetHome">
+ <property name="text">
+ <string>Set as Home</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include <QtGui/QApplication>
+#include <QSettings>
+#include <QLocale>
+#include <QTextCodec>
+#include <QTranslator>
+#include <QDebug>
+#include "playermainwindow.h"
+#include "appsettings.h"
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ QCoreApplication::setOrganizationName("Omed");
+ QCoreApplication::setOrganizationDomain("medsoft.blogspot.com/");
+ QCoreApplication::setApplicationName("Maemo VLC remote");
+
+ QString locale = QLocale::system().name();
+ QTranslator translator;
+ translator.load(QString(":/languages/vlcremote_") + locale);
+ a.installTranslator(&translator);
+
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
+
+
+ qDebug() << AppSettings::getCurrentIp();
+
+
+ PlayerMainWindow * mainwindow = new PlayerMainWindow;
+
+ //mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ //mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ //mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+
+ mainwindow->showMaximized();
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ Orientation o = AppSettings::getOrientation();
+ switch (o) {
+ case AUTO_ROTATE:
+ mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ break;
+ case LANDSCAPE:
+ mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ break;
+ case PORTRAIT:
+ mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ break;
+ default:
+ mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ break;
+ }
+#endif
+ return a.exec();
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "newaccountdialog.h"
+#include <QFormLayout>
+#include <QDebug>
+#include <QSettings>
+//#include <QMaemo5InformationBox>
+
+NewAccountDialog::NewAccountDialog(QWidget *parent)
+{
+ Q_UNUSED(parent);
+ this->setWindowTitle(tr("Add account"));
+
+ mKeyLineEdit = new QLineEdit;
+ mIpLineEdit = new QLineEdit;
+ mPortLineEdit = new QLineEdit;
+ mPortLineEdit->setText("8080");
+ mPortLineEdit->setReadOnly(false);
+
+ mButtonBox = new QDialogButtonBox;
+ mButtonBox->addButton(QDialogButtonBox::Save);
+ mButtonBox->addButton(QDialogButtonBox::Cancel);
+
+ connect(mButtonBox, SIGNAL(accepted()), this, SLOT(save()));
+ connect(mButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+
+ QFormLayout *layout = new QFormLayout;
+ layout->expandingDirections();
+ layout->addRow(tr("Name:"), mKeyLineEdit);
+ layout->addRow(tr("Ip:"), mIpLineEdit);
+ layout->addRow(tr("Port:"), mPortLineEdit);
+ layout->addWidget(mButtonBox);
+
+ setLayout(layout);
+}
+
+void NewAccountDialog::save()
+{
+ QString myKey = mKeyLineEdit->text();
+ QString myIp = mIpLineEdit->text();
+ QString myPort = mPortLineEdit->text();
+
+ QSettings settings;
+ settings.beginGroup("account");
+ if (!mEditKey.isEmpty()) {
+ settings.remove(mEditKey);
+ }
+
+ if (!myIp.isEmpty() && !myKey.isEmpty()) {
+ if (myPort.isEmpty()) {
+ myPort = "8080";
+ }
+ settings.setValue(myKey, myIp+":"+myPort);
+ // Rajouter des tests pour vérifier qu'on est sur Maemo
+ //QMaemo5InformationBox::information(this, tr("Account saved"), QMaemo5InformationBox::DefaultTimeout);
+ }
+ settings.endGroup();
+
+ emit accept();
+}
+
+void NewAccountDialog::edit(QString &key, QString &ip)
+{
+ Q_UNUSED(ip);
+ this->setWindowTitle(tr("Edit account"));
+
+ QSettings settings;
+ settings.beginGroup("account");
+ QString value = settings.value(key).toString();
+ settings.endGroup();
+
+ QStringList values = value.split(":");
+
+ mEditKey = key;
+ mEditIp = values.first();
+ mEditPort = values.last();
+
+ mKeyLineEdit->setText(mEditKey);
+ mKeyLineEdit->setDisabled(true);
+ mIpLineEdit->setText(mEditIp);
+ mPortLineEdit->setText(mEditPort);
+}
+
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef NEWACCOUNTDIALOG_H
+#define NEWACCOUNTDIALOG_H
+
+#include <QDialog>
+#include <QLineEdit>
+#include <QLabel>
+#include <QDialogButtonBox>
+
+class NewAccountDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit NewAccountDialog(QWidget *parent = 0);
+ void edit(QString &key, QString &ip);
+
+public slots:
+ void save();
+
+private:
+ QLineEdit *mKeyLineEdit;
+ QLineEdit *mIpLineEdit;
+ QLineEdit *mPortLineEdit;
+ QPushButton *mSavePushButton;
+ QPushButton *mCancelPushButton;
+ QDialogButtonBox *mButtonBox;
+
+ QString mEditKey;
+ QString mEditIp;
+ QString mEditPort;
+};
+
+#endif // NEWACCOUNTDIALOG_H
--- /dev/null
+ /* VLC-REMOTE for MAEMO 5
+ * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program 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 this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+ #include <QDebug>
+ #include <QTime>
+ #include <QtGui>
+ #include "playermainwindow.h"
+ #include "ui_playermainwindow.h"
+ #include "configdialog.h"
+ #include "aboutdialog.h"
+ #include "accountdialog.h"
+ #include "appsettings.h"
+ //#include "vlcstatus.h"
+
+ PlayerMainWindow::PlayerMainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::PlayerMainWindow)
+ {
+ ui->setupUi(this);
+ setWindowTitle("Vlc remote");
+
+
+
+ mTimer = new QTimer(this);
+ mNetManager = new QNetworkAccessManager(this);
+ mPlayListMainWindow = new PlayListMainWindow;
+ mBrowserMainWindow = new BrowseMainWindow;
+
+ mVolume = 100;
+ mMuted = false;
+
+ mIsLandscape = true;
+
+ ui->playlistButton->setIcon(QIcon::fromTheme("notes_bullets"));
+ ui->browseButton->setIcon(QIcon::fromTheme("filemanager_media_folder"));
+
+ ui->previousButton->setIcon(QIcon::fromTheme("pdf_viewer_first_page"));
+ ui->nextButton->setIcon(QIcon::fromTheme("pdf_viewer_last_page"));
+ ui->playpauseButton->setIcon(QIcon::fromTheme("camera_playback"));
+ ui->stopButton->setIcon(QIcon::fromTheme("camera_video_stop"));
+ //ui->pauseButton->setIcon(QIcon::fromTheme("camera_video_pause"));
+ ui->fullscreenButton->setIcon(QIcon::fromTheme("general_fullsize"));
+ ui->volDown->setIcon(QIcon::fromTheme("statusarea_volumelevel1"));
+ ui->volUp->setIcon(QIcon::fromTheme("statusarea_volumelevel4"));
+ ui->volMute->setIcon(QIcon::fromTheme("statusarea_volume_mute"));
+
+ ui->labelArtPortrait->setVisible(false);
+ ui->labelArtLandscape->setVisible(false);
+
+ ui->labelTitle->setTextFormat(Qt::RichText);
+ ui->labelArtist->setTextFormat(Qt::RichText);
+ ui->labelAlbum->setTextFormat(Qt::RichText);
+
+
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+
+ mPlayListMainWindow->setParent(this);
+ mPlayListMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ mPlayListMainWindow->setWindowFlags(mPlayListMainWindow->windowFlags() | Qt::Window);
+
+ mBrowserMainWindow->setParent(this);
+ mBrowserMainWindow->setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ setAttribute(Qt::WA_Maemo5StackedWindow, true);
+ mBrowserMainWindow->setWindowFlags(mBrowserMainWindow->windowFlags() | Qt::Window);
+
+ connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
+
+ #endif
+
+ connect(mTimer,SIGNAL(timeout()),this,SLOT(askStatus()));
+ connect(ui->actionConfiguration,SIGNAL(triggered()),this,SLOT(showConfig()));
+ connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout()));
+ connect(ui->actionPortrait,SIGNAL(triggered()),this,SLOT(setPortrait()));
+ connect(ui->actionLandscape,SIGNAL(triggered()),this,SLOT(setLandscape()));
+ connect(ui->actionAutoRotate,SIGNAL(triggered()),this,SLOT(setAutoRotate()));
+ connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(show()));
+ connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(showPlayList()));
+ connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(show()));
+ connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(showCurrentDirectory()));
+
+ connect(ui->playpauseButton,SIGNAL(clicked()),this,SLOT(playpause()));
+ connect(ui->stopButton,SIGNAL(clicked()),this,SLOT(stop()));
+ connect(ui->previousButton,SIGNAL(clicked()),this,SLOT(previous()));
+ connect(ui->nextButton,SIGNAL(clicked()),this,SLOT(next()));
+ connect(ui->fullscreenButton,SIGNAL(clicked()),this,SLOT(fullscreen()));
+ connect(ui->volUp,SIGNAL(clicked()),this,SLOT(volUp()));
+ connect(ui->volDown,SIGNAL(clicked()),this,SLOT(volDown()));
+ connect(ui->volMute,SIGNAL(clicked()),this,SLOT(volMute()));
+ connect(ui->slider,SIGNAL(sliderMoved(int)),this,SLOT(slide(int)));
+
+ connect(mPlayListMainWindow, SIGNAL(idUpdated(int,bool,QString)), this, SLOT(playlistIdUpdated(int, bool, QString)));
+
+
+ // check if last used connection is still valid or showConfig
+ QSettings settings;
+ QString last_ip = AccountDialog::currentIp();
+ if (!last_ip.isNull() && !last_ip.isEmpty()) {
+ QTcpSocket * socket = new QTcpSocket;
+ if(last_ip.contains(":"))
+ {
+ QStringList hostSplit = last_ip.split(":");
+ QString ip = hostSplit.at(0);
+ QString port = hostSplit.at(1);
+ socket->connectToHost(ip,port.toInt());
+ }
+ else {
+ socket->connectToHost(last_ip,8080);
+ }
+ if (!socket->waitForConnected(1000)) {
+ showConfig();
+ }
+ else {
+ mIp= last_ip;
+
+ mPlayListMainWindow->init();
+ mBrowserMainWindow->init();
+ mTimer->start(5000);
+ askStatus();
+ }
+ delete socket;
+ }
+ else {
+ showConfig();
+ }
+
+
+ }
+
+
+ PlayerMainWindow::~PlayerMainWindow()
+ {
+ delete ui;
+ }
+
+ void PlayerMainWindow::changeEvent(QEvent *e)
+ {
+ QMainWindow::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void PlayerMainWindow::setPortrait()
+ {
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ AppSettings::setOrientation(PORTRAIT);
+ this->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ #endif
+ }
+
+ void PlayerMainWindow::setLandscape()
+ {
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ AppSettings::setOrientation(LANDSCAPE);
+ this->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ #endif
+ }
+
+ void PlayerMainWindow::setAutoRotate()
+ {
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ AppSettings::setOrientation(AUTO_ROTATE);
+ this->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ #endif
+ }
+
+ void PlayerMainWindow::orientationChanged() {
+ QRect screenGeometry = QApplication::desktop()->screenGeometry();
+ mIsLandscape = (screenGeometry.width() > screenGeometry.height());
+ if (mHasImage) {
+ if (mIsLandscape) {
+ ui->labelArtPortrait->setVisible(false);
+ ui->labelArtLandscape->setVisible(true);
+ }
+ else {
+ ui->labelArtLandscape->setVisible(false);
+ ui->labelArtPortrait->setVisible(true);
+ }
+ }
+ else {
+ ui->labelArtLandscape->setVisible(false);
+ ui->labelArtPortrait->setVisible(false);
+ }
+ }
+
+ void PlayerMainWindow::playpause()
+ {
+ // NB. There is no guarentee that our current state is the real current state.
+ // This is due to the polling frequency and possibility of user interaction directly on the server.
+ // Still this is probably better than nothing and our next real poll will set us straight again.
+ if (PAUSED == mCurrentStatus.state) {
+ mCurrentStatus.state = PLAYING;
+ pause();
+ updateUiWithCurrentStatus();
+ }
+ else if (PLAYING == mCurrentStatus.state) {
+ mCurrentStatus.state = PAUSED;
+ pause();
+ updateUiWithCurrentStatus();
+ }
+ else {
+ // could be STOP or UNKNOWN, either way there is no guarentee we will enter a playing state next.
+ // So don't update the current state or UI
+ // Ideally we would try to find a way to check the current state again but this could lead to an infinite loop!
+ play();
+ }
+ }
+ void PlayerMainWindow::play()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_play")));
+ }
+ void PlayerMainWindow::stop()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_stop")));
+ }
+ void PlayerMainWindow::pause()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_pause")));
+ }
+ void PlayerMainWindow::previous()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_previous")));
+ }
+ void PlayerMainWindow::next()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_next")));
+ }
+ void PlayerMainWindow::fullscreen()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=fullscreen")));
+ }
+ void PlayerMainWindow::volUp()
+ {
+ QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=volume");
+ url.addEncodedQueryItem(QByteArray("val"), QByteArray("%2B10"));
+ mNetManager->get(QNetworkRequest(url));
+ }
+ void PlayerMainWindow::volDown()
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val=-10")));
+ }
+ void PlayerMainWindow::volMute()
+ {
+ this->mMuted = !this->mMuted;
+ if (this->mMuted) {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val=0")));
+ }
+ else {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=volume&val="+QString::number(this->mVolume))));
+ }
+ }
+ void PlayerMainWindow::slide(int value)
+ {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=seek&val="+QString::number(value)+"%25")));
+ }
+
+ void PlayerMainWindow::showConfig()
+ {
+ mTimer->stop();
+ AccountDialog * dialog = new AccountDialog;
+ dialog->exec();
+
+ mIp= AccountDialog::currentIp();
+
+ mPlayListMainWindow->init();
+ mBrowserMainWindow->init();
+ mTimer->start(5000);
+ askStatus();
+ }
+ void PlayerMainWindow::showAbout()
+ {
+
+ AboutDialog * dialog = new AboutDialog;
+ dialog->exec();
+
+ }
+
+ void PlayerMainWindow::askStatus()
+ {
+ //qDebug() << "Status requested. at:" << QTime::currentTime().toString("hh::mm:ss");
+ QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml")));
+ connect(reply,SIGNAL(readyRead()),this,SLOT(parseXmlStatus()));
+ }
+
+ void PlayerMainWindow::parseXmlStatus()
+ {
+ QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
+ QDomDocument doc;
+ doc.setContent(reply->readAll());
+ delete reply;
+ QDomElement docElem = doc.documentElement();
+ // Get the raw values
+ int volume = docElem.namedItem("volume").toElement().text().toInt();
+ int length = docElem.namedItem("length").toElement().text().toInt();
+ int time = docElem.namedItem("time").toElement().text().toInt();
+ int position = docElem.namedItem("position").toElement().text().toInt();
+ int random = docElem.namedItem("random").toElement().text().toInt();
+ int loop = docElem.namedItem("loop").toElement().text().toInt();
+ int repeat = docElem.namedItem("repeat").toElement().text().toInt();
+ QString state = docElem.namedItem("state").toElement().text();
+ QDomNode infoNode = docElem.namedItem("information");
+ QDomNode metaInfoNode = infoNode.namedItem("meta-information");
+ QString title = metaInfoNode.namedItem("title").toElement().text().replace("\\\\", "\\");
+ // if it's a file style title fix it up
+ if (40 < title.length()) {
+ if (0 < title.lastIndexOf("\\")) {
+ title = title.right(title.length() - (title.lastIndexOf("\\") + 1));
+ }
+ else if (0 < title.lastIndexOf("/")) {
+ title = title.right(title.length() - (title.lastIndexOf("/") + 1));
+ }
+ }
+ QString artist = metaInfoNode.namedItem("artist").toElement().text();
+ QString album = metaInfoNode.namedItem("album").toElement().text();
+ QString now_playing = metaInfoNode.namedItem("now_playing").toElement().text();
+ QString art_url = metaInfoNode.namedItem("art_url").toElement().text();
+ //metaInfoNode.clear();
+ //infoNode.clear();
+ //docElem.clear();
+ //doc.clear();
+ // Populate the current status structure
+ // now would be a good time to work out if we are a new track / file or not.
+ // key if we are going to look for album art later
+ // for now we check length and title this will require further examination later
+ mCurrentStatus.newtrack = true;
+ if (mCurrentStatus.length == length && !mCurrentStatus.title.isNull() && 0 == QString::compare(mCurrentStatus.title, title)) {
+ mCurrentStatus.newtrack = false;
+ }
+ mCurrentStatus.volume = volume;
+ mCurrentStatus.length = length;
+ mCurrentStatus.time = time;
+ mCurrentStatus.position = position;
+ mCurrentStatus.random = (1 == random);
+ mCurrentStatus.loop = (1 == loop);
+ mCurrentStatus.repeat = (1 == repeat);
+ mCurrentStatus.title = title;
+ mCurrentStatus.artist = artist;
+ mCurrentStatus.album = album;
+ mCurrentStatus.nowplaying = now_playing;
+ mCurrentStatus.hasart = (!art_url.isNull() && !art_url.isEmpty());
+ if (!state.isNull() && !state.isEmpty()) {
+ if (0 == QString::compare("playing", state, Qt::CaseInsensitive)) {
+ mCurrentStatus.state = PLAYING;
+ }
+ else if (0 == QString::compare("paused", state, Qt::CaseInsensitive)) {
+ mCurrentStatus.state = PAUSED;
+ }
+ else if (0 == QString::compare("stop", state, Qt::CaseInsensitive)) {
+ mCurrentStatus.state = STOP;
+ }
+ else {
+ mCurrentStatus.state = UNKNOWN;
+ }
+ }
+ else {
+ mCurrentStatus.state = UNKNOWN;
+ }
+ // What's our mute status?
+ if (0 < mCurrentStatus.volume) {
+ this->mVolume = mCurrentStatus.volume;
+ this->mMuted = false;
+ }
+ else {
+ this->mMuted = true;
+ }
+ // Update the UI
+ updateUiWithCurrentStatus();
+
+ }
+
+ void PlayerMainWindow::updateUiWithCurrentStatus() {
+ // position
+ QTime timePosition(0,0,0) ;
+ timePosition = timePosition.addSecs(mCurrentStatus.time);
+
+ ui->timeLabel->setText(timePosition.toString("h:mm:ss"));
+
+ // duration
+ if (0 < mCurrentStatus.length) {
+ QTime timeDuration(0,0,0) ;
+ timeDuration = timeDuration.addSecs(mCurrentStatus.length);
+
+ ui->durationLabel->setText(timeDuration.toString("h:mm:ss"));
+ }
+ else {
+ ui->durationLabel->setText("0:00:00");
+ }
+
+
+ if (mCurrentStatus.position >= 0 && mCurrentStatus.position <= 100) {
+ ui->slider->blockSignals(true);
+ ui->slider->setValue(mCurrentStatus.position);
+ ui->slider->blockSignals(false);
+ }
+
+ ui->labelTitle->setText(mCurrentStatus.title);
+ ui->labelArtist->setText(mCurrentStatus.artist);
+ ui->labelAlbum->setText(mCurrentStatus.album);
+
+ if (PLAYING == mCurrentStatus.state) {
+ ui->playpauseButton->setIcon(QIcon::fromTheme("camera_video_pause"));
+ }
+ else {
+ ui->playpauseButton->setIcon(QIcon::fromTheme("camera_playback"));
+ }
+
+ if (mCurrentStatus.newtrack) {
+ // potential actions:
+ // rebuild display layout
+ // retrieve album art
+ mHasImage = false;
+ QTimer::singleShot(500, mPlayListMainWindow, SLOT(requestPlayList()));
+ }
+ // Update the buttons on the playlist window
+ if (NULL != this->mPlayListMainWindow) {
+ this->mPlayListMainWindow->updateUiWithCurrentStatus(& mCurrentStatus);
+ }
+
+ }
+ void PlayerMainWindow::playlistIdUpdated(int id, bool hasart, QString extension) {
+ Q_UNUSED(extension);
+ if (hasart) {
+ getCoverArt(id);
+ }
+ else {
+ ui->labelArtLandscape->setVisible(false);
+ ui->labelArtPortrait->setVisible(false);
+ // could use a default graphic from extension here!
+ // setCoverArtFromPixmap();
+ }
+ }
+ void PlayerMainWindow::error(QNetworkReply::NetworkError code) {
+ qDebug() << "Error Code: " << code;
+ }
+ void PlayerMainWindow::readReady() {
+ QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
+ // append to buffer
+ mResponse += reply->readAll();
+ }
+ void PlayerMainWindow::finished(QNetworkReply * reply) {
+ // now we can call setCoverArt to process the full buffers
+ this->setCoverArt(mResponse);
+ // only interested in finished signals
+ disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+ delete reply;
+ }
+ void PlayerMainWindow::getCoverArt(int id) {
+ qDebug() << "getCoverArt id=!" << id;
+ mResponse.clear();
+ QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/art?id=" + QString::number(id))));
+ connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
+ connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
+ connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+
+ }
+ void PlayerMainWindow::setCoverArt(const QByteArray data) {
+ QPixmap* image = new QPixmap();
+ if (image->loadFromData(data)) {
+ mHasImage = true;
+ ui->labelArtLandscape->setPixmap(image->scaledToHeight(120, Qt::SmoothTransformation));
+ ui->labelArtPortrait->setPixmap(image->scaledToHeight(310, Qt::SmoothTransformation));
+ if (mIsLandscape) {
+ ui->labelArtPortrait->setVisible(false);
+ ui->labelArtLandscape->setVisible(true);
+ }
+ else {
+ ui->labelArtLandscape->setVisible(false);
+ ui->labelArtPortrait->setVisible(true);
+ }
+ }
+ else {
+ qDebug() << "image load failed!";
+ qDebug() << "data.length" << data.length();
+ ui->labelArtPortrait->setVisible(false);
+ ui->labelArtLandscape->setVisible(false);
+ }
+ delete image;
+ }
+ void PlayerMainWindow::setCoverArtFromPixmap(QPixmap image) {
+ mHasImage = true;
+ ui->labelArtLandscape->setPixmap(image.scaledToHeight(120, Qt::SmoothTransformation));
+ ui->labelArtPortrait->setPixmap(image.scaledToHeight(320, Qt::SmoothTransformation));
+ if (mIsLandscape) {
+ ui->labelArtPortrait->setVisible(false);
+ ui->labelArtLandscape->setVisible(true);
+ }
+ else {
+ ui->labelArtLandscape->setVisible(false);
+ ui->labelArtPortrait->setVisible(true);
+ }
+ }
+
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef PLAYERMAINWINDOW_H
+#define PLAYERMAINWINDOW_H
+
+#include <QMainWindow>
+#include <QtNetwork>
+#include <QtXml>
+#include <QTimer>
+#include "playlistmainwindow.h"
+#include "browsemainwindow.h"
+#include "vlcstatus.h"
+
+namespace Ui {
+ class PlayerMainWindow;
+}
+
+class PlayerMainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ explicit PlayerMainWindow(QWidget *parent = 0);
+ ~PlayerMainWindow();
+
+public slots:
+ void askStatus();
+ void showConfig();
+ void showAbout();
+ void play();
+ void playpause();
+ void stop();
+ void pause();
+ void previous();
+ void next();
+ void fullscreen();
+ void volUp();
+ void volDown();
+ void volMute();
+ void slide(int value);
+ void updateUiWithCurrentStatus();
+ void setCoverArt(const QByteArray data);
+ void setCoverArtFromPixmap(QPixmap image);
+ void getCoverArt(int id);
+ void finished(QNetworkReply * reply);
+ void error(QNetworkReply::NetworkError code);
+ void readReady();
+ void orientationChanged();
+ void setPortrait();
+ void setLandscape();
+ void setAutoRotate();
+ void playlistIdUpdated(int id, bool hasart, QString extension);
+
+
+protected slots:
+ void parseXmlStatus();
+protected:
+ void changeEvent(QEvent *e);
+
+
+private:
+ Ui::PlayerMainWindow *ui;
+ PlayListMainWindow * mPlayListMainWindow;
+ BrowseMainWindow * mBrowserMainWindow;
+ QNetworkAccessManager * mNetManager;
+ QString mIp;
+ QTimer * mTimer;
+ int mVolume;
+ int mMuted;
+ VlcStatus mCurrentStatus;
+ QByteArray mResponse;
+ bool mIsLandscape;
+ bool mHasImage;
+
+};
+
+#endif // PLAYERMAINWINDOW_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PlayerMainWindow</class>
+ <widget class="QMainWindow" name="PlayerMainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>796</width>
+ <height>631</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Vlc-Remote</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="labelArtPortrait">
+ <property name="minimumSize">
+ <size>
+ <width>380</width>
+ <height>350</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>380</width>
+ <height>350</height>
+ </size>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayoutDetails">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayoutDetails">
+ <item>
+ <widget class="QLabel" name="labelTitle">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Information</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelArtist">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Information</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelAlbum">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Information</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelArtLandscape">
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>140</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>100</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayoutTime">
+ <item>
+ <widget class="QLabel" name="timeLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(201, 201, 201);</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="durationLabel">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(201, 201, 201);</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QSlider" name="slider">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="previousButton">
+ <property name="text">
+ <string><</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="playpauseButton">
+ <property name="text">
+ <string>Play/Pause</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="nextButton">
+ <property name="text">
+ <string>></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="stopButton">
+ <property name="text">
+ <string>Stop</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer1">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="fullscreenButton">
+ <property name="text">
+ <string>FS</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="volUp">
+ <property name="text">
+ <string>V+</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="volDown">
+ <property name="text">
+ <string>V-</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="volMute">
+ <property name="text">
+ <string>Mute</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QPushButton" name="playlistButton">
+ <property name="text">
+ <string>PlayList</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="browseButton">
+ <property name="text">
+ <string>Browse</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>796</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuMenu">
+ <property name="title">
+ <string>menu</string>
+ </property>
+ <addaction name="actionConfiguration"/>
+ <addaction name="actionAbout"/>
+ <addaction name="actionPortrait"/>
+ <addaction name="actionLandscape"/>
+ <addaction name="actionAutoRotate"/>
+ </widget>
+ <addaction name="menuMenu"/>
+ </widget>
+ <action name="actionConfiguration">
+ <property name="text">
+ <string>Configuration</string>
+ </property>
+ </action>
+ <action name="actionAbout">
+ <property name="text">
+ <string>About</string>
+ </property>
+ </action>
+ <action name="actionPortrait">
+ <property name="text">
+ <string>Portrait Mode</string>
+ </property>
+ </action>
+ <action name="actionLandscape">
+ <property name="text">
+ <string>Landscape Mode</string>
+ </property>
+ </action>
+ <action name="actionAutoRotate">
+ <property name="text">
+ <string>Auto Rotate</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+ * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program 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 this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "playlistmainwindow.h"
+#include "ui_playlistmainwindow.h"
+#include <QPushButton>
+#include <QSettings>
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+#include <QMaemo5InformationBox>
+#endif
+#include "configdialog.h"
+#include "aboutdialog.h"
+#include "appsettings.h"
+//#include "vlcstatus.h"
+
+PlayListMainWindow::PlayListMainWindow(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::PlayListMainWindow)
+{
+
+ ui->setupUi(this);
+ mTimer = new QTimer(this);
+ setWindowTitle("Vlc remote");
+
+ mCurrentDepth = 0;
+ mCurrentVlcIndex = 0;
+
+
+ mNetManager = new QNetworkAccessManager(this);
+
+ mContents = new QList<VlcPlayListElementSimple>();
+
+ ui->listWidget->setTextElideMode(Qt::ElideLeft);
+ ui->listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ ui->playButton->setIcon(QIcon::fromTheme("camera_playback"));
+ ui->clearButton->setIcon(QIcon::fromTheme("general_delete"));
+ ui->shuffleButton->setIcon(QIcon::fromTheme("mediaplayer_default_shuffle"));
+ ui->loopButton->setIcon(QIcon::fromTheme("general_refresh"));
+ ui->repeatButton->setIcon(QIcon::fromTheme("general_redo"));
+ ui->removeButton->setIcon(QIcon::fromTheme("general_close"));
+
+ ui->clearButton->setDisabled(false);
+ ui->shuffleButton->setDisabled(false);
+ ui->loopButton->setDisabled(false);
+ ui->repeatButton->setDisabled(false);
+ ui->removeButton->setDisabled(true);
+ ui->playButton->setDisabled(true);
+
+ connect(ui->playButton,SIGNAL(clicked()),this,SLOT(onPlay()));
+ connect(ui->removeButton,SIGNAL(clicked()),this,SLOT(onRemove()));
+ connect(ui->repeatButton,SIGNAL(clicked()),this,SLOT(onRepeat()));
+ connect(ui->loopButton,SIGNAL(clicked()),this,SLOT(onLoop()));
+ connect(ui->shuffleButton,SIGNAL(clicked()),this,SLOT(onShuffle()));
+ connect(ui->clearButton,SIGNAL(clicked()),this,SLOT(onClear()));
+ connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
+
+ init();
+
+}
+void PlayListMainWindow::init() // CALL WHEN CONFIG CHANGES
+{
+ mIp = AppSettings::getCurrentIp(); // AccountDialog::currentIp();
+}
+void PlayListMainWindow::showPlayList() // CALL WHEN SHOWN
+{
+ requestPlayList();
+}
+
+PlayListMainWindow::~PlayListMainWindow()
+{
+ delete ui;
+}
+
+void PlayListMainWindow::changeEvent(QEvent *e)
+{
+ QMainWindow::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void PlayListMainWindow::onListSelectionChanged() {
+ QList<QListWidgetItem *> items = ui->listWidget->selectedItems();
+ if (0 < items.count()) {
+ // TODO VLC doesn't seem to support removing nodes!
+ // Playing nodes works fine, however.
+ // should check to see if it is a leaf or not and disable the remove button
+ mCurrentVlcIndex = items.at(0)->type() - LIST_ITEM_TYPE_OFFSET; // Qt reserves types up to 1000, we use an offset beyond that for index tracking. May prove to be too hacky!
+ mCurrentElement = getElementFromId(mCurrentVlcIndex);
+ if (0 == QString::compare("node", mCurrentElement.type)) {
+ ui->removeButton->setDisabled(true);
+ ui->playButton->setDisabled(false);
+ }
+ else {
+ ui->removeButton->setDisabled(false);
+ ui->playButton->setDisabled(false);
+ }
+ }
+ else {
+ mCurrentVlcIndex = 0;
+ ui->removeButton->setDisabled(true);
+ ui->playButton->setDisabled(true);
+ }
+}
+
+void PlayListMainWindow::onRemove() {
+ if (0 < this->mCurrentVlcIndex) {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_delete&id=" + QString::number(this->mCurrentVlcIndex))));
+ //connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
+ // don't refresh just clear the item!
+ delete ui->listWidget->takeItem(ui->listWidget->currentRow());
+ }
+}
+void PlayListMainWindow::onPlay() {
+ if (0 < this->mCurrentVlcIndex) {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_play&id=" + QString::number(this->mCurrentVlcIndex))));
+ }
+}
+void PlayListMainWindow::onRepeat() {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_repeat")));
+}
+void PlayListMainWindow::onLoop() {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_loop")));
+}
+void PlayListMainWindow::onShuffle() {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_random")));
+}
+void PlayListMainWindow::onClear() {
+ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_empty")));
+ mContents->clear();
+ ui->listWidget->clear();
+ //connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
+}
+void PlayListMainWindow::requestPlayList() {
+ mResponse.clear();
+ ui->removeButton->setDisabled(true);
+ ui->playButton->setDisabled(true);
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+#endif
+ QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/playlist.xml")));
+ disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
+ connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
+ connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
+ connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+}
+void PlayListMainWindow::error(QNetworkReply::NetworkError code) {
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
+ qDebug() << code;
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ QMaemo5InformationBox::information(this, tr("Playlist could not be retrieved."), QMaemo5InformationBox::DefaultTimeout);
+#endif
+}
+void PlayListMainWindow::readReady() {
+ QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
+ // append to buffer
+ mResponse += reply->readAll();
+}
+void PlayListMainWindow::finished(QNetworkReply * reply) {
+ // now we can call parseXmlList to process the full buffers
+ this->parseXmlPlayList();
+ // only interested in finished signals
+ disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
+ delete reply;
+}
+
+void PlayListMainWindow::parseXmlPlayList() {
+ mContents->clear();
+ QDomDocument doc;
+ doc.setContent(this->mResponse);
+ QDomElement docElem = doc.documentElement();
+ QDomNodeList nodes = docElem.elementsByTagName("node");
+ int depth = 0;
+
+ int currentLeafId = 0;
+ bool hasArt = false;
+ QString extension = "";
+
+ int ct = nodes.count();
+ for (int idx = 0; idx < ct; ++idx) {
+ QDomNode node = nodes.at(idx);
+ QString current = "";
+ //QString name = node.attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
+ int id = node.attributes().namedItem("id").nodeValue().toInt();
+ if (4 > id && 0 == QString::compare(node.attributes().namedItem("ro").nodeValue(), "ro")) {
+ // got the main playlist, let's build it up
+ if (node.hasChildNodes()) {
+ QDomNodeList leafs = node.childNodes();
+ int leafct = leafs.count();
+ if (0 < leafct) {
+ depth = 1;
+ for (int jdx = 0; jdx < leafct; ++jdx) {
+ QDomNode leaf = leafs.at(jdx);
+ parsePlayListItem(&leaf, &extension, &hasArt, ¤tLeafId, 1);
+ }
+ }
+ }
+
+ }
+ }
+
+ mResponse.clear();
+
+ emit this->idUpdated(currentLeafId, hasArt, extension);
+ this->updateList();
+
+
+}
+
+
+int PlayListMainWindow::parsePlayListItem(QDomNode *node, QString *extension, bool *hasArt, int *currentLeafId, int depth) {
+ int leafCt = 0;
+ if (NULL != node) {
+ QString current;
+ VlcPlayListElementSimple* el = new VlcPlayListElementSimple();
+ el->id = node->attributes().namedItem("id").nodeValue().toInt();
+ el->path = node->attributes().namedItem("uri").nodeValue();
+ el->name = node->attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
+ current = node->attributes().namedItem("current").nodeValue();
+ el->playing = (0 < current.length());
+ el->depth = depth;
+ if (0 != QString::compare(node->nodeName(), "node")) {
+ el->type = "leaf";
+ el->extension = getExtension(el->path, NULL);
+ if (el->playing) {
+ *currentLeafId = el->id;
+ QString art = node->toElement().namedItem("art_url").toElement().text();
+ *hasArt = (!art.isNull() && !art.isEmpty());
+ *extension = getExtension(el->path, NULL);
+ }
+ QString title = node->toElement().namedItem("title").toElement().text();
+ QString artist = node->toElement().namedItem("artist").toElement().text();
+ QString album = node->toElement().namedItem("album").toElement().text();
+ if (0 < artist.length() || 0 < album.length()) {
+ el->name = "" + title + "\n" + artist + " - " + album;
+ }
+ this->mContents->append(*el);
+ ++leafCt;
+ delete el;
+ }
+ else {
+ el->type = "node";
+ el->extension = getExtension(el->path, NULL);
+ // empty nodes appear in the playlist when they can't be played!
+ if (node->hasChildNodes()) {
+ this->mContents->append(*el);
+ ++leafCt;
+ }
+ delete el;
+ // now parse the child nodes as leaf.
+ if (node->hasChildNodes()) {
+ QDomNodeList items = node->childNodes();
+ int itemct = items.count();
+ int added = 0;
+ if (0 < itemct) {
+ ++depth;
+ for (int kdx = 0; kdx < itemct; ++kdx) {
+ QDomNode item = items.at(kdx);
+ added += parsePlayListItem(&item, extension, hasArt, currentLeafId, depth);
+ }
+ if (1 > added) {
+ // should remove the last PlayListElement
+ this->mContents->removeLast();
+ --leafCt;
+ }
+ else {
+ leafCt += added;
+ }
+ }
+ }
+ }
+ }
+ return leafCt;
+}
+
+QString PlayListMainWindow::getExtension(QString path, QString extension) {
+ // return extension if exists
+ if (!extension.isNull() && !extension.isEmpty()) return extension;
+ // return blank if no path
+ if (path.isNull() || path.isEmpty()) return "";
+ // otherwise extract the extension
+ int dot_pos = path.lastIndexOf('.');
+ if (0 < dot_pos) {
+ return path.right(path.length() - (dot_pos + 1));
+ }
+ else { // no dot
+ return "";
+ }
+}
+
+VlcPlayListElementSimple PlayListMainWindow::getElementFromId(int id) {
+ //if (0 != QString::compare("", text)) {
+ for (int idx = 0; idx < mContents->count(); ++idx) {
+ if (0 < id && (id == mContents->at(idx).id)) {
+ return mContents->at(idx);
+ }
+ }
+ //}
+ return *(new VlcPlayListElementSimple());
+}
+
+void PlayListMainWindow::updateList() {
+ ui->listWidget->clear();
+ int ct = this->mContents->count();
+ if (0 < ct) {
+ QIcon icon_audio = QIcon::fromTheme("general_audio_file");
+ QIcon icon_video = QIcon::fromTheme("general_video_file");
+ QIcon icon_image = QIcon::fromTheme("general_image");
+ QIcon icon_flash = QIcon::fromTheme("filemanager_flash_file");
+ QIcon icon_media = QIcon::fromTheme("filemanager_media_folder");
+ QIcon icon_real = QIcon::fromTheme("filemanager_real_music");
+ QIcon icon_playl = QIcon::fromTheme("filemanager_playlist");
+ QIcon icon_unknown= QIcon::fromTheme("filemanager_unknown_file");
+ for (int idx = 0; idx < ct; ++idx) {
+ VlcPlayListElementSimple el = mContents->at(idx);
+ QListWidgetItem* item;
+ if (0 == QString::compare("node", el.type)) {
+ item = new QListWidgetItem(icon_media, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
+ }
+ else {
+ if ( 0 == QString::compare(el.extension, "jpg") ||
+ 0 == QString::compare(el.extension, "jpeg") ||
+ 0 == QString::compare(el.extension, "gif") ||
+ 0 == QString::compare(el.extension, "png") ||
+ 0 == QString::compare(el.extension, "bmp") ) {
+ item = new QListWidgetItem(icon_image, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .jpg, .jpeg, .gif, .png, .bmp
+ }
+ else if ( 0 == QString::compare(el.extension, "mp3") ||
+ 0 == QString::compare(el.extension, "m4a") ||
+ 0 == QString::compare(el.extension, "ogg") ||
+ 0 == QString::compare(el.extension, "oga") ||
+ 0 == QString::compare(el.extension, "wav") ||
+ 0 == QString::compare(el.extension, "flac") ) {
+ item = new QListWidgetItem(icon_audio, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .mp3, .m4a, .ogg, .oga, .wav, .flac
+ }
+ else if ( 0 == QString::compare(el.extension, "m3u") ||
+ 0 == QString::compare(el.extension, "wpl") ||
+ 0 == QString::compare(el.extension, "pls") ||
+ 0 == QString::compare(el.extension, "asx") ||
+ 0 == QString::compare(el.extension, "xspf") ||
+ 0 == QString::compare(el.extension, "cmml") ) {
+ item = new QListWidgetItem(icon_playl, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .m3u, .wpl, .pls, .asx, .xspf, .cmml
+ }
+ else if ( 0 == QString::compare(el.extension, "avi") ||
+ 0 == QString::compare(el.extension, "mpeg") ||
+ 0 == QString::compare(el.extension, "mpg") ||
+ 0 == QString::compare(el.extension, "mov") ||
+ 0 == QString::compare(el.extension, "mp4") ||
+ 0 == QString::compare(el.extension, "m4v") ||
+ 0 == QString::compare(el.extension, "wmv") ||
+ 0 == QString::compare(el.extension, "mkv") ||
+ 0 == QString::compare(el.extension, "ogv") ) {
+ item = new QListWidgetItem(icon_video, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .avi, .mpg, .mpeg, .mov, .m4v, .mp4, .wmv, .mkv, .ogv
+ }
+ else if ( 0 == QString::compare(el.extension, "rm") ||
+ 0 == QString::compare(el.extension, "ra") ||
+ 0 == QString::compare(el.extension, "ram") ) {
+ item = new QListWidgetItem(icon_real, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .ram, 'rm, 'ra
+ }
+ else if ( 0 == QString::compare(el.extension, "flv") ) {
+ item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
+ }
+ //else if ( 0 == QString::compare(el.extension, "") ) {
+ // item = new QListWidgetItem(icon_unknown, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
+ //}
+ else {
+ if (el.name.contains("Flash")) {
+ item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
+ }
+ else {
+ item = new QListWidgetItem(icon_media, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
+ }
+ }
+ }
+ item->setSelected(el.playing);
+ ui->listWidget->addItem(item);
+ if (el.playing) {
+ ui->listWidget->scrollToItem(item, QAbstractItemView::PositionAtCenter);
+ }
+ }
+ }
+}
+void PlayListMainWindow::updateUiWithCurrentStatus(VlcStatus * status) {
+ ui->loopButton->setChecked(status->loop);
+ ui->repeatButton->setChecked(status->repeat);
+ ui->shuffleButton->setChecked(status->random);
+}
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef PLAYLISTMAINWINDOW_H
+#define PLAYLISTMAINWINDOW_H
+
+#include <QMainWindow>
+#include <QTimer>
+#include <QtNetwork>
+#include <QtXml>
+#include "vlcplaylistelementsimple.h"
+#include "vlcstatus.h"
+
+#ifndef LIST_ITEM_TYPE_OFFSET
+#define LIST_ITEM_TYPE_OFFSET 1000
+#endif
+
+namespace Ui {
+ class PlayListMainWindow;
+}
+
+class PlayListMainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ explicit PlayListMainWindow(QWidget *parent = 0);
+ ~PlayListMainWindow();
+ void init();
+public slots:
+ void onClear();
+ void onShuffle();
+ void onLoop();
+ void onPlay();
+ void onRepeat();
+ void onRemove();
+ void requestPlayList();
+ void onListSelectionChanged();
+ void finished(QNetworkReply * reply);
+ void readReady();
+ void error(QNetworkReply::NetworkError code);
+ void showPlayList();
+ void updateUiWithCurrentStatus(VlcStatus * status);
+
+protected slots:
+ void parseXmlPlayList();
+ void updateList();
+ int parsePlayListItem(QDomNode *node, QString *extension, bool *hasArt, int *currentLeafId, int depth);
+
+signals:
+ void idUpdated(int id, bool hasArt, QString extension);
+
+protected:
+ void changeEvent(QEvent *e);
+ VlcPlayListElementSimple getElementFromId(int id);
+ QString getExtension(QString path, QString extension);
+
+private:
+ Ui::PlayListMainWindow *ui;
+ QTimer * mTimer;
+ QString mIp;
+ QNetworkAccessManager * mNetManager;
+ QList<VlcPlayListElementSimple>* mContents;
+ VlcPlayListElementSimple mCurrentElement;
+ int mCurrentVlcIndex;
+ int mCurrentDepth;
+ QByteArray mResponse;
+};
+
+#endif // PLAYLISTMAINWINDOW_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PlayListMainWindow</class>
+ <widget class="QMainWindow" name="PlayListMainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Playlist</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QListWidget" name="listWidget">
+ <item>
+ <property name="text">
+ <string>not yet done</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>not yet done</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>not yet done</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="playButton">
+ <property name="text">
+ <string>Play</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="shuffleButton">
+ <property name="text">
+ <string>Shuffle</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="loopButton">
+ <property name="text">
+ <string>Loop</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="repeatButton">
+ <property name="text">
+ <string>Repeat</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QPushButton" name="clearButton">
+ <property name="text">
+ <string>Clear all</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="removeButton">
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuMenu">
+ <property name="title">
+ <string>menu</string>
+ </property>
+ </widget>
+ <addaction name="menuMenu"/>
+ </widget>
+ <action name="actionPortrait">
+ <property name="text">
+ <string>Portrait Mode</string>
+ </property>
+ </action>
+ <action name="actionLandscape">
+ <property name="text">
+ <string>Landscape Mode</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file>config-vlc.jpg</file>
+ </qresource>
+</RCC>
--- /dev/null
+<RCC>
+ <qresource prefix="/languages">
+ <file>vlcremote_fr_FR.qm</file>
+ </qresource>
+</RCC>
--- /dev/null
+#include "scanipdialog.h"
+#include "ui_scanipdialog.h"
+
+ScanIPDialog::ScanIPDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ScanIPDialog)
+{
+ ui->setupUi(this);
+}
+
+ScanIPDialog::~ScanIPDialog()
+{
+ delete ui;
+}
+
+void ScanIPDialog::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
--- /dev/null
+#ifndef SCANIPDIALOG_H
+#define SCANIPDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+ class ScanIPDialog;
+}
+
+class ScanIPDialog : public QDialog {
+ Q_OBJECT
+public:
+ explicit ScanIPDialog(QWidget *parent = 0);
+ ~ScanIPDialog();
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::ScanIPDialog *ui;
+};
+
+#endif // SCANIPDIALOG_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ScanIPDialog</class>
+ <widget class="QDialog" name="ScanIPDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>422</width>
+ <height>360</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>IP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lineEdit_2"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QListWidget" name="listWidget"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
+ <string>Scan</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Done</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+# -------------------------------------------------
+# Project created by QtCreator 2010-07-29T19:02:39
+# -------------------------------------------------
+QT += core \
+ gui \
+ network \
+ xml \
+ maemo5
+TARGET = vlc-remote
+TEMPLATE = app
+SOURCES += main.cpp \
+ playlistmainwindow.cpp \
+ playermainwindow.cpp \
+ configdialog.cpp \
+ aboutdialog.cpp \
+ accountdialog.cpp \
+ newaccountdialog.cpp \
+ browsemainwindow.cpp \
+ vlcbrowseelement.cpp \
+ vlcplaylistelementsimple.cpp \
+ vlcstatus.cpp \
+ appsettings.cpp \
+ favouritesmainwindow.cpp
+HEADERS += playlistmainwindow.h \
+ playermainwindow.h \
+ configdialog.h \
+ aboutdialog.h \
+ accountdialog.h \
+ newaccountdialog.h \
+ browsemainwindow.h \
+ vlcbrowseelement.h \
+ vlcplaylistelementsimple.h \
+ vlcstatus.h \
+ appsettings.h \
+ favouritesmainwindow.h
+FORMS += playlistmainwindow.ui \
+ playermainwindow.ui \
+ configdialog.ui \
+ aboutdialog.ui \
+ accountdialog.ui \
+ browsemainwindow.ui \
+ favouritesmainwindow.ui
+OTHER_FILES += vlc-remote.desktop
+RESOURCES += ressources.qrc
+TRANSLATIONS = vlcremote_fr_FR.ts
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Version=0.2
+Type=Application
+Terminal=true
+Name=vlc-remote
+Exec=/usr/bin/vlc-remote
+Icon=
+#X-Window-Icon=timerwidget
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+ * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program 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 this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "vlcbrowseelement.h"
+
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef VLCBROWSEELEMENT_H
+#define VLCBROWSEELEMENT_H
+#include <QString>
+#include <QDate>
+
+struct VlcBrowseElement {
+ QString type;
+ int size;
+ QDate date;
+ QString path;
+ QString name;
+ QString extension;
+} ;
+
+
+#endif // VLCBROWSEELEMENT_H
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+ * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program 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 this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "vlcplaylistelementsimple.h"
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef VLCPLAYLISTELEMENTSIMPLE_H
+#define VLCPLAYLISTELEMENTSIMPLE_H
+
+#include <QString>
+
+struct VlcPlayListElementSimple {
+ int id; // vlc playlist item id
+ int depth; // how deep in the tree
+ bool playing; // currently playing item
+ QString type; // node or leaf
+ QString extension; // file extension
+ QString path; // Only used for leaf - repeat name otherwise
+ QString name; // name or metadata title if available
+} ;
+
+#endif // VLCPLAYLISTELEMENTSIMPLE_H
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <location filename="aboutdialog.ui" line="14"/>
+ <source>Dialog</source>
+ <translation>À propos</translation>
+ </message>
+ <message>
+ <location filename="aboutdialog.ui" line="20"/>
+ <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application by Sacha schutz </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></source>
+ <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application par Sacha schutz </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></translation>
+ </message>
+</context>
+<context>
+ <name>AccountDialog</name>
+ <message>
+ <location filename="accountdialog.ui" line="14"/>
+ <source>Accounts</source>
+ <translation>Comptes</translation>
+ </message>
+ <message>
+ <location filename="accountdialog.ui" line="21"/>
+ <source>test</source>
+ <translation>test</translation>
+ </message>
+ <message>
+ <location filename="accountdialog.ui" line="31"/>
+ <source>Add</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="accountdialog.ui" line="41"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="accountdialog.ui" line="51"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <location filename="accountdialog.ui" line="77"/>
+ <source>Use</source>
+ <translation>Utiliser</translation>
+ </message>
+</context>
+<context>
+ <name>BrowseMainWindow</name>
+ <message>
+ <location filename="browsemainwindow.ui" line="14"/>
+ <source>MainWindow</source>
+ <translation>Vlc remote</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="27"/>
+ <source>Play</source>
+ <translation>Lire</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="34"/>
+ <source>Enqueue</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="41"/>
+ <source>Browse</source>
+ <translation>Ouvrir</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="60"/>
+ <source>menu</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="71"/>
+ <source>User Folder</source>
+ <translation>Utiliser</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="76"/>
+ <source>Home</source>
+ <translation>Dossier d'accueil</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="81"/>
+ <source>Set as Home</source>
+ <translation>Marquer comme dossier d'accueil</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="86"/>
+ <source>Favourites</source>
+ <translation>Favoris</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.ui" line="91"/>
+ <source>Add to Favourite</source>
+ <translation>Ajouter aux favoris</translation>
+ </message>
+ <message>
+ <source>configuration</source>
+ <translation type="obsolete">Configuration</translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="obsolete">À propos</translation>
+ </message>
+ <message>
+ <location filename="browsemainwindow.cpp" line="311"/>
+ <source>Directory could not be browsed!</source>
+ <translation>Le dossier ne peux être listé !</translation>
+ </message>
+</context>
+<context>
+ <name>ConfigDialog</name>
+ <message>
+ <location filename="configdialog.ui" line="14"/>
+ <source>Dialog</source>
+ <translation>Configuration</translation>
+ </message>
+ <message>
+ <location filename="configdialog.ui" line="20"/>
+ <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter IP of VLC server. </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Example : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Be sure you have properly configured Vlc</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and allows connection by adding this IP in /vlc/http/.hosts</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">More information on my blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></source>
+ <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
+<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
+<tr>
+<td style="border: none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mettre l'ip du Serveur VLC.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Exemple : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vous devez avoir configurer VLC correctement</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> et autoriser les connexions en ajoutant l'ip de votre N900 dans /vlc/http/.hosts</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Plus d'informations sur mon blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></translation>
+ </message>
+</context>
+<context>
+ <name>FavouritesMainWindow</name>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="14"/>
+ <source>MainWindow</source>
+ <translation>Vlc remote</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="26"/>
+ <source>Name</source>
+ <translation>Nom</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="36"/>
+ <source>Save</source>
+ <translation>Sauvegarder</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="47"/>
+ <source>Delete</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="54"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="61"/>
+ <source>Browse</source>
+ <translation>Ouvrir</translation>
+ </message>
+ <message>
+ <location filename="favouritesmainwindow.ui" line="82"/>
+ <source>Set as Home</source>
+ <translation>Dossier d'accueil</translation>
+ </message>
+</context>
+<context>
+ <name>NewAccountDialog</name>
+ <message>
+ <location filename="newaccountdialog.cpp" line="27"/>
+ <source>Add account</source>
+ <translation>Ajouter un compte</translation>
+ </message>
+ <message>
+ <location filename="newaccountdialog.cpp" line="44"/>
+ <source>Name:</source>
+ <translation>Nom : </translation>
+ </message>
+ <message>
+ <location filename="newaccountdialog.cpp" line="45"/>
+ <source>Ip:</source>
+ <translation>Ip : </translation>
+ </message>
+ <message>
+ <location filename="newaccountdialog.cpp" line="46"/>
+ <source>Port:</source>
+ <translation>Port : </translation>
+ </message>
+ <message>
+ <location filename="newaccountdialog.cpp" line="80"/>
+ <source>Edit account</source>
+ <translation>Édition d'un compte</translation>
+ </message>
+</context>
+<context>
+ <name>PlayListMainWindow</name>
+ <message>
+ <source>MainWindow</source>
+ <translation type="obsolete">Vlc remote</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="14"/>
+ <source>Playlist</source>
+ <translation>Liste de lecture</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="22"/>
+ <location filename="playlistmainwindow.ui" line="27"/>
+ <location filename="playlistmainwindow.ui" line="32"/>
+ <source>not yet done</source>
+ <translation>fonctions pas encore développée</translation>
+ </message>
+ <message>
+ <source>Clear</source>
+ <translation type="obsolete">Vider</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="42"/>
+ <source>Play</source>
+ <translation>Lire</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="49"/>
+ <source>Shuffle</source>
+ <translation>Aléatoire</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="59"/>
+ <source>Loop</source>
+ <translation>Boucler</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="69"/>
+ <source>Repeat</source>
+ <translation>Répéter</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="96"/>
+ <source>Clear all</source>
+ <translation>Vider</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="103"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="122"/>
+ <source>menu</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="129"/>
+ <source>Portrait Mode</source>
+ <translation>Mode Portrait</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.ui" line="134"/>
+ <source>Landscape Mode</source>
+ <translation>Mode Paysage</translation>
+ </message>
+ <message>
+ <source>configuration</source>
+ <translation type="obsolete">Configuration</translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="obsolete">À propos</translation>
+ </message>
+ <message>
+ <location filename="playlistmainwindow.cpp" line="172"/>
+ <source>Playlist could not be retrieved.</source>
+ <translation>Impossible de récupérer la liste de lecture.</translation>
+ </message>
+</context>
+<context>
+ <name>PlayerMainWindow</name>
+ <message>
+ <source>MainWindow</source>
+ <translation type="obsolete">Vlc remote</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="14"/>
+ <source>Vlc-Remote</source>
+ <translation>Vlc-Remote</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="50"/>
+ <location filename="playermainwindow.ui" line="66"/>
+ <location filename="playermainwindow.ui" line="82"/>
+ <source>Information</source>
+ <translation>Information</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="170"/>
+ <source><</source>
+ <translation><</translation>
+ </message>
+ <message>
+ <source>play</source>
+ <translation type="obsolete">Lire</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="184"/>
+ <source>></source>
+ <translation>></translation>
+ </message>
+ <message>
+ <source>Pause</source>
+ <translation type="obsolete">Pause</translation>
+ </message>
+ <message>
+ <source>play/pause</source>
+ <translation type="obsolete">Lire/Pause</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="191"/>
+ <source>Stop</source>
+ <translation>Stop</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="211"/>
+ <source>FS</source>
+ <translation>FS</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="231"/>
+ <source>V+</source>
+ <translation>V+</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="238"/>
+ <source>V-</source>
+ <translation>V-</translation>
+ </message>
+ <message>
+ <source>mute</source>
+ <translation type="obsolete">Couper le son</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="177"/>
+ <source>Play/Pause</source>
+ <translation>Lecture/Pause</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="245"/>
+ <source>Mute</source>
+ <translation>Couper le son</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="256"/>
+ <source>PlayList</source>
+ <translation>Liste de lecture</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="263"/>
+ <source>Browse</source>
+ <translation>Ouvrir</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="282"/>
+ <source>menu</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="294"/>
+ <source>Configuration</source>
+ <translation>Configuration</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="299"/>
+ <source>About</source>
+ <translation>À propos</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="304"/>
+ <source>Portrait Mode</source>
+ <translation>Mode Portrait</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="309"/>
+ <source>Landscape Mode</source>
+ <translation>Mode Paysage</translation>
+ </message>
+ <message>
+ <location filename="playermainwindow.ui" line="314"/>
+ <source>Auto Rotate</source>
+ <translation>À propos de l'orientation</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "vlcstatus.h"
--- /dev/null
+/* VLC-REMOTE for MAEMO 5
+* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2,
+* or (at your option) any later version, as published by the Free
+* Software Foundation
+*
+* This program 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 this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef VLCSTATUS_H
+#define VLCSTATUS_H
+#include <QString>
+
+enum VlcStatusState {
+ UNKNOWN,
+ STOP,
+ PLAYING,
+ PAUSED
+};
+
+struct VlcStatus {
+ bool newtrack;
+ bool random;
+ bool loop;
+ bool repeat;
+ bool hasart;
+ int volume;
+ int length;
+ int time;
+ int position;
+ VlcStatusState state;
+ QString title;
+ QString artist;
+ QString album;
+ QString nowplaying;
+};
+
+#endif // VLCSTATUS_H
+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=0.2
-Type=Application
-Terminal=true
-Name=vlc-remote
-Exec=/usr/bin/vlc-remote
-Icon=
-#X-Window-Icon=timerwidget
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
--- /dev/null
+QMAKEVERSION = $$[QMAKE_VERSION]
+ISQT4 = $$find(QMAKEVERSION, ^[2-9])
+isEmpty( ISQT4 ) {
+error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
+}
+
+TEMPLATE = subdirs
+SUBDIRS = src
+++ /dev/null
-# -------------------------------------------------
-# Project created by QtCreator 2010-07-29T19:02:39
-# -------------------------------------------------
-QT += core \
- gui \
- network \
- xml \
- maemo5
-TARGET = vlc-remote
-TEMPLATE = app
-SOURCES += main.cpp \
- playlistmainwindow.cpp \
- playermainwindow.cpp \
- configdialog.cpp \
- aboutdialog.cpp \
- accountdialog.cpp \
- newaccountdialog.cpp \
- browsemainwindow.cpp \
- vlcbrowseelement.cpp \
- vlcplaylistelementsimple.cpp \
- vlcstatus.cpp \
- appsettings.cpp \
- favouritesmainwindow.cpp
-HEADERS += playlistmainwindow.h \
- playermainwindow.h \
- configdialog.h \
- aboutdialog.h \
- accountdialog.h \
- newaccountdialog.h \
- browsemainwindow.h \
- vlcbrowseelement.h \
- vlcplaylistelementsimple.h \
- vlcstatus.h \
- appsettings.h \
- favouritesmainwindow.h
-FORMS += playlistmainwindow.ui \
- playermainwindow.ui \
- configdialog.ui \
- aboutdialog.ui \
- accountdialog.ui \
- browsemainwindow.ui \
- favouritesmainwindow.ui
-OTHER_FILES += vlc-remote.desktop
-RESOURCES += ressources.qrc
-TRANSLATIONS = vlcremote_fr_FR.ts
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
- * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * or (at your option) any later version, as published by the Free
- * Software Foundation
- *
- * This program 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 this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-#include "vlcbrowseelement.h"
-
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef VLCBROWSEELEMENT_H
-#define VLCBROWSEELEMENT_H
-#include <QString>
-#include <QDate>
-
-struct VlcBrowseElement {
- QString type;
- int size;
- QDate date;
- QString path;
- QString name;
- QString extension;
-} ;
-
-
-#endif // VLCBROWSEELEMENT_H
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
- * Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * or (at your option) any later version, as published by the Free
- * Software Foundation
- *
- * This program 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 this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-#include "vlcplaylistelementsimple.h"
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef VLCPLAYLISTELEMENTSIMPLE_H
-#define VLCPLAYLISTELEMENTSIMPLE_H
-
-#include <QString>
-
-struct VlcPlayListElementSimple {
- int id; // vlc playlist item id
- int depth; // how deep in the tree
- bool playing; // currently playing item
- QString type; // node or leaf
- QString extension; // file extension
- QString path; // Only used for leaf - repeat name otherwise
- QString name; // name or metadata title if available
-} ;
-
-#endif // VLCPLAYLISTELEMENTSIMPLE_H
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
-<context>
- <name>AboutDialog</name>
- <message>
- <location filename="aboutdialog.ui" line="14"/>
- <source>Dialog</source>
- <translation>À propos</translation>
- </message>
- <message>
- <location filename="aboutdialog.ui" line="20"/>
- <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application by Sacha schutz </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></source>
- <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">OMed </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Application par Sacha schutz </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">istdasklar@gmail.com</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">http://omedsoft.blogspot.com/</span></a></p></td></tr></table></body></html></translation>
- </message>
-</context>
-<context>
- <name>AccountDialog</name>
- <message>
- <location filename="accountdialog.ui" line="14"/>
- <source>Accounts</source>
- <translation>Comptes</translation>
- </message>
- <message>
- <location filename="accountdialog.ui" line="21"/>
- <source>test</source>
- <translation>test</translation>
- </message>
- <message>
- <location filename="accountdialog.ui" line="31"/>
- <source>Add</source>
- <translation>Ajouter</translation>
- </message>
- <message>
- <location filename="accountdialog.ui" line="41"/>
- <source>Edit</source>
- <translation>Éditer</translation>
- </message>
- <message>
- <location filename="accountdialog.ui" line="51"/>
- <source>Remove</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <location filename="accountdialog.ui" line="77"/>
- <source>Use</source>
- <translation>Utiliser</translation>
- </message>
-</context>
-<context>
- <name>BrowseMainWindow</name>
- <message>
- <location filename="browsemainwindow.ui" line="14"/>
- <source>MainWindow</source>
- <translation>Vlc remote</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="27"/>
- <source>Play</source>
- <translation>Lire</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="34"/>
- <source>Enqueue</source>
- <translation>Ajouter</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="41"/>
- <source>Browse</source>
- <translation>Ouvrir</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="60"/>
- <source>menu</source>
- <translation></translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="71"/>
- <source>User Folder</source>
- <translation>Utiliser</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="76"/>
- <source>Home</source>
- <translation>Dossier d'accueil</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="81"/>
- <source>Set as Home</source>
- <translation>Marquer comme dossier d'accueil</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="86"/>
- <source>Favourites</source>
- <translation>Favoris</translation>
- </message>
- <message>
- <location filename="browsemainwindow.ui" line="91"/>
- <source>Add to Favourite</source>
- <translation>Ajouter aux favoris</translation>
- </message>
- <message>
- <source>configuration</source>
- <translation type="obsolete">Configuration</translation>
- </message>
- <message>
- <source>About</source>
- <translation type="obsolete">À propos</translation>
- </message>
- <message>
- <location filename="browsemainwindow.cpp" line="311"/>
- <source>Directory could not be browsed!</source>
- <translation>Le dossier ne peux être listé !</translation>
- </message>
-</context>
-<context>
- <name>ConfigDialog</name>
- <message>
- <location filename="configdialog.ui" line="14"/>
- <source>Dialog</source>
- <translation>Configuration</translation>
- </message>
- <message>
- <location filename="configdialog.ui" line="20"/>
- <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enter IP of VLC server. </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Example : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Be sure you have properly configured Vlc</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and allows connection by adding this IP in /vlc/http/.hosts</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">More information on my blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></source>
- <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; font-size:14pt; font-weight:400; font-style:normal;">
-<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
-<tr>
-<td style="border: none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mettre l'ip du Serveur VLC.</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Exemple : <span style=" font-weight:600;">192.168.0.8:8080</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vous devez avoir configurer VLC correctement</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> et autoriser les connexions en ajoutant l'ip de votre N900 dans /vlc/http/.hosts</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Plus d'informations sur mon blog : <a href="http://omedsoft.blogspot.com/"><span style=" text-decoration: underline; color:#0000ff;">omed.blogspot.com</span></a><br /></p></td></tr></table></body></html></translation>
- </message>
-</context>
-<context>
- <name>FavouritesMainWindow</name>
- <message>
- <location filename="favouritesmainwindow.ui" line="14"/>
- <source>MainWindow</source>
- <translation>Vlc remote</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="26"/>
- <source>Name</source>
- <translation>Nom</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="36"/>
- <source>Save</source>
- <translation>Sauvegarder</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="47"/>
- <source>Delete</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="54"/>
- <source>Edit</source>
- <translation>Éditer</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="61"/>
- <source>Browse</source>
- <translation>Ouvrir</translation>
- </message>
- <message>
- <location filename="favouritesmainwindow.ui" line="82"/>
- <source>Set as Home</source>
- <translation>Dossier d'accueil</translation>
- </message>
-</context>
-<context>
- <name>NewAccountDialog</name>
- <message>
- <location filename="newaccountdialog.cpp" line="27"/>
- <source>Add account</source>
- <translation>Ajouter un compte</translation>
- </message>
- <message>
- <location filename="newaccountdialog.cpp" line="44"/>
- <source>Name:</source>
- <translation>Nom : </translation>
- </message>
- <message>
- <location filename="newaccountdialog.cpp" line="45"/>
- <source>Ip:</source>
- <translation>Ip : </translation>
- </message>
- <message>
- <location filename="newaccountdialog.cpp" line="46"/>
- <source>Port:</source>
- <translation>Port : </translation>
- </message>
- <message>
- <location filename="newaccountdialog.cpp" line="80"/>
- <source>Edit account</source>
- <translation>Édition d'un compte</translation>
- </message>
-</context>
-<context>
- <name>PlayListMainWindow</name>
- <message>
- <source>MainWindow</source>
- <translation type="obsolete">Vlc remote</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="14"/>
- <source>Playlist</source>
- <translation>Liste de lecture</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="22"/>
- <location filename="playlistmainwindow.ui" line="27"/>
- <location filename="playlistmainwindow.ui" line="32"/>
- <source>not yet done</source>
- <translation>fonctions pas encore développée</translation>
- </message>
- <message>
- <source>Clear</source>
- <translation type="obsolete">Vider</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="42"/>
- <source>Play</source>
- <translation>Lire</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="49"/>
- <source>Shuffle</source>
- <translation>Aléatoire</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="59"/>
- <source>Loop</source>
- <translation>Boucler</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="69"/>
- <source>Repeat</source>
- <translation>Répéter</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="96"/>
- <source>Clear all</source>
- <translation>Vider</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="103"/>
- <source>Remove</source>
- <translation>Supprimer</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="122"/>
- <source>menu</source>
- <translation></translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="129"/>
- <source>Portrait Mode</source>
- <translation>Mode Portrait</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.ui" line="134"/>
- <source>Landscape Mode</source>
- <translation>Mode Paysage</translation>
- </message>
- <message>
- <source>configuration</source>
- <translation type="obsolete">Configuration</translation>
- </message>
- <message>
- <source>About</source>
- <translation type="obsolete">À propos</translation>
- </message>
- <message>
- <location filename="playlistmainwindow.cpp" line="172"/>
- <source>Playlist could not be retrieved.</source>
- <translation>Impossible de récupérer la liste de lecture.</translation>
- </message>
-</context>
-<context>
- <name>PlayerMainWindow</name>
- <message>
- <source>MainWindow</source>
- <translation type="obsolete">Vlc remote</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="14"/>
- <source>Vlc-Remote</source>
- <translation>Vlc-Remote</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="50"/>
- <location filename="playermainwindow.ui" line="66"/>
- <location filename="playermainwindow.ui" line="82"/>
- <source>Information</source>
- <translation>Information</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="170"/>
- <source><</source>
- <translation><</translation>
- </message>
- <message>
- <source>play</source>
- <translation type="obsolete">Lire</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="184"/>
- <source>></source>
- <translation>></translation>
- </message>
- <message>
- <source>Pause</source>
- <translation type="obsolete">Pause</translation>
- </message>
- <message>
- <source>play/pause</source>
- <translation type="obsolete">Lire/Pause</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="191"/>
- <source>Stop</source>
- <translation>Stop</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="211"/>
- <source>FS</source>
- <translation>FS</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="231"/>
- <source>V+</source>
- <translation>V+</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="238"/>
- <source>V-</source>
- <translation>V-</translation>
- </message>
- <message>
- <source>mute</source>
- <translation type="obsolete">Couper le son</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="177"/>
- <source>Play/Pause</source>
- <translation>Lecture/Pause</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="245"/>
- <source>Mute</source>
- <translation>Couper le son</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="256"/>
- <source>PlayList</source>
- <translation>Liste de lecture</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="263"/>
- <source>Browse</source>
- <translation>Ouvrir</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="282"/>
- <source>menu</source>
- <translation></translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="294"/>
- <source>Configuration</source>
- <translation>Configuration</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="299"/>
- <source>About</source>
- <translation>À propos</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="304"/>
- <source>Portrait Mode</source>
- <translation>Mode Portrait</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="309"/>
- <source>Landscape Mode</source>
- <translation>Mode Paysage</translation>
- </message>
- <message>
- <location filename="playermainwindow.ui" line="314"/>
- <source>Auto Rotate</source>
- <translation>À propos de l'orientation</translation>
- </message>
-</context>
-</TS>
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#include "vlcstatus.h"
+++ /dev/null
-/* VLC-REMOTE for MAEMO 5
-* Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2,
-* or (at your option) any later version, as published by the Free
-* Software Foundation
-*
-* This program 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 this program; if not, write to the
-* Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-#ifndef VLCSTATUS_H
-#define VLCSTATUS_H
-#include <QString>
-
-enum VlcStatusState {
- UNKNOWN,
- STOP,
- PLAYING,
- PAUSED
-};
-
-struct VlcStatus {
- bool newtrack;
- bool random;
- bool loop;
- bool repeat;
- bool hasart;
- int volume;
- int length;
- int time;
- int position;
- VlcStatusState state;
- QString title;
- QString artist;
- QString album;
- QString nowplaying;
-};
-
-#endif // VLCSTATUS_H
<p>Les procèdures sont similaires suivant votre système d'exploitation ( Windows/Linux/Mac OS)</p>
<p>Nous considèrons ici que vous avez déjà installé VLC sur votre ordinateur</p>
<h4>Linux</h4>
- <ol>
+ <ol class="instructions">
<li>Démarrez VLC</li>
<li>Cliquez sur le menu <em>Outils</em></li>
<li>Cliquez sur <em>Préférences</em>, vous avez une fenêtre similaire à celle ci :
- <img width="90%" src="images/screenshots/vlc-linux-preferences-simple.jpeg" alt="VLC - Outils -Préférences" /></li>
+ <img src="images/screenshots/vlc-linux-preferences-simple.jpeg" alt="VLC - Outils -Préférences" /></li>
<li>Cliquez sur <em>Tous</em> en bas à gauche de la fenêtre,
la colonne de gauche contient maintenant une arboressence de menu
</li>
- <li>Double cliquez sur <em>Interface</em>, puis sur <em>Interfaces Principales</em>
- <img width="90%" src="images/screenshots/vlc-linux-interfaces-principales-http-checked.jpeg" alt="VLC - Outils -Préférences - Interfaces principales http" /></li></li>
-
+ <li>Double cliquez sur <em>Interface</em>, puis sur <em>Interfaces Principales</em>.<br />
+ Cocher la case <em>Interface de commande à distance HTTP</em>.
+ <img src="images/screenshots/vlc-linux-interfaces-principales-http-checked.jpeg" alt="VLC - Outils -Préférences - Interfaces principales http" /></li>
+ <li>
+ Dans l'arborescence à gauche cliquez sur <em>HTTP</em> en dessous d'<em>Interfaces principales</em>.<br />
+ Cochez la case <em>Exporter la jaquette vers « /art »</em><br />
+ Cliquez sur Enregistrer pour valider les paramètres et fermer la fenêtre, puis redémarez VLC.
+ <img src="images/screenshots/vlc-linux-interfaces-principales-http-art.jpeg" alt="VLC - Outils -Préférences - Interfaces principales http - art" />
+ </li>
</ol>
<h4>Windows</h4>
<h4>Mac OS</h4>
+
+
<h3>Configurer Vlc-remote sur votre mobile</h3>
<p>Lorsque vous démarez l'application la fenêtre de gestion de compte apparait.<br/>
Elle vous permet d'enregistrer plusieurs machines, ainsi vous pouvez facilement accèder
</p>
<h4>Gestionnaire de compte</h4>
-
<img src="" alt="Copite d'écran du gestionnaire de compte" />
-
- <ol>
+ <ol class="instructions">
<li><strong>Ajouter</strong>
<p>Un compte contient les éléments suivants : </p>
<ol>
</li>
</ol>
+ <h3>Utiliser</h3>
+ <p>L'affichage principale permet de controler la vidéo en cours
+ de lecture, de consulter la playlist et de naviguer dans les
+ repertoires de l'ordinateur sur leque Vlc est en cours d'éxecution.
+ </p>
<p><a href="#menu">Retour menu</a></p>
<h2 id="licence">4. Licence</h2>
text-decoration: underline;\r
}\r
\r
-p { margin-left: 1em; }
\ No newline at end of file
+p { margin-left: 1em; }\r
+\r
+.instructions img{\r
+ width: 90%;\r
+}
\ No newline at end of file