Switch to unified view

a/src/qtgui/uiprefs_w.cpp b/src/qtgui/uiprefs_w.cpp
...
...
51
#include "uiprefs_w.h"
51
#include "uiprefs_w.h"
52
#include "viewaction_w.h"
52
#include "viewaction_w.h"
53
#include "debuglog.h"
53
#include "debuglog.h"
54
#include "editdialog.h"
54
#include "editdialog.h"
55
#include "rclmain_w.h"
55
#include "rclmain_w.h"
56
#include "ptrans_w.h"
56
57
57
void UIPrefsDialog::init()
58
void UIPrefsDialog::init()
58
{
59
{
59
    m_viewAction = 0;
60
    m_viewAction = 0;
60
61
...
...
62
    connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
63
    connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
63
    connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
64
    connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
64
    connect(stylesheetPB, SIGNAL(clicked()), this, SLOT(showStylesheetDialog()));
65
    connect(stylesheetPB, SIGNAL(clicked()), this, SLOT(showStylesheetDialog()));
65
    connect(resetSSPB, SIGNAL(clicked()), this, SLOT(resetStylesheet()));
66
    connect(resetSSPB, SIGNAL(clicked()), this, SLOT(resetStylesheet()));
66
67
68
    connect(idxLV, SIGNAL(itemSelectionChanged()),
69
      this, SLOT(extradDbSelectChanged()));
70
    connect(ptransPB, SIGNAL(clicked()),
71
      this, SLOT(extraDbEditPtrans()));
67
    connect(addExtraDbPB, SIGNAL(clicked()), 
72
    connect(addExtraDbPB, SIGNAL(clicked()), 
68
        this, SLOT(addExtraDbPB_clicked()));
73
        this, SLOT(addExtraDbPB_clicked()));
69
    connect(delExtraDbPB, SIGNAL(clicked()), 
74
    connect(delExtraDbPB, SIGNAL(clicked()), 
70
        this, SLOT(delExtraDbPB_clicked()));
75
        this, SLOT(delExtraDbPB_clicked()));
71
    connect(togExtraDbPB, SIGNAL(clicked()), 
76
    connect(togExtraDbPB, SIGNAL(clicked()), 
...
...
395
}
400
}
396
401
397
////////////////////////////////////////////
402
////////////////////////////////////////////
398
// External / extra search indexes setup
403
// External / extra search indexes setup
399
404
405
void UIPrefsDialog::extradDbSelectChanged()
406
{
407
    if (idxLV->selectedItems().size() <= 1) 
408
  ptransPB->setEnabled(true);
409
    else
410
  ptransPB->setEnabled(false);
411
}
412
413
void UIPrefsDialog::extraDbEditPtrans()
414
{
415
    string dbdir;
416
    if (idxLV->selectedItems().size() == 0) {
417
  dbdir = theconfig->getDbDir();
418
    } else if (idxLV->selectedItems().size() == 1) {
419
  QListWidgetItem *item = idxLV->selectedItems()[0];
420
  QString qd = item->data(Qt::DisplayRole).toString();
421
  dbdir = (const char *)qd.toLocal8Bit();
422
    } else {
423
  QMessageBox::warning(
424
      0, "Recoll", tr("At most one index should be selected"));
425
  return;
426
    }
427
    dbdir = path_canon(dbdir);
428
    EditTrans *etrans = new EditTrans(dbdir, this);
429
    etrans->show();
430
}
431
400
void UIPrefsDialog::togExtraDbPB_clicked()
432
void UIPrefsDialog::togExtraDbPB_clicked()
401
{
433
{
402
    for (int i = 0; i < idxLV->count(); i++) {
434
    for (int i = 0; i < idxLV->count(); i++) {
403
    QListWidgetItem *item = idxLV->item(i);
435
    QListWidgetItem *item = idxLV->item(i);
404
    if (item->isSelected()) {
436
    if (item->isSelected()) {