summaryrefslogtreecommitdiff
path: root/src/rekonqpage
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2010-01-04 18:22:50 +0100
committermatgic78 <matgic78@gmail.com>2010-02-06 11:22:47 +0100
commit0c98fe6a475ec8003590db31eb6c9ab471a4b388 (patch)
tree29382ce0cee064dd1f4922634dcb618afaad0f45 /src/rekonqpage
parentfix bug : closed Tabs replaced favorites when loaded (diff)
downloadrekonq-0c98fe6a475ec8003590db31eb6c9ab471a4b388.tar.xz
tmp commit
Diffstat (limited to 'src/rekonqpage')
-rw-r--r--src/rekonqpage/previewchooser.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/rekonqpage/previewchooser.cpp b/src/rekonqpage/previewchooser.cpp
index eeea9f99..79bdb068 100644
--- a/src/rekonqpage/previewchooser.cpp
+++ b/src/rekonqpage/previewchooser.cpp
@@ -51,7 +51,7 @@ PreviewChooser::PreviewChooser(int previewIndex, QString url)
setModal(true);
setButtons(KDialog::Cancel | KDialog::Apply | KDialog::Ok);
- setDefaultButton(KDialog::Ok);
+ //setDefaultButton(KDialog::Ok);
connect(this, SIGNAL(buttonClicked(KDialog::ButtonCode)), this, SLOT(buttonClicked(KDialog::ButtonCode)));
m_treeView->setUniformRowHeights(true);
@@ -68,18 +68,7 @@ PreviewChooser::PreviewChooser(int previewIndex, QString url)
QLabel *searchLabel = new QLabel(i18n("adress:"));
urlLayout->addWidget(searchLabel);
m_line = new KLineEdit;
- connect(m_line, SIGNAL(textChanged(QString)), SLOT(urlChanged()));
- urlLayout->addWidget(m_line);
- if(url.isEmpty() || url.startsWith("about:"))
- m_line->setText(QString("http://"));
- else
- {
- m_line->setText(url);
- m_line->setSelection(8, m_line->text().size());
- }
-
-
// setup view
QVBoxLayout *vBoxLayout = new QVBoxLayout;
vBoxLayout->setContentsMargins(0, 0, 0, 0);
@@ -94,6 +83,21 @@ PreviewChooser::PreviewChooser(int previewIndex, QString url)
m_treeView->setModel(m_model);
connect(m_treeView, SIGNAL(activated(QModelIndex)), SLOT(setUrl(QModelIndex)));
+
+ connect(m_line, SIGNAL(textChanged(QString)), SLOT(urlChanged()));
+ urlLayout->addWidget(m_line);
+
+ if(url.isEmpty() || url.startsWith("about:"))
+ m_line->setText(QString("http://"));
+ else
+ {
+ m_line->setText(url);
+ m_line->setSelection(8, m_line->text().size());
+ }
+
+ enableButtonApply(false);
+ setFocusProxy(mainWidget);
+ mainWidget->setFocusProxy(m_line);
}
@@ -112,12 +116,12 @@ void PreviewChooser::refreshModel()
{
WebView *view = qobject_cast<WebView *>(mv->webTab(i)->view());
- if(view->url().scheme() == "about")
- continue;
-
- QStandardItem *it = new QStandardItem(Application::icon(view->url()), view->title());
- it->setData(QVariant(view->url()), Qt::ToolTipRole);
- m_model->insertRow(i, it);
+ if(view->url().scheme() != "about")
+ {
+ QStandardItem *it = new QStandardItem(Application::icon(view->url()), view->title());
+ it->setData(QVariant(view->url()), Qt::ToolTipRole);
+ m_model->appendRow(it);
+ }
}
}