diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index 86127d87..f3328a08 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -117,6 +117,8 @@ void rwSettings(bool writing) SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Int, 8); SETTING_RW(prefs.collapseDuplicates, "/Recoll/prefs/reslist/collapseDuplicates", Bool, false); + SETTING_RW(prefs.showResultsAsTable, + "/Recoll/prefs/showResultsAsTable", Bool, false); SETTING_RW(prefs.maxhltextmbs, "/Recoll/prefs/preview/maxhltextmbs", Int, 3); SETTING_RW(prefs.qtermcolor, "/Recoll/prefs/qtermcolor", String, "blue"); if (!writing && prefs.qtermcolor == "") diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index 6fd42652..d059e991 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -79,6 +79,8 @@ class PrefsPack { bool startWithAdvSearchOpen; bool previewHtml; bool collapseDuplicates; + bool showResultsAsTable; + // Extra query indexes. This are stored in the history file, not qt prefs list allExtraDbs; list activeExtraDbs; diff --git a/src/qtgui/images/table.png b/src/qtgui/images/table.png new file mode 100755 index 00000000..de480f89 Binary files /dev/null and b/src/qtgui/images/table.png differ diff --git a/src/qtgui/rclmain.ui b/src/qtgui/rclmain.ui index 7de0e410..664e5df5 100644 --- a/src/qtgui/rclmain.ui +++ b/src/qtgui/rclmain.ui @@ -10,17 +10,32 @@ 600 + + + 0 + 0 + + Recoll + 0 + + + 4 + + 2 - + 4 + + 2 + @@ -34,7 +49,7 @@ - + 0 0 @@ -51,7 +66,7 @@ 0 0 45 - 29 + 20 @@ -103,6 +118,8 @@ + + @@ -412,6 +429,21 @@ Show Query Details + + + true + + + + :/images/table.png:/images/table.png + + + Show results as table + + + Show results as table + + qPixmapFromMimeSource diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index f02b9bd6..2c2a91a6 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -195,8 +195,14 @@ void RclMain::init() actionSortByDateAsc->setChecked(true); onSortCtlChanged(); } + restable = new ResTable(this); + verticalLayout->insertWidget(2, restable); + actionShowResultsAsTable->setChecked(prefs.showResultsAsTable); + on_actionShowResultsAsTable_toggled(prefs.showResultsAsTable); - restable = new ResTable(); + // Must not do this when restable is a child of rclmain + // sc = new QShortcut(quitKeySeq, restable); + // connect(sc, SIGNAL (activated()), this, SLOT (fileExit())); // A shortcut to get the focus back to the search entry. QKeySequence seq("Ctrl+Shift+s"); @@ -237,6 +243,7 @@ void RclMain::init() this, SLOT(showUIPrefs())); connect(extIdxAction, SIGNAL(activated()), this, SLOT(showExtIdxDialog())); + if (prefs.catgToolBar && catgCMB) connect(catgCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int))); @@ -246,10 +253,6 @@ void RclMain::init() this, SLOT(showQueryDetails())); connect(periodictimer, SIGNAL(timeout()), this, SLOT(periodic100())); - - sc = new QShortcut(quitKeySeq, restable); - connect(sc, SIGNAL (activated()), - this, SLOT (fileExit())); connect(this, SIGNAL(docSourceChanged(RefCntr)), restable, SLOT(setDocSource(RefCntr))); connect(this, SIGNAL(searchReset()), @@ -309,7 +312,6 @@ void RclMain::init() // Start timer on a slow period (used for checking ^C). Will be // speeded up during indexing periodictimer->start(1000); - restable->show(); } void RclMain::resultCount(int n) @@ -886,13 +888,31 @@ void RclMain::onSortCtlChanged() void RclMain::onResTableSortBy(DocSeqSortSpec spec) { m_sortspecnochange = true; - actionSortByDateDesc->setChecked(false); - actionSortByDateAsc->setChecked(false); + if (spec.field.compare("mtime")) { + actionSortByDateDesc->setChecked(false); + actionSortByDateAsc->setChecked(false); + } else { + actionSortByDateDesc->setChecked(spec.desc); + actionSortByDateAsc->setChecked(!spec.desc); + } m_sortspecnochange = false; m_sortspec = spec; emit applyFiltSortData(); } +void RclMain::on_actionShowResultsAsTable_toggled(bool on) +{ + LOGDEB(("RclMain::on_actionShowResultsAsTable_toggled(%d)\n", int(on))); + prefs.showResultsAsTable = on; + if (on) { + restable->show(); + reslist->hide(); + } else { + restable->hide(); + reslist->show(); + } +} + void RclMain::on_actionSortByDateAsc_toggled(bool on) { LOGDEB(("RclMain::on_actionSortByDateAsc_toggled(%d)\n", int(on))); diff --git a/src/qtgui/rclmain_w.h b/src/qtgui/rclmain_w.h index 854029ca..e925d6bd 100644 --- a/src/qtgui/rclmain_w.h +++ b/src/qtgui/rclmain_w.h @@ -95,6 +95,7 @@ public slots: virtual void focusToSearch(); virtual void on_actionSortByDateAsc_toggled(bool on); virtual void on_actionSortByDateDesc_toggled(bool on); + virtual void on_actionShowResultsAsTable_toggled(bool on); virtual void onResTableSortBy(DocSeqSortSpec); virtual void resultCount(int); virtual void showQueryDetails(); diff --git a/src/qtgui/recoll.qrc b/src/qtgui/recoll.qrc index 0b92ae56..b55ba775 100644 --- a/src/qtgui/recoll.qrc +++ b/src/qtgui/recoll.qrc @@ -9,6 +9,7 @@ images/firstpage.png images/sortparms.png images/spell.png + images/table.png images/up.png images/down.png