|
50 | 50 | //
|
51 | 51 | //the gui subclass
|
52 | 52 | //
|
53 |
| -#include "plugingui.h" |
54 |
| - |
| 53 | +//#include "plugingui.h" |
| 54 | +#include "qgspointdialog.h" |
| 55 | +#include "qgsgeorefdescriptiondialog.h" |
55 | 56 |
|
56 | 57 | static const char * const sIdent = "$Id$";
|
57 |
| -static const QString sName = QObject::tr( "Georeferencer" ); |
58 |
| -static const QString sDescription = QObject::tr( "Adding projection info to rasters" ); |
| 58 | +static const QString sName = QObject::tr( "Georeferencer GDAL" ); |
| 59 | +static const QString sDescription = QObject::tr( "Adding projection info to rasters using GDAL" ); |
59 | 60 | static const QString sPluginVersion = QObject::tr( "Version 0.1" );
|
60 | 61 | static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
|
61 | 62 |
|
@@ -97,19 +98,53 @@ void QgsGeorefPlugin::initGui()
|
97 | 98 | mQGisIface->addToolBarIcon( mQActionPointer );
|
98 | 99 | mQGisIface->addPluginToMenu( tr( "&Georeferencer" ), mQActionPointer );
|
99 | 100 |
|
| 101 | + mQActionPointer = new QAction( QIcon( ":/about.png" ), tr( "&Georeferencer" ), this ); |
| 102 | + mQActionPointer = new QAction("About", this); |
| 103 | + connect(mQActionPointer, SIGNAL(triggered()), SLOT(about())); |
| 104 | + mQGisIface->addPluginToMenu(tr ("&Georeferencer"), mQActionPointer); |
| 105 | + |
| 106 | + mQActionPointer = new QAction( QIcon( ":/help.png" ), tr( "&Georeferencer" ), this ); |
| 107 | + mQActionPointer = new QAction("Help", this); |
| 108 | + connect(mQActionPointer, SIGNAL(triggered()), SLOT(help())); |
| 109 | + mQGisIface->addPluginToMenu(tr ("&Georeferencer"), mQActionPointer); |
100 | 110 | }
|
101 | 111 | //method defined in interface
|
102 | 112 | void QgsGeorefPlugin::help()
|
103 | 113 | {
|
104 |
| - //implement me! |
| 114 | + QgsGeorefDescriptionDialog dlg( mQGisIface->mainWindow( ) ); |
| 115 | + dlg.exec(); |
| 116 | +} |
| 117 | + |
| 118 | +void QgsGeorefPlugin::about( ) |
| 119 | +{ |
| 120 | + QDialog dlg( mQGisIface->mainWindow( ) ); |
| 121 | + dlg.setWindowFlags( dlg.windowFlags( ) | Qt::MSWindowsFixedSizeDialogHint ); |
| 122 | + dlg.setWindowFlags( dlg.windowFlags( ) &~ Qt::WindowContextHelpButtonHint ); |
| 123 | + QVBoxLayout *lines = new QVBoxLayout( &dlg ); |
| 124 | + lines->addWidget( new QLabel( tr( "<b>Georeferencer GDAL</b>") ) ); |
| 125 | + lines->addWidget( new QLabel( tr( " Based on original Georeferencer Plugin" ) ) ); |
| 126 | + lines->addWidget( new QLabel( tr( "<b>Developers:</b>" ) ) ); |
| 127 | + lines->addWidget( new QLabel( tr( " Lars Luthman (original Georeferencer)" ) ) ); |
| 128 | + lines->addWidget( new QLabel( " Lynx (lynx21.12.12@gmail.ru)" )); |
| 129 | + lines->addWidget( new QLabel( " Maxim Dubinin (sim@gis-lab.info)" )); |
| 130 | + lines->addWidget( new QLabel( tr( "<b>Links:</b>" ) ) ); |
| 131 | + QLabel *link = new QLabel( " <a href=\"http://gis-lab.info/qa/qgis-georef-new-eng.html\">http://gis-lab.info/qa/qgis-georef-new-eng.html</a>"); |
| 132 | + link->setOpenExternalLinks( true ); |
| 133 | + lines->addWidget( link ); |
| 134 | + |
| 135 | + dlg.exec( ); |
105 | 136 | }
|
106 | 137 |
|
107 | 138 | // Slot called when the buffer menu item is triggered
|
108 | 139 | void QgsGeorefPlugin::run()
|
109 | 140 | {
|
110 |
| - QgsGeorefPluginGui *myPluginGui = new QgsGeorefPluginGui( mQGisIface, QgsGeorefPluginGui::findMainWindow() ); |
111 |
| - myPluginGui->show(); |
112 |
| - myPluginGui->setFocus(); |
| 141 | +// QgsGeorefPluginGui *myPluginGui = new QgsGeorefPluginGui( mQGisIface, QgsGeorefPluginGui::findMainWindow(), Qt::Window | Qt::WindowMinimizeButtonHint); |
| 142 | +// myPluginGui->show(); |
| 143 | +// myPluginGui->setFocus(); |
| 144 | + QgsPointDialog *myPlugin = new QgsPointDialog(mQGisIface, QgsPointDialog::findMainWindow(), Qt::Window | Qt::WindowMinimizeButtonHint); |
| 145 | + myPlugin->move(0, 0); |
| 146 | + myPlugin->show(); |
| 147 | + myPlugin->setFocus(); |
113 | 148 | }
|
114 | 149 |
|
115 | 150 | // Unload the plugin by cleaning up the GUI
|
|
0 commit comments