Re: Multi Filter

2014-10-02 Thread Tomaz Canabrava
On Thu, Oct 2, 2014 at 11:30 AM, Dirk Hohndel  wrote:

> On Wed, Oct 01, 2014 at 04:37:43PM -0300, Tomaz Canabrava wrote:
> >
> > This new version of the TagFilterSortModel actually accepts
> > *any* new MultiFilterInterface
> >
> > So, how to use it to create a new filter:
> >
> > Implement a class that inherits from MultiFilterInterface
> >
> > Implement the filterRow method
> >
> > TagFilterSortModel::instance->add( myClass );
>
> So right now this is infrastructure without a consumer...
>
> > +void TagFilterSortModel::myInvalidate()
> > +{
> > + qDebug() << "Just making sure..."; makeSure = true;
>
> :-)
>
> I'll drop the qDebug() and fix a few minor whitespace things.
>
> One other odd thing that I noticed is that when we clear the filter, the
> selected row in the dive list is no longer marked as selected. Let me
> explain better. I have a tag for which I have only one dive that has that
> tag. If I filter for that tag only that one dive is shown (and selected).
> Now if I clear the filter, all dives are shown in the dive list. A
> DIFFERENT trip from the one that contains the dive that is still selected
> is expanded, the trip with that dive is collapsed. If I manually expand
> the trip, the dive is not marked as selected, either.
>
> Can you investigate what's going on there?
>

Sure. What might be happening is that when the Qt infrastructure
repopulates the interface because of the filter change, it *might* be
losing selection. I'll be looking this.
It's also not a infrastructure without a consumer, it's already using it
for the TagFiltering, as I used it to test if things were running.
I need to add now the proper UI for it, so new filters can be easily added.


>
> Thanks
>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Multi Filter

2014-10-01 Thread Tomaz Canabrava
as requested.
I didn't implemented any of the new filters yet, but this is the important
bit:
as soon as new filters are added they should work out of the box.

:)
From d1fdd6f88f5f90bfb35f9c88da28321c49d2669f Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 1 Oct 2014 16:23:02 -0300
Subject: [PATCH] Added Possibility to filter more than one filter at a time.

This new version of the TagFilterSortModel actually accepts
*any* new MultiFilterInterface

So, how to use it to create a new filter:

Implement a class that inherits from MultiFilterInterface

Implement the filterRow method

TagFilterSortModel::instance->add( myClass );

and you are done.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/divelistview.cpp  |  2 +-
 qt-ui/models.cpp| 77 -
 qt-ui/models.h  | 17 +--
 qt-ui/simplewidgets.cpp | 12 
 qt-ui/simplewidgets.h   |  3 +-
 5 files changed, 93 insertions(+), 18 deletions(-)

diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index a8f718c..29a2301 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -34,7 +34,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
 	setItemDelegate(new DiveListDelegate(this));
 	setUniformRowHeights(true);
 	setItemDelegateForColumn(DiveTripModel::RATING, new StarWidgetsDelegate(this));
-	TagFilterSortModel *model = new TagFilterSortModel(this);
+	TagFilterSortModel *model = TagFilterSortModel::instance();
 	model->setSortRole(DiveTripModel::SORT_ROLE);
 	model->setFilterKeyColumn(-1); // filter all columns
 	model->setFilterCaseSensitivity(Qt::CaseInsensitive);
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 2cdea68..9703900 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2193,25 +2193,22 @@ bool TagFilterModel::setData(const QModelIndex &index, const QVariant &value, in
 	return false;
 }
 
-TagFilterSortModel::TagFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent)
-{
-	connect(TagFilterModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(invalidate()));
-}
+bool makeSure;
 
-bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
+bool TagFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const
 {
 	// If there's nothing checked, this should show everythin.
-	if (!TagFilterModel::instance()->anyChecked) {
+	if (!anyChecked) {
 		return true;
 	}
 
-	QModelIndex index0 = sourceModel()->index(source_row, 0, source_parent);
-	QVariant diveVariant = sourceModel()->data(index0, DiveTripModel::DIVE_ROLE);
+	QModelIndex index0 = sourceModel->index(source_row, 0, source_parent);
+	QVariant diveVariant = sourceModel->data(index0, DiveTripModel::DIVE_ROLE);
 	struct dive *d = (struct dive *)diveVariant.value();
 
 	if (!d) { // It's a trip, only show the ones that have dives to be shown.
-		for (int i = 0; i < sourceModel()->rowCount(index0); i++) {
-			if (filterAcceptsRow(i, index0))
+		for (int i = 0; i < sourceModel->rowCount(index0); i++) {
+			if (filterRow(i, index0, sourceModel))
 return true;
 		}
 		return false;
@@ -2220,23 +2217,75 @@ bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &sou
 	struct tag_entry *head = d->tag_list;
 
 	if (!head) { // last tag means "Show empty tags";
-		if (TagFilterModel::instance()->rowCount() > 0)
-			return TagFilterModel::instance()->checkState[TagFilterModel::instance()->rowCount() - 1];
+		if (rowCount() > 0)
+			return checkState[rowCount() - 1];
 		else
 			return true;
 	}
 
 	// have at least one tag.
-	QStringList tagList = TagFilterModel::instance()->stringList();
+	QStringList tagList = stringList();
 	if (!tagList.isEmpty()) {
 		tagList.removeLast(); // remove the "Show Empty Tags";
 		while (head) {
 			QString tagName(head->tag->name);
 			int index = tagList.indexOf(tagName);
-			if (TagFilterModel::instance()->checkState[index])
+			if (checkState[index])
 return true;
 			head = head->next;
 		}
 	}
 	return false;
 }
+
+TagFilterSortModel *TagFilterSortModel::instance()
+{
+	static TagFilterSortModel *self = new TagFilterSortModel();
+	return self;
+}
+
+TagFilterSortModel::TagFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent)
+{
+}
+
+bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
+{
+	if(makeSure){
+		makeSure = false;
+		qDebug() << "Called";
+	}
+
+	if (models.isEmpty()){
+		return true;
+	}
+
+	Q_FOREACH(MultiFilterInterface *model, models) {
+		if (model->filterRow(source_row, source_parent, sourceModel())){
+			return true;
+		}
+	}
+
+	return false;
+}
+
+void TagFilterSortModel::myInvalidate()
+{
+	qDebug() << "Just making sure..."; makeSure = true;
+	i

Re: Multi-Filter Search in action draft

2014-09-30 Thread Tomaz Canabrava
She is, but she never reads.
I need to poke her for that sometimes.
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: ui problems

2014-09-29 Thread Tomaz Canabrava
Hm...

Deivide,

On Mon, Sep 29, 2014 at 5:24 AM, Davide DB  wrote:

> Moreover, on Windows there are nasty refresh problems on various
> field. e.g. tags. You think it failed but switching dive forth and
> back and the field has changed.
>

Can you list the ones that fails to refresh?
and if possible, a short video showing them?

Tomaz

>
>
>
> On Mon, Sep 29, 2014 at 9:46 AM, "Paul-Erik Törrönen"
>  wrote:
> >> Every time I put what kind of weight i was using, and then how many kg
> of
> >> it I had, this "save" button appears.
> >> After hitting it, the weight I just added disappears.
> >> Then if I insert it again and hit save again, it will stay there.
> >
> > See http://trac.hohndel.org/ticket/728
> >
> > Poltsi
> >
> > --
> > Paul-Erik Törrönen   "When science and the Bible differ,
> > pol...@777-team.org   science has obviously misinterpreted
> > +358 40 703 1231  its data"
> > http://poltsi.fi/ Henry Morris, father of 'modern creationism'
> >
> > ___
> > subsurface mailing list
> > subsurface@hohndel.org
> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
>
> --
> Davide
> https://vimeo.com/bocio/videos
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Started doing the Multi - Filter component for dives.

2014-09-25 Thread Tomaz Canabrava
On Thu, Sep 25, 2014 at 3:56 PM, Dirk Hohndel  wrote:

> On Thu, Sep 25, 2014 at 03:52:56PM -0300, Tomaz Canabrava wrote:
> > This multifilter is starting to shape up nicely,
> > It resembles the mockups that deivide did.
> > so, 4.3 will have an amazing filter tool.
>
> AWESOME. I cannot wait to see that.
>
> I have been working on the infrastructure (getting there) and on support
> for a new divecomputer (the Aeris A300CS) - that goes into
> libdivecomputer, of course.
>

Hah. Awesome.


> What else are people working on? It's been suspiciously quiet here!
>

Too quiet for my taste. :)


>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Started doing the Multi - Filter component for dives.

2014-09-25 Thread Tomaz Canabrava
This multifilter is starting to shape up nicely,
It resembles the mockups that deivide did.
so, 4.3 will have an amazing filter tool.
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: What happens without libgit2?

2014-09-24 Thread Tomaz Canabrava
For now, nothing much. As libgit is used on a hidden feature. We can ifdef
it for 4.2.1

Sorry for top post, answering by phone.
 Em 24/09/2014 07:49, "Salvo Tomaselli"  escreveu:

> Hello,
>
> Since libgit2 is giving a lot of troubles in Debian, I am asking, what
> would
> happen if I were to remove all the places where it is used?
> Which functionality would be lost?
>
> I am talking about the last stable release of subsurface, not the version
> being developed.
>
> The problem is that libgit2 won't build on some archs, so as it stands,
> subsurface 4.2 won't go into the next stable.
>
> Best
>
> --
> Salvo Tomaselli
>
> "Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
> senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
> -- Galileo Galilei
>
> http://ltworf.github.io/ltworf/
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Luisa's return.

2014-09-22 Thread Tomaz Canabrava
Luisa started mocking up the UX for subsurface 5,
Deivide, you have great ideas, you can poke her too. :)

tomaz
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Call to arms for UX / Interface Design for Subsurface 5?

2014-09-22 Thread Tomaz Canabrava
[INFO] -
[ERROR] COMPILATION ERROR :
[INFO] -
[ERROR]
/data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[6,80]
cannot find symbol
symbol: class HelloAndroidActivity
[ERROR]
/data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[9,15]
cannot find symbol
symbol  : class HelloAndroidActivity
location: class foo.test.HelloAndroidActivityTest
[ERROR]
/data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[13,9]
cannot find symbol
symbol  : class HelloAndroidActivity
location: class foo.test.HelloAndroidActivityTest


Vocês me mandaram um app que nem compila negos?


On Mon, Sep 22, 2014 at 12:44 PM, Tomaz Canabrava 
wrote:

> People, should we do a call to arms for a UX and Interface Design for
> subsurface 5?
>
> about subsurface 5:
> Next big version, not anytime soon.
>
> I think there's still going to be a Subsurface 4.4 ,   4.5 and 4.6 at
> least, but it's good to start thinking about the future. :)
>
> Tomaz
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Call to arms for UX / Interface Design for Subsurface 5?

2014-09-22 Thread Tomaz Canabrava
Ups - sorry, that was to another mailing list, please ignore.

On Mon, Sep 22, 2014 at 1:02 PM, Tomaz Canabrava  wrote:

> [INFO] -
> [ERROR] COMPILATION ERROR :
> [INFO] -
> [ERROR]
> /data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[6,80]
> cannot find symbol
> symbol: class HelloAndroidActivity
> [ERROR]
> /data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[9,15]
> cannot find symbol
> symbol  : class HelloAndroidActivity
> location: class foo.test.HelloAndroidActivityTest
> [ERROR]
> /data/Frescao/fcheckin-parent/fcheckin-it/src/main/java/foo/test/HelloAndroidActivityTest.java:[13,9]
> cannot find symbol
> symbol  : class HelloAndroidActivity
> location: class foo.test.HelloAndroidActivityTest
>
>
> Vocês me mandaram um app que nem compila negos?
>
>
> On Mon, Sep 22, 2014 at 12:44 PM, Tomaz Canabrava 
> wrote:
>
>> People, should we do a call to arms for a UX and Interface Design for
>> subsurface 5?
>>
>> about subsurface 5:
>> Next big version, not anytime soon.
>>
>> I think there's still going to be a Subsurface 4.4 ,   4.5 and 4.6 at
>> least, but it's good to start thinking about the future. :)
>>
>> Tomaz
>>
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Call to arms for UX / Interface Design for Subsurface 5?

2014-09-22 Thread Tomaz Canabrava
People, should we do a call to arms for a UX and Interface Design for
subsurface 5?

about subsurface 5:
Next big version, not anytime soon.

I think there's still going to be a Subsurface 4.4 ,   4.5 and 4.6 at
least, but it's good to start thinking about the future. :)

Tomaz
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-22 Thread Tomaz Canabrava
On Mon, Sep 22, 2014 at 11:44 AM, Dirk Hohndel  wrote:

>
> On Sep 22, 2014, at 7:37 AM, Davide DB  wrote:
>
> > Ah ok, the DC display was just a joke :)
> > I dont' understand why the search bar doesn't fit the current UI. It's
> > just a panel with some listboxes. What's wrong with it?
> > You press Ctrl+F and you get that panel in the upper part.
>
> So after staring at this for a while I think Davide’s idea is starting to
> grow
> on me.
> Shift the tabbed window and profile down a little and have the search areas
> above, one for tags, one for dive masters, buddies, suits… I think that
> gives
> a cleaner look and is easier to understand. What we have now is useful for
> just the tags - but as we want to be able to filter for the other
> categories as
> well, Davide’s design does seem like a good solution.
>
> Is there anything in particular about it that you don’t like or that we
> can’t
> implement at this stage?
>

Nope, I like the Idea, I don't like our current UX with the idea.
but I can move some stuff up and see what will happen.


>
> /D
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-22 Thread Tomaz Canabrava
On Mon, Sep 22, 2014 at 11:37 AM, Davide DB  wrote:

> Ah ok, the DC display was just a joke :)
> I dont' understand why the search bar doesn't fit the current UI. It's
> just a panel with some listboxes. What's wrong with it?
> You press Ctrl+F and you get that panel in the upper part.
>
>
Because that would shrink the Profile too much.
The best way it would shrink the app in a way that the rest is still usable.
on small screens ( like my laptop ) it will not work good.
I think we need to find a better UI for Subsurface as a whole.



> Bye
>
> On Mon, Sep 22, 2014 at 4:31 PM, Tomaz Canabrava 
> wrote:
> > se
> >
> > On Mon, Sep 22, 2014 at 11:28 AM, Davide DB  wrote:
> >>
> >> On Mon, Sep 22, 2014 at 4:19 PM, Tomaz Canabrava 
> >> wrote:
> >> >
> >> > I like it,
> >> >
> >> > The only problem is that it doesn't fit on the current subsurface UI.
> >> > But for subsurface 5 I think we should hire a UX designer to work with
> >> > us to
> >> > find a killer way to display things.
> >> > I can start separating the widgets in a way that's easy to change them
> >> > later
> >> > ( and always, I should start with unittesting. )
> >>
> >> Do you mean the DC display or the search bar?
> >
> >
> > Search bar. The DC display I didn't liked :) but I think it can be
> userfull
> > ( if we allow themes )
> >
> >
>
>
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-22 Thread Tomaz Canabrava
se

On Mon, Sep 22, 2014 at 11:28 AM, Davide DB  wrote:

> On Mon, Sep 22, 2014 at 4:19 PM, Tomaz Canabrava 
> wrote:
> >
> > I like it,
> >
> > The only problem is that it doesn't fit on the current subsurface UI.
> > But for subsurface 5 I think we should hire a UX designer to work with
> us to
> > find a killer way to display things.
> > I can start separating the widgets in a way that's easy to change them
> later
> > ( and always, I should start with unittesting. )
>
> Do you mean the DC display or the search bar?
>

Search bar. The DC display I didn't liked :) but I think it can be userfull
( if we allow themes )
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-22 Thread Tomaz Canabrava
On Mon, Sep 22, 2014 at 11:11 AM, Davide DB  wrote:

> Just for fun I create a thumbnail dive which mimic a dive computer
> display. I was inspired by Black BT layout. I don't know the Petrel
> logbook layout :) Of course the classic divelist it's still the best
> choice.
>
> Jokes apart, I moved listboxes of my previous mockup to accomodate a
> date range selection widget but...
> What's the best way to easily and rapidily select a date range?
>
> The amazing examples of faceted search below, filter only by year.
> http://moritz.stefaner.eu/projects/elastic-lists/NYT/
> http://well-formed-data.net/experiments/elastic_lists/
>
> The year bar graph below is a good idea for the stats page... Diving
> log has something similar.
>
> http://archive.stefaner.eu/projects/elastic-lists/MACE%20ProjectSearch/index.html
>
> I put a search box in the upper right corner. It should be always
> visible and it could be a main entry point for the search
> functionality without accessing a menu. It could be a free text search
> or bounded to the location that in our specific case it's the only
> free text field.
>
> Bye
>
>
I like it,

The only problem is that it doesn't fit on the current subsurface UI.
But for subsurface 5 I think we should hire a UX designer to work with us
to find a killer way to display things.
I can start separating the widgets in a way that's easy to change them
later ( and always, I should start with unittesting. )




>
>
>
>
>
> On Mon, Sep 22, 2014 at 12:44 PM, Davide DB  wrote:
> > On Fri, Sep 19, 2014 at 4:21 PM, Dirk Hohndel  wrote:
> >>
> >> I don't have the time for a beautiful mockup...
> >>
> >> Imagine having all the tags, alphabetically ordered, each with a gray
> >> bubble around it. You click on one, the bubble turns blue and that tag
> >> is selected as filter.
> >>
> >> The bubbles look just like the ones we are using for tags and the likes
> >> on the Notes panel.
> >>
> >> Makes sense?
> >
> > Yes but only if we will have just tag filtering.
> > I was the first to propose a sort of tag cloud and I fell in love with
> > it but later I realized that tag filtering is just one of the many
> > filtering options that we should implement: date, location, equipment,
> > buddy, etc...
> > Hence I began to think to a more "holistic" approach in which tag
> > filtering is one of the several search I need.
> > From the UI point of view would be important having the same approach
> > for the various searches and not having a tag cloud, a text input and
> > combo boxes for different task/search.
> > Tomaz told that the search code is pretty much independent from the UI
> > implementation.
> >
> > Regarding the OR/AND between tags I agree that could be useful having
> > both options but I guess we all are accustomed to AND by default. When
> > we search via google we expect having only results with all input
> > words/keys (and not like the ancient Altavista model). Same with usual
> > web tag clouds. So when selecting "drift" and "reef" I would like
> > seeing only dives with both tags. Otherwise the more tags I select the
> > more dives I find.
> >
> >
> > --
> > Davide
> > https://vimeo.com/bocio/videos
>
>
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re:

2014-09-21 Thread Tomaz Canabrava
thanks. :)
did my patch fixed the loading of all dives on start?

On Sun, Sep 21, 2014 at 4:32 PM, Dirk Hohndel  wrote:

> Yes? Did I forget to push?
>
> /D
>
>
>
> On September 21, 2014 11:47:13 AM Tomaz Canabrava 
> wrote:
>
>  Hello?
>> Em 20/09/2014 18:06, "Tomaz Canabrava"  escreveu:
>>
>> > while I was testing, found a bug on the settings. this patch fixes it.
>> :)
>> >
>> > On Sat, Sep 20, 2014 at 1:45 PM, Tomaz Canabrava 
>> > wrote:
>> >
>> >> Fix crash, fix show all dives when nothing is selected.
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>>
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re:

2014-09-21 Thread Tomaz Canabrava
Hello?
Em 20/09/2014 18:06, "Tomaz Canabrava"  escreveu:

> while I was testing, found a bug on the settings. this patch fixes it. :)
>
> On Sat, Sep 20, 2014 at 1:45 PM, Tomaz Canabrava 
> wrote:
>
>> Fix crash, fix show all dives when nothing is selected.
>>
>>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re:

2014-09-20 Thread Tomaz Canabrava
while I was testing, found a bug on the settings. this patch fixes it. :)

On Sat, Sep 20, 2014 at 1:45 PM, Tomaz Canabrava  wrote:

> Fix crash, fix show all dives when nothing is selected.
>
>
From e2019b5a878871cbcfcd0210ec6e210194cf8e07 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Sat, 20 Sep 2014 17:56:56 -0300
Subject: [PATCH 3/3] Fix typo that broke settings.

A small typo broke the disabling of the graphs for the
newly added curves. ( btw, we need a designer to display
the graphs in a better way, just too much information. )

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/mainwindow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 30227a4..dfe8a23 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -815,7 +815,7 @@ void MainWindow::readSettings()
 	TOOLBOX_PREF_BUTTON(show_sac, show_sac, profSAC);
 	TOOLBOX_PREF_BUTTON(show_pictures_in_profile, show_pictures_in_profile, profTogglePicture);
 	TOOLBOX_PREF_BUTTON(tankbar, tankbar, profTankbar);
-	TOOLBOX_PREF_BUTTON(percentagegraph, precentagegraph, profTissues);
+	TOOLBOX_PREF_BUTTON(percentagegraph, percentagegraph, profTissues);
 	s.endGroup();
 	s.beginGroup("DiveComputer");
 	default_dive_computer_vendor = getSetting(s, "dive_computer_vendor");
-- 
2.1.0

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


[no subject]

2014-09-20 Thread Tomaz Canabrava
Fix crash, fix show all dives when nothing is selected.
From 33d1fea2f4a5fb01f183f7eed1e9bbe3c3d8bdbd Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Sat, 20 Sep 2014 13:38:24 -0300
Subject: [PATCH 1/2] Show everything when nothing is checked.

This patch fixes a bit of the logic used. Now we show every
dive if nothing is chedked.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/models.cpp | 17 +++--
 qt-ui/models.h   |  1 +
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 1d28373..2cdea68 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2171,14 +2171,22 @@ void TagFilterModel::repopulate()
 	setStringList(list);
 	delete[] checkState;
 	checkState = new bool[list.count()];
-	memset(checkState, true, list.count());
-	checkState[list.count() - 1] = true;
+	memset(checkState, false, list.count());
+	checkState[list.count() - 1] = false;
+	anyChecked = false;
 }
 
 bool TagFilterModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
 	if (role == Qt::CheckStateRole) {
 		checkState[index.row()] = value.toBool();
+		anyChecked = false;
+		for (int i = 0; i < rowCount(); i++) {
+			if (checkState[i] == true) {
+anyChecked = true;
+break;
+			}
+		}
 		dataChanged(index, index);
 		return true;
 	}
