Permalink
Browse files

add status bar message when inserting an image

  • Loading branch information...
1 parent 40d21a2 commit 3037ba2214b65d35367f027327bb7d1f7ecd3e61 @Ramblurr committed Apr 15, 2011
Showing with 9 additions and 0 deletions.
  1. +7 −0 MainWindow.cpp
  2. +2 −0 MainWindow.h
View
7 MainWindow.cpp
@@ -76,6 +76,11 @@ MainWindow::MainWindow( QWidget *parent ) :
mUndoStack = new QUndoStack(this);
mUndoHandler = new UndoHandler(mUndoStack, mModel);
+ mStatusLabel = new QLabel( ui->mStatusbar );
+ mStatusLabel->setObjectName( QString::fromUtf8( "statusLabel " ) );
+ // statusLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ ui->mStatusbar->addPermanentWidget( mStatusLabel );
+
mMonitor = new ViewMonitor( this );
mMonitor->setPixelSize( INITIAL_CODEL_SIZE );
ui->mZoomSlider->setValue( INITIAL_CODEL_SIZE );
@@ -267,6 +272,7 @@ bool MainWindow::eventFilter( QObject* obj, QEvent* event )
setCursor(Qt::ArrowCursor);
mWaitingForCoordSelection = false;
mUndoHandler->insertImage(i.column(), i.row(), mInsertImage);
+ mStatusLabel->clear();
return true;
}
}
@@ -444,6 +450,7 @@ void MainWindow::slotActionInsert()
if ( !mInsertImage.isNull() ) {
setCursor(Qt::CrossCursor);
mWaitingForCoordSelection = true;
+ mStatusLabel->setText( tr("Click upper left coordinate to insert image") );
}
}
View
2 MainWindow.h
@@ -40,6 +40,7 @@ class CommandWidget;
class DebugWidget;
class UndoHandler;
class QUndoStack;
+class QLabel;
class MainWindow : public QMainWindow
{
@@ -109,6 +110,7 @@ private slots:
RunController* mRunController;
CommandWidget* mCommandWidget;
DebugWidget* mDebugWidget;
+ QLabel* mStatusLabel;
QThread mRunThread;
QUrl mCurrentFile;

0 comments on commit 3037ba2

Please sign in to comment.