measure_colour.diff

Patch against SVN 061217 - lars-luthman-gmail-com -, 2006-12-17 09:40 AM

Download (14.2 KB)

View differences:

src/gui/qgsoptions.cpp (working copy)
122 122
  myGreen = settings.value("/qgis/default_canvas_color_green",255).toInt();
123 123
  myBlue = settings.value("/qgis/default_canvas_color_blue",255).toInt();
124 124
  pbnCanvasColor->setColor( QColor(myRed,myGreen,myBlue) );
125
  
126
  // set the default color for the measure tool
127
  myRed = settings.value("/qgis/default_measure_color_red",180).toInt();
128
  myGreen = settings.value("/qgis/default_measure_color_green",180).toInt();
129
  myBlue = settings.value("/qgis/default_measure_color_blue",180).toInt();
130
  pbnMeasureColour->setColor( QColor(myRed,myGreen,myBlue) );
125 131

  
126 132
  capitaliseCheckBox->setChecked(settings.value("qgis/capitaliseLayerName", QVariant(false)).toBool());
127 133
  
......
151 157
    pbnCanvasColor->setColor(color);
152 158
  }
153 159
}
160

  
161
void QgsOptions::on_pbnMeasureColour_clicked()
162
{
163
  QColor color = QColorDialog::getColor(pbnMeasureColour->color(), this);
164
  if (color.isValid())
165
  {
166
    pbnMeasureColour->setColor(color);
167
  }
168
}
169

  
154 170
void QgsOptions::themeChanged(const QString &newThemeName)
155 171
{
156 172
  // Slot to change the theme as user scrolls through the choices
......
214 230
  myGreen = settings.writeEntry("/qgis/default_canvas_color_green",myColor.green());
215 231
  myBlue = settings.writeEntry("/qgis/default_canvas_color_blue",myColor.blue());
216 232

  
233
  //set the default color for the measure tool
234
  myColor = pbnMeasureColour->color();
235
  myRed = settings.writeEntry("/qgis/default_measure_color_red",myColor.red());
236
  myGreen = settings.writeEntry("/qgis/default_measure_color_green",myColor.green());
237
  myBlue = settings.writeEntry("/qgis/default_measure_color_blue",myColor.blue());
238

  
217 239
  settings.writeEntry("/qgis/wheel_action", cmbWheelAction->currentIndex());
218 240
  settings.writeEntry("/qgis/zoom_factor", spinZoomFactor->value());
219 241

  
src/gui/qgsoptions.h (working copy)
69 69
  void on_pbnSelectionColour_clicked();
70 70
  
71 71
  /*!
72
   * Slot to select the default measure tool colour
73
   */
74
  void on_pbnMeasureColour_clicked();
75

  
76
  /*!
72 77
   * Slot to select the default map selection colour
73 78
   */
74 79
  void on_pbnCanvasColor_clicked();
src/gui/qgsmeasure.cpp (working copy)
57 57
    connect( mMapCanvas, SIGNAL(renderComplete(QPainter*)), this, SLOT(mapCanvasChanged()) );
58 58
    
59 59
    mCalc = new QgsDistanceArea;
60
    
61
    // read color settings
62
    QSettings settings;
63
    int myRed = settings.readNumEntry("/qgis/default_measure_color_red", 180);
64
    int myGreen = settings.readNumEntry("/qgis/default_measure_color_green", 180);
65
    int myBlue = settings.readNumEntry("/qgis/default_measure_color_blue", 180);
60 66

  
61 67
    mRubberBand = new QgsRubberBand(mMapCanvas, mMeasureArea);
68
    mRubberBand->setColor(QColor(myRed, myGreen, myBlue));
62 69

  
63 70
    mCanvas->setCursor(Qt::CrossCursor);
64 71

  
......
104 111

  
105 112
    mRubberBand->reset(mMeasureArea);
106 113

  
114
    // re-read color settings
115
    QSettings settings;
116
    int myRed = settings.readNumEntry("/qgis/default_measure_color_red", 180);
117
    int myGreen = settings.readNumEntry("/qgis/default_measure_color_green", 180);
118
    int myBlue = settings.readNumEntry("/qgis/default_measure_color_blue", 180);
119
    mRubberBand->setColor(QColor(myRed, myGreen, myBlue));
120

  
107 121
    mRightMouseClicked = false;
108 122
}
109 123

  
src/ui/qgsoptionsbase.ui (working copy)
28 28
   <item row="0" column="0" >
29 29
    <widget class="QTabWidget" name="tabWidget" >
30 30
     <property name="currentIndex" >
