Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
luyikei
VLMC
Commits
c85b9123
Commit
c85b9123
authored
Dec 10, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The wizzard now really creates a project.
If a project is currently oppened, it is closed.
parent
8be771a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
src/GUI/wizard/ProjectWizard.cpp
src/GUI/wizard/ProjectWizard.cpp
+4
-0
src/Project/ProjectManager.cpp
src/Project/ProjectManager.cpp
+13
-9
src/Project/ProjectManager.h
src/Project/ProjectManager.h
+1
-1
No files found.
src/GUI/wizard/ProjectWizard.cpp
View file @
c85b9123
...
...
@@ -34,6 +34,8 @@
#include "WelcomePage.h"
#include "OpenPage.h"
#include <QtDebug>
ProjectWizard
::
ProjectWizard
(
QWidget
*
parent
)
:
QWizard
(
parent
)
{
...
...
@@ -98,6 +100,8 @@ void ProjectWizard::accept()
{
SettingsManager
::
getInstance
()
->
commit
();
}
ProjectManager
::
getInstance
()
->
newProject
(
SettingsManager
::
getInstance
()
->
getValue
(
"project"
,
"ProjectName"
)
->
get
().
toString
()
);
emit
flush
();
QDialog
::
accept
();
return
;
...
...
src/Project/ProjectManager.cpp
View file @
c85b9123
...
...
@@ -93,6 +93,9 @@ void ProjectManager::loadProject( const QString& fileName )
if
(
fileName
.
length
()
==
0
)
return
;
if
(
closeProject
()
==
false
)
return
;
// Append the item to the recents list
m_recentsProjects
.
removeAll
(
fileName
);
m_recentsProjects
.
prepend
(
fileName
);
...
...
@@ -102,8 +105,6 @@ void ProjectManager::loadProject( const QString& fileName )
QSettings
s
;
s
.
setValue
(
"RecentsProjects"
,
m_recentsProjects
);
closeProject
();
m_projectFile
=
new
QFile
(
fileName
);
m_domDocument
=
new
QDomDocument
;
...
...
@@ -176,22 +177,25 @@ void ProjectManager::saveProject( bool saveAs /*= true*/ )
emit
projectSaved
();
}
//void ProjectManager::newProject( const QString &projectName )
//{
// if ( closeProject()
// m_fi
//}
void
ProjectManager
::
newProject
(
const
QString
&
projectName
)
{
if
(
closeProject
()
==
false
)
return
;
m_projectName
=
projectName
;
emit
projectUpdated
(
m_projectName
,
true
);
}
void
ProjectManager
::
closeProject
()
bool
ProjectManager
::
closeProject
()
{
if
(
askForSaveIfModified
()
==
false
)
return
;
return
false
;
if
(
m_projectFile
!=
NULL
)
{
delete
m_projectFile
;
m_projectFile
=
NULL
;
}
emit
projectClosed
();
return
true
;
}
bool
ProjectManager
::
askForSaveIfModified
()
...
...
src/Project/ProjectManager.h
View file @
c85b9123
...
...
@@ -43,7 +43,7 @@ public:
void
saveProject
(
bool
saveAs
=
true
);
bool
needSave
()
const
;
QStringList
recentsProjects
()
const
;
void
closeProject
();
bool
closeProject
();
bool
askForSaveIfModified
();
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment