Set-QgsCollapsibleGroupBox-autosave-to-false.patch

patch - Olivier Dalang, 2013-02-09 08:34 AM

Download (21.9 KB)

View differences:

python/gui/qgscollapsiblegroupbox.sip
1
/**
2
 * \class QgsCollapsibleGroupBox
3
 * \brief A groupbox that collapses/expands when toggled.
4
 * It is capable of saving it's collapsed and/or checked state.
5
 * Those states are saved using the widget's and it's parent names.
6
 *
7
 * To add Collapsible properties in promoted QtDesigner widgets,
8
 * you can add the following "Dynamic properties" by clicking
9
 * on the green + in the propreties palette :
10
 * bool collapsed,
11
 * bool saveCollapsedState,
12
 * bool saveCheckedState
13
 */
14

  
1 15
class QgsCollapsibleGroupBox : QGroupBox
2 16
{
3 17
%TypeHeaderCode
src/gui/qgscollapsiblegroupbox.cpp
71 71
  }
72 72
  // variables
73 73
  mCollapsed = false;
74
  mSaveCollapsedState = true;
74
  mSaveCollapsedState = false;
75 75
  // NOTE: only turn on mSaveCheckedState for groupboxes NOT used
76 76
  // in multiple places or used as options for different parent objects
77 77
  mSaveCheckedState = false;
src/gui/qgscollapsiblegroupbox.h
22 22

  
23 23
/** \ingroup gui
24 24
 * A groupbox that collapses/expands when toggled.
25
 * @note Collapsible function not shown in promoted QtDesigner widgets.
25
 * A groupbox that collapses/expands when toggled.
26
 * It is capable of saving it's collapsed and/or checked state.
27
 * Those states are saved using the widget's and it's parent names.
28
 *
29
 * To add Collapsible properties in promoted QtDesigner widgets,
30
 * you can add the following "Dynamic properties" by clicking
31
 * on the green + in the propreties palette :
32
 * bool collapsed,
33
 * bool saveCollapsedState,
34
 * bool saveCheckedState
26 35
 */
