summaryrefslogtreecommitdiff
path: root/src/frontend/searchdialog/csearchdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/searchdialog/csearchdialog.cpp')
-rw-r--r--src/frontend/searchdialog/csearchdialog.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/frontend/searchdialog/csearchdialog.cpp b/src/frontend/searchdialog/csearchdialog.cpp
index 8ce55d4..54981e3 100644
--- a/src/frontend/searchdialog/csearchdialog.cpp
+++ b/src/frontend/searchdialog/csearchdialog.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -20,18 +20,23 @@
#include <QVBoxLayout>
#include <QWidget>
-#include "backend/config/cbtconfig.h"
+#include "backend/config/btconfig.h"
#include "backend/cswordmodulesearch.h"
#include "backend/keys/cswordkey.h"
#include "backend/keys/cswordversekey.h"
+#include "bibletimeapp.h"
#include "frontend/btmoduleindexdialog.h"
#include "frontend/searchdialog/btsearchoptionsarea.h"
#include "frontend/searchdialog/btsearchresultarea.h"
+#include "frontend/messagedialog.h"
#include "util/cresmgr.h"
-#include "util/directory.h"
-#include "util/dialogutil.h"
+#include "util/geticon.h"
+namespace {
+const QString GeometryKey = "GUI/SearchDialog/geometry";
+} // anonymous namespace
+
namespace Search {
static CSearchDialog* m_staticDialog = 0;
@@ -78,9 +83,7 @@ CSearchDialog* CSearchDialog::getSearchDialog() {
CSearchDialog::CSearchDialog(QWidget *parent)
: QDialog(parent), /*m_searchButton(0),*/ m_closeButton(0),
m_searchResultArea(0), m_searchOptionsArea(0) {
- namespace DU = util::directory;
-
- setWindowIcon(DU::getIcon(CResMgr::searchdialog::icon));
+ setWindowIcon(util::getIcon(CResMgr::searchdialog::icon));
setWindowTitle(tr("Search"));
setAttribute(Qt::WA_DeleteOnClose);
@@ -123,7 +126,7 @@ void CSearchDialog::startSearch() {
moduleNames.append("</center><br>");
// Ask the user about unindexed modules:
- int result = util::showQuestion(
+ int result = message::showQuestion(
this, tr("Missing indices"),
tr("The following modules need to be indexed before they can be"
" searched in:") + moduleNames + tr("Indexing could take a l"
@@ -185,7 +188,7 @@ QString CSearchDialog::prepareSearchText(const QString& orig) {
qDebug() << "After syntax characters removed:" << text;
text.replace(andWords, "\"and\"");
text.replace(orWords, "\"or\"");
- qDebug() << "After andor repclaced:" << text;
+ qDebug() << "After \"and\" and \"or\" replaced:" << text;
text.replace(" ", " AND ");
}
if (m_searchOptionsArea->searchType() == BtSearchOptionsArea::OrType) {
@@ -219,7 +222,6 @@ void CSearchDialog::setSearchText( const QString &searchText ) {
/** Initializes this object. */
void CSearchDialog::initView() {
- namespace DU = util::directory;
QVBoxLayout* verticalLayout = new QVBoxLayout(this);
setLayout(verticalLayout);
@@ -244,7 +246,7 @@ void CSearchDialog::initView() {
m_closeButton = new QPushButton(this);
m_closeButton->setText(tr("&Close"));
- m_closeButton->setIcon(DU::getIcon(CResMgr::searchdialog::close_icon));
+ m_closeButton->setIcon(util::getIcon(CResMgr::searchdialog::close_icon));
horizontalLayout->addWidget(m_closeButton);
verticalLayout->addLayout(horizontalLayout);
@@ -283,15 +285,11 @@ void CSearchDialog::closeButtonClicked() {
}
void CSearchDialog::loadDialogSettings() {
- resize(CBTConfig::get(CBTConfig::searchDialogWidth), CBTConfig::get(CBTConfig::searchDialogHeight));
- move(CBTConfig::get(CBTConfig::searchDialogX), CBTConfig::get(CBTConfig::searchDialogY));
+ restoreGeometry(btConfig().value<QByteArray>(GeometryKey, QByteArray()));
}
void CSearchDialog::saveDialogSettings() const {
- CBTConfig::set(CBTConfig::searchDialogWidth, size().width());
- CBTConfig::set(CBTConfig::searchDialogHeight, size().height());
- CBTConfig::set(CBTConfig::searchDialogX, x());
- CBTConfig::set(CBTConfig::searchDialogY, y());
+ btConfig().setValue(GeometryKey, saveGeometry());
}