@@ -2192,6 +2200,11 @@ TagFilterSortModel::TagFilterSortModel(QObject *parent) : QSortFilterProxyModel(
 
 bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
 {
+	// If there's nothing checked, this should show everythin.
+	if (!TagFilterModel::instance()->anyChecked) {
+		return true;
+	}
+
 	QModelIndex index0 = sourceModel()->index(source_row, 0, source_parent);
 	QVariant diveVariant = sourceModel()->data(index0, DiveTripModel::DIVE_ROLE);
 	struct dive *d = (struct dive *)diveVariant.value();
diff --git a/qt-ui/models.h b/qt-ui/models.h
index fc762b6..18c26df 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -425,6 +425,7 @@ public:
 	virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
 	virtual Qt::ItemFlags flags(const QModelIndex &index) const;
 	bool *checkState;
+	bool anyChecked;
 public
 slots:
 	void repopulate();
-- 
2.1.0

From b5ec41bc156f3cf249bf60c00ee3a8b156f87195 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Sat, 20 Sep 2014 13:41:36 -0300
Subject: [PATCH 2/2] Fix crash when moving the mouse over the profile when no
 dive is shown

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/divetooltipitem.cpp | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index 97f687a..33679d0 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -235,23 +235,25 @@ void ToolTipItem::refresh(const QPointF &pos)
 	struct membuffer mb = { 0 };
 
 	entry = get_plot_details_new(&pInfo, time, &mb);
-	tissues->fill();
-	painter->setPen(QColor(0, 0, 0, 0));
-	painter->setBrush(QColor(LIMENADE1));
-	painter->drawRect(0, 10 + (100 - AMB_PERCENTAGE) / 2, 16, AMB_PERCENTAGE / 2);
-	painter->setBrush(QColor(SPRINGWOOD1));
-	painter->drawRect(0, 10, 16, (100 - AMB_PERCENTAGE) / 2);
-	painter->setBrush(QColor("Red"));
-	painter->drawRect(0,0,16,10);
-	painter->setPen(QColor(0, 0, 0, 255));
-	painter->drawLine(0, 60 - entry->gfline / 2, 16, 60 - entry->gfline / 2);
-	painter->drawLine(0, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2,
-			  16, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure /2);
-	painter->setPen(QColor(0, 0, 0, 127));
-	for (i=0; i<16; i++) {
-		painter->drawLine(i, 60, i, 60 - entry->percentages[i] / 2);
+	if (entry) {
+		tissues->fill();
+		painter->setPen(QColor(0, 0, 0, 0));
+		painter->setBrush(QColor(LIMENADE1));
+		painter->drawRect(0, 10 + (100 - AMB_PERCENTAGE) / 2, 16, AMB_PERCENTAGE / 2);
+		painter->setBrush(QColor(SPRINGWOOD1));
+		painter->drawRect(0, 10, 16, (100 - AMB_PERCENTAGE) / 2);
+		painter->setBrush(QColor("Red"));
+		painter->drawRect(0,0,16,10);
+		painter->setPen(QColor(0, 0, 0, 255));
+		painter->drawLine(0, 60 - entry->gfline / 2, 16, 60 - entry->gfline / 2);
+		painter->drawLine(0, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2,
+16, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure /2);
+		painter->setPen(QColor(0, 0, 0, 127));
+		for (i=0; i<16; i++) {
+			painter->drawLine(i, 60, i, 60 - entry->percentages[i] / 2);
+		}
+		addToolTip(QString::fromUtf8(mb.buffer, mb.len),QIcon(), tissues);
 	}
-	addToolTip(QString::fromUtf8(mb.buffer, mb.len),Q

Re: Tag filtering

2014-09-20 Thread Tomaz Canabrava
On Sat, Sep 20, 2014 at 11:14 AM, Dirk Hohndel  wrote:

> On Sat, Sep 20, 2014 at 11:04:56AM -0300, Tomaz Canabrava wrote:
> > Em 20/09/2014 02:53, "Dirk Hohndel"  escreveu:
> > >
> > > Hey Tomaz,
> > >
> > > I spent some time with this and believe that your algorithm for
> showing or
> > > not showing dives is not working correctly.
> > >
> > > When I start Subsurface, without ever touching the filter screen,
> dozens
> > > of my dives get excluded...
> >
> > The filtering is active even if you dont open the dialog. But all of them
> > should be shown.
> > I'll spend a bit of time looking at the code today.
>
> Please. It seems at first only dives with no tags are shown.
>
> I'm dive-mastering a tech diving class this weekend and was showing the
> students Subsurface last night and it certainly wasn't working too well
> :-/
>
>
you shouldn't show pre-alpha software :p
I think it's easy to fix, looking at it.


> Everything else, however, people were very impressed with. Enough so that
> one of them (who currently onws a Cochran computer) is considering getting
> a different computer so he can log with Subsurface...
>
> BTW: The response to Robert's saturation visualization in the info overlay
> box was an immediate "WOW, Cool".
>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag filtering

2014-09-20 Thread Tomaz Canabrava
Em 20/09/2014 02:53, "Dirk Hohndel"  escreveu:
>
> Hey Tomaz,
>
> I spent some time with this and believe that your algorithm for showing or
> not showing dives is not working correctly.
>
> When I start Subsurface, without ever touching the filter screen, dozens
> of my dives get excluded...

The filtering is active even if you dont open the dialog. But all of them
should be shown.
I'll spend a bit of time looking at the code today.

> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Odd behavior while loading divelog file

2014-09-19 Thread Tomaz Canabrava
On Fri, Sep 19, 2014 at 1:29 PM, Salvador Cuñat 
wrote:

> Hellow.
>
> On latest git, while loading divelog file  (command line, default or from
> main menu) the file is not fully loaded  (e.g..  I have 220 registered
> dives, but only 205 are shown in the dive list).
> If the file is reloaded from main menu, then is fully loaded.
>

The codepath is the same, strange.


>
> I can't reproduce this issue in small files (say 25 dives) but it's there
> with 180 dives too .
>
> On Debian Wheezy  in a  32 bit machine
>
> BTW,  it seems someone forgot to remove debugging messages:
>
> boret@imladris:~/subsurface$ ./subsurface
> phethreshold 13 13
> po2threshold 1.6 1.4
> pn2threshold 4 4
> modpO2 1.6 1.6
> redceiling 0 true
> gflow 30 30
> gfhigh 75 75
> gf_low_at_maxdepth false true
> display_unused_tanks 0 false
> show_average_depth 1 true
> font_size 9 9
>
> boret@imladris:~/subsurface$ ./subsurface ../test_gps_3.xml
> Renumbering.
> Renumbering.
> Renumbering.
>
> Best regards.
>
> Salva.
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-19 Thread Tomaz Canabrava
On Fri, Sep 19, 2014 at 10:56 AM, Davide DB  wrote:

> On Fri, Sep 19, 2014 at 3:38 PM, Tomaz Canabrava 
> wrote:
>
> > It is, maybe it's just collapsed ( there's a 'handler' on the right that
> you
> > can drag and make the globe appear again )
> > ( or dirk didn't put the globe on the new build script and builded with
> > -NO_MARBLE )
>
> You are right.
> Actually on Windows there's no indication of the collapsed panel until
> I go there with my mouse. I see no handle.
> Now I expanded a little bit.
>
> >
> > If no tags were selected, you would see the list empty, what do you
> prefer?
>
> I understand. Maybe we could have a global checkbox or a tree view
> with checks like this:
>
> http://i.msdn.microsoft.com/dynimg/IC725568.png
>
> I guess that the label filtering of Adobe Lightroom works in a different
> way.
> By default you see all your photo.
> When you open the tag search, nothing is selected but all your photos
> are still there.
> Once you click on one of them, filtering become effective.
> Strange but it solves that problem, moreover they have tags hierarchy.
>
> >> - I see the scrollbar moving when I Check/unchecking tags but I do not
> >> understand which dives are filtered. I tried with tags used in my
> >> logbook as wreck or reef but nothing changes.
>
> >
> > it should, unless I did something wrong, but it seems that my tests are
> > correct ( I used dirk's logfile )
>
> Please believe me, I restarted the application to record it and now it
> works :) I feel an idiot when I write this.
>
> I see that you used OR for multi tag selection. I would expect AND
> between them. Really I do not know.
>
> When I select "wreck" AND "photo" what I would expect?
> Only the dives when I was filming a wreck or all the dives on a wreck
> and all the dives I shot photos?
> What do you think?
>
>
I used 'AND'
( unless my code is wrong =p )

QStringList tagList = TagFilterModel::instance()->stringList();
if (!tagList.isEmpty()) {
tagList.removeLast(); // remove the "Show Empty Tags";
while (head) {
QString tagName(head->tag->name);
int index = tagList.indexOf(tagName);
if (TagFilterModel::instance()->checkState[index])
return true;
head = head->next;
}
}
return false;

This is the filtering code, it seems an AND to me. :)


> >>
> >> Otherwise I think that some changes could force to rewrite it from
> >> scratch.
> >> If you like and you think that could be useful I could repost them.
> >> Yesterday I took 5 minutes to show how it's designed the metadata
> >> search on Adobe Lightroom (We can criticize Adobe for many things but
> >> their UI are effective.). My mockups where generated starting from
> >> there. BTW 100% of application have search tool on the top right/left
> >> section because the common F-shaped eye scanning pattern.
> >
> >
> > Not from scratch at all, the way I did, the interface is completely
> > separated from the filtering feature, so what we need to do is to redo
> the
> > UI, but the filter code doesn't needs to know about it.
> > that's why I did that way. The interface currently is provided by Qt,
> but we
> > can  completely override that.
> >>
>
>
> Ok, my first doubt was exactly this. That a different UX design could
> force a total rewrite.
> Good work indeed.
>
> Attached my old mockup and the Lightroom search:
>
> https://www.screenr.com/asnN
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-19 Thread Tomaz Canabrava
On Fri, Sep 19, 2014 at 10:32 AM, Davide DB  wrote:

> From where I start? :)
>
> Actually it's not working on my pc, I guess.
>
> - Globe is not there anymore. I tried: View > Show all/ Show Globe.
> Now by default the lower window space is fully booked by the divelist
> table.
>

It is, maybe it's just collapsed ( there's a 'handler' on the right that
you can drag and make the globe appear again )
( or dirk didn't put the globe on the new build script and builded with
-NO_MARBLE )


>
> - Log > Filter by tag: globe space seems to be substituted by the
> search tag view.
>

Same as above, the globe is just collapsed.


> - Tags are all checked by default. Given that I see all my dive listed
> I understand that this should be correct: all my dives, all my tags
> checked.
>

Yup.


> - Problem is that I have to uncheck them one by one and it's a very
> long operation. No please.
>

If no tags were selected, you would see the list empty, what do you prefer?


> - I see the scrollbar moving when I Check/unchecking tags but I do not
> understand which dives are filtered. I tried with tags used in my
> logbook as wreck or reef but nothing changes.
>

it should, unless I did something wrong, but it seems that my tests are
correct ( I used dirk's logfile )


>
> Disclaimer: I'm not a developer :)
>
> Despite of this very welcome early alpha funtionality, could we try to
> implement a search feature thinking on how it should be when it's
> finished? And then starting to implement it piece by piece with a
> global design in mind?
>

Didn't understand.


> I remember that about one month ago I wrote an email with some mockups
> and brainstorming about search and tag filtering. It was welcomed and
> I thought we could start discussing from there.
>

Sure.


> Otherwise I think that some changes could force to rewrite it from scratch.
> If you like and you think that could be useful I could repost them.
> Yesterday I took 5 minutes to show how it's designed the metadata
> search on Adobe Lightroom (We can criticize Adobe for many things but
> their UI are effective.). My mockups where generated starting from
> there. BTW 100% of application have search tool on the top right/left
> section because the common F-shaped eye scanning pattern.
>

Not from scratch at all, the way I did, the interface is completely
separated from the filtering feature, so what we need to do is to redo the
UI, but the filter code doesn't needs to know about it.
that's why I did that way. The interface currently is provided by Qt, but
we can  completely override that.

>
> Here my screencast (go full screen)
>
> https://www.screenr.com/asnN
>
> PS
> I go assembling my rebreather :)
>
> --
> Davide
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: almost missed it - statistics update

2014-09-19 Thread Tomaz Canabrava
On Fri, Sep 19, 2014 at 10:06 AM, Davide DB  wrote:

> On Fri, Sep 19, 2014 at 1:43 PM, Tomaz Canabrava 
> wrote:
> > Agree
> > Em 19/09/2014 08:04, "Salvo Tomaselli"  escreveu:
>
> >> Anyway, I also see forums as a rare thing these days. I think to get
> more
> >> kown, some kind of group on facebook could be more effective, since a
> lot
> >> of
> >> people would already have an account that they can use to comment or ask
> >> questions.
> >>
> >> For the development I don't think that replacing the mailing list is a
> >> good
> >> idea.
> >
> > Please don't replace.
> > But I agree that a Facebook Page about subsurface is a good thing to do.
>
> Personally I'm with Salvo and Tomaz of course.
> I was just replying on how to let that as many as possible people can
> approach Subsurface.
>
> Regarding FB, I do not agree that a FB group is the best approach for
> support.
> I do not have a FB account nor I would give my personal data to them
> to ask something about Subsurface.
> I use Subsurface (also) because I want my dive data for me and not on
> a public service...
> Neverthless I agree that a FB group or page could be a good way to do
> some marketing.
>

That.
Since most of people in the world is on FB, it's the best way to approach.
If dirk / linus give the Ok, I can create and maintain a page there.


> Actually, Dirk already have a G+ page on Subsurface where he post
> updates and so on...
> The problem is that G+ is a dead horse :)
>
> A good compromise could be a small PhpBB forum for general support,
> feedback and a mailing list for core development.
> The risk is that most of developers doesn't visit the forum to help people.
>
> The key factor here is to create a community around Subsurface and
> showing this community around.
>
> Jus my 2c
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: almost missed it - statistics update

2014-09-19 Thread Tomaz Canabrava
Agree
Em 19/09/2014 08:04, "Salvo Tomaselli"  escreveu:
>
> In data venerdì 19 settembre 2014 10:43:08, Davide DB ha scritto:
> > So IMHO a small, simple but important advertizing effort would be
> > transforming this mailing list in a forum.
> > A free PhpBB would be enough (or a free forum which comes with an
> > effective mobile layout).
> I tend to disagree.
>
> I get the emails in my inbox, and I can see how many new ones are there
and so
> on, but I surely would not bother to open the forum every day and see
what's
> new there. Yes forums can have RSS feeds, but I think those are even more
> specialized to use.
>
> Besides, git can post patches to the mailing list but not to a forum.
>
> Anyway, I also see forums as a rare thing these days. I think to get more
> kown, some kind of group on facebook could be more effective, since a lot
of
> people would already have an account that they can use to comment or ask
> questions.
>
> For the development I don't think that replacing the mailing list is a
good
> idea.

Please don't replace.
But I agree that a Facebook Page about subsurface is a good thing to do.

> --
> Salvo Tomaselli
>
> "Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
> senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
> -- Galileo Galilei
>
> http://ltworf.github.io/ltworf/
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: almost missed it - statistics update

2014-09-18 Thread Tomaz Canabrava
200 users.
Let's put subsurface on a few dive magazines / dive conventions?
There's such a thing as a dive convention?


On Thu, Sep 18, 2014 at 5:48 PM, Dirk Hohndel  wrote:

> (OK, I did miss 2000 - but I'm close)
>
> Lots of interesting data. Still about 2/3 on Windows, 1/6 each Linux and
> Mac.
> More 32bit versions than I expected.
> Not a single submission from Brazil??? There must be a bug in my program
> that analyzes the data.
>
> /D
>
>
> Downloads: 2005
> Mac 448 (22%)
> Windows 64 1330 (66%)
> Windows 32 227 (11%)
>
> Unique records: 580
>
> Subsurface versions:
> Subsurface 4.2: 536
> Development builds: 44
>
> OS breakdown:
> Linux: 109 (18%)
> Arch: 11  []
> Debian: 6  [wheezy: 3 - jessie/sid: 3]
> Fedora: 7  [18 : 1 - 20 : 6]
> Gentoo: 3  []
> Linux: 1  [Mint LMDE: 1]
> RedHat: 1  [Enterprise Linux: 1]
> Sabayon: 1  [Linux: 1]
> Ubuntu: 72  [13.10: 4 - 14.04 LTS: 9 - 14.04.1 LTS: 43 - 12.04.4
> LTS: 2 - 12.04.5 LTS: 14]
> Zorin: 1  [OS 9: 1]
> openSUSE: 6  [13.1 : 1 - 13.1 : 5]
> MACOSX: 88 (15%)
> Mac OS X Lion (10.7): 2
> OS X Mountain Lion (10.8): 4
> OS X Mavericks (10.9): 78
> OS X Yosemite (10.10): 4
> Windows: 382 (65%)
> Windows XP: 14
> Windows Vista: 8
> Windows 2003: 1
> Windows 7: 266
> Windows 8: 16
> Windows 8.1: 77
>
> Arch breakdown:
> i386: 31 (5%)
> i386/i386: 34 (5%)
> i386/i686: 6 (1%)
> i386/x86_64: 3 (0%)
> x86_64: 505 (87%)
>
> Languages:
> en: 235, de: 121, fr: 59, it: 37, es: 23, sv: 22, pl: 20, nl: 13, ru: 11,
> zh: 11, fi: 10, el: 4, ca: 2, ja: 2, nb: 2, pt: 2, C: 1, cs: 1, de-CH: 1,
> hu: 1, ko: 1, tr: 1,
>
> Survey:
> Total Surveys: 263
> download from dive computer: 214
> download/import from other sources: 69
> enter dives manually: 66
> interested in dive planning: 146
> recreational diver: 214
> tech diver: 106
> use companion app: 40
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-18 Thread Tomaz Canabrava
I send an screenshoot yesterday. ._.

On Thu, Sep 18, 2014 at 11:45 AM, Davide DB  wrote:

> On Thu, Sep 18, 2014 at 4:40 PM, Dirk Hohndel  wrote:
> > Actually, I broke something in my Windows builds. I need to figure out
> > what went wrong :-(
>
>
> So just send me a screenshot. I'm really curious :)
>
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-18 Thread Tomaz Canabrava
Globe not gone.

The thing is, it uses SP literatura between the list, the filter, the
globe. So if you move the splitter to the right it will collapse the globe,
but you can just drag the handler from the right to the left again, and it
will uncollapse.

And no, it doesn't remember filtering across restarts, I didnt tougth that
it was a valid  thing to do, since that per default the filtering is
hidden, you May think you lost a few dives.

Sorry to top post, on cellphone.
Em 18/09/2014 11:10, "Dirk Hohndel"  escreveu:

> On September 18, 2014 7:06:52 AM Tomaz Canabrava 
> wrote:
>
>  You can even filter the tag that you are filtering, yo.
>>
>> One thing that I didn't do because it feel like a good thing to somebody
>> that wanna start qt development is a button to close the tag filter.
>>
>> *runs*
>>
>
> There are some problems with master.
> Once you filter once the globe is gone it seems.
> It also seems to remember the filter across restarts? Not sure, didn't
> have enough time to test in more detail...
>
> /D
>
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-18 Thread Tomaz Canabrava
You can even filter the tag that you are filtering, yo.

One thing that I didn't do because it feel like a good thing to somebody
that wanna start qt development is a button to close the tag filter.

*runs*
Em 18/09/2014 10:50, "Davide DB"  escreveu:

> On Thu, Sep 18, 2014 at 3:40 PM, Dirk Hohndel  wrote:
> > On Thu, Sep 18, 2014 at 10:07:32AM +0200, Davide DB wrote:
> >> Let me know when it will pushed in a daily build so I can see it :)
> >
> > I'll kick one off in a few minutes, so maybe 20 minutes from now?
>
>
> No hurry, I'll give it a try this night (Italy)
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Tag Filtering.

2014-09-17 Thread Tomaz Canabrava
On Wed, Sep 17, 2014 at 7:52 PM, Dirk Hohndel  wrote:

> On Wed, Sep 17, 2014 at 06:04:54PM -0300, Tomaz Canabrava wrote:
> > patch-bomb.
>
> Yay!
>
> > Tag filtering working.
>
> Double Yay!
>
> > Load a dive xml file, go to log->filter by tag, filter things.
> > The dialog will appear between the dive list and the globe, so *maybe*
> it's
> > too small and you need to drag it a bit to be able to see.
>
> It seems to work reasonably well. At least after I added a patch to fix a
> few ways to crash it at startup.
>

Ups. :)


> The UI is LAME :-)
>

It is. :P


> Can we get big buttons that are shaped just like the tags are when shown?
> And that have an enabled / disabled state (indicated by color, no color or
> something)?
>

yes, reasonably easy to do.


> The checkboxes are totally a blast from the last decade...
>

Agreed, I just didn't think of a better ui. :)


> But don't get me wrong - that's just a detail, I'm glad we are getting the
> functionality itself.
>
> Pushed (with whitespace cleanup and crash fix added)
>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Tag Filtering.

2014-09-17 Thread Tomaz Canabrava
patch-bomb.
Tag filtering working.
Load a dive xml file, go to log->filter by tag, filter things.
The dialog will appear between the dive list and the globe, so *maybe* it's
too small and you need to drag it a bit to be able to see.

Tomaz
From 9df5541acf46f556137790be131cb2af2d1039b6 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 16 Sep 2014 17:23:01 -0300
Subject: [PATCH 01/12] Fix compilation with C99

Signed-off-by: Tomaz Canabrava 
---
 dive.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dive.h b/dive.h
