+ connect(undoManager, SIGNAL(undoTextChanged(QString)),
+ this, SLOT(slotUndoTextChanged(QString)));
+ connect(undoManager, SIGNAL(jobRecordingStarted(CommandType)),
+ this, SLOT(clearStatusBar()));
+ connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
+ this, SLOT(showCommand(CommandType)));
+
+ GeneralSettings* generalSettings = GeneralSettings::self();
+ const bool firstRun = (generalSettings->version() < 200);
+ if (firstRun) {
+ generalSettings->setViewPropsTimestamp(QDateTime::currentDateTime());
+ }
+
+ setAcceptDrops(true);
+
+ m_tabWidget = new DolphinTabWidget(this);
+ connect(m_tabWidget, SIGNAL(activeViewChanged(DolphinViewContainer*)),
+ this, SLOT(activeViewChanged(DolphinViewContainer*)));
+ connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
+ this, SLOT(tabCountChanged(int)));
+ connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
+ this, SLOT(setUrlAsCaption(KUrl)));
+ setCentralWidget(m_tabWidget);
+
+ setupActions();
+
+ m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
+ connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
+ connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
+
+ m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
+
+ setupDockWidgets();
+
+ setupGUI(Keys | Save | Create | ToolBar);
+ stateChanged("new_file");
+
+ QClipboard* clipboard = QApplication::clipboard();
+ connect(clipboard, SIGNAL(dataChanged()),
+ this, SLOT(updatePasteAction()));
+
+ QAction* showFilterBarAction = actionCollection()->action("show_filter_bar");
+ showFilterBarAction->setChecked(generalSettings->filterBar());
+
+ if (firstRun) {
+ menuBar()->setVisible(false);
+ // Assure a proper default size if Dolphin runs the first time
+ resize(750, 500);
+ }
+
+ const bool showMenu = !menuBar()->isHidden();
+ QAction* showMenuBarAction = actionCollection()->action(KStandardAction::name(KStandardAction::ShowMenubar));
+ showMenuBarAction->setChecked(showMenu); // workaround for bug #171080
+ if (!showMenu) {
+ createControlButton();
+ }