Re-added controller renaming

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1029 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-05-28 04:07:33 +00:00
parent d8848ff6a0
commit cddc8405e0
3 changed files with 34 additions and 5 deletions

View File

@@ -4,7 +4,11 @@
Restore gain setting when loading a project and keep gain setting when
changing sample rate
2008-05-26 Paul Giblock <drfaygo/at/gmail/dot/com>
* include/controller_view.h:
* src/gui/widgets/controller_view.cpp:
reverted toby's controllerView changes.
2008-05-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/controller_view.h:
* src/gui/widgets/controller_view.cpp:

View File

@@ -78,6 +78,7 @@ protected:
virtual void contextMenuEvent( QContextMenuEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void modelChanged( void );
virtual void mouseDoubleClickEvent( QMouseEvent * event );
private:

View File

@@ -32,6 +32,7 @@
#include <QtGui/QMdiArea>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QPainter>
#include <QtGui/QInputDialog>
#include "caption_menu.h"
#include "controller_dialog.h"
@@ -52,12 +53,12 @@ controllerView::controllerView( controller * _model, QWidget * _parent ) :
m_controllerDlg( NULL ),
m_show( TRUE )
{
setFixedSize( 210, 20 );
setFixedSize( 210, 32 );
setAttribute( Qt::WA_OpaquePaintEvent, TRUE );
m_bypass = new ledCheckBox( "", this, tr( "Turn the controller off" ) );
m_bypass->move( 3, 3 );
m_bypass->move( 3, 2 );
m_bypass->setWhatsThis( tr( "Toggles the controller on or off." ) );
toolTip::add( m_bypass, tr( "On/Off" ) );
@@ -140,13 +141,36 @@ void controllerView::paintEvent( QPaintEvent * )
f.setBold( TRUE );
p.setFont( f );
p.drawText( 6, 55, castModel<controller>()->publicName() );
controller * c = castModel<controller>();
p.setPen( QColor( 64, 64, 64 ) );
p.drawText( 21, 13, c->publicName() );
p.setPen( Qt::white );
p.drawText( 5, 54, castModel<controller>()->publicName() );
p.drawText( 20, 12, c->publicName() );
f.setBold( FALSE );
p.setFont( f );
p.drawText( 6, 26, c->name() );
}
void controllerView::mouseDoubleClickEvent( QMouseEvent * event )
{
bool ok;
controller * c = castModel<controller>();
QString new_name = QInputDialog::getText( this,
tr( "Rename controller" ),
tr( "Enter the new name for this controller" ),
QLineEdit::Normal, c->name() , &ok );
if( ok && !new_name.isEmpty() )
{
c->setName( new_name );
update();
}
}
void controllerView::modelChanged( void )
{