Skip to content

Commit 3c45355

Browse files
rduivenvoordejef-n
authored andcommitted
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
1 parent 65f32bc commit 3c45355

File tree

8 files changed

+193
-477
lines changed

8 files changed

+193
-477
lines changed

src/app/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ SET(QGIS_APP_SRCS
1212
qgsattributetypedialog.cpp
1313
qgsattributetypeloaddialog.cpp
1414
qgsattributetabledialog.cpp
15-
qgsbookmarkitem.cpp
1615
qgsbookmarks.cpp
1716
qgsbrowserdockwidget.cpp
1817
qgsclipboard.cpp

src/app/qgisapp.cpp

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
#include "qgsapplication.h"
102102
#include "qgsattributeaction.h"
103103
#include "qgsattributetabledialog.h"
104-
#include "qgsbookmarkitem.h"
105104
#include "qgsbookmarks.h"
106105
#include "qgsbrowserdockwidget.h"
107106
#include "qgsclipboard.h"
@@ -6751,48 +6750,15 @@ void QgisApp::customProjection()
67516750
myDialog->setAttribute( Qt::WA_DeleteOnClose );
67526751
myDialog->show();
67536752
}
6754-
void QgisApp::showBookmarks()
6755-
{
6756-
// Create or show the single instance of the Bookmarks modeless dialog.
6757-
// Closing a QWidget only hides it so it can be shown again later.
6758-
static QgsBookmarks *bookmarks = NULL;
6759-
if ( bookmarks == NULL )
6760-
{
6761-
bookmarks = new QgsBookmarks( this, Qt::WindowMinMaxButtonsHint );
6762-
}
6763-
bookmarks->show();
6764-
bookmarks->raise();
6765-
bookmarks->setWindowState( bookmarks->windowState() & ~Qt::WindowMinimized );
6766-
bookmarks->activateWindow();
6767-
}
67686753

67696754
void QgisApp::newBookmark()
67706755
{
6771-
// Get the name for the bookmark. Everything else we fetch from
6772-
// the mapcanvas
6756+
QgsBookmarks::newBookmark();
6757+
}
67736758

6774-
bool ok;
6775-
QString bookmarkName = QInputDialog::getText( this, tr( "New Bookmark" ),
6776-
tr( "Enter a name for the new bookmark:" ), QLineEdit::Normal,
6777-
QString::null, &ok );
6778-
if ( ok && !bookmarkName.isEmpty() )
6779-
{
6780-
if ( createDB() )
6781-
{
6782-
// create the bookmark
6783-
QgsBookmarkItem *bmi = new QgsBookmarkItem( bookmarkName,
6784-
QgsProject::instance()->title(), mMapCanvas->extent(), -1,
6785-
QgsApplication::qgisUserDbFilePath() );
6786-
bmi->store();
6787-
delete bmi;
6788-
// emit a signal to indicate that the bookmark was added
6789-
emit bookmarkAdded();
6790-
}
6791-
else
6792-
{
6793-
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark. Your user database may be missing or corrupted" ) );
6794-
}
6795-
}
6759+
void QgisApp::showBookmarks()
6760+
{
6761+
QgsBookmarks::showBookmarks();
67966762
}
67976763

67986764
// Slot that gets called when the project file was saved with an older

src/app/qgisapp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
856856
*/
857857
void newProject();
858858

859-
//! emitted when a new bookmark is added
860-
void bookmarkAdded();
861-
862859
/** Signal emitted when the current theme is changed so plugins
863860
* can change there tool button icons.
864861
* @note This was added in QGIS 1.1

src/app/qgsbookmarkitem.cpp

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/app/qgsbookmarkitem.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)