Commit Graph

134 Commits

Author SHA1 Message Date
Soeren Apel 7b7ab1f5cb Fix #1038 by catching invalid cursor ranges 2018-02-10 23:18:33 +01:00
Gerhard Sittig ca1d6d5f46 MainBar: fixup file extension filter in "Import File" dialog
The previous implementation used a "*" filter when a file of any other
format than srzip got imported. This happened to be a duplicate of
"All files", and ignored the list of filename extensions provided by
the input formats.

This change does respect the input format's file extensions, and copes
with the lack of such a list (raw binary), as well as lists that have
one (most formats), or multiple extensions (raw analog).

This fixes bug #1039.

Another byproduct of the change is that extensions and their decoration
(separators, parentheses) move outside of tr() calls. These technical
details shall not concern translators, and translations for human
languages shall not break the filter mechanism.

This implementation might be "too complex, computationally expensive".
But it works, and fixes an issue, and the code path executes seldom and
waits for user interaction anyway. Cost reduction can get applied later.
2018-02-10 20:35:32 +01:00
Soeren Apel aa8da126bb Don't set SR_CONF_LIMIT_FRAMES to 1 2017-12-27 18:40:19 +01:00
Soeren Apel e771b42d65 Session: Break up add_decoder() 2017-07-06 00:37:08 +02:00
Soeren Apel f23c46921d Adjust trace view namespace 2017-06-10 15:37:45 +02:00
Soeren Apel 1573bf16ba Move trace view files 2017-06-10 15:37:28 +02:00
Uwe Hermann b0e15aa24c Fix sigrok spelling in two places. 2017-06-06 10:24:30 +02:00
Sergey Alirzaev 75ab6b87f1 permit file names not containing dots on import 2017-06-06 10:23:40 +02:00
Soeren Apel d375140b2e Disable context menus that could lead to users removing UI parts
If a user removes the main toolbar then there's no way to get it
back. We don't want that.

If a user removes a dock window's contents he can get it back
by using the same context menu but it's a useless feature for us
and potentially very confusing, so we disable this, too.
2017-05-26 19:36:04 +02:00
Soeren Apel e0ddc2a408 MainBar: Fix notification message 2017-05-26 19:36:04 +02:00
Uwe Hermann 4d8130bb03 Improve icon/theme handling.
Only use QIcon::fromTheme() for icons which are included in the
freedesktop.org icon naming specification:

https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

For all others there will be no icon to use from the theme and we always
want our own icons to be used unconditionally in those cases anyway.
2017-05-05 23:41:27 +02:00
Uwe Hermann 3432032fbc Rename icons to match freedesktop.org icon naming specification.
https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
2017-05-05 23:41:27 +02:00
Uwe Hermann ae95fe5832 Add a tooltip for the "Add decoder" button. 2017-03-30 20:03:21 +02:00
Uwe Hermann aca9aa834c Use alphabetical order for #includes.
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,llvm-include-order" -fix
2017-03-28 11:43:40 +02:00
Uwe Hermann c063290ac7 Random simplifications, cosmetics/whitespace/consistency fixes. 2017-03-23 19:42:18 +01:00
Uwe Hermann cafe470ed9 Don't use deprecated headers.
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,modernize-deprecated-headers" -fix

(with some additional manual fixups)
2017-03-23 17:59:00 +01:00
Uwe Hermann 83b1c8d251 Remove unused "using" declarations.
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,misc-unused-using-decls" -fix

(with manual add-on fixes such as dropping unused headers as well,
and commenting some false-positive cases)
2017-03-23 17:59:00 +01:00
Uwe Hermann 6f925ba9d6 Don't use std:: in the code directly (where possible).
Use "using std::foo" to make the actual code itself a lot more readable.

