1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Merge pull request #694 from srazi/master

Fixed some issues from recent commits
This commit is contained in:
David Rosca 2012-12-29 10:06:26 -08:00
commit 82ffaed2ad
5 changed files with 20 additions and 20 deletions

View File

@ -39,6 +39,7 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
const RestoreManager::WindowData &wd = data.at(i);
QTreeWidgetItem* root = new QTreeWidgetItem(ui->treeWidget);
root->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsTristate);
root->setText(0, tr("Window %1").arg((i + 1)));
root->setCheckState(0, Qt::Checked);
@ -46,6 +47,7 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
const WebTab::SavedTab &st = wd.tabsState.at(tab);
QTreeWidgetItem* child = new QTreeWidgetItem(root);
child->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled);
child->setCheckState(0, Qt::Checked);
child->setIcon(0, st.icon);
child->setText(0, st.title);
@ -54,24 +56,10 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
ui->treeWidget->expandAll();
connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), SLOT(onItemChanged(QTreeWidgetItem*, int)));
connect(ui->restoreSession, SIGNAL(clicked()), this, SLOT(restoreSession()));
connect(ui->newSession, SIGNAL(clicked()), this, SLOT(newSession()));
}
void RecoveryWidget::onItemChanged(QTreeWidgetItem* item, int column)
{
if (column != 0 || item->childCount() == 0) {
return;
}
bool disabled = item->checkState(0) == Qt::Unchecked;
for (int i = 0; i < item->childCount(); ++i) {
item->child(i)->setDisabled(disabled);
}
}
void RecoveryWidget::restoreSession()
{
RestoreManager* manager = mApp->restoreManager();

View File

@ -40,8 +40,6 @@ public:
~RecoveryWidget();
private slots:
void onItemChanged(QTreeWidgetItem* item, int column);
void restoreSession();
void newSession();

View File

@ -382,6 +382,7 @@ QString QT_QUPZILLA_EXPORT qz_escape(const QString &string)
#endif
}
#ifdef QZ_WS_X11
void QT_QUPZILLA_EXPORT* qz_X11Display(const QWidget* widget)
{
Q_UNUSED(widget)
@ -392,6 +393,7 @@ void QT_QUPZILLA_EXPORT* qz_X11Display(const QWidget* widget)
return QX11Info::display();
#endif
}
#endif
QString qz_buildSystem()
{

View File

@ -34,6 +34,7 @@
#include <QClipboard>
#include <QWebSecurityOrigin>
#include <QWebDatabase>
#include <QTimer>
QString SiteInfo::showCertInfo(const QString &string)
{
@ -50,12 +51,13 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
, ui(new Ui::SiteInfo)
, m_certWidget(0)
, m_view(view)
, m_delegate(0)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
ListItemDelegate* delegate = new ListItemDelegate(24, ui->listWidget);
ui->listWidget->setItemDelegate(delegate);
m_delegate = new ListItemDelegate(24, ui->listWidget);
ui->listWidget->setItemDelegate(m_delegate);
ui->listWidget->item(0)->setIcon(QIcon::fromTheme("document-properties", QIcon(":/icons/preferences/document-properties.png")));
ui->listWidget->item(1)->setIcon(QIcon::fromTheme("applications-graphics", QIcon(":/icons/preferences/applications-graphics.png")));
@ -63,8 +65,6 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->listWidget->item(3)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
ui->listWidget->item(0)->setSelected(true);
ui->listWidget->setFixedHeight(delegate->itemHeight());
WebPage* webPage = view->page();
QWebFrame* frame = view->page()->mainFrame();
QString title = view->title();
@ -175,6 +175,8 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->treeImages->sortByColumn(-1);
ui->treeTags->sortByColumn(-1);
QTimer::singleShot(0, this, SLOT(heightChange()));
}
void SiteInfo::imagesCustomContextMenuRequested(const QPoint &p)
@ -245,6 +247,13 @@ void SiteInfo::downloadImage()
}
}
void SiteInfo::heightChange()
{
if (m_delegate) {
ui->listWidget->setFixedHeight(m_delegate->itemHeight());
}
}
void SiteInfo::showImagePreview(QTreeWidgetItem* item)
{
if (!item) {

View File

@ -33,6 +33,7 @@ class QTreeWidgetItem;
class WebView;
class CertificateInfoWidget;
class ListItemDelegate;
class QT_QUPZILLA_EXPORT SiteInfo : public QDialog
{
@ -52,11 +53,13 @@ private slots:
void imagesCustomContextMenuRequested(const QPoint &p);
void copyActionData();
void downloadImage();
void heightChange();
private:
Ui::SiteInfo* ui;
CertificateInfoWidget* m_certWidget;
WebView* m_view;
ListItemDelegate* m_delegate;
QPixmap m_activePixmap;
QUrl m_baseUrl;