diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp
index e28aede0..05420ee8 100644
--- a/src/qtgui/guiutils.cpp
+++ b/src/qtgui/guiutils.cpp
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.31 2007-02-14 10:10:43 dockes Exp $ (C) 2005 Jean-Francois Dockes";
+static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.32 2007-05-24 07:48:19 dockes Exp $ (C) 2005 Jean-Francois Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -201,6 +201,10 @@ void rwSettings(bool writing)
"english");
SETTING_RW(prefs.useDesktopOpen,
"/Recoll/prefs/useDesktopOpen", Bool, false);
+ SETTING_RW(prefs.keepSort,
+ "/Recoll/prefs/keepSort", Bool, false);
+ SETTING_RW(prefs.sortActive,
+ "/Recoll/prefs/sortActive", Bool, false);
SETTING_RW(prefs.queryBuildAbstract,
"/Recoll/prefs/query/buildAbstract", Bool, true);
SETTING_RW(prefs.queryReplaceAbstract,
diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h
index 4ab80d3b..60bdb684 100644
--- a/src/qtgui/guiutils.h
+++ b/src/qtgui/guiutils.h
@@ -17,7 +17,7 @@
#ifndef _GUIUTILS_H_INCLUDED_
#define _GUIUTILS_H_INCLUDED_
/*
- * @(#$Id: guiutils.h,v 1.20 2007-02-14 10:10:43 dockes Exp $ (C) 2005 Jean-Francois Dockes
+ * @(#$Id: guiutils.h,v 1.21 2007-05-24 07:48:19 dockes Exp $ (C) 2005 Jean-Francois Dockes
* jean-francois.dockes@wanadoo.fr
*
* This program is free software; you can redistribute it and/or modify
@@ -76,6 +76,8 @@ class PrefsPack {
int ssearchTyp;
QString htmlBrowser;
bool useDesktopOpen; // typically xdg-open, instead of mimeview settings
+ bool keepSort; // remember sort status between invocations
+ bool sortActive; // Remembered sort state.
bool queryBuildAbstract;
bool queryReplaceAbstract;
bool startWithAdvSearchOpen;
diff --git a/src/qtgui/sort_w.cpp b/src/qtgui/sort_w.cpp
index c729cda8..768aa4f0 100644
--- a/src/qtgui/sort_w.cpp
+++ b/src/qtgui/sort_w.cpp
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "@(#$Id: sort_w.cpp,v 1.4 2006-12-05 15:23:50 dockes Exp $ (C) 2006 J.F.Dockes";
+static char rcsid[] = "@(#$Id: sort_w.cpp,v 1.5 2007-05-24 07:48:19 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -48,6 +48,16 @@ void SortForm::init()
mcntSB->setValue(prefs.sortWidth);
unsigned int spec = (unsigned int)prefs.sortSpec;
+ // Restore active/inactive state only once from prefs, only if requested
+ fprintf(stderr, "sort_w init\n");
+ if (prefs.keepSort) {
+ sortCB->setChecked(prefs.sortActive);
+ } else {
+ sortCB->setChecked(false);
+ }
+
+ // Always start with sort disabled
+
// We use 4 bits per spec hi is direction, 3 low bits = sort field
unsigned int v, d;
@@ -63,8 +73,6 @@ void SortForm::init()
fldCMB2->setCurrentItem(v < 3 ? v : 0);
descCB2->setChecked(d!=0?true:false);
- // Always start with sort disabled
- sortCB->setChecked(false);
// signals and slots connections
connect(applyPB, SIGNAL(clicked()), this, SLOT(apply()));
@@ -94,6 +102,8 @@ void SortForm::setData()
fldCMB2->setEnabled(sortCB->isChecked());
descCB2->setEnabled(sortCB->isChecked());
+ prefs.sortActive = sortCB->isChecked();
+
if (!sortCB->isChecked()) {
spec.sortwidth = 0;
} else {
diff --git a/src/qtgui/uiprefs.ui b/src/qtgui/uiprefs.ui
index 2d7df805..13389b28 100644
--- a/src/qtgui/uiprefs.ui
+++ b/src/qtgui/uiprefs.ui
@@ -8,8 +8,8 @@
0
0
- 523
- 530
+ 0
+ 0
@@ -319,6 +319,17 @@
false
+
+
+ keepSortCB
+
+
+ Remember sorting preference between invocations.
+
+
+ false
+
+
diff --git a/src/qtgui/uiprefs_w.cpp b/src/qtgui/uiprefs_w.cpp
index dc3d16fe..de8d5dd9 100644
--- a/src/qtgui/uiprefs_w.cpp
+++ b/src/qtgui/uiprefs_w.cpp
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.16 2007-02-14 10:10:43 dockes Exp $ (C) 2005 J.F.Dockes";
+static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.17 2007-05-24 07:48:19 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -105,6 +105,7 @@ void UIPrefsDialog::setFromPrefs()
initStartAdvCB->setChecked(prefs.startWithAdvSearchOpen);
initStartSortCB->setChecked(prefs.startWithSortToolOpen);
useDesktopOpenCB->setChecked(prefs.useDesktopOpen);
+ keepSortCB->setChecked(prefs.keepSort);
// Result list font family and size
reslistFontFamily = prefs.reslistfontfamily;
@@ -193,6 +194,7 @@ void UIPrefsDialog::accept()
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
prefs.startWithSortToolOpen = initStartSortCB->isChecked();
prefs.useDesktopOpen = useDesktopOpenCB->isChecked();
+ prefs.keepSort = keepSortCB->isChecked();
prefs.syntAbsLen = syntlenSB->value();
prefs.syntAbsCtx = syntctxSB->value();