diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-17 23:39:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-17 23:39:35 +0000 |
commit | f48aef5ed7f2e333984766d9ceb02e01ecbd47a7 (patch) | |
tree | 6ed79de882f3051cf7999a9cee2b633d8daabeab /src/bookmarkssettingspage.h | |
download | dolphin-f48aef5ed7f2e333984766d9ceb02e01ecbd47a7.tar.gz dolphin-f48aef5ed7f2e333984766d9ceb02e01ecbd47a7.zip |
Added old KDE3 version of dolphin
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/dolphin@1076309 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/bookmarkssettingspage.h')
-rw-r--r-- | src/bookmarkssettingspage.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/bookmarkssettingspage.h b/src/bookmarkssettingspage.h new file mode 100644 index 0000000..89f3752 --- /dev/null +++ b/src/bookmarkssettingspage.h @@ -0,0 +1,93 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * [email protected] * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * 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; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef BOOKMARKSSETTINGSPAGE_H +#define BOOKMARKSSETTINGSPAGE_H + +#include <settingspagebase.h> +#include <qvaluelist.h> + +class KListView; +class KPushButton; +class QListViewItem; + +/** + * @brief Represents the page from the Dolphin Settings which allows + * to modify the bookmarks. + */ +class BookmarksSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + BookmarksSettingsPage(QWidget* parent); + + virtual ~BookmarksSettingsPage(); + + /** @see SettingsPageBase::applySettings */ + virtual void applySettings(); + +private slots: + void updateButtons(); + void slotBookmarkDoubleClicked(QListViewItem*, const QPoint&, int); + void slotAddButtonClicked(); + void slotEditButtonClicked(); + void slotRemoveButtonClicked(); + void slotMoveUpButtonClicked(); + void slotMoveDownButtonClicked(); + + /** + * Is connected with the signal QListView::pressed(QListViewItem* item) + * and assures that always one bookmarks stays selected although a + * click has been done on the viewport area. + * TODO: this is a workaround, possibly there is a more easy approach + * doing this... + */ + void slotBookmarkPressed(QListViewItem* item); + +private: + enum ColumnIndex { + PixmapIdx = 0, + NameIdx = 1, + URLIdx = 2, + IconIdx = 3 + }; + + KListView* m_listView; + KPushButton* m_addButton; + KPushButton* m_editButton; + KPushButton* m_removeButton; + KPushButton* m_moveUpButton; + KPushButton* m_moveDownButton; + + /** + * Returns the index of the selected bookmark + * inside the bookmarks listview. + */ + int selectedBookmarkIndex() const; + + /** + * Moves the currently selected bookmark up, if 'direction' + * is < 0, otherwise the bookmark is moved down. + */ + void moveBookmark(int direction); +}; + +#endif |