changeset 785:e136dd3bb5c6

Permit setting the default alignment preference
author Chris Cannam
date Wed, 05 Aug 2020 16:05:51 +0100
parents ee430e9ffccc
children 1089d65c585d
files align/Align.cpp align/Align.h
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/align/Align.cpp	Thu Jul 23 17:24:16 2020 +0100
+++ b/align/Align.cpp	Wed Aug 05 16:05:51 2020 +0100
@@ -250,6 +250,18 @@
 }
 
 void
+Align::setDefaultAlignmentPreference(AlignmentType type)
+{
+    QSettings settings;
+    settings.beginGroup("Alignment");
+    if (!settings.contains("alignment-type")) {
+        QString tag = getAlignmentTypeTag(type);
+        settings.setValue("alignment-type", tag);
+    }
+    settings.endGroup();
+}
+
+void
 Align::setPreferredAlignmentProgram(QString program)
 {
     QSettings settings;
--- a/align/Align.h	Thu Jul 23 17:24:16 2020 +0100
+++ b/align/Align.h	Wed Aug 05 16:05:51 2020 +0100
@@ -80,6 +80,12 @@
     static void setAlignmentPreference(AlignmentType type);
 
     /**
+     * Set the default alignment preference. That is, if no alignment
+     * preference has been set by the user yet, set it to this.
+     */
+    static void setDefaultAlignmentPreference(AlignmentType type);
+    
+    /**
      * Get the external program associated with the
      * ExternalProgramAlignment type, if any is set (an empty string
      * otherwise). Note that this will return a value if any has ever