improved external index dialog with listview
This commit is contained in:
parent
b45c49980c
commit
83b84f71f1
@ -27,12 +27,12 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -88,6 +88,7 @@
|
||||
</item>
|
||||
<item text="&Preferences" name="Preferences">
|
||||
<action name="preferencesQuery_PrefsAction"/>
|
||||
<action name="extIdxAction"/>
|
||||
</item>
|
||||
<separator/>
|
||||
<item text="&Help" name="Help">
|
||||
@ -151,7 +152,6 @@
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<pixmap>image0</pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<actions>
|
||||
@ -270,6 +270,17 @@
|
||||
<string>&Query configuration</string>
|
||||
</property>
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>extIdxAction</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>External index dialog</string>
|
||||
</property>
|
||||
<property name="menuText">
|
||||
<string>External index dialog</string>
|
||||
</property>
|
||||
</action>
|
||||
</actions>
|
||||
<pixmapinproject/>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.21 2007-01-08 10:11:53 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.22 2007-01-13 15:21:41 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -151,6 +151,7 @@ void RclMain::init()
|
||||
|
||||
connect(preferencesQuery_PrefsAction, SIGNAL(activated()),
|
||||
this, SLOT(showUIPrefs()));
|
||||
connect(extIdxAction, SIGNAL(activated()), this, SLOT(showExtIdxDialog()));
|
||||
|
||||
|
||||
#if (QT_VERSION < 0x040000)
|
||||
@ -456,12 +457,24 @@ void RclMain::showUIPrefs()
|
||||
if (uiprefs == 0) {
|
||||
uiprefs = new UIPrefsDialog(0);
|
||||
connect(uiprefs, SIGNAL(uiprefsDone()), this, SLOT(setUIPrefs()));
|
||||
uiprefs->show();
|
||||
} else {
|
||||
// Close and reopen, in hope that makes us visible...
|
||||
uiprefs->close();
|
||||
uiprefs->show();
|
||||
}
|
||||
uiprefs->show();
|
||||
}
|
||||
|
||||
void RclMain::showExtIdxDialog()
|
||||
{
|
||||
if (uiprefs == 0) {
|
||||
uiprefs = new UIPrefsDialog(0);
|
||||
connect(uiprefs, SIGNAL(uiprefsDone()), this, SLOT(setUIPrefs()));
|
||||
} else {
|
||||
// Close and reopen, in hope that makes us visible...
|
||||
uiprefs->close();
|
||||
}
|
||||
uiprefs->tabWidget->setCurrentPage(2);
|
||||
uiprefs->show();
|
||||
}
|
||||
|
||||
// If a preview (toplevel) window gets closed by the user, we need to
|
||||
|
||||
@ -80,6 +80,7 @@ public slots:
|
||||
virtual void showAboutDialog();
|
||||
virtual void startManual();
|
||||
virtual void showDocHistory();
|
||||
virtual void showExtIdxDialog();
|
||||
virtual void sortDataChanged(DocSeqSortSpec spec);
|
||||
virtual void showUIPrefs();
|
||||
virtual void setUIPrefs();
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>558</width>
|
||||
<height>534</height>
|
||||
<width>523</width>
|
||||
<height>530</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
@ -24,7 +24,7 @@
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout17</cstring>
|
||||
<cstring>layout16</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
@ -32,7 +32,7 @@
|
||||
</property>
|
||||
<widget class="QTabWidget">
|
||||
<property name="name">
|
||||
<cstring>tabWidget2</cstring>
|
||||
<cstring>tabWidget</cstring>
|
||||
</property>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
@ -41,13 +41,13 @@
|
||||
<attribute name="title">
|
||||
<string>User interface</string>
|
||||
</attribute>
|
||||
<hbox>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout20</cstring>
|
||||
<cstring>layout39</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
@ -55,7 +55,7 @@
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout1</cstring>
|
||||
<cstring>layout23</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@ -92,7 +92,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
<cstring>layout24</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@ -132,7 +132,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout18</cstring>
|
||||
<cstring>layout35</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@ -142,6 +142,14 @@
|
||||
<property name="name">
|
||||
<cstring>textLabel1_4</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Result paragraph<br>format string</string>
|
||||
</property>
|
||||
@ -156,17 +164,20 @@
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>5</height>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="resizePolicy">
|
||||
<enum>Manual</enum>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>PlainText</enum>
|
||||
</property>
|
||||
@ -184,7 +195,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout9</cstring>
|
||||
<cstring>layout36</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@ -221,7 +232,7 @@
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout18</cstring>
|
||||
<cstring>layout37</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
@ -299,7 +310,7 @@
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
@ -517,222 +528,172 @@ May be slow for big documents.</string>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout15</cstring>
|
||||
<cstring>layout16</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<widget class="QListView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>External indexes</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>addExtraDbPB</cstring>
|
||||
<cstring>idxLV</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<property name="selectionMode">
|
||||
<enum>Extended</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add index</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
<property name="resizeMode">
|
||||
<enum>AllColumns</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>extraDbLE</cstring>
|
||||
<cstring>layout15</cstring>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>togExtraDbPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>actAllExtraDbPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Activate All</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>unacAllExtraDbPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Desactivate All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="Line">
|
||||
<property name="name">
|
||||
<cstring>line2_2</cstring>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
<property name="frameShape">
|
||||
<enum>HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>browseDbPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout12</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout13</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>textLabel2_2</cstring>
|
||||
<cstring>delExtraDbPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>All indexes</string>
|
||||
<string>Remove selected</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Indexes currently not used</string>
|
||||
<string>Remove from list. This has no effect on the disk index.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListBox">
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>allDbsLB</cstring>
|
||||
<cstring>spacer3</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>addExtraDbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add index</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>extraDbLE</cstring>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>200</height>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>Extended</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout11</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>addAADbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>All ----></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>addADbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sel -----></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>delADbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><----- Sel</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>delAADbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><----- All</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout14</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel5</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Active indexes</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Indexes that will be searched in addition to the main one</string>
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListBox">
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>actDbsLB</cstring>
|
||||
<cstring>browseDbPB</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>Extended</enum>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Select the xapiandb directory for the index you want to add, then click Add Index</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>Layout1</cstring>
|
||||
<cstring>layout38</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>Horizontal Spacing2</cstring>
|
||||
@ -745,7 +706,7 @@ May be slow for big documents.</string>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<width>210</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.13 2006-12-14 13:53:43 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.14 2007-01-13 15:21:41 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -37,13 +37,17 @@ static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.13 2006-12-14 13:53:43 dockes E
|
||||
#include <qcombobox.h>
|
||||
#if QT_VERSION < 0x040000
|
||||
#include <qlistbox.h>
|
||||
#include <qlistview.h>
|
||||
#include <qfiledialog.h>
|
||||
#else
|
||||
#include <q3listbox.h>
|
||||
#include <q3listview.h>
|
||||
#include <q3filedialog.h>
|
||||
#define QListBox Q3ListBox
|
||||
#define QListBoxItem Q3ListBoxItem
|
||||
#include <
|
||||
#define QListView Q3ListView
|
||||
#define QCheckListItem Q3CheckListItem
|
||||
#define QFileDialog Q3FileDialog
|
||||
#define QListViewItemIterator Q3ListViewItemIterator
|
||||
#endif
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
@ -67,16 +71,24 @@ void UIPrefsDialog::init()
|
||||
connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
|
||||
connect(extraDbLE,SIGNAL(textChanged(const QString&)), this,
|
||||
SLOT(extraDbTextChanged(const QString&)));
|
||||
connect(addAADbPB, SIGNAL(clicked()), this, SLOT(addAADbPB_clicked()));
|
||||
connect(addADbPB, SIGNAL(clicked()), this, SLOT(addADbPB_clicked()));
|
||||
connect(delADbPB, SIGNAL(clicked()), this, SLOT(delADbPB_clicked()));
|
||||
connect(delAADbPB, SIGNAL(clicked()), this, SLOT(delAADbPB_clicked()));
|
||||
connect(addExtraDbPB, SIGNAL(clicked()), this, SLOT(addExtraDbPB_clicked()));
|
||||
|
||||
connect(addExtraDbPB, SIGNAL(clicked()),
|
||||
this, SLOT(addExtraDbPB_clicked()));
|
||||
connect(delExtraDbPB, SIGNAL(clicked()),
|
||||
this, SLOT(delExtraDbPB_clicked()));
|
||||
connect(togExtraDbPB, SIGNAL(clicked()),
|
||||
this, SLOT(togExtraDbPB_clicked()));
|
||||
connect(actAllExtraDbPB, SIGNAL(clicked()),
|
||||
this, SLOT(actAllExtraDbPB_clicked()));
|
||||
connect(unacAllExtraDbPB, SIGNAL(clicked()),
|
||||
this, SLOT(unacAllExtraDbPB_clicked()));
|
||||
|
||||
connect(browseDbPB, SIGNAL(clicked()), this, SLOT(browseDbPB_clicked()));
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
|
||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||
connect(buildAbsCB, SIGNAL(toggled(bool)),
|
||||
replAbsCB, SLOT(setEnabled(bool)));
|
||||
|
||||
setFromPrefs();
|
||||
}
|
||||
|
||||
@ -138,21 +150,22 @@ void UIPrefsDialog::setFromPrefs()
|
||||
replAbsCB->setChecked(prefs.queryReplaceAbstract);
|
||||
|
||||
// Initialize the extra indexes listboxes
|
||||
QStringList ql;
|
||||
idxLV->clear();
|
||||
for (list<string>::iterator it = prefs.allExtraDbs.begin();
|
||||
it != prefs.allExtraDbs.end(); it++) {
|
||||
ql.append(QString::fromLocal8Bit(it->c_str()));
|
||||
QCheckListItem *item =
|
||||
new QCheckListItem(idxLV, QString::fromLocal8Bit(it->c_str()),
|
||||
QCheckListItem::CheckBox);
|
||||
if (item) item->setOn(false);
|
||||
}
|
||||
allDbsLB->clear();
|
||||
allDbsLB->insertStringList(ql);
|
||||
ql.clear();
|
||||
for (list<string>::iterator it = prefs.activeExtraDbs.begin();
|
||||
it != prefs.activeExtraDbs.end(); it++) {
|
||||
ql.append(QString::fromLocal8Bit(it->c_str()));
|
||||
QCheckListItem *item;
|
||||
if ((item = (QCheckListItem *)
|
||||
idxLV->findItem (QString::fromLocal8Bit(it->c_str()), 0))) {
|
||||
item->setOn(true);
|
||||
}
|
||||
}
|
||||
actDbsLB->clear();
|
||||
actDbsLB->insertStringList(ql);
|
||||
ql.clear();
|
||||
}
|
||||
|
||||
void UIPrefsDialog::accept()
|
||||
@ -183,26 +196,26 @@ void UIPrefsDialog::accept()
|
||||
prefs.syntAbsLen = syntlenSB->value();
|
||||
prefs.syntAbsCtx = syntctxSB->value();
|
||||
|
||||
prefs.activeExtraDbs.clear();
|
||||
for (unsigned int i = 0; i < actDbsLB->count(); i++) {
|
||||
QListBoxItem *item = actDbsLB->item(i);
|
||||
if (item)
|
||||
prefs.activeExtraDbs.push_back((const char *)item->text().local8Bit());
|
||||
}
|
||||
QListViewItemIterator it(idxLV);
|
||||
prefs.allExtraDbs.clear();
|
||||
for (unsigned int i = 0; i < allDbsLB->count(); i++) {
|
||||
QListBoxItem *item = allDbsLB->item(i);
|
||||
if (item)
|
||||
prefs.allExtraDbs.push_back((const char *)item->text().local8Bit());
|
||||
prefs.activeExtraDbs.clear();
|
||||
while (it.current()) {
|
||||
QCheckListItem *item = (QCheckListItem *)it.current();
|
||||
prefs.allExtraDbs.push_back((const char *)item->text().local8Bit());
|
||||
if (item->isOn()) {
|
||||
prefs.activeExtraDbs.push_back((const char *)
|
||||
item->text().local8Bit());
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
||||
|
||||
rwSettings(true);
|
||||
string reason;
|
||||
maybeOpenDb(reason, true);
|
||||
emit uiprefsDone();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void UIPrefsDialog::reject()
|
||||
{
|
||||
setFromPrefs();
|
||||
@ -236,7 +249,6 @@ void UIPrefsDialog::showFontDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UIPrefsDialog::resetReslistFont()
|
||||
{
|
||||
reslistFontFamily = "";
|
||||
@ -272,75 +284,34 @@ void UIPrefsDialog::showViewAction()
|
||||
// External / extra search indexes setup
|
||||
// TBD: a way to remove entry from 'all' list (del button?)
|
||||
|
||||
void UIPrefsDialog::extraDbTextChanged(const QString &text)
|
||||
void UIPrefsDialog::togExtraDbPB_clicked()
|
||||
{
|
||||
if (text.isEmpty()) {
|
||||
addExtraDbPB->setEnabled(false);
|
||||
} else {
|
||||
addExtraDbPB->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the selected extra dbs to the active list
|
||||
*/
|
||||
void UIPrefsDialog::addADbPB_clicked()
|
||||
{
|
||||
for (unsigned int i = 0; i < allDbsLB->count();i++) {
|
||||
QListBoxItem *item = allDbsLB->item(i);
|
||||
if (item && item->isSelected()) {
|
||||
allDbsLB->setSelected(i, false);
|
||||
if (!actDbsLB->findItem(item->text(),
|
||||
#if QT_VERSION < 0x040000
|
||||
Qt::CaseSensitive|Qt::ExactMatch
|
||||
#else
|
||||
Q3ListBox::CaseSensitive|Q3ListBox::ExactMatch
|
||||
#endif
|
||||
)) {
|
||||
actDbsLB->insertItem(item->text());
|
||||
}
|
||||
QListViewItemIterator it(idxLV);
|
||||
while (it.current()) {
|
||||
QCheckListItem *item = (QCheckListItem *)it.current();
|
||||
if (item->isSelected()) {
|
||||
item->setOn(!item->isOn());
|
||||
}
|
||||
}
|
||||
actDbsLB->sort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make all extra dbs active
|
||||
*/
|
||||
void UIPrefsDialog::addAADbPB_clicked()
|
||||
{
|
||||
for (unsigned int i = 0; i < allDbsLB->count();i++) {
|
||||
allDbsLB->setSelected(i, true);
|
||||
}
|
||||
addADbPB_clicked();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the selected entries from the list of active extra search dbs
|
||||
*/
|
||||
void UIPrefsDialog::delADbPB_clicked()
|
||||
{
|
||||
list<int> rmi;
|
||||
for (unsigned int i = 0; i < actDbsLB->count(); i++) {
|
||||
QListBoxItem *item = actDbsLB->item(i);
|
||||
if (item && item->isSelected()) {
|
||||
rmi.push_front(i);
|
||||
}
|
||||
}
|
||||
for (list<int>::iterator ii = rmi.begin(); ii != rmi.end(); ii++) {
|
||||
actDbsLB->removeItem(*ii);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all extra search indexes from the active list
|
||||
*/
|
||||
void UIPrefsDialog::delAADbPB_clicked()
|
||||
void UIPrefsDialog::actAllExtraDbPB_clicked()
|
||||
{
|
||||
for (unsigned int i = 0; i < actDbsLB->count(); i++) {
|
||||
actDbsLB->setSelected(i, true);
|
||||
QListViewItemIterator it(idxLV);
|
||||
while (it.current()) {
|
||||
QCheckListItem *item = (QCheckListItem *)it.current();
|
||||
item->setOn(true);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
void UIPrefsDialog::unacAllExtraDbPB_clicked()
|
||||
{
|
||||
QListViewItemIterator it(idxLV);
|
||||
while (it.current()) {
|
||||
QCheckListItem *item = (QCheckListItem *)it.current();
|
||||
item->setOn(false);
|
||||
++it;
|
||||
}
|
||||
delADbPB_clicked();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -370,19 +341,44 @@ void UIPrefsDialog::addExtraDbPB_clicked()
|
||||
tr("This is the main/local index!"));
|
||||
return;
|
||||
}
|
||||
if (allDbsLB->findItem(extraDbLE->text(),
|
||||
if (idxLV->findItem(extraDbLE->text(),
|
||||
#if QT_VERSION < 0x040000
|
||||
Qt::CaseSensitive|Qt::ExactMatch
|
||||
#else
|
||||
Q3ListBox::CaseSensitive|Q3ListBox::ExactMatch
|
||||
Q3ListView::CaseSensitive|Q3ListView::ExactMatch
|
||||
#endif
|
||||
)) {
|
||||
QMessageBox::warning(0, "Recoll",
|
||||
tr("The selected directory is already in the index list"));
|
||||
return;
|
||||
}
|
||||
allDbsLB->insertItem(extraDbLE->text());
|
||||
allDbsLB->sort();
|
||||
new QCheckListItem(idxLV, extraDbLE->text(), QCheckListItem::CheckBox);
|
||||
idxLV->sort();
|
||||
}
|
||||
|
||||
void UIPrefsDialog::delExtraDbPB_clicked()
|
||||
{
|
||||
list<QCheckListItem*> dlt;
|
||||
QListViewItemIterator it(idxLV);
|
||||
while (it.current()) {
|
||||
QCheckListItem *item = (QCheckListItem *)it.current();
|
||||
if (item->isSelected()) {
|
||||
dlt.push_back(item);
|
||||
}
|
||||
++it;
|
||||
}
|
||||
for (list<QCheckListItem*>::iterator it = dlt.begin();
|
||||
it != dlt.end(); it++)
|
||||
delete *it;
|
||||
}
|
||||
|
||||
void UIPrefsDialog::extraDbTextChanged(const QString &text)
|
||||
{
|
||||
if (text.isEmpty()) {
|
||||
addExtraDbPB->setEnabled(false);
|
||||
} else {
|
||||
addExtraDbPB->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void UIPrefsDialog::browseDbPB_clicked()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* @(#$Id: uiprefs_w.h,v 1.6 2006-12-14 13:53:43 dockes Exp $ (C) 2006 J.F.Dockes */
|
||||
/* @(#$Id: uiprefs_w.h,v 1.7 2007-01-13 15:21:41 dockes Exp $ (C) 2006 J.F.Dockes */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#ifndef _UIPREFS_W_H_INCLUDED_
|
||||
#define _UIPREFS_W_H_INCLUDED_
|
||||
/* @(#$Id: uiprefs_w.h,v 1.6 2006-12-14 13:53:43 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
/* @(#$Id: uiprefs_w.h,v 1.7 2007-01-13 15:21:41 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
#include <qvariant.h>
|
||||
#include <qdialog.h>
|
||||
|
||||
@ -69,12 +69,12 @@ public slots:
|
||||
virtual void resetReslistFont();
|
||||
virtual void showBrowserDialog();
|
||||
virtual void extraDbTextChanged( const QString & text );
|
||||
virtual void addAADbPB_clicked();
|
||||
virtual void addADbPB_clicked();
|
||||
virtual void delADbPB_clicked();
|
||||
virtual void delAADbPB_clicked();
|
||||
virtual void addExtraDbPB_clicked();
|
||||
virtual void delExtraDbPB_clicked();
|
||||
virtual void browseDbPB_clicked();
|
||||
virtual void togExtraDbPB_clicked();
|
||||
virtual void actAllExtraDbPB_clicked();
|
||||
virtual void unacAllExtraDbPB_clicked();
|
||||
|
||||
signals:
|
||||
void uiprefsDone();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user