Skip to content
Permalink
Browse files

fix #3243

Richard Duivenvoorde (from pull request #78)
- crs taking into account, bookmarklist is now editable qtreeview
- set better column names the column names from the table

Juergen Fischer added refactoring:
- move adding bookmarks into QgsBookmarks
- make QgsBookmarks a singleton
- delete multiple entries at once
  • Loading branch information
rduivenvoorde authored and jef-n committed Jan 28, 2012
1 parent 65f32bc commit 3c45355eb66b76008c50493823f60956e02f2bfa
@@ -12,7 +12,6 @@ SET(QGIS_APP_SRCS
qgsattributetypedialog.cpp
qgsattributetypeloaddialog.cpp
qgsattributetabledialog.cpp
qgsbookmarkitem.cpp
qgsbookmarks.cpp
qgsbrowserdockwidget.cpp
qgsclipboard.cpp
@@ -101,7 +101,6 @@
#include "qgsapplication.h"
#include "qgsattributeaction.h"
#include "qgsattributetabledialog.h"
#include "qgsbookmarkitem.h"
#include "qgsbookmarks.h"
#include "qgsbrowserdockwidget.h"
#include "qgsclipboard.h"
@@ -6751,48 +6750,15 @@ void QgisApp::customProjection()
myDialog->setAttribute( Qt::WA_DeleteOnClose );
myDialog->show();
}
void QgisApp::showBookmarks()
{
// Create or show the single instance of the Bookmarks modeless dialog.
// Closing a QWidget only hides it so it can be shown again later.
static QgsBookmarks *bookmarks = NULL;
if ( bookmarks == NULL )
{
bookmarks = new QgsBookmarks( this, Qt::WindowMinMaxButtonsHint );
}
bookmarks->show();
bookmarks->raise();
bookmarks->setWindowState( bookmarks->windowState() & ~Qt::WindowMinimized );
bookmarks->activateWindow();
}

void QgisApp::newBookmark()
{
// Get the name for the bookmark. Everything else we fetch from
// the mapcanvas
QgsBookmarks::newBookmark();
}

bool ok;
QString bookmarkName = QInputDialog::getText( this, tr( "New Bookmark" ),
tr( "Enter a name for the new bookmark:" ), QLineEdit::Normal,
QString::null, &ok );
if ( ok && !bookmarkName.isEmpty() )
{
if ( createDB() )
{
// create the bookmark
QgsBookmarkItem *bmi = new QgsBookmarkItem( bookmarkName,
QgsProject::instance()->title(), mMapCanvas->extent(), -1,
QgsApplication::qgisUserDbFilePath() );
bmi->store();
delete bmi;
// emit a signal to indicate that the bookmark was added
emit bookmarkAdded();
}
else
{
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark. Your user database may be missing or corrupted" ) );
}
}
void QgisApp::showBookmarks()
{
QgsBookmarks::showBookmarks();
}

// Slot that gets called when the project file was saved with an older
@@ -856,9 +856,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
*/
void newProject();

//! emitted when a new bookmark is added
void bookmarkAdded();

/** Signal emitted when the current theme is changed so plugins
* can change there tool button icons.
* @note This was added in QGIS 1.1

This file was deleted.

This file was deleted.

0 comments on commit 3c45355

Please sign in to comment.
You can’t perform that action at this time.