index 47e893f..3c32ee8 100644
--- a/dive.h
+++ b/dive.h
@@ -362,7 +362,7 @@ static inline int get_surface_pressure_in_mbar(const struct dive *dive, bool non
 /* Pa = N/m^2 - so we determine the weight (in N) of the mass of 10m
  * of water (and use standard salt water at 1.03kg per liter if we don't know salinity)
  * and add that to the surface pressure (or to 1013 if that's unknown) */
-inline int calculate_depth_to_mbar(int depth, pressure_t surface_pressure, int salinity)
+static inline int calculate_depth_to_mbar(int depth, pressure_t surface_pressure, int salinity)
 {
 	double specific_weight;
 	int mbar = surface_pressure.mbar;
@@ -376,7 +376,7 @@ inline int calculate_depth_to_mbar(int depth, pressure_t surface_pressure, int s
 	return mbar;
 }
 
-inline int depth_to_mbar(int depth, struct dive *dive)
+static inline int depth_to_mbar(int depth, struct dive *dive)
 {
 	return calculate_depth_to_mbar(depth, dive->surface_pressure, dive->salinity);
 }
-- 
2.1.0

From 90b15ded9bced3dcf60e746beb87a4b84212d3a3 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 17 Sep 2014 13:51:08 -0300
Subject: [PATCH 02/12] Added skeleton to the Tag Filtering.

Just the ui file and a empty class to start playing with it.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/simplewidgets.cpp |  1 +
 qt-ui/simplewidgets.h   |  7 +++
 qt-ui/tagfilter.ui  | 27 +++
 subsurface.pro  |  3 ++-
 4 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 qt-ui/tagfilter.ui

diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index 772c8d1..c745887 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -455,3 +455,4 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button)
 		selective_copy_dive(&displayed_dive, targetDive, *what, true);
 	}
 }
+
diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h
index b41189f..1673055 100644
--- a/qt-ui/simplewidgets.h
+++ b/qt-ui/simplewidgets.h
@@ -12,6 +12,7 @@ class QAbstractButton;
 #include "ui_shifttimes.h"
 #include "ui_shiftimagetimes.h"
 #include "ui_divecomponentselection.h"
+#include "ui_tagfilter.h"
 #include "exif.h"
 
 class MinMaxAvgWidget : public QWidget {
@@ -126,6 +127,12 @@ private:
 	struct dive_components *what;
 };
 
+class TagFilter : public QWidget {
+	Q_OBJECT
+public:
+	TagFilter(QWidget *parent);
+};
+
 bool isGnome3Session();
 QImage grayImage(const QImage& coloredImg);
 
diff --git a/qt-ui/tagfilter.ui b/qt-ui/tagfilter.ui
new file mode 100644
index 000..91078ed
--- /dev/null
+++ b/qt-ui/tagfilter.ui
@@ -0,0 +1,27 @@
+
+
+ TagFilter
+ 
+  
+   
+0
+0
+400
+300
+   
+  
+  
+   Form
+  
+  
+   
+
+   
+   
+
+   
+  
+ 
+ 
+ 
+
diff --git a/subsurface.pro b/subsurface.pro
index 63024ce..1e85b11 100644
--- a/subsurface.pro
+++ b/subsurface.pro
@@ -221,7 +221,8 @@ FORMS = \
 	qt-ui/plannerSettings.ui \
 	qt-ui/usersurvey.ui \
 	qt-ui/divecomponentselection.ui \
-	qt-ui/configuredivecomputerdialog.ui
+	qt-ui/configuredivecomputerdialog.ui \
+	qt-ui/tagfilter.ui
 
 # Nether usermanual or printing is supported on android right now
 android: FORMS -= qt-ui/printoptions.ui
-- 
2.1.0

From 9cb60a6fbecd306c4a28fa9f877b7171d7555890 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 17 Sep 2014 13:52:42 -0300
Subject: [PATCH 03/12] Removed unused method signature.

This was declared on a class definition, but never implemented.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/simplewidgets.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h
index 1673055..7b83834 100644
--- a/qt-ui/simplewidgets.h
+++ b/qt-ui/simplewidgets.h
@@ -77,7 +77,6 @@ public:
 	explicit ShiftImageTimesDialog(QWidget *parent);
 	time_t amount() const;
 	void setOffset(time_t offset);
-	time_t epochFromExiv(EXIFInfo *exif);
 private
 slots:
 	void buttonClicked(QAbstractButton *button);
-- 
2.1.0

From 87c9a59073751354d4153869849ce982bffd21f2 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 17 Sep 2014 14:17:41 -0300
Subject: [PATCH 04/12] Add the Tag Widget on the MainWindow

Place the TagWidget on the correct place on the main  window.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/mainwindow.ui | 9 -
 qt-ui/simplewidgets.cpp | 4 
 qt-ui/simplewidgets.h   | 4 +++-
 3 files c

Back in

2014-09-15 Thread Tomaz Canabrava
So I took 3 week vacation to take care of my leg, Actually I tried to work
but my mind wasn't working very good and everything that I did looked like
a complete mess, so I'm resuming my stuff that I told everybody "it will be
ready in two days", and reestarting it today.

Sorry for the abscense, Getting back and getting it better. o/

Tomaz
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Typos

2014-09-11 Thread Tomaz Canabrava
Mh
Em 11/09/2014 12:47, "Dirk Hohndel"  escreveu:

> On Thu, Sep 11, 2014 at 05:12:57PM +0200, Florian Klink wrote:
> > Hi Dirk,
> >
> > as a long (but inactive) subsurface user, I'm happy to help out with my
> > first patch ;-)
>
> Yay!
> I'm always thrilled when we get a patch from a new contributor.
> The number of people participating for me is the main measure of our
> success. In many ways I care about this more than I care about the number
> of entries in the Bug tracker... (if you have no users, no one files
> bugs... is that good?).
>
> Anyway. Welcome! And thank you.
>
> I think I have sorted out the mess, pushed the fixed strings, cleaned up
> the repository and applied other outstanding patches.
>
> This is pushed.
>
> Everyone with outstanding patches, please make sure that I got what you
> sent and if not resend.
>
> I know that there's the outstanding "align divelist column" patch - Tomaz
> wanted to comment on that before he decided to break his leg instead...
> So I'm holding back on this for now.
>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Commit reverted tool-tip text changes

2014-09-11 Thread Tomaz Canabrava
Whut?
What I broke?
 Em 11/09/2014 10:53, "Dirk Hohndel"  escreveu:

> On Thu, Sep 11, 2014 at 08:33:25AM +0100, Tim Wootton wrote:
> > Hi Dirk,
> >
> > Looks like commit 9acf1caca3370f3e7eaf53c88e5419a62c07e4cb reverted the
> > tool-tip text tidy-up from commit
> > 44a554d53a5d1167bd79e54f8b752154a3b2877a was this intended?
>
> My mistake for not paying more attention when applying Tomaz' patch.
>
> I'll need to clean this up again :-(
>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: What happened in Brazil?

2014-09-10 Thread Tomaz Canabrava
Em 10/09/2014 00:59, "Dirk Hohndel"  escreveu:
>
>
> I just happened to look at the site stats and more than a third of our
traffic in the last 24h came from Brazil (which usually accounts for about
1.6% of our traffic).
>
> Just wondering… Tomaz, did you post about Subsurface somewhere? :-)

Nothing that I know of. =)

> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: [CCR PATCH] Create memory space for CCR gas pressures (part 2)

2014-09-04 Thread Tomaz Canabrava
We do provide an script to run clang style
Em 04/09/2014 11:59, "Salvo Tomaselli"  escreveu:

> In data martedì 26 agosto 2014 10:39:14, Dirk Hohndel ha scritto:
> > Both this and the previous patch are whitespace damaged.
> >
> > Can I please get ONE patch that uses tabs to indent?
> It would be cool if you could provide astyle parameters or something
> similar
> to use before applying patches, so that they are styled properly (not just
> the
> tabs but everything else too.
>
> --
> Salvo Tomaselli
>
> "Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
> senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
> -- Galileo Galilei
>
> http://ltworf.github.io/ltworf/
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCH] Switch some columns to right alignment in divelist

2014-09-03 Thread Tomaz Canabrava
Em 03/09/2014 17:34, "Anton Lundin"  escreveu:
>
> On 03 September, 2014 - Tomaz Canabrava wrote:
>
> > Em 03/09/2014 17:24, "Anton Lundin"  escreveu:
> > >
> > > Some columns in the dive list makes more sense to have right aligned
> > > than left aligned. This switches the numeric columns to right
alignment
> > > so they is more easily compared visually.
> > >
> > > Signed-off-by: Anton Lundin 
> > > ---
> > >  qt-ui/models.cpp | 21 -
> > >  1 file changed, 20 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
> > > index 5266130..872f395 100644
> > > --- a/qt-ui/models.cpp
> > > +++ b/qt-ui/models.cpp
> > > @@ -1070,7 +1070,26 @@ QVariant DiveItem::data(int column, int role)
const
> > >
> > > switch (role) {
> > > case Qt::TextAlignmentRole:
> > > -   retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
> > > +   switch (column) {
> > > +   case NR:
> > > +   case DEPTH:
> > > +   case DURATION:
> > > +   case TEMPERATURE:
> > > +   case TOTALWEIGHT:
> > > +   case SAC:
> > > +   case OTU:
> > > +   case MAXCNS:
> > > +   retVal = int(Qt::AlignRight |
Qt::AlignVCenter);
> > > +   break;
> > > +   case DATE:
> > > +   case RATING:
> > > +   case SUIT:
> > > +   case CYLINDER:
> > > +   case GAS:
> > > +   case LOCATION:
> > > +   retVal = int(Qt::AlignLeft |
Qt::AlignVCenter);
> > > +   break;
> > > +   }
> > > break;
> > > case DiveTripModel::SORT_ROLE:
> > > Q_ASSERT(dive != NULL);
> > > --
> > > 1.9.1
> > >
> > >
> >
> > Nope.
> > NR is one of the columns that this doesn't works because of the way that
> > the treeview works. There is actually a commit from me reverting this a
> > while ago.
> >
>
> On my system i have a visual tab on all the trip-child-dives, and
> right-aligning the NR column makes the non-trip-dive-numbers align with
> the trip-dive-numbers.
>
> I would prefer if we could get rid of that implicit tab on trip dives.
> It just makes things look inconsistent if you lower the with for the NR
> column.

Can you send a picture só I can better visualize this?

The issue on changing the NR to right Align is that its hard to say whats
on a trip and whats not.

> //Anton
>
> --
> Anton Lundin+46702-161604
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCH] Switch some columns to right alignment in divelist

2014-09-03 Thread Tomaz Canabrava
Em 03/09/2014 17:24, "Anton Lundin"  escreveu:
>
> Some columns in the dive list makes more sense to have right aligned
> than left aligned. This switches the numeric columns to right alignment
> so they is more easily compared visually.
>
> Signed-off-by: Anton Lundin 
> ---
>  qt-ui/models.cpp | 21 -
>  1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
> index 5266130..872f395 100644
> --- a/qt-ui/models.cpp
> +++ b/qt-ui/models.cpp
> @@ -1070,7 +1070,26 @@ QVariant DiveItem::data(int column, int role) const
>
> switch (role) {
> case Qt::TextAlignmentRole:
> -   retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
> +   switch (column) {
> +   case NR:
> +   case DEPTH:
> +   case DURATION:
> +   case TEMPERATURE:
> +   case TOTALWEIGHT:
> +   case SAC:
> +   case OTU:
> +   case MAXCNS:
> +   retVal = int(Qt::AlignRight | Qt::AlignVCenter);
> +   break;
> +   case DATE:
> +   case RATING:
> +   case SUIT:
> +   case CYLINDER:
> +   case GAS:
> +   case LOCATION:
> +   retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
> +   break;
> +   }
> break;
> case DiveTripModel::SORT_ROLE:
> Q_ASSERT(dive != NULL);
> --
> 1.9.1
>
>

Nope.
NR is one of the columns that this doesn't works because of the way that
the treeview works. There is actually a commit from me reverting this a
while ago.

___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Explaining my abscense

2014-09-01 Thread Tomaz Canabrava
People,

I suffered an accident and broke my leg, tomorrow I'll put six skrulls on
it, my working computer is back at home, but IV managed to put subsurface
to run on my moms PC, but everything thst I did seems wrong, and I didnt
managed to improve anything. Sigh.

Só, see you all after surgery.

Hugs
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: [PATCH 1/1] QT += concurrent is a Qt 5 thing

2014-08-29 Thread Tomaz Canabrava
Em 29/08/2014 13:39, "Dirk Hohndel"  escreveu:
>
>
> On Aug 29, 2014, at 9:38 AM, Thiago Macieira  wrote:
>
> > In Qt 4, QtConcurrent is part of QtCore.
>
> So why do my Qt5 builds succeed without this patch?

Because it was marked to use for qt4 and 5, but it only existed on 5
.
> /D
>
>
> > Signed-off-by: Thiago Macieira 
> > ---
> > subsurface.pro | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/subsurface.pro b/subsurface.pro
> > index 1d34ee9..6d3a581 100644
> > --- a/subsurface.pro
> > +++ b/subsurface.pro
> > @@ -2,11 +2,11 @@ CODECFORTR = UTF-8
> > CODECFORSRC = UTF-8
> > include(subsurface-configure.pri)
> >
> > -QT = core gui network svg concurrent
> > +QT = core gui network svg
> > lessThan(QT_MAJOR_VERSION, 5) {
> >   QT += webkit
> > } else {
> > - QT += printsupport
> > + QT += printsupport concurrent
> >   !android: QT += webkitwidgets webkit
> >   android: QT += androidextras
> > }
> > --
> > 1.8.4.5
> >
> > ___
> > subsurface mailing list
> > subsurface@hohndel.org
> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Student looking to contribute toward Subsurface

2014-08-29 Thread Tomaz Canabrava
This means that you dont have qt concurrent installed, it seems.
Em 29/08/2014 13:33, "Rohit Shinde"  escreveu:
>
> I encountered this strange error while building subsurface from source.
>
> Project MESSAGE: Warning: unknown QT: concurrent
>
> I got this error when I tried using the command qmake.

What version of qt you have?
And please, dont top post.
Take a look at the qt docs on how to compile with qt assistant, but this
shouldn't happen if you have qt development tool installed

> Anyone know about this?
>
>
> On Fri, Aug 29, 2014 at 9:45 PM, JB2Cool  wrote:
>>
>> Rohit,
>> Have a look at the Bug Tracker here (http://trac.hohndel.org/). This
will give you an idea of some of the things that need fixing.
>>
>> Jason
>>
>>
>> On Fri, Aug 29, 2014 at 4:59 PM, Tomaz Canabrava 
wrote:
>>>
>>>
>>> Em 29/08/2014 12:42, "Rohit Shinde" 
escreveu:
>>>
>>>
>>> >
>>> > Yes, I do realise that the GSoC is over.
>>> >
>>> > I just prefer Python. I do know quite a bit of C++. I haven't worked
with Ot or xstl but I can pick them up on the go.
>>> >
>>> > I liked the concept of the software. I am a swimmer myself, so I
naturally have an affinity for all things aquatic. I did not know about
divelog or dive computers before I came across this software, however on
searching the web, I learned about it and I got the urge to contribute.
>>> >
>>> > Is it possible for me to contribute?
>>>
>>> Of course it is, you just need to contribute. =)
>>> Easy things first. Download the code, compile, test it a bit, learn the
code and try to fix an easy bug.
>>>
>>> We will give you all the help you request.
>>>
>>> >
>>> > On Fri, Aug 29, 2014 at 8:33 PM, Tomaz Canabrava 
wrote:
>>> >>
>>> >>
>>> >> Em 29/08/2014 11:58, "Rohit Shinde" 
escreveu:
>>> >>
>>> >>
>>> >> >
>>> >> > Hello all,
>>> >> >
>>> >> > I am a CS student studying in India. I cam across this
organisation while browsing through GSoC 2014 accepted organisations.I
would like to contribute here.
>>> >>
>>> >> Good, but you realize that the gsoc is over right?
>>> >>
>>> >> >I am quite proficient with Python. What would I need to know to
contribute to this software?
>>> >>
>>> >> Unfortunately, not python at all. Python is a good language for web
related stuff, but not for desktop applications.
>>> >>
>>> >> > Would I need to have domain specific knowledge?
>>> >>
>>> >> C,  c++,  xstl, Qt are a great plus. But if I may ask, what did you
liked in this project? Your "I wanna contribute"  seems rather vague.
>>> >>
>>> >> > Thanks in advance
>>> >> >
>>> >> > ___
>>> >> > subsurface mailing list
>>> >> > subsurface@hohndel.org
>>> >> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>> >> >
>>> >
>>> >
>>>
>>>
>>> ___
>>> subsurface mailing list
>>> subsurface@hohndel.org
>>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>>
>>
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Student looking to contribute toward Subsurface

2014-08-29 Thread Tomaz Canabrava
Em 29/08/2014 12:42, "Rohit Shinde"  escreveu:
>
> Yes, I do realise that the GSoC is over.
>
> I just prefer Python. I do know quite a bit of C++. I haven't worked with
Ot or xstl but I can pick them up on the go.
>
> I liked the concept of the software. I am a swimmer myself, so I
naturally have an affinity for all things aquatic. I did not know about
divelog or dive computers before I came across this software, however on
searching the web, I learned about it and I got the urge to contribute.
>
> Is it possible for me to contribute?

Of course it is, you just need to contribute. =)
Easy things first. Download the code, compile, test it a bit, learn the
code and try to fix an easy bug.

We will give you all the help you request.

>
> On Fri, Aug 29, 2014 at 8:33 PM, Tomaz Canabrava 
wrote:
>>
>>
>> Em 29/08/2014 11:58, "Rohit Shinde" 
escreveu:
>>
>>
>> >
>> > Hello all,
>> >
>> > I am a CS student studying in India. I cam across this organisation
while browsing through GSoC 2014 accepted organisations.I would like to
contribute here.
>>
>> Good, but you realize that the gsoc is over right?
>>
>> >I am quite proficient with Python. What would I need to know to
contribute to this software?
>>
>> Unfortunately, not python at all. Python is a good language for web
related stuff, but not for desktop applications.
>>
>> > Would I need to have domain specific knowledge?
>>
>> C,  c++,  xstl, Qt are a great plus. But if I may ask, what did you
liked in this project? Your "I wanna contribute"  seems rather vague.
>>
>> > Thanks in advance
>> >
>> > ___
>> > subsurface mailing list
>> > subsurface@hohndel.org
>> > http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>> >
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Student looking to contribute toward Subsurface

2014-08-29 Thread Tomaz Canabrava
Em 29/08/2014 11:58, "Rohit Shinde"  escreveu:
>
> Hello all,
>
> I am a CS student studying in India. I cam across this organisation while
browsing through GSoC 2014 accepted organisations.I would like to
contribute here.

Good, but you realize that the gsoc is over right?

>I am quite proficient with Python. What would I need to know to contribute
to this software?

Unfortunately, not python at all. Python is a good language for web related
stuff, but not for desktop applications.

> Would I need to have domain specific knowledge?

C,  c++,  xstl, Qt are a great plus. But if I may ask, what did you liked
in this project? Your "I wanna contribute"  seems rather vague.

> Thanks in advance
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Beginning of the Statistics rework

2014-08-25 Thread Tomaz Canabrava
\o/


On Mon, Aug 25, 2014 at 5:01 PM, Tomaz Canabrava  wrote:

> so, this whole set of patches does: almost nothing, it's the beginning of
> the work for the new statistics pane.
> It's *safe* to merge, won't break anything, it will actually clear quite a
> bit of code.
> the new white part of the statistics widget is the new one that I'm
> working with, the bottom part is the old one.
>
>
>
From cfdb2f7c24ec6a42d303c7ffd53bcd5c09301e48 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 25 Aug 2014 17:48:32 -0300
Subject: [PATCH 10/12] Add stub of the "YearlyStatisticsItem" on the new
 Statistics

This YearlyStatisticsItem is the concentration of information
for a single year, and inside of it there will be informations
for months. Everything is a stub now - so the graphics are
still blank.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/statistics/statisticswidget.cpp | 12 
 qt-ui/statistics/statisticswidget.h   |  3 +++
 qt-ui/statistics/yearstatistics.cpp   | 10 ++
 qt-ui/statistics/yearstatistics.h | 18 ++
 4 files changed, 43 insertions(+)

diff --git a/qt-ui/statistics/statisticswidget.cpp b/qt-ui/statistics/statisticswidget.cpp
index 4adb122..294cb07 100644
--- a/qt-ui/statistics/statisticswidget.cpp
+++ b/qt-ui/statistics/statisticswidget.cpp
@@ -1,5 +1,6 @@
 #include "statisticswidget.h"
 #include "models.h"
+#include "yearstatistics.h"
 #include 
 
 YearlyStatisticsWidget::YearlyStatisticsWidget(QWidget *parent): QGraphicsView(parent)
@@ -30,6 +31,17 @@ void YearlyStatisticsWidget::setModel(YearlyStatisticsModel *m)
 
 void YearlyStatisticsWidget::modelRowsInserted(const QModelIndex &index, int first, int last)
 {
+	for(int i = 0; i < m_model->rowCount(); i++){
+		QModelIndex yearIndex = m_model->index(i,0);
+		YearlyStatisticsItem *year = new YearlyStatisticsItem(m_model, i, this);
+		scene()->addItem(year);
+	}
+	doLayout();
+}
+
+void YearlyStatisticsWidget::doLayout()
+{
+	// correctly place the items on screen, animating them.
 	// stub
 }
 
diff --git a/qt-ui/statistics/statisticswidget.h b/qt-ui/statistics/statisticswidget.h
index ae98829..b862ccc 100644
--- a/qt-ui/statistics/statisticswidget.h
+++ b/qt-ui/statistics/statisticswidget.h
@@ -5,9 +5,11 @@
 
 class YearlyStatisticsModel;
 class QModelIndex;
+class YearStatisticsItem;
 
 class YearlyStatisticsWidget : public QGraphicsView {
 	Q_OBJECT
+	void doLayout();
 public:
 	YearlyStatisticsWidget(QWidget *parent = 0);
 	void setModel(YearlyStatisticsModel *m);
@@ -18,6 +20,7 @@ public slots:
 	void modelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
 private:
 	YearlyStatisticsModel *m_model;
+	QList m_years;
 };
 
 #endif
\ No newline at end of file
diff --git a/qt-ui/statistics/yearstatistics.cpp b/qt-ui/statistics/yearstatistics.cpp
index e69de29..db04889 100644
--- a/qt-ui/statistics/yearstatistics.cpp
+++ b/qt-ui/statistics/yearstatistics.cpp
@@ -0,0 +1,10 @@
+#include "yearstatistics.h"
+#include "statisticswidget.h"
+#include "models.h"
+
+YearlyStatisticsItem::YearlyStatisticsItem(YearlyStatisticsModel *m, int row, YearlyStatisticsWidget *parent) :
+	QObject(parent),
+	model(m),
+	row(row)
+{
+}
diff --git a/qt-ui/statistics/yearstatistics.h b/qt-ui/statistics/yearstatistics.h
index e69de29..24e1eb1 100644
--- a/qt-ui/statistics/yearstatistics.h
+++ b/qt-ui/statistics/yearstatistics.h
@@ -0,0 +1,18 @@
+#ifndef YEARLYSTATISTICSITEM_H
+#define YEARLYSTATISTICSITEM_H
+
+#include 
+
+class YearlyStatisticsModel;
+class YearlyStatisticsWidget;
+
+class YearlyStatisticsItem : public QObject, public QGraphicsRectItem {
+	Q_OBJECT
+public:
+	explicit YearlyStatisticsItem(YearlyStatisticsModel *m, int row, YearlyStatisticsWidget *parent = 0);
+private:
+	YearlyStatisticsModel *model;
+	int row;
+};
+
+#endif
\ No newline at end of file
-- 
2.1.0

