[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/office/zippl
From: Klaas Freitag <freitag () suse ! de>
Date: 2010-06-13 19:26:04
Message-ID: 20100613192604.6BAD4AC8CF () svn ! kde ! org
[Download RAW message or body]
SVN commit 1137623 by freitag:
- use return to switch to next spot
- fix loading of input file
M +1 -0 graphwidget.cpp
M +6 -6 mainwindow.cpp
M +4 -3 zipplcontroler.cpp
M +1 -1 zipplcontroler.h
--- trunk/playground/office/zippl/graphwidget.cpp #1137622:1137623
@@ -85,6 +85,7 @@
emit moveToNextStation();
break;
case Qt::Key_Enter:
+ case Qt::Key_Return:
emit moveToNextSpot();
break;
default:
--- trunk/playground/office/zippl/mainwindow.cpp #1137622:1137623
@@ -18,18 +18,18 @@
qDebug() << "ARGC: " << argc;
qDebug() << "ARGV: " << argv;
+ bool res = false;
if( argc > 1 ) {
file = argv[1];
- } else {
+ res = mController->loadFile( file );
+ }
+
+ while( ! res ) {
file = QFileDialog::getOpenFileName( this, tr("Pick a Zippl file to Open"),
QDir::homePath(), tr("Zippl Files (*xml)"));
+ res = mController->loadFile( file );
}
- if( file.isEmpty() ) {
- // Error!
- } else {
- mController->loadFile( file );
}
-}
MainWindow::~MainWindow()
{
--- trunk/playground/office/zippl/zipplcontroler.cpp #1137622:1137623
@@ -17,13 +17,14 @@
}
-void ZipplControler::loadFile( const QString& filePath )
+bool ZipplControler::loadFile( const QString& filePath )
{
QFile file( filePath );
if( !file.open( QIODevice::ReadOnly ) ) {
qDebug() << "Cannot open File: " <<
qPrintable(file.errorString()) << endl;
+ return false;
}
ZipplXmlReader xmlReader( mGraphWidget );
@@ -38,7 +39,7 @@
} else {
qDebug() << "Failed to read zippl in file!";
}
- qDebug() << "Result: " << res;
+ return res;
}
void ZipplControler::slotFileChanged( const QString& file )
@@ -51,7 +52,7 @@
QGraphicsItem *ZipplControler::currentSpot()
{
- if( mCurrSpotNo >= mSpotList.count() ) {
+ if( mCurrSpotNo >= mSpotList.count() || mCurrSpotNo < 0 ) {
mCurrSpotNo = 0;
}
return mSpotList[mCurrSpotNo];
--- trunk/playground/office/zippl/zipplcontroler.h #1137622:1137623
@@ -12,7 +12,7 @@
Q_OBJECT
public:
ZipplControler( GraphWidget* );
- void loadFile( const QString& );
+ bool loadFile( const QString& );
QGraphicsItem *currentSpot();
protected slots:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic