Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,63 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "plugingui.h"

#include "qgsdecorationcopyrightdialog.h"
#include "qgsdecorationcopyright.h"

#include "qgscontexthelp.h"

//qt includes
#include <QColorDialog>
#include <QColor>
#include <QFont>


//standard includes

QgsCopyrightLabelPluginGui::QgsCopyrightLabelPluginGui( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyright& deco, QWidget* parent )
: QDialog( parent ), mDeco( deco )
{
setupUi( this );
//programmatically hide orientation selection for now
cboOrientation->hide();
textLabel15->hide();

cboxEnabled->setChecked( mDeco.mEnable );
// text
txtCopyrightText->setPlainText( mDeco.mLabelQString );
// placement
cboPlacement->clear();
cboPlacement->addItems( mDeco.mPlacementLabels );
cboPlacement->setCurrentIndex( mDeco.mPlacementIndex );
// color
pbnColorChooser->setColor( mDeco.mLabelQColor );
QTextCursor cursor = txtCopyrightText->textCursor();
txtCopyrightText->selectAll();
txtCopyrightText->setTextColor( mDeco.mLabelQColor );
txtCopyrightText->setTextCursor( cursor );
}

QgsCopyrightLabelPluginGui::~QgsCopyrightLabelPluginGui()
QgsDecorationCopyrightDialog::~QgsDecorationCopyrightDialog()
{
}

void QgsCopyrightLabelPluginGui::on_buttonBox_accepted()
void QgsDecorationCopyrightDialog::on_buttonBox_accepted()
{
//hide the dialog before we send all our signals
hide();
//close the dialog
emit changeFont( txtCopyrightText->currentFont() );
emit changeLabel( txtCopyrightText->toPlainText() );
emit changeColor( pbnColorChooser->color() );
emit changePlacement( cboPlacement->currentIndex() );
emit enableCopyrightLabel( cboxEnabled->isChecked() );
mDeco.mQFont = txtCopyrightText->currentFont();
mDeco.mLabelQString = txtCopyrightText->toPlainText();
mDeco.mLabelQColor = pbnColorChooser->color();
mDeco.mPlacementIndex = cboPlacement->currentIndex();
mDeco.mEnable = cboxEnabled->isChecked();

accept();
}

void QgsCopyrightLabelPluginGui::on_buttonBox_rejected()
void QgsDecorationCopyrightDialog::on_buttonBox_rejected()
{
reject();
}

void QgsCopyrightLabelPluginGui::on_pbnColorChooser_clicked()
void QgsDecorationCopyrightDialog::on_pbnColorChooser_clicked()
{
QColor c = QColorDialog::getColor();
if ( c.isValid() )
Expand All @@ -62,32 +78,7 @@ void QgsCopyrightLabelPluginGui::on_pbnColorChooser_clicked()
}
}

void QgsCopyrightLabelPluginGui::setEnabled( bool theBool )
{
cboxEnabled->setChecked( theBool );
}

void QgsCopyrightLabelPluginGui::setText( QString theTextQString )
{
txtCopyrightText->setPlainText( theTextQString );
}

void QgsCopyrightLabelPluginGui::setPlacementLabels( QStringList& labels )
{
cboPlacement->clear();
cboPlacement->addItems( labels );
}

void QgsCopyrightLabelPluginGui::setPlacement( int placementIndex )
void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
{
cboPlacement->setCurrentIndex( placementIndex );
}

void QgsCopyrightLabelPluginGui::setColor( QColor color )
{
pbnColorChooser->setColor( color );
QTextCursor cursor = txtCopyrightText->textCursor();
txtCopyrightText->selectAll();
txtCopyrightText->setTextColor( color );
txtCopyrightText->setTextCursor( cursor );
QgsContextHelp::run( metaObject()->className() );
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,29 @@
#ifndef QGSCOPYRIGHTLABELPLUGINGUI_H
#define QGSCOPYRIGHTLABELPLUGINGUI_H

#include <ui_pluginguibase.h>
#include <QColor>
#include <QFont>
#include "qgscontexthelp.h"

/**
@author Tim Sutton
*/
class QgsCopyrightLabelPluginGui : public QDialog, private Ui::QgsCopyrightLabelPluginGuiBase
#include "ui_qgsdecorationcopyrightdialog.h"

class QColor;
class QFont;

class QgsDecorationCopyright;

class QgsDecorationCopyrightDialog : public QDialog, private Ui::QgsDecorationCopyrightDialog
{
Q_OBJECT

public:
QgsCopyrightLabelPluginGui( QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsCopyrightLabelPluginGui();
void setText( QString );
void setPlacementLabels( QStringList& );
void setPlacement( int );
void setColor( QColor );
void setEnabled( bool );
QgsDecorationCopyrightDialog( QgsDecorationCopyright& deco, QWidget* parent = 0 );
~QgsDecorationCopyrightDialog();

private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void on_buttonBox_helpRequested();
void on_pbnColorChooser_clicked();

signals:
//void drawRasterLayer(QString);
//void drawVectorrLayer(QString,QString,QString);
void changeFont( QFont );
void changeLabel( QString );
void changeColor( QColor );
void changePlacement( int );
void enableCopyrightLabel( bool );

protected:
QgsDecorationCopyright& mDeco;
};

#endif
1 change: 0 additions & 1 deletion src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})

