mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
L'application verifie desormais que le fichier n'est pas deja ouvert dans tous les editeurs de schemas.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@353 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
28
qetapp.cpp
28
qetapp.cpp
@@ -76,6 +76,13 @@ QETApp::~QETApp() {
|
||||
delete qsti;
|
||||
}
|
||||
|
||||
/**
|
||||
@return l'instance de la QETApp
|
||||
*/
|
||||
QETApp *QETApp::instance() {
|
||||
return(static_cast<QETApp *>(qApp));
|
||||
}
|
||||
|
||||
/**
|
||||
Change le langage utilise par l'application.
|
||||
@param desired_language langage voulu
|
||||
@@ -266,6 +273,25 @@ QString QETApp::symbolicPath(const QString &real_path) {
|
||||
return(chemin);
|
||||
}
|
||||
|
||||
/**
|
||||
@param filepath Un chemin de fichier
|
||||
Note : si filepath est une chaine vide, cette methode retourne 0.
|
||||
@return le QETDiagramEditor editant le fichier filepath, ou 0 si ce fichier
|
||||
n'est pas edite par l'application.
|
||||
*/
|
||||
QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) {
|
||||
if (filepath.isEmpty()) return(0);
|
||||
|
||||
QETApp *qet_app(QETApp::instance());
|
||||
foreach (QETDiagramEditor *diagram_editor, qet_app -> diagramEditors()) {
|
||||
if (diagram_editor -> viewForFile(filepath)) {
|
||||
return(diagram_editor);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
|
||||
/**
|
||||
Redefinit le chemin du dossier des elements communs
|
||||
@@ -795,5 +821,5 @@ QIcon QETStyle::standardIconImplementation(StandardPixmap standardIcon, const QS
|
||||
|
||||
/// @return une reference vers les parametres de QElectroTEch
|
||||
QSettings &QETApp::settings() {
|
||||
return(*(static_cast<QETApp *>(qApp) -> qet_settings));
|
||||
return(*(instance() -> qet_settings));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user