Hi Oliver:

Am 08.01.13 20:04 schrieb(en) Oliver Eichler:
you still have one of the older devices, don't you? With the newer ones it's 
just exchanging gpx files. Thus all sticky waypoints are in one file which is 
rarely changed. And all other data is in files below sub-directories.

Yes, I have an old eTrex legend HCx...  It absolutely makes sense what you say!

The export dialog is always used to transfer data to devices. If you use an old 
device with the device driver or a modern one, it's always the same. As there 
are more new devices than old ones, the current sticky rule is a bit more 
practical than with old ones.

The attached trivial patch just makes the process clearer (IMHO).  All sticky 
waypoints are simply disabled in the dialogue.

Opinions?

Cheers,
Albrecht.
Index: src/CDlgExport.cpp
===================================================================
--- src/CDlgExport.cpp	(Revision 3567)
+++ src/CDlgExport.cpp	(Arbeitskopie)
@@ -75,7 +75,18 @@ int CDlgExport::exec()
             QStringList str;
             str << key.name << key.comment.left(32);
             QTreeWidgetItem * item = new QTreeWidgetItem(itemWpt, str);
-            item->setCheckState(0, Qt::Checked);
+
+            CWpt *wpt = CWptDB::self().getWptByKey(key.key);
+            if (wpt->sticky)
+            {
+                item->setCheckState(0, Qt::Unchecked);
+                item->setFlags(0);
+            }
+            else
+            {
+                item->setCheckState(0, Qt::Checked);
+            }
+
             item->setIcon(0,getWptIconByName(key.icon));
             item->setData(0, Qt::UserRole, key.key);
         }
@@ -205,7 +216,8 @@ void CDlgExport::slotCheckAll(bool checked)
     max = itemWpt->childCount();
     for(i = 0; i < max; i++)
     {
-        itemWpt->child(i)->setCheckState(0, checked ? Qt::Checked : Qt::Unchecked);
+        if ((itemWpt->child(i)->flags() & Qt::ItemIsEnabled) == Qt::ItemIsEnabled)
+            itemWpt->child(i)->setCheckState(0, checked ? Qt::Checked : Qt::Unchecked);
     }
 
     max = itemTrk->childCount();

Attachment: pgpJBXOztVf1e.pgp
Description: PGP signature

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to