2011-04-15 20:45:22 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2012-01-01 15:29:55 +01:00
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
2011-04-15 20:45:22 +02:00
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
|
|
|
#include "bookmarkssidebar.h"
|
|
|
|
#include "mainapplication.h"
|
|
|
|
#include "ui_bookmarkssidebar.h"
|
|
|
|
#include "qupzilla.h"
|
2011-04-25 20:56:45 +02:00
|
|
|
#include "iconprovider.h"
|
2012-01-21 20:27:45 +01:00
|
|
|
#include "tabbedwebview.h"
|
2011-04-15 20:45:22 +02:00
|
|
|
#include "bookmarkstoolbar.h"
|
|
|
|
#include "tabwidget.h"
|
|
|
|
#include "bookmarksmodel.h"
|
2012-08-10 21:16:43 +02:00
|
|
|
#include "qzsettings.h"
|
2011-04-15 20:45:22 +02:00
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include <QMenu>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QClipboard>
|
|
|
|
#include <QSqlQuery>
|
2012-09-02 15:53:00 +02:00
|
|
|
#include <QKeyEvent>
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2011-10-18 21:07:58 +02:00
|
|
|
BookmarksSideBar::BookmarksSideBar(QupZilla* mainClass, QWidget* parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
, m_isRefreshing(false)
|
|
|
|
, ui(new Ui::BookmarksSideBar)
|
|
|
|
, p_QupZilla(mainClass)
|
|
|
|
, m_bookmarksModel(mApp->bookmarksModel())
|
2011-04-15 20:45:22 +02:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->bookmarksTree->setDefaultItemShowMode(TreeWidget::ItemsExpanded);
|
2011-04-15 20:45:22 +02:00
|
|
|
connect(ui->bookmarksTree, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
|
|
|
|
connect(ui->bookmarksTree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*)));
|
2011-10-18 21:07:58 +02:00
|
|
|
connect(ui->bookmarksTree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(itemControlClicked(QTreeWidgetItem*)));
|
2011-11-06 17:01:23 +01:00
|
|
|
connect(ui->bookmarksTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*)));
|
2011-07-30 17:57:14 +02:00
|
|
|
connect(ui->search, SIGNAL(textChanged(QString)), ui->bookmarksTree, SLOT(filterString(QString)));
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
|
|
|
|
connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark)));
|
2011-11-06 17:01:23 +01:00
|
|
|
connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark, BookmarksModel::Bookmark)));
|
2011-04-15 20:45:22 +02:00
|
|
|
connect(m_bookmarksModel, SIGNAL(folderAdded(QString)), this, SLOT(addFolder(QString)));
|
|
|
|
connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(removeFolder(QString)));
|
2011-11-06 17:01:23 +01:00
|
|
|
connect(m_bookmarksModel, SIGNAL(folderRenamed(QString, QString)), this, SLOT(renameFolder(QString, QString)));
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
QTimer::singleShot(0, this, SLOT(refreshTable()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::itemControlClicked(QTreeWidgetItem* item)
|
|
|
|
{
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!item || item->text(1).isEmpty()) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-12-04 16:54:57 +01:00
|
|
|
|
2012-09-02 15:19:12 +02:00
|
|
|
int id = item->data(0, Qt::UserRole + 10).toInt();
|
|
|
|
mApp->bookmarksModel()->countUpBookmark(id);
|
|
|
|
|
|
|
|
const QUrl &url = QUrl::fromEncoded(item->text(1).toUtf8());
|
2011-12-20 18:58:42 +01:00
|
|
|
p_QupZilla->tabWidget()->addView(url, item->text(0));
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
2011-11-06 17:01:23 +01:00
|
|
|
void BookmarksSideBar::itemDoubleClicked(QTreeWidgetItem* item)
|
2011-04-15 20:45:22 +02:00
|
|
|
{
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!item || item->text(1).isEmpty()) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-12-04 16:54:57 +01:00
|
|
|
|
2012-09-02 15:19:12 +02:00
|
|
|
int id = item->data(0, Qt::UserRole + 10).toInt();
|
|
|
|
mApp->bookmarksModel()->countUpBookmark(id);
|
|
|
|
|
|
|
|
const QUrl &url = QUrl::fromEncoded(item->text(1).toUtf8());
|
2011-12-04 16:54:57 +01:00
|
|
|
p_QupZilla->loadAddress(url);
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::loadInNewTab()
|
|
|
|
{
|
2012-09-02 15:19:12 +02:00
|
|
|
QTreeWidgetItem* item = ui->bookmarksTree->currentItem();
|
|
|
|
QAction* action = qobject_cast<QAction*>(sender());
|
|
|
|
|
|
|
|
if (!item || !action) {
|
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2012-09-02 15:19:12 +02:00
|
|
|
|
|
|
|
int id = item->data(0, Qt::UserRole + 10).toInt();
|
|
|
|
mApp->bookmarksModel()->countUpBookmark(id);
|
|
|
|
|
|
|
|
p_QupZilla->tabWidget()->addView(action->data().toUrl(), item->text(0), qzSettings->newTabPosition);
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
2011-10-28 17:52:42 +02:00
|
|
|
void BookmarksSideBar::copyAddress()
|
|
|
|
{
|
2011-11-06 17:01:23 +01:00
|
|
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
2011-12-04 16:54:57 +01:00
|
|
|
QApplication::clipboard()->setText(action->data().toUrl().toEncoded());
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-10-28 17:52:42 +02:00
|
|
|
}
|
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
void BookmarksSideBar::deleteItem()
|
|
|
|
{
|
|
|
|
QTreeWidgetItem* item = ui->bookmarksTree->currentItem();
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!item) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
|
2012-03-13 17:51:06 +01:00
|
|
|
int id = item->data(0, Qt::UserRole + 10).toInt();
|
2011-04-15 20:45:22 +02:00
|
|
|
m_bookmarksModel->removeBookmark(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::contextMenuRequested(const QPoint &position)
|
|
|
|
{
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!ui->bookmarksTree->itemAt(position)) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-12-04 16:54:57 +01:00
|
|
|
QUrl link = QUrl::fromEncoded(ui->bookmarksTree->itemAt(position)->text(1).toUtf8());
|
2011-11-06 17:01:23 +01:00
|
|
|
if (link.isEmpty()) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
QMenu menu;
|
2012-01-25 15:46:18 +01:00
|
|
|
menu.addAction(tr("Open link in current &tab"), p_QupZilla, SLOT(loadActionUrl()))->setData(link);
|
2011-04-15 20:45:22 +02:00
|
|
|
menu.addAction(tr("Open link in &new tab"), this, SLOT(loadInNewTab()))->setData(link);
|
2011-10-28 17:52:42 +02:00
|
|
|
menu.addAction(tr("Copy address"), this, SLOT(copyAddress()))->setData(link);
|
2011-04-15 20:45:22 +02:00
|
|
|
menu.addSeparator();
|
|
|
|
menu.addAction(tr("&Delete"), this, SLOT(deleteItem()));
|
2011-10-28 17:52:42 +02:00
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
//Prevent choosing first option with double rightclick
|
2012-04-11 18:06:50 +02:00
|
|
|
QPoint pos = ui->bookmarksTree->viewport()->mapToGlobal(position);
|
2011-11-06 17:01:23 +01:00
|
|
|
QPoint p(pos.x(), pos.y() + 1);
|
2011-04-15 20:45:22 +02:00
|
|
|
menu.exec(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::addBookmark(const BookmarksModel::Bookmark &bookmark)
|
|
|
|
{
|
|
|
|
QString translatedFolder = BookmarksModel::toTranslatedFolder(bookmark.folder);
|
|
|
|
QTreeWidgetItem* item = new QTreeWidgetItem();
|
|
|
|
item->setText(0, bookmark.title);
|
|
|
|
item->setText(1, bookmark.url.toEncoded());
|
2012-03-13 17:51:06 +01:00
|
|
|
item->setData(0, Qt::UserRole + 10, bookmark.id);
|
2012-04-22 20:51:28 +02:00
|
|
|
item->setIcon(0, qIconProvider->iconFromImage(bookmark.image));
|
2011-04-15 20:45:22 +02:00
|
|
|
item->setToolTip(0, bookmark.url.toEncoded());
|
|
|
|
|
2011-11-06 17:01:23 +01:00
|
|
|
if (bookmark.folder != "unsorted") {
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->bookmarksTree->appendToParentItem(translatedFolder, item);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
else {
|
2011-04-15 20:45:22 +02:00
|
|
|
ui->bookmarksTree->addTopLevelItem(item);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
// if (!ui->search->text().isEmpty())
|
2011-11-06 17:01:23 +01:00
|
|
|
item->setHidden(!bookmark.title.contains(ui->search->text(), Qt::CaseInsensitive));
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::removeBookmark(const BookmarksModel::Bookmark &bookmark)
|
|
|
|
{
|
|
|
|
if (bookmark.folder == "unsorted") {
|
2011-04-17 13:03:29 +02:00
|
|
|
QList<QTreeWidgetItem*> list = ui->bookmarksTree->findItems(bookmark.title, Qt::MatchExactly);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (list.count() == 0) {
|
2011-04-17 13:03:29 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-17 13:03:29 +02:00
|
|
|
QTreeWidgetItem* item = list.at(0);
|
2012-03-13 17:51:06 +01:00
|
|
|
if (item && item->data(0, Qt::UserRole + 10).toInt() == bookmark.id) {
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->bookmarksTree->deleteItem(item);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2011-04-17 13:03:29 +02:00
|
|
|
QList<QTreeWidgetItem*> list = ui->bookmarksTree->findItems(BookmarksModel::toTranslatedFolder(bookmark.folder), Qt::MatchExactly);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (list.count() == 0) {
|
2011-04-17 13:03:29 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-17 13:03:29 +02:00
|
|
|
QTreeWidgetItem* parentItem = list.at(0);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!parentItem) {
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
for (int i = 0; i < parentItem->childCount(); i++) {
|
|
|
|
QTreeWidgetItem* item = parentItem->child(i);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!item) {
|
2011-04-15 20:45:22 +02:00
|
|
|
continue;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2012-03-13 17:51:06 +01:00
|
|
|
if (item->text(0) == bookmark.title && item->data(0, Qt::UserRole + 10).toInt() == bookmark.id) {
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->bookmarksTree->deleteItem(item);
|
2011-04-15 20:45:22 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::bookmarkEdited(const BookmarksModel::Bookmark &before, const BookmarksModel::Bookmark &after)
|
|
|
|
{
|
|
|
|
removeBookmark(before);
|
|
|
|
addBookmark(after);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::addFolder(const QString &name)
|
|
|
|
{
|
|
|
|
QTreeWidgetItem* item = new QTreeWidgetItem(ui->bookmarksTree);
|
|
|
|
item->setText(0, name);
|
|
|
|
item->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
|
|
|
|
}
|
|
|
|
|
|
|
|
void BookmarksSideBar::removeFolder(const QString &name)
|
|
|
|
{
|
2011-10-28 17:52:42 +02:00
|
|
|
QList<QTreeWidgetItem*> list = ui->bookmarksTree->findItems(name, Qt::MatchExactly);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (list.count() == 0) {
|
2011-10-28 17:52:42 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-10-28 17:52:42 +02:00
|
|
|
QTreeWidgetItem* item = list.at(0);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (item) {
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->bookmarksTree->deleteItem(item);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
2011-10-28 17:52:42 +02:00
|
|
|
void BookmarksSideBar::renameFolder(const QString &before, const QString &after)
|
|
|
|
{
|
|
|
|
QList<QTreeWidgetItem*> list = ui->bookmarksTree->findItems(before, Qt::MatchExactly);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (list.count() == 0) {
|
2011-10-28 17:52:42 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-10-28 17:52:42 +02:00
|
|
|
QTreeWidgetItem* item = list.at(0);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!item) {
|
2011-10-28 17:52:42 +02:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-10-28 17:52:42 +02:00
|
|
|
|
|
|
|
item->setText(0, after);
|
|
|
|
}
|
|
|
|
|
2012-09-02 15:53:00 +02:00
|
|
|
void BookmarksSideBar::keyPressEvent(QKeyEvent* event)
|
|
|
|
{
|
|
|
|
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
|
|
|
|
QTreeWidgetItem* item = ui->bookmarksTree->currentItem();
|
|
|
|
|
|
|
|
if (event->modifiers() & Qt::ControlModifier) {
|
|
|
|
itemControlClicked(item);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
itemDoubleClicked(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget::keyPressEvent(event);
|
|
|
|
}
|
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
void BookmarksSideBar::refreshTable()
|
|
|
|
{
|
|
|
|
m_isRefreshing = true;
|
|
|
|
ui->bookmarksTree->setUpdatesEnabled(false);
|
|
|
|
ui->bookmarksTree->clear();
|
|
|
|
|
|
|
|
QSqlQuery query;
|
|
|
|
QTreeWidgetItem* newItem = new QTreeWidgetItem(ui->bookmarksTree);
|
2011-12-17 14:30:54 +01:00
|
|
|
newItem->setText(0, _bookmarksMenu);
|
2011-04-15 20:45:22 +02:00
|
|
|
newItem->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
|
|
|
|
ui->bookmarksTree->addTopLevelItem(newItem);
|
|
|
|
|
2011-10-28 17:52:42 +02:00
|
|
|
query.exec("SELECT name FROM folders WHERE subfolder!='yes'");
|
2011-11-06 17:01:23 +01:00
|
|
|
while (query.next()) {
|
2011-04-15 20:45:22 +02:00
|
|
|
newItem = new QTreeWidgetItem(ui->bookmarksTree);
|
|
|
|
newItem->setText(0, query.value(0).toString());
|
|
|
|
newItem->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
|
|
|
|
ui->bookmarksTree->addTopLevelItem(newItem);
|
|
|
|
}
|
|
|
|
|
2011-07-31 13:33:44 +02:00
|
|
|
query.exec("SELECT title, url, id, folder, icon FROM bookmarks");
|
2011-11-06 17:01:23 +01:00
|
|
|
while (query.next()) {
|
2011-04-15 20:45:22 +02:00
|
|
|
QString title = query.value(0).toString();
|
|
|
|
QUrl url = query.value(1).toUrl();
|
|
|
|
int id = query.value(2).toInt();
|
|
|
|
QString folder = query.value(3).toString();
|
2012-04-22 20:51:28 +02:00
|
|
|
QIcon icon = qIconProvider->iconFromImage(QImage::fromData(query.value(4).toByteArray()));
|
2011-04-15 20:45:22 +02:00
|
|
|
QTreeWidgetItem* item;
|
2011-11-06 17:01:23 +01:00
|
|
|
if (folder == "bookmarksMenu") {
|
2011-12-17 14:30:54 +01:00
|
|
|
folder = _bookmarksMenu;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
if (folder == "bookmarksToolbar") {
|
2011-10-28 17:52:42 +02:00
|
|
|
continue;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
if (folder != "unsorted") {
|
|
|
|
QList<QTreeWidgetItem*> findParent = ui->bookmarksTree->findItems(folder, 0);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (findParent.count() != 1) {
|
2011-10-28 17:52:42 +02:00
|
|
|
continue;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-10-28 17:52:42 +02:00
|
|
|
|
|
|
|
item = new QTreeWidgetItem(findParent.at(0));
|
|
|
|
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
else {
|
2011-04-15 20:45:22 +02:00
|
|
|
item = new QTreeWidgetItem(ui->bookmarksTree);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-04-15 20:45:22 +02:00
|
|
|
|
|
|
|
item->setText(0, title);
|
|
|
|
item->setText(1, url.toEncoded());
|
|
|
|
item->setToolTip(0, url.toEncoded());
|
|
|
|
|
2012-03-13 17:51:06 +01:00
|
|
|
item->setData(0, Qt::UserRole + 10, id);
|
2011-07-31 13:33:44 +02:00
|
|
|
item->setIcon(0, icon);
|
2011-04-15 20:45:22 +02:00
|
|
|
ui->bookmarksTree->addTopLevelItem(item);
|
|
|
|
}
|
|
|
|
ui->bookmarksTree->expandAll();
|
|
|
|
|
|
|
|
ui->bookmarksTree->setUpdatesEnabled(true);
|
|
|
|
m_isRefreshing = false;
|
2012-09-02 15:53:00 +02:00
|
|
|
|
|
|
|
ui->search->setFocus();
|
2011-04-15 20:45:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BookmarksSideBar::~BookmarksSideBar()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|