Removed old unused kfileiconview.h header, fixed some unrelated missing includes due to that one being removed.
svn path=/trunk/KDE/kdebase/apps/; revision=647244
#include <QPainter>
#include <QPixmap>
+#include <kicon.h>
BookmarkSelector::BookmarkSelector(UrlNavigator* parent, KBookmarkManager* bookmarkManager) :
UrlButton(parent),
m_selectedAddress = QString();
// No bookmark has been found which matches to the given Url. Show
// a generic folder icon as pixmap for indication:
- setIcon(SmallIcon("folder"));
+ setIcon(KIcon("folder"));
}
}
KMenu* popup = new KMenu();
if (item == 0) {
- QAction *action = popup->addAction(SmallIcon("document-new"), i18n("Add Bookmark..."));
+ QAction *action = popup->addAction(KIcon("document-new"), i18n("Add Bookmark..."));
action->setData(addID);
}
else {
- QAction *action = popup->addAction(SmallIcon("document-new"), i18n("Insert Bookmark..."));
+ QAction *action = popup->addAction(KIcon("document-new"), i18n("Insert Bookmark..."));
action->setData(insertID);
- action = popup->addAction(SmallIcon("edit"), i18n("Edit..."));
+ action = popup->addAction(KIcon("edit"), i18n("Edit..."));
action->setData(editID);
- action = popup->addAction(SmallIcon("edit-delete"), i18n("Delete"));
+ action = popup->addAction(KIcon("edit-delete"), i18n("Delete"));
action->setData(deleteID);
}
#include <QApplication>
#include <QClipboard>
#include <QDir>
+#include <Q3ValueList>
DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
KFileItem* fileInfo,
m_newMenu = new DolphinNewMenu(this);\r
KMenu* menu = m_newMenu->menu();\r
menu->setTitle(i18n("Create New..."));\r
- menu->setIcon(SmallIcon("document-new"));\r
+ menu->setIcon(KIcon("document-new"));\r
connect(menu, SIGNAL(aboutToShow()),\r
this, SLOT(updateNewMenu()));\r
\r
#include <QItemSelectionModel>
#include <QMouseEvent>
#include <QVBoxLayout>
+#include <QTimer>
+#include <QScrollBar>
#include <kdirmodel.h>
#include <kfileitemdelegate.h>
#include "urlnavigator.h"
#include "viewproperties.h"
#include "dolphinsettings.h"
+#include "dolphin_generalsettings.h"
DolphinView::DolphinView(DolphinMainWindow* mainWindow,
QWidget* parent,
this, SLOT(updateCutItems()));
m_urlNavigator = new UrlNavigator(DolphinSettings::instance().bookmarkManager(), url, this);
+ m_urlNavigator->setUrlEditable(DolphinSettings::instance().generalSettings()->editableUrl());
+ m_urlNavigator->setHomeUrl(DolphinSettings::instance().generalSettings()->homeUrl());
m_urlNavigator->setShowHiddenFiles(showHiddenFiles);
connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(loadDirectory(const KUrl&)));
int DolphinView::contentsX() const
{
-
return itemView()->horizontalScrollBar()->value();
}
void DolphinView::setUrlEditable(bool editable)
{
- m_urlNavigator->editUrl(editable);
+ m_urlNavigator->setUrlEditable(editable);
}
bool DolphinView::hasSelection() const
#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileitemdelegate.h>
-#include <kfileiconview.h>
#include <kio/job.h>
#include <urlnavigator.h>
// create icon widgets
new QLabel(i18n("Icon:"), grid);
m_iconName = icon;
- m_iconButton = new QPushButton(SmallIcon(m_iconName), QString(), grid);
+ m_iconButton = new QPushButton(KIcon(m_iconName), QString(), grid);
m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(m_iconButton, SIGNAL(clicked()),
this, SLOT(selectIcon()));
m_location = new QLineEdit(url.prettyUrl(), locationBox);
m_location->setMinimumWidth(320);
- QPushButton* selectLocationButton = new QPushButton(SmallIcon("folder"), QString(), locationBox);
+ QPushButton* selectLocationButton = new QPushButton(KIcon("folder"), QString(), locationBox);
selectLocationButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(selectLocationButton, SIGNAL(clicked()),
this, SLOT(selectLocation()));
const QString iconName(KIconDialog::getIcon(K3Icon::Small, K3Icon::FileSystem));
if (!iconName.isEmpty()) {
m_iconName = iconName;
- m_iconButton->setIconSet(SmallIcon(iconName));
+ m_iconButton->setIcon(KIcon(iconName));
}
}
new QLabel(i18n("Location:"), homeUrlBox);
m_homeUrl = new QLineEdit(settings->homeUrl(), homeUrlBox);
- QPushButton* selectHomeUrlButton = new QPushButton(SmallIcon("folder"), QString(), homeUrlBox);
+ QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder"), QString(), homeUrlBox);
connect(selectHomeUrlButton, SIGNAL(clicked()),
this, SLOT(selectHomeUrl()));
#include "urlnavigator.h"
#include "bookmarkselector.h"
-#include "dolphinsettings.h"
-#include "dolphin_generalsettings.h"
#include "protocolcombo.h"
#include "urlnavigatorbutton.h"
*/
void switchView();
- /**
- * Allows to edit the Url of the navigation bar if \a editable
- * is true. If \a editable is false, each part of
- * the Url is presented by a button for a fast navigation.
- */
- void setUrlEditable(bool editable);
-
/**
* Updates the history element with the current file item
* and the contents position.
QLineEdit* m_host;
QLinkedList<UrlNavigatorButton*> m_navButtons;
QWidget* m_filler;
+ QString m_homeUrl;
UrlNavigator* q;
};
m_layout->insertWidget(m_layout->count() - 1, widget);
}
-void UrlNavigator::Private::setUrlEditable(bool editable)
-{
- if (q->isUrlEditable() != editable) {
- m_toggleButton->toggle();
- switchView();
- }
-}
-
void UrlNavigator::Private::slotReturnPressed(const QString& text)
{
// Parts of the following code have been taken
QFontMetrics fontMetrics(font());
setMinimumHeight(fontMetrics.height() + 10);
- if (DolphinSettings::instance().generalSettings()->editableUrl()) {
- d->m_toggleButton->toggle();
- }
-
setLayout(d->m_layout);
d->updateContent();
void UrlNavigator::goHome()
{
- setUrl(DolphinSettings::instance().generalSettings()->homeUrl());
+ if (d->m_homeUrl.isEmpty())
+ setUrl(QDir::homePath());
+ else
+ setUrl(d->m_homeUrl);
}
bool UrlNavigator::isUrlEditable() const
return d->m_toggleButton->isChecked();
}
-void UrlNavigator::editUrl(bool editOrBrowse)
+void UrlNavigator::setUrlEditable(bool editable)
{
- d->setUrlEditable(editOrBrowse);
- if (editOrBrowse) {
- d->m_pathBox->setFocus();
+ if (isUrlEditable() != editable) {
+ d->m_toggleButton->toggle();
+ d->switchView();
}
}
if ( urlStr.length() > 0 && urlStr.at(0) == '~') {
// replace '~' by the home directory
urlStr.remove(0, 1);
- urlStr.insert(0, QDir::home().path());
+ urlStr.insert(0, QDir::homePath());
}
const KUrl transformedUrl(urlStr);
{
QWidget::keyReleaseEvent(event);
if (isUrlEditable() && (event->key() == Qt::Key_Escape)) {
- d->setUrlEditable(false);
+ setUrlEditable(false);
}
}
return d->m_showHiddenFiles;
}
+void UrlNavigator::setHomeUrl(const QString& homeUrl)
+{
+ d->m_homeUrl = homeUrl;
+}
+
#include "urlnavigator.moc"
#include <kurl.h>
#include <QWidget>
-#include <QList>
class KBookmarkManager;
class QMouseEvent;
*/
void goHome();
+ /**
+ * Sets the home URL used by goHome().
+ */
+ void setHomeUrl(const QString& homeUrl);
+
/**
* @return True, if the URL is editable by the user within a line editor.
* If false is returned, each part of the URL is presented by a button
bool isUrlEditable() const;
/**
- * Switches to the edit mode and assures that the keyboard focus
- * is assigned.
+ * Allows to edit the URL of the navigation bar if \a editable
+ * is true, and sets the focus accordingly.
+ * If \a editable is false, each part of
+ * the URL is presented by a button for a fast navigation.
*/
- void editUrl(bool editOrBrowse); //TODO: switch to an enum
+ void setUrlEditable(bool editable);
/**
* Set the URL navigator to the active mode, if \a active
* is true. The active mode is default. Using the URL navigator
* in the inactive mode is useful when having split views,
- * where the inactive view is indicated by a an inactive URL
+ * where the inactive view is indicated by an inactive URL
* navigator visually.
*/
void setActive(bool active);
#include <QDateTime>
#include <QFile>
+#include <QFileInfo>
#include <kcomponentdata.h>
#include <klocale.h>
QLabel* viewModeLabel = new QLabel(i18n("View mode:"), propsBox);
m_viewMode = new QComboBox(propsBox);
- m_viewMode->addItem(SmallIcon("view-icon"), i18n("Icons"));
- m_viewMode->addItem(SmallIcon("fileview-text"), i18n("Details"));
+ m_viewMode->addItem(KIcon("view-icon"), i18n("Icons"));
+ m_viewMode->addItem(KIcon("fileview-text"), i18n("Details"));
const int index = static_cast<int>(m_viewProps->viewMode());
m_viewMode->setCurrentIndex(index);
// initialize 'General' tab
m_generalPage = new GeneralViewSettingsPage(mainWindow, tabWidget);
- tabWidget->addTab(m_generalPage, SmallIcon("view-choose"), i18n("General"));
+ tabWidget->addTab(m_generalPage, KIcon("view-choose"), i18n("General"));
// initialize 'Icons' tab
m_iconsPage = new IconsViewSettingsPage(mainWindow, tabWidget);
- tabWidget->addTab(m_iconsPage, SmallIcon("view-icon"), i18n("Icons"));
+ tabWidget->addTab(m_iconsPage, KIcon("view-icon"), i18n("Icons"));
// initialize 'Details' tab
m_detailsPage = new DetailsViewSettingsPage(mainWindow, tabWidget);
- tabWidget->addTab(m_detailsPage, SmallIcon("fileview-text"), i18n("Details"));
+ tabWidget->addTab(m_detailsPage, KIcon("fileview-text"), i18n("Details"));
topLayout->addWidget(tabWidget, 0, 0 );
}