]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Merged very early alpha-version of Dolphin 2.0
[dolphin.git] / src / dolphinmainwindow.cpp
index 3b5f493ca903be55baa485d6f20013c28567a1af..a379f31b095825bf354e12f6b7935c64de401751 100644 (file)
@@ -42,7 +42,6 @@
 #include "statusbar/dolphinstatusbar.h"
 #include "views/dolphinviewactionhandler.h"
 #include "views/dolphinremoteencoding.h"
-#include "views/draganddrophelper.h"
 #include "views/viewproperties.h"
 
 #ifndef Q_OS_WIN
@@ -161,8 +160,8 @@ DolphinMainWindow::DolphinMainWindow() :
             this, SLOT(showCommand(CommandType)));
     connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(const QString&)),
             this, SLOT(showErrorMessage(const QString&)));
-    connect(&DragAndDropHelper::instance(), SIGNAL(errorMessage(const QString&)),
-            this, SLOT(showErrorMessage(const QString&)));
+    //connect(&DragAndDropHelper::instance(), SIGNAL(errorMessage(const QString&)),
+    //        this, SLOT(showErrorMessage(const QString&)));
 
     const DolphinSettings& settings = DolphinSettings::instance();
 
@@ -725,14 +724,14 @@ void DolphinMainWindow::readProperties(const KConfigGroup& group)
 
 void DolphinMainWindow::updateNewMenu()
 {
-    m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->showHiddenFiles());
+    m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
     m_newFileMenu->checkUpToDate();
     m_newFileMenu->setPopupFiles(activeViewContainer()->url());
 }
 
 void DolphinMainWindow::createDirectory()
 {
-    m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->showHiddenFiles());
+    m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
     m_newFileMenu->setPopupFiles(activeViewContainer()->url());
     m_newFileMenu->createDirectory();
 }
@@ -1313,7 +1312,8 @@ void DolphinMainWindow::tabDropEvent(int tab, QDropEvent* event)
     if (!urls.isEmpty() && tab != -1) {
         const ViewTab& viewTab = m_viewTab[tab];
         const KUrl destPath = viewTab.isPrimaryViewActive ? viewTab.primaryView->url() : viewTab.secondaryView->url();
-        DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
+        Q_UNUSED(destPath);
+        //DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
     }
 }
 
@@ -1479,6 +1479,8 @@ void DolphinMainWindow::updateToolBarMenu()
     connect(menu, SIGNAL(aboutToHide()), helpMenu, SLOT(deleteLater()));
     helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::HelpContents)));
     helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::WhatsThis)));
+    helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::ReportBug)));
+    helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::SwitchApplicationLanguage)));
     helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutApp)));
     helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutKDE)));
     menu->addMenu(helpMenu);
@@ -1801,7 +1803,7 @@ void DolphinMainWindow::setupDockWidgets()
 
     connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
     connect(terminalDock, SIGNAL(visibilityChanged(bool)),
-            terminalPanel, SLOT(visibilityChanged(bool)));
+            terminalPanel, SLOT(dockVisibilityChanged()));
 
     QAction* terminalAction = terminalDock->toggleViewAction();
     terminalAction->setShortcut(Qt::Key_F4);
@@ -2176,7 +2178,7 @@ void DolphinMainWindow::createSecondaryView(int tabIndex)
     const int newWidth = (m_viewTab[tabIndex].primaryView->width() - splitter->handleWidth()) / 2;
 
     const DolphinView* view = m_viewTab[tabIndex].primaryView->view();
-    m_viewTab[tabIndex].secondaryView = createViewContainer(view->rootUrl(), 0);
+    m_viewTab[tabIndex].secondaryView = createViewContainer(view->url(), 0);
     splitter->addWidget(m_viewTab[tabIndex].secondaryView);
     splitter->setSizes(QList<int>() << newWidth << newWidth);
     connectViewSignals(m_viewTab[tabIndex].secondaryView);
@@ -2267,20 +2269,18 @@ void ToolBarMenu::showEvent(QShowEvent* event)
     // Assure that the menu is not shown outside the screen boundaries and
     // that it does not overlap with the parent button.
     const QRect screen = QApplication::desktop()->screenGeometry(QCursor::pos());
-    if (pos.x() < 0) {
-        pos.rx() = 0;
-    } else if (pos.x() + width() >= screen.width()) {
-        pos.rx() = screen.width() - width();
+    if (pos.x() < screen.x()) {
+        pos.rx() = screen.x();
+    } else if (pos.x() + width() > screen.x() + screen.width()) {
+        pos.rx() = screen.x() + screen.width() - width();
     }
 
-    if (pos.y() < 0) {
-        pos.ry() = 0;
-    } else if (pos.y() + height() >= screen.height()) {
+    if (pos.y() < screen.y()) {
+        pos.ry() = screen.y();
+    } else if (pos.y() + height() > screen.y() + screen.height()) {
         pos.ry() = button->mapToGlobal(QPoint(0, 0)).y() - height();
     }
 
-    pos += screen.topLeft();
-
     move(pos);
 }