mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
compile++
But crashes while listing folder... svn path=/trunk/playground/utils/dolphin/; revision=606919
This commit is contained in:
parent
2aac5c21bd
commit
9a5f54d83d
|
@ -275,3 +275,4 @@ int BookmarkItem::height(const Q3ListBox* listBox) const
|
|||
return Q3ListBoxPixmap::height(listBox) + 8;
|
||||
}
|
||||
|
||||
#include "bookmarkssidebarpage.moc"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <qcheckbox.h>
|
||||
#include <klocale.h>
|
||||
#include <kdialog.h>
|
||||
#include <kfontcombo.h>
|
||||
#include <qfontcombobox.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <q3grid.h>
|
||||
|
@ -107,7 +107,7 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(QWidget *parent) :
|
|||
textGroup->setMargin(margin);
|
||||
|
||||
new QLabel(i18n("Font family:"), textGroup);
|
||||
m_fontFamilyBox = new KFontCombo(textGroup);
|
||||
m_fontFamilyBox = new QFontComboBox(textGroup);
|
||||
m_fontFamilyBox->setCurrentFont(settings->fontFamily());
|
||||
|
||||
new QLabel(i18n("Font size:"), textGroup);
|
||||
|
@ -144,7 +144,7 @@ void DetailsViewSettingsPage::applySettings()
|
|||
}
|
||||
settings->setIconSize(iconSize);
|
||||
|
||||
settings->setFontFamily(m_fontFamilyBox->currentFont());
|
||||
settings->setFontFamily(m_fontFamilyBox->currentFont().family());
|
||||
settings->setFontSize(m_fontSizeBox->value());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <q3vbox.h>
|
||||
class QCheckBox;
|
||||
class KFontCombo;
|
||||
class QFontComboBox;
|
||||
class QSpinBox;
|
||||
class QComboBox;
|
||||
class QRadioButton;
|
||||
|
@ -58,7 +58,7 @@ private:
|
|||
QRadioButton* m_mediumIconSize;
|
||||
QRadioButton* m_largeIconSize;
|
||||
|
||||
KFontCombo* m_fontFamilyBox;
|
||||
QFontComboBox* m_fontFamilyBox;
|
||||
QSpinBox* m_fontSizeBox;
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <kactioncollection.h>
|
||||
#include <kbookmarkmanager.h>
|
||||
#include <kbookmark.h>
|
||||
#include <ktrader.h>
|
||||
#include <kmimetypetrader.h>
|
||||
#include <klocale.h>
|
||||
#include <krun.h>
|
||||
#include <qdir.h>
|
||||
|
@ -36,7 +36,6 @@
|
|||
#include <kpropertiesdialog.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <assert.h>
|
||||
#include <ksortablevaluelist.h>
|
||||
#include <kio/netaccess.h>
|
||||
#include <kmenu.h>
|
||||
#include <kstdaction.h>
|
||||
|
@ -78,8 +77,6 @@ void DolphinContextMenu::openViewportContextMenu()
|
|||
// (Copyright (C) 2000 David Faure <faure@kde.org>)
|
||||
|
||||
assert(m_fileInfo == 0);
|
||||
const int propertiesID = 100;
|
||||
const int bookmarkID = 101;
|
||||
|
||||
KMenu* popup = new KMenu(m_dolphinView);
|
||||
Dolphin& dolphin = Dolphin::mainWin();
|
||||
|
@ -143,16 +140,16 @@ void DolphinContextMenu::openViewportContextMenu()
|
|||
popup->insertItem(i18n("View Mode"), viewModeMenu);
|
||||
popup->insertSeparator();
|
||||
|
||||
popup->insertItem(i18n("Bookmark this folder"), bookmarkID);
|
||||
QAction *bookmarkAction = popup->addAction(i18n("Bookmark this folder"));
|
||||
popup->insertSeparator();
|
||||
|
||||
popup->insertItem(i18n("Properties..."), propertiesID);
|
||||
QAction *propertiesAction = popup->addAction(i18n("Properties..."));
|
||||
|
||||
int id = popup->exec(m_pos);
|
||||
if (id == propertiesID) {
|
||||
QAction *activatedAction = popup->exec(m_pos);
|
||||
if (activatedAction == propertiesAction) {
|
||||
new KPropertiesDialog(dolphin.activeView()->url());
|
||||
}
|
||||
else if (id == bookmarkID) {
|
||||
else if (activatedAction == bookmarkAction) {
|
||||
const KUrl& url = dolphin.activeView()->url();
|
||||
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add folder as bookmark"),
|
||||
url.fileName(),
|
||||
|
@ -211,28 +208,29 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
// insert 'Bookmark this folder...' entry
|
||||
// urls is a list of selected items, so insert boolmark menu if
|
||||
// urls contains only one item, i.e. no multiple selection made
|
||||
QAction *bookmarkAction = 0;
|
||||
if (m_fileInfo->isDir() && (urls.count() == 1)) {
|
||||
popup->insertItem(i18n("Bookmark this folder"), bookmarkID);
|
||||
bookmarkAction = popup->addAction(i18n("Bookmark this folder"));
|
||||
}
|
||||
|
||||
popup->insertSeparator();
|
||||
|
||||
// Insert 'Open With...' sub menu
|
||||
Q3ValueVector<KService::Ptr> openWithVector;
|
||||
const int openWithID = insertOpenWithItems(popup, openWithVector);
|
||||
const QList<QAction*> openWithActions = insertOpenWithItems(popup, openWithVector);
|
||||
|
||||
// Insert 'Actions' sub menu
|
||||
Q3ValueVector<KDEDesktopMimeType::Service> actionsVector;
|
||||
insertActionItems(popup, actionsVector);
|
||||
const QList<QAction*> serviceActions = insertActionItems(popup, actionsVector);
|
||||
|
||||
// insert 'Properties...' entry
|
||||
popup->insertSeparator();
|
||||
KAction* propertiesAction = dolphin.actionCollection()->action("properties");
|
||||
propertiesAction->plug(popup);
|
||||
|
||||
int id = popup->exec(m_pos);
|
||||
QAction *activatedAction = popup->exec(m_pos);
|
||||
|
||||
if (id == bookmarkID) {
|
||||
if (activatedAction == bookmarkAction) {
|
||||
const KUrl selectedURL(m_fileInfo->url());
|
||||
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add folder as bookmark"),
|
||||
selectedURL.fileName(),
|
||||
|
@ -245,19 +243,21 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
manager->emitChanged(root);
|
||||
}
|
||||
}
|
||||
else if (id >= actionsIDStart) {
|
||||
else if (serviceActions.contains(activatedAction)) {
|
||||
// one of the 'Actions' items has been selected
|
||||
KDEDesktopMimeType::executeService(urls, actionsVector[id - actionsIDStart]);
|
||||
int id = serviceActions.indexOf(activatedAction);
|
||||
KDEDesktopMimeType::executeService(urls, actionsVector[id]);
|
||||
}
|
||||
else if (id >= openWithIDStart) {
|
||||
else if (openWithActions.contains(activatedAction)) {
|
||||
// one of the 'Open With' items has been selected
|
||||
if (id == openWithID) {
|
||||
if (openWithActions.last()==activatedAction) {
|
||||
// the item 'Other...' has been selected
|
||||
KRun::displayOpenWithDialog(urls);
|
||||
KRun::displayOpenWithDialog(urls, m_dolphinView);
|
||||
}
|
||||
else {
|
||||
KService::Ptr servicePtr = openWithVector[id - openWithIDStart];
|
||||
KRun::run(*servicePtr, urls);
|
||||
int id = openWithActions.indexOf(activatedAction);
|
||||
KService::Ptr servicePtr = openWithVector[id];
|
||||
KRun::run(*servicePtr, urls, m_dolphinView);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
popup->deleteLater();
|
||||
}
|
||||
|
||||
int DolphinContextMenu::insertOpenWithItems(KMenu* popup,
|
||||
QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
|
||||
Q3ValueVector<KService::Ptr>& openWithVector)
|
||||
{
|
||||
// Prepare 'Open With' sub menu. Usually a sub menu is created, where all applications
|
||||
|
@ -278,23 +278,22 @@ int DolphinContextMenu::insertOpenWithItems(KMenu* popup,
|
|||
|
||||
bool insertOpenWithItems = true;
|
||||
const QString contextMimeType(m_fileInfo->mimetype());
|
||||
KFileItemListIterator mimeIt(*list);
|
||||
KFileItem* item = 0;
|
||||
while (insertOpenWithItems && ((item = mimeIt.current()) != 0)) {
|
||||
QListIterator<KFileItem*> mimeIt(*list);
|
||||
while (insertOpenWithItems && mimeIt.hasNext()) {
|
||||
KFileItem* item = mimeIt.next();
|
||||
insertOpenWithItems = (contextMimeType == item->mimetype());
|
||||
++mimeIt;
|
||||
}
|
||||
|
||||
int openWithID = -1;
|
||||
QList<QAction*> openWithActions;
|
||||
|
||||
if (insertOpenWithItems) {
|
||||
// fill the 'Open with' sub menu with application types
|
||||
const KMimeType::Ptr mimePtr = KMimeType::findByURL(m_fileInfo->url());
|
||||
KTrader::OfferList offers = KTrader::self()->query(mimePtr->name(),
|
||||
const KMimeType::Ptr mimePtr = KMimeType::findByUrl(m_fileInfo->url());
|
||||
KService::List offers = KMimeTypeTrader::self()->query(mimePtr->name(),
|
||||
"Application",
|
||||
"Type == 'Application'");
|
||||
int index = openWithIDStart;
|
||||
if (offers.count() > 0) {
|
||||
KTrader::OfferList::Iterator it;
|
||||
KService::List::Iterator it;
|
||||
KMenu* openWithMenu = new KMenu();
|
||||
for(it = offers.begin(); it != offers.end(); ++it) {
|
||||
// The offer list from the KTrader returns duplicate
|
||||
|
@ -303,43 +302,42 @@ int DolphinContextMenu::insertOpenWithItems(KMenu* popup,
|
|||
// will be skipped here.
|
||||
const QString appName((*it)->name());
|
||||
if (!containsEntry(openWithMenu, appName)) {
|
||||
openWithMenu->insertItem((*it)->pixmap(K3Icon::Small),
|
||||
appName, index);
|
||||
QAction *action = openWithMenu->addAction((*it)->pixmap(K3Icon::Small),
|
||||
appName);
|
||||
openWithVector.append(*it);
|
||||
++index;
|
||||
openWithActions << action;
|
||||
}
|
||||
}
|
||||
|
||||
openWithMenu->insertSeparator();
|
||||
openWithMenu->insertItem(i18n("&Other..."), index);
|
||||
QAction *action = openWithMenu->addAction(i18n("&Other..."));
|
||||
openWithActions << action;
|
||||
popup->insertItem(i18n("Open With"), openWithMenu);
|
||||
}
|
||||
else {
|
||||
// No applications are registered, hence just offer
|
||||
// a "Open With..." item instead of a sub menu containing
|
||||
// only one entry.
|
||||
popup->insertItem(i18n("Open With..."), openWithIDStart);
|
||||
QAction *action = popup->addAction(i18n("Open With..."));
|
||||
openWithActions << action;
|
||||
}
|
||||
openWithID = index;
|
||||
}
|
||||
else {
|
||||
// At least one of the selected items has a different MIME type. In this case
|
||||
// just show a disabled "Open With..." entry.
|
||||
popup->insertItem(i18n("Open With..."), openWithIDStart);
|
||||
popup->setItemEnabled(openWithIDStart, false);
|
||||
QAction *action = popup->addAction(i18n("Open With..."));
|
||||
action->setEnabled(false);
|
||||
}
|
||||
|
||||
popup->setItemEnabled(openWithID, insertOpenWithItems);
|
||||
|
||||
return openWithID;
|
||||
return openWithActions;
|
||||
}
|
||||
|
||||
void DolphinContextMenu::insertActionItems(KMenu* popup,
|
||||
QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
|
||||
Q3ValueVector<KDEDesktopMimeType::Service>& actionsVector)
|
||||
{
|
||||
KMenu* actionsMenu = new KMenu();
|
||||
|
||||
int actionsIndex = 0;
|
||||
QList<QAction*> serviceActions;
|
||||
|
||||
QStringList dirs = KGlobal::dirs()->findDirs("data", "dolphin/servicemenus/");
|
||||
|
||||
|
@ -364,12 +362,11 @@ void DolphinContextMenu::insertActionItems(KMenu* popup,
|
|||
const KFileItemList* list = m_dolphinView->selectedItems();
|
||||
assert(list != 0);
|
||||
|
||||
KFileItemListIterator mimeIt(*list);
|
||||
KFileItem* item = 0;
|
||||
QListIterator<KFileItem*> mimeIt(*list);
|
||||
insert = true;
|
||||
while (insert && ((item = mimeIt.current()) != 0)) {
|
||||
while (insert && mimeIt.hasNext()) {
|
||||
KFileItem* item = mimeIt.next();
|
||||
insert = !item->isDir();
|
||||
++mimeIt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,17 +377,16 @@ void DolphinContextMenu::insertActionItems(KMenu* popup,
|
|||
const KFileItemList* list = m_dolphinView->selectedItems();
|
||||
assert(list != 0);
|
||||
|
||||
KFileItemListIterator mimeIt(*list);
|
||||
KFileItem* item = 0;
|
||||
QListIterator<KFileItem*> mimeIt(*list);
|
||||
insert = true;
|
||||
while (insert && ((item = mimeIt.current()) != 0)) {
|
||||
const QString mimeType((*mimeIt)->mimetype());
|
||||
while (insert && mimeIt.hasNext()) {
|
||||
KFileItem* item = mimeIt.next();
|
||||
const QString mimeType(item->mimetype());
|
||||
const QString mimeGroup(mimeType.left(mimeType.find('/')));
|
||||
|
||||
insert = (*it == mimeType) ||
|
||||
((*it).right(1) == "*") &&
|
||||
((*it).left((*it).find('/')) == mimeGroup);
|
||||
++mimeIt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,16 +406,15 @@ void DolphinContextMenu::insertActionItems(KMenu* popup,
|
|||
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
|
||||
KDEDesktopMimeType::Service service = (*serviceIt);
|
||||
if (!service.m_strIcon.isEmpty()) {
|
||||
menu->insertItem(SmallIcon(service.m_strIcon),
|
||||
service.m_strName,
|
||||
actionsIDStart + actionsIndex);
|
||||
QAction *action = menu->addAction(SmallIcon(service.m_strIcon),
|
||||
service.m_strName);
|
||||
serviceActions << action;
|
||||
}
|
||||
else {
|
||||
menu->insertItem(service.m_strName,
|
||||
actionsIDStart + actionsIndex);
|
||||
QAction *action = menu->addAction(service.m_strName);
|
||||
serviceActions << action;
|
||||
}
|
||||
actionsVector.append(service);
|
||||
++actionsIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -441,12 +436,16 @@ void DolphinContextMenu::insertActionItems(KMenu* popup,
|
|||
// The item is an action, hence show the action in the root menu.
|
||||
const int id = actionsMenu->idAt(0);
|
||||
const QString text(actionsMenu->text(id));
|
||||
const QIcon* iconSet = actionsMenu->iconSet(id);
|
||||
if (iconSet == 0) {
|
||||
popup->insertItem(text, id);
|
||||
QIcon iconSet = actionsMenu->iconSet(id);
|
||||
if (iconSet.isNull()) {
|
||||
QAction *action = popup->addAction(text);
|
||||
serviceActions.clear();
|
||||
serviceActions << action;
|
||||
}
|
||||
else {
|
||||
popup->insertItem(*iconSet, text, id);
|
||||
QAction *action = popup->addAction(iconSet, text);
|
||||
serviceActions.clear();
|
||||
serviceActions << action;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -459,6 +458,8 @@ void DolphinContextMenu::insertActionItems(KMenu* popup,
|
|||
else {
|
||||
popup->insertItem(i18n("Actions"), actionsMenu);
|
||||
}
|
||||
|
||||
return serviceActions;
|
||||
}
|
||||
|
||||
bool DolphinContextMenu::containsEntry(const KMenu* menu,
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <qpoint.h>
|
||||
#include <qstring.h>
|
||||
#include <q3valuelist.h>
|
||||
#include <kmountpoint.h>
|
||||
#include <q3valuevector.h>
|
||||
#include <kservice.h>
|
||||
#include <kpropertiesdialog.h>
|
||||
|
@ -84,7 +83,7 @@ private:
|
|||
* All succeeding identifiers have an increased value of 1
|
||||
* to the predecessor.
|
||||
*/
|
||||
int insertOpenWithItems(KMenu* popup,
|
||||
QList<QAction*> insertOpenWithItems(KMenu* popup,
|
||||
Q3ValueVector<KService::Ptr>& openWithVector);
|
||||
|
||||
/**
|
||||
|
@ -94,7 +93,7 @@ private:
|
|||
* @param openWithVector Output parameter which contains all 'Actions...'
|
||||
* services.
|
||||
*/
|
||||
void insertActionItems(KMenu* popup,
|
||||
QList<QAction*> insertActionItems(KMenu* popup,
|
||||
Q3ValueVector<KDEDesktopMimeType::Service>& actionsVector);
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "dolphinsettingsdialog.h"
|
||||
#include <klocale.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kicon.h>
|
||||
#include "generalsettingspage.h"
|
||||
#include "viewsettingspage.h"
|
||||
#include "bookmarkssettingspage.h"
|
||||
|
@ -29,43 +29,36 @@
|
|||
#include <Q3Frame>
|
||||
|
||||
DolphinSettingsDialog::DolphinSettingsDialog() :
|
||||
KDialogBase(IconList, i18n("Dolphin Preferences"),
|
||||
Ok|Apply|Cancel, Ok)
|
||||
KPageDialog()
|
||||
{
|
||||
KIconLoader iconLoader;
|
||||
QFrame* generalSettingsFrame = addPage(i18n("General"), 0,
|
||||
iconLoader.loadIcon("exec",
|
||||
K3Icon::NoGroup,
|
||||
K3Icon::SizeMedium));
|
||||
m_generalSettingsPage = new GeneralSettingsPage(generalSettingsFrame);
|
||||
setFaceType( List);
|
||||
setCaption(i18n("Dolphin Preferences"));
|
||||
setButtons(Ok|Apply|Cancel);
|
||||
setDefaultButton(Ok);
|
||||
|
||||
QFrame* viewSettingsFrame = addPage(i18n("View Modes"), 0,
|
||||
iconLoader.loadIcon("view_choose",
|
||||
K3Icon::NoGroup,
|
||||
K3Icon::SizeMedium));
|
||||
m_viewSettingsPage = new ViewSettingsPage(viewSettingsFrame);
|
||||
m_generalSettingsPage = new GeneralSettingsPage(this);
|
||||
KPageWidgetItem* generalSettingsFrame = addPage(m_generalSettingsPage, i18n("General"));
|
||||
generalSettingsFrame->setIcon(KIcon("exec"));
|
||||
|
||||
QFrame* bookmarksSettingsFrame = addPage(i18n("Bookmarks"), 0,
|
||||
iconLoader.loadIcon("bookmark",
|
||||
K3Icon::NoGroup,
|
||||
K3Icon::SizeMedium));
|
||||
m_bookmarksSettingsPage = new BookmarksSettingsPage(bookmarksSettingsFrame);
|
||||
m_viewSettingsPage = new ViewSettingsPage(this);
|
||||
KPageWidgetItem* viewSettingsFrame = addPage(m_viewSettingsPage, i18n("View Modes"));
|
||||
viewSettingsFrame->setIcon(KIcon("view_choose"));
|
||||
|
||||
m_bookmarksSettingsPage = new BookmarksSettingsPage(this);
|
||||
KPageWidgetItem* bookmarksSettingsFrame = addPage(m_bookmarksSettingsPage, i18n("Bookmarks"));
|
||||
bookmarksSettingsFrame->setIcon(KIcon("bookmark"));
|
||||
}
|
||||
|
||||
DolphinSettingsDialog::~DolphinSettingsDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::slotOk()
|
||||
void DolphinSettingsDialog::slotButtonClicked(int button)
|
||||
{
|
||||
if (button==Ok || button==Apply) {
|
||||
applySettings();
|
||||
KDialogBase::slotOk();
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::slotApply()
|
||||
{
|
||||
applySettings();
|
||||
KDialogBase::slotApply();
|
||||
KPageDialog::slotButtonClicked(button);
|
||||
}
|
||||
|
||||
void DolphinSettingsDialog::applySettings()
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef DOLPHINSETTINGSDIALOG_H
|
||||
#define DOLPHINSETTINGSDIALOG_H
|
||||
|
||||
#include <kdialog.h>
|
||||
#include <kpagedialog.h>
|
||||
class GeneralSettingsPage;
|
||||
class ViewSettingsPage;
|
||||
class BookmarksSettingsPage;
|
||||
|
@ -34,7 +34,7 @@ class BookmarksSettingsPage;
|
|||
*
|
||||
* @author Peter Penz <peter.penz@gmx.at>
|
||||
*/
|
||||
class DolphinSettingsDialog : public KDialog {
|
||||
class DolphinSettingsDialog : public KPageDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
@ -42,8 +42,7 @@ public:
|
|||
virtual ~DolphinSettingsDialog();
|
||||
|
||||
protected slots:
|
||||
virtual void slotOk();
|
||||
virtual void slotApply();
|
||||
virtual void slotButtonClicked(int button);
|
||||
|
||||
private:
|
||||
GeneralSettingsPage* m_generalSettingsPage;
|
||||
|
|
|
@ -47,27 +47,36 @@ KBookmark EditBookmarkDialog::getBookmark(const QString& title,
|
|||
return dialog.m_bookmark;
|
||||
}
|
||||
|
||||
void EditBookmarkDialog::slotOk()
|
||||
void EditBookmarkDialog::slotButtonClicked(int button)
|
||||
{
|
||||
if (button==Ok) {
|
||||
m_bookmark = KBookmark::standaloneBookmark(m_name->text(),
|
||||
KUrl(m_location->text()),
|
||||
m_iconName);
|
||||
}
|
||||
|
||||
KDialogBase::slotOk();
|
||||
KDialog::slotButtonClicked(button);
|
||||
}
|
||||
|
||||
EditBookmarkDialog::EditBookmarkDialog(const QString& title,
|
||||
const QString& name,
|
||||
const KUrl& url,
|
||||
const QString& icon) :
|
||||
KDialogBase(Plain, title, Ok|Cancel, Ok),
|
||||
KDialog(),
|
||||
m_iconButton(0),
|
||||
m_name(0),
|
||||
m_location(0)
|
||||
{
|
||||
Q3VBoxLayout* topLayout = new Q3VBoxLayout(plainPage(), 0, spacingHint());
|
||||
setCaption(title);
|
||||
setButtons(Ok|Cancel);
|
||||
setDefaultButton(Ok);
|
||||
|
||||
Q3Grid* grid = new Q3Grid(2, Qt::Horizontal, plainPage());
|
||||
QWidget *page = new QWidget(this);
|
||||
setMainWidget(page);
|
||||
|
||||
Q3VBoxLayout* topLayout = new Q3VBoxLayout(page, 0, spacingHint());
|
||||
|
||||
Q3Grid* grid = new Q3Grid(2, Qt::Horizontal, page);
|
||||
grid->setSpacing(spacingHint());
|
||||
|
||||
// create icon widgets
|
||||
|
@ -113,7 +122,7 @@ void EditBookmarkDialog::selectIcon()
|
|||
void EditBookmarkDialog::selectLocation()
|
||||
{
|
||||
const QString location(m_location->text());
|
||||
KUrl url(KFileDialog::getExistingURL(location));
|
||||
KUrl url(KFileDialog::getExistingUrl(location));
|
||||
if (!url.isEmpty()) {
|
||||
m_location->setText(url.prettyUrl());
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define EDITBOOKMARKDIALOG_H
|
||||
|
||||
#include <kbookmark.h>
|
||||
#include <kdialogbase.h>
|
||||
#include <kdialog.h>
|
||||
|
||||
class Bookmark;
|
||||
class QLineEdit;
|
||||
|
@ -41,7 +41,7 @@ class QPushButton;
|
|||
* }
|
||||
* \endcode
|
||||
*/
|
||||
class EditBookmarkDialog : public KDialogBase
|
||||
class EditBookmarkDialog : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
const QString& icon);
|
||||
|
||||
protected slots:
|
||||
virtual void slotOk();
|
||||
virtual void slotButtonClicked(int button);
|
||||
|
||||
protected:
|
||||
EditBookmarkDialog(const QString& title,
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <qradiobutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kfontcombo.h>
|
||||
#include <qfontcombobox.h>
|
||||
#include <kdialog.h>
|
||||
#include <klocale.h>
|
||||
#include <assert.h>
|
||||
|
@ -117,7 +117,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
|
|||
textGroup->setMargin(margin);
|
||||
|
||||
new QLabel(i18n("Font family:"), textGroup);
|
||||
m_fontFamilyBox = new KFontCombo(textGroup);
|
||||
m_fontFamilyBox = new QFontComboBox(textGroup);
|
||||
m_fontFamilyBox->setCurrentFont(settings->fontFamily());
|
||||
|
||||
new QLabel(i18n("Font size:"), textGroup);
|
||||
|
@ -138,7 +138,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
|
|||
gridGroup->setSizePolicy(sizePolicy);
|
||||
gridGroup->setMargin(margin);
|
||||
|
||||
const bool leftToRightArrangement = (settings->arrangement() == Q3IconView::LeftToRight);
|
||||
const bool leftToRightArrangement = (settings->arrangement() == "LeftToRight");
|
||||
new QLabel(i18n("Arrangement:"), gridGroup);
|
||||
m_arrangementBox = new QComboBox(gridGroup);
|
||||
m_arrangementBox->insertItem(i18n("Left to right"));
|
||||
|
@ -189,7 +189,7 @@ void IconsViewSettingsPage::applySettings()
|
|||
settings->setArrangement(arrangement);
|
||||
DolphinSettings::instance().calculateGridSize(m_textWidthBox->currentItem());
|
||||
|
||||
settings->setFontFamily(m_fontFamilyBox->currentFont());
|
||||
settings->setFontFamily(m_fontFamilyBox->currentFont().family());
|
||||
settings->setFontSize(fontSize);
|
||||
settings->setNumberOfTexlines(m_textlinesCountBox->value());
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class QComboBox;
|
|||
class QCheckBox;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
class KFontCombo;
|
||||
class QFontComboBox;
|
||||
class PixmapViewer;
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ private:
|
|||
PixmapViewer* m_previewSizeViewer;
|
||||
QComboBox* m_textWidthBox;
|
||||
QComboBox* m_gridSpacingBox;
|
||||
KFontCombo* m_fontFamilyBox;
|
||||
QFontComboBox* m_fontFamilyBox;
|
||||
QSpinBox* m_fontSizeBox;
|
||||
QSpinBox* m_textlinesCountBox;
|
||||
QComboBox* m_arrangementBox;
|
||||
|
|
|
@ -246,7 +246,7 @@ bool InfoSidebarPage::applyBookmark()
|
|||
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
|
||||
KBookmark bookmark = root.first();
|
||||
while (!bookmark.isNull()) {
|
||||
if (m_shownURL.equals(bookmark.url(), true)) {
|
||||
if (m_shownURL.equals(bookmark.url(), KUrl::CompareWithoutTrailingSlash)) {
|
||||
QString text("<b>");
|
||||
text.append(bookmark.text());
|
||||
text.append("</b>");
|
||||
|
@ -457,12 +457,11 @@ void InfoSidebarPage::insertActions()
|
|||
if ((*it) == "all/allfiles") {
|
||||
// The service type is valid for all files, but not for directories.
|
||||
// Check whether the selected items only consist of files...
|
||||
KFileItemListIterator mimeIt(*itemList);
|
||||
KFileItem* item = 0;
|
||||
QListIterator<KFileItem*> mimeIt(*itemList);
|
||||
insert = true;
|
||||
while (insert && ((item = mimeIt.current()) != 0)) {
|
||||
while (insert && mimeIt.hasNext()) {
|
||||
KFileItem* item = mimeIt.next();
|
||||
insert = !item->isDir();
|
||||
++mimeIt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,17 +469,16 @@ void InfoSidebarPage::insertActions()
|
|||
// Check whether the MIME types of all selected files match
|
||||
// to the mimetype of the service action. As soon as one MIME
|
||||
// type does not match, no service menu is shown at all.
|
||||
KFileItemListIterator mimeIt(*itemList);
|
||||
KFileItem* item = 0;
|
||||
QListIterator<KFileItem*> mimeIt(*itemList);
|
||||
insert = true;
|
||||
while (insert && ((item = mimeIt.current()) != 0)) {
|
||||
const QString mimeType((*mimeIt)->mimetype());
|
||||
while (insert && mimeIt.hasNext()) {
|
||||
KFileItem* item = mimeIt.next();
|
||||
const QString mimeType(item->mimetype());
|
||||
const QString mimeGroup(mimeType.left(mimeType.find('/')));
|
||||
|
||||
insert = (*it == mimeType) ||
|
||||
((*it).right(1) == "*") &&
|
||||
((*it).left((*it).find('/')) == mimeGroup);
|
||||
++mimeIt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -566,7 +564,7 @@ void ServiceButton::drawButton(QPainter* painter)
|
|||
}
|
||||
|
||||
// draw button background
|
||||
painter->setPen(NoPen);
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->setBrush(backgroundColor);
|
||||
painter->drawRect(0, 0, buttonWidth, buttonHeight);
|
||||
|
||||
|
@ -632,3 +630,4 @@ void ServiceButton::slotReleased()
|
|||
emit requestServiceStart(m_index);
|
||||
}
|
||||
|
||||
#include "infosidebarpage.moc"
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#include <Q3PtrList>
|
||||
|
||||
#include <kurl.h>
|
||||
#include <ksortablevaluelist.h>
|
||||
#include <kmimetype.h>
|
||||
#include <kdedesktopmimetype.h>
|
||||
|
||||
namespace KIO {
|
||||
class Job;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <kdebug.h>
|
||||
#include <kprotocolinfo.h>
|
||||
#include <kprotocolmanager.h>
|
||||
|
||||
#include "protocolcombo.h"
|
||||
|
||||
|
@ -42,7 +43,7 @@ ProtocolCombo::ProtocolCombo(const QString& protocol, URLNavigator* parent)
|
|||
// if a protocol is appropriate for use in a file manager. hum!
|
||||
//if (KProtocolInfo::capabilities(*it).findIndex("filemanager") == -1)
|
||||
if (KProtocolInfo::protocolClass(*it) == ":" ||
|
||||
!KProtocolInfo::supportsWriting(*it))
|
||||
!KProtocolManager::supportsWriting(*it))
|
||||
{
|
||||
//kDebug() << "!!! removing " << *it << endl;
|
||||
QStringList::iterator tempIt = it;
|
||||
|
|
|
@ -29,19 +29,25 @@
|
|||
#include <klineedit.h>
|
||||
|
||||
RenameDialog::RenameDialog(const KUrl::List& items) :
|
||||
KDialogBase(Plain, i18n("Rename Items"),
|
||||
Ok|Cancel, Ok)
|
||||
KDialog()
|
||||
{
|
||||
setButtonOK(KGuiItem(i18n("Rename"), "apply"));
|
||||
setCaption(i18n("Rename Items"));
|
||||
setButtons(Ok|Cancel);
|
||||
setDefaultButton(Ok);
|
||||
|
||||
Q3VBoxLayout* topLayout = new Q3VBoxLayout(plainPage(), 0, spacingHint());
|
||||
setButtonGuiItem(Ok, KGuiItem(i18n("Rename"), "apply"));
|
||||
|
||||
QWidget *page = new QWidget(this);
|
||||
setMainWidget(page);
|
||||
|
||||
Q3VBoxLayout* topLayout = new Q3VBoxLayout(page, 0, spacingHint());
|
||||
topLayout->setMargin(KDialog::marginHint());
|
||||
|
||||
const int itemCount = items.count();
|
||||
QLabel* editLabel = new QLabel(i18n("Rename the %1 selected items to:").arg(itemCount),
|
||||
plainPage());
|
||||
page);
|
||||
|
||||
m_lineEdit = new KLineEdit(plainPage());
|
||||
m_lineEdit = new KLineEdit(page);
|
||||
m_newName = i18n("New name #");
|
||||
assert(itemCount > 1);
|
||||
QString postfix(items[0].prettyUrl().section('.',1));
|
||||
|
@ -67,7 +73,7 @@ RenameDialog::RenameDialog(const KUrl::List& items) :
|
|||
m_lineEdit->setSelection(0, selectionLength - 1);
|
||||
m_lineEdit->setFocus();
|
||||
|
||||
QLabel* infoLabel = new QLabel(i18n("(# will be replaced by ascending numbers)"), plainPage());
|
||||
QLabel* infoLabel = new QLabel(i18n("(# will be replaced by ascending numbers)"), page);
|
||||
|
||||
topLayout->addWidget(editLabel);
|
||||
topLayout->addWidget(m_lineEdit);
|
||||
|
@ -78,14 +84,16 @@ RenameDialog::~RenameDialog()
|
|||
{
|
||||
}
|
||||
|
||||
void RenameDialog::slotOk()
|
||||
void RenameDialog::slotButtonClicked(int button)
|
||||
{
|
||||
if (button==Ok) {
|
||||
m_newName = m_lineEdit->text();
|
||||
if (m_newName.contains('#') != 1) {
|
||||
m_newName.truncate(0);
|
||||
}
|
||||
}
|
||||
|
||||
KDialogBase::slotOk();
|
||||
KDialog::slotButtonClicked(button);
|
||||
}
|
||||
|
||||
#include "renamedialog.moc"
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
const QString& newName() const { return m_newName; }
|
||||
|
||||
protected slots:
|
||||
virtual void slotOk();
|
||||
virtual void slotButtonClicked(int button);
|
||||
|
||||
private:
|
||||
KLineEdit* m_lineEdit;
|
||||
|
|
|
@ -108,3 +108,5 @@ int Sidebar::indexForName(const QString& name) const
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "sidebar.moc"
|
||||
|
|
|
@ -34,3 +34,5 @@ SidebarPage::~SidebarPage()
|
|||
void SidebarPage::activeViewChanged()
|
||||
{
|
||||
}
|
||||
|
||||
#include "sidebarpage.moc"
|
||||
|
|
|
@ -217,3 +217,5 @@ QColor StatusBarMessageLabel::mixColors(const QColor& c1,
|
|||
const int blue = (c1.blue() * recip + c2.blue() * percent) / 100;
|
||||
return QColor(red, green, blue);
|
||||
}
|
||||
|
||||
#include "statusbarmessagelabel.moc"
|
||||
|
|
|
@ -94,3 +94,5 @@ QColor URLButton::mixColors(const QColor& c1,
|
|||
const int blue = (c1.blue() + c2.blue()) / 2;
|
||||
return QColor(red, green, blue);
|
||||
}
|
||||
|
||||
#include "urlbutton.moc"
|
||||
|
|
|
@ -385,3 +385,5 @@ bool URLNavigatorButton::isTextClipped() const
|
|||
QFontMetrics fontMetrics(font());
|
||||
return fontMetrics.width(text()) >= availableWidth;
|
||||
}
|
||||
|
||||
#include "urlnavigatorbutton.moc"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <qlabel.h>
|
||||
//Added by qt3to4:
|
||||
#include <Q3VBoxLayout>
|
||||
#include <kdialogbase.h>
|
||||
#include <kdialog.h>
|
||||
#include <klocale.h>
|
||||
#include "iconsviewsettingspage.h"
|
||||
#include "detailsviewsettingspage.h"
|
||||
|
|
Loading…
Reference in New Issue
Block a user