[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Thu Jan 27 23:01:14 CET 2011
SVN commit 1217564 by nienhueser:
Add an action to open the bookmark manager to the kde application. Remove the actions to create a new bookmark folder and to remove all bookmarks from the kde and the qt applications. The bookmark manager provides that functionality.
M +0 -27 QtMainWindow.cpp
M +0 -4 QtMainWindow.h
M +10 -26 marble_part.cpp
M +2 -4 marble_part.h
M +1 -2 marble_part.rc
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1217563:1217564
@@ -279,16 +279,9 @@
m_addBookmarkAct->setStatusTip(tr("Add Bookmark"));
connect( m_addBookmarkAct, SIGNAL( triggered() ), this, SLOT( openEditBookmarkDialog() ) );
- m_removeAllBookmarksAct = new QAction( QIcon(":/icons/bookmark-remove.png"), tr("&Remove all Bookmarks"),this);
- m_removeAllBookmarksAct->setStatusTip(tr("Remove all Bookmarks"));
- connect( m_removeAllBookmarksAct, SIGNAL( triggered() ), this, SLOT( removeAllBookmarks() ) );
-
m_manageBookmarksAct = new QAction( QIcon( ":/icons/bookmarks-organize.png" ), tr( "&Manage Bookmarks" ), this);
m_manageBookmarksAct->setStatusTip( tr( "Manage Bookmarks" ) );
connect( m_manageBookmarksAct, SIGNAL( triggered() ), this, SLOT( manageBookmarks() ) );
- m_addBookmarkFolderAct = new QAction( QIcon(":/icons/bookmark-add-folder.png"), tr("&New Bookmark Folder"),this);
- m_addBookmarkFolderAct->setStatusTip(tr("New Bookmark Folder"));
- connect( m_addBookmarkFolderAct, SIGNAL( triggered() ), this, SLOT( openNewBookmarkFolderDialog() ) );
// Map Wizard action
m_mapWizardAct = new QAction( tr("&Create a New Map..."), this );
@@ -487,8 +480,6 @@
{
m_bookmarkMenu->clear();
m_bookmarkMenu->addAction( m_addBookmarkAct );
- m_bookmarkMenu->addAction( m_addBookmarkFolderAct );
- m_bookmarkMenu->addAction( m_removeAllBookmarksAct );
m_bookmarkMenu->addAction( m_manageBookmarksAct );
m_bookmarkMenu->addSeparator();
@@ -537,16 +528,6 @@
}
-void MainWindow::removeAllBookmarks()
-{
- QString const title = tr( "Marble" );
- QString const text = tr( "Are you sure you want to delete all bookmarks?" );
- QMessageBox::StandardButtons const buttons = QMessageBox::Yes | QMessageBox::No;
- if ( QMessageBox::question( m_controlView->marbleWidget(), title, text, buttons, QMessageBox::No ) == QMessageBox::Yes ) {
- m_controlView->marbleWidget()->removeAllBookmarks();
- }
-}
-
void MainWindow::manageBookmarks()
{
MarbleModel * const model = m_controlView->marbleWidget()->model();
@@ -560,14 +541,6 @@
delete dialog;
}
-void MainWindow::openNewBookmarkFolderDialog()
-{
- QPointer<NewBookmarkFolderDialog> dialog = new NewBookmarkFolderDialog( this );
- dialog->setMarbleWidget( m_controlView->marbleWidget() );
- dialog->exec();
- delete dialog;
-}
-
void MainWindow::openEditBookmarkDialog()
{
MarbleWidget *widget = m_controlView->marbleWidget();
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.h #1217563:1217564
@@ -112,9 +112,7 @@
void openEditBookmarkDialog();
void createBookmarksListMenu(QMenu *m_bookmarksListMenu, const GeoDataFolder &folder);
void lookAtBookmark( QAction * action );
- void removeAllBookmarks();
void manageBookmarks();
- void openNewBookmarkFolderDialog();
void createBookmarkMenu();
void createFolderList();
@@ -197,9 +195,7 @@
//Bookmark Menu
QAction *m_addBookmarkAct;
- QAction *m_removeAllBookmarksAct;
QAction *m_manageBookmarksAct;
- QAction *m_addBookmarkFolderAct;
// Small screen devices
QAction *m_showMapViewDialogAction;
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1217563:1217564
@@ -56,6 +56,7 @@
#include "AbstractDataPlugin.h"
#include "EditBookmarkDialog.h"
#include "BookmarkManager.h"
+#include "BookmarkManagerDialog.h"
#include "DownloadRegionDialog.h"
#include "GeoDataCoordinates.h"
#include "GeoDataFolder.h"
@@ -860,22 +861,14 @@
connect( m_addBookmarkAction, SIGNAL( triggered( ) ),
this, SLOT( openEditBookmarkDialog() ) );
+ m_manageBookmarksAction = new KAction( this );
+ actionCollection()->addAction( "manage_bookmarks", m_manageBookmarksAction );
+ m_manageBookmarksAction->setText( i18nc( "Manage Bookmarks", "&Manage Bookmarks" ) );
+ m_manageBookmarksAction->setIcon( KIcon( ":/icons/bookmarks-organize.png" ) );
+ connect( m_manageBookmarksAction, SIGNAL( triggered( ) ),
+ this, SLOT( openManageBookmarksDialog() ) );
- m_removeAllBookmarksAction = new KAction( this );
- actionCollection()->addAction( "remove_all_bookmark", m_removeAllBookmarksAction );
- m_removeAllBookmarksAction->setIcon( KIcon( ":/icons/bookmark-remove.png" ) );
- m_removeAllBookmarksAction->setText( i18nc( "Remove All Bookmarks", "&Remove All Bookmarks" ) );
- connect( m_removeAllBookmarksAction, SIGNAL( triggered( ) ),
- this, SLOT( removeAllBookmarks() ) );
-
- m_addBookmarkFolderAction = new KAction( this );
- actionCollection()->addAction( "new_bookmark_folder", m_addBookmarkFolderAction );
- m_addBookmarkFolderAction->setIcon( KIcon( ":/icons/bookmark-add-folder.png" ) );
- m_addBookmarkFolderAction->setText( i18nc( "New Bookmark Folder", "&New Bookmark Folder" ) );
- connect( m_addBookmarkFolderAction, SIGNAL( triggered( ) ),
- this, SLOT( openNewBookmarkFolderDialog() ) );
-
createFolderList();
connect( m_controlView->marbleWidget()->model()->bookmarkManager(),
SIGNAL( bookmarksChanged() ), this, SLOT( createFolderList() ) );
@@ -1600,19 +1593,10 @@
delete dialog;
}
-void MarblePart::removeAllBookmarks()
+void MarblePart::openManageBookmarksDialog()
{
- QString const title = i18nc( "Application name", "Marble" );
- QString const text = i18n( "Are you sure you want to delete all bookmarks?" );
- if ( KMessageBox::questionYesNo( widget(), text, title ) == KMessageBox::Yes ) {
- m_controlView->marbleWidget()->removeAllBookmarks();
- }
-}
-
-void MarblePart::openNewBookmarkFolderDialog()
-{
- QPointer<NewBookmarkFolderDialog> dialog = new NewBookmarkFolderDialog( m_controlView->marbleWidget() );
- dialog->setMarbleWidget( m_controlView->marbleWidget() );
+ MarbleModel * const model = m_controlView->marbleWidget()->model();
+ QPointer<BookmarkManagerDialog> dialog = new BookmarkManagerDialog( model, m_controlView->marbleWidget() );
dialog->exec();
delete dialog;
}
--- trunk/KDE/kdeedu/marble/src/marble_part.h #1217563:1217564
@@ -171,10 +171,9 @@
//Bookmark Menu
void openEditBookmarkDialog();
+ void openManageBookmarksDialog();
void createBookmarksListMenu( QMenu *, const GeoDataFolder& );
void lookAtBookmark( QAction * );
- void removeAllBookmarks();
- void openNewBookmarkFolderDialog();
// void createBookmarkMenu();
@@ -223,8 +222,7 @@
//Bookmark Menu
KAction *m_addBookmarkAction;
- KAction *m_removeAllBookmarksAction;
- KAction *m_addBookmarkFolderAction;
+ KAction *m_manageBookmarksAction;
// Actions for the status bar
KAction *m_showPositionAction;
KAction *m_showDateTimeAction;
--- trunk/KDE/kdeedu/marble/src/marble_part.rc #1217563:1217564
@@ -58,8 +58,7 @@
<Menu name="bookmarks" noMerge="1">
<text>&Bookmarks</text>
<Action name="add_bookmark"/>
- <Action name="new_bookmark_folder"/>
- <Action name="remove_all_bookmark"/>
+ <Action name="manage_bookmarks"/>
<Separator/>
<ActionList name="folders"/>
</Menu>
More information about the Marble-commits
mailing list