From fe0c4c651221033b36be08a183271af1f86c40d5 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 25 Aug 2014 18:26:13 -0300
Subject: [PATCH 11/12] Prepare the data to be displayed

This commit I add the fetching of the data, it's not yet
visible, that will start in the next commit.
This commit I prepare all data in the model to be used
in  "years" and "months". There's one issue with this code:
The last model is by trips, so I'll need to come with a better way for that.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/statistics/yearstatistics.cpp | 40 +
 qt-ui/statistics/yearstatistics.h   | 20 +++
 2 files changed, 60 insertions(+)

diff --git a/qt-ui/statistics/yearstatistics.cpp b/qt-ui/statistics/yearstatistics.cpp
index db04889..ade918c 100644
--- a/qt-ui/statistics/yearstatistics.cpp
+++ b/qt-ui/statistics/yearstatistics.cpp
@@ -7,4 +7,44 @@ YearlyStatisticsItem::YearlyStatisticsItem(Yearl

Beginning of the Statistics rework

2014-08-25 Thread Tomaz Canabrava
so, this whole set of patches does: almost nothing, it's the beginning of
the work for the new statistics pane.
It's *safe* to merge, won't break anything, it will actually clear quite a
bit of code.
the new white part of the statistics widget is the new one that I'm working
with, the bottom part is the old one.
From b6b99f80eb07398026b6813b70d9f4e4d9db1a0e Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 25 Aug 2014 14:52:45 -0300
Subject: [PATCH 1/9] Added initial skeleton for the Statistics Redesign

The statistics widget is a beast, one of the parts that I dislike most
on the current subsurface implementation. This is the initial work to
change that to something amazing. This first commit adds the first bunch
of files that I think are needed, and the correct setup for the qmake and
cmake buildsystems.

Signed-off-by: Tomaz Canabrava 
---
 CMakeLists.txt| 11 +++
 qt-ui/statistics/monthstatistics.cpp  |  0
 qt-ui/statistics/monthstatistics.h|  0
 qt-ui/statistics/statisticsbar.cpp|  0
 qt-ui/statistics/statisticsbar.h  |  0
 qt-ui/statistics/statisticswidget.cpp |  0
 qt-ui/statistics/statisticswidget.h   |  0
 qt-ui/statistics/yearstatistics.cpp   |  0
 qt-ui/statistics/yearstatistics.h |  0
 subsurface.pro| 12 ++--
 10 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 qt-ui/statistics/monthstatistics.cpp
 create mode 100644 qt-ui/statistics/monthstatistics.h
 create mode 100644 qt-ui/statistics/statisticsbar.cpp
 create mode 100644 qt-ui/statistics/statisticsbar.h
 create mode 100644 qt-ui/statistics/statisticswidget.cpp
 create mode 100644 qt-ui/statistics/statisticswidget.h
 create mode 100644 qt-ui/statistics/yearstatistics.cpp
 create mode 100644 qt-ui/statistics/yearstatistics.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44fa134..2eef2d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,6 +164,14 @@ SET(SUBSURFACE_PROFILE_LIB_SRCS
 	qt-ui/profile/tankitem.cpp
 )
 
+#the yearly statistics widget.
+SET(SUBSURFACE_STATISTICS_LIB_SRCS
+	qt-ui/statistics/statisticswidget.cpp
+	qt-ui/statistics/yearstatistics.cpp
+	qt-ui/statistics/statisticsbar.cpp
+	qt-ui/statistics/monthstatistics.cpp
+)
+
 #the main app.
 SET(SUBSURFACE_APP
 	main.cpp
@@ -182,6 +190,7 @@ ENDIF()
 
 ADD_LIBRARY(subsurface_corelib STATIC ${SUBSURFACE_CORE_LIB_SRCS} )
 ADD_LIBRARY(subsurface_profile STATIC ${SUBSURFACE_PROFILE_LIB_SRCS})
+ADD_LIBRARY(subsurface_statistics STATIC ${SUBSURFACE_STATISTICS_LIB_SRCS})
 ADD_LIBRARY(subsurface_generated_ui STATIC ${SUBSURFACE_UI_HDRS})
 ADD_LIBRARY(subsurface_interface STATIC ${SUBSURFACE_INTERFACE})
 ADD_EXECUTABLE(subsurface ${SUBSURFACE_APP} ${SUBSURFACE_QRC_HRDS} )
@@ -190,6 +199,7 @@ target_link_libraries( subsurface
   subsurface_generated_ui
   subsurface_interface
   subsurface_profile
+  subsurface_statistics
   subsurface_corelib
   ${QT_LIBRARIES}
   ${MARBLE_LIBRARIES}
@@ -198,6 +208,7 @@ target_link_libraries( subsurface
   -lzip
 )
 
+ADD_DEPENDENCIES(subsurface_statistics subsurface_generated_ui)
 ADD_DEPENDENCIES(subsurface_profile subsurface_generated_ui)
 ADD_DEPENDENCIES(subsurface_interface subsurface_generated_ui)
 ADD_DEPENDENCIES(subsurface_generated_ui version)
diff --git a/qt-ui/statistics/monthstatistics.cpp b/qt-ui/statistics/monthstatistics.cpp
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/monthstatistics.h b/qt-ui/statistics/monthstatistics.h
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/statisticsbar.cpp b/qt-ui/statistics/statisticsbar.cpp
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/statisticsbar.h b/qt-ui/statistics/statisticsbar.h
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/statisticswidget.cpp b/qt-ui/statistics/statisticswidget.cpp
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/statisticswidget.h b/qt-ui/statistics/statisticswidget.h
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/yearstatistics.cpp b/qt-ui/statistics/yearstatistics.cpp
new file mode 100644
index 000..e69de29
diff --git a/qt-ui/statistics/yearstatistics.h b/qt-ui/statistics/yearstatistics.h
new file mode 100644
index 000..e69de29
diff --git a/subsurface.pro b/subsurface.pro
index 4ce0eba..5fa9686 100644
--- a/subsurface.pro
+++ b/subsurface.pro
@@ -94,7 +94,11 @@ HEADERS = \
 	qt-ui/configuredivecomputerdialog.h \
 	configuredivecomputer.h \
 	configuredivecomputerthreads.h \
-	devicedetails.h
+	devicedetails.h \
+	qt-ui/statistics/monthstatistics.h \
+	qt-ui/statistics/statisticswidget.h \
+	qt-ui/statistics/statisticsbar.h \
+	qt-ui/statistics/yearstatistics.h
 
 android: HEADERS -= \
 	qt-ui/usermanual.h \
@@ -178,7 +182,11 @@ SOURCES =  \
 	qt-ui/configuredivecomputerdialog.cpp \
 	configuredivecomputer.cpp \
 	configuredivecomputerthreads.cpp \
-	devicedetails.cpp
+	devi

Re: Diveplans to dive data?

2014-08-25 Thread Tomaz Canabrava
On Mon, Aug 25, 2014 at 9:58 AM, Kari Kolehmainen <
kari.kolehmai...@abysscore.com> wrote:

> Ok I didn't know it had a planner ( I have a version 4.1 Mac OS X). I
> don't know about GUE deco planner, I am using V-Planner and Multi deco.
>

Hey
( please please, don't top post )


>
> I don't seem to be able to find the planner feature from the menus...
> Still it would be nice to be able to see the plots from other planners as
> well. Plot could be simple line on the dive profile. Data is simple enough:
> time, depth depth pairs, possibly also contingensy plans.
>

Because the planner got back on subsurface in the version 4.2, could you
update? *tons* of bugs where fixed.


>
> I think it would be easiest if there was a "add dive plan" button on the
> Dive Notes tab and possibility to enter data on simple table, first column
> for depth and subsequent columns for actual plan, lost gas plan and over
> time/depth plan.
>

There is the "Add plan" menu, on the 4.2 version :)


>
> Cheers,
> Kari Kolehmainen
>
> On Aug 25, 2014, at 3:33 PM, Davide DB  wrote:
>
> Hi Kari,
> Could you explain better?
> Right now Subsurface has a dive planner module already implemented. Maybe
> the UI needs some refinement but functionalities are even better than GUE
> decoplanner. Moreover Subsurface is in full development while decoplanner
> seems a little bit on a dead end.
>
> davide@mobile
> Il 25/ago/2014 12:35 "Kari Kolehmainen" 
> ha scritto:
>
>> Hello,
>>
>> I just switched from JDiveLog to Subsurface and I am liking it.
>>
>> One question though, Is there an option to import or enter dive plan data
>> to the dive log?
>>
>> I am thinking it would be very insightful to see how the dive relates to
>> the plan and what sort of plans you have had on various dive sites. It
>> would be even more useful to be able to import data directly from V-Planner
>> or Multideco.
>>
>> If there is development going on related to this, I could chip in my
>> time. If not, I could try to implement something of that sort once I have
>> some free time (wishful thinking…)
>>
>> --- Kari Kolehmainen
>>
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: QSettings weirdness

2014-08-23 Thread Tomaz Canabrava
All those static classes. If we remove them we have a better control of
that.

This can be a good exercice for a cleaner code.
Em 23/08/2014 17:14, "Dirk Hohndel"  escreveu:

> On August 23, 2014 12:41:26 PM Thiago Macieira 
> wrote:
>
>  On Saturday 23 August 2014 11:38:21 Dirk Hohndel wrote:
>> > But if I look in ~/.config/Subsurface/Subsurface.conf there are a ton
>> of
>> > settings in there...
>>
>> Depends on where in the application you put that. At the end of that
>> block,
>> when I tried here, the file *is* empty.
>>
>> But the application continues to run and re-adds stuff there.
>>
>
> I did it in main() and the return 0 afterwards should end the program.
>
> My guess is it's some destructors that still run after that...
>
> /D
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Better toolbar

2014-08-23 Thread Tomaz Canabrava
On Sat, Aug 23, 2014 at 12:19 PM, Dirk Hohndel  wrote:

> On Sat, Aug 23, 2014 at 11:48:05AM -0300, Tomaz Canabrava wrote:
> > I think this fixes all issues we had from the old toolbar implementation,
> > and we also managed to remove around 250 LOC. <3
>
> I'm happy with the way it works on principle. This reordered the buttons
> and I am wondering... which buttons are the most important / most
> frequently used ones that should be on the top (and the others will then
> start flowing out on the bottom and turn into menu entries)?
>
> Heartrate seems like something that should be close to the bottom as very
> few dive computers support that. What else?
>

The reorder was unintentional, I'll send a patch that reorganizes it the
way it was before.


>
> ?D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Better toolbar

2014-08-23 Thread Tomaz Canabrava
forget about the .gitignore part, sorry.


On Sat, Aug 23, 2014 at 12:07 PM, Dirk Hohndel  wrote:

> On Sat, Aug 23, 2014 at 11:48:05AM -0300, Tomaz Canabrava wrote:
> > From c4e1a6cc12b17db51c525ef6195e16a24467dcfd Mon Sep 17 00:00:00 2001
> > From: Tomaz Canabrava 
> > Date: Fri, 22 Aug 2014 18:28:55 -0300
> > Subject: [PATCH 1/2] Complement the CMakesList.txt with the latest file
> >  inclusions.
> >
> > Just added the missing files to the CMakesList.txt
> >
> > Signed-off-by: Tomaz Canabrava 
> > ---
> >  .gitignore | 2 ++
> >  CMakeLists.txt | 6 +-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/.gitignore b/.gitignore
> > index 911b0ee..4a34a07 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -21,6 +21,8 @@ packaging/windows/subsurface.nsi
> >  packaging/macos/Info.plist
> >  *.kdev4
> >  callgrind.out.*
> > +.gitignore
>
> Is adding .gitignore to .gitignore what you wanted to do?
>
> > +build/
> >  .rcc
> >  .moc
> >  .uic
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Fix editing trip blocks time edition forever

2014-08-23 Thread Tomaz Canabrava

From 697974ab58a30bccb2a64ecd870028f2d2e50686 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Thu, 14 Aug 2014 15:53:59 -0300
Subject: [PATCH 2/2] Re-enable the edition of the Date after editing a trip.

since we can't edit the trip date, we need to remember to
re-enable it after we disable it.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/maintab.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index e8087c7..7aa3e41 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -294,6 +294,7 @@ void MainTab::enableEdition(EditMode newEditMode)
 		ui.dateEdit->setEnabled(false);
 		editMode = TRIP;
 	} else {
+		ui.dateEdit->setEnabled(true);
 		if (amount_selected > 1) {
 			displayMessage(tr("Multiple dives are being edited."));
 		} else {
@@ -662,6 +663,7 @@ void MainTab::acceptChanges()
 	struct dive *d;
 	tabBar()->setTabIcon(0, QIcon()); // Notes
 	tabBar()->setTabIcon(1, QIcon()); // Equipment
+	ui.dateEdit->setEnabled(true);
 	hideMessage();
 	ui.equipmentTab->setEnabled(true);
 	on_location_editingFinished(); // complete coordinates *before* saving
@@ -847,6 +849,7 @@ void MainTab::rejectChanges()
 			return;
 		}
 	}
+	ui.dateEdit->setEnabled(true);
 	editMode = NONE;
 	tabBar()->setTabIcon(0, QIcon()); // Notes
 	tabBar()->setTabIcon(1, QIcon()); // Equipment
-- 
2.1.0

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Better toolbar

2014-08-23 Thread Tomaz Canabrava
I think this fixes all issues we had from the old toolbar implementation,
and we also managed to remove around 250 LOC. <3
From c4e1a6cc12b17db51c525ef6195e16a24467dcfd Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Fri, 22 Aug 2014 18:28:55 -0300
Subject: [PATCH 1/2] Complement the CMakesList.txt with the latest file
 inclusions.

Just added the missing files to the CMakesList.txt

Signed-off-by: Tomaz Canabrava 
---
 .gitignore | 2 ++
 CMakeLists.txt | 6 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 911b0ee..4a34a07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,8 @@ packaging/windows/subsurface.nsi
 packaging/macos/Info.plist
 *.kdev4
 callgrind.out.*
+.gitignore
+build/
 .rcc
 .moc
 .uic
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed9f3cc..44fa134 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,6 +108,9 @@ SET(SUBSURFACE_CORE_LIB_SRCS
 	divecomputer.cpp
 	exif.cpp
 	subsurfacesysinfo.cpp
+	devicedetails.cpp
+	configuredivecomputer.cpp
+	configuredivecomputerthreads.cpp
 )
 
 #the interface, in C++
@@ -141,7 +144,7 @@ SET(SUBSURFACE_INTERFACE
 	qt-ui/divelogexportdialog.cpp
 	qt-ui/divepicturewidget.cpp
 	qt-ui/usersurvey.cpp
-
+	qt-ui/configuredivecomputerdialog.cpp
 )
 
 #the profile widget
@@ -158,6 +161,7 @@ SET(SUBSURFACE_PROFILE_LIB_SRCS
 	qt-ui/profile/diveeventitem.cpp
 	qt-ui/profile/divetooltipitem.cpp
 	qt-ui/profile/ruleritem.cpp
+	qt-ui/profile/tankitem.cpp
 )
 
 #the main app.
-- 
2.1.0

From 0fbecc4c1a758bd03daeef172718f5bf7f37fa00 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Fri, 22 Aug 2014 22:26:07 -0300
Subject: [PATCH 2/2] A much better Toolbar for the profile.

Using QToolBar I was able to remove much of the dead code
from the mainwindow.ui xml file, by transforming the QToolButtons
into actions and loading them dinamically in the .cpp code
I couldn't use the designer for this ( as I wanted ) because
Qt has no notion of ToolBars outside of the areas where the
MainWindow should have one, and we use it in a very different
area.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/mainwindow.cpp |  47 ++-
 qt-ui/mainwindow.h   |  33 +-
 qt-ui/mainwindow.ui  | 635 ---
 qt-ui/profile/profilewidget2.cpp |   4 +-
 4 files changed, 235 insertions(+), 484 deletions(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 17c5547..4c70f5c 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "divelistview.h"
 #include "starwidget.h"
@@ -69,6 +70,10 @@ MainWindow::MainWindow() : QMainWindow(),
 	Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!");
 	m_Instance = this;
 	ui.setupUi(this);
+	profileToolbarActions << ui.profCalcAllTissues << ui.profCalcCeiling << ui.profDcCeiling << ui.profEad <<
+		ui.profHR << ui.profIncrement3m << ui.profMod << ui.profNdl_tts << ui.profNdl_tts <<
+		ui.profPhe << ui.profPn2 << ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled <<
+		ui.profTogglePicture << ui.profTankbar;
 	setWindowIcon(QIcon(":subsurface-icon"));
 	if (!QIcon::hasThemeIcon("window-close")) {
 		QIcon::setThemeName("subsurface");
@@ -117,6 +122,19 @@ MainWindow::MainWindow() : QMainWindow(),
 #endif
 	memset(©PasteDive, 0, sizeof(copyPasteDive));
 	memset(&what, 0, sizeof(what));
+
+	QToolBar *toolBar = new QToolBar();
+	Q_FOREACH(QAction *a, profileToolbarActions)
+		toolBar->addAction(a);
+	toolBar->setOrientation(Qt::Vertical);
+
+	// since I'm adding the toolBar by hand, because designer
+	// has no concept of "toolbar" for a non-mainwindow widget (...)
+	// I need to take the current item that's in the toolbar Position
+	// and reposition it alongside the grid layout.
+	QLayoutItem *p = ui.gridLayout->takeAt(0);
+	ui.gridLayout->addWidget(toolBar,0,0);
+	ui.gridLayout->addItem(p, 0, 1);
 }
 
 MainWindow::~MainWindow()
@@ -228,26 +246,6 @@ void MainWindow::cleanUpEmpty()
 	disableDcShortcuts();
 }
 
-void MainWindow::setToolButtonsEnabled(bool enabled)
-{
-	ui.profPO2->setEnabled(enabled);
-	ui.profPn2->setEnabled(enabled);
-	ui.profPhe->setEnabled(enabled);
-	ui.profDcCeiling->setEnabled(enabled);
-	ui.profCalcCeiling->setEnabled(enabled);
-	ui.profCalcAllTissues->setEnabled(enabled);
-	ui.profIncrement3m->setEnabled(enabled);
-	ui.profMod->setEnabled(enabled);
-	ui.profEad->setEnabled(enabled);
-	ui.profNdl_tts->setEnabled(enabled);
-	ui.profSAC->setEnabled(enabled);
-	ui.profRuler->setEnabled(enabled);
-	ui.profScaled->setEnabled(enabled);
-	ui.profHR->setEnabled(enabled);
-	ui.profTogglePicture->setEnabled(enabled);
-	ui.pro

Re: Towards 4.3: TAG management

2014-08-22 Thread Tomaz Canabrava
On Fri, Aug 22, 2014 at 1:51 PM, Davide DB  wrote:

>
> Il 22/ago/2014 18:11 "Dirk Hohndel" 
> > So careful with your
> > '813' vertical - that's too tall for many of our users.
>
> Ok
> I will try with 768px. Right now I'm not confident with font size used by
> this amazing mockup design program.
> To be sure of spacing I tried the same font size as Subsurface while
> sketching but I get a far smaller font...
> I have Subsurface with Segoe UI 9pt while Pencil with 11 (no unit
> displayed) I suspect they are pixel.
>

Davide,

you can use 'Designer', the same tool we use in subsurface to design our
interfaces, so the mockups will be a better fit.

Tomaz

> > > You click on a card and you go to the usual full dive view while the
> > > search panel collapse above occupying just few pixels to open again.
> >
> > That said... it's a cool idea.
> >
> > /D
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3: TAG management

2014-08-22 Thread Tomaz Canabrava
On Fri, Aug 22, 2014 at 12:59 PM, Davide DB  wrote:

> I was too lazy to add a calendar control to filter by period and a
> time slider to filter for runtime. It lacks of max depth filter too.
> BTW the frame is 1007x813 so plenty of space for small monitors.
> You click on a card and you go to the usual full dive view while the
> search panel collapse above occupying just few pixels to open again.
>
>
very good mockup - the only thing we can't do right now is the results as
you proposed because creating the data to be visualized is an expensive
operation and subsurface would be really slow at that.
( we could however keep a small pixmap of the profile to use on those
cases... hm... )


> Sci-Fi
>
> --
> Davide
> https://vimeo.com/bocio/videos
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3: TAG management

2014-08-21 Thread Tomaz Canabrava
On Thu, Aug 21, 2014 at 2:41 PM, Davide DB  wrote:

>
> Il 21/ago/2014 18:04 "Joakim Bygdell"  ha scritto:
>
> > One place to put the tag based filtering would be in the main tab, that
> way it doesn’t compete with the dive list for space.
> > We vill get a fairly large area to place the tags in which will allow us
> to print the more used tags with a font that is slightly larger than the
> other or just have them in bold face.
> >
> > While we are at tit we might also put the globe up there, that will give
> us more horizontal space for the dive list when subsurface is run on
> laptops with low resolution.
>
> Do you mean adding another tab after "photo"?
>

no no no, we already have too many stuff there. :(
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3: TAG management

2014-08-21 Thread Tomaz Canabrava
Em 21/08/2014 11:12, "Davide DB"  escreveu:
>
> 2014-08-21 16:02 GMT+02:00 Tomaz Canabrava :
> >
> > Deivide, I think the best approach right now is to remove the globe and
> > place the "advanced search on top of it, this way we can have a good
dialog
> > that's not very small and we can display things in a sane way. What you
> > think?
>
> Hummm, having a search pane on the left, lower side doesn't seem very
handy.
> I could try to work/sketch with real minimum dimensions (my laptop has
> just 1280x1024) drawing components and fonts with real size to see how
> much space we need...
> Let me try.

I think its not bad if we do a hit of higligth when we change focus of the
widget.

Ill try to sketch something.

A lot of programa do as a popup window

What we really need is a designer to look our interface.

Tomaz
>
> Davide
> https://vimeo.com/bocio/videos
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3: TAG management

2014-08-21 Thread Tomaz Canabrava
Em 21/08/2014 10:37, "Davide DB"  escreveu:
>
> 2014-08-20 16:17 GMT+02:00 Dirk Hohndel :
> >
> > In a way you want this to be always visible - but it can't take much
> > screen real estate. This is a tough one.
> > On reasonably big screens it would be easy to have it just as a single
> > line at the top of the dive list. But on small screens (like the
1366x768
> > screens that we just talked about a few days ago) this is going to be
> > tight. I'm not sure there is a perfect solution that will make everyone
> > happy.
>
> Yes, space is the main problem...
>
>
> I lost yesterday sketch project... Ah! open source projects ;)
>
> I did not like the search canvas position being so in the middle so I
> gave another try on layout.
> As I wrote I guess that once a user filters and finds a dive or a
> subset, he probably wants to maintain the full view.
> So we are forced to remove some space somewhere...
>
> I see a lot of applications (even OS X and Windows system windows)
> having a search imput field on the top right angle. So I copied this
> style. We shouldn't loose too much space because we already have the
> menu bar.
>
> I still have to understand what to do with it because we could search
> by tag of by specific field... Maybe a default on preferences? I don't
> know :)
>
> Anyway, when the user start to type there something happen: the four
> panels shift (or resize) downwards leaving space for a small
> pane/canvas which accomodate the search tools...
>
> - For tag search: a view like I drawn (and lost) yesterday. Hence same
> considerations apply.
>
> - For field search: we could have just a list of searchable fields
> with checkboxes, so the user can select one of them. This means that
> if he checks "Location", terms typed in the search box will search for
> Location.
>
> In this way the search pane/canvas shouldn't need too much vertical
> space, it's like the small space that most web sites have for
> tags/labels under a post/article.
>
> I attached two images showing my layout idea: default full layout and
> the search layout just to show the arrangement.
> Eventually I can elaborate some views of this pane/canvas but tomorrow
> entire day dedicated to bottle refills and next week I will be diving
> so I will stop with my foolishness :)
>
> PS
> Tomaz!!! Where are you???

Doing a lot of work on the real one, sorry guys.

Deivide, I think the best approach right now is to remove the globe and
place the "advanced search on top of it, this way we can have a good dialog
that's not very small and we can display things in a sane way. What you
think?

> --
> Davide
> https://vimeo.com/bocio/videos
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Subsurface Dive list table

2014-08-20 Thread Tomaz Canabrava
On Wed, Aug 20, 2014 at 3:52 PM, Thomas Maisl  wrote:

> Davide, keep in mind Subsurface is running on Linux and OS X, too. The
> development is mostly done within Linux and OS X, also using QT.
> So different style guide may apply, too.
>

We do have in subsurface code to adjust to the Gnome platform, we do have
code on subsurface to adjust to Mac platform, we don't have code to adjust
to Windows platform because till now nobody really told us what was broken
there, since no programmer of subsurface uses windows as primary targets.


>
> Probably most users are running Subsurface within a M$ Windows environment.
> The user survey may provide better information, soon.
> With M$ Windows there seem to be certain restrictions regarding the
>

Please, don't use M$ here, let's be professionals and not attack *any* kind
of software, okay? :)


