2011-10-29 12:24:12 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2012-01-01 15:29:55 +01:00
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
2011-10-29 12:24:12 +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/>.
|
|
|
|
* ============================================================ */
|
2011-10-22 22:29:33 +02:00
|
|
|
#ifndef BOOKMARKSIMPORTDIALOG_H
|
|
|
|
#define BOOKMARKSIMPORTDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QPair>
|
|
|
|
#include <QWebPage>
|
|
|
|
#include <QWebFrame>
|
|
|
|
#include <QWebSettings>
|
|
|
|
|
|
|
|
#include "bookmarksmodel.h"
|
|
|
|
|
2011-11-06 17:01:23 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class BookmarksImportDialog;
|
2011-10-22 22:29:33 +02:00
|
|
|
}
|
|
|
|
|
2011-10-28 23:17:38 +02:00
|
|
|
class IconFetcher;
|
2011-10-22 22:29:33 +02:00
|
|
|
class BookmarksImportDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit BookmarksImportDialog(QWidget* parent = 0);
|
|
|
|
~BookmarksImportDialog();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void nextPage();
|
|
|
|
void setFile();
|
|
|
|
|
|
|
|
void stopDownloading();
|
2011-10-28 23:17:38 +02:00
|
|
|
void iconFetched(const QIcon &icon);
|
2011-10-22 22:29:33 +02:00
|
|
|
void loadFinished();
|
|
|
|
|
|
|
|
private:
|
2011-12-08 21:52:03 +01:00
|
|
|
enum Browser { Firefox = 0, Chrome = 1, Opera = 2, Html = 3, IE = 4};
|
2011-10-22 22:29:33 +02:00
|
|
|
|
|
|
|
void setupBrowser(Browser browser);
|
|
|
|
bool exportedOK();
|
|
|
|
void startFetchingIcons();
|
|
|
|
void addExportedBookmarks();
|
|
|
|
|
2011-11-06 17:01:23 +01:00
|
|
|
Ui::BookmarksImportDialog* ui;
|
2011-10-22 22:29:33 +02:00
|
|
|
|
|
|
|
int m_currentPage;
|
|
|
|
Browser m_browser;
|
|
|
|
QString m_browserName;
|
|
|
|
QString m_browserFileText;
|
|
|
|
QString m_browserFileText2;
|
|
|
|
QString m_standardDir;
|
|
|
|
|
|
|
|
QPixmap m_browserPixmap;
|
|
|
|
QString m_browserBookmarkFile;
|
|
|
|
|
|
|
|
QList<BookmarksModel::Bookmark> m_exportedBookmarks;
|
|
|
|
|
2011-10-28 23:17:38 +02:00
|
|
|
QList<QPair<IconFetcher*, QUrl> > m_fetchers;
|
2011-10-22 22:29:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BOOKMARKSIMPORTDIALOG_H
|