Disallow duplicate automation connections. Busy cursor while loading

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1536 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-09-03 00:19:09 +00:00
parent affa58f6eb
commit 8807368377
3 changed files with 35 additions and 6 deletions

View File

@@ -19,6 +19,14 @@
Change Piano-Roll paste behavior. Instead of pasting at 0, paste at the
quantized location of the time-line's position-indicator.
* src/gui/main_window.cpp:
Display waiting cursor when loading project. Really only helps when
loading a large song while another is loaded. Provides feedback before
the loading dialog appears (I guess this is during project close)
* src/core/automation_pattern.cpp:
Don't connect to the same model more than once.
2008-09-01 Paul Giblock <drfaygo/at/gmail/dot/com>
* include/track_container.h:

View File

@@ -94,12 +94,28 @@ automationPattern::~automationPattern()
void automationPattern::addObject( automatableModel * _obj )
{
m_objects += _obj;
// been empty before?
if( m_objects.size() == 1 && !hasAutomation() )
bool addIt = true;
for( objectVector::iterator it = m_objects.begin();
it != m_objects.end(); ++it )
{
// then initialize default-value
putValue( 0, _obj->value<float>(), FALSE );
if( *it == _obj ) {
// Already exists
// TODO: Maybe let the user know in some non-annoying way
addIt = false;
break;
}
}
if( addIt )
{
m_objects += _obj;
// been empty before?
if( m_objects.size() == 1 && !hasAutomation() )
{
// then initialize default-value
putValue( 0, _obj->value<float>(), FALSE );
}
}
}
@@ -591,7 +607,8 @@ void automationPatternView::constructContextMenu( QMenu * _cm )
if( !m_pat->m_objects.isEmpty() )
{
_cm->addSeparator();
QMenu * m = new QMenu( tr( "Connections" ), _cm );
QMenu * m = new QMenu( tr( "%1 Connections" ).
arg( m_pat->m_objects.count() ), _cm );
for( automationPattern::objectVector::iterator it =
m_pat->m_objects.begin();
it != m_pat->m_objects.end(); ++it )

View File

@@ -648,8 +648,10 @@ void mainWindow::openProject( void )
if( ofd.exec () == QDialog::Accepted &&
!ofd.selectedFiles().isEmpty() )
{
setCursor( Qt::WaitCursor );
engine::getSong()->loadProject(
ofd.selectedFiles()[0] );
setCursor( Qt::ArrowCursor );
}
}
}
@@ -674,8 +676,10 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void )
void mainWindow::openRecentlyOpenedProject( QAction * _action )
{
const QString & f = _action->text();
setCursor( Qt::WaitCursor );
engine::getSong()->loadProject( f );
configManager::inst()->addRecentlyOpenedProject( f );
setCursor( Qt::ArrowCursor );
}