Commit Graph

191 Commits

Author SHA1 Message Date
Daniel Teske
bca5429633 SessionManager: Restore last session setting with dots
As far as I can see the saved string was changed in May 2010 to not
store the filename but just the session name. Thus this code only worked
because completeBaseName() is the same if the name not contained a dot.

Task-number: QTCREATORBUG-8064
Change-Id: I59326282012ef46206da473a72d99a813f7a7ce7
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2012-10-18 11:40:08 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Tobias Hunger
fb59a39a78 Fix saving of XML configuration files
... when removing settings

Change-Id: If85061321082a8cd0e35752f71d2498fd4693dfd
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-09-04 14:21:01 +02:00
Tobias Hunger
96d8009693 Fix saving of xml files
Do not save XML config files (profiles.xml, toolchains.xml, etc.)
if the file has not changed.

Change-Id: I5f0dea374b33a05e7c428f4031d53c83d92de595
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-24 15:48:40 +02:00
Tobias Hunger
61e95e9a99 Replace some QStrings with Utils::FileName
Change-Id: Ia96963b90788250b4bc6bc89c2bb697de103535f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-08-24 11:27:05 +02:00
Konstantin Tokarev
d18bf468ad Changed return type of :ICore::mainWindow() to QWidget*
Also removed all <QMainWindow> includes which are not needed
anymore.

Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-19 15:15:53 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Eike Ziller
b7c34292f4 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	tests/system/objects.map

Change-Id: Ie6aed14f2f61111d26498ff3684ea4a57e6da59e
2012-06-01 14:06:24 +02:00
Daniel Teske
69a7b5e824 SessionManager: Don't autosave the session while loading a session
Change-Id: I3ce769f9d9753b2771b349ad19a5b248a7f306d2
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-06-01 12:07:15 +02:00
Daniel Teske
e664a53668 Prevent duplicated project entries on failed project loading
Change-Id: I4505d0957398d47c40843dbcbf8ce25365f6501d
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-05-09 11:26:31 +02:00
Daniel Teske
d51edeaf51 Fix "Projects mode" looking broken if the startup project is "wrong"
E.g. this could happen if a session with two projects is opened, where
the startup project no longer exists.

Change-Id: I1c60bacb62b5f39f7830a3bc30e3aa388a825884
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-05-09 11:26:24 +02:00
hjk
cad2966498 use Core::Id for IMode::id and IMode::type
Change-Id: Ic7ce5b883e054c6eeba078327042e99e1c556345
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-08 10:18:12 +02:00
Daniel Teske
1ee7205a82 Cleanup more TODOs in ProjectExplorer
Those are just comments on the code, nothing to do.

Change-Id: I1daaa26eafd3d5f4da1d4be3eede9996ea87248f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-05-03 17:32:43 +02:00
Eike Ziller
b1216cf376 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: I975a4208588d174ebb44054de56c5ac8d7c878fe
2012-05-02 13:53:46 +02:00
Daniel Teske
f059018a8e Stop the autosaving session timer on closing Creator
Change-Id: I3b9c791d95d7815a711f72cec08f405fb1cdac7c
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-02 12:24:12 +02:00
Konstantin Tokarev
06010713e2 Update Project's displayName in GUI if it changes after initial load.
Change-Id: I94386102609772897c93a26ce97acb21d155bdf6
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-04-17 09:22:01 +02:00
Daniel Teske
07460d167d ProjectExplorerPlugin:addProject() remove code to set startup project
addProject() is called from 2 places: openProject and restoreSession
openProject() takes care of setting a startup project itself and
restoreSession sets it explicitly after opening the projects. So the
code in addProject() is not needed.

Change-Id: Iaa5de3e36fd4b60c8ceb79b8ea3ca68dbc9b491c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-03-28 15:00:28 +02:00
Daniel Teske
68790aa20a On Session restore, set the correct startup project
Task-number: QTCREATORBUG-7161
Change-Id: Ie83961b35f2d7d4419a519a2fe6e4df601a67d1c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-03-28 15:00:21 +02:00
Robert Loehning
b41171c847 Normalized connect()s
Change-Id: Id353ab140a46e06ffc3abf667ab3b234e749e17c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-06 12:46:52 +01:00
Thomas Hartmann
9bc042e09f WelcomePage: Add tooltip for sessions
The tooltip allows renaming, cloning and deleting and shows
included projects.

