void AiMainWindow::refreshItems (  )  [private, slot]

slot for refreshing a fractals list

Definition at line 826 of file aimainwindow.cpp.

00827 {
00828     try
00829     {
00830         QDir dir("scripts");
00831         if( !dir.exists() )
00832         {
00833             // create dir if not exists
00834             dir.mkdir("scripts");
00835         }
00836 
00837         // getting a list of QtScript files
00838         QFileInfoList entries = dir.entryInfoList(QStringList() << "*.js");
00839         QStringList list;
00840         for (int i = 0; i < entries.size(); ++i)
00841         {
00842             list << entries.at(i).fileName();
00843         }
00844         if( !list.empty() )
00845         {
00846             m_config->addItems( list );
00847         }
00848         else
00849         {
00850             QMessageBox::information(this, tr("Fractals scripts"), tr("Please add your fractals scripts in folder \"[AiFractals-dir]/scripts\" =)."));
00851         }
00852     }
00853     catch(const std::exception & exception )
00854     {
00855         QMessageBox::critical(this, tr("Critical Error!"), tr("Please report this problem to adrabi[at]gmail[dot]com =)."));
00856     }
00857 }

 All Classes Namespaces Files Functions Variables Typedefs

Generated on Sat Feb 27 08:33:18 2010 for AiFractals by  doxygen 1.6.1