31
      <number>0</number>
31
      <number>2</number>
32 32
     </property>
33 33
     <widget class="QWidget" name="tabAppearance" >
34 34
      <attribute name="title" >
......
149 149
             <string>Selection Color:</string>
150 150
            </property>
151 151
            <property name="buddy" >
152
             <cstring>pbnSelectionColour</cstring>
152
             <cstring>pbnMeasureColour</cstring>
153 153
            </property>
154 154
           </widget>
155 155
          </item>
......
405 405
       <property name="spacing" >
406 406
        <number>6</number>
407 407
       </property>
408
       <item row="3" column="0" >
409
        <spacer>
410
         <property name="orientation" >
411
          <enum>Qt::Vertical</enum>
412
         </property>
413
         <property name="sizeHint" >
414
          <size>
415
           <width>20</width>
416
           <height>40</height>
417
          </size>
418
         </property>
419
        </spacer>
420
       </item>
421
       <item row="0" column="0" >
422
        <widget class="QGroupBox" name="groupBox_7" >
408
       <item row="2" column="0" >
409
        <widget class="QGroupBox" name="groupBox_10" >
423 410
         <property name="title" >
424
          <string>Search radius</string>
411
          <string>Panning and zooming</string>
425 412
         </property>
426 413
         <layout class="QGridLayout" >
427 414
          <property name="margin" >
......
430 417
          <property name="spacing" >
431 418
           <number>6</number>
432 419
          </property>
433
          <item row="1" column="0" colspan="2" >
434
           <widget class="QLabel" name="textLabel2" >
420
          <item row="0" column="1" >
421
           <widget class="QComboBox" name="cmbWheelAction" >
422
            <item>
423
             <property name="text" >
424
              <string>Zoom</string>
425
             </property>
426
            </item>
427
            <item>
428
             <property name="text" >
429
              <string>Zoom and recenter</string>
430
             </property>
431
            </item>
432
            <item>
433
             <property name="text" >
434
              <string>Nothing</string>
435
             </property>
436
            </item>
437
           </widget>
438
          </item>
439
          <item row="1" column="0" >
440
           <widget class="QLabel" name="label_3" >
435 441
            <property name="text" >
436
             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
437
p, li { white-space: pre-wrap; }
438
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
439
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Note:&lt;/span> Specify the search radius as a percentage of the map width.&lt;/p>
440
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
442
             <string>Zoom factor:</string>
441 443
            </property>
442
            <property name="wordWrap" >
443
             <bool>true</bool>
444
            </property>
445 444
           </widget>
446 445
          </item>
447 446
          <item row="0" column="0" >
448
           <widget class="QLabel" name="textLabel1_3" >
447
           <widget class="QLabel" name="label_2" >
449 448
            <property name="text" >
450
             <string>Search Radius for Identifying Features</string>
449
             <string>Mouse wheel action:</string>
451 450
            </property>
452
            <property name="buddy" >
453
             <cstring>spinBoxIdentifyValue</cstring>
454
            </property>
455 451
           </widget>
456 452
          </item>
457
          <item row="0" column="1" >
458
           <widget class="QDoubleSpinBox" name="spinBoxIdentifyValue" >
459
            <property name="suffix" >
460
             <string>%</string>
453
          <item row="1" column="1" >
454
           <widget class="QDoubleSpinBox" name="spinZoomFactor" >
455
            <property name="decimals" >
456
             <number>1</number>
461 457
            </property>
462
            <property name="maximum" >
463
             <double>100.000000000000000</double>
458
            <property name="minimum" >
459
             <double>1.100000000000000</double>
464 460
            </property>
465
            <property name="singleStep" >
466
             <double>0.010000000000000</double>
467
            </property>
468 461
            <property name="value" >
469
             <double>5.000000000000000</double>
462
             <double>2.000000000000000</double>
470 463
            </property>
471 464
           </widget>
472 465
          </item>
......
485 478
          <property name="spacing" >
486 479
           <number>6</number>
487 480
          </property>
481
          <item row="1" column="2" >
482
           <spacer>
483
            <property name="orientation" >
484
             <enum>Qt::Horizontal</enum>
485
            </property>
486
            <property name="sizeHint" >
487
             <size>
488
              <width>191</width>
489
              <height>20</height>
490
             </size>
491
            </property>
492
           </spacer>
493
          </item>
494
          <item row="1" column="1" >
495
           <widget class="QgsColorButton" name="pbnMeasureColour" >
496
            <property name="minimumSize" >
497
             <size>
498
              <width>100</width>