There are some exceptions where we usually cannot do this, e.g. std::thread
often conflicts with "thread" from Qt or Boost.
2017-03-18 20:00:51 +01:00
Soeren Apel 49ec9e075c MainBar: Properly limit the lower value of the sample range
This fixes bug #890.
2017-02-15 12:12:31 +01:00
Soeren Apel 348f9ceca2 MainBar: Make sure device and GUI are in sync on startup 2017-02-08 21:53:08 +01:00
Gerhard Sittig efdec55aec license: remove FSF postal address from boiler plate license text
Remove the FSF postal address as it might change (it did in the past).
Reference the gnu.org website instead which is more stable.
2017-01-07 16:11:15 +01:00
Soeren Apel 5f66b56eb6 Add tooltips 2016-12-13 23:19:41 +01:00
Soeren Apel f4ce3e772e MainBar: Correct event handler name 2016-12-04 14:37:38 +01:00
Soeren Apel e0ba4f6fb2 Implement views::trace::StandardBar and derive MainBar from it 2016-12-04 14:37:38 +01:00
Soeren Apel fd22c71c1a Move file loading from MainBar to Session 2016-12-04 14:37:38 +01:00
Soeren Apel c32bf63a93 Do not change session name when performing only a selective save 2016-12-04 14:37:38 +01:00
Soeren Apel 3231fbf937 Move run/stop button from the menu bar to the tab widget 2016-12-04 14:37:37 +01:00
Soeren Apel f1e2d26b86 Move the "new session" button to the main window's tab area 2016-12-04 14:37:37 +01:00
Soeren Apel f4e5759734 Change namespace for the trace view and implement ViewBase 2016-12-04 14:37:36 +01:00
Soeren Apel 0ff97f965a MainBar: Remove empty menu button 2016-09-04 08:03:30 +02:00
Soeren Apel 33e1afbe17 Update main window and dock widget titles as session name changes 2016-09-04 00:15:42 +02:00
Soeren Apel c9da51187f Add "new session" and "new view" toolbar buttons
Those are temporary and will eventually replaced by
a proper UI.
2016-09-01 21:11:18 +02:00
Soeren Apel d552c5c7f2 MainWindow/MainBar: Fix signals
Before, QMetaObject::connectSlotsByName(this) was used to connect
the signals to the slots automagically. This is no longer feasible
for the MainBar as there are slots that can't be auto-assigned and
the MainWindow doesn't have any signals at the moment.
2016-08-28 16:54:58 +02:00
Soeren Apel 91f8fe8c30 Session/MainBar: Fix device change handling 2016-08-27 22:23:28 +02:00
Soeren Apel 101e7a9b40 Implement multi-session handling
This includes letting sessions restore their internal state on
their own and that there are unique names associated with each
session that the GUI can use when there is no data.
2016-08-27 21:55:57 +02:00
Soeren Apel 0f8f8c180b Make the first view own the toolbar instead of the main window
Handling multiple sessions requires that every session can be
controlled individually. This means that either

a) there could be one toolbar that adjusts dynamically to the
session whose view currently has focus

or

b) every session has its own toolbar.

I opted for b) because it's more intuitive and more straightforward
to implement. So now every session has a main view (the first one
created) and a main bar that sits in the same dock widget.
2016-08-26 22:29:40 +02:00
Soeren Apel 7e0c99bf95 Fix #805 by resetting selected device on failure
It can happen that devices can be selected but not used
(permissions problems, connection issues, driver issues, etc.),
so in those cases we want to fail gracefully instead of
segfaulting.
The reason for the segfault is the device selector button
isn't reset in case the device couldn't be opened, causing
the rest of the application to try and work with a device
instance that is actually invalid.

Resetting the device selector when the device failed to
open not only fixes this but also makes the UI more
consistent with the internal state.
2016-06-24 23:15:39 +02:00
Joel Holdsworth 24fa726ff2 MainBar: Added missing menu item 2016-01-03 20:09:30 +01:00
Martin Ling 7bb0fbf4d3 Update to new configuration API. 2015-12-31 18:20:06 +01:00
Uwe Hermann 2ad82c2e40 Various minor whitespace and consistency fixes. 2015-12-26 15:10:01 +01:00
Tilman Sauerbeck 4a8185876c MainBar: Only show "total sampling time" tooltip if supported by device.
If the device doesn't support SR_CONF_LIMIT_SAMPLES, the tooltip would
always show a sampling time of 0s.
2015-11-16 21:37:48 +01:00
Soeren Apel 61501398c3 Add "save selection range as..." to the export menu on the toolbar 2015-11-04 17:56:17 +01:00
Soeren Apel 686d9151fe Make ExportMenu accept a vector of actions 2015-11-04 17:56:17 +01:00
Jens Steinhauser 3ccf0f7f5b Untangle the time formatting functions a bit
The formatting depending on the distance between two timestamps is
reintroduced with the responding function residing in the 'Ruler' class
(the prime user of that function).

Fixes a rounding bug for the least significant digit in the
'format_time_minutes()' function.

The 'Cursor' and 'CursorPair' classes now use the same precision when
formatting timestamps as the rest of the program.
2015-09-04 12:54:52 +02:00
Jens Steinhauser 60d9b99a32 Use a type with a greater resolution to represent time values
Fixes #627.
2015-09-04 12:54:51 +02:00
Soeren Apel 73e170f93c Fix #597 by disabling device-related toolbar buttons as necessary 2015-08-25 18:11:16 +02:00
Soeren Apel c7b03d9daa Fix #121 by implementing sticky scrolling 2015-07-23 23:30:44 +02:00
Soeren Apel e13e787920 MainBar: Re-check sample count/rate when needed 2015-07-18 22:44:33 +02:00
Soeren Apel 449aec3cba MainBar: Change calling order and flag usage for sample count, too 2015-07-15 18:09:01 +02:00
Soeren Apel 0e0b6b3e34 MainBar: Fix #594 by changing calling order and flag usage
The reason that the sampling rate button disappears after a
sampling rate was selected is that there's a flaw in the
chain of events:

on_sample_rate_changed() which calls
commit_sample_rate() which sets updating_sample_rate_ and calls
on_config_changed() which calls
update_sample_rate_selector() which...
...clears the list and exits because updating_sample_rate_ is set.
2015-07-15 18:08:56 +02:00