bugfix1306.diff

Jürgen Fischer, 2008-09-10 02:14 PM

Download (5.22 KB)

View differences:

app/qgsattributetable.cpp (working copy)
24 24
#include "qgslogger.h"
25 25
#include "qgsvectordataprovider.h"
26 26
#include "qgsvectorlayer.h"
27
#include "qgisapp.h"
28
#include "qgsmapcanvas.h"
27 29

  
28 30
#include <QApplication>
29 31
#include <QClipboard>
30 32
#include <QHeaderView>
31 33
#include <QKeyEvent>
32 34
#include <QMenu>
35
#include <QSettings>
33 36

  
34 37

  
35 38
QgsAttributeTableItemDelegate::QgsAttributeTableItemDelegate( QgsAttributeTable *table, QObject *parent )
......
464 467
  }
465 468

  
466 469
  QgsFeatureList features;
467
  if ( layer->selectedFeatureCount() == 0 )
470

  
471
  QSettings settings;
472
  int behaviour = settings.value( "/qgis/attributeTableBehaviour", 0 ).toInt();
473

  
474
  if ( behaviour == 1 )
468 475
  {
469
    layer->select( layer->pendingAllAttributesList(), QgsRect(), false );
476
    // selected features
477
    features = layer->selectedFeatures();
478
  }
479
  else
480
  {
481
    QgsRect rect;
482
    if ( behaviour == 2 )
483
    {
484
      // current canvas
485
      rect = QgisApp::instance()->mapCanvas()->extent();
486
    }
470 487

  
488
    layer->select( layer->pendingAllAttributesList(), rect, false );
489

  
471 490
    QgsFeature f;
472 491
    while ( layer->getNextFeature( f ) )
473 492
      features << f;
474 493
  }
475
  else
476
  {
477
    features = layer->selectedFeatures();
478
  }
479 494

  
480 495
  setRowCount( features.size() );
481 496

  
......
559 574
  for ( QList<QTableWidgetSelectionRange>::iterator iter = selections.begin();iter != selections.end();++iter )
560 575
  {
561 576
    removeselection = true;
562
    while ( swaptorow<rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
577
    while ( swaptorow < rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
563 578
    {
564 579
      ++swaptorow;
565 580
    }
app/qgsoptions.cpp (working copy)
64 64
  leProxyPassword->setText( settings.value( "proxy/proxyPassword", "" ).toString() );
65 65
  // set the current theme
66 66
  cmbTheme->setItemText( cmbTheme->currentIndex(), settings.value( "/Themes" ).toString() );
67

  
68
  // set the attribute table behaviour
69
  cmbAttrTableBehaviour->clear();
70
  cmbAttrTableBehaviour->addItem( tr( "Show all features" ) );
71
  cmbAttrTableBehaviour->addItem( tr( "Show selected features" ) );
72
  cmbAttrTableBehaviour->addItem( tr( "Show features in current canvas" ) );
73
  cmbAttrTableBehaviour->setCurrentIndex( settings.value( "/qgis/attributeTableBehaviour", 0 ).toInt() );
74

  
67 75
  // set the display update threshold
68 76
  spinBoxUpdateThreshold->setValue( settings.value( "/Map/updateThreshold" ).toInt() );
69 77
  //set the default projection behaviour radio buttongs
......
257 265
  settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
258 266
  settings.setValue( "/qgis/hideSplash", cbxHideSplash->isChecked() );
259 267
  settings.setValue( "/qgis/dockAttributeTable", cbxAttributeTableDocked->isChecked() );
268
  settings.setValue( "/qgis/attributeTableBehaviour", cmbAttrTableBehaviour->currentIndex() );
260 269
  settings.setValue( "/qgis/new_layers_visible", chkAddedVisibility->isChecked() );
261 270
  settings.setValue( "/qgis/enable_anti_aliasing", chkAntiAliasing->isChecked() );
262 271
  settings.setValue( "/qgis/use_qimage_to_render", !( chkUseQPixmap->isChecked() ) );
gui/qgsmapcanvas.h (working copy)
129 129
    //! Returns the mapUnitsPerPixel (map units per pixel) for the canvas
130 130
    double mapUnitsPerPixel() const;
131 131

  
132
    //! Returns the current zoom exent of the map canvas
132
    //! Returns the current zoom extent of the map canvas
133 133
    QgsRect extent() const;
134 134
    //! Returns the combined exent for all layers on the map canvas
135 135
    QgsRect fullExtent() const;
ui/qgsoptionsbase.ui (working copy)
220 220
            </property>
221 221
           </widget>
222 222
          </item>
223
          <item row="6" column="0" >
224
           <widget class="QLabel" name="textLabel1_6" >
225
            <property name="sizePolicy" >
226
             <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
227
              <horstretch>0</horstretch>
228
              <verstretch>0</verstretch>
229
             </sizepolicy>
230
            </property>
231
            <property name="text" >
232
             <string>Attribute table behaviour</string>
233
            </property>
234
            <property name="buddy" >
235
             <cstring>cmbAttrTableBehaviour</cstring>
236
            </property>
237
           </widget>
238
          </item>
239
          <item row="6" column="1" >
240
           <widget class="QComboBox" name="cmbAttrTableBehaviour" >
241
            <property name="duplicatesEnabled" >
242
             <bool>false</bool>
243
            </property>
244
            <item>
245
             <property name="text" >
246
              <string/>
247
             </property>
248
            </item>
249
           </widget>
250
          </item>
223 251
         </layout>
224 252
        </widget>
225 253
       </item>