> functionality.
>
> Am 20.08.2014 18:48:01 schrieb Davide Db:
> > *Column Heading*
> >
> > [...] We all know what the first column "#" means but it's a U.S.
> > customary. From Wikipedia:
> > Would be nice finding a correct number sign localization or something
> > else. An Italian man does not understand # at all. In Italian language it
> > would be "n°"
> >
> It seems to be a translation related thing. In a german environment I see
> "Nr." as Column Heading. Probably other headers can be easyly
> fixed/changed, too.
>
> > *
> > *
> > *Font size*
> >
> > On Windows, Subsurface installs by default with the Calibri font. This
> > gives immediately a naive looking UI to the Windows Average Joe user like
> > me and my dive buddies.
> >
> Calibri is used as default font, because some native Windows fonts lack the
> subscript 2 sign.
> If Segeo UI provides proper subscript support it probably might be easy to
> change to.
>
> Thomas
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: I'm working on this dive-share in my spare time

2014-08-20 Thread Tomaz Canabrava
On Wed, Aug 20, 2014 at 2:00 PM, Salvo Tomaselli 
wrote:

> In data mercoledì 20 agosto 2014 07:49:12, Dirk Hohndel ha scritto:
> > SOrry for the delay - your email was sitting in our long spam queue and I
> > only go through that manually every few days...
> Well less than 1 day doesn't seem too terrible to me :-)
>
> > But one question I have... Gehad has done a really strong job with the
> > HTML export... wouldn't it make more sense to use his HTML export code
> and
> > find ways to integrate that into your website? The user experience of his
> > code is already very nice, I think.
> I didn't know about that, because I was still using the older version that
> is
> in debian (they haven't upgraded because libgit2 is in experimental).
>
> Now I've compiled the new version and had a look.
>
> I am hesitant to use that HTML for various reasons:
> - it displays less informations than what I've already implemented
> - I need one separate HTML per dive (but that could be fixed)
> - can't control or change the look of the website
>

can - the dives should be easily themable by css.


> - it would mean to give up the possibility to ever import data from other
> sources (unless I reimplement the same HTML generation for the other
> formats).
>

it can be a plus for the people that uses subsurface :D


>
> So I don't think it would be such a great idea, even thou it would make my
> codebase and my life simpler.
>
> > If you then add the ability for people to select if their dives are
> public
> > or only visible with a private URL (minimum pretend-security) then this
> > could trivially become the backend of ONE way to show your divelog to a
> > diveoperator from a tablet or phone...
> >
> > I don't know if this is a direction that you'd like to take this, but
> this
> > is a frequently requested feature.
> This seems like a good idea. I'll think for a decent way to do this and
> I'll
> get back at you.
>
> Best
>
> --
> Salvo Tomaselli
>
> "Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
> senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
> -- Galileo Galilei
>
> http://ltworf.github.io/ltworf/
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: help : resizable is not possible

2014-08-20 Thread Tomaz Canabrava
On Wed, Aug 20, 2014 at 12:03 PM, Miika Turkia 
wrote:

> On Wed, Aug 20, 2014 at 3:29 PM, Dirk Hohndel  wrote:
>
>> On Wed, Aug 20, 2014 at 08:23:51AM -0300, Tomaz Canabrava wrote:
>> > Em 20/08/2014 06:39, "Benjamin"  escreveu:
>> > >
>> > > This may be flogging a dead horse, but maybe instead of just changing
>> the
>> > icon layout, would it help if the user could also select which icons
>> should
>> > be shown? Is it possible to do the equivalent of "visible = false" to
>> the
>> > icons, based on a user setting, without causing huge problems in either
>> the
>> > UI, or the functionality? Or would it simply lead to far too many user
>> > problems?
>> >
>> > I think it would, but im no designer. Ill attack a designer to see what
>> > they think about it.
>>
>> I like your idea, Tomaz, of simply re-layouting things into two column
>> when the vertical space gets constraint MUCH better than an option to
>> disable and hide some of the buttons.
>>
>
> How about similar enable-disable selection than what is already used for
> the columns on divelist? Many of the icons are useless for the average
> recreational diver, so it would not hurt to hide these by default.
>

not going to happen.  The dive list have this because it's so big and
there's no other way to display the items in a sane way, and this one we
can.
The recreational diver can not understand most of the buttons but as soon
as he clicks something will happen and he will see some differences ( for
instance, the tissues ) and this is a nice point to have. :)



> miika
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3: TAG management

2014-08-20 Thread Tomaz Canabrava
There will be a advanced search on 4.3, im working on it right now. And
tags will be used =)

I like the tag cloud stuff, I just dont know where to put it on subsurface.
Em 20/08/2014 07:45, "Davide DB"  escreveu:

> All my friends converted to Subsurface keep asking: what TAGs are
> designed for? How I search trough my dives?
>
> I've told that Subsurface 3.x had the search and filter
> functionalities (I've been using it since 4.x) that was removed to be
> designed from scratch.
> Will we see it again in 4.3? :)
>
> http://trac.hohndel.org/ticket/559#comment:2
>
> http://trac.hohndel.org/ticket/491
>
> Following Dirk suggestions I imagine a new TAG view that could occupy
> lower/upper part of the dive list view.
>
> In this tag view you have a TAG Cloud similar to some web widgets very
> popuplar on forum/social websites.
>
> TAGs are multiselectable and filters the dive list above/below. In
> this way the normal layout is not changed.
>
> Optionally TAG Cloud could have some nice graphical effect like web tag
> clouds:
>
> TAG font size based on tag popularity
> TAGs ordered alphabetically or by popularity and so on...
>
>
> I do not know if QT has a Tag cloud or popular tag widget by default.
> It's common on web sites but I found, just as graphical examples, two
> custom widgets written in C# and Delphy wor Windows:
>
>
> http://www.windows8downloads.com/win8-tagcloud-for-vcl-lsszavxj/screenshot.html
>
>
> http://www.codeproject.com/Articles/224231/Word-Cloud-Tag-Cloud-Generator-Control-for-NET-Win
>
> Mavericks OS X has an integrated tags support and it's way less intrusive:
>
> http://support.apple.com/kb/HT5839
>
> Following their examples, we could put the most used tags in a
> horizontal bar. The last tag should be always "all your tags..." which
> opens a full tag view.
>
> The interesting feature is "In any Finder window, enter the tag you
> want to find in the search field. Items that have that tag appear.
> Enter multiple tags to find items to narrow or expand your search."
> They have the search field in the upper right corner but I do not know
> how does it works with multiple tags but I guess here is full of mac
> users...
>
> For Linux I found only semi command line examples :)
>
>
>
>
>
>
>
>
>
>
>
> --
> Davide
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: help : resizable is not possible

2014-08-20 Thread Tomaz Canabrava
Em 20/08/2014 06:39, "Benjamin"  escreveu:
>
> This may be flogging a dead horse, but maybe instead of just changing the
icon layout, would it help if the user could also select which icons should
be shown? Is it possible to do the equivalent of "visible = false" to the
icons, based on a user setting, without causing huge problems in either the
UI, or the functionality? Or would it simply lead to far too many user
problems?

I think it would, but im no designer. Ill attack a designer to see what
they think about it.

>
>
> On 17 August 2014 18:01, vavincavent  wrote:
>>
>> Dirk,
>>
>> My résolution is 1366x768 with a laptop.
>>
>> Vavincavent
>>
>> Le 17/08/2014 15:25, Dirk Hohndel a écrit :
>>
>>> On Sun, Aug 17, 2014 at 11:07:13AM +0200, vavincavent wrote:

 In the all vue, risizable is not possible because of the icon on the
right
 of graph. So we can see only a little globe.
 Is it possible to put the icons on the top of the graph?
>>>
>>> I've heard complaints about this from people with small screens before -
>>> and I just added another icon to the toolbar :-/
>>>
>>> I'm not sure what the best solution is. Most people with small screens
>>> find the vertical size the most limiting factor, so having the icons use
>>> vertical space above the profile isn't a great solution, either.
>>> I wonder if we could switch to two columns (or maybe scale the icons
down
>>> smaller) if we detect a very small screen.
>>>
>>> What's your screen resolution? 1366x768? I usually work on a 2560x1600
>>> laptop and don't really run into this, much :-)
>>>
>>> /D
>>
>>
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: re-planning a planned dive

2014-08-19 Thread Tomaz Canabrava
You are making my job too easy =)
Em 19/08/2014 23:42, "Dirk Hohndel"  escreveu:

> This was one of the outstanding features that we didn't get done in time
> for 4.2. And it turned out to be on the one hand not very hard, on the
> other hand fairly instrumental to finding quite a few bugs that were still
> lurking here and there in the planner code. I think more of the commits in
> this series end up fixing old issues than adding new capabilities. And
> certainly 3/4 of the time working on this was spent on observing the
> issues, understanding their causes and coming up with reasonable fixes for
> them.
>
> That said, as usual I have hidden some very cute bugs in the new code,
> just to make sure that you guys read what I commit and test it. So please
> get started, as always the first one to find a bug in my code will win a
> valuable price!
>
> So where are the limitations of the current implementation?
>
> It seems to work quite well in my testing (but who knows once Henrik,
> Joakim, Robert and the other usual suspects start doing their testing).
>
> But there is one rather interesting issue: right now we don't save whether
> a sample was manually entered or created by our deco (or ascent)
> algorithm. Or more precisely, we've never saved this in the past and we
> still don't save this information to disk. Which means that when you
> re-plan such a dive the dive points table will contain ALL waypoints of
> the dive, including the ascent and deco stops (and all such points will
> have handlers in the profile). This is of course undesirable (even though
> it isn't really hard to get rid of them - especially in the dive points
> table it's really easy to just delete them all and they get automagically
> recreated by the planning algorithm).
>
> For now I have only implemented an in memory solution. The idea is that
> while you are planning a dive you may go back and forth and try multiple
> things. And as long as you don't save the planned dive, restart Subsurface
> and read it in again, you can continue to make changes as you'd expect.
> Only the dive data points that you entered before are in the table and
> have handles in the profile. All the other poinst (gas changes, ascent,
> deco stops, transitions) will get recalculated on the fly as if you never
> left planning mode.
>
> But once the planned dive is written to disk and read back we are back to
> what I describe above - ALL waypoints are treated as if they were user
> entered.
>
> I have a hunch that this is sufficient for most reasonable use cases, but
> the simply fact how hard it is to explain this makes me wonder if we
> shouldn't save this data to disk, anyway. It obviously would be easy to
> add to both XML and git save and parse routines... but I didn't want to
> add this until the likely users of this feature have commented if that
> would be important to them.
>
> And until all of you had some time to poke holes into my architecture and
> implementation for this.
>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: annoying warnings from Qt on the console

2014-08-18 Thread Tomaz Canabrava
On Mon, Aug 18, 2014 at 1:34 PM, Dirk Hohndel  wrote:

> Dear Qt Experts...
>
> I had seen those on Windows (but no one starts things from the console
> there), and now that I have switched my Linux builds to be Qt5 by default
> as well I get them on Linux and it's rather annoying.
>
> Simply starting Subsurface without any data file gives me >100
>
> QFSFileEngine::open: No file name specified
>

on mine, just to compare:

[tcanabra@trantor subsurface]$
./subsurface

can't find Qt localization for locale "C" searching in "/usr/share
/qt4/translations"

can't find Subsurface localization for locale
"C"



Just that.
I don't really know how to turn warnings down on runtme on Qt, maybe thiago?


> warnings.
>
> My guess is that this could be related to my hacked version of Marble
> (that throws away large parts of Marble code), but I wonder how to track
> down WHERE these messages are coming from. I ran things under the debugger
> (but I don't have built Qt5 from source here on Linux) and tracked the
> first few of them down to being caused by Marble trying to set up its
> styles... but without Qt5 source / ability to step through its functions I
> didn't get very far.
>
> But fundamentally I wonder if there's an easy way to turn the warnings off
> - they seem kinda pointless.
>
> Thanks
>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: help : resizable is not possible

2014-08-17 Thread Tomaz Canabrava
I'll make them Flow on more columns if the size is smaller than the
Contents.
Em 17/08/2014 10:41, "Benjamin"  escreveu:

> My laptop maxes out at 1366*768. Would it be possible to maybe make the
> icons scale by a certain percent based on screen size?
> On 17 Aug 2014 15:25, "Dirk Hohndel"  wrote:
>
>> On Sun, Aug 17, 2014 at 11:07:13AM +0200, vavincavent wrote:
>> > In the all vue, risizable is not possible because of the icon on the
>> right
>> > of graph. So we can see only a little globe.
>> > Is it possible to put the icons on the top of the graph?
>>
>> I've heard complaints about this from people with small screens before -
>> and I just added another icon to the toolbar :-/
>>
>> I'm not sure what the best solution is. Most people with small screens
>> find the vertical size the most limiting factor, so having the icons use
>> vertical space above the profile isn't a great solution, either.
>> I wonder if we could switch to two columns (or maybe scale the icons down
>> smaller) if we detect a very small screen.
>>
>> What's your screen resolution? 1366x768? I usually work on a 2560x1600
>> laptop and don't really run into this, much :-)
>>
>> /D
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3 :)

2014-08-08 Thread Tomaz Canabrava
Em 08/08/2014 17:14, "Davide DB"  escreveu:
>
>
> Il 08/ago/2014 20:59 "Linus Torvalds"  ha
scritto:
>
> > Well, if we just pick the currently selected one like Tomaz said (it
> > would be the one shown behind the download dialog, so you can kind of
> > see it in the background), a tech diver with lots of different complex
> > cases can easily just pick his last "similar" dive, and off he goes.
> >
> > And for the most common recreational use, you'd probably just fire up
> > subsurface in order to download new dives, and the last dive is the
> > one we select by default at startup, so it just DTRT by default.
> >
> > Now, if somebody randomly browses old dives before deciding to
> > download new ones, *that* could be confusing, but if the download
> > checkmark text clearly states something like "take equipment data from
> > currently shown dive in newly downloaded dives" it really sounds
> > fairly straightforward.
>
> For new downloaded dives it's perfect for me.
> How to get the same for already logged dives?
> Something like a crtl-c crtl-v with tanks?
>
> I'm bringing into Subsurface tons to dives from several sources and I'm
completing their data from my wet notes. Having a way to copy and paste
bottle sets would be amazing...

Its quite easy to do.
I just need time. Ajjhh

___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Towards 4.3 :)

2014-08-08 Thread Tomaz Canabrava
On Fri, Aug 8, 2014 at 3:28 PM, Dirk Hohndel  wrote:

> On Fri, Aug 08, 2014 at 09:57:42AM -0700, Linus Torvalds wrote:
> > On Fri, Aug 8, 2014 at 6:28 AM, Davide DB  wrote:
> > >
> > > I do only tech dives and despite of default cylinder I set, I have to
> insert
> > > manually two deco bottles (at least) each dive.
> > > Having a bottles set instead of a single cylinder would be really
> useful.
> >
> > I'm wondering if there might not be a simpler model than having a
> > configuration thing for "default cylinders" etc.
> >
> > For example, if the issue really is "I hate having to fill in all this
> > information every time", why not have a simple "copy dive equipment
> > from last dive" kind of model?
> >
> > IOW, there wouldn't be any special default set, but perhaps just when
> > downloading dives there would be a simple checkmark for "copy
> > equipment".
> >
> > For example, even if you *don't* end up having special default
> > equipment, when you're on a dive trip with rental gear, presumably
> > you're going to have the *same* rental gear the whole time. So once
> > you've filled it out after the first day, that "copy equipment" model
> > would work fine too.
> >
> > That wouldn't be just cylinders, btw. It would be the suit and weights
> too.
> >
> > Hmm?
>
> I like it - especially as it is a) intuitive and b) should allow for a
> reasonably simple UI.
>
> The challenge is simply to pick which dive to clone the data from... but
> that seems doable.
>

The currently selected one.


>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: delete pictures from the widget by selecting and pressing delete.

2014-08-06 Thread Tomaz Canabrava
UGH

THAT SHOYLD'NT BE THERE.
i was on drugs, only explanation.

I forgot to rest hard before trying to fix the pictures.

=(
Em 06/08/2014 20:09, "Dirk Hohndel"  escreveu:

> On Wed, Aug 06, 2014 at 06:09:07PM -0300, Tomaz Canabrava wrote:
> > this was needed to remove the pictures that are not on the trip.
>
> > --- a/qt-ui/modeldelegates.cpp
> > +++ b/qt-ui/modeldelegates.cpp
> > @@ -63,8 +63,9 @@ QSize StarWidgetsDelegate::sizeHint(const
> QStyleOptionViewItem &option, const QM
> >   return QSize(IMG_SIZE * TOTALSTARS + SPACING * (TOTALSTARS - 1),
> IMG_SIZE);
> >  }
> >
> > -ComboBoxDelegate::ComboBoxDelegate(QAbstractItemModel *model, QObject
> *parent) : QStyledItemDelegate(parent), model(model)
> > +ComboBoxDelegate::ComboBoxDelegate(QAbstractItemModel *model, QObject
> *parent) : QStyledItemDelegate(parent)
> >  {
> > + model = new QSortFilterProxyModel();
> >   connect(this, SIGNAL(closeEditor(QWidget *,
> QAbstractItemDelegate::EndEditHint)),
> >   this, SLOT(revertModelData(QWidget *,
> QAbstractItemDelegate::EndEditHint)));
> >   connect(this, SIGNAL(closeEditor(QWidget *,
> QAbstractItemDelegate::EndEditHint)),
>
> Are you sure about this change? I don't see it's connection to the
> pictures... I worry that this is from you playing with sorting the
> locations drop-down...
>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


delete pictures from the widget by selecting and pressing delete.

2014-08-06 Thread Tomaz Canabrava
this was needed to remove the pictures that are not on the trip.
From 3096f7d76c5abd81d0429ba372e1386e9a41f231 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 6 Aug 2014 18:05:54 -0300
Subject: [PATCH] Delete pictures from the Widget by pressing delete

Select the picture, press delete, profit.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/maintab.cpp| 17 +
 qt-ui/maintab.h  |  2 +-
 qt-ui/modeldelegates.cpp |  3 ++-
 qt-ui/profile/divepixmapitem.cpp |  7 +--
 qt-ui/profile/divepixmapitem.h   |  1 +
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index ed65a19..d49c884 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -167,6 +167,13 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
 		ui.cylinders->view()->setColumnHidden(i, checked);
 		ui.cylinders->view()->horizontalHeader()->addAction(action);
 	}
+
+	QAction *deletePhoto = new QAction(this);
+	deletePhoto->setShortcut(Qt::Key_Delete);
+	deletePhoto->setShortcutContext(Qt::WidgetShortcut);
+	ui.photosView->addAction(deletePhoto);
+	ui.photosView->setSelectionMode(QAbstractItemView::SingleSelection);
+	connect(deletePhoto, SIGNAL(triggered(bool)), this, SLOT(removeSelectedPhotos()));
 }
 
 MainTab::~MainTab()
@@ -1153,3 +1160,13 @@ void MainTab::photoDoubleClicked(const QString filePath)
 {
 	QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
 }
+
+void MainTab::removeSelectedPhotos()
+{
+	if (!ui.photosView->selectionModel()->hasSelection())
+		return;
+
+	QModelIndex photoIndex = ui.photosView->selectionModel()->selectedIndexes().first();
+	QString fileUrl = photoIndex.data(Qt::DisplayPropertyRole).toString();
+	DivePictureModel::instance()->removePicture(fileUrl);
+}
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index 20a72d0..f3aec54 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -86,7 +86,7 @@ slots:
 	void updateTextLabels(bool showUnits = true);
 	void escDetected(void);
 	void photoDoubleClicked(const QString filePath);
-
+	void removeSelectedPhotos();
 private:
 	Ui::MainTab ui;
 	WeightModel *weightModel;
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 87846d2..019f19b 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -63,8 +63,9 @@ QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem &option, const QM
 	return QSize(IMG_SIZE * TOTALSTARS + SPACING * (TOTALSTARS - 1), IMG_SIZE);
 }
 
