aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/tagwidget.cpp
AgeCommit message (Collapse)Author
2014-07-11Misc UI capitalisation consitencies and other text changesGravatar Tim Wootton
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-10Correctly fake keyPressEvent for tabs and returnsGravatar Tomaz Canabrava
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-10Forbid the use of empty strings as tagsGravatar Tomaz Canabrava
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-06-26Headers cleanup.Gravatar Tomaz Canabrava
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-01Remove some unused variablesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-27Much, much smarter way of finding the TagsGravatar Tomaz Canabrava
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-22Gratuitous whitespace changesGravatar Dirk Hohndel
I keep trying to get to consistenct. Completely hopeless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-18Improve the tag widget to allow us to tab to the next fieldGravatar Dirk Hohndel
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-04-23Fix a minor bug in the tags widget.Gravatar Gehad
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-03-23Divemaster and Buddy fields auto-completion are not savedGravatar Yosef Hamza
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-20Make esc-key discard the new tag selectionGravatar Gehad
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Don't create then set, do both at the same time.Gravatar Tomaz Canabrava
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-20QString starts empty, do not set "" as empty string.Gravatar Tomaz Canabrava
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-20Do not copy strings when you don't need it.Gravatar Tomaz Canabrava
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-20Code CleanupGravatar Tomaz Canabrava
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-19Make Up/Down arrows work with tagsGravatar Gehad
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-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
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-01-19Ignore mouse wheel events on tags widgetGravatar Sergey Starosek
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-16Whitespace and coding style updatesGravatar Dirk Hohndel
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-16Emit textChanged() signal on completion selectionGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20Do not New / Delete the item, use the Stack.Gravatar Tomaz Canabrava
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-20Make it possible to use the Tag System in dark themesGravatar Tomaz Canabrava
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-20Code cleanup: QPair<int, int> -> qMakePairGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11Use delete instead of free() in c++Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07Remove debug output left in the previous commit by mistakeGravatar Dirk Hohndel
Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07Make the tag widget act more sanely when pressing TabGravatar Dirk Hohndel
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-02Fix the inconsistent behaviour of QCompleterGravatar Maximilian Güntner
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-02Added a custom widget for tagging divesGravatar Maximilian Güntner
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>