[Jahshaka-cvs] SF.net SVN: editopia:[226] cinesuite/cineplay-cinecode/trunk/src
Status: Beta
Brought to you by:
jahshaka
From: <tim...@us...> - 2008-11-05 09:00:08
|
Revision: 226 http://editopia.svn.sourceforge.net/editopia/?rev=226&view=rev Author: timdewhirst Date: 2008-11-05 09:00:02 +0000 (Wed, 05 Nov 2008) Log Message: ----------- cinesuite * fix favourites table * remove warning from ScrollViewResizer * fixup checkable menu entries * tweak favourite tray entry layout Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp cinesuite/cineplay-cinecode/trunk/src/CineCode.h cinesuite/cineplay-cinecode/trunk/src/Common.cpp cinesuite/cineplay-cinecode/trunk/src/FavoriteTrayEntry.cpp cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.cpp cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.h cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.cpp cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.h cinesuite/cineplay-cinecode/trunk/src/SkinDlg.h cinesuite/cineplay-cinecode/trunk/src/resources/default.css cinesuite/cineplay-cinecode/trunk/src/windows/favorite_tray_entry.ui Modified: cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2008-11-05 09:00:02 UTC (rev 226) @@ -54,6 +54,7 @@ #include <QResizeEvent> #include <QMouseEvent> #include <QIcon> +#include <QSpacerItem> #include <QDebug> // olibs @@ -162,11 +163,12 @@ sv->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); // setup a placeholder - m_favouriteTrayViewport = sv->viewport(); - m_favouriteTrayPlaceholder = new QWidget( sv->viewport() ); + m_favouriteTrayPlaceholder = new QWidget(); m_favouriteTrayPlaceholder->setLayout( new QVBoxLayout ); m_favouriteTrayPlaceholder->layout()->setMargin( 0 ); m_favouriteTrayPlaceholder->layout()->setSpacing( 0 ); + sv->setWidget( m_favouriteTrayPlaceholder ); + sv->setWidgetResizable( true ); m_encodeStack->insertWidget( ENUM_FAVOURITE, sv ); } @@ -501,7 +503,7 @@ favorites->getName( i ), QFileInfo( favorites->getUrl( i ) ).fileName(), favorites->getThumbnail( i ) ); - new ScrollViewResizer( e, m_favouriteTrayViewport, ScrollViewResizer::HORIZONTAL ); + new ScrollViewResizer( e, m_favouriteTrayPlaceholder, ScrollViewResizer::HORIZONTAL ); m_favouriteTrayPlaceholder->layout()->addWidget( e ); QFont f( font() ); @@ -517,6 +519,10 @@ e->show(); m_favouriteTrayEntries.push_back( e ); } + + m_favouriteTrayPlaceholder->layout()->addItem( new QSpacerItem( 10, 10, + QSizePolicy::Minimum, + QSizePolicy::Expanding ) ); } void CineCode::onRemoveFavorite( int id ) Modified: cinesuite/cineplay-cinecode/trunk/src/CineCode.h =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CineCode.h 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/CineCode.h 2008-11-05 09:00:02 UTC (rev 226) @@ -107,7 +107,6 @@ QWidget* m_encodeTrayPlaceholder; QWidget* m_favouriteTrayPlaceholder; QWidget* m_encodeTrayViewport; - QWidget* m_favouriteTrayViewport; EncodeJobList m_encodeJobList; WidgetVector m_favouriteTrayEntries; Modified: cinesuite/cineplay-cinecode/trunk/src/Common.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2008-11-05 09:00:02 UTC (rev 226) @@ -218,7 +218,9 @@ m_menuViewShowAction = m_menuView->addAction( tr( "hide &video" ), this, SLOT( onViewHideVideo() ) ); m_menuView->addSeparator(); m_menuViewLoopAction = m_menuView->addAction( tr( "&loop" ), this, SLOT( onViewLoop() ) ); + m_menuViewLoopAction->setCheckable( true ); m_menuViewPlayAllAction = m_menuView->addAction( tr( "&play all" ), this, SLOT( onPlayAll() ) ); + m_menuViewPlayAllAction->setCheckable( true ); m_menubar->addMenu( m_menuView ); // window @@ -880,8 +882,8 @@ QStringList filtersAsList = filters.split( " ", QString::SkipEmptyParts ); QString filtersString = tr( "media files (%1)" ).arg( filtersAsList.join( " " ) ); - SkinDialog* dialog = new SkinDialog(); - QFileDialog* fd = new QFileDialog( dialog, tr( "open media" ) ); + std::auto_ptr< SkinDialog > dialog( new SkinDialog() ); + QFileDialog* fd = new QFileDialog( dialog.get(), tr( "open media" ) ); dialog->SetContentWidget( fd ); fd->setWindowFlags( Qt::FramelessWindowHint | Qt::CustomizeWindowHint ); fd->setNameFilters( QStringList() << tr( "all files (*.*)" ) << filtersAsList ); @@ -891,7 +893,6 @@ return; QString fname = fd->selectedFiles()[0]; - delete dialog; if(!fname.isEmpty()) { @@ -1154,18 +1155,13 @@ void Common::onViewLoop() { DEBUG_LOG; - - bool chk = m_menuViewLoopAction->isChecked(); - m_menuViewLoopAction->setChecked( !chk ); } void Common::onPlayAll() { DEBUG_LOG; - bool checked = !m_menuViewPlayAllAction->isChecked(); - m_menuViewPlayAllAction->setChecked( checked ); - if ( checked ) + if ( m_menuViewPlayAllAction->isChecked() ) { onFavSelected( m_currentFavourite ); onPlay(); Modified: cinesuite/cineplay-cinecode/trunk/src/FavoriteTrayEntry.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/FavoriteTrayEntry.cpp 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/FavoriteTrayEntry.cpp 2008-11-05 09:00:02 UTC (rev 226) @@ -36,6 +36,8 @@ { ui.setupUi( this ); + setFixedHeight( minimumSizeHint().height() ); + if ( !thumb.isNull() && thumb.size() != QSize() ) ui.image->setPixmap( QPixmap::fromImage( thumb ) ); ui.name_label->setText( name ); Modified: cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.cpp 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.cpp 2008-11-05 09:00:02 UTC (rev 226) @@ -23,7 +23,9 @@ // qt #include <QTableWidget> #include <QTableWidgetItem> +#include <QHeaderView> #include <QSet> +#include <QDebug> RemoveFavouriteDlg::RemoveFavouriteDlg( QWidget* parent, cineplay::CFavourites* favs ) @@ -37,6 +39,13 @@ unsigned int count = m_favList->getEntryCount(); + ui.favList->setSortingEnabled( false ); + ui.favList->setSelectionBehavior( QAbstractItemView::SelectRows ); + ui.favList->setSelectionMode( QAbstractItemView::SingleSelection ); + ui.favList->setEditTriggers( QAbstractItemView::NoEditTriggers ); + ui.favList->verticalHeader()->hide(); + ui.favList->horizontalHeader()->setResizeMode( 2, QHeaderView::Stretch ); + // populate the table for( int t=0; t<count; ++t ) { @@ -45,6 +54,7 @@ if(num != -1) frameString = QString::number(num); + ui.favList->insertRow( t ); QTableWidgetItem* name = new QTableWidgetItem( m_favList->getName(t) ); QTableWidgetItem* frame = new QTableWidgetItem( frameString ); QTableWidgetItem* url = new QTableWidgetItem( m_favList->getUrl(t) ); @@ -54,7 +64,8 @@ ui.favList->setItem( t, 2, url ); } - ConnectCtrlButton( tr( "Delete" ), true ); + ConnectCtrlButton( "delete_button", true ); + ConnectCtrlButton( "cancel_button", false ); } @@ -69,7 +80,7 @@ s.insert( item->row() ); foreach ( int r, s ) - ui.favList->removeRow( r ); + m_favList->removeEntry( r ); } SkinDialog::accept(); Modified: cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.h =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.h 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/RemoveFavouriteDlg.h 2008-11-05 09:00:02 UTC (rev 226) @@ -30,6 +30,8 @@ class RemoveFavouriteDlg : public SkinDialog { + Q_OBJECT + protected: Ui::remove_favourite ui; cineplay::CFavourites* m_favList; @@ -37,5 +39,6 @@ public: RemoveFavouriteDlg( QWidget *parent, cineplay::CFavourites *favs ); +public slots: void accept(); }; Modified: cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.cpp 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.cpp 2008-11-05 09:00:02 UTC (rev 226) @@ -18,8 +18,6 @@ // Copyright (C) 2008 Audiotube Ltd. // For more information, see http://www.audiotube.com -#pragma once - #include "ScrollViewResizer.h" // qt Modified: cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.h =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.h 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/ScrollViewResizer.h 2008-11-05 09:00:02 UTC (rev 226) @@ -21,7 +21,7 @@ #pragma once // qt -#include <qobject.h> +#include <QObject> /// simple event filter to ensure that an item is always made to fit a viewport. /// this class should normally be created as a child of the item to be resized. Modified: cinesuite/cineplay-cinecode/trunk/src/SkinDlg.h =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/SkinDlg.h 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/SkinDlg.h 2008-11-05 09:00:02 UTC (rev 226) @@ -42,7 +42,6 @@ void ConnectStandardButtons(QWidget *parent); public: - SkinDialog( QWidget* parent = 0 ); void SetContentWidget(QWidget *w); Modified: cinesuite/cineplay-cinecode/trunk/src/resources/default.css =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/resources/default.css 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/resources/default.css 2008-11-05 09:00:02 UTC (rev 226) @@ -3,7 +3,7 @@ background-color: rgb( 0, 0, 0, 0% ); } -#tray, #styledlg, QFileDialog { +#tray, #styledlg, QDialog { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop: 0 #424242, stop: 1 #181818); } @@ -342,3 +342,11 @@ #favorite_tray_entry[alternate], #favorite_tray_entry[alternate] * { background-color: #dddddd; } + +#favorite_tray_entry #bottom_button { + background-image: url(":/images/stop-normal"); + min-width: 12px; + max-width: 12px; + min-height: 12px; + max-height: 12px; +} Modified: cinesuite/cineplay-cinecode/trunk/src/windows/favorite_tray_entry.ui =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/windows/favorite_tray_entry.ui 2008-11-05 08:57:09 UTC (rev 225) +++ cinesuite/cineplay-cinecode/trunk/src/windows/favorite_tray_entry.ui 2008-11-05 09:00:02 UTC (rev 226) @@ -9,12 +9,6 @@ <height>75</height> </rect> </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="windowTitle" > <string>Form1</string> </property> @@ -104,24 +98,6 @@ </property> <item> <widget class="QPushButton" name="bottom_button" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize" > - <size> - <width>16</width> - <height>16</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>16</width> - <height>16</height> - </size> - </property> <property name="text" > <string/> </property> @@ -161,9 +137,6 @@ <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> - <property name="wordWrap" > - <bool>true</bool> - </property> </widget> </item> </layout> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |