COPASI API  4.16.103
Macros | Functions
copasiui3window.cpp File Reference
#include <sbml/SBMLDocument.h>
#include <QtCore/QEvent>
#include <QtGui/QMenuBar>
#include <QtCore/QTimer>
#include <QtGui/QComboBox>
#include <QtGui/QToolBar>
#include <QtGui/QTextEdit>
#include <QtCore/QThread>
#include <QtGui/QFontDialog>
#include <vector>
#include <sstream>
#include "AboutDialog.h"
#include "CopasiFileDialog.h"
#include "copasiui3window.h"
#include "listviews.h"
#include "DataModelGUI.h"
#include "ObjectBrowserDialog.h"
#include "qtUtilities.h"
#include "SliderDialog.h"
#include "CQMessageBox.h"
#include "CQPreferenceDialog.h"
#include "CQSBMLFileDialog.h"
#include "copasi/UI/CQTabWidget.h"
#include "copasiWidget.h"
#include "TaskWidget.h"
#include "resourcesUI/CQIconResource.h"
#include "CopasiDataModel/CCopasiDataModel.h"
#include "report/CCopasiRootContainer.h"
#include "utilities/CCopasiException.h"
#include "utilities/CDirEntry.h"
#include "model/CModel.h"
#include "commandline/COptionParser.h"
#include "commandline/COptions.h"
#include "commandline/CConfigurationFile.h"
#include "commandline/CLocaleString.h"
#include "wizard/wizard.h"
#include "report/CKeyFactory.h"
#include "sbml/SBMLIncompatibility.h"
#include "MIRIAM/CConstants.h"
#include "copasi/utilities/CVersion.h"
#include "model/CModelExpansion.h"
#include "copasi/UI/CQCheckModelWindow.h"
#include <UI/CWindowInterface.h>
#include "model/CModelAnalyzer.h"
#include "UI/CQExpandModelData.h"
#include <QtCore/QUrl>
Include dependency graph for copasiui3window.cpp:

Go to the source code of this file.

Macros

#define AutoSaveInterval   10*60*1000
 

Functions

QMainWindow * getWindowByTitle (const QList< QPointer< QMainWindow > > &list, const QString &title)
 
bool isProabablySBML (QString &fileName)
 

Macro Definition Documentation

#define AutoSaveInterval   10*60*1000

Function Documentation

QMainWindow* getWindowByTitle ( const QList< QPointer< QMainWindow > > &  list,
const QString &  title 
)

Definition at line 89 of file copasiui3window.cpp.

Referenced by CopasiUI3Window::slotActivateWindowTriggered().

90 {
91  for (int index = 0; index < list.count(); ++index)
92  {
93  QMainWindow *window = list[index];
94 
95  if (window == NULL) continue;
96 
97  if (window ->windowTitle() == title)
98  return window;
99  }
100 
101  return NULL;
102 }
bool isProabablySBML ( QString &  fileName)

Utility function for guessing whether the file might be an SBML file. If so it should contain an SBML tag in the first couple of lines.

Definition at line 2742 of file copasiui3window.cpp.

Referenced by CopasiUI3Window::dropEvent().

2743 {
2744  QFile file(fileName);
2745 
2746  if (!file.open(QIODevice::ReadOnly))
2747  return false;
2748 
2749  for (int i = 0; i < 5; ++i)
2750  {
2751  QByteArray array = file.readLine();
2752 
2753  if (QString(array).contains("<sbml"))
2754  return true;
2755  }
2756 
2757  file.close();
2758 
2759  return false;
2760 }