Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9f0aa35b authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Remove the 'Create Search' dialog

Nobody is going to type in JSON query to create search. We can restore it if we
ever need it....
parent 3ea2f16b
......@@ -36,7 +36,6 @@ set(libakonadiconsole_SRCS
monitorsmodel.cpp
notificationmodel.cpp
notificationmonitor.cpp
searchdialog.cpp
searchwidget.cpp
querydebugger.cpp
tagpropertiesdialog.cpp
......
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui version="4" name="akonadiconsole" >
<gui version="5" name="akonadiconsole" >
<MenuBar>
<Menu name="edit">
<Action name="akonadi_paste" append="edit_paste_merge"/>
<Action name="akonadiconsole_search"/>
</Menu>
<Menu name="collection"><text>&amp;Collection</text>
<Action name="akonadi_collection_create"/>
......
......@@ -25,7 +25,6 @@
#include "dbbrowser.h"
#include "dbconsole.h"
#include "debugwidget.h"
#include "searchdialog.h"
#include "searchwidget.h"
#include "jobtrackerwidget.h"
#include "notificationmonitor.h"
......@@ -68,11 +67,7 @@ MainWidget::MainWidget(KXmlGuiWindow *parent)
tabWidget->addTab(new SearchWidget(tabWidget), QStringLiteral("Item Search"));
tabWidget->addTab(new MonitorsWidget(tabWidget), QStringLiteral("Monitors"));
QAction *action = parent->actionCollection()->addAction(QStringLiteral("akonadiconsole_search"));
action->setText(QStringLiteral("Create Search..."));
connect(action, &QAction::triggered, this, &MainWidget::createSearch);
action = parent->actionCollection()->addAction(QStringLiteral("akonadiconsole_akonadi2xml"));
auto action = parent->actionCollection()->addAction(QStringLiteral("akonadiconsole_akonadi2xml"));
action->setText(QStringLiteral("Dump to XML..."));
connect(action, &QAction::triggered, mBrowser, &BrowserWidget::dumpToXml);
......@@ -98,30 +93,6 @@ MainWidget::~MainWidget()
delete mBrowser;
}
void MainWidget::createSearch()
{
//QT5 TODO need to reimplement it
#pragma message("port to QT5")
#if 0
SearchDialog dlg;
if (!dlg.exec()) {
return;
}
const QString query = dlg.searchQuery();
if (query.isEmpty()) {
return;
}
QString name = dlg.searchName();
if (name.isEmpty()) {
name = "My Search";
}
new Akonadi::SearchCreateJob(name, query);
#endif
}
void MainWidget::startServer()
{
Akonadi::ServerManager::start();
......
......@@ -37,7 +37,6 @@ public:
~MainWidget();
private Q_SLOTS:
void createSearch();
void startServer();
void stopServer();
void restartServer();
......
/*
This file is part of Akonadi.
Copyright (c) 2008 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
#include "searchdialog.h"
#include <QLineEdit>
#include <KTextEdit>
#include <QLabel>
#include <QGridLayout>
#include <QDialogButtonBox>
#include <KConfigGroup>
#include <QPushButton>
#include <QVBoxLayout>
SearchDialog::SearchDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(QStringLiteral("Create Search"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &SearchDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &SearchDialog::reject);
QGridLayout *layout = new QGridLayout;
mainLayout->addLayout(layout);
mainLayout->addWidget(buttonBox);
mName = new QLineEdit(this);
mName->setText(QStringLiteral("My Search"));
mEdit = new KTextEdit(this);
mEdit->setAcceptRichText(false);
mEdit->setWhatsThis(QStringLiteral("Enter a SparQL query here"));
layout->addWidget(new QLabel(QStringLiteral("Search query name:")), 0, 0);
layout->addWidget(mName, 0, 1);
layout->addWidget(mEdit, 1, 0, 1, 2);
}
SearchDialog::~SearchDialog()
{
}
QString SearchDialog::searchName() const
{
return mName->text();
}
QString SearchDialog::searchQuery() const
{
return mEdit->toPlainText();
}
/*
This file is part of Akonadi.
Copyright (c) 2008 Tobias Koenig <tokoe@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
#ifndef AKONADICONSOLE_SEARCHDIALOG_H
#define AKONADICONSOLE_SEARCHDIALOG_H
#include <QDialog>
class QLineEdit;
class KTextEdit;
class SearchDialog : public QDialog
{
public:
explicit SearchDialog(QWidget *parent = nullptr);
~SearchDialog();
QString searchName() const;
QString searchQuery() const;
private:
QLineEdit *mName;
KTextEdit *mEdit;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment