Diffstat (limited to 'libopie/big-screen/omodalhelper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/big-screen/omodalhelper.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie/big-screen/omodalhelper.cpp b/libopie/big-screen/omodalhelper.cpp index e3d1c70..c5a47b3 100644 --- a/libopie/big-screen/omodalhelper.cpp +++ b/libopie/big-screen/omodalhelper.cpp @@ -47,65 +47,65 @@ OModalHelperSignal::~OModalHelperSignal() { /* Helper Controler */ /* * the dialogs signal will be slotted here * and we will call into m_base */ OModalHelperControler::OModalHelperControler( OModalHelperBase* base, QObject* parent ) : QObject(parent, "OModal Helper Controler" ), m_base( base ), m_dia( 0 ), m_id( -1 ) { } TransactionID OModalHelperControler::transactionID()const { return m_id; } void OModalHelperControler::setTransactionID( TransactionID id ) { m_dia = 0; m_id = id; } QDialog* OModalHelperControler::dialog()const { return m_dia; } /* * If we're in the New mode we will map the QDialog * to the TransactionID */ void OModalHelperControler::done( int result ) { if ( sender() && !sender()->isA("OModalQueuedDialog") ) m_dia = static_cast<QDialog*>( sender() ); - m_base->done( m_id ); + m_base->done( result, m_id ); } void OModalHelperControler::next() { m_base->next( m_id ); } void OModalHelperControler::prev() { m_base->prev( m_id ); } /* The Queued Dialog inclusive QueuedBar */ struct OModalQueueBar : public QHBox { QPushButton* next; QPushButton* prev; QLabel * label; OModalQueueBar( QWidget* parent ); void setText( const QString& str ); }; OModalQueueBar::OModalQueueBar( QWidget* parent ) : QWidget( parent, "OModal Queue Bar" ) { prev = new QPushButton( this ); prev->setText( OModalQueuedDialog::tr("Prev") ); label = new QLabel(this); next = new QPushButton( this ); next->setText( OModalQueuedDialog::tr("Next") ); } void OModalQueueBar::setText( const QString& str ) { @@ -126,35 +126,40 @@ OModalQueuedDialog::OModalQueuedDialog( QDialog* mainWidget ) lay->addWidget( m_center ); connect(m_bar->next, SIGNAL(clicked() ), this, SIGNAL(next() ) ); connect(m_bar->prev, SIGNAL(clicked() ), this, SIGNAL(prev() ) ); } OModalQueuedDialog::~OModalQueuedDialog() { } QDialog* OModalQueuedDialog::centerDialog()const { return m_center; } void OModalQueuedDialog::setQueueBarEnabled( bool b) { /* in Qt3 use setEnabled( bool ) */ if (b) m_bar->show(); else m_bar->hide(); } void OModalQueuedDialog::setRecord( int record, int count ) { if (!record && !count ) { hide(); return; }else show(); + if ( count > 1 ) + m_bar->show(); + else + m_bar->hide(); + m_bar->setText( tr("Editing record %1 out of %2", "Shows the current edited record out of an array of records").arg( record ). arg( count ) ); } |