Commit Graph

65 Commits

Author SHA1 Message Date
baldurk 4a2242f0a1 Make checkerboard colours update immediately when theme changes 2018-02-21 14:29:36 +00:00
baldurk 64406b47a3 Add an SDBasic type for ResourceId.
* This type is core enum and used globally (not API specific) that it
  merits becoming a specific structured data type
2018-02-15 10:21:52 +00:00
baldurk cad5520238 Tweak the event browser to support richtext in drawcall names
* This lets Resource ID text become links to the resource inspector even
  in drawcall names (like glBlitFramebuffer(src, dst)).
2018-02-13 21:10:06 +00:00
baldurk 8368f9b8be Stringify ResourceIds consistently as "ResourceId::12345"
* This means even strings generated in the core code will become
  richtext in the UI.
2018-02-13 21:10:01 +00:00
baldurk 9f87e6e013 Add a function to reveal a file in the platform's external file browser 2018-02-07 16:07:08 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk ebaefc82a9 Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
2017-12-22 13:02:36 +00:00
baldurk 764b39a23c Add update checking system to Qt UI
* This only runs on windows - on other platforms we rely on system
  distribution or user local builds.
2017-12-19 17:31:32 +00:00
baldurk 84220b9aaf Fix uninitialised data in rich resource text layout Refs #820 2017-12-15 12:28:41 +00:00
baldurk a6ebf09785 Add analytics system - disabled for now
* This is a *very* light-touch analytics system that will track the
  simplest and most anonymous statistics that can be useful in
  determining which features are most used or perhaps underused, and
  where it's best to direct development attention.
* It is entirely implemented in the UI layer, no analytics-gathering
  code exists in the library that's injected into programs, and of
  course no capture data (screenshots, resource contents, shaders, etc
  etc) is transmitted.
* Once it's turned on, it will apply to both development and release
  builds. It tracks stats over a month, and then at the beginning of a
  new month it sends the previous data.
* When the user first starts up a build with analytics if there's no
  previous analytics database then they are informed of the new code and
  asked to approve it. They have the option of selecting to manually
  verify any sent reports, or just opt-ing out entirely.
2017-11-29 19:01:22 +00:00
baldurk a13902fe2f Make sure RichResourceText never wraps, and just clips instead. 2017-11-21 16:56:46 +00:00
baldurk 17c2eb37ef Accept a const QWidget* in RichResource functions 2017-11-21 16:56:32 +00:00
baldurk bb5ae999f5 Vertically align RichResourceText painting in the centre with margins 2017-11-21 16:55:58 +00:00
baldurk 32a74e20e1 Extract out most code for text-with-ResourceId-links from RDTreeWidget
* The RDTreeWidget items still use this code, but it can now be reused
  on other widgets like RDLabel.
2017-11-21 14:45:22 +00:00
baldurk e399365ba2 Add simple utility functions for serialising QVariantMap to/from JSON 2017-11-17 16:30:57 +00:00
baldurk 200f0799a4 Generate clickable links to resource inspector in RDTreeWidget 2017-11-17 16:30:56 +00:00
baldurk 7c8628b237 Centralise resource naming with capture context to allow customisation
* We remove the now unneeded name fields in buffer/texture descriptions
  and some of the pipeline state structs.
* A single function will give the human-readable name for a resource id.
  This will look up a custom set of renames, on top of the names from
  the resource descriptions.
2017-11-17 16:30:53 +00:00
baldurk bace05d926 Split out code to populate RDTreeWidget with structured data 2017-11-17 16:30:51 +00:00
baldurk 60e530de88 Split out utility function to group together resource usage events 2017-11-17 16:30:51 +00:00
baldurk 82e1218b62 Defer loading .rdc from drag & drop, to unblock the calling application 2017-11-10 18:36:08 +00:00
baldurk 3aa3262089 Expose ToStr interface publicly, split out into separate files
* Note that while this is public and uses std::string, because it's a
  template with specialisations in a .inl the string never crosses a
  module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
  yet switched over the serialisation system to expect all structs to
  have serialise functions.
2017-11-03 16:23:02 +00:00
baldurk fbf37fd201 Convert to native separators before passing filename to Win32 APIs 2017-10-23 15:01:02 +01:00
Cory Bloor 2fc8475fdf Replace "All Files (*.*)" with "All Files (*)"
To quote the Qt documentation for QFileDialog::setNameFilters:

> Note that the filter *.* is not portable, because the historical
> assumption that the file extension determines the file type is not
> consistent on every operating system. It is possible to have a file
> with no dot in its name (for example, Makefile). In a native Windows
> file dialog, *.* will match such files, while in other types of file
> dialogs it may not. So it is better to use * if you mean to select
> any file.

