}
else if(b[0]==QString("setint")){
bool ok;
- QString e=QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(b[1])).toInt(), 0, 100, 1, &ok);
+ int e=QInputDialog::getInt(this, "setInt", b[1] , conf->value(QString(b[1])).toInt(), 0, 100, 1, &ok);
if(ok)conf->setValue(b[1], e);
}
else if(b[0]==QString("start")){
}
download(a, aa);
connect(m, SIGNAL(downloaded()), SLOT(writeFile()));
+ }
+ else if(b[0]==QString("play")){
+
}
else if(b[0]==QString("vid")){
addMedia(c);
}
else if(b[0]==QString("history")){
flush();
- //addWidget(QString("back"), new CLabel(trUtf8("back", "label of history's \"back\" button"), conf->value(QString("button")).toString()));
+ QString wi;
for(int i=0; i<way.size(); i++){
- addWidget(QString(way[i]), new CLabel(QString(way[i]), conf->value(QString("button")).toString()));
+ wi=way[i];
+ addWidget(QString(wi), new CLabel(QString(wi), conf->value(QString("button")).toString()));
+ addWidget(QString("rm "+i), new CLabel(QString("del")), conf->value(QString("button")).toString());
+
}
}
+ else if(b[0]==QString("rm")){
+ way.removeAt(b[1]);
+ }
else if(b[0]==QString("read")){
QFile a(b[1]);
a.open(QIODevice::ReadOnly);
QMessageBox::information(this, trUtf8("RAWsent", "message title when data has been send"), trUtf8("sendRAW finish", "message text when data has been send"));
}
void MainWindow::back(){
- if(label->text()!=QString("video")){
- flush();
+ if(!((video)&&(playlist))){
getButtons(conf->value(QString("menuback")).toString());
}else{
getButtons(QString("+video"));
for(int i=1; i<a; i++){
q->prepare(d);
int b=in.split('\n').at(i).count('$');
- qDebug()<<i<<"th line, "<<b<<" delimiter";
+ //qDebug()<<i<<"th line, "<<b<<" delimiter";
for(int j=0; j<b+1; j++){
q->bindValue(j, QString(in.split('\n').at(i).split('$').at(j)));
- qDebug()<<"bind "<<j<<" and "<< QString(in.split('\n').at(i).split('$').at(j));
+ //qDebug()<<"bind "<<j<<" and "<< QString(in.split('\n').at(i).split('$').at(j));
}
qDebug()<<"q->exec() : "<<q->exec()<<" lastError()="<<q->lastError();
}
void MainWindow::addMedia(const QString & a){
if((video)&&(playlist)){
- playlist->addMedia(QMediaResource(a));
+ playlist->addMedia(QUrl(a));
}else{
flush();
- video=new QMediaPlayer(this);
- videoWidget=new QVideoWidget(this);
- playlist=new QMediaPlaylist(this);
- video->setVideoOutput(videoWidget);
+
+ playlist = new QMediaPlaylist;
+ playlist->addMedia(QUrl::fromLocalFile(a));
+ playlist->setCurrentIndex(1);
+
+ video = new QMediaPlayer;
video->setPlaylist(playlist);
- playlist->load(QUrl(a));
- int c=grid->count();
- int maxc=conf->value(QString("maxcolumn")).toInt();
- //if(!orientation)
- grid->addWidget(videoWidget, c/maxc, c%maxc, 1, -1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
- //else grid->addWidget(videoWidget, c/maxc, c%maxc, -1, 1, Qt::AlignJustify| Qt::AlignVCenter | Qt::AlignHCenter);
- label->setText(QString("video"));
- video->play();
+
+ videoWidget = new QVideoWidget;
+ video->setVideoOutput(videoWidget);
+ videoWidget->show();
+ grid->addWidget(videoWidget,0,0,1,-1);
+ connect(video, SIGNAL(videoAvailableChanged(bool)), video, SLOT(play()));
+
}
}
+void MainWindow::play(){
+ video->play();
+}
void MainWindow::resizeEvent(QResizeEvent *event)
{
QSize size = event->size();