Hello,

When adding new waypoints, some use cases make it desirable to always
edit the new waypoint's detail (name, elevation, etc.) rather than first
depending on auto-generated details and then click again on the new
waypoint to change those.
Attached is a patch that adds a new configuration option which allows to
modify QLGT's default behavior in this regards.
Do you think that could be included in the main tree?

Thanks and cheers,

Cédric

PS: I must currently stick to SVN revision 3257 as source tree,
currently being stuck on Ubuntu 10.04 and QT 4.6 for development (the
changes made after 3257 introduce QT 4.7 dependencies that prevent a
successful build)

PS2: I haven't forgotten about my planned "extended route support";
currently working on it ;-)


diff --git a/src/CDlgConfig.cpp b/src/CDlgConfig.cpp
index febe7f4..54efe10 100644
--- a/src/CDlgConfig.cpp
+++ b/src/CDlgConfig.cpp
@@ -95,6 +95,7 @@ void CDlgConfig::exec()
     checkShowZoomLevel->setChecked(resources.m_showZoomLevel);
     checkAntiAliasing->setChecked(resources.m_useAntiAliasing);
     checkReducePoiIcons->setChecked(resources.m_reducePoiIcons);
+    checkWptForceEdit->setChecked(resources.m_WptForceEdit);
 #ifdef HAS_GEODB
     checkUseGeoDB->setChecked(resources.m_useGeoDB);
     groupSaveWks->setEnabled(resources.m_useGeoDB);
@@ -192,6 +193,7 @@ void CDlgConfig::accept()
     resources.m_playSound       = checkPlaySound->isChecked();
     resources.m_useAntiAliasing = checkAntiAliasing->isChecked();
     resources.m_reducePoiIcons  = checkReducePoiIcons->isChecked();
+    resources.m_WptForceEdit    = checkWptForceEdit->isChecked();
 
 #ifdef HAS_GEODB
     resources.m_useGeoDB        = checkUseGeoDB->isChecked();
diff --git a/src/CResources.cpp b/src/CResources.cpp
index 087b0b4..91098de 100644
--- a/src/CResources.cpp
+++ b/src/CResources.cpp
@@ -74,6 +74,7 @@ CResources::CResources(QObject * parent)
 , m_useAntiAliasing(true)
 , m_reducePoiIcons(true)
 , m_WptTextColor(Qt::black)
+, m_WptForceEdit(false)
 , m_pathMapCache(QDir::temp().filePath("qlandkartegt/cache"))
 , m_sizeMapCache(100)
 , m_expireMapCache(8)
@@ -154,6 +155,7 @@ CResources::CResources(QObject * parent)
     m_reducePoiIcons   = cfg.value("environment/reducePoiIcons",m_reducePoiIcons).toBool();
 
     m_WptTextColor = QColor(cfg.value("environment/wptTextColor", m_WptTextColor.name()).toString());
+    m_WptForceEdit = cfg.value("environment/wptForceEdit",m_WptForceEdit).toBool();
 
     QDir dirWeb(QDir::home().filePath(CONFIGDIR));
     dirWeb.mkdir("WebStuff");
@@ -248,6 +250,7 @@ CResources::~CResources()
     cfg.setValue("environment/reducePoiIcons",m_reducePoiIcons);
 
     cfg.setValue("environment/wptTextColor", m_WptTextColor.name());
+    cfg.setValue("environment/wptForceEdit",m_WptForceEdit);
 
     cfg.setValue("network/mapcache/path", m_pathMapCache.absolutePath());
     cfg.setValue("network/mapcache/size", m_sizeMapCache);
diff --git a/src/CResources.h b/src/CResources.h
index 65dd115..ebccc24 100644
--- a/src/CResources.h
+++ b/src/CResources.h
@@ -74,6 +74,7 @@ class CResources : public QObject
         bool reducePoiIcons(){return m_reducePoiIcons;}
 
         QColor wptTextColor(){return m_WptTextColor;}
+        bool wptForceEdit(){return m_WptForceEdit;}
 
         QDir getPathMapCache(){return m_pathMapCache;}
         int getSizeMapCache(){return m_sizeMapCache;}
@@ -150,6 +151,7 @@ class CResources : public QObject
         bool m_reducePoiIcons;
 
         QColor m_WptTextColor;
+        bool m_WptForceEdit;
 
         /// unit translator object
         QPointer<IUnit> unit;
diff --git a/src/CWptDB.cpp b/src/CWptDB.cpp
index 4e07179..a58c177 100644
--- a/src/CWptDB.cpp
+++ b/src/CWptDB.cpp
@@ -291,7 +291,7 @@ CWpt * CWptDB::newWpt(float lon, float lat, float ele, const QString& name)
     SETTINGS;
     wpt->setIcon(cfg.value("waypoint/lastSymbol","").toString());
 
-    if(name.isEmpty())
+    if(CResources::self().wptForceEdit() || name.isEmpty())
     {
         CDlgEditWpt dlg(*wpt,theMainWindow->getCanvas());
         if(dlg.exec() == QDialog::Rejected)
diff --git a/src/IDlgConfig.ui b/src/IDlgConfig.ui
index 75dc160..3ab2b54 100644
--- a/src/IDlgConfig.ui
+++ b/src/IDlgConfig.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>704</width>
-    <height>570</height>
+    <height>582</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,7 +17,7 @@
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>3</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="tab">
       <attribute name="title">
@@ -201,6 +201,25 @@
         </widget>
        </item>
        <item>
+        <widget class="QGroupBox" name="groupBox_10">
+         <property name="title">
+          <string>Waypoints</string>
+         </property>
+         <layout class="QHBoxLayout">
+          <item>
+           <widget class="QCheckBox" name="checkWptForceEdit">
+            <property name="toolTip">
+             <string>Always display the waypoint edit dialog when adding new waypoints</string>
+            </property>
+            <property name="text">
+             <string>Always edit new entry</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
         <spacer>
          <property name="orientation">
           <enum>Qt::Vertical</enum>
diff --git a/src/locale/qlandkartegt_fr.ts b/src/locale/qlandkartegt_fr.ts
index e937e5f..7d52cdf 100644
--- a/src/locale/qlandkartegt_fr.ts
+++ b/src/locale/qlandkartegt_fr.ts
@@ -7388,6 +7388,16 @@ p, li { white-space: pre-wrap; }
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../IDlgConfig.ui" line="168"/>
+        <source>Always edit new entry</source>
+        <translation>Toujours éditer les nouveaux points</translation>
+    </message>
+    <message>
+        <location filename="../IDlgConfig.ui" line="168"/>
+        <source>Always display the waypoint edit dialog when adding new waypoints</source>
+        <translation>Toujours afficher le formulaire d&apos;édition lors de l&apos;ajout de nouveaux points géographique</translation>
+    </message>
+    <message>
         <location filename="../IDlgConfig.ui" line="212"/>
         <source>Services &amp;&amp; Paths</source>
         <translation type="unfinished"></translation>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to