-ComboBoxDelegate::ComboBoxDelegate(QAbstractItemModel *model, QObject *parent) : QStyledItemDelegate(parent), model(model)
+ComboBoxDelegate::ComboBoxDelegate(QAbstractItemModel *model, QObject *parent) : QStyledItemDelegate(parent)
 {
+	model = new QSortFilterProxyModel();
 	connect(this, SIGNAL(closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)),
 		this, SLOT(revertModelData(QWidget *, QAbstractItemDelegate::EndEditHint)));
 	connect(this, SIGNAL(closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)),
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp
index 853b950..a73473a 100644
--- a/qt-ui/profile/divepixmapitem.cpp
+++ b/qt-ui/profile/divepixmapitem.cpp
@@ -114,6 +114,11 @@ void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
 		button->hide();
 }
 
+DivePictureItem::~DivePictureItem(){
+	if(button)
+		Animations::hide(button);
+}
+
 void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
 	QDesktopServices::openUrl(QUrl::fromLocalFile(fileUrl));
@@ -121,7 +126,5 @@ void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 
 void DivePictureItem::removePicture()
 {
-	Animations::hide(button);
-	hide();
 	DivePictureModel::instance()->removePicture(fileUrl);
 }
diff --git a/qt-ui/profile/divepixmapitem.h b/qt-ui/profile/divepixmapitem.h
index d39f26d..963e641 100644
--- a/qt-ui/profile/divepixmapitem.h
+++ b/qt-ui/profile/divepixmapitem.h
@@ -19,6 +19,7 @@ class DivePictureItem : public DivePixmapItem {
 	Q_PROPERTY(qreal scale WRITE setScale READ scale)
 public:
 	DivePictureItem(QObject *parent = 0);
+	virtual ~DivePictureItem();
 	void setPixmap(const QPixmap& pix);
 public slots:
 	void settingsChanged();
-- 
2.0.4

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Enhancement: locations drop down list ordered

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 5:55 PM, Davide DB  wrote:

> +1
>
> PS
> I know Dirk do not approve but as I will come back from this dive trip I
> will return to the fray with the ugliest part of subsurface ui: dive list
> column headers ;)
>

Why they are ugliest, what would you change?
I'm all for making it prettier. :)


> Davide@mobile
> Il 06/ago/2014 22:46 "Tomaz Canabrava"  ha scritto:
>
> A bit intrusive to do now, just checked. I tougth it was just a QSortModel
>> would suffice, but because of the way that we handle the delegates I need
>> to do a microsurgery. I'll postpone that a bit. :(
>>
>>
>>
>> On Wed, Aug 6, 2014 at 5:32 PM, Davide DB  wrote:
>>
>>>
>>> Again, maybe it's not late :)
>>>
>>> Auto completion is very useful but... The proposed list should be
>>> ordered otherwise I will never take advantage of it's full potential.
>>>
>>> Is there any way to order them in alphabetical order?
>>>
>>> Please see the attached screenshot
>>>
>>> Davide@mobile
>>>
>>> ___
>>> subsurface mailing list
>>> subsurface@hohndel.org
>>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>>
>>>
>>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Enhancement: locations drop down list ordered

2014-08-06 Thread Tomaz Canabrava
A bit intrusive to do now, just checked. I tougth it was just a QSortModel
would suffice, but because of the way that we handle the delegates I need
to do a microsurgery. I'll postpone that a bit. :(



On Wed, Aug 6, 2014 at 5:32 PM, Davide DB  wrote:

>
> Again, maybe it's not late :)
>
> Auto completion is very useful but... The proposed list should be ordered
> otherwise I will never take advantage of it's full potential.
>
> Is there any way to order them in alphabetical order?
>
> Please see the attached screenshot
>
> Davide@mobile
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 4:26 PM, Dirk Hohndel  wrote:

> On Wed, Aug 06, 2014 at 04:01:13PM -0300, Tomaz Canabrava wrote:
> > On Wed, Aug 6, 2014 at 3:55 PM, Salvador Cuñat  >
> > wrote:
> >
> > >
> > >
> > >
> > > 2014-08-06 19:29 GMT+02:00 Tomaz Canabrava :
> > >
> > >
> > >>
> > >>
> > >>> This goes back to the reported bug that we currently store absolute
> > >>> filenames. That's a pain when you move between machines. But a
> generic
> > >>> solution that works everywhere is near impossible...
> > >>>
> > >>
> > >> A thumbnail pixmap would suffice? The user would not be able to see
> the
> > >> picture in full size, but it can have a glimpse of what's there.
> > >>
> > >>
> > > I don't think this would be necessary, if the user wants to hace
> access to
> > > his photos from different platforms, he is probably already using some
> > > cloud service, so he should be able to refer to this cloud service's
> images
> > > without any problem, just as one can do with the .xml divelog.
> > >
> > > I'm going to play a bit with this idea.
> > >
> > > The only thing I dislike in the photos part is the fact that they
> can't be
> > > erased from the tab, but from the profile thumbnail. This creates two
> > > issues, the first is that a photo can't be erased if it's out of the
> > > profile (e.g. drinking a beer with the buddies after diving);  the
> second
> > > is how easy it is to click on the dustbin icon, as thumbnail grows
> down and
> > > right, leaving the dustbin just under the cursor pointer.
> > >
> >
> > hm... I can add a 'delete' shotcut by hiting the delete key when
> selecting
> > pictures on the photos tab.
>
> Can you
> a) move the dustbin / change the background as you promised to Willem
>

Will do that today, as soon as I have time.


> b) create the same dustbin and action on the photo tab?
>

Doable, but way way harder because of the way a delegate is exposed on qt
widgets. ( this is one of the things where QML is WY easier. )



>
> I'd love to have (a) for 4.2. (b) is not as important. The less code we
> modify between now and 4.2, the less we break :-)
>
> /D
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 3:55 PM, Salvador Cuñat 
wrote:

>
>
>
> 2014-08-06 19:29 GMT+02:00 Tomaz Canabrava :
>
>
>>
>>
>>> This goes back to the reported bug that we currently store absolute
>>> filenames. That's a pain when you move between machines. But a generic
>>> solution that works everywhere is near impossible...
>>>
>>
>> A thumbnail pixmap would suffice? The user would not be able to see the
>> picture in full size, but it can have a glimpse of what's there.
>>
>>
> I don't think this would be necessary, if the user wants to hace access to
> his photos from different platforms, he is probably already using some
> cloud service, so he should be able to refer to this cloud service's images
> without any problem, just as one can do with the .xml divelog.
>
> I'm going to play a bit with this idea.
>
> The only thing I dislike in the photos part is the fact that they can't be
> erased from the tab, but from the profile thumbnail. This creates two
> issues, the first is that a photo can't be erased if it's out of the
> profile (e.g. drinking a beer with the buddies after diving);  the second
> is how easy it is to click on the dustbin icon, as thumbnail grows down and
> right, leaving the dustbin just under the cursor pointer.
>

hm... I can add a 'delete' shotcut by hiting the delete key when selecting
pictures on the photos tab.


>
> Regards
>
> Salva.
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: testing Beta5: printing

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 2:29 PM, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> I still have printing problems. The notes of the dive are only partially
> printed. It is arbitrarily truncated both in preview and on the printed
> paper.
> (Ubuntu 12.04)
> Kind regards,
> willem
>

Known issue, if the notes are bigger than the space we give them, it won't
get printed. I'm preparing a better printing for 4.3, will not make it for
4.2 unfortunaately.



>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5" photos

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 2:25 PM, Dirk Hohndel  wrote:

> On Wed, Aug 06, 2014 at 07:22:17PM +0200, Willem Ferguson wrote:
> > On 06/08/2014 18:50, Salvador Cuñat wrote:
> > >Good Afternoon.
> > >
> > >
> > >There is a weird thing on profile if the user has photos added in his
> .xml
> > >file but he is not using his usual box (no photos in this), some white
> > >squares are displayed where the photographs should be shown.  Relative
> to
> > >this situation, may be a recomendation should be made in user manual: if
> > >the user shares a divelog (e.g. vía Dropbox) to access it from different
> > >machines, would be interesting to store the photos there and refer
> > >subsurface to this storage, so images could be seen on every machine he
> > >uses.
> > >
> > I suggest, leave that as is. The white dots convey information, meaning
> > "Photo attached which cannot be accessed now". This is useful knowledge,
> > meaning either "now go and attach the external drive with your photos" or
> > "you have inadvertently erased the directory with your photos". If the
> white
> > dots do not appear, one does not know whether the links between photos
> and
> > dive were inadvertently lost or not. If the white dots are troublesome
> and
> > in one's way, just switch off the display of photos using the button in
> the
> > profile toolbar.
>
> Yeah, I think that's the correct answer
>

Almost.
A sligtly bigger one with a helpfull information on tooltip saying "there
should be a photo here, but you removed or anything wrong happened. wanna
remove the picture? click on the X "


>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 2:19 PM, Dirk Hohndel  wrote:

> On Wed, Aug 06, 2014 at 06:50:05PM +0200, Salvador Cuñat wrote:
> > Good Afternoon.
> >
> > Have been testing Beta5 in WIN7-64 bits and only see a little thing. Just
> > after the date/time in, Dive List, there is a "0" (or may be "O").  It is
> > not in Linux (latest git). See first attachment.
>
> Excellent find!!!
> It turns out that on Windows in Spanish localization the format string for
> time puts the time zone in parenthesis. We remove the time zone designator
> (as our times don't have a time zone) but didn't remove the parenthesis.
>
> I added a fix for this.
>
> > There is a weird thing on profile if the user has photos added in his
> .xml
> > file but he is not using his usual box (no photos in this), some white
> > squares are displayed where the photographs should be shown.
>
> Hmm - I wonder what is better: have the white squares indicate "there
> should be pictures here", or have nothing shown?
>
> > Relative to
> > this situation, may be a recomendation should be made in user manual: if
> > the user shares a divelog (e.g. vía Dropbox) to access it from different
> > machines, would be interesting to store the photos there and refer
> > subsurface to this storage, so images could be seen on every machine he
> > uses.
>
> This goes back to the reported bug that we currently store absolute
> filenames. That's a pain when you move between machines. But a generic
> solution that works everywhere is near impossible...
>

A thumbnail pixmap would suffice? The user would not be able to see the
picture in full size, but it can have a glimpse of what's there.


>
> > Another weird thing.  In 1 dive  (just and only 1) there is a warning
> > ("ceiling")  *before* dive begins.  This is there in both Linux and Win,
> so
> > it's most likely a thing from the .xml file.  I'm pretty sure (not
> > absolutely) it wasn't there yesterday.  See 2nd attachment.
>
> Would you send me the XML for that dive?
>
> /D
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5

2014-08-06 Thread Tomaz Canabrava
On Wed, Aug 6, 2014 at 1:50 PM, Salvador Cuñat 
wrote:

> Good Afternoon.
>
> Have been testing Beta5 in WIN7-64 bits and only see a little thing. Just
> after the date/time in, Dive List, there is a "0" (or may be "O").  It is
> not in Linux (latest git). See first attachment.
>



There is a weird thing on profile if the user has photos added in his .xml
> file but he is not using his usual box (no photos in this), some white
> squares are displayed where the photographs should be shown.
>

didn't test that case - will send a fix in a moment.


> Relative to this situation, may be a recomendation should be made in user
> manual: if the user shares a divelog (e.g. vía Dropbox) to access it from
> different machines, would be interesting to store the photos there and
> refer subsurface to this storage, so images could be seen on every machine
> he uses.
>

hard to do that for 4.2, but maybe for 4.3 we can store the miniature
pixmaps of the dives, because thef full picture can be way too big.


> Have tried uploading to divelogs.de from the win7 machine and worked
> perfectly.
>
> Printing also seems to work fine in win7.
>
> Another weird thing.  In 1 dive  (just and only 1) there is a warning
> ("ceiling")  *before* dive begins.  This is there in both Linux and Win, so
> it's most likely a thing from the .xml file.  I'm pretty sure (not
> absolutely) it wasn't there yesterday.  See 2nd attachment.
>
> Regards
>
> Salva.
>
>
> 2014-08-06 16:54 GMT+02:00 Dirk Hohndel :
>
> On Wed, Aug 06, 2014 at 09:53:07PM +1000, Rick Walsh wrote:
>> > I just played around with the latest 32 bit Windows installer,
>> > subsurface-4.1.94-2-gd85d08e14f9e-32bit-Qt4. Tested English and
>> > Swedish localizations on 32 bit Vista.
>> >
>> > A few little niggles, but nothing at all critical. Not sure if any of
>> > this is related to the OS or QT4.
>> >
>> > Downloading dives (Hollis DG03 connected to COM4) - OK
>> > Editing downloaded dive - ok but SAC not displayed in dive list when
>> > cylinder data entered and dive saved (SAC is displayed in Dive Info).
>>
>> I cannot reproduce this. If I add a dive with no gas information and then
>> add gas information, the SAC rate is correctly shown in the dive list.
>> If you can reproduce this, can you please file a bug with step by step
>> instructions how to replicate the result?
>>
>> > When selecting another dive or clicking on the profile, SAC is still
>> > shown as 0 l/m in dive list, but after setting a location by
>> > double-clicking on the map, SAC does show in the dive list.
>>
>> Very strange. BTW: the 0 l/m crap is fixed. Just pushed a commit for this.
>>
>> > Printing (to PDFCreator) - 6 per page profile view looks good. Clear
>> > graphics and text
>> > Table view - font is very ugly but can be read. Tried playing with
>> > printer settings but no luck. Also tried changing font in preferences
>> > but this affects only the program.
>>
>> The combinatorics of printing are mind boggling, between the different OSs
>> and Qt versions. We know that Qt4 on Windows causes some issues. But I'm
>> not sure if this is what causes the issue here.
>>
>> Please file a bug.
>>
>> > Printing dive plan text looks ok (fixed width font), except the word
>> > körtid (runtime in Swedish) is displayed as 6 squares instead of
>> > letters. Elsewhere, words with Swedish vowels å, ä and ö are printed
>> > fine, as is BÜHLMANN in the disclaimer at bottom.
>>
>> I wonder if this is a font issue. Does this show up in the print preview?
>> In the actual print on paper?
>> I just tried this in Swedish (I love using a program in a UI language I
>> don't speak) and the print to PDF printout indeed shows körtid.
>>
>> > Preferences dialog - by default so large I cannot see the buttons at
>> > the bottom (1280 x 800 laptop screen). Resized by dragging down top of
>> > title bar.
>>
>> Oh. Oops. Yes, it was given a rather large fixed size for some reason.
>> I just fixed that.
>>
>> > Swedish localization - Note I an not a native speaker and have not
>> > been in Sweden for 6 years, so excuse me if what I'm reporting is
>> > actually my poor Swedish skills.
>> > Days of week in notes and dive list end in "en" rather than "dag".
>> > E.g. freen, lören, sören instead of fredag, lördag, söndag (Friday,
>> > Saturday, Sunday).
>>
>> Hehe, I'll leave this one to the Swedish speakers to argue about :-)
>>
>> > I did not try photos (none at hand) or uploading to divelogs.de (no
>> account).
>>
>> Accounts are free. And there is a subsurface test account. IIRC the
>> credentials are subsurfacetest / geheim
>>
>> > Hope this helps, and sorry, I won't get a chance to test again until
>> > the weekend at least.
>>
>> Yes, this helps a lot. The more people test, the more of the little
>> oddities we can find and fix. I had a few follow up questions here and
>> this might mean it won't get fixed for 4.2, but that's OK as none of these
>> things look like blockers to me, but I'd love to get them all resolved.
>>
>> /D

fixes

2014-08-05 Thread Tomaz Canabrava
the 676 it's harder than I think to fix, but it's user error so nothing
very urgent.
From e962983873666e996c4c425c712a70d80eb1782e Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 5 Aug 2014 17:40:50 -0300
Subject: [PATCH 1/2] Hide Depth Column

we were showing everything, always.

fixes #639

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/maintab.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index c704f55..5a37c16 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -582,6 +582,7 @@ void MainTab::updateDiveInfo(bool clear)
 		ui.visibility->setCurrentStars(0);
 	}
 	editMode = NONE;
+	ui.cylinders->view()->hideColumn(CylindersModel::DEPTH);
 }
 
 void MainTab::addCylinder_clicked()
-- 
2.0.4

From b09ceb9ef237977bb2fcf49bba0053d0a4b2bf42 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 5 Aug 2014 18:27:00 -0300
Subject: [PATCH 2/2] Add lines that follows the mouse helping see time and
 depth.

This was missing from the conversion from the oldPlanner
to the new one, and it also works ok on the profile.

One thing is missing is the Labels on the bottom / left
saying which position it is, but it's already userful.

fixes #674

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/profilewidget2.cpp | 28 
 qt-ui/profile/profilewidget2.h   |  2 ++
 2 files changed, 30 insertions(+)

diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index c3a289d..b19ca81 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -86,6 +86,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
 	po2GasItem(new PartialPressureGasItem()),
 	heartBeatAxis(new DiveCartesianAxis()),
 	heartBeatItem(new DiveHeartrateItem()),
+	mouseFollowerHorizontal(new DiveLineItem()),
+	mouseFollowerVertical(new DiveLineItem()),
 	rulerItem(new RulerItem2()),
 	isGrayscale(false),
 	printMode(false),
@@ -158,6 +160,10 @@ void ProfileWidget2::addItemsToScene()
 	scene()->addItem(rulerItem);
 	scene()->addItem(rulerItem->sourceNode());
 	scene()->addItem(rulerItem->destNode());
+	scene()->addItem(mouseFollowerHorizontal);
+	scene()->addItem(mouseFollowerVertical);
+	mouseFollowerHorizontal->setPen(QPen(QColor(Qt::red).lighter()));
+	mouseFollowerVertical->setPen(QPen(QColor(Qt::red).lighter()));
 	Q_FOREACH (DiveCalculatedTissue *tissue, allTissues) {
 		scene()->addItem(tissue);
 	}
@@ -665,6 +671,20 @@ void ProfileWidget2::mouseMoveEvent(QMouseEvent *event)
 		scrollViewTo(event->pos());
 		toolTipItem->setPos(mapToScene(toolTipPos));
 	}
+
+	QPointF pos = mapToScene(event->pos());
+	qreal vValue = profileYAxis->valueAt(pos);
+	qreal hValue = timeAxis->valueAt(pos);
+	if ( profileYAxis->maximum() >= vValue
+		&& profileYAxis->minimum() <= vValue){
+		mouseFollowerHorizontal->setPos(timeAxis->pos().x(), pos.y());
+	}
+	if ( timeAxis->maximum() >= hValue
+		&& timeAxis->minimum() <= hValue){
+		mouseFollowerVertical->setPos(pos.x(), profileYAxis->line().y1());
+	}
+
+
 }
 
 bool ProfileWidget2::eventFilter(QObject *object, QEvent *event)
@@ -706,6 +726,8 @@ void ProfileWidget2::setEmptyState()
 	pn2GasItem->setVisible(false);
 	po2GasItem->setVisible(false);
 	pheGasItem->setVisible(false);
+	mouseFollowerHorizontal->setVisible(false);
+	mouseFollowerVertical->setVisible(false);
 
 	#define HIDE_ALL(TYPE, CONTAINER) \
 	Q_FOREACH (TYPE *item, CONTAINER) item->setVisible(false);
@@ -788,6 +810,10 @@ void ProfileWidget2::setProfileState()
 	HIDE_ALL(DiveHandler, handles);
 	HIDE_ALL(QGraphicsSimpleTextItem, gases);
 	#undef HIDE_ALL
+	mouseFollowerHorizontal->setVisible(true);
+	mouseFollowerVertical->setVisible(true);
+	mouseFollowerHorizontal->setLine(timeAxis->line());
+	mouseFollowerVertical->setLine(QLineF(0, profileYAxis->pos().y(), 0, timeAxis->pos().y()));
 }
 
 void ProfileWidget2::setAddState()
@@ -1055,6 +1081,8 @@ void ProfileWidget2::setPrintMode(bool mode, bool grayscale)
 {
 	printMode = mode;
 	isGrayscale = mode ? grayscale : false;
+	mouseFollowerHorizontal->setVisible( !mode );
+	mouseFollowerVertical->setVisible( !mode );
 }
 
 void ProfileWidget2::setFontPrintScale(double scale)
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index bcde4a2..c3db984 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -161,6 +161,8 @@ private:
 	PartialPressureGasItem *po2GasItem;
 	DiveCartesianAxis *heartBeatAxis;
 	DiveHeartrateItem *heartBeatItem;
+	DiveLineItem *mouseFollowerVertical;
+	DiveLineItem *mouseFollowerHorizontal;
 	RulerItem2 *rulerItem;
 	bool isGrayscale;
 	bool printMode;
-- 
2.0.4

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Beta 5 (103) Equipment add issue

2014-08-05 Thread Tomaz Canabrava
Richard,

The print issue will be fixed before release,
I fixed several inconsiatencies on printing in the last week, but the
pictures are being a pain to find the error.
Have faith. =D

Em 05/08/2014 09:07, "Richard DePas"  escreveu:
>
> First time I add a piece of equipment, it does not remain after clicking
Save. Seems to only happen the first time after opening the program. If I
go in and add it again, it will work. If I move to another dive and add, it
will work. In my case, I was adding a weight belt.
>
> Still seeing the pictures saved to the displayed dive showing up on all
dives I print as well.
>
> -Rich
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: test binaries for Beta 5

