Switch to side-by-side view

--- a/src/qtgui/recollmain.ui.h
+++ b/src/qtgui/recollmain.ui.h
@@ -343,10 +343,16 @@
 
     // Document number
     int reldocnum = reldocnumfromparnum(par);
-    // Bad number or already displayed. Forget it
-    if (reldocnum < 0)
-	return;
-    startPreview(reslist_winfirst + reldocnum);
+
+    if (reldocnum < 0) {
+	// Bad number: must have clicked on header. Show details of query
+	QString desc = tr("Query details") + ": " + 
+	    currentQueryData.description.c_str();
+	QMessageBox::information(this, tr("Query details"), desc);
+	return;
+    } else {
+	startPreview(reslist_winfirst + reldocnum);
+    }
 }
 
 // User asked to start query. Send it to the db aand call
@@ -389,12 +395,13 @@
 	delete docsource;
 
     if (sortwidth > 0) {
-	DocSequenceDb myseq(rcldb);
-	docsource = new DocSeqSorted(myseq, sortwidth, sortspecs);
-    } else {
-	docsource = new DocSequenceDb(rcldb);
-    }
-
+	DocSequenceDb myseq(rcldb, tr("Query results"));
+	docsource = new DocSeqSorted(myseq, sortwidth, sortspecs,
+				     tr("Query results (sorted)"));
+    } else {
+	docsource = new DocSequenceDb(rcldb, tr("Query results"));
+    }
+    currentQueryData = sdata;
     showResultPage();
 }
 
@@ -781,22 +788,23 @@
     startHelpBrowser();
 }
 
-
 void RecollMain::showDocHistory()
 {
     LOGDEB(("RecollMain::showDocHistory\n"));
     reslist_winfirst = -1;
     curPreview = 0;
-
     if (docsource)
 	delete docsource;
 
     if (sortwidth > 0) {
-	DocSequenceHistory myseq(rcldb, history);
-	docsource = new DocSeqSorted(myseq, sortwidth, sortspecs);
-    } else {
-	docsource = new DocSequenceHistory(rcldb, history);
-    }
+	DocSequenceHistory myseq(rcldb, history, tr("Document history"));
+	docsource = new DocSeqSorted(myseq, sortwidth, sortspecs,
+				     tr("Document history (sorted)"));
+    } else {
+	docsource = new DocSequenceHistory(rcldb, history, 
+					   tr("Document history"));
+    }
+    currentQueryData.erase();
     showResultPage();
 }