Skip to content

Commit

Permalink
automatic indentation update (r11371-r12139)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12141 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 16, 2009
1 parent 8563611 commit ca3c014
Show file tree
Hide file tree
Showing 45 changed files with 740 additions and 731 deletions.
22 changes: 15 additions & 7 deletions src/app/attributetable/qgsattributetabledialog.cpp
Expand Up @@ -389,7 +389,7 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click
if ( clickType == 0 ) // Single click
{
if ( mSelectedFeatures.size() == 1 && wasSelected ) // One item selected
return; // Click over a selected item doesn't do anything
return; // Click over a selected item doesn't do anything

mView->setCurrentIndex( mFilterModel->index( first, 0 ) );
mView->selectRow( first );
Expand Down Expand Up @@ -418,10 +418,14 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click

// Remove items in mSelectedFeatures if they aren't in mNewSelection
QgsFeatureIds::Iterator it = mSelectedFeatures.begin();
while ( it != mSelectedFeatures.end() ) {
if ( !newSelection.contains( *it ) ) {
while ( it != mSelectedFeatures.end() )
{
if ( !newSelection.contains( *it ) )
{
it = mSelectedFeatures.erase( it );
} else {
}
else
{
++it;
}
}
Expand Down Expand Up @@ -461,10 +465,14 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click

// Remove items in mSelectedFeatures if they aren't in mNewSelection
QgsFeatureIds::Iterator it = mSelectedFeatures.begin();
while ( it != mSelectedFeatures.end() ) {
if ( !newSelection.contains( *it ) ) {
while ( it != mSelectedFeatures.end() )
{
if ( !newSelection.contains( *it ) )
{
it = mSelectedFeatures.erase( it );
} else {
}
else
{
++it;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -27,8 +27,8 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend ): m

//add widget for item properties
QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, legend );
toolBox->addItem( itemPropertiesWidget, tr( "Item Options") );
toolBox->addItem( itemPropertiesWidget, tr( "Item Options" ) );

if ( legend )
{
mItemTreeView->setModel( legend->model() );
Expand Down
210 changes: 105 additions & 105 deletions src/app/composer/qgscomposermanager.cpp
Expand Up @@ -21,11 +21,11 @@
#include <QListWidgetItem>
#include <QMessageBox>

QgsComposerManager::QgsComposerManager(QgisApp* app, QWidget * parent, Qt::WindowFlags f): QDialog(parent, f), mQgisApp(app)
QgsComposerManager::QgsComposerManager( QgisApp* app, QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ), mQgisApp( app )
{
setupUi(this);
connect(mButtonBox, SIGNAL(rejected()), this, SLOT(close()));
initialize();
setupUi( this );
connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
initialize();
}

QgsComposerManager::~QgsComposerManager()
Expand All @@ -35,125 +35,125 @@ QgsComposerManager::~QgsComposerManager()

void QgsComposerManager::initialize()
{
if(!mQgisApp)
{
return;
}

QSet<QgsComposer*> composers = mQgisApp->printComposers();
QSet<QgsComposer*>::const_iterator it = composers.constBegin();
for(; it != composers.constEnd(); ++it)
{
QListWidgetItem* item = new QListWidgetItem((*it)->title(), mComposerListWidget);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
mItemComposerMap.insert(item, *it);
}
if ( !mQgisApp )
{
return;
}

QSet<QgsComposer*> composers = mQgisApp->printComposers();
QSet<QgsComposer*>::const_iterator it = composers.constBegin();
for ( ; it != composers.constEnd(); ++it )
{
QListWidgetItem* item = new QListWidgetItem(( *it )->title(), mComposerListWidget );
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
mItemComposerMap.insert( item, *it );
}
}

void QgsComposerManager::on_mAddButton_clicked()
{
if(!mQgisApp)
{
return;
}
QgsComposer* newComposer = mQgisApp->createNewComposer();
if(!newComposer)
{
return;
}
QListWidgetItem* item = new QListWidgetItem(newComposer->title(), mComposerListWidget);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
mItemComposerMap.insert(item, newComposer);
if ( !mQgisApp )
{
return;
}
QgsComposer* newComposer = mQgisApp->createNewComposer();
if ( !newComposer )
{
return;
}
QListWidgetItem* item = new QListWidgetItem( newComposer->title(), mComposerListWidget );
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
mItemComposerMap.insert( item, newComposer );
}

void QgsComposerManager::on_mRemoveButton_clicked()
{
if(!mQgisApp)
{
return;
}

QListWidgetItem* item = mComposerListWidget->currentItem();
if(!item)
{
return;
}

//ask for confirmation
if(QMessageBox::warning(0, tr("Remove composer"), tr("Do you really want to remove the map composer '%1'?").arg(item->text()), QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
{
return;
}

//delete composer
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find(item);
if(it != mItemComposerMap.end())
{
mQgisApp->deleteComposer(it.value());
}
mItemComposerMap.remove(item);
mComposerListWidget->removeItemWidget(item);
//and remove the list widget row
delete (mComposerListWidget->takeItem(mComposerListWidget->row(item)));
if ( !mQgisApp )
{
return;
}

QListWidgetItem* item = mComposerListWidget->currentItem();
if ( !item )
{
return;
}

//ask for confirmation
if ( QMessageBox::warning( 0, tr( "Remove composer" ), tr( "Do you really want to remove the map composer '%1'?" ).arg( item->text() ), QMessageBox::Ok | QMessageBox::Cancel ) != QMessageBox::Ok )
{
return;
}

//delete composer
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
if ( it != mItemComposerMap.end() )
{
mQgisApp->deleteComposer( it.value() );
}
mItemComposerMap.remove( item );
mComposerListWidget->removeItemWidget( item );
//and remove the list widget row
delete( mComposerListWidget->takeItem( mComposerListWidget->row( item ) ) );
}

void QgsComposerManager::on_mShowPushButton_clicked()
{
if(!mQgisApp)
{
return;
}

QListWidgetItem* item = mComposerListWidget->currentItem();
if(!item)
{
return;
}

//delete composer
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find(item);
if(it != mItemComposerMap.end())
{
it.value()->show();
it.value()->activate();
it.value()->stackUnder(this);
}
if ( !mQgisApp )
{
return;
}

QListWidgetItem* item = mComposerListWidget->currentItem();
if ( !item )
{
return;
}

//delete composer
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
if ( it != mItemComposerMap.end() )
{
it.value()->show();
it.value()->activate();
it.value()->stackUnder( this );
}
}

void QgsComposerManager::on_mRenamePushButton_clicked()
{
QListWidgetItem* item = mComposerListWidget->currentItem();
if(!item)
{
return;
}

QString currentTitle;
QgsComposer* currentComposer = 0;
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find(item);
if(it != mItemComposerMap.end())
{
currentComposer = it.value();
currentTitle = it.value()->title();
}
else
{
return;
}
QString newTitle = QInputDialog::getText(0, tr("Change title"), tr("Title"), QLineEdit::Normal, currentTitle );
if(newTitle.isNull())
{
return;
}
currentComposer->setTitle(newTitle);
item->setText(newTitle);
QListWidgetItem* item = mComposerListWidget->currentItem();
if ( !item )
{
return;
}

QString currentTitle;
QgsComposer* currentComposer = 0;
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
if ( it != mItemComposerMap.end() )
{
currentComposer = it.value();
currentTitle = it.value()->title();
}
else
{
return;
}
QString newTitle = QInputDialog::getText( 0, tr( "Change title" ), tr( "Title" ), QLineEdit::Normal, currentTitle );
if ( newTitle.isNull() )
{
return;
}
currentComposer->setTitle( newTitle );
item->setText( newTitle );
}

void QgsComposerManager::on_mComposerListWidget_itemChanged( QListWidgetItem * item )
{
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find(item);
if(it != mItemComposerMap.end())
{
it.value()->setTitle(item->text());
}
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
if ( it != mItemComposerMap.end() )
{
it.value()->setTitle( item->text() );
}
}
36 changes: 18 additions & 18 deletions src/app/composer/qgscomposermanager.h
Expand Up @@ -28,24 +28,24 @@ instances and change title of existing ones*/
class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
{
Q_OBJECT
public:
QgsComposerManager(QgisApp* app, QWidget * parent = 0, Qt::WindowFlags f = 0);
~QgsComposerManager();


private:
QgisApp* mQgisApp;
/**Stores the relation between items and composer pointers */
QMap<QListWidgetItem*, QgsComposer*> mItemComposerMap;
/**Enters the composer instances and created the item-composer map*/
void initialize();

private slots:
void on_mAddButton_clicked();
void on_mRemoveButton_clicked();
void on_mShowPushButton_clicked();
void on_mRenamePushButton_clicked();
void on_mComposerListWidget_itemChanged( QListWidgetItem * item );
public:
QgsComposerManager( QgisApp* app, QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsComposerManager();


private:
QgisApp* mQgisApp;
/**Stores the relation between items and composer pointers */
QMap<QListWidgetItem*, QgsComposer*> mItemComposerMap;
/**Enters the composer instances and created the item-composer map*/
void initialize();

private slots:
void on_mAddButton_clicked();
void on_mRemoveButton_clicked();
void on_mShowPushButton_clicked();
void on_mRenamePushButton_clicked();
void on_mComposerListWidget_itemChanged( QListWidgetItem * item );
};

#endif // QGSCOMPOSERMANAGER_H

0 comments on commit ca3c014

Please sign in to comment.