patch-25.diff

Suggested patch for #25 - luca76 -, 2010-09-15 12:48 AM

Download (2.55 KB)

View differences:

src/app/attributetable/qgsattributetabledialog.cpp (copia locale)
620 620
  int fldIndex = mLayer->fieldNameIndex( fieldName );
621 621
  QVariant::Type fldType = flds[fldIndex].type();
622 622
  bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double );
623
  QString sensString = "ILIKE";
624
  if (cbxCaseSensitive->isChecked()) {
625
     sensString = "LIKE";
626
  }
623 627

  
624 628
  QString str = QString( "%1 %2 '%3'" )
625 629
                .arg( QgsSearchTreeNode::quotedColumnRef( fieldName ) )
626
                .arg( numeric ? "=" : "~" )
627
                .arg( mQuery->displayText().replace( "'", "''" ) ); // escape quotes
628

  
630
                .arg( numeric ? "=" : sensString )
631
                .arg( numeric ? mQuery->displayText().replace( "'", "''" ) :
632
                                "%" + mQuery->displayText().replace ("'", "''") + "%"  ); // escape quotes
629 633
  doSearch( str );
630 634
}
631 635

  
src/ui/qgsattributetabledialog.ui (copia locale)
26 26
     <item>
27 27
      <widget class="QCheckBox" name="cbxShowSelectedOnly">
28 28
       <property name="text">
29
        <string>Show selected records only</string>
29
        <string>Show selected only</string>
30 30
       </property>
31 31
      </widget>
32 32
     </item>
33 33
     <item>
34 34
      <widget class="QCheckBox" name="cbxSearchSelectedOnly">
35 35
       <property name="text">
36
        <string>Search selected records only</string>
36
        <string>Search selected only</string>
37 37
       </property>
38 38
      </widget>
39 39
     </item>
40 40
     <item>
41
      <widget class="QCheckBox" name="cbxCaseSensitive">
42
       <property name="text">
43
        <string>Case sensitive</string>
44
       </property>
45
       <property name="checked">
46
        <bool>true</bool>
47
       </property>
48
      </widget>
49
     </item>
50
     <item>
41 51
      <spacer>
42 52
       <property name="orientation">
43 53
        <enum>Qt::Horizontal</enum>
......
68 78
     </item>
69 79
     <item>
70 80
      <widget class="QPushButton" name="mHelpButton">
81
       <property name="minimumSize">
82
        <size>
83
         <width>85</width>
84
         <height>0</height>
85
        </size>
86
       </property>
71 87
       <property name="text">
72
        <string>Help</string>
88
        <string>?</string>
73 89
       </property>
74 90
      </widget>
75 91
     </item>