2014-08-05 Thread Tomaz Canabrava
Em 05/08/2014 08:34, "Joakim Bygdell"  escreveu:
>
> Well in this case I think it is more correct to tell subsurface not to
update the profile until the user has committed the final value by pressing
enter or tab.
> Because with latest master it recalculates the profile as soon as I enter
the first digit meaning that it tries to calculate a profile with a GF-high
of 7 or 8.

Good catch. This is just a matter of changing the connect line for the gf
high to editfinished instead of value changed, can somebody do that for me?
Im on the dive store trying to buy my wet suit now, só I dont have a
computer.

> On Tue, Aug 5, 2014 at 1:02 PM, Robert Helling  wrote:
>>
>>
>> On 05.08.2014, at 12:10, Robert Helling  wrote:
>>
>> Hi,
>>
>>> What shall we do about this?
>>>
>>> 1) Nothing. We consider it a user error.
>>> 2) Not allow setting GFhigh to values below 35% if “last stop at 6m” is
selected (GFhigh=1% still allows to surface with the saturation at 3m, so
the problem is only with decoing at 6m). In fact, I don’t think values
below 50% are reasonable anyway.
>>> 3) Always ascent after 48h of deco (the Buehlmann model is not supposed
to be extrapolated to such long times anyway)
>>> 4) Always ascent to 3m after 48h of deco (which then eventually brings
us to the surface as argued above)
>>> 5) Do 3) or 4) with a statement in the notes that this is what happened
(new translatable string, hurray!)
>>> 6) Throw an error message and refuse to plan deco (again a new string).
>>>
>>
>> Hi,
>>
>> here is a patch that implements option 5) above.
>>
>> Best
>> Robert
>>
>>
>>
>> --
>>
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
>> Robert C. Helling Elite Master Course Theoretical and Mathematical
Physics
>>   Scientific Coordinator
>>   Ludwig Maximilians Universitaet Muenchen, Dept.
Physik
>>   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
>>   http://www.atdotde.de
>>
>> Enhance your privacy, use cryptography! My PGP keys have fingerprints
>> A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1Dand
>> DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F
>>
>>
>>
>>
>>
>
>
>
> --
> #
>
> Joakim Bygdell
> j.bygd...@gmail.com
> +46 (0) 705 542 386
>
> #
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Some fixes.

2014-08-04 Thread Tomaz Canabrava
really?
hah. good, since I had no idea what was causing that bug.



On Mon, Aug 4, 2014 at 3:22 PM, Salvador Cuñat 
wrote:

> 002 has also fixed #641.
>
> I've just closed the ticket.
>
> Thanks Tomaz.
>
> Salva.
>
>
> 2014-08-04 18:30 GMT+02:00 Tomaz Canabrava :
>
>> we are getting close. :)
>>
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>>
>>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Some fixes.

2014-08-04 Thread Tomaz Canabrava
one more.


On Mon, Aug 4, 2014 at 1:30 PM, Tomaz Canabrava  wrote:

> we are getting close. :)
>
From 04143f5a5913de9a34ed9a91b3fec0988cb2010a Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 4 Aug 2014 14:06:58 -0300
Subject: [PATCH 4/4] Do not recreate all the dive just because a picture was
 added.

If we add a picture to the dive, this will not change anything
else, so there's no need to recalculate the profile_plot info.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/divelistview.cpp | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 442ea1f..d58f312 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -786,10 +786,8 @@ void DiveListView::loadImages()
 	}
 
 	mark_divelist_changed(true);
-	// the sequence is somewhat magic - replot re-populates the displayed_dive.
-	// calling refreshDisplay afterwards gets the picture model populated and the thumbnails displayed
-	MainWindow::instance()->graphics()->replot();
-	MainWindow::instance()->refreshDisplay();
+	copy_dive(current_dive, &displayed_dive);
+	DivePictureModel::instance()->updateDivePictures();
 }
 
 QString DiveListView::lastUsedImageDir()
-- 
2.0.4

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Some fixes.

2014-08-04 Thread Tomaz Canabrava
we are getting close. :)
From e9b471c68b11df10f0e049b9982ad2898dd20307 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 4 Aug 2014 12:58:21 -0300
Subject: [PATCH 1/3] Disable the Toolbox when in edit mode.

Some of the toolbox icons will trigger a recalculation of the dive,
triggering then a replot, that will copy the dive to the displayed_dive
again, but in the case of a edit this would discard the edition (
that would still be shown on the UI ) leaving the dive in an
unconsistent state.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/maintab.cpp|  3 +++
 qt-ui/mainwindow.cpp | 10 ++
 qt-ui/mainwindow.h   |  1 +
 3 files changed, 14 insertions(+)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 5a6f7b5..652e824 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -270,6 +270,7 @@ void MainTab::enableEdition(EditMode newEditMode)
 		return;
 	}
 	MainWindow::instance()->dive_list()->setEnabled(false);
+	MainWindow::instance()->setEnabledToolbar(false);
 
 	// only setup the globe for editing if we are editing exactly one existing dive
 	if (amount_selected == 1 && newEditMode != ADD)
@@ -781,6 +782,7 @@ void MainTab::acceptChanges()
 	MainWindow::instance()->dive_list()->setFocus();
 	cylindersModel->changed = false;
 	weightModel->changed = false;
+	MainWindow::instance()->setEnabledToolbar(true);
 }
 
 void MainTab::resetPallete()
@@ -845,6 +847,7 @@ void MainTab::rejectChanges()
 	MainWindow::instance()->globe()->reload();
 	// show the profile and dive info
 	MainWindow::instance()->graphics()->replot();
+	MainWindow::instance()->setEnabledToolbar(true);
 	cylindersModel->changed = false;
 	weightModel->changed = false;
 	cylindersModel->updateDive();
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index aa9d8c1..1a4594b 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1286,3 +1286,13 @@ void MainWindow::on_actionExport_triggered()
 	DiveLogExportDialog diveLogExport;
 	diveLogExport.exec();
 }
+
+void MainWindow::setEnabledToolbar(bool arg1)
+{
+	 QList toolBar; toolBar << ui.profCalcAllTissues << ui.profCalcCeiling
+		<< ui.profDcCeiling << ui.profEad << ui.profHR << ui.profIncrement3m
+		<< ui.profMod << ui.profNdl_tts << ui.profNdl_tts << ui.profPhe << ui.profPn2
+		<< ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled << ui.profTogglePicture;
+	Q_FOREACH(QToolButton *b, toolBar)
+		b->setEnabled(arg1);
+}
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 6b53bab..5c0ec8e 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -156,6 +156,7 @@ slots:
 	void editCurrentDive();
 	void planCanceled();
 	void planCreated();
+	void setEnabledToolbar(bool arg1);
 
 private:
 	Ui::MainWindow ui;
-- 
2.0.4

From 7aa2dae86ec9d1a705c64b028275237105ae7f20 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Mon, 4 Aug 2014 13:18:20 -0300
Subject: [PATCH 2/3] Fix unresizable DiveList

The issue with the dive list was actually the Planner Settings widget
that was in the same space as the dive list but hidden, but since it
had a minimum width we couldn't resize the dive list to be below the
planner settings minimum.

Fixed by inserting the contents of the Planner Settings into a QScroll
Area.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/plannerSettings.ui | 981 ---
 1 file changed, 503 insertions(+), 478 deletions(-)

diff --git a/qt-ui/plannerSettings.ui b/qt-ui/plannerSettings.ui
index e94dc88..0ad0f5b 100644
--- a/qt-ui/plannerSettings.ui
+++ b/qt-ui/plannerSettings.ui
@@ -6,496 +6,521 @@

 0
 0
-1116
-292
+1102
+442

   
   
Form
   
-  
-   
-2
-   
-   
-2
-   
-   
-2
-   
-   
-2
-   
-   
-2
-   
+  

-
- 
-  Rates
+
+ 
+  QFrame::NoFrame
  
- 
-  
-   2
-  
-  
-   2
-  
-  
-   2
-  
-  
-   2
-  
-  
-   2
+ 
+  QFrame::Plain
+ 
+ 
+  true
+ 
+ 
+  
+   
+0
+0
+1089
+404
+   
   
-  
-   
-
- Ascent
-
-
- 
-  2
- 
- 
-  2
- 
- 
-  2
- 
- 
-  2
- 
- 
-  2
+  
+   
+0
+   
+   
+0
+   
+   
+0
+   
+   
+0
+   
+   
+0
+   
+   
+
+ 
+  Rates
  
- 
-  
-   
-below 75% avg. depth
-   
-  
- 
- 
-  
-   
-m/min
-   
-   
-1
-   
-  
- 
- 
-  
-   
- 

Re: Problems with delete image

2014-08-01 Thread Tomaz Canabrava
On Fri, Aug 1, 2014 at 5:58 PM, Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> Tomaz,
>
> After images have been associated with a dive profile, one needs to hover
> above the 'stub image' image in order to see a thumbnail of the same image.
> However, two problems:
>
> 1) When the thumbnail is activated, Subsurface puts the cursor on the
> dustbin icon. If one clicks, thinking to open the image, it is in fact
> deleted. The present setup makes it very easy to inadvertently delete
> messages. What about a popup message requiring confirmation before delete?
>

not good to have a confirmation dialog for everything, I can, however, move
the dustbin to the other side, so the user knows what's happen.


>
> 2) If the background is dark, the dustbin is very difficult to spot. I
> would recommend highlighting the perimeter of the circular area around the
> dustbin in white so that it shows up on a dark background. Is it ok if I
> send you a proposal for a dustbin image tomorrow? The objective is to have
> a  dustbin that shows up on any image regardless of background colour or
> contrast.
>

We need that. :)
The current image + a white background will work.

Kind regards,
> willem
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


A bit of help with patches

2014-08-01 Thread Tomaz Canabrava
People,

work is getting *very* timeconsuming, we are near to release our product
and this is affecting my productivity with subsurface. Since we are near
4.2 and some bugs are really easy to resolve, I'm asking help to fix them.
:)

Play around, try to find an annoyance, help to fix.

Thanks a lot.
Tomaz
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Dive list resizing problem.

2014-08-01 Thread Tomaz Canabrava
On Fri, Aug 1, 2014 at 12:16 PM, Ďoďo  wrote:

> Folks,
>
> I just compiled latest greatest version, started and wanted it to fit
> in to my 1920x1200 desktop.
>
> So I made windows 1217x929. And because I did not see the map, I
> wanted to make dive list more narrow. But it does not work. I can make
> it brighter then in attached image but nor more narrow. Minimum is
> about 1100 pixels. Is it bug or feature or am I doing something wrong?
>

I'll take a look at this. :)


>
> Attached image is showing minimum I have
>
> Dodo
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Missing functionality

2014-07-30 Thread Tomaz Canabrava
this should fix the mouseGrabber issue.


On Wed, Jul 30, 2014 at 4:55 PM, Dirk Hohndel  wrote:

> On Wed, Jul 30, 2014 at 04:21:18PM -0300, Tomaz Canabrava wrote:
> > This is a missing functionality on the 4.2 that I'v talked to dirk and we
> > decided that it was better to implement it now before waiting for 4.3
> > because things can get messy if a user adds the wrong pictures on the
> dive.
>
> I decided to take it now. I realize this is way late. I very carefully
> reviewed them and made some small changes. But this is really rather
> important functionality, fixes a bug and shouldn't have any side effects
> (famous last words).
>
> It would be nice if the manual could be updated, but I find the UI so
> brilliantly intuitive, that I think worst case we can do without it
> explicitly mentioned. Up to Willem :-)
>
> /D
>
From 9a1a32f2edc6415dc55823dbf47bba2cacf286db Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Wed, 30 Jul 2014 17:20:38 -0300
Subject: [PATCH] Add a new 'show' Animation, and use it on the close button.

The error with 'ungrabMouse' warning that we got was because
we were removing an item that had the mouse grab instead of
waiting a few milisseconds so it won't be the mouse grabber
anymore.

So I'v used the Animations::hide() to get rid of it, and
since it worked well, I'v also added a Animations::show()
method to display it in a good fade-in way.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/animationfunctions.cpp | 12 
 qt-ui/profile/animationfunctions.h   |  1 +
 qt-ui/profile/divepixmapitem.cpp |  4 +++-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp
index dc46d7f..fb1c85f 100644
--- a/qt-ui/profile/animationfunctions.cpp
+++ b/qt-ui/profile/animationfunctions.cpp
@@ -18,6 +18,18 @@ namespace Animations {
 		}
 	}
 
+	void show(QObject *obj)
+	{
+		if (prefs.animation_speed != 0) {
+			QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
+			animation->setStartValue(0);
+			animation->setEndValue(1);
+			animation->start(QAbstractAnimation::DeleteWhenStopped);
+		} else {
+			obj->setProperty("opacity", 1);
+		}
+	}
+
 	void animDelete(QObject *obj)
 	{
 		if (prefs.animation_speed != 0) {
diff --git a/qt-ui/profile/animationfunctions.h b/qt-ui/profile/animationfunctions.h
index d8e44be..3cfcff5 100644
--- a/qt-ui/profile/animationfunctions.h
+++ b/qt-ui/profile/animationfunctions.h
@@ -8,6 +8,7 @@ class QObject;
 
 namespace Animations {
 	void hide(QObject *obj);
+	void show(QObject *obj);
 	void moveTo(QObject *obj, qreal x, qreal y);
 	void moveTo(QObject *obj, const QPointF &pos);
 	void animDelete(QObject *obj);
diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp
index 41541c2..853b950 100644
--- a/qt-ui/profile/divepixmapitem.cpp
+++ b/qt-ui/profile/divepixmapitem.cpp
@@ -94,7 +94,9 @@ void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
 		scene()->addItem(button);
 	}
 	button->setPos(mapToScene(0,0));
+	button->setOpacity(0);
 	button->show();
+	Animations::show(button);
 	button->disconnect();
 	connect(button, SIGNAL(clicked()), this, SLOT(removePicture()));
 }
@@ -119,7 +121,7 @@ void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 
 void DivePictureItem::removePicture()
 {
-	button->hide();
+	Animations::hide(button);
 	hide();
 	DivePictureModel::instance()->removePicture(fileUrl);
 }
-- 
2.0.3

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Missing functionality

2014-07-30 Thread Tomaz Canabrava
This is a missing functionality on the 4.2 that I'v talked to dirk and we
decided that it was better to implement it now before waiting for 4.3
because things can get messy if a user adds the wrong pictures on the dive.

So, possibility to remove pictures on the dive now.
Now that I'v mastered 'git rebase squash', I'll have so much less commits
=p , 9 became 3.
From 10c818b5318bc72351cb8a73471a11a59fa207a1 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 21:56:45 -0300
Subject: [PATCH 1/3] Added a button to hide a picture from the dive.

This patch hides a picture from the dive, it should actually
remove it, but because I didn't found a quick way to remove
a picture from the dive yet, it just hides it.

To remove a picture from the dive, the DivePictureItem has to
remember the QUrl of the original file, to remove that from the
model, and currently it only has the QPixmap.

this can be for 4.2.1 or we can postpone 4.2 a tiny bit since this
is a important feature.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/divepixmapitem.cpp | 62 
 qt-ui/profile/divepixmapitem.h   | 20 +
 2 files changed, 82 insertions(+)

diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp
index dd002e5..372cbd1 100644
--- a/qt-ui/profile/divepixmapitem.cpp
+++ b/qt-ui/profile/divepixmapitem.cpp
@@ -7,12 +7,44 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 DivePixmapItem::DivePixmapItem(QObject *parent) : QObject(parent), QGraphicsPixmapItem()
 {
 }
 
+DiveButtonItem::DiveButtonItem(QObject *parent): DivePixmapItem(parent)
+{
+}
+
+void DiveButtonItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+	QGraphicsItem::mousePressEvent(event);
+	emit clicked();
+}
+
+// If we have many many pictures on screen, maybe a shared-pixmap would be better to
+// paint on screen, but for now, this.
+CloseButtonItem::CloseButtonItem(QObject *parent): DiveButtonItem(parent)
+{
+	static QPixmap p = QPixmap(":trash");
+	setPixmap(p);
+	setFlag(ItemIgnoresTransformations);
+}
+
+void CloseButtonItem::hide()
+{
+	DiveButtonItem::hide();
+}
+
+void CloseButtonItem::show()
+{
+	DiveButtonItem::show();
+}
+
 DivePictureItem::DivePictureItem(int row, QObject *parent): DivePixmapItem(parent)
 {
 	setFlag(ItemIgnoresTransformations);
@@ -50,20 +82,50 @@ void DivePictureItem::setPixmap(const QPixmap &pix)
 	shadow->setZValue(-2);
 }
 
+CloseButtonItem *button = NULL;
 void DivePictureItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
 {
 	Animations::scaleTo(this, 1.0);
 	setZValue(5);
+
+	if(!button) {
+		button = new CloseButtonItem();
+		button->setScale(0.2);
+		button->setZValue(7);
+		scene()->addItem(button);
+	}
+	button->setPos(mapToScene(0,0));
+	button->show();
+	button->disconnect();
+	connect(button, SIGNAL(clicked()), this, SLOT(removePicture()));
 }
 
 void DivePictureItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
 {
 	Animations::scaleTo(this, 0.2);
 	setZValue(0);
+	if(button)
+		button->hide();
 }
 
 void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+	QGraphicsView *view = scene()->views().first();
+	QList items = view->items(view->mapFromScene(event->scenePos()));
+	Q_FOREACH(QGraphicsItem *item, items){
+		if (dynamic_cast(item)){
+			return;
+		}
+	}
 	QString filePath = DivePictureModel::instance()->index(rowOnModel,0).data(Qt::ToolTipRole).toString();
 	QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
 }
+
+void DivePictureItem::removePicture()
+{
+	/* this is a WIP, it doesn't really *removes* anything, merely hides it.
+	 * good workaround, I still need to figure out how to activelly remove
+	 * it from the model. */
+	button->hide();
+	hide();
+}
diff --git a/qt-ui/profile/divepixmapitem.h b/qt-ui/profile/divepixmapitem.h
index 950b211..b5bed37 100644
--- a/qt-ui/profile/divepixmapitem.h
+++ b/qt-ui/profile/divepixmapitem.h
@@ -22,6 +22,7 @@ public:
 	void setPixmap(const QPixmap& pix);
 public slots:
 	void settingsChanged();
+	void removePicture();
 protected:
 	void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
 	void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
@@ -30,4 +31,23 @@ private:
 	int rowOnModel;
 };
 
+class DiveButtonItem : public DivePixmapItem {
+	Q_OBJECT
+public:
+	DiveButtonItem(QObject *parent = 0);
+protected:
+	virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+signals:
+	void clicked();
+};
+
+class CloseButtonItem : public DiveButtonItem {
+	Q_OBJECT
+public:
+	CloseButtonItem(QObject *parent = 0);
+public slots:
+	void hide();
+	void show();
+};
+
 #endif // DIVEPIXMAPITEM_H
-- 
2.0.3

From 5156b528d57233cf3175f77055ab1f8de1da5dab Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 22:13:14 -0300
Subject: [PATCH 2/3] Instead of holding the index, hold the URL.

Since the idea is to re

Don't show heartrate unconditionally

2014-07-29 Thread Tomaz Canabrava
One more.
From 8130e28477215689ce1462cde2c965138ae5ad80 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 19:38:21 -0300
Subject: [PATCH 3/3] Do not show the heartrate info unconditionally.

use the preferences instead.

Fixes #664

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/profilewidget2.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index c1bdccd..cc1b7ec 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -454,10 +454,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
 		heartBeatAxis->setMinimum(pInfo.minhr);
 		heartBeatAxis->setMaximum(pInfo.maxhr);
 		heartBeatAxis->updateTicks(HR_AXIS); // this shows the ticks
-		heartBeatAxis->setVisible(true);
-	} else {
-		heartBeatAxis->setVisible(false);
 	}
+	heartBeatAxis->setVisible(prefs.hrgraph && pInfo.maxhr);
 
 	timeAxis->setMaximum(maxtime);
 	int i, incr;
-- 
2.0.3

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


fix ruler not being resized.

2014-07-29 Thread Tomaz Canabrava
thiw was preventing the Axis to resize when requested.
From 5e3e815357671971a5b31c68686403df23f086e8 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 18:48:17 -0300
Subject: [PATCH 2/2] Make the Axis set the changed flag when a new line is set

This was preventing the recalculation of the ticks, making the
line static when we enabled or disabled the PP graphs.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/divecartesianaxis.cpp | 6 ++
 qt-ui/profile/divecartesianaxis.h   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index be3e313..e28d1c4 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -252,6 +252,12 @@ void DiveCartesianAxis::updateTicks(color_indice_t color)
 	changed = false;
 }
 
+void DiveCartesianAxis::setLine(const QLineF &line)
+{
+	QGraphicsLineItem::setLine(line);
+	changed = true;
+}
+
 void DiveCartesianAxis::animateChangeLine(const QLineF &newLine)
 {
 	setLine(newLine);
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index 77e2697..1515569 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -45,6 +45,7 @@ public:
 	void setTextVisible(bool arg1);
 	void setLinesVisible(bool arg1);
 	void setLineSize(qreal lineSize);
+	void setLine(const QLineF& line);
 	int unitSystem;
 public
 slots:
-- 
2.0.3

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


fix axis units

2014-07-29 Thread Tomaz Canabrava
this patch fixes axis units.
while testing this I also found another bug that I'm trying to fix now:
the depth axis will stay the same, but the profile will update it's
size as if it was shrinked when a preference is changed.
From 700b9e1101823603ed08a96d0ee62e2b7e7dc300 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 16:34:57 -0300
Subject: [PATCH] Change the Ruler text values when metric system changes.

"ups", as I did this in Metric system I forgot to update
to imperial when the user selected it.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/profile/divecartesianaxis.cpp | 29 +++--
 qt-ui/profile/divecartesianaxis.h   |  3 ---
 qt-ui/profile/profilewidget2.cpp|  1 -
 3 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index f5123ae..be3e313 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -308,9 +308,9 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
 	double retValue = realSize * percent;
 	double adjusted =
 		orientation == LeftToRight ? retValue + m.x1() + p.x() :
-	 orientation == RightToLeft ? retValue + m.x1() + p.x() :
-	  orientation == TopToBottom ? retValue + m.y1() + p.y() :
-   /* entation == BottomToTop */ retValue + m.y1() + p.y();
+		orientation == RightToLeft ? retValue + m.x1() + p.x() :
+		orientation == TopToBottom ? retValue + m.y1() + p.y() :
+		/* entation == BottomToTop */ retValue + m.y1() + p.y();
 	return adjusted;
 }
 
