Commit 8141ccd0 authored by Christoph Cullmann's avatar Christoph Cullmann

less friends

parent f81ff78a
......@@ -85,7 +85,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
// modified files notification
m_modNotifications = new QCheckBox(
i18n("Wa&rn about files modified by foreign processes"), buttonGroup );
m_modNotifications->setChecked( parent->modNotification );
m_modNotifications->setChecked( parent->modNotificationEnabled() );
m_modNotifications->setWhatsThis( i18n(
"If enabled, when Kate receives focus you will be asked what to do with "
"files that have been modified on the hard disk. If not enabled, you will "
......@@ -334,7 +334,7 @@ void KateConfigDialog::slotApply()
KateDocManager::self()->setDaysMetaInfos(m_daysMetaInfos->value());
cg.writeEntry("Modified Notification", m_modNotifications->isChecked());
m_mainWindow->modNotification = m_modNotifications->isChecked();
m_mainWindow->setModNotificationEnabled (m_modNotifications->isChecked());
// patch document modified warn state
const QList<KTextEditor::Document*> &docs = KateDocManager::self()->documentList ();
......
......@@ -188,7 +188,7 @@ KateMainWindow::KateMainWindow (KConfig *sconfig, const QString &sgroup)
finishRestore ();
fileOpenRecent->loadEntries( KConfigGroup(sconfig, "Recent Files" ) );
m_fileOpenRecent->loadEntries( KConfigGroup(sconfig, "Recent Files" ) );
setAcceptDrops(true);
......@@ -269,9 +269,9 @@ void KateMainWindow::setupActions()
actionCollection()->addAction( KStandardAction::Open, QStringLiteral("file_open"), m_viewManager, SLOT(slotDocumentOpen()) )
->setWhatsThis(i18n("Open an existing document for editing"));
fileOpenRecent = KStandardAction::openRecent (m_viewManager, SLOT(openUrl(QUrl)), this);
actionCollection()->addAction(fileOpenRecent->objectName(), fileOpenRecent);
fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
m_fileOpenRecent = KStandardAction::openRecent (m_viewManager, SLOT(openUrl(QUrl)), this);
actionCollection()->addAction(m_fileOpenRecent->objectName(), m_fileOpenRecent);
m_fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
a = actionCollection()->addAction( QStringLiteral("file_save_all") );
a->setIcon( QIcon::fromTheme(QStringLiteral("document-save-all")) );
......@@ -534,7 +534,7 @@ void KateMainWindow::readOptions ()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
const KConfigGroup generalGroup(config, "General");
modNotification = generalGroup.readEntry("Modified Notification", false);
m_modNotification = generalGroup.readEntry("Modified Notification", false);
KateDocManager::self()->setSaveMetaInfos(generalGroup.readEntry("Save Meta Infos", true));
KateDocManager::self()->setDaysMetaInfos(generalGroup.readEntry("Days Meta Infos", 30));
......@@ -899,7 +899,7 @@ void KateMainWindow::saveProperties(KConfigGroup& config)
}
}
fileOpenRecent->saveEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_fileOpenRecent->saveEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_viewManager->saveViewConfiguration (config);
}
......@@ -915,7 +915,7 @@ void KateMainWindow::readProperties(const KConfigGroup& config)
finishRestore ();
fileOpenRecent->loadEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_fileOpenRecent->loadEntries( KConfigGroup(config.config(), "Recent Files" ) );
m_viewManager->restoreViewConfiguration (config);
}
......@@ -967,7 +967,7 @@ void KateMainWindow::slotUpdateBottomViewBar()
void KateMainWindow::queueModifiedOnDisc(KTextEditor::Document *doc)
{
if (!modNotification) return;
if (!m_modNotification) return;
if (s_modOnHdDialog==0) {
DocVector list;
......
......@@ -70,9 +70,6 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
{
Q_OBJECT
friend class KateConfigDialog;
friend class KateViewManager;
public:
/**
* Construct the window and restore its state from given config if any
......@@ -142,6 +139,11 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
void restoreWindowConfig(const KConfigGroup &);
/**
* save some global options to katerc
*/
void saveOptions();
private:
/**
* Setup actions which pointers are needed already in setupMainWindow
......@@ -157,11 +159,6 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
void readOptions();
/**
* save some global options to katerc
*/
void saveOptions();
void dragEnterEvent( QDragEnterEvent * );
void dropEvent( QDropEvent * );
......@@ -232,6 +229,21 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
inline void showBottomViewBarForView(KTextEditor::View *view) {QWidget *bar; BarState state=m_bottomViewBarMapping.value(view); bar=state.bar(); if (bar) {m_bottomContainerStack->setCurrentWidget(bar); bar->show(); state.setState(true); m_bottomViewBarMapping[view]=state; m_bottomViewBarContainer->show();}}
inline void deleteBottomViewBarForView(KTextEditor::View *view) {QWidget *bar; BarState state=m_bottomViewBarMapping.take(view); bar=state.bar(); if (bar) {if (m_bottomContainerStack->currentWidget()==bar) m_bottomViewBarContainer->hide(); delete bar;}}
bool modNotificationEnabled () const
{
return m_modNotification;
}
void setModNotificationEnabled (bool e)
{
m_modNotification = e;
}
KRecentFilesAction *fileOpenRecent () const
{
return m_fileOpenRecent;
}
//
// KTextEditor::MainWindow interface, get called by invokeMethod from our wrapper object!
//
......@@ -403,7 +415,10 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
static uint uniqueID;
uint myID;
bool modNotification;
/**
* Notify about file modifications from other processes?
*/
bool m_modNotification;
/**
* stacked widget containing the central area, aka view manager, quickopen, ...
......@@ -420,7 +435,7 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa
*/
KateViewManager *m_viewManager;
KRecentFilesAction *fileOpenRecent;
KRecentFilesAction *m_fileOpenRecent;
KActionMenu* documentOpenWith;
......
......@@ -313,7 +313,7 @@ KTextEditor::Document *KateViewManager::openUrl (const QUrl &url,
KTextEditor::Document *doc = KateDocManager::self()->openUrl (url, encoding, isTempFile, docInfo);
if (!doc->url().isEmpty())
m_mainWindow->fileOpenRecent->addUrl( doc->url() );
m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
if (activate)
activateView( doc );
......@@ -330,7 +330,7 @@ KTextEditor::Document *KateViewManager::openUrls (const QList<QUrl> &urls,
foreach (const KTextEditor::Document *doc, docs) {
if (!doc->url().isEmpty()) {
m_mainWindow->fileOpenRecent->addUrl( doc->url() );
m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
}
}
......@@ -345,7 +345,7 @@ KTextEditor::View *KateViewManager::openUrlWithView (const QUrl &url, const QStr
return 0;
if (!doc->url().isEmpty())
m_mainWindow->fileOpenRecent->addUrl( doc->url() );
m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
activateView( doc );
......@@ -418,7 +418,7 @@ void KateViewManager::documentDeleted (KTextEditor::Document *)
void KateViewManager::documentSavedOrUploaded(KTextEditor::Document *doc, bool)
{
if (!doc->url().isEmpty())
m_mainWindow->fileOpenRecent->addUrl( doc->url() );
m_mainWindow->fileOpenRecent()->addUrl( doc->url() );
}
bool KateViewManager::createView ( KTextEditor::Document *doc )
......
......@@ -296,8 +296,6 @@ class KateViewManager : public QSplitter
* current minimal age
*/
qint64 m_minAge;
friend class KateContainer;
};
#endif
......
......@@ -90,14 +90,12 @@ class KateVSStatusBar : public QStatusBar
class KateViewSpace : public QFrame
{
friend class KateVSStatusBar;
Q_OBJECT
public:
explicit KateViewSpace(KateViewManager *, QWidget* parent = 0, const char* name = 0);
~KateViewSpace();
bool isActiveSpace();
void setActive(bool b, bool showled = false);
......@@ -141,4 +139,3 @@ class KateViewSpace : public QFrame
};
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment