2000-10-26 03:52:56 +00:00
|
|
|
/* This file is part of the KDE project
|
|
|
|
Copyright (C) 2000 David Faure <faure@kde.org>
|
2003-01-21 16:16:53 +00:00
|
|
|
Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
|
2000-10-26 03:52:56 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License version 2 as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2003-09-14 18:07:31 +00:00
|
|
|
#include "toplevel.h"
|
|
|
|
|
2003-09-23 15:07:14 +00:00
|
|
|
#include "bookmarkinfo.h"
|
2003-09-14 18:07:31 +00:00
|
|
|
#include "listview.h"
|
|
|
|
#include "actionsimpl.h"
|
|
|
|
#include "dcop.h"
|
|
|
|
#include "search.h"
|
|
|
|
#include "exporters.h"
|
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <stdlib.h>
|
2002-09-17 17:16:23 +00:00
|
|
|
|
2003-03-01 11:04:06 +00:00
|
|
|
#include <qclipboard.h>
|
|
|
|
#include <qsplitter.h>
|
2003-06-07 19:52:21 +00:00
|
|
|
#include <qlayout.h>
|
2003-06-09 11:49:25 +00:00
|
|
|
#include <qlabel.h>
|
2003-06-07 19:52:21 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <klocale.h>
|
2000-10-26 03:52:56 +00:00
|
|
|
#include <kdebug.h>
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-02-10 14:32:32 +00:00
|
|
|
#include <kapplication.h>
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <kstdaction.h>
|
2003-02-10 14:32:32 +00:00
|
|
|
#include <kaction.h>
|
2003-02-19 00:11:04 +00:00
|
|
|
#include <dcopclient.h>
|
2003-03-25 22:00:49 +00:00
|
|
|
#include <dcopref.h>
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-02-10 14:32:32 +00:00
|
|
|
#include <kkeydialog.h>
|
|
|
|
#include <kedittoolbar.h>
|
2003-03-25 22:00:49 +00:00
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <klineedit.h>
|
|
|
|
#include <kfiledialog.h>
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <kbookmarkdrag.h>
|
|
|
|
#include <kbookmarkmanager.h>
|
2002-04-29 15:19:35 +00:00
|
|
|
|
2003-09-14 20:17:45 +00:00
|
|
|
bool KEBApp::queryClose() {
|
|
|
|
return ActionsImpl::self()->queryClose();
|
|
|
|
}
|
|
|
|
|
2003-03-22 16:52:02 +00:00
|
|
|
CmdHistory* CmdHistory::s_self = 0;
|
|
|
|
|
|
|
|
CmdHistory::CmdHistory(KActionCollection *collection) : m_commandHistory(collection) {
|
|
|
|
connect(&m_commandHistory, SIGNAL( commandExecuted() ),
|
|
|
|
SLOT( slotCommandExecuted() ));
|
|
|
|
connect(&m_commandHistory, SIGNAL( documentRestored() ),
|
|
|
|
SLOT( slotDocumentRestored() ));
|
|
|
|
assert(!s_self);
|
|
|
|
s_self = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
CmdHistory* CmdHistory::self() {
|
|
|
|
assert(s_self);
|
|
|
|
return s_self;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::slotCommandExecuted() {
|
2003-03-22 20:27:55 +00:00
|
|
|
KEBApp::self()->notifyCommandExecuted();
|
2003-03-22 16:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::slotDocumentRestored() {
|
|
|
|
// called when undoing the very first action - or the first one after
|
|
|
|
// saving. the "document" is set to "non modified" in that case.
|
|
|
|
if (!KEBApp::self()->readonly()) {
|
|
|
|
KEBApp::self()->setModifiedFlag(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::notifyDocSaved() {
|
|
|
|
m_commandHistory.documentSaved();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::didCommand(KCommand *cmd) {
|
2003-08-25 20:56:36 +00:00
|
|
|
if (!cmd)
|
|
|
|
return;
|
|
|
|
m_commandHistory.addCommand(cmd, false);
|
2003-09-14 17:28:52 +00:00
|
|
|
CmdHistory::slotCommandExecuted();
|
2003-03-22 16:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::addCommand(KCommand *cmd) {
|
2003-08-25 20:56:36 +00:00
|
|
|
if (!cmd)
|
|
|
|
return;
|
|
|
|
m_commandHistory.addCommand(cmd);
|
2003-03-22 16:52:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CmdHistory::clearHistory() {
|
|
|
|
m_commandHistory.clear();
|
|
|
|
}
|
|
|
|
|
2003-04-19 08:32:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
|
2003-03-22 19:50:23 +00:00
|
|
|
CurrentMgr *CurrentMgr::s_mgr = 0;
|
|
|
|
|
2003-06-15 22:32:39 +00:00
|
|
|
KBookmark CurrentMgr::bookmarkAt(const QString &a) {
|
2003-03-22 19:50:23 +00:00
|
|
|
return self()->mgr()->findByAddress(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CurrentMgr::managerSave() { return mgr()->save(); }
|
|
|
|
void CurrentMgr::saveAs(const QString &fileName) { mgr()->saveAs(fileName); }
|
|
|
|
void CurrentMgr::setUpdate(bool update) { mgr()->setUpdate(update); }
|
2003-06-15 22:46:00 +00:00
|
|
|
QString CurrentMgr::path() const { return mgr()->path(); }
|
|
|
|
bool CurrentMgr::showNSBookmarks() const { return mgr()->showNSBookmarks(); }
|
2003-03-22 19:50:23 +00:00
|
|
|
|
2003-03-23 04:11:19 +00:00
|
|
|
void CurrentMgr::createManager(const QString &filename) {
|
2003-03-22 19:50:23 +00:00
|
|
|
if (m_mgr) {
|
2003-03-22 20:27:55 +00:00
|
|
|
disconnect(m_mgr, 0, 0, 0);
|
|
|
|
// still todo - delete old m_mgr
|
2003-03-22 19:50:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
m_mgr = KBookmarkManager::managerForFile(filename, false);
|
|
|
|
|
2003-03-22 20:27:55 +00:00
|
|
|
connect(m_mgr, SIGNAL( changed(const QString &, const QString &) ),
|
|
|
|
SLOT( slotBookmarksChanged(const QString &, const QString &) ));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CurrentMgr::slotBookmarksChanged(const QString &, const QString &caller) {
|
2003-03-23 04:11:19 +00:00
|
|
|
// kdDebug() << "CurrentMgr::slotBookmarksChanged" << endl;
|
2003-03-22 20:27:55 +00:00
|
|
|
if ((caller.latin1() != kapp->dcopClient()->appId()) && !KEBApp::self()->modified()) {
|
2003-03-23 04:11:19 +00:00
|
|
|
// TODO
|
|
|
|
// umm.. what happens if a readonly gets a update for a non-readonly???
|
|
|
|
// the non-readonly maybe has a pretty much random kapp->name() ??? umm...
|
2003-03-22 20:27:55 +00:00
|
|
|
CmdHistory::self()->clearHistory();
|
2003-03-23 10:46:14 +00:00
|
|
|
ListView::self()->updateListView();
|
2003-03-22 20:27:55 +00:00
|
|
|
KEBApp::self()->updateActions();
|
|
|
|
}
|
2003-03-22 19:50:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CurrentMgr::notifyManagers() {
|
|
|
|
QCString objId("KBookmarkManager-");
|
|
|
|
objId += mgr()->path().utf8();
|
|
|
|
DCOPRef("*", objId).send("notifyCompleteChange", QString::fromLatin1(kapp->dcopClient()->appId()));
|
|
|
|
}
|
|
|
|
|
2003-06-15 22:46:00 +00:00
|
|
|
QString CurrentMgr::correctAddress(const QString &address) const {
|
2003-03-22 19:50:23 +00:00
|
|
|
return mgr()->findByAddress(address, true).address();
|
|
|
|
}
|
|
|
|
|
2003-04-19 08:32:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
|
2003-09-14 17:28:52 +00:00
|
|
|
KEBApp *KEBApp::s_topLevel = 0;
|
2003-06-13 19:17:25 +00:00
|
|
|
|
2003-06-20 00:13:10 +00:00
|
|
|
KEBApp::KEBApp(
|
|
|
|
const QString &bookmarksFile, bool readonly,
|
|
|
|
const QString &address, bool browser, const QString &caption
|
2003-06-20 00:31:30 +00:00
|
|
|
) : KMainWindow(), m_dcopIface(0), m_bookmarksFilename(bookmarksFile),
|
|
|
|
m_caption(caption), m_readOnly(readonly), m_browser(browser) {
|
2002-10-16 17:29:51 +00:00
|
|
|
|
2003-03-22 16:52:02 +00:00
|
|
|
m_cmdHistory = new CmdHistory(actionCollection());
|
2002-10-16 17:29:51 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
s_topLevel = this;
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-05-17 12:59:28 +00:00
|
|
|
int h = 20;
|
|
|
|
|
2003-03-25 22:00:49 +00:00
|
|
|
QSplitter *vsplitter = new QSplitter(this);
|
2003-06-15 22:13:20 +00:00
|
|
|
m_iSearchLineEdit = new MagicKLineEdit(i18n("Type here to search..."), vsplitter);
|
2003-05-17 12:59:28 +00:00
|
|
|
m_iSearchLineEdit->setMinimumHeight(h);
|
|
|
|
m_iSearchLineEdit->setMaximumHeight(h);
|
2003-03-01 10:40:23 +00:00
|
|
|
|
2003-06-15 02:10:49 +00:00
|
|
|
readConfig();
|
|
|
|
|
2003-03-25 22:00:49 +00:00
|
|
|
QSplitter *splitter = new QSplitter(vsplitter);
|
2003-03-01 11:04:06 +00:00
|
|
|
ListView::createListViews(splitter);
|
|
|
|
ListView::self()->initListViews();
|
2003-03-23 11:08:37 +00:00
|
|
|
ListView::self()->setInitialAddress(address);
|
2003-03-01 10:40:23 +00:00
|
|
|
|
2003-06-09 11:49:25 +00:00
|
|
|
m_bkinfo = new BookmarkInfoWidget(vsplitter);
|
|
|
|
|
2003-04-27 13:14:46 +00:00
|
|
|
vsplitter->setOrientation(QSplitter::Vertical);
|
2003-06-09 11:49:25 +00:00
|
|
|
vsplitter->setSizes(QValueList<int>() << h << 380 << m_bkinfo->sizeHint().height() );
|
2003-04-27 13:14:46 +00:00
|
|
|
|
2003-03-25 22:00:49 +00:00
|
|
|
setCentralWidget(vsplitter);
|
2003-04-27 14:48:50 +00:00
|
|
|
resize(ListView::self()->widget()->sizeHint().width(), vsplitter->sizeHint().height());
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
createActions();
|
2003-06-13 19:37:11 +00:00
|
|
|
if (m_browser)
|
|
|
|
createGUI();
|
|
|
|
else
|
|
|
|
createGUI("keditbookmarks-genui.rc");
|
2002-06-03 18:58:18 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
m_dcopIface = new KBookmarkEditorIface();
|
2002-04-26 22:21:50 +00:00
|
|
|
|
2003-01-22 15:19:31 +00:00
|
|
|
connect(kapp->clipboard(), SIGNAL( dataChanged() ), SLOT( slotClipboardDataChanged() ));
|
2003-02-15 00:18:41 +00:00
|
|
|
|
2003-06-15 22:13:20 +00:00
|
|
|
connect(m_iSearchLineEdit, SIGNAL( textChanged(const QString &) ),
|
|
|
|
Searcher::self(), SLOT( slotSearchTextChanged(const QString &) ));
|
|
|
|
|
|
|
|
connect(m_iSearchLineEdit, SIGNAL( returnPressed() ),
|
|
|
|
Searcher::self(), SLOT( slotSearchNext() ));
|
|
|
|
|
2003-02-15 01:18:29 +00:00
|
|
|
ListView::self()->connectSignals();
|
2002-04-26 22:21:50 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
KGlobal::locale()->insertCatalogue("libkonq");
|
2002-04-27 10:47:22 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
construct();
|
2003-01-23 12:32:02 +00:00
|
|
|
|
2003-03-01 11:36:20 +00:00
|
|
|
updateActions();
|
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::construct() {
|
2003-03-23 04:11:19 +00:00
|
|
|
CurrentMgr::self()->createManager(m_bookmarksFilename);
|
2002-04-27 10:47:22 +00:00
|
|
|
|
2003-02-15 01:18:29 +00:00
|
|
|
ListView::self()->updateListViewSetup(m_readOnly);
|
2003-03-23 10:46:14 +00:00
|
|
|
ListView::self()->updateListView();
|
2003-06-15 22:13:20 +00:00
|
|
|
ListView::self()->widget()->setFocus();
|
2003-05-22 23:19:11 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
slotClipboardDataChanged();
|
2002-10-16 17:29:51 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
resetActions();
|
2003-02-10 13:52:45 +00:00
|
|
|
updateActions();
|
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
setAutoSaveSettings();
|
|
|
|
setModifiedFlag(false);
|
2003-03-22 16:52:02 +00:00
|
|
|
m_cmdHistory->notifyDocSaved();
|
2000-10-26 03:52:56 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
KEBApp::~KEBApp() {
|
2002-10-16 17:50:42 +00:00
|
|
|
s_topLevel = 0;
|
2003-01-21 16:16:53 +00:00
|
|
|
delete m_dcopIface;
|
|
|
|
}
|
|
|
|
|
2003-06-15 22:46:00 +00:00
|
|
|
KToggleAction* KEBApp::getToggleAction(const char *action) const {
|
2003-03-21 21:30:16 +00:00
|
|
|
return static_cast<KToggleAction*>(actionCollection()->action(action));
|
2003-02-11 09:57:10 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::resetActions() {
|
2003-03-21 21:30:16 +00:00
|
|
|
stateChanged("disablestuff");
|
2003-01-21 16:16:53 +00:00
|
|
|
stateChanged("normal");
|
2002-10-16 16:39:37 +00:00
|
|
|
|
2003-06-15 22:32:39 +00:00
|
|
|
if (!m_readOnly)
|
2003-01-21 16:16:53 +00:00
|
|
|
stateChanged("notreadonly");
|
2002-03-26 23:28:26 +00:00
|
|
|
|
2003-03-21 21:30:16 +00:00
|
|
|
getToggleAction("settings_saveonclose")->setChecked(m_saveOnClose);
|
2003-04-19 12:33:40 +00:00
|
|
|
getToggleAction("settings_advancedaddbookmark")->setChecked(m_advancedAddBookmark);
|
2003-06-20 00:31:30 +00:00
|
|
|
getToggleAction("settings_filteredtoolbar")->setChecked(m_filteredToolbar);
|
2003-09-14 17:08:10 +00:00
|
|
|
// getToggleAction("settings_splitview")->setChecked(m_splitView);
|
2003-04-19 12:33:40 +00:00
|
|
|
getToggleAction("settings_showNS")->setChecked(CurrentMgr::self()->showNSBookmarks());
|
|
|
|
}
|
|
|
|
|
|
|
|
void KEBApp::readConfig() {
|
2003-06-15 22:32:39 +00:00
|
|
|
if (m_browser) {
|
2003-06-13 19:37:11 +00:00
|
|
|
KConfig config("kbookmarkrc", false, false);
|
|
|
|
config.setGroup("Bookmarks");
|
|
|
|
m_advancedAddBookmark = config.readBoolEntry("AdvancedAddBookmark", false);
|
2003-06-20 00:31:30 +00:00
|
|
|
m_filteredToolbar = config.readBoolEntry("FilteredToolbar", false);
|
2003-06-13 19:37:11 +00:00
|
|
|
}
|
2003-04-19 12:33:40 +00:00
|
|
|
|
|
|
|
KConfig appconfig("keditbookmarksrc", false, false);
|
|
|
|
appconfig.setGroup("General");
|
|
|
|
m_saveOnClose = appconfig.readBoolEntry("Save On Close", false);
|
2003-09-14 17:08:10 +00:00
|
|
|
m_splitView = false; // appconfig.readBoolEntry("Split View", false);
|
2003-04-19 12:33:40 +00:00
|
|
|
}
|
|
|
|
|
2003-06-20 00:31:30 +00:00
|
|
|
static void writeConfigBool(
|
|
|
|
const QString &rcfile, const QString &group,
|
|
|
|
const QString &entry, bool flag
|
|
|
|
) {
|
|
|
|
KConfig config(rcfile, false, false);
|
|
|
|
config.setGroup(group);
|
|
|
|
config.writeEntry(entry, flag);
|
|
|
|
}
|
|
|
|
|
2003-08-26 12:01:28 +00:00
|
|
|
// temporary only
|
|
|
|
static void sorryRelogin(QWidget *p) {
|
|
|
|
KMessageBox::sorry(p, "<qt>In order to see the affect of this setting<br>"
|
|
|
|
"modification you will need to relogin.</qt>");
|
|
|
|
}
|
|
|
|
|
2003-04-19 12:33:40 +00:00
|
|
|
void KEBApp::slotAdvancedAddBookmark() {
|
2003-06-20 00:31:30 +00:00
|
|
|
Q_ASSERT(m_browser);
|
|
|
|
m_advancedAddBookmark = getToggleAction("settings_advancedaddbookmark")->isChecked();
|
|
|
|
writeConfigBool("kbookmarkrc", "Bookmarks", "AdvancedAddBookmark", m_advancedAddBookmark);
|
2003-08-26 12:01:28 +00:00
|
|
|
sorryRelogin(this);
|
2003-06-20 00:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void KEBApp::slotFilteredToolbar() {
|
|
|
|
m_filteredToolbar = getToggleAction("settings_filteredtoolbar")->isChecked();
|
|
|
|
writeConfigBool("kbookmarkrc", "Bookmarks", "FilteredToolbar", m_filteredToolbar);
|
2003-08-26 12:01:28 +00:00
|
|
|
sorryRelogin(this);
|
2002-03-26 23:28:26 +00:00
|
|
|
}
|
|
|
|
|
2003-06-15 01:54:24 +00:00
|
|
|
void KEBApp::slotSplitView() {
|
2003-09-14 17:08:10 +00:00
|
|
|
Q_ASSERT( 0 );
|
2003-06-15 01:54:24 +00:00
|
|
|
m_splitView = getToggleAction("settings_splitview")->isChecked();
|
2003-06-20 00:31:30 +00:00
|
|
|
writeConfigBool("keditbookmarksrc", "General", "Split View", m_splitView);
|
2003-08-26 12:01:28 +00:00
|
|
|
sorryRelogin(this);
|
2003-06-15 01:54:24 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::slotSaveOnClose() {
|
2003-03-21 21:30:16 +00:00
|
|
|
m_saveOnClose = getToggleAction("settings_saveonclose")->isChecked();
|
2003-06-20 00:31:30 +00:00
|
|
|
writeConfigBool("keditbookmarksrc", "General", "Save On Close", m_saveOnClose);
|
2003-02-06 13:16:40 +00:00
|
|
|
}
|
|
|
|
|
2003-06-15 22:46:00 +00:00
|
|
|
bool KEBApp::nsShown() const {
|
2003-03-21 21:30:16 +00:00
|
|
|
return getToggleAction("settings_showNS")->isChecked();
|
2003-02-06 13:16:40 +00:00
|
|
|
}
|
2003-02-10 13:52:45 +00:00
|
|
|
|
2003-03-23 10:46:14 +00:00
|
|
|
// this should be pushed from listview, not pulled
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::updateActions() {
|
2003-02-15 01:18:29 +00:00
|
|
|
setActionsEnabled(ListView::self()->getSelectionAbilities());
|
2002-03-26 23:28:26 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::setModifiedFlag(bool modified) {
|
2003-06-21 00:08:17 +00:00
|
|
|
m_modified = modified && !m_readOnly;
|
2003-03-21 23:22:20 +00:00
|
|
|
|
2003-06-21 00:08:17 +00:00
|
|
|
QString caption = m_caption.isNull() ? "" : (m_caption + " ");
|
2003-06-15 22:32:39 +00:00
|
|
|
if (m_bookmarksFilename != KBookmarkManager::userBookmarksManager()->path())
|
2003-06-21 00:08:17 +00:00
|
|
|
caption += (caption.isEmpty()?"":" - ") + m_bookmarksFilename;
|
|
|
|
if (m_readOnly)
|
2003-02-24 12:18:27 +00:00
|
|
|
caption += QString(" [%1]").arg(i18n("Read Only"));
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-01-22 15:19:31 +00:00
|
|
|
setCaption(caption, m_modified);
|
2002-01-05 17:21:29 +00:00
|
|
|
|
2003-06-20 00:13:10 +00:00
|
|
|
// we receive dcop if modified
|
|
|
|
// rather than reparse notifies
|
2003-03-18 12:55:27 +00:00
|
|
|
CurrentMgr::self()->setUpdate(!m_modified);
|
2002-04-28 22:01:11 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::slotClipboardDataChanged() {
|
2003-03-23 04:11:19 +00:00
|
|
|
// kdDebug() << "KEBApp::slotClipboardDataChanged" << endl;
|
2003-01-22 15:19:31 +00:00
|
|
|
if (!m_readOnly) {
|
2003-02-11 09:57:10 +00:00
|
|
|
m_canPaste = KBookmarkDrag::canDecode(kapp->clipboard()->data(QClipboard::Clipboard));
|
2003-01-22 15:19:31 +00:00
|
|
|
ListView::self()->emitSlotSelectionChanged();
|
|
|
|
}
|
2002-04-28 22:01:11 +00:00
|
|
|
}
|
|
|
|
|
2003-02-16 00:05:39 +00:00
|
|
|
/* -------------------------- */
|
2002-04-28 22:01:11 +00:00
|
|
|
|
2003-03-22 20:27:55 +00:00
|
|
|
void KEBApp::notifyCommandExecuted() {
|
2003-03-23 04:11:19 +00:00
|
|
|
// kdDebug() << "KEBApp::notifyCommandExecuted()" << endl;
|
2003-01-22 15:19:31 +00:00
|
|
|
if (!m_readOnly) {
|
2003-01-21 16:16:53 +00:00
|
|
|
setModifiedFlag(true);
|
2003-02-15 01:18:29 +00:00
|
|
|
ListView::self()->updateListView();
|
|
|
|
ListView::self()->emitSlotSelectionChanged();
|
2003-01-21 16:16:53 +00:00
|
|
|
updateActions();
|
2002-10-16 17:29:51 +00:00
|
|
|
}
|
2000-11-22 01:46:49 +00:00
|
|
|
}
|
|
|
|
|
2003-03-22 16:52:02 +00:00
|
|
|
/* -------------------------- */
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::slotConfigureKeyBindings() {
|
2003-01-21 16:16:53 +00:00
|
|
|
KKeyDialog::configure(actionCollection());
|
2001-09-09 15:36:30 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::slotConfigureToolbars() {
|
2003-01-21 16:16:53 +00:00
|
|
|
saveMainWindowSettings(KGlobal::config(), "MainWindow");
|
|
|
|
KEditToolbar dlg(actionCollection());
|
|
|
|
connect(&dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ));
|
|
|
|
dlg.exec();
|
2000-10-26 03:52:56 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 19:00:14 +00:00
|
|
|
void KEBApp::slotNewToolbarConfig() {
|
2003-01-21 16:16:53 +00:00
|
|
|
// called when OK or Apply is clicked
|
|
|
|
createGUI();
|
|
|
|
applyMainWindowSettings(KGlobal::config(), "MainWindow");
|
2002-04-19 23:09:16 +00:00
|
|
|
}
|
|
|
|
|
2003-02-16 00:05:39 +00:00
|
|
|
/* -------------------------- */
|
2002-04-26 22:21:50 +00:00
|
|
|
|
2000-10-26 03:52:56 +00:00
|
|
|
#include "toplevel.moc"
|