Example use case: Multiple wizard json files want to reference a shared
resource file without using fragile relative paths.
Change-Id: I2502083d4c371c25a8b66e7d5d3b4fb9d8697317
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.
Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
handle a mime type if it was enabled
Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
We need multi line support, multi text range support. This is only adding
enablers and adds later the multi line and multi text support because this
triggers larger changes because you have to know the text document.
Change-Id: I44e46d9d80d7d73b2650c69cc83657c20c85bfae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Split up getting the data from the arguments list and actually applying
the values, and move the details of theme creation and application to
better places.
This gets rid of ugly control flow details like that
CorePlugin::initialize created the action manager before calling
parseArguments, because that is needed to apply the presentation mode
argument setting, and parseArguments created the main window because
that needs to be created _after_ setting the theme (which can be
overridden by command line argument), but _before_ applying the override
color argument setting.
Change-Id: I9c99305b6efbfcc4b37cea9e5c70d816a621963b
Reviewed-by: David Schulz <david.schulz@qt.io>
The kits are restored in delayedInitialize now, but the file open event
from Finder was delivered before that. That lead to the projects mode
being opened with the kit configuration screen, but mostly no kits in
it, when double-clicking a .pro file while Qt Creator is not running.
Delay the remote open file command until plugin initialization is really
done.
Change-Id: I1a75f6b1f7bcefb4c53d594de11df0d3a0d2e5d3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Also, rename it to Core::Find. It hasn't been a plugin for a while.
Change-Id: I845885ccf18bdc1440258d523b033758d5583881
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Commit 11f6162739 removed
the usage of userProvidedTheme leading to "unused variable"
warning. Remove last traces of userProvidedTheme.
Change-Id: I187d7ac335ec659a5e8a52e38ffe075a98446586
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Themes from the user config where not restored correctly.
Improve error handling when no themes are found
in case of broken installations.
Cleanly differentiate between theme "id" (currently complete basename of
theme file) and theme "displayName" (as specified as a property in the
theme file).
Remove convoluted broken code that tried to allow using an absolute file
path for a theme on the command line and require themes to be installed
either in Qt Creator globally or in the user settings path.
In general stream line the code.
Task-number: QTCREATORBUG-15113
Task-number: QTCREATORBUG-15233
Change-Id: I014a4314e8bea27422ed4c42462cf16f4220698b
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
And then use this to add the "Open in Graphical Shell" and "Open in
Terminal" actions.
Those actions cannot be implemented in Utils directly since the Core::FileUtils
depends on the Options dialog.
This affects all PathChoosers, and there's currently no way for a PathChooser
to opt out or have a different context menu. That can be added at a later
point.
Change-Id: I22121c19d66f08785381c7e0bca5317628eb6342
Task-number: QTCREATORBUG-14736
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Expose the last visited directory as well as the project directory
stored by the DocumentManager to the MacroExpander.
Change-Id: I7cdbe5e5471b5c96954c74f21187786de7bb9aa3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
%{#: is now treated as a comment and expands to an empty string }
This is useful to add comments about copyright, etc. into the
wizard templates.
Change-Id: I6e25c724edfa4b865d2d4f74b0f4900982d9ea47
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Trigger scan for wizards in delayedInitialize since we need to
create commands for the wizards. Also make sure wizards are
scanned for when opening the options page, so that the keyboard
shortcut page can be fully populated.
Change-Id: Iefe28dbcb17f43a7ed114f056012fe8f6e4ae352
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Do not use the object pool to hold potential wizards. Register
FactoryCreator functions with IWizardFactory instead and use
those to create the wizards when necessary.
This saves us a couple of cycles during startup since we can now
delay construction of all wizards and it makes us more flexible
wrt. managing the lifecycle of the wizard factories.
Change-Id: I95d6a6dfcdf0fd995e1934a9fefcd96c6a676753
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
When the dialog is displayed, the welcome mode becomes disabled.
This happens because before the main loop begins, there is no active window, so
the dialog has no parent to return focus to when it is closed.
Change-Id: I2f8830c3c7bc6816d8483e05e81f5abfe5ee335f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Instead of transforming to absolute paths in the client, pass the
working directory and leave it to the target.
Change-Id: I4f8724c8857e89a7ee77116c78cf8b25c56795fa
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
When specifying a filename as an argument, you can append a colon (or a
plus) followed by a number to indicate which line the cursor should be
positioned at in that file. This patch adds the same functionality but
for the column position as well. Ex: main.cpp:5:4 would open main.cpp
and put the cursor at line 5 column 4. The column number is optional,
just like the line number before it. It should be noted that specified
column numbers larger than the amount of characters available on that
line are wrapped onto subsequent lines.
Change-Id: I50208500fa43e43a9514d2be21630b3c607119a6
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Error caused by any file named as current theme and placed to directory
which is used for starting Qt Creator (formely user home directory).
For example, create empty file with name 'default', place it to your
home directory (for example: /home/user) and run Qt Creator. As result
you will see black corrupted screen.
To fix this bug I add checks of theme name. Now Qt Creator will only
load theme from current directory if name is explicitly provided by
the user or it is an absolute path.
Change-Id: I0255c8d220d84bd5b51de7ef9d64c66f7f57959c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I5c6690f51488bf8ca3610ba9fb11e6e5fd814aaa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Also make a bit less dependent on main window:
- Menus do not need to start with main window as parent.
- Centering the presentation label on the main window is wrong in the
presence of extra windows anyhow. It should be centered on the active
window.
Unfortunately, actions still must be added to the main window, because
actions that are not children of visible widgets do not trigger.
Change-Id: Ibb99644a3723de476db465ebe6a9cdc0820ea692
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
We use double quotes instead of single ones.
Change-Id: Ieb0024aec2053bea2a03e5ae09fb576089663ff1
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
+ always set the global palette and base style on apply
This is required for correctly using the selected theme
with multiple installations of Qt Creator.
Task-number: QTCREATORBUG-13203
Task-number: QTCREATORBUG-13396
Change-Id: I036b96721b6d184dae43d08c5e8bc9e6d1328a7b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Setting the global palette is not a very good idea, because
it interferes with native styling.
On Windows 7 the dark theme was unuasable, because the text on
all natives controls was to bright.
All native controls and the global palette should be left alone.
Wherever we want styling/theming we have to use Manhatten style.
Change-Id: Ia1d0bfb190e4bde7be72f751afc0846570c1189d
Reviewed-by: hjk <hjk121@nokiamail.com>
Adds a 'Theme' tab to the environment settings and a '-theme' command
line option.
A theme is a combination of colors, gradients, flags and style
information.
There are two themes:
- 'default': preserves the current default look
- 'dark': uses a more flat for many widgets, dark color theme
for everything
This does not use a stylesheet (too limited), but rather sets
the palette via C++ and modifies drawing behavior.
Overall, the look is more flat (removed some gradients and bevels).
Tested on Ubuntu 14.04 using Qt 5.4 and running on a KDE
Desktop (Oxygen base style).
For a screenshot, see
https://gist.github.com/thorbenk/5ab06bea726de0aa7473
Changes:
- Introduce class Theme, defining the interface how to access theme
specific settings. The class reads a .creatortheme file (INI file, via
QSettings)
- Define named colors in the [Palette] section
(see dark.creatortheme for example usage)
- Use either named colors of AARRGGBB (hex) in the [Colors]
section
- A file ending with .creatortheme may be supplied
to the '-theme' command line option
- A global Theme instance can be accessed via creatorTheme()
- Query colors, gradients, icons and flags from the theme
were possible (TODO: use this in more places...)
- There are very many color roles. It seems better to me
to describe the role clearly, and then to consolidate later
in the actual theme by assigning the same color.
For example, one can set the text color of the output pane button
individualy.
- Many elements are also drawn differently.
For the dark theme, I wanted to have a flatter look.
- Introduce Theme::WidgetStyle enum, for now {Original, Flat}.
- The theme specifies which kind of widget style it wants.
- The drawing code queries the theme's style flag and
switches between the original, gradient based look and
the new, flat look.
- Create some custom icons which look better on dark background
(wip, currently folder/file icons)
- Let ManhattanStyle draw some elements for non-panelwidgets, too
(open/close arrows in QTreeView, custom folder/file icons)
- For the welcomescreen, pass the WelcomeTheme class.
WelcomeTheme exposes theme colors as Q_PROPERTY accessible from
.qml
- Themes can be modified via the 'Themes' tab in the environment
settings.
TODO:
* Unify image handling
* Avoid style name references
* Fix gradients
Change-Id: I92c2050ab0fb327649ea1eff4adec973d2073944
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>