The following method was added to Session:

QStringList projectsForSessionName(const QString &session) const;

I moved the SessionNameInputDialog into the header to reuse it.

I added new roles to SessionModel (ProjectsPathRole, ProjectsDisplayRole).
The following slots were added to SessionModel to expose the backend
functionality:

void cloneSession(const QString &session);
void deleteSession(const QString &session);
void renameSession(const QString &session);

Change-Id: I0182a26dc63b4f051ea948756decd5413c832c60
Reviewed-by: hjk <qthjk@ovi.com>
2012-02-23 18:14:56 +01:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Daniel Teske
854fbd1e41 Rename SessionManager::clear() to closeAllProjects()
Also move the editor closing out of the function. It isn't needed on
shutdown as all editors are already closed then.

Change-Id: Ie50a238e0a0382a99b0a267b286f9ed9484f26f6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-13 13:33:37 +01:00
Daniel Teske
accb0040ed SessionManager::loadSession inline impl functions and rewrite
The order of actions and thus the state at which the signals are emitted
has changed. The aboutToUnloadSession comes before the actual saving
now. Also the aboutToLoadSession is after restoring values but before
restoring projects and editors.

Change-Id: I3eae66cffae970f00535d8d6e2bb11a6ca645456
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-13 13:28:54 +01:00
Daniel Teske
d2c6adb93a Remove SessionFile
Finally one unecessary layer is gone

Change-Id: I34ec37ab898884def075a86e7dfd978e3244d2e3
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:52:04 +01:00
Daniel Teske
c200a9262f Move SessionFile::future to SessionManager
Instead of reseting the variable at new SessionFile, I did it at the
right place, that is after reportingFinished().

Change-Id: Ia5b58734a646840ff645dad07dd87a2bffcef02b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:51:58 +01:00
Daniel Teske
27275a0748 Move SessionFile::m_values to SessionManager
Change-Id: Iccb40a16d3087f612ad5d570ed42a243fe87dfe5
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:01:08 +01:00
Daniel Teske
24c7a7bbf6 Move SessionFile::m_depMap to SessionManager
Note: The m_dep.clear() calls on new SessionFile are theoretically
unecessary. After SessionManager::clear(), m_depMap should be empty.
I can't prove that easily though, so I'll remove that later.

Change-Id: I50b36ca7578dccb50b2b2d81351c8e2d1f0826cd
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:57 +01:00
Daniel Teske
3aacf0ee60 Move SessionFile::m_failedProjects to SessionManager
Change-Id: Ic030e6ac521728431ee17b2e69e7d5aaa30b1fc3
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:52 +01:00
Daniel Teske
739ab0be74 Move SessionFile::m_projects to SessionManager
Note: We do not need to clear it on delete m_file; new SessionFile,
since the clear() before that removes all projects from m_projects

Change-Id: I800f52939602cc2c02deff993da578e28ad9115c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:44 +01:00
Daniel Teske
af621d0852 Move SessionFile::m_startupProject to SessionManager
Preserve the exact same semantics, that is set it to 0 even if it is
later overriden anyway. Note, this 0 setting prevents the startup
project changed signal from being emitted, so it's likely to be wrong.
I'll fix that later.

Change-Id: I8efc33e54fca1fe3636006fe8616ae20aa8c211b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:38 +01:00
Daniel Teske
2ffc2c3b9a Move SessionFile::sessionLoadingProgress to SessionManager
Another step towards removing SessionFile.

Change-Id: I63ff5bd1c62d03e362e33c0ed65bf7bf3d7d0d6f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:30 +01:00
Daniel Teske
cd98f05f0c Simply SessionFile::m_failedProjects handling
Remove the functions and access the variable directly.

Change-Id: Ic35d971a618299b6ccf26f9fb0d76de498268cc1
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:24 +01:00
Daniel Teske
742656df89 Inline SessionFile::load() into SessionManager::loadImpl
Another step towards removing SessionFile.

Change-Id: I0d3f7e9de3fbdf49ecc5e5d033128cb29a14538b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:15 +01:00
Daniel Teske
95896242de Simplfy logic in SessionManager::loadImpl
Removing the bool success makes later refactorings easier to do. The
code flow is the same, except that the block handling failedProjects
after load was always run, even if SessionFile::load returned false.
The only place SessionFile::load returns false failedProjects didn't yet
change, so the code was wrong before.

Change-Id: I8ce565791d67ece7ab8fc7c4a799ed365153e34b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 15:00:01 +01:00
Daniel Teske
8b519d5ebc Inline SessionFile::save into SessionManager
I want to get rid of SessionFile, this is the first step.
Only slight coding style reformating has been done.

Change-Id: I57cae8356b9f12229e3f788f2e71f8e1161fc3c7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 14:59:50 +01:00
Daniel Teske
bd5a7d684f SessionFile: Remove m_fileName
It's easily constructed from sessionName, thus removing one member

Change-Id: I8ae92db0732dada6baa7b50ec84d7b95a16efed6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 14:59:40 +01:00
Daniel Teske
040c0593f2 Remove SessionFile::fileName
Only called in debug output, which is going to change later anyway

Change-Id: I7dd6ec4a30a5d98eeab82cf46276c2811dc0207c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 14:59:33 +01:00
Daniel Teske
a92830e37a SessionFile::fileName can't return a empty filename
So remove code that checks for that

Change-Id: I6e717f27713fae0b7487e18a45790b82e4e1e8cd
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 14:59:24 +01:00
Daniel Teske
c59bf4b402 Move creating of the default session into the SessionManager ctor
There used to be 3 states for the SessionManager:
1) Uninitialized (after ctor)
2) A default virgin session
3) Using a session (including the default session)

And we used to switch from state 1 to 2 or 3 after ICore::coreOpened().
This changes that we start in state 2 and thus don't emit a few signals
after coreOpened. I don't think that'll break anything.

Change-Id: I4cf7dade132c9d0ebd6d472d79c8b70c07acd20f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-07 14:59:03 +01:00
Daniel Teske
da34e80ede SessionManager: Inline and remove updateName
It's only ever called two times and makes it easier to understand how
m_sesionName is changed

Change-Id: I0106516b78481181d7a027a6348eee45e0e462d6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-03 12:09:29 +01:00
Daniel Teske
b7a76cd7a8 Fix overriding the default session
To reproduce the bug:
1) Load a project into the default session.cpp
2) Close creator (which saves the session)
3) Start Creator
4) Create a new session and switch to it => This calls createImpl
   and overrides the default session, even though it shouldn't
5) Load the default session, which will now be empty

Change-Id: I7c23fba8c1f9fd32cc95b3b9206afc422c1f0133
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-02-03 12:09:15 +01:00
Daniel Teske
9ac92e6fad Remove class SessionNodeImpl, just use SessionNode directly
The class added nothing over SessionNode.

Change-Id: I137c274514b2c5897a591b7e093ba84e1a91e9d7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-31 16:03:25 +01:00
Daniel Teske
53ffa9c676 Remove SessionManager::currentSession
It returns the same as activeSession

Change-Id: I244747eddcca3fda181eb8dc52b1b616beba212e
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-31 15:52:12 +01:00
hjk
2df4cb21fe Core::ModeManager: make some functions static
Change-Id: I5c1275ba3f596d8911fd2e4404181bf57b58f494
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-01-27 14:52:24 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk
b0b105d575 ProjectExplorer: make currentProject static
This saves one function call compared to the instance()->currentProject()
pattern and is typically less to type on the caller site.

Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 19:20:13 +01:00
hjk
4a21f0c3c8 Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 18:48:47 +01:00
Daniel Teske
f539bfa3f4 Remove dependencies on unloadeable projects
Task-number: QTCREATORBUG-6736

Change-Id: Icff1857a1bf44f2f2bad106c3fce8bdd3a2d2e49
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-11 13:37:15 +01:00
Friedemann Kleint
ced6fc4136 ProjectExplorer: Compile with QT_NO_CAST_FROM_ASCII.
- Add missing translations
- Remove some unneeded conversions.

Change-Id: Ia30e5c838099e52a9f38ca4854395c10c0391075
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-09 16:45:08 +01:00