--- /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>
#include "accountdialog.h"
#include "ui_accountdialog.h"
+#include "newaccountdialog.h"
#include <QDebug>
#include <QInputDialog>
#include <QSettings>
+#include <QTcpSocket>
AccountDialog::AccountDialog(QWidget *parent) :
QDialog(parent),
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(); // On charge les compte
+ load();
}
{
delete ui;
}
+
void AccountDialog::add()
{
- QString ip = QInputDialog::getText(this,"ip?","enter your ip");
- // On peut checker si c'est une bonne forme d'ip avec QRegExp
-
- if (!ip.isEmpty()) {
- QString ipKey = "Label"+ip; // La faudra l'integré dans un widget personnalisé ( entrez le label, entrez l' IP)
-
- QSettings settings;
- settings.beginGroup("account");
- settings.setValue(ipKey, ip);
- settings.endGroup();
-
- load(); // On recharge les compte
- }
+ NewAccountDialog *dialog = new NewAccountDialog(this);
+ dialog->exec();
+ load();
}
+
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;
+ settings.beginGroup("config");
+ QString useKey = settings.value("currentKey").toString();
+ settings.endGroup();
+
settings.beginGroup("account");
foreach ( QString key, settings.allKeys())
{
QListWidgetItem * item = new QListWidgetItem;
+
+ // ========> NEED TO USE QFUTUR
+ // QString hostIp = settings.value(key).toString();
+ // QTcpSocket * socket = new QTcpSocket(this);
+ // socket->connectToHost(hostIp, 80);
+ // if (socket->waitForConnected(1000))
+ // item->setBackgroundColor(Qt::green);
+ // else
+ // item->setBackgroundColor(Qt::red);
+
+
item->setText(key);
- item->setData(Qt::UserRole,settings.value(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);
-
}
settings.endGroup();
}
void AccountDialog::edit()
{
- QString currentValue = ui->listWidget->currentItem()->data(Qt::UserRole).toString();
+ 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();
- QString ip = QInputDialog::getText(this, "ip ?", "enter your ip", QLineEdit::Normal, currentValue);
-
- if (!ip.isEmpty()) {
- QString ipKey = "Label"+ip; // La faudra l'integré dans un widget personnalisé ( entrez le label, entrez l' IP)
-
- QSettings settings;
- settings.beginGroup("account");
- settings.remove(currentKey);
- settings.setValue(ipKey, ip);
- settings.endGroup();
-
- load();
-
- }
+ load();
}
void AccountDialog::rem()
load(); // On recharge les compte
}
+void AccountDialog::use()
+{
+ QString currentKey = ui->listWidget->currentItem()->text();
+
+ QSettings settings;
+ settings.beginGroup("config");
+ settings.setValue("currentKey", currentKey);
+ settings.endGroup();
+
+ load();
+}
+
void AccountDialog::enableUi()
{
ui->editButton->setEnabled(true);
ui->remButton->setEnabled(true);
+ ui->useButton->setEnabled(true);
}