Switch to unified view

a/src/qtgui/uiprefs_w.cpp b/src/qtgui/uiprefs_w.cpp
...
...
60
    m_viewAction = 0;
60
    m_viewAction = 0;
61
61
62
    connect(viewActionPB, SIGNAL(clicked()), this, SLOT(showViewAction()));
62
    connect(viewActionPB, SIGNAL(clicked()), this, SLOT(showViewAction()));
63
    connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
63
    connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
64
    connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
64
    connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
65
65
    connect(stylesheetPB, SIGNAL(clicked()), this, SLOT(showStylesheetDialog()));
66
    connect(stylesheetPB, SIGNAL(clicked()),this, SLOT(showStylesheetDialog()));
66
    connect(resetSSPB, SIGNAL(clicked()), this, SLOT(resetStylesheet()));
67
    connect(resetSSPB, SIGNAL(clicked()), this, SLOT(resetStylesheet()));
68
    connect(snipCssPB, SIGNAL(clicked()),this, SLOT(showSnipCssDialog()));
69
    connect(resetSnipCssPB, SIGNAL(clicked()), this, SLOT(resetSnipCss()));
67
70
68
    connect(idxLV, SIGNAL(itemSelectionChanged()),
71
    connect(idxLV, SIGNAL(itemSelectionChanged()),
69
        this, SLOT(extradDbSelectChanged()));
72
        this, SLOT(extradDbSelectChanged()));
70
    connect(ptransPB, SIGNAL(clicked()),
73
    connect(ptransPB, SIGNAL(clicked()),
71
        this, SLOT(extraDbEditPtrans()));
74
        this, SLOT(extraDbEditPtrans()));
...
...
140
    reslistFontPB->setText(reslistFontFamily + "-" +
143
    reslistFontPB->setText(reslistFontFamily + "-" +
141
                   s.setNum(reslistFontSize));
144
                   s.setNum(reslistFontSize));
142
    }
145
    }
143
146
144
    // Style sheet
147
    // Style sheet
145
    stylesheetFile = prefs.stylesheetFile;
148
    qssFile = prefs.qssFile;
146
    if (stylesheetFile.isEmpty()) {
149
    if (qssFile.isEmpty()) {
147
    stylesheetPB->setText(tr("Choose"));
150
    stylesheetPB->setText(tr("Choose"));
148
    } else {
151
    } else {
149
    string nm = path_getsimple((const char *)stylesheetFile.toLocal8Bit());
152
    string nm = path_getsimple((const char *)qssFile.toLocal8Bit());
150
    stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
153
    stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
154
    }
155
156
    snipCssFile = prefs.snipCssFile;
157
    if (snipCssFile.isEmpty()) {
158
  snipCssPB->setText(tr("Choose"));
159
    } else {
160
  string nm = path_getsimple((const char *)snipCssFile.toLocal8Bit());
161
  snipCssPB->setText(QString::fromLocal8Bit(nm.c_str()));
151
    }
162
    }
152
163
153
    paraFormat = prefs.reslistformat;
164
    paraFormat = prefs.reslistformat;
154
    headerText = prefs.reslistheadertext;
165
    headerText = prefs.reslistheadertext;
155
166
...
...
223
    prefs.reslistdateformat = dateformatLE->text();
234
    prefs.reslistdateformat = dateformatLE->text();
224
    prefs.creslistdateformat = (const char*)prefs.reslistdateformat.toUtf8();
235
    prefs.creslistdateformat = (const char*)prefs.reslistdateformat.toUtf8();
225
236
226
    prefs.reslistfontfamily = reslistFontFamily;
237
    prefs.reslistfontfamily = reslistFontFamily;
227
    prefs.reslistfontsize = reslistFontSize;
238
    prefs.reslistfontsize = reslistFontSize;
228
    prefs.stylesheetFile = stylesheetFile;
239
    prefs.qssFile = qssFile;
229
    QTimer::singleShot(0, m_mainWindow, SLOT(applyStyleSheet()));
240
    QTimer::singleShot(0, m_mainWindow, SLOT(applyStyleSheet()));
241
    prefs.snipCssFile = snipCssFile;
230
    prefs.reslistformat =  paraFormat;
242
    prefs.reslistformat =  paraFormat;
231
    prefs.reslistheadertext =  headerText;
243
    prefs.reslistheadertext =  headerText;
232
    if (prefs.reslistformat.trimmed().isEmpty()) {
244
    if (prefs.reslistformat.trimmed().isEmpty()) {
233
    prefs.reslistformat = prefs.dfltResListFormat;
245
    prefs.reslistformat = prefs.dfltResListFormat;
234
    paraFormat = prefs.reslistformat;
246
    paraFormat = prefs.reslistformat;
...
...
362
    }
374
    }
363
}
375
}
364
376
365
void UIPrefsDialog::showStylesheetDialog()
377
void UIPrefsDialog::showStylesheetDialog()
366
{
378
{
367
    stylesheetFile = myGetFileName(false, "Select stylesheet file", true);
379
    qssFile = myGetFileName(false, "Select stylesheet file", true);
368
    string nm = path_getsimple((const char *)stylesheetFile.toLocal8Bit());
380
    string nm = path_getsimple((const char *)qssFile.toLocal8Bit());
369
    stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
381
    stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
370
}
382
}
371
383
372
void UIPrefsDialog::resetStylesheet()
384
void UIPrefsDialog::resetStylesheet()
373
{
385
{
374
    stylesheetFile = "";
386
    qssFile = "";
375
    stylesheetPB->setText(tr("Choose"));
387
    stylesheetPB->setText(tr("Choose"));
388
}
389
void UIPrefsDialog::showSnipCssDialog()
390
{
391
    snipCssFile = myGetFileName(false, "Select snippets window CSS file", true);
392
    string nm = path_getsimple((const char *)snipCssFile.toLocal8Bit());
393
    snipCssPB->setText(QString::fromLocal8Bit(nm.c_str()));
394
}
395
void UIPrefsDialog::resetSnipCss()
396
{
397
    snipCssFile = "";
398
    snipCssPB->setText(tr("Choose"));
376
}
399
}
377
400
378
void UIPrefsDialog::resetReslistFont()
401
void UIPrefsDialog::resetReslistFont()
379
{
402
{
380
    reslistFontFamily = "";
403
    reslistFontFamily = "";