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