Admittedly, one of these usages is Windows-only and we are using the
native file dialog there, but we might as well be consistent.
2017-10-23 14:27:24 +02:00
Cory Bloor 405e98639f Parse getSaveFileName filter for default file exts
Instead of manually specifying the default extension, just grab the
first one from each filter. We can only specify one at a time, so
update it whenever the selected filter changes.
2017-10-23 14:27:24 +02:00
Cory Bloor 427b7f8553 Revert "Set default extensions for most save files"
This reverts commit 6f21bacd82.
2017-10-23 14:27:24 +02:00
Cory Bloor 6f21bacd82 Set default extensions for most save files
In most of these cases, the open file dialog won't even display a file
without the proper extension, so this helps ensure the user doesn't
accidentally misplace their files. The one exception is *.rdc, which
could be found without the extension, but could not be opened.
2017-10-11 03:26:17 -07:00
baldurk 00e06d8ff1 Make display rendering colours theme-aware.
* In particular this removes hard-coded checkerboard colours that don't
  look right on dark themes.
2017-08-28 18:50:17 +01:00
baldurk 4c24b0f28f Remove use of ToQStr to convert rdctype::str to QString 2017-08-18 14:13:22 +01:00
Cody Northrop b52d91224e utils: Update messageBoxChecked to use bool directly, no local copy 2017-08-15 09:36:20 -07:00
Cody Northrop 58b0d29bf4 utils: Add new messageBox helper that includes checkBox 2017-08-15 09:36:20 -07:00
baldurk acae04af02 Expose getLuminance for QColor 2017-07-14 17:17:54 +01:00
baldurk 9e8bb36008 Compile fix - keep headers separate so clang-format doesn't re-sort them 2017-07-13 18:45:25 +01:00
baldurk a01b85135b Move windows-only code into #ifdef 2017-07-12 21:36:04 +01:00
baldurk 0032a11fc2 Implement global hook feature for Qt 2017-07-12 13:54:12 +01:00
baldurk f8b458176a Add stub HLSL generation for editing D3D shaders that have no source 2017-07-06 16:34:48 +01:00
baldurk 5fc90f7a08 Fix menus not showing up on some user configurations
* Menus aren't guaranteed to pass isVisible() immediately after calling
  popup() on them, so we need to wait for their aboutToHide signal to
  stop the event loop.
2017-06-16 23:31:05 +01:00
baldurk 1cc2c22195 Invoke CaptureContext function calls onto UI thread, from python thread
* Any work that might use Qt needs to happen on the UI thread, so when
  running a python script on the python thread we need to invoke across.
  We wrap the main ICaptureContext interface to block invoke onto the UI
  for any function calls that aren't just returning internal data.
2017-06-09 17:00:28 +01:00
baldurk fe8c76154f Draw gridlines in WindowText palette color, not just black 2017-06-01 14:23:34 +01:00
baldurk 5b74b66493 Don't construct a QFont globally (as a class static)
* It causes a crash when Qt is statically linked.
2017-05-18 15:05:03 +01:00
baldurk 870f0cc166 Filename filters should be translated 2017-05-15 10:11:55 +01:00
baldurk bbff0fce1c Implement row colouring and tree colouring in event browser.
* Also do custom painting of branches to do proper full-row colouring
  instead of leaving an ugly gap around the tree controls.
2017-05-04 20:36:46 +01:00
baldurk ab432f24fc Implement the UI option for preferring monospaced font 2017-05-04 20:36:46 +01:00
baldurk 0ecc6ca877 Enable QT_NO_CAST_FROM_ASCII & QT_NO_CAST_TO_ASCII
* Added a couple of utility macros to help with the conversion. lit() is
  paired with tr() for untranslated text.
* QFormatStr is more explicitly for non-textual formatting strings.
* Both are just #define'd to QStringLiteral()
2017-05-02 22:58:12 +01:00
baldurk f65f5ea9da Use new RDTreeWidget everywhere in favour of QTreeWidget
* Since we're promoting everything, we reset the behaviour of
  RDTreeWidget so that it's not doing anything different by default.
* RDTreeWidget's interface is a bit different, exposing some useful
  things like a single selected item and so on.
* We also can't set columns in the Qt Creator UI anymore, so we set them
  from code.
2017-04-21 18:44:52 +01:00
baldurk 637d4089e2 Rename colour to color in public API code
* Following the principle of least surprise, color tends to be more
  commonly used in APIs and graphics code even outside the USA.
2017-04-18 14:57:37 +01:00
baldurk d40fc8471d Change API enums to enum class, remove now redundant prefixing
* This gives a little nicer syntax, a bit better type safety, and also
  reflects better for SWIG bindings. Overall it's a minor change but
  better.
* We don't update the C# UI at all, since it's soon to be removed and
  not worth the effort/code churn.
* For now so we're ABI compatible with C#, all enums are uint32_t, but
  that is an obvious optimisation in future to reduce struct packing.
* We avoid 'None' as an enum value, because it's a reserved word in
  python so will cause problems generating bindings.
2017-04-18 14:57:33 +01:00
baldurk 3398fcc9de Add support for configuring an external SPIR-V disassembler in Qt UI 2017-02-16 17:10:04 +00:00
baldurk 72921f2642 Ensure windows.h is included first before shellapi.h 2017-02-16 17:10:02 +00:00
baldurk f416f4770e Implement UI side of detecting vulkan layer problems and fixing as admin
* Stub functions for the actual detection/fixing part.
2017-02-14 19:14:53 +00:00
baldurk e1d180246c Add dialog for both managing remote hosts (add/remove) and attaching 2017-02-09 19:28:23 +00:00