@@ -365,28 +365,21 @@ static bool isPPGraphEnabled()
 	return prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe;
 }
 
-DepthAxis::DepthAxis() : showWithPPGraph(false)
+DepthAxis::DepthAxis()
 {
 	connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
-
-	// force the correct size of the line.
-	showWithPPGraph = !isPPGraphEnabled();
+	changed = true;
 	settingsChanged();
 }
 
 void DepthAxis::settingsChanged()
 {
-	// 	bool ppGraph = isPPGraphEnabled();
-	// 	if ( ppGraph == showWithPPGraph){
-	// 		return;
-	// 	}
-	//
-	// 	if (ppGraph) {
-	// 		animateChangeLine(shrinkedLine);
-	// 	} else {
-	// 		animateChangeLine(expandedLine);
-	// 	}
-	// 	showWithPPGraph = ppGraph;
+	static int unitSystem = prefs.units.length;
+	if ( unitSystem == prefs.units.length )
+		return;
+	changed = true;
+	updateTicks();
+	unitSystem = prefs.units.length;
 }
 
 QColor TimeAxis::colorForValue(double value)
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index e7fa68c..77e2697 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -83,9 +83,6 @@ protected:
 private
 slots:
 	void settingsChanged();
-
-private:
-	bool showWithPPGraph;
 };
 
 class TimeAxis : public DiveCartesianAxis {
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 6ec51e0..c1bdccd 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -450,7 +450,6 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
 	temperatureAxis->setMinimum(pInfo.mintemp);
 	temperatureAxis->setMaximum(pInfo.maxtemp);
 
-
 	if (pInfo.maxhr) {
 		heartBeatAxis->setMinimum(pInfo.minhr);
 		heartBeatAxis->setMaximum(pInfo.maxhr);
-- 
2.0.3

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: Multi cylinder dives on 4.1

2014-07-29 Thread Tomaz Canabrava
On Tue, Jul 29, 2014 at 4:22 PM, Davide DB  wrote:
> Is there anybody out there :)

> davide@mobile
>
> Il 26/lug/2014 23:10 "Davide DB"  ha scritto:
>
>> Dirk's patch to Ticket #622 should have solved the main issue with the
>> unknown cylinder.
>> This time I just followed the correct compiling sequence (I believe) for a
>> multi cylinder dive.
>> I cannot test further because I'm jumping on an airplane right now.
>>
>> davide@mobile
>>
>>
>>
>>
>> On Sat, Jul 26, 2014 at 12:16 PM, Davide DB  wrote:
>>>
>>> On three fresh imported dives:
>>>
>>> I have a default cylinder
>>> I add two new cylinders
>>> I fill all requested data: gas, pressure, type...
>>> I save the logbook
>>> I add a gas switch.
>>> Dive info panel gets corrupted not showing anymore default cylinder
>>
>>
>> Does it work for you if you enable the "Show unused cylinders in
>> Equipment tab" in File -> Preferences?
>>
>> I really think we should remove that option entirely. The whole "hide
>> unused cylinders" thing is a broken hack, written for *another* bug entirely
>> (the old behavior wrt default cylinders).. In fact, the whole cylinder
>> "used" thing is just entirely broken. I've said so before, but I can't be
>> bothered to really argue any more. The thing is just confusing and wrong,
>> and your bug sounds like exactly the kind of crap it results in.
>>
>>   Linus
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>


Waiting you to test further. :)
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: final steps towards 4.2

2014-07-29 Thread Tomaz Canabrava
Just did a good cleanup on the pt-br translation, only 60 missing.
will finish this today.

On Tue, Jul 29, 2014 at 2:26 PM, roberto forini  wrote:
> It works with ipad and google chrome. Looks like it is very easy, even if
> i'm not used at, i find it very intuitive. Hope to do a good job in the next
> days during my off work period obviously when i'm not diving... ;-)
>
> Bye
>
>
> Il martedì 29 luglio 2014, Dirk Hohndel  ha scritto:
>>
>> On Tue, Jul 29, 2014 at 07:15:28PM +0200, roberto forini wrote:
>>
>> > Done. Waiting answer from italian team. I hope to be able to
>> > easily translate using my ipad. :-)
>>
>> You're in :-)
>>
>> I never tried this from a tablet, but I don't see why it wouldn't work.
>>
>> Please let us know...
>>
>> /D
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: final steps towards 4.2

2014-07-29 Thread Tomaz Canabrava
Roberto,

Create an account on transifex.com and search for the subsurface
project, there ask permission to enter the translation team. all the
translation is done on the software.


On Tue, Jul 29, 2014 at 1:36 PM, roberto forini  wrote:
> Can someone explain how to push the translation? I could try to translate
> into Italian but I need to know which software ... or procedure... or what
> else need to do that. Tks
>
> Il 29/lug/2014 18:31 "Dirk Hohndel"  ha scritto:
>
>> Bugfixing
>> -
>>
>> Tomaz and I are fixing some of the newly reported bugs.
>> I invite others to take a look at trac as well :-)
>>
>> Translations
>> 
>>
>> We'll get one more string in a moment (I'll simply fix up the existing
>> commit instead of waiting for a new one). We have made amazing progress
>> with Chinese being completed, Estonian catching up (but still missing
>> quite a bit), Russian, Dutch, French, and Slovak now at 99/100%...
>>
>> Languages that could use some love in order to be included in the 4.2
>> binaries include
>>
>> - Italian (we have quite a few Italians here - volunteers?)
>> - Greek (small team, sadly)
>> - Hebrew (we had an active team but they seem to have disappeared)
>> - Romanian
>>
>> The others are below 50% and I doubt they'll make it.
>>
>> Documentation
>> -
>>
>> Willem is doing an awesome job - I'm sure he'd love feedback if people
>> could take the time to read through it with Subsurface open to try
>> everything - this is a great thing that the contributors who aren't
>> developers could do for us.
>> I think Salvador is only one commit behind (the one from today) on the
>> translation to Spanish, so that's in great shape, too.
>>
>> README / Relnotes - those need a lot of work. I always struggle doing
>> those and it tends to be a last minute effort... if someone wants to help
>> and send in patches I'd love that.
>>
>> Website
>> ---
>>
>> The updates to the pages I think I can do by search and replace, even in
>> the languages I don't speak. I'll draft and announcement once the README /
>> Relnotes are done (since I usually borrow heavily from those).
>>
>> Timeline
>> 
>>
>> Assuming nothing major goes wrong, I'd hope for the end of this week. If
>> translators need until after the weekend, just let me know and I'd be
>> willing to hold things back a couple more days.
>>
>>
>> Thanks everyone
>>
>> /D
>> ___
>> subsurface mailing list
>> subsurface@hohndel.org
>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
> ___
> subsurface mailing list
> subsurface@hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


blocker fix.

2014-07-29 Thread Tomaz Canabrava

From fa231d636f07240f8549f313557be5a4767f6faa Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 12:50:06 -0300
Subject: [PATCH 1/2] Don't copy_dive double deleted when removing an event.

The copy_dive assumed that the event being removed was from
current_dive, wich was untill a very recent past. now it
can't assume that anymore, so instead of setting ev =
assumed_dive->event->next, we do a ev = current_dive->event->next.

Fixes #663

Signed-off-by: Tomaz Canabrava 
---
 dive.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dive.c b/dive.c
index acab8ff..dacc433 100644
--- a/dive.c
+++ b/dive.c
@@ -70,8 +70,13 @@ void remove_event(struct event* event)
 	while (ep && !same_event(*ep, event))
 		ep = &(*ep)->next;
 	if (ep) {
-		*ep = event->next;
-		free(event);
+		/* we can't link directly with event->next
+		 * because 'event' can be a copy from another
+		 * dive ( for instance the displayed_dive
+		 * that we use on the interface to show things. */
+		struct event *temp = (*ep)->next;
+		free(*ep);
+		*ep = temp;
 	}
 }
 
-- 
2.0.3

From 17d6dfeabac8873f8cfe923271dffd7fa89d252c Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava 
Date: Tue, 29 Jul 2014 13:06:30 -0300
Subject: [PATCH 2/2] C++ Correctness and code cleanup.

Use const-reference where we can gain a bit of speed from that
and clear an else { if {}} by using else if.

Signed-off-by: Tomaz Canabrava 
---
 qt-ui/groupedlineedit.cpp |  2 +-
 qt-ui/mainwindow.cpp  | 10 --
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/qt-ui/groupedlineedit.cpp b/qt-ui/groupedlineedit.cpp
index 28758e0..4867089 100644
--- a/qt-ui/groupedlineedit.cpp
+++ b/qt-ui/groupedlineedit.cpp
@@ -106,7 +106,7 @@ void GroupedLineEdit::removeAllColors()
 QStringList GroupedLineEdit::getBlockStringList()
 {
 	QStringList retList;
-	foreach (Private::Block block, d->blocks)
+	foreach (const Private::Block &block, d->blocks)
 		retList.append(block.text);
 	return retList;
 }
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index c847660..cb6dc79 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1029,18 +1029,16 @@ void MainWindow::removeRecentFile(QStringList failedFiles)
 		}
 	}
 
-	foreach (QString file, failedFiles)
+	foreach (const QString &file, failedFiles)
 		files.removeAll(file);
 
 	for (int c = 1; c <= 4; c++) {
 		QString key = QString("File_%1").arg(c);
 
-		if (files.count() >= c) {
+		if (files.count() >= c)
 			s.setValue(key, files.at(c - 1));
-		} else {
-			if (s.contains(key))
-s.remove(key);
-		}
+		else if (s.contains(key))
+			s.remove(key);
 	}
 
 	s.endGroup();
-- 
2.0.3

___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: GSOC project updates

2014-07-28 Thread Tomaz Canabrava
On Mon, Jul 28, 2014 at 2:48 PM, Lubomir I. Ivanov  wrote:
> On 28 July 2014 20:33, Tomaz Canabrava  wrote:
>> On Mon, Jul 28, 2014 at 2:20 PM, Lubomir I. Ivanov  
>> wrote:
>>>
>>> dunno, my tests were based on Qt5.2 for Win32.
>>> RotationAnimation on a declarative image, 15% CPU on a dual core with 
>>> OpenGL.
>>> rotating with QGraphicsScene / C++ ~0% CPU with or without OpenGL.
>>
>> Then I hope they fix this bug, as they are selling QML as the big thing in 
>> Qt.
>> We can do a touch ui based on QGraphicsView, but it will be so much
>> easier in QML ( mostly because now there's a widget's QML package )
>>
>>
>
> me and Dirk are asking the same question in a way, do we even have to
> create a new UI? can we just style the existing UI to be usable on
> android with #ifdefs and things like setStyleSheet(...). also only
> show one Subsurface view at a time?
>
> from what i've gathered both you and Anton mention that the main issue
> is the tiny UI elements.
> that aside, aren't all parts like the profile and dive list already
> working on Android - do they receive touch events, does input text
> fields open the Android keyboard etc..?

well, There are some parts of the interface that will not ever be good
even if we style it:

The Dive Info part should be vertical, two fields side by side is too
big for phones ( but works for tablets )

the dive list has too many fields.

"do we even have to create a new UI" -> to get the most of the platform, yes.
at least three UI's:

- Tablet
- Phone
- Desktop

how hard it's going to be?
Right now, on Subsurface 4.2, a tiny bit hard since we have some
'desktop' assumptions ( like the existence of a mainwindow, that other
classes calls ).

I plan to clean all that for 4.3 and further separate the code from
interface ( thing that I'm doing for quite a long time already ) in a
way that will be easy to integrate new interfaces to the existing
core.

that's going to be too much of work? I sincerely hope not. :)

> lubomir
> --
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: GSOC project updates

2014-07-28 Thread Tomaz Canabrava
On Mon, Jul 28, 2014 at 2:20 PM, Lubomir I. Ivanov  wrote:
> On 28 July 2014 20:13, Tomaz Canabrava  wrote:
>> On Mon, Jul 28, 2014 at 2:01 PM, Lubomir I. Ivanov  
>> wrote:
>>> On 28 July 2014 19:54, Tomaz Canabrava  wrote:
>>>> On Mon, Jul 28, 2014 at 1:39 PM, Lubomir I. Ivanov  
>>>> wrote:
>>>>> On 28 July 2014 19:29, Tomaz Canabrava  wrote:
>>>>>> On Mon, Jul 28, 2014 at 1:27 PM, Lubomir I. Ivanov  
>>>>>> wrote:
>>>>>>> On 28 July 2014 19:19, Tomaz Canabrava  wrote:
>>>>>>>> On Mon, Jul 28, 2014 at 1:16 PM, Lubomir I. Ivanov 
>>>>>>>>  wrote:
>>>>>>>>> On 28 July 2014 19:03, Anton Lundin  wrote:
>>>>>>>>>> Just a note here from how we thought.
>>>>>>>>>>
>>>>>>>>>> The scope of this GSOC project is to produce a usable downloader app
>>>>>>>>>> for android and one pre-req for that is a usable touch friendly ui.
>>>>>>>>>>
>>>>>>>>>> The current Android port of subsurface is unusable as a ui, but it
>>>>>>>>>> works as a technical product. It needs a better ui for touch.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> i haven't followed previous discussions; can you elaborate on why 
>>>>>>>>> it's unusable?
>>>>>>>>> is it more of a cosmetic issue or perhaps QWidget based things like
>>>>>>>>> QTreeView (divelist) do not work at all?
>>>>>>>>
>>>>>>>> The UI becomes too small to be used on a phone and it's not stetically
>>>>>>>> appealing to be used on Tablet.
>>>>>>>>
>>>>>>>
>>>>>>> hmm, how about allowing only one view at time: profile, divelist,
>>>>>>> diveinfo etc and increasing the font sizes?
>>>>>>> the "one view at a time" thing, is the mobile way of doing it because
>>>>>>> of resolution restrictions.
>>>>>>
>>>>>> QML can takes care of that, I'v already created a Subsurface QML
>>>>>> interface just for fun and it was almost easy to do. :)
>>>>>>
>>>>>
>>>>> and can be done in C++ based on our current UI - just show the "view"
>>>>> that is needed?
>>>>>
>>>>> for a recent Qt / POC project i completely ditched QML in favor of C++
>>>>> because i wanted a more direct QGraphicsScene interaction.
>>>>> QML only provided the "quick" part in terms of instantiating UI
>>>>> elements, but not the control and performance i wanted.
>>>>
>>>> True in Qt4, false in Qt5. in Qt5 QML uses OpenGL directly so it
>>>> should be faster / smoother than QGraphicsView.
>>>>
>>>
>>> well, QML to my knowledge is built based on QGraphicsView and
>>> QGraphicsView can use QGLWidget as a viewport, which i've tried and it
>>> works apart from minor font glitches for now.
>>
>> True for Qt4, False for Qt5.
>> for Qt5 QML is build not on QGraphicsView anymore, but SceneGraph.
>> There's a very nice blog post about it here:
>>
>> http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-renderer/
>>
>
> oh yes, forgot about the SceneGraph...
>
>>> the performance of QML's animation (this should be also based on Qt's
>>> animation framework) and of Context2D (for heavy SVG like drawing)
>>> were main decision factors to stick to C++.
>>
>> yes - true for Qt4 :)
>>
>
> dunno, my tests were based on Qt5.2 for Win32.
> RotationAnimation on a declarative image, 15% CPU on a dual core with OpenGL.
> rotating with QGraphicsScene / C++ ~0% CPU with or without OpenGL.

Then I hope they fix this bug, as they are selling QML as the big thing in Qt.
We can do a touch ui based on QGraphicsView, but it will be so much
easier in QML ( mostly because now there's a widget's QML package )


> lubomir
> --
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: GSOC project updates

2014-07-28 Thread Tomaz Canabrava
On Mon, Jul 28, 2014 at 2:01 PM, Lubomir I. Ivanov  wrote:
> On 28 July 2014 19:54, Tomaz Canabrava  wrote:
>> On Mon, Jul 28, 2014 at 1:39 PM, Lubomir I. Ivanov  
>> wrote:
>>> On 28 July 2014 19:29, Tomaz Canabrava  wrote:
>>>> On Mon, Jul 28, 2014 at 1:27 PM, Lubomir I. Ivanov  
>>>> wrote:
>>>>> On 28 July 2014 19:19, Tomaz Canabrava  wrote:
>>>>>> On Mon, Jul 28, 2014 at 1:16 PM, Lubomir I. Ivanov  
>>>>>> wrote:
>>>>>>> On 28 July 2014 19:03, Anton Lundin  wrote:
>>>>>>>> Just a note here from how we thought.
>>>>>>>>
>>>>>>>> The scope of this GSOC project is to produce a usable downloader app
>>>>>>>> for android and one pre-req for that is a usable touch friendly ui.
>>>>>>>>
>>>>>>>> The current Android port of subsurface is unusable as a ui, but it
>>>>>>>> works as a technical product. It needs a better ui for touch.
>>>>>>>>
>>>>>>>
>>>>>>> i haven't followed previous discussions; can you elaborate on why it's 
>>>>>>> unusable?
>>>>>>> is it more of a cosmetic issue or perhaps QWidget based things like
>>>>>>> QTreeView (divelist) do not work at all?
>>>>>>
>>>>>> The UI becomes too small to be used on a phone and it's not stetically
>>>>>> appealing to be used on Tablet.
>>>>>>
>>>>>
>>>>> hmm, how about allowing only one view at time: profile, divelist,
>>>>> diveinfo etc and increasing the font sizes?
>>>>> the "one view at a time" thing, is the mobile way of doing it because
>>>>> of resolution restrictions.
>>>>
>>>> QML can takes care of that, I'v already created a Subsurface QML
>>>> interface just for fun and it was almost easy to do. :)
>>>>
>>>
>>> and can be done in C++ based on our current UI - just show the "view"
>>> that is needed?
>>>
>>> for a recent Qt / POC project i completely ditched QML in favor of C++
>>> because i wanted a more direct QGraphicsScene interaction.
>>> QML only provided the "quick" part in terms of instantiating UI
>>> elements, but not the control and performance i wanted.
>>
>> True in Qt4, false in Qt5. in Qt5 QML uses OpenGL directly so it
>> should be faster / smoother than QGraphicsView.
>>
>
> well, QML to my knowledge is built based on QGraphicsView and
> QGraphicsView can use QGLWidget as a viewport, which i've tried and it
> works apart from minor font glitches for now.

True for Qt4, False for Qt5.
for Qt5 QML is build not on QGraphicsView anymore, but SceneGraph.
There's a very nice blog post about it here:

http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-renderer/

> the performance of QML's animation (this should be also based on Qt's
> animation framework) and of Context2D (for heavy SVG like drawing)
> were main decision factors to stick to C++.

yes - true for Qt4 :)

> lubomir
> --
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: GSOC project updates

2014-07-28 Thread Tomaz Canabrava
On Mon, Jul 28, 2014 at 1:39 PM, Lubomir I. Ivanov  wrote:
> On 28 July 2014 19:29, Tomaz Canabrava  wrote:
>> On Mon, Jul 28, 2014 at 1:27 PM, Lubomir I. Ivanov  
>> wrote:
>>> On 28 July 2014 19:19, Tomaz Canabrava  wrote:
>>>> On Mon, Jul 28, 2014 at 1:16 PM, Lubomir I. Ivanov  
>>>> wrote:
>>>>> On 28 July 2014 19:03, Anton Lundin  wrote:
>>>>>> Just a note here from how we thought.
>>>>>>
>>>>>> The scope of this GSOC project is to produce a usable downloader app
>>>>>> for android and one pre-req for that is a usable touch friendly ui.
>>>>>>
>>>>>> The current Android port of subsurface is unusable as a ui, but it
>>>>>> works as a technical product. It needs a better ui for touch.
>>>>>>
>>>>>
>>>>> i haven't followed previous discussions; can you elaborate on why it's 
>>>>> unusable?
>>>>> is it more of a cosmetic issue or perhaps QWidget based things like
>>>>> QTreeView (divelist) do not work at all?
>>>>
>>>> The UI becomes too small to be used on a phone and it's not stetically
>>>> appealing to be used on Tablet.
>>>>
>>>
>>> hmm, how about allowing only one view at time: profile, divelist,
>>> diveinfo etc and increasing the font sizes?
>>> the "one view at a time" thing, is the mobile way of doing it because
>>> of resolution restrictions.
>>
>> QML can takes care of that, I'v already created a Subsurface QML
>> interface just for fun and it was almost easy to do. :)
>>
>
> and can be done in C++ based on our current UI - just show the "view"
> that is needed?
>
> for a recent Qt / POC project i completely ditched QML in favor of C++
> because i wanted a more direct QGraphicsScene interaction.
> QML only provided the "quick" part in terms of instantiating UI
> elements, but not the control and performance i wanted.

True in Qt4, false in Qt5. in Qt5 QML uses OpenGL directly so it
should be faster / smoother than QGraphicsView.

> lubomir
> --
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


Re: GSOC project updates

2014-07-28 Thread Tomaz Canabrava
On Mon, Jul 28, 2014 at 1:27 PM, Lubomir I. Ivanov  wrote:
> On 28 July 2014 19:19, Tomaz Canabrava  wrote:
>> On Mon, Jul 28, 2014 at 1:16 PM, Lubomir I. Ivanov  
>> wrote:
>>> On 28 July 2014 19:03, Anton Lundin  wrote:
>>>> Just a note here from how we thought.
>>>>
>>>> The scope of this GSOC project is to produce a usable downloader app
>>>> for android and one pre-req for that is a usable touch friendly ui.
>>>>
>>>> The current Android port of subsurface is unusable as a ui, but it
>>>> works as a technical product. It needs a better ui for touch.
>>>>
>>>
>>> i haven't followed previous discussions; can you elaborate on why it's 
>>> unusable?
>>> is it more of a cosmetic issue or perhaps QWidget based things like
>>> QTreeView (divelist) do not work at all?
>>
>> The UI becomes too small to be used on a phone and it's not stetically
>> appealing to be used on Tablet.
>>
>
> hmm, how about allowing only one view at time: profile, divelist,
> diveinfo etc and increasing the font sizes?
> the "one view at a time" thing, is the mobile way of doing it because
> of resolution restrictions.

QML can takes care of that, I'v already created a Subsurface QML
interface just for fun and it was almost easy to do. :)

> lubomir
> --
___
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


  1   2   3   4   5   >