summaryrefslogtreecommitdiff
authoralwin <alwin>2005-04-14 09:23:25 (UTC)
committer alwin <alwin>2005-04-14 09:23:25 (UTC)
commitc643e152dc7d2167381d3fc0568ad4043de5604e (patch) (side-by-side diff)
tree3050f49d659a1d6eb54cca2a08ed64cf0d04842a
parentcb10570b4118161a066b741c2674d8d522670623 (diff)
downloadopie-c643e152dc7d2167381d3fc0568ad4043de5604e.zip
opie-c643e152dc7d2167381d3fc0568ad4043de5604e.tar.gz
opie-c643e152dc7d2167381d3fc0568ad4043de5604e.tar.bz2
gui polish
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/mwindow.cpp9
-rw-r--r--noncore/multimedia/opieplayer3/mwindow.h1
-rw-r--r--noncore/multimedia/opieplayer3/playlist.cpp6
-rw-r--r--noncore/multimedia/opieplayer3/videowidget.cpp1
4 files changed, 14 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer3/mwindow.cpp b/noncore/multimedia/opieplayer3/mwindow.cpp
index 75d1490..0898c7b 100644
--- a/noncore/multimedia/opieplayer3/mwindow.cpp
+++ b/noncore/multimedia/opieplayer3/mwindow.cpp
@@ -38,16 +38,17 @@
#include "../opieplayer2/lib.h"
#include <opie2/oapplicationfactory.h>
#include <opie2/owidgetstack.h>
#include <opie2/ofileselector.h>
#include <opie2/odebug.h>
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
#include <qfileinfo.h>
#include <qfile.h>
#include <qtoolbar.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
#include <qtimer.h>
#include <qslider.h>
@@ -56,17 +57,17 @@
OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
using namespace Opie::Ui;
PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f)
: QMainWindow(w,name,f)
{
checkLib();
- setCaption( QObject::tr("Opie Mediaplayer 3" ) );
+ setCaption(appTitle());
m_MainBox = new QWidget(this);
QVBoxLayout*m_l = new QVBoxLayout(m_MainBox);
m_stack = new OWidgetStack(m_MainBox);
m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen);
m_l->addWidget(m_stack);
@@ -206,16 +207,17 @@ void PMainWindow::slotPlayList()
void PMainWindow::slotUserStop()
{
if (!m_playing || !m_PlayLib) return;
m_playing = false;
m_PlayLib->stop();
m_PosSlider->setEnabled(false);
hideVideo();
slotShowList();
+ setCaption(appTitle());
}
void PMainWindow::slotTogglePlay(bool how)
{
if (how == m_playing) {
if (how) {
slotShowMediaWindow();
}
@@ -239,16 +241,17 @@ void PMainWindow::hideVideo()
void PMainWindow::slotPlayCurrent()
{
if (!m_LastItem) {
if (m_PlayLib) m_PlayLib->stop();
m_PosSlider->setEnabled(false);
a_playAction->setOn(false);
hideVideo();
slotShowList();
+ setCaption(appTitle());
return;
}
m_CurrentPos = 0;
m_playList->setCurrentItem(m_LastItem);
m_uppos = 0;
m_PosSlider->setValue(0);
int result = 0;
if (!m_LastItem->isVideo()) {
@@ -261,16 +264,17 @@ void PMainWindow::slotPlayCurrent()
setupVideo(a_ShowFull->isOn());
result = m_VideoPlayer->playFile(m_LastItem->Lnk(),m_PlayLib);
}
if (result<0) {
// fehler
return;
}
mediaWindowraised();
+ setCaption(appTitle()+" - "+m_LastItem->Lnk().name());
odebug << "Range: " << result << oendl;
m_PosSlider->setEnabled(true);
m_PosSlider->setRange(0,m_PlayLib->length());
m_PosSlider->setValue(m_PlayLib->currentTime());
QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) );
}
void PMainWindow::slotPlayNext()
@@ -306,17 +310,18 @@ void PMainWindow::slotStopped()
void PMainWindow::slotCheckPos()
{
if (!m_playing) return;
if (!m_pressed) {
m_uppos = m_PlayLib->currentTime();
emit sigPos(m_uppos);
m_PosSlider->setValue(m_PlayLib->currentTime());
}
- QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) );
+ qApp->processEvents(100);
+ QTimer::singleShot( 900, this, SLOT( slotCheckPos() ) );
}
void PMainWindow::slotRemoveFiles()
{
if (m_playing||!m_playList->isVisible()) return;
PlaylistItem* Item = m_playList->currentItem();
slotShowList();
m_playList->removeFromList(Item);
diff --git a/noncore/multimedia/opieplayer3/mwindow.h b/noncore/multimedia/opieplayer3/mwindow.h
index 5d011d5..3ea9a52 100644
--- a/noncore/multimedia/opieplayer3/mwindow.h
+++ b/noncore/multimedia/opieplayer3/mwindow.h
@@ -59,16 +59,17 @@ class AudioWidget;
class VideoWidget;
class PlaylistItem;
class QSlider;
class PMainWindow : public QMainWindow {
Q_OBJECT
public:
static QString appName() { return QString::fromLatin1("opie-mediaplayer3" ); }
+ static QString appTitle() {return QString::fromLatin1("Opie Mediaplayer 3" ); }
PMainWindow(QWidget*, const char*, WFlags );
virtual ~PMainWindow();
public slots:
virtual void slotVideoclicked();
protected:
/* GUI parts */
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp
index 2eb40e3..6f2e668 100644
--- a/noncore/multimedia/opieplayer3/playlist.cpp
+++ b/noncore/multimedia/opieplayer3/playlist.cpp
@@ -159,16 +159,18 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
default:
msg += tr("Unknown error");
break;
}
QMessageBox::warning(0,tr("Error reading fileheader"),msg);
return;
}
m_lastItem = m_items.last();
+ PlaylistItem*_it = currentItem();
+
if (m_lastItem) {
m_lastItem = new PlaylistItem(aFile,this,m_lastItem);
} else {
m_lastItem = new PlaylistItem(aFile,this);
}
m_lastItem->setExpandable(false);
m_lastItem->setText(1,name);
@@ -194,17 +196,19 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName)
codec.sprintf("%2i:%2i:%2i h",h,m,l);
} else {
codec.sprintf("%02i:%02i m",m,l);
}
// time
m_lastItem->setText(COL_TIME,codec);
m_lastItem->Video(m_Infolib->hasVideo());
m_items.append(m_lastItem);
- setSelected(m_lastItem,true);
+ if (_it==NULL) {
+ setSelected(m_lastItem,true);
+ }
}
void PlaylistView::slotAppendDir()
{
QString _dir = Opie::Ui::OFileDialog::getDirectory(Opie::Ui::OFileSelector::Extended,m_lastDir,0,m_lastDir);
if (_dir.isEmpty()) return;
m_lastDir = _dir;
QDir sDir(_dir);
diff --git a/noncore/multimedia/opieplayer3/videowidget.cpp b/noncore/multimedia/opieplayer3/videowidget.cpp
index 833ecb4..414400b 100644
--- a/noncore/multimedia/opieplayer3/videowidget.cpp
+++ b/noncore/multimedia/opieplayer3/videowidget.cpp
@@ -52,16 +52,17 @@ int VideoWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
if (!m_xineLib) {
return -1;
}
connect(m_xineLib,SIGNAL(stopped()),this,SLOT(slotStopped()));
m_xineLib->setWidget(m_Videodisplay);
m_xineLib->setShowVideo(true);
int res = m_xineLib->play(m_current.file());
vSize = m_xineLib->videoSize();
+
slot_Videoresized(m_Videodisplay->size());
odebug << "Xine play: " << res << oendl;
if (res != 1) {
return -2;
}
return m_xineLib->length();
}