- if (!myIStream) return;
-
- while (!myIStream->atEnd()) {
- QString aLine = myIStream->readLine();
- if (aLine.isNull()) return;
-
- // find first function
- int aDefPos = aLine.find("def");
- if (aDefPos == 0) { // only not a class members
- myText->clear();
- // find name
- /*int aStart = aLine.find(" ", aDefPos);
- int aEnd = aLine.find("(", aStart);
- QString aName = aLine.mid(aStart, (aEnd-aStart));
- aName = aName.stripWhiteSpace();
- myNameEdt->setText(aName);*/
-
- // find input params
- /*aStart = aEnd+1;
- aEnd = aLine.find(")", aStart);
- QString aParams = aLine.mid(aStart, (aEnd-aStart));
- aParams = aParams.stripWhiteSpace();
- myParamEdt->setText(aParams);*/
-
- myText->append(aLine);
- // read body
- QString aBodyLine = myIStream->readLine();
- while ((!aBodyLine.isNull()) && aBodyLine[0].isSpace()) {
- myText->append(aBodyLine);
- aBodyLine = myIStream->readLine();
- }
- return;
- }
- }
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"),
- tr("MSG_NOMORE_FUNCTIONS"));
- delete myIStream;
- myIStream = 0;
- myNextBtn->setEnabled(false);
- myFile->close();
- delete myFile;
+ myText->clear();
+ if ( myPyIndex != -1 && myPyFunctions.size() && myPyFunctions.size() > myPyIndex )
+ myText->append( myPyFunctions[ myPyIndex++ ] );
+ if ( myPyFunctions.size() <= myPyIndex ) // last index was reached
+ myNextBtn->setEnabled( false );