// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/*!
- SALOME SalomeApp
-
- Copyright (C) 2005 CEA/DEN, EDF R&D
-
- File : SUIT_Operation.h
- Author : Unknown
- Module : SALOME
-*/
-
#include "SUIT_Operation.h"
#include "SUIT_Study.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
#include "SUIT_Application.h"
/*!
SUIT_Operation::SUIT_Operation( SUIT_Application* app )
: QObject(),
myApp( app ),
+myFlags( Transaction ),
myStudy( 0 ),
-myState( Waiting ),
-myFlags( Transaction )
+myState( Waiting )
{
}
#include "SUIT.h"
-#include <qobject.h>
-#include <qguardedptr.h>
+#include <QObject>
+#include <QPointer>
class SUIT_Study;
class SUIT_Application;
virtual QString operationName() const;
+ int execStatus() const;
+
signals:
void started( SUIT_Operation* );
void aborted( SUIT_Operation* );
virtual bool hasTransaction() const;
virtual bool commitTransaction( const QString& = QString::null );
- int execStatus() const;
void setExecStatus( const int );
void setState( const OperationState );
void start( SUIT_Operation*, const bool = false );
private:
- typedef QGuardedPtr<SUIT_Study> StudyPtr;
+ typedef QPointer<SUIT_Study> StudyPtr;
private:
SUIT_Application* myApp; //!< application for this operation
//
#include "SUIT_OverrideCursor.h"
+#include <QApplication>
+
/*!Constructor. Initialize wait cursor.*/
SUIT_OverrideCursor::SUIT_OverrideCursor()
{
if ( isActive() )
return;
- for ( QValueList<QCursor>::const_iterator it = myCursors.begin(); it != myCursors.end(); ++it )
+ for ( QList<QCursor>::const_iterator it = myCursors.begin(); it != myCursors.end(); ++it )
QApplication::setOverrideCursor( *it );
myCursors.clear();
#ifndef SUIT_OVERRIDECURSOR_H
#define SUIT_OVERRIDECURSOR_H
-#include <qapplication.h>
-#include <qcursor.h>
-
#include "SUIT.h"
+#include <QList>
+#include <QCursor>
+
/*! \brief Class used for management cursors.*/
class SUIT_EXPORT SUIT_OverrideCursor
{
void resume();
private:
- QValueList<QCursor> myCursors;
+ QList<QCursor> myCursors;
};
#endif
//
#include "SUIT_PopupClient.h"
-#include <qevent.h>
-
/*! constructor. initialize mySignal.*/
SUIT_PopupClient::SUIT_PopupClient()
: mySignal( 0 )
#include "SUIT.h"
-#include <qobject.h>
+#include <QObject>
-class QPopupMenu;
+class QMenu;
class QContextMenuEvent;
/*!\class SUIT_PopupClient
bool disconnectPopupRequest( QObject* reciever, const char* slot );
virtual QString popupClientType() const = 0;
- virtual void contextMenuPopup( QPopupMenu* ) {}
+ virtual void contextMenuPopup( QMenu* ) {}
protected:
void contextMenuRequest( QContextMenuEvent* e );
//
#include "SUIT_ResourceMgr.h"
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qapplication.h>
-#include <qregexp.h>
+#include <QDir>
+#include <QFileInfo>
+#include <QApplication>
+#include <QRegExp>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
/*!
Constructor
return path( docSection, prefix, id );
}
-#ifndef WIN32
-#include <unistd.h>
-#endif
/*!
Returns the user file name for specified application
*/
{
QString pathName;
+ QStringList arguments = QApplication::arguments();
// Try config file, given in arguments
- for (int i = 1; i < qApp->argc(); i++) {
+ for (int i = 1; i < arguments.count(); i++) {
QRegExp rx ("--resources=(.+)");
- if ( rx.search( QString(qApp->argv()[i]) ) >= 0 && rx.capturedTexts().count() > 1 ) {
- QString file = rx.capturedTexts()[1];
+ if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 1 ) {
+ QString file = rx.cap(1);
QFileInfo fi (file);
- pathName = fi.absFilePath();
+ pathName = fi.absoluteFilePath();
}
}
*/
QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const
{
- QDir d( QFileInfo( fname ).dir( true ) );
+ QDir d( QFileInfo( fname ).dir() );
d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
QStringList l = d.entryList();
QString appr_file;
if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) )
{
appr = id;
- appr_file = d.absFilePath( *anIt );
+ appr_file = d.absoluteFilePath( *anIt );
}
}
return appr_file;