27 36

  
28 37
#include <QGroupBox>
......
36 45
{
37 46
    Q_OBJECT
38 47

  
48
    Q_PROPERTY(bool collapsed READ isCollapsed WRITE setCollapsed USER true)
49
    Q_PROPERTY(bool saveCollapsedState READ saveCollapsedState WRITE setSaveCollapsedState USER true)
50
    Q_PROPERTY(bool saveCheckedState READ saveCheckedState WRITE setSaveCheckedState USER true)
51

  
39 52
  public:
40 53
    QgsCollapsibleGroupBox( QWidget *parent = 0, QSettings* settings = 0 );
41 54
    QgsCollapsibleGroupBox( const QString &title, QWidget *parent = 0, QSettings* settings = 0 );
src/ui/qgscomposeritemwidgetbase.ui
26 26
   </item>
27 27
   <item row="1" column="0" colspan="2">
28 28
    <widget class="QgsCollapsibleGroupBox" name="mFrameGroupBox">
29
               <property name="collapsed" stdset="0"><bool>false</bool></property>
30
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
31
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
29 32
     <property name="title">
30 33
      <string>Show frame</string>
31 34
     </property>
......
61 64
   </item>
62 65
   <item row="2" column="0" colspan="2">
63 66
    <widget class="QgsCollapsibleGroupBox" name="mBackgroundGroupBox">
67
               <property name="collapsed" stdset="0"><bool>false</bool></property>
68
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
69
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
64 70
     <property name="title">
65 71
      <string>Show background</string>
66 72
     </property>
src/ui/qgslabelingguibase.ui
170 170
          <bool>false</bool>
171 171
         </property>
172 172
         <widget class="QgsCollapsibleGroupBox" name="groupBox_mPreview">
173
               <property name="collapsed" stdset="0"><bool>false</bool></property>
174
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
175
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
173 176
          <property name="sizePolicy">
174 177
           <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
175 178
            <horstretch>0</horstretch>
......
463 466
            </property>
464 467
            <item row="9" column="0">
465 468
             <widget class="QgsCollapsibleGroupBox" name="chkFormattedNumbers">
469
               <property name="collapsed" stdset="0"><bool>false</bool></property>
470
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
471
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
466 472
              <property name="sizePolicy">
467 473
               <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
468 474
                <horstretch>0</horstretch>
......
530 536
            </item>
531 537
            <item row="7" column="0">
532 538
             <widget class="QgsCollapsibleGroupBox" name="mFontMultiLineGroupBox">
539
               <property name="collapsed" stdset="0"><bool>false</bool></property>
540
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
541
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
533 542
              <property name="minimumSize">
534 543
               <size>
535 544
                <width>0</width>
......
678 687
            </item>
679 688
            <item row="2" column="0">
680 689
             <widget class="QgsCollapsibleGroupBox" name="mFontStyleGroupBox">
690
               <property name="collapsed" stdset="0"><bool>false</bool></property>
691
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
692
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
681 693
              <property name="sizePolicy">
682 694
               <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
683 695
                <horstretch>0</horstretch>
......
1162 1174
            </item>
1163 1175
            <item row="4" column="0">
1164 1176
             <widget class="QgsCollapsibleGroupBox" name="chkBuffer">
1177
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1178
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1179
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1165 1180
              <property name="sizePolicy">
1166 1181
               <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
1167 1182
                <horstretch>0</horstretch>
......
1413 1428
            </item>
1414 1429
            <item row="6" column="0">
1415 1430
             <widget class="QgsCollapsibleGroupBox" name="mFontLimitPixelGroupBox">
1431
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1432
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1433
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1416 1434
              <property name="title">
1417 1435
               <string>Pixel size-based visibility</string>
1418 1436
              </property>
......
1551 1569
            </item>
1552 1570
            <item row="5" column="0">
1553 1571
             <widget class="QgsCollapsibleGroupBox" name="chkScaleBasedVisibility">
1572
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1573
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1574
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1554 1575
              <property name="sizePolicy">
1555 1576
               <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
1556 1577
                <horstretch>0</horstretch>
......
1692 1713
            </item>
1693 1714
            <item row="8" column="0">
1694 1715
             <widget class="QgsCollapsibleGroupBox" name="mDirectSymbGroupBox">
1716
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1717
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1718
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1695 1719
              <property name="title">
1696 1720
               <string>Line direction symbols</string>
1697 1721
              </property>
......
1930 1954
           </property>
1931 1955
           <item row="1" column="0">
1932 1956
            <widget class="QgsCollapsibleGroupBox" name="mPriorityGroupBox">
1957
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1958
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1959
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1933 1960
             <property name="maximumSize">
1934 1961
              <size>
1935 1962
               <width>16777215</width>
......
1978 2005
           </item>
1979 2006
           <item row="0" column="0">
1980 2007
            <widget class="QgsCollapsibleGroupBox" name="mPlacementGroupBox">
2008
               <property name="collapsed" stdset="0"><bool>false</bool></property>
2009
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
2010
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1981 2011
             <property name="sizePolicy">
1982 2012
              <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
1983 2013
               <horstretch>0</horstretch>
......
2732 2762
           </item>
2733 2763
           <item row="2" column="0">
2734 2764
            <widget class="QgsCollapsibleGroupBox" name="mOptionsGroupBox">
2765
               <property name="collapsed" stdset="0"><bool>false</bool></property>
2766
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
2767
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
2735 2768
             <property name="maximumSize">
2736 2769
              <size>
2737 2770
               <width>16777215</width>
......
3004 3037
           </property>
3005 3038
           <item row="3" column="0">
3006 3039
            <widget class="QgsCollapsibleGroupBox" name="mBufferAttributesPropertiesGroupBox">
3040
               <property name="collapsed" stdset="0"><bool>false</bool></property>
3041
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
3042
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
3007 3043
             <property name="title">
3008 3044
              <string>Buffer properties</string>
3009 3045
             </property>
......
3050 3086
           </item>
3051 3087
           <item row="4" column="0">
3052 3088
            <widget class="QgsCollapsibleGroupBox" name="mPositionAttributeGroupBox">
3089
               <property name="collapsed" stdset="0"><bool>false</bool></property>
3090
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
3091
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
3053 3092
             <property name="title">
3054 3093
              <string>Position</string>
3055 3094
             </property>
......
3148 3187
           </item>
3149 3188
           <item row="1" column="0">
3150 3189
            <widget class="QgsCollapsibleGroupBox" name="mDisplayAttributesPropertiesGroupBox">
3190
               <property name="collapsed" stdset="0"><bool>false</bool></property>
3191
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
3192
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
3151 3193
             <property name="title">
3152 3194
              <string>Display properties</string>
3153 3195
             </property>
......
3212 3254
           </item>
3213 3255
           <item row="2" column="0">
3214 3256
            <widget class="QgsCollapsibleGroupBox" name="mFontAttributePropertiesGroupBox">
3257
               <property name="collapsed" stdset="0"><bool>false</bool></property>
3258
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
3259
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
3215 3260
             <property name="sizePolicy">
3216 3261
              <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
3217 3262
               <horstretch>0</horstretch>
src/ui/qgsoptionsbase.ui
998 998
                  </item>
999 999
                  <item row="2" column="0" colspan="4">
1000 1000
                   <widget class="QgsCollapsibleGroupBox" name="mCurrentVariablesGrpBx">
1001
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1002
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1003
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1001 1004
                    <property name="minimumSize">
1002 1005
                     <size>
1003 1006
                      <width>0</width>
......
3748 3751
               </item>
3749 3752
               <item>
3750 3753
                <widget class="QgsCollapsibleGroupBox" name="grpProxy">
3754
               <property name="collapsed" stdset="0"><bool>false</bool></property>
3755
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
3756
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
3751 3757
                 <property name="title">
3752 3758
                  <string>Use proxy for web access</string>
3753 3759
                 </property>
src/ui/qgsprojectpropertiesbase.ui
844 844
          <layout class="QGridLayout" name="gridLayout_15">
845 845
           <item row="0" column="0">
846 846
            <widget class="QgsCollapsibleGroupBox" name="grpOWSServiceCapabilities">
847
               <property name="collapsed" stdset="0"><bool>false</bool></property>
848
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
849
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
847 850
             <property name="title">
848 851
              <string>Service Capabilitities</string>
849 852
             </property>
......
980 983
             <layout class="QGridLayout" name="gridLayout_14">
981 984
              <item row="0" column="0">
982 985
               <widget class="QgsCollapsibleGroupBox" name="grpWMSExt">
986
               <property name="collapsed" stdset="0"><bool>false</bool></property>
987
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
988
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
983 989
                <property name="title">
984 990
                 <string>Advertised Extent</string>
985 991
                </property>
......
1083 1089
              </item>
1084 1090
              <item row="0" column="1" colspan="2">
1085 1091
               <widget class="QgsCollapsibleGroupBox" name="grpWMSList">
1092
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1093
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1094
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1086 1095
                <property name="title">
1087 1096
                 <string>Coordinate Systems Restrictions</string>
1088 1097
                </property>
......
1122 1131
              </item>
1123 1132
              <item row="1" column="0">
1124 1133
               <widget class="QgsCollapsibleGroupBox" name="mWMSComposerGroupBox">
1134
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1135
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1136
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1125 1137
                <property name="title">
1126 1138
                 <string>Exclude composers</string>
1127 1139
                </property>
......
1175 1187
              </item>
1176 1188
              <item row="1" column="2">
1177 1189
               <widget class="QgsCollapsibleGroupBox" name="mLayerRestrictionsGroupBox">
1190
               <property name="collapsed" stdset="0"><bool>false</bool></property>
1191
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
1192
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
1178 1193
                <property name="title">
1179 1194
                 <string>Exclude layers</string>
1180 1195
                </property>
src/ui/qgsrasterlayerpropertiesbase.ui
159 159
       </item>
160 160
       <item>
161 161
        <widget class="QgsCollapsibleGroupBox" name="mResamplingGroupBox">
162
               <property name="collapsed" stdset="0"><bool>false</bool></property>
163
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
164
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
162 165
         <property name="title">
163 166
          <string>Resampling</string>
164 167
         </property>
src/ui/qgsrasterlayersaveasdialogbase.ui
223 223
       </property>
224 224
       <item>
225 225
        <widget class="QgsCollapsibleGroupBox" name="mExtentGroupBox">
226
               <property name="collapsed" stdset="0"><bool>false</bool></property>
227
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
228
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
226 229
         <property name="sizePolicy">
227 230
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
228 231
           <horstretch>0</horstretch>
......
381 384
       </item>
382 385
       <item>
383 386
        <widget class="QgsCollapsibleGroupBox" name="mResolutionGroupBox">
387
               <property name="collapsed" stdset="0"><bool>false</bool></property>
388
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
389
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
384 390
         <property name="sizePolicy">
385 391
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
386 392
           <horstretch>0</horstretch>
......
466 472
       </item>
467 473
       <item>
468 474
        <widget class="QgsCollapsibleGroupBox" name="mTilesGroupBox">
475
               <property name="collapsed" stdset="0"><bool>false</bool></property>
476
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
477
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
469 478
         <property name="sizePolicy">
470 479
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
471 480
           <horstretch>0</horstretch>
......
521 530
       </item>
522 531
       <item>
523 532
        <widget class="QgsCollapsibleGroupBox" name="mCreateOptionsGroupBox">
533
               <property name="collapsed" stdset="0"><bool>false</bool></property>
534
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
535
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
524 536
         <property name="sizePolicy">
525 537
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
526 538
           <horstretch>0</horstretch>
......
545 557
       </item>
546 558
       <item>
547 559
        <widget class="QgsCollapsibleGroupBox" name="mPyramidsGroupBox">
560
               <property name="collapsed" stdset="0"><bool>false</bool></property>
561
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
562
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
548 563
         <property name="sizePolicy">
549 564
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
550 565
           <horstretch>0</horstretch>
......
629 644
       </item>
630 645
       <item>
631 646
        <widget class="QgsCollapsibleGroupBox" name="mNoDataGroupBox">
647
               <property name="collapsed" stdset="0"><bool>false</bool></property>
648
               <property name="saveCheckedState" stdset="0"><bool>false</bool></property>
649
               <property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
632 650
         <property name="sizePolicy">
633 651
          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
634 652
           <horstretch>0</horstretch>
635
-