#include <QDockWidget>
DolphinMainWindow::DolphinMainWindow(int id) :
- KMainWindow(0),
+ KXmlGuiWindow(0),
m_newMenu(0),
m_splitter(0),
m_activeView(0),
settings.save();
- // TODO: I assume there will be a generic way in KDE 4 to store the docks
- // of the main window. In the meantime they are stored manually:
- QString filename = KStandardDirs::locateLocal("data", KGlobal::mainComponent().componentName());
- filename.append("/panels_layout");
- QFile file(filename);
- if (file.open(QIODevice::WriteOnly)) {
- QByteArray data = saveState();
- file.write(data);
- file.close();
- }
-
- KMainWindow::closeEvent(event);
+ KXmlGuiWindow::closeEvent(event);
}
void DolphinMainWindow::saveProperties(KConfig* config)
break;
case KonqUndoManager::MKDIR:
- statusBar->setMessage(i18n("Created directory."),
+ statusBar->setMessage(i18n("Created folder."),
DolphinStatusBar::OperationCompleted);
break;
}
updateViewActions();
-
- // TODO: I assume there will be a generic way in KDE 4 to restore the docks
- // of the main window. In the meantime they are restored manually (see also
- // DolphinMainWindow::closeEvent() for more details):
- QString filename = KStandardDirs::locateLocal("data", KGlobal::mainComponent().componentName()); filename.append("/panels_layout");
- QFile file(filename);
- if (file.open(QIODevice::ReadOnly)) {
- QByteArray data = file.readAll();
- restoreState(data);
- file.close();
- }
}
void DolphinMainWindow::setupActions()
KToggleAction* columnView = actionCollection()->add<KToggleAction>("columns");
columnView->setText(i18n("Columns"));
columnView->setShortcut(Qt::CTRL | Qt::Key_3);
- columnView->setIcon(KIcon("view-tree"));
+ columnView->setIcon(KIcon("fileview-column"));
connect(columnView, SIGNAL(triggered()), this, SLOT(setColumnView()));
QActionGroup* viewModeGroup = new QActionGroup(this);
QAction* findFile = actionCollection()->addAction("find_file");
findFile->setText(i18n("Find File..."));
- findFile->setShortcut(Qt::Key_F);
+ findFile->setShortcut(Qt::CTRL | Qt::Key_F);
findFile->setIcon(KIcon("file-find"));
connect(findFile, SIGNAL(triggered()), this, SLOT(findFile()));
// after the dock concept has been finalized.
// setup "Information"
- QDockWidget* infoDock = new QDockWidget(i18n("Information"), this);
+ QDockWidget* infoDock = new QDockWidget(i18n("Information"));
infoDock->setObjectName("infoDock");
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
SidebarPage* infoWidget = new InfoSidebarPage(infoDock);
infoDock->setWidget(infoWidget);
-
infoDock->toggleViewAction()->setText(i18n("Show Information Panel"));
actionCollection()->addAction("show_info_panel", infoDock->toggleViewAction());
connectSidebarPage(infoWidget);
// setup "Tree View"
- QDockWidget* treeViewDock = new QDockWidget(i18n("Folders")); // TODO: naming?
+ QDockWidget* treeViewDock = new QDockWidget(i18n("Folders"));
treeViewDock->setObjectName("treeViewDock");
treeViewDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
TreeViewSidebarPage* treeWidget = new TreeViewSidebarPage(treeViewDock);
KFilePlacesView *listView = new KFilePlacesView(placesDock);
placesDock->setWidget(listView);
listView->setModel(DolphinSettings::instance().placesModel());
+
+ placesDock->toggleViewAction()->setText(i18n("Show Places Panel"));
+ actionCollection()->addAction("show_places_panel", placesDock->toggleViewAction());
+
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
connect(listView, SIGNAL(urlChanged(KUrl)),
this, SLOT(changeUrl(KUrl)));
connect(navigator, SIGNAL(historyChanged()),
this, SLOT(slotHistoryChanged()));
}
+
void DolphinMainWindow::connectSidebarPage(SidebarPage* page)
{
connect(page, SIGNAL(changeUrl(KUrl)),
}
DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) :
- KonqUndoManager::UiInterface(mainWin),
- m_mainWin(mainWin)
+ KonqUndoManager::UiInterface(mainWin),
+ m_mainWin(mainWin)
{
Q_ASSERT(m_mainWin != 0);
}
DolphinMainWindow::UndoUiInterface::~UndoUiInterface()
-{}
+{
+}
void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
{