Commit graph

32 commits

Author SHA1 Message Date
Tomaz Canabrava
238c0573da Remove information panel from mainwindow.ui
Now it's created in the mainwindow.cpp as part of the new
way to configure the interface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Miika Turkia
e1db5f21b1 Fix Ubuntu glitch with completer popup
On Ubuntu, the completer often prevents applying/discarding the changes
on the dive info pane and disrupts editing of other fields as well. This
patch prevents the completer popup from appearing when not in edit mode
(apply or discard is pressed) or when the string is still empty.

Fixes #818

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 13:50:35 -08:00
Dirk Hohndel
02d8dd5d13 Clean up the header files
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 23:00:43 +13:00
Tomaz Canabrava
82a946152b 727 fixed
--047d7b8737f87ede8e050803e6b2
Content-Type: text/plain; charset=UTF-8

<div dir="ltr"><br></div>

From 3db4a422485374801ca2f6233ec23b8671a8656d Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@intel.com>
Date: Sun, 16 Nov 2014 23:22:58 -0200
Subject: [PATCH] fix 727 - position correctly the popup.

When the user entered a tag and that made the message box display
the popup with the possible choices was still in the old position
hidding the line edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 06:02:21 +00:00
Tim Wootton
9dd484b63f Misc UI capitalisation consitencies and other text changes
Capitalisation consitencies
A typo correction
A readability improvement (IMHO)

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11 10:44:09 -07:00
Tomaz Canabrava
29b35ad6d8 Correctly fake keyPressEvent for tabs and returns
since we need to filter for incorrect comma usage, we need to
recurse instead of passing the keyEvent to the base class.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 10:18:23 -07:00
Tomaz Canabrava
37fa2fda03 Forbid the use of empty strings as tags
Some tags were wrong when the user added two commas, so this patch forbids
the use of a comma when we don't have any tags.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 10:17:50 -07:00
Tomaz Canabrava
89816f64c2 Headers cleanup.
Too much noise on the headers, this commit remove uneeded
headers when they are uneeded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:47:02 -07:00
Dirk Hohndel
59785345f8 Remove some unused variables
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01 15:41:12 -07:00
Tomaz Canabrava
7320748ace Much, much smarter way of finding the Tags
The old way manually implemented a parser, where it could simply call a
regexp (or, in my case, a QChar) that will split the QString into many, to
find the beginning and end of the strings on the tags.

This patch also fixes a Qt5 off-by-one bug on the tag Visualization.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-27 20:03:29 -07:00
Dirk Hohndel
5ba573240f Gratuitous whitespace changes
I keep trying to get to consistenct.
Completely hopeless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22 11:40:22 -07:00
Dirk Hohndel
6d42a99e7f Improve the tag widget to allow us to tab to the next field
If the last key that went in ended a tag and the next key is a tab -
deliver that to the TabWidget instead so we can navigate between input
fields.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-18 14:32:15 +09:00
Gehad
e088067ef1 Fix a minor bug in the tags widget.
Using the auto-completer while the tags widget is 'empty', always picked
the first choice.

Write some letters and remove them in an empty tags widget, the complete
list of tags will appear - now if you try to choose any tag with the
keyboard arrows it will choose the first one. also if you tried choosing
it by mouse it will be inserted twice.

This is fixed by removing the unneeded else part.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-23 07:22:03 -07:00
Yosef Hamza
d4a1932276 Divemaster and Buddy fields auto-completion are not saved
The added characters by auto-completion "for the last item"
isn't saved when using Return to save it "works well with
tab"

Fixes #469

Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-23 17:20:03 -07:00
Gehad
cc2369c5f9 Make esc-key discard the new tag selection
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:54:58 -07:00
Tomaz Canabrava
5b497b5655 Don't create then set, do both at the same time.
When we create, then set the value of a variable, we are wasting cycles
and making the code more verbose.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:48:19 -07:00
Tomaz Canabrava
ec2ea7ec3a QString starts empty, do not set "" as empty string.
Let's not be evil by creating "" as empty strings inside of the code,
really.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:48:10 -07:00
Tomaz Canabrava
30770f5d85 Do not copy strings when you don't need it.
This patch removed the use of copy-constructors on the QString to use the
const-references. Even knowing that the QString is a refcounted class,
let's not get that bad habit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:47:57 -07:00
Tomaz Canabrava
3d83c48c49 Code Cleanup
The offending code is line-by-line equal to the completion highlited
method, so why make it duplicated? Call that method instead.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:47:43 -07:00
Gehad
fdf6f3cd4e Make Up/Down arrows work with tags
When using Up/Down arrows to scroll the tag list it always selected the
first item in the list and doesn't scroll.

Fixes #468

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-19 09:33:59 -07:00
Dirk Hohndel
76e6420f6b Massive automated whitespace cleanup
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27 20:09:57 -08:00
Sergey Starosek
ec1088f2cc Ignore mouse wheel events on tags widget
This prevents tags widgets (dive tags and buddy) from grabbing
focus on mouse wheel events but allows entering dive edit mode
on mouse click.

It was attempted earlier by Dirk (commit d117beca), but edit mode
did not work properly.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19 13:56:06 -08:00
Dirk Hohndel
a27f67c026 Whitespace and coding style updates
Another futile attempt to cleanup the code and make coding style and
whitespace consistent. I tried to add a file that describes the key points
of our coding style. I have no illusions that this will help the least
bit...

This commit should ONLY change whitespace

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16 11:50:56 +07:00
Sergey Starosek
4659b594f0 Emit textChanged() signal on completion selection
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16 09:12:59 +07:00
Tomaz Canabrava
bffceb18e7 Do not New / Delete the item, use the Stack.
This should be somewhat faster, and the code is cleaner.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
bdd1b3b546 Make it possible to use the Tag System in dark themes
The color used on the bright theme was cyan, and it's too bright when the
font is also white.

This patch uses the HSL information of the color to determine if the text
color is light or dark, and adjusting the background color for that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
9e57dd4826 Code cleanup: QPair<int, int> -> qMakePair
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Anton Lundin
5b61409358 Use delete instead of free() in c++
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 03:13:30 +01:00
Dirk Hohndel
4e9a29a0af Remove debug output left in the previous commit by mistake
Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 16:32:23 +09:00
Dirk Hohndel
f262ed69cc Make the tag widget act more sanely when pressing Tab
When dealing with autocompletion, tag usually means "take this, move on".
In the tag widget the tab was added to the tag itself (and then stripped
when the input line was processed). Not exactly useful.

This feels a bit "hackish", but it seems to get the job done.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 13:40:57 +09:00
Maximilian Güntner
c4d8b6a4d5 Fix the inconsistent behaviour of QCompleter
The TagWidget behaves now similiar to a QLineEdit.
Pressing Enter/Return will now close the completion widget.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 17:10:34 +01:00
Maximilian Güntner
04cdfce782 Added a custom widget for tagging dives
A custom tag widget has been added to MainTab.
Tags are seperated by a comma ",". The implementation
supports escaping a comma by using "\,".
While typing, the widget supports the user by suggesting
tags using a QCompleter.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 03:37:31 +01:00