ADD_SUBDIRECTORY(copyright_label)
ADD_SUBDIRECTORY(delimited_text)
ADD_SUBDIRECTORY(diagram_overlay)
ADD_SUBDIRECTORY(interpolation)
Expand Down
45 changes: 0 additions & 45 deletions src/plugins/copyright_label/CMakeLists.txt

This file was deleted.

15 changes: 0 additions & 15 deletions src/plugins/copyright_label/README

This file was deleted.

143 changes: 0 additions & 143 deletions src/plugins/copyright_label/copyright.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/plugins/copyright_label/copyright_plugin.qrc

This file was deleted.

329 changes: 0 additions & 329 deletions src/plugins/copyright_label/plugin.cpp

This file was deleted.

1 change: 1 addition & 0 deletions src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ FILE(GLOB SYMBOLLAYER_UIS "${CMAKE_CURRENT_SOURCE_DIR}/symbollayer/*.ui")
QT4_WRAP_UI(QGIS_UIS_H ${QGIS_UIS} ${SYMBOLLAYER_UIS})

ADD_CUSTOM_TARGET(ui ALL DEPENDS ${QGIS_UIS_H})

21 changes: 20 additions & 1 deletion src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1054</width>
<height>24</height>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="mEditMenu">
Expand Down Expand Up @@ -98,6 +98,12 @@
<addaction name="mActionMeasureArea"/>
<addaction name="mActionMeasureAngle"/>
</widget>
<widget class="QMenu" name="menuDecorations">
<property name="title">
<string>&amp;Decorations</string>
</property>
<addaction name="mActionDecorationCopyright"/>
</widget>
<addaction name="mActionPan"/>
<addaction name="mActionZoomIn"/>
<addaction name="mActionZoomOut"/>
Expand All @@ -113,6 +119,7 @@
<addaction name="mActionZoomNext"/>
<addaction name="mActionZoomActualSize"/>
<addaction name="separator"/>
<addaction name="menuDecorations"/>
<addaction name="mActionMapTips"/>
<addaction name="mActionNewBookmark"/>
<addaction name="mActionShowBookmarks"/>
Expand Down Expand Up @@ -1483,6 +1490,18 @@
<string>Embed layers and groups from other project files</string>
</property>
</action>
<action name="mActionDecorationCopyright">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/plugins/copyright_label.png</normaloff>:/images/themes/default/plugins/copyright_label.png</iconset>
</property>
<property name="text">
<string>&amp;Copyright Label</string>
</property>
<property name="whatsThis">
<string>Creates a copyright label that is displayed on the map canvas.</string>
</property>
</action>
</widget>
<resources>
<include location="../../images/images.qrc"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsCopyrightLabelPluginGuiBase</class>
<widget class="QDialog" name="QgsCopyrightLabelPluginGuiBase">
<class>QgsDecorationCopyrightDialog</class>
<widget class="QDialog" name="QgsDecorationCopyrightDialog">
<property name="geometry">
<rect>
<x>0</x>
Expand All @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Copyright Label Plugin</string>
<string>Copyright Label Decoration</string>
</property>
<property name="windowIcon">
<iconset>
Expand Down Expand Up @@ -45,7 +45,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Verdana';&quot;&gt;© QGIS 2009&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
Expand Down Expand Up @@ -162,8 +162,6 @@ p, li { white-space: pre-wrap; }
<tabstop>pbnColorChooser</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="copyright_plugin.qrc"/>
</resources>
<resources/>
<connections/>
</ui>