499
              <height>0</height>
500
             </size>
501
            </property>
502
            <property name="text" >
503
             <string/>
504
            </property>
505
           </widget>
506
          </item>
507
          <item row="0" column="1" colspan="2" >
508
           <widget class="QComboBox" name="cmbEllipsoid" />
509
          </item>
510
          <item row="1" column="0" >
511
           <widget class="QLabel" name="textLabel1_10" >
512
            <property name="text" >
513
             <string>Rubberband color:</string>
514
            </property>
515
            <property name="buddy" >
516
             <cstring>cmbEllipsoid</cstring>
517
            </property>
518
           </widget>
519
          </item>
488 520
          <item row="0" column="0" >
489 521
           <widget class="QLabel" name="textLabel1_8" >
490 522
            <property name="text" >
......
495 527
            </property>
496 528
           </widget>
497 529
          </item>
498
          <item row="0" column="1" >
499
           <widget class="QComboBox" name="cmbEllipsoid" />
500
          </item>
501 530
         </layout>
502 531
        </widget>
503 532
       </item>
504
       <item row="2" column="0" >
505
        <widget class="QGroupBox" name="groupBox_10" >
533
       <item row="0" column="0" >
534
        <widget class="QGroupBox" name="groupBox_7" >
506 535
         <property name="title" >
507
          <string>Panning and zooming</string>
536
          <string>Search radius</string>
508 537
         </property>
509 538
         <layout class="QGridLayout" >
510 539
          <property name="margin" >
......
513 542
          <property name="spacing" >
514 543
           <number>6</number>
515 544
          </property>
516
          <item row="0" column="1" >
517
           <widget class="QComboBox" name="cmbWheelAction" >
518
            <item>
519
             <property name="text" >
520
              <string>Zoom</string>
521
             </property>
522
            </item>
523
            <item>
524
             <property name="text" >
525
              <string>Zoom and recenter</string>
526
             </property>
527
            </item>
528
            <item>
529
             <property name="text" >
530
              <string>Nothing</string>
531
             </property>
532
            </item>
533
           </widget>
534
          </item>
535
          <item row="1" column="0" >
536
           <widget class="QLabel" name="label_3" >
545
          <item row="1" column="0" colspan="2" >
546
           <widget class="QLabel" name="textLabel2" >
537 547
            <property name="text" >
538
             <string>Zoom factor:</string>
548
             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
549
p, li { white-space: pre-wrap; }
550
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
551
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Note:&lt;/span> Specify the search radius as a percentage of the map width.&lt;/p>
552
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
539 553
            </property>
554
            <property name="wordWrap" >
555
             <bool>true</bool>
556
            </property>
540 557
           </widget>
541 558
          </item>
542 559
          <item row="0" column="0" >
543
           <widget class="QLabel" name="label_2" >
560
           <widget class="QLabel" name="textLabel1_3" >
544 561
            <property name="text" >
545
             <string>Mouse wheel action:</string>
562
             <string>Search Radius for Identifying Features</string>
546 563
            </property>
564
            <property name="buddy" >
565
             <cstring>spinBoxIdentifyValue</cstring>
566
            </property>
547 567
           </widget>
548 568
          </item>
549
          <item row="1" column="1" >
550
           <widget class="QDoubleSpinBox" name="spinZoomFactor" >
551
            <property name="decimals" >
552
             <number>1</number>
569
          <item row="0" column="1" >
570
           <widget class="QDoubleSpinBox" name="spinBoxIdentifyValue" >
571
            <property name="suffix" >
572
             <string>%</string>
553 573
            </property>
554
            <property name="minimum" >
555
             <double>1.100000000000000</double>
574
            <property name="maximum" >
575
             <double>100.000000000000000</double>
556 576
            </property>
577
            <property name="singleStep" >
578
             <double>0.010000000000000</double>
579
            </property>
557 580
            <property name="value" >
558
             <double>2.000000000000000</double>
581
             <double>5.000000000000000</double>
559 582
            </property>
560 583
           </widget>
561 584
          </item>
562 585
         </layout>
563 586
        </widget>
564 587
       </item>
588
       <item row="3" column="0" >
589
        <spacer>
590
         <property name="orientation" >
591
          <enum>Qt::Vertical</enum>
592
         </property>
593
         <property name="sizeHint" >
594
          <size>
595
           <width>20</width>
596
           <height>40</height>
597
          </size>
598
         </property>
599
        </spacer>
600
       </item>
565 601
      </layout>
566 602
     </widget>
567 603
     <widget class="QWidget" name="TabPage" >