Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
7b7df00f
Valider
7b7df00f
rédigé
Il y a 4 ans
par
Elliu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Moving documentStore to VivyApplication
Adding vivyApp macro to access the application globally
parent
6372f711
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!3
Add documents
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
src/MainWindow.cc
+4
-3
4 ajouts, 3 suppressions
src/MainWindow.cc
src/MainWindow.hh
+1
-2
1 ajout, 2 suppressions
src/MainWindow.hh
src/VivyApplication.hh
+6
-0
6 ajouts, 0 suppression
src/VivyApplication.hh
avec
11 ajouts
et
5 suppressions
src/MainWindow.cc
+
4
−
3
Voir le fichier @
7b7df00f
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include
<QImage>
#include
<QImage>
#include
<QToolBar>
#include
<QToolBar>
#include
<QTabWidget>
#include
<QTabWidget>
#include
"VivyApplication.hh"
MainWindow
::
MainWindow
(
QWidget
*
parent
)
noexcept
MainWindow
::
MainWindow
(
QWidget
*
parent
)
noexcept
:
QMainWindow
(
parent
)
:
QMainWindow
(
parent
)
...
@@ -76,7 +77,7 @@ MainWindow::closeDocument(int index) noexcept
...
@@ -76,7 +77,7 @@ MainWindow::closeDocument(int index) noexcept
if
(
auto
doc
=
documentToClose
->
getDocument
().
lock
())
{
if
(
auto
doc
=
documentToClose
->
getDocument
().
lock
())
{
const
QString
documentName
=
doc
->
getName
();
const
QString
documentName
=
doc
->
getName
();
documentStore
.
closeDocument
(
documentName
);
vivyApp
->
documentStore
.
closeDocument
(
documentName
);
qDebug
()
<<
"Request to close the document"
<<
documentName
<<
"with tab position"
<<
index
;
qDebug
()
<<
"Request to close the document"
<<
documentName
<<
"with tab position"
<<
index
;
}
else
{
}
else
{
qCritical
()
<<
"The document at index"
<<
index
<<
"was already deleted from the store"
;
qCritical
()
<<
"The document at index"
<<
index
<<
"was already deleted from the store"
;
...
@@ -98,12 +99,12 @@ MainWindow::openDocument() noexcept
...
@@ -98,12 +99,12 @@ MainWindow::openDocument() noexcept
QFileInfo
fileInfo
(
filename
);
QFileInfo
fileInfo
(
filename
);
const
QString
baseName
=
fileInfo
.
baseName
();
const
QString
baseName
=
fileInfo
.
baseName
();
if
(
documentStore
.
isDocumentPresent
(
baseName
))
{
if
(
vivyApp
->
documentStore
.
isDocumentPresent
(
baseName
))
{
qWarning
()
<<
"The document"
<<
baseName
<<
"is already loaded"
;
qWarning
()
<<
"The document"
<<
baseName
<<
"is already loaded"
;
return
;
return
;
}
}
std
::
weak_ptr
<
VivyDocument
>
document
=
documentStore
.
loadDocument
(
filename
);
std
::
weak_ptr
<
VivyDocument
>
document
=
vivyApp
->
documentStore
.
loadDocument
(
filename
);
try
{
try
{
VivyDocumentView
*
documentView
=
new
VivyDocumentView
(
document
);
VivyDocumentView
*
documentView
=
new
VivyDocumentView
(
document
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/MainWindow.hh
+
1
−
2
Voir le fichier @
7b7df00f
...
@@ -17,11 +17,10 @@ class VivyApplication;
...
@@ -17,11 +17,10 @@ class VivyApplication;
class
MainWindow
final
:
public
QMainWindow
{
class
MainWindow
final
:
public
QMainWindow
{
Q_OBJECT
Q_OBJECT
VivyDocumentStore
documentStore
{};
QTabWidget
*
documents
{
nullptr
};
QTabWidget
*
documents
{
nullptr
};
public
:
public
:
explicit
MainWindow
(
QWidget
*
paret
=
nullptr
)
noexcept
;
explicit
MainWindow
(
QWidget
*
pare
n
t
=
nullptr
)
noexcept
;
~
MainWindow
()
noexcept
=
default
;
~
MainWindow
()
noexcept
=
default
;
std
::
weak_ptr
<
VivyDocument
>
getCurrentDocument
()
const
;
std
::
weak_ptr
<
VivyDocument
>
getCurrentDocument
()
const
;
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/VivyApplication.hh
+
6
−
0
Voir le fichier @
7b7df00f
...
@@ -5,8 +5,11 @@
...
@@ -5,8 +5,11 @@
#error "This is a C++ header"
#error "This is a C++ header"
#endif
#endif
#define vivyApp static_cast<VivyApplication*>(QApplication::instance())
#include
<QApplication>
#include
<QApplication>
#include
<QPixmap>
#include
<QPixmap>
#include
"Document/VivyDocumentStore.hh"
#include
<memory>
#include
<memory>
class
MainWindow
;
class
MainWindow
;
...
@@ -14,6 +17,9 @@ class MainWindow;
...
@@ -14,6 +17,9 @@ class MainWindow;
class
VivyApplication
:
public
QApplication
{
class
VivyApplication
:
public
QApplication
{
Q_OBJECT
Q_OBJECT
public:
VivyDocumentStore
documentStore
{};
private
:
private
:
public
:
public
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter