Commit Graph

40 Commits

Author SHA1 Message Date
hjk
4a24df38a3 EditorManager: Use static pattern, adjust surrounding code
Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-08-30 11:22:56 +02:00
Eike Ziller
8c2e3fd2cb Fix usage of EditorManager::editorsForFileName
And move to using the corresponding method in document model.

Change-Id: I80b12ceab8a91c5393b9c0422d660a8896ae09d8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-07-18 14:51:39 +02:00
Eike Ziller
c32db57514 EditorManager: Remove unneeded methods
Change-Id: If3ab9414270df33fb6b0e269b628813e4c71e5c8
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-15 07:57:58 +02:00
Eike Ziller
624d9e2c4c Move IEditor::isTemporary to IDocument
It's a property of the document implementation, not of the specific
editor instance working on it.

Change-Id: I5c3dd054e21b646e2d94b891916a096d045923f8
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-12 16:43:54 +02:00
Eike Ziller
dd43d9908f Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.

Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 13:51:42 +02:00
Eike Ziller
99c383f3d0 Make IDocument::fileName a member with setter.
Instead of requiring subclasses to implement a method.
Also renames IDocument::rename to IDocument::setFileName,
since it doesn't really rename any files or such.

Change-Id: I1344025c24d2f74a6a983e04fb0a5245f1f37aad
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 10:21:58 +02:00
Eike Ziller
553e33979a Fix external file change notification in case of multiple windows.
The notification was only done when the main window was activated which
leads to funny results with external editor windows.

Change-Id: I657ef7e429256f9c098b1fc744d40ffbc2bb5260
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2013-06-21 16:22:37 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Orgad Shaneh
5c900d205d Revert "DocumentManager: Support expect/unexpect directory changes"
Doesn't work

This reverts commit f6ec8c3342.

Change-Id: I84ecb956bd8ad2358228e11630e95ac03c903c21
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-19 11:05:23 +02:00
Orgad Shaneh
f6ec8c3342 DocumentManager: Support expect/unexpect directory changes
Change-Id: I68b69fa00dd6cc189ecfcdb9dfad09c41531883f
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-10 10:12:05 +02:00
Orgad Shaneh
277fa49d28 Fix compilation
Change-Id: I269013c06dd540309b95cf1411bbc3571df2c5b5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-06-05 10:10:46 +02:00
Orgad Shaneh
81fc8ff210 Doc: Remove \fn lines adjacent to functions
They are unneeded, some of them are unmaintained

Change-Id: I0ad87e152d8e2328b486b2f904f7cf9613004afe
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-05 10:07:14 +02:00
Eike Ziller
7c8db79817 Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
  IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
  instead
* Adapts the mode switching code in EditorManager to handle multiple
  windows, for example switching to edit mode should only happen if
  the editor/view is in the main window. Otherwise the editor window
  should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
  make the current editor visible by default, introducing
  DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
  used

One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.

Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-05 09:43:14 +02:00
Eike Ziller
c31c5612ab Allow nested IContexts and use it to give extra editor windows a context
The extra editor windows need to have editor manager context, otherwise
shortcuts (like ctrl+tab) do not work in them if e.g. projects mode is
active. Doing this via add/removeAdditionalContexts would be non-trivial
and error prone, so adding a context to the extra window is more
convenient. Since editors themselves already define a context, we need
to allow nesting of contexts.

Change-Id: I244eca53ebd665fd4d8fe7531e8ff701ed0b40b2
Reviewed-by: David Schulz <david.schulz@digia.com>
(cherry picked from commit deff0eb3c7)
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-05-21 15:07:14 +02:00
Friedemann Kleint
d1bf51161d tr()-Fixes for ReadOnlyFilesDialog.
Fix contexts, remove exclamation mark.

Change-Id: Icfd698e10d7e9e8c949919a102c7a482f007f91a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-04-15 15:03:57 +02:00
David Schulz
6c12a06029 Editor: Added Dialog for read only files.
Task-number: QTCREATORBUG-2851
Change-Id: Ic47a5a1833650e31b4e27d0a01259d6b398a6415
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-04-08 10:16:11 +02:00
Friedemann Kleint
cf5e615f6d Clean headers in Core-plugin.
Change-Id: Ie79d334765ca5c6a034fa2f5eccff5d45b481975
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-03-27 09:31:54 +01:00
Knut Petter Svendsen
0d3b54f410 ClearCase: Don't show Hijack button for dynamic view
The Hijack button (makeWriteableButton) should only
be shown for snapshot views.

Change-Id: I809981885d18b6057d82f73b5104b0f1041cd255
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-03-11 14:18:51 +01:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
	src/plugins/qmldesigner/designercore/include/widgetqueryview.h
	src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
	src/plugins/qnx/bardescriptormagicmatcher.h
	src/plugins/qt4projectmanager/profilekeywords.cpp
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h

Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
2013-01-31 16:25:33 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
hjk
42c16ff7d3 Core: Use the new Id methods in a few places
There are a lot more left.

Change-Id: I97d32629aa6deef0f4819f70cc0b8437f2814257
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-01-17 10:57:22 +01:00
Orgad Shaneh
29a93998df Remove braces for single lines of conditions
#!/usr/bin/env ruby

Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}

Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 10:48:18 +01:00
Daniel Teske
ddc951c456 Default Shadow Build Dir: Use different key
The former settting saved under this key had a default value of $HOME,
which is a akward value. We need to use a different key, so that users
get the default value even if they had run a creator which sets the
$HOME value.

Change-Id: I1c6637c3037e4e1919f078f56eaba5ce77d7fbce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-05 14:57:07 +01:00
Tobias Hunger
1c4d51ef7a Add configuration option for default build directory
Change the UI to always show the editor for the build directory.
Default to what we do for qmake projects right now (with shadow-
building enabled).

Use this setting in qmake based projects.

Set this to '.' for in-source builds by default.

Change-Id: I3fb26ab817b0f545e9b318b68e592df8040d5562
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2012-11-21 13:25:56 +01:00
Aaron McCarthy
1b3909e45a Add option to place shadow build directory parallel to source tree.
This option requires that the projects directory setting is enabled.
For example with the following settings:

Projects directory: $HOME/depot
Build directory: $HOME/build

This will by default place the default shadow build directory in the
$HOME/build tree instead of adjacent to the source in $HOME/depot.

Change-Id: I74bfc00883d0479d5965350c760d14ef7602cc34
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2012-10-27 10:27:50 +02:00
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
Eike Ziller
68c796e244 Merge origin/2.6
Conflicts:
	src/libs/utils/fileutils.cpp
	src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.h
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
	src/plugins/cmakeprojectmanager/makestep.cpp
	src/plugins/qtsupport/baseqtversion.cpp

Change-Id: I153295bad2d97609d96d28945e9f942c5b46b2da
2012-10-05 20:51:31 +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
0bcf6930d3 Add Close button to window asking what to do with changed documents
Add a close button to window asking what to do with documents that
were changed outside Creator. Finally a simple way to get rid of
open moc-files that trigger this window over and over again:-)

Task-number: QTCREATORBUG-7360
Change-Id: I7a373ed60d85d810caf6604bc7dae7bb7fa186a9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-04 16:51:18 +02:00
Christian Kandeler
1b3d637c1b Replace qVariantValue() with qvariant_cast().
qVariantvalue() is deprecated in Qt 5. qvariant_cast() does
the same thing and works in Qt 4 and Qt 5.

Change-Id: I922329d3a47fe394669f5d97a25f0825d3d2dea5
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-20 09:41:37 +02:00
Eike Ziller
887456e38a Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemoglobal.cpp
	src/plugins/madde/maemoinstalltosysrootstep.cpp
	src/plugins/madde/maemopublisherfremantlefree.cpp
	src/plugins/madde/qt4maemodeployconfiguration.cpp
	src/plugins/qt4projectmanager/librarydetailscontroller.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
	src/plugins/qt4projectmanager/qt4buildconfiguration.cpp
	src/plugins/qt4projectmanager/qt4project.cpp
	src/plugins/qtsupport/baseqtversion.cpp
	src/plugins/remotelinux/abstractremotelinuxdeployservice.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.cpp
	src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
	src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp

Change-Id: I2560b528596f284e7b45a2260d8d3037891c5d17
2012-09-04 18:04:16 +02:00
Orgad Shaneh
1faea8a0b3 Read-only file dialog: Use VCS terms if applicable
Also add keyboard accelerators

Change-Id: Icea8af6af7e5d94623ba7782c375977bbab17f22
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-09-04 16:02:23 +02:00
Christian Kandeler
e669f05406 Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.

Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-27 17:00:03 +02:00
Robert Loehning
ed7c80d4c6 Normalized connect()s
Change-Id: Ieb95bd04026d4a8ba824e6355031954332654e99
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-26 16:12:43 +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
hjk
21bf0046c3 editormanager: simplify use of interface
Less code on the user side, same meaning.

Change-Id: I14e54a5d2ed8e024a51cce74eaf7c8419ad544be
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-11 13:51:14 +02:00
Daniel Teske
10438d2e9d BaseTextMark: Support renaming files
Change-Id: I8d712f76fca5d8f5ecad70f1485228e21c00648d
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-04-05 16:47:15 +02:00
Eike Ziller
8e8168fc5c Fix reloading behavior of image viewer.
The image viewer is not able to save, so we should not ask.

Task-number: QTCREATORBUG-5966
Change-Id: I947520d7450704abda8395e8aaae56dfe7842328
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-03-16 13:40:27 +01: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
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