optionally remember sorting state between invocations
This commit is contained in:
parent
edada96bf8
commit
747a6183c2
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -201,6 +201,10 @@ void rwSettings(bool writing)
|
|||||||
"english");
|
"english");
|
||||||
SETTING_RW(prefs.useDesktopOpen,
|
SETTING_RW(prefs.useDesktopOpen,
|
||||||
"/Recoll/prefs/useDesktopOpen", Bool, false);
|
"/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,
|
SETTING_RW(prefs.queryBuildAbstract,
|
||||||
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
||||||
SETTING_RW(prefs.queryReplaceAbstract,
|
SETTING_RW(prefs.queryReplaceAbstract,
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#ifndef _GUIUTILS_H_INCLUDED_
|
#ifndef _GUIUTILS_H_INCLUDED_
|
||||||
#define _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
|
* jean-francois.dockes@wanadoo.fr
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -76,6 +76,8 @@ class PrefsPack {
|
|||||||
int ssearchTyp;
|
int ssearchTyp;
|
||||||
QString htmlBrowser;
|
QString htmlBrowser;
|
||||||
bool useDesktopOpen; // typically xdg-open, instead of mimeview settings
|
bool useDesktopOpen; // typically xdg-open, instead of mimeview settings
|
||||||
|
bool keepSort; // remember sort status between invocations
|
||||||
|
bool sortActive; // Remembered sort state.
|
||||||
bool queryBuildAbstract;
|
bool queryBuildAbstract;
|
||||||
bool queryReplaceAbstract;
|
bool queryReplaceAbstract;
|
||||||
bool startWithAdvSearchOpen;
|
bool startWithAdvSearchOpen;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -48,6 +48,16 @@ void SortForm::init()
|
|||||||
mcntSB->setValue(prefs.sortWidth);
|
mcntSB->setValue(prefs.sortWidth);
|
||||||
unsigned int spec = (unsigned int)prefs.sortSpec;
|
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
|
// We use 4 bits per spec hi is direction, 3 low bits = sort field
|
||||||
unsigned int v, d;
|
unsigned int v, d;
|
||||||
|
|
||||||
@ -63,8 +73,6 @@ void SortForm::init()
|
|||||||
fldCMB2->setCurrentItem(v < 3 ? v : 0);
|
fldCMB2->setCurrentItem(v < 3 ? v : 0);
|
||||||
descCB2->setChecked(d!=0?true:false);
|
descCB2->setChecked(d!=0?true:false);
|
||||||
|
|
||||||
// Always start with sort disabled
|
|
||||||
sortCB->setChecked(false);
|
|
||||||
|
|
||||||
// signals and slots connections
|
// signals and slots connections
|
||||||
connect(applyPB, SIGNAL(clicked()), this, SLOT(apply()));
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(apply()));
|
||||||
@ -94,6 +102,8 @@ void SortForm::setData()
|
|||||||
fldCMB2->setEnabled(sortCB->isChecked());
|
fldCMB2->setEnabled(sortCB->isChecked());
|
||||||
descCB2->setEnabled(sortCB->isChecked());
|
descCB2->setEnabled(sortCB->isChecked());
|
||||||
|
|
||||||
|
prefs.sortActive = sortCB->isChecked();
|
||||||
|
|
||||||
if (!sortCB->isChecked()) {
|
if (!sortCB->isChecked()) {
|
||||||
spec.sortwidth = 0;
|
spec.sortwidth = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>523</width>
|
<width>0</width>
|
||||||
<height>530</height>
|
<height>0</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="caption">
|
<property name="caption">
|
||||||
@ -319,6 +319,17 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QCheckBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>keepSortCB</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Remember sorting preference between invocations.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</vbox>
|
</vbox>
|
||||||
</widget>
|
</widget>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -105,6 +105,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
initStartAdvCB->setChecked(prefs.startWithAdvSearchOpen);
|
initStartAdvCB->setChecked(prefs.startWithAdvSearchOpen);
|
||||||
initStartSortCB->setChecked(prefs.startWithSortToolOpen);
|
initStartSortCB->setChecked(prefs.startWithSortToolOpen);
|
||||||
useDesktopOpenCB->setChecked(prefs.useDesktopOpen);
|
useDesktopOpenCB->setChecked(prefs.useDesktopOpen);
|
||||||
|
keepSortCB->setChecked(prefs.keepSort);
|
||||||
|
|
||||||
// Result list font family and size
|
// Result list font family and size
|
||||||
reslistFontFamily = prefs.reslistfontfamily;
|
reslistFontFamily = prefs.reslistfontfamily;
|
||||||
@ -193,6 +194,7 @@ void UIPrefsDialog::accept()
|
|||||||
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
||||||
prefs.startWithSortToolOpen = initStartSortCB->isChecked();
|
prefs.startWithSortToolOpen = initStartSortCB->isChecked();
|
||||||
prefs.useDesktopOpen = useDesktopOpenCB->isChecked();
|
prefs.useDesktopOpen = useDesktopOpenCB->isChecked();
|
||||||
|
prefs.keepSort = keepSortCB->isChecked();
|
||||||
|
|
||||||
prefs.syntAbsLen = syntlenSB->value();
|
prefs.syntAbsLen = syntlenSB->value();
|
||||||
prefs.syntAbsCtx = syntctxSB->value();
|
prefs.syntAbsCtx = syntctxSB->value();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user