[Kstars-devel] [kstars] kstars: 1. Rename the 'Backends' tab under 'Advanced' options to 'General' and

Akarsh Simha akarshsimha at gmail.com
Sat Apr 14 12:41:54 UTC 2012


Git commit 624f0c5faba1daf3558159bcd1eff7fe35c0e4cb by Akarsh Simha.
Committed on 14/04/2012 at 14:37.
Pushed by asimha into branch 'master'.

1. Rename the 'Backends' tab under 'Advanced' options to 'General' and
   add a "DSS Imagery" group in it.

2. DSS Image default size / padding is now configurable.

CCMAIL: kstars-devel at kde.org

M  +13   -0    kstars/kstars.kcfg
M  +4    -3    kstars/ksutils.cpp
M  +152  -47   kstars/options/opsadvanced.ui
M  +1    -1    kstars/tools/observinglist.cpp

http://commits.kde.org/kstars/624f0c5faba1daf3558159bcd1eff7fe35c0e4cb

diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 633c4d4..258d0f6 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1130,4 +1130,17 @@
       <whatsthis>List of selected satellites.</whatsthis>
     </entry>
   </group>
+  <group name="General">
+    <entry name="DefaultDSSImageSize" type="Double">
+      <label>Default size for DSS images</label>
+      <whatsthis>The default size for DSS images downloaded from the internet.</whatsthis>
+      <default>15.0</default>
+    </entry>
+    <entry name="DSSPadding" type="Double">
+      <label>Additional padding around DSS Images of deep-sky objects</label>
+      <whatsthis>To include parts of the star field, we add some extra padding around DSS images of deep-sky objects. This option configures the total (both sides) padding added to either dimension of the field.</whatsthis>
+      <default>10.0</default>
+    </entry>
+  </group>
+
 </kcfg>
diff --git a/kstars/ksutils.cpp b/kstars/ksutils.cpp
index 631d9dd..b39edf9 100644
--- a/kstars/ksutils.cpp
+++ b/kstars/ksutils.cpp
@@ -19,6 +19,7 @@
 
 #include "deepskyobject.h"
 #include "skyobject.h"
+#include "Options.h"
 
 #include <QFile>
 
@@ -41,8 +42,8 @@ QString KSUtils::getDSSURL( const SkyPoint * const p ) {
         dms ra(0.0), dec(0.0);
         double height, width;
 
-        const double dss_default_size = 15.0; // TODO: Make this user-configurable
-        const double dss_padding = 10.0; // TODO: Make this user-configurable
+        double dss_default_size = Options::defaultDSSImageSize();
+        double dss_padding = Options::dSSPadding();
 
         Q_ASSERT( p );
         Q_ASSERT( dss_default_size > 0.0 && dss_padding >= 0.0 );
@@ -93,7 +94,7 @@ QString KSUtils::getDSSURL( const SkyPoint * const p ) {
 QString KSUtils::getDSSURL( const dms &ra, const dms &dec, float width, float height ) {
     const QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=1" );
     const QString URLsuffix( "&e=J2000&f=gif&c=none&fov=NONE" );
-    const double dss_default_size = 15.0; // Duplicate. TODO: Make this user-configurable
+    const double dss_default_size = Options::defaultDSSImageSize();
 
     char decsgn = ( dec.Degrees() < 0.0 ) ? '-' : '+';
     int dd = abs( dec.degree() );
diff --git a/kstars/options/opsadvanced.ui b/kstars/options/opsadvanced.ui
index 2b236c6..edf504b 100644
--- a/kstars/options/opsadvanced.ui
+++ b/kstars/options/opsadvanced.ui
@@ -20,8 +20,159 @@
    <item>
     <widget class="QTabWidget" name="AdvancedOptionsTabWidget">
      <property name="currentIndex">
-      <number>2</number>
+      <number>0</number>
      </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>&General</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QGroupBox" name="BackendsGroupBox">
+         <property name="title">
+          <string>Backends</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_4">
+          <item>
+           <widget class="QCheckBox" name="kcfg_UseRefraction">
+            <property name="toolTip">
+             <string>Correct coordinates of objects for the effects of the atmosphere</string>
+            </property>
+            <property name="whatsThis">
+             <string>The atmosphere bends light passing through it, like a lens.  If this item is checked, this "atmospheric refraction" will be simulated in the sky map.  Note that this correction is only applied when using the Horizontal coordinate system.</string>
+            </property>
+            <property name="text">
+             <string>Correct for atmospheric refraction</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="kcfg_UseRelativistic">
+            <property name="toolTip">
+             <string>Correct for the effect of sun's gravity on star positions, as predicted by General Relativity, and verified by Eddington's experiment.</string>
+            </property>
+            <property name="text">
+             <string>General Relativity effects near the sun</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="ImageryGroupBox">
+         <property name="title">
+          <string>DSS Imagery</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout">
+          <item row="0" column="0">
+           <widget class="QLabel" name="label">
+            <property name="text">
+             <string>Default DSS Image Size: </string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QDoubleSpinBox" name="kcfg_DefaultDSSImageSize">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>75</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="decimals">
+             <number>1</number>
+            </property>
+            <property name="minimum">
+             <double>1.000000000000000</double>
+            </property>
+            <property name="maximum">
+             <double>75.000000000000000</double>
+            </property>
+            <property name="value">
+             <double>15.000000000000000</double>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="3">
+           <widget class="QLabel" name="DefaultDSSImageSizeUnitLabel">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>arcminutes</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="label_3">
+            <property name="text">
+             <string>Padding around Deep Sky Objects:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QDoubleSpinBox" name="kcfg_DSSPadding">
+            <property name="minimumSize">
+             <size>
+              <width>75</width>
+              <height>0</height>
+             </size>
+            </property>
+            <property name="decimals">
+             <number>1</number>
+            </property>
+            <property name="minimum">
+             <double>1.000000000000000</double>
+            </property>
+            <property name="maximum">
+             <double>75.000000000000000</double>
+            </property>
+            <property name="value">
+             <double>10.000000000000000</double>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="2" colspan="2">
+           <widget class="QLabel" name="DSSPaddingUnitLabel">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>arcminutes</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="GeneralTabSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="tab_3">
       <attribute name="title">
        <string>Look and &Feel</string>
@@ -350,52 +501,6 @@
         </spacer>
        </item>
       </layout>
-      <zorder>textLabelHideTimeStep</zorder>
-      <zorder>verticalLayoutWidget_3</zorder>
-      <zorder>verticalLayoutWidget_2</zorder>
-     </widget>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>&Backends</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QCheckBox" name="kcfg_UseRefraction">
-         <property name="toolTip">
-          <string>Correct coordinates of objects for the effects of the atmosphere</string>
-         </property>
-         <property name="whatsThis">
-          <string>The atmosphere bends light passing through it, like a lens.  If this item is checked, this "atmospheric refraction" will be simulated in the sky map.  Note that this correction is only applied when using the Horizontal coordinate system.</string>
-         </property>
-         <property name="text">
-          <string>Correct for atmospheric refraction</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="kcfg_UseRelativistic">
-         <property name="toolTip">
-          <string>Correct for the effect of sun's gravity on star positions, as predicted by General Relativity, and verified by Eddington's experiment.</string>
-         </property>
-         <property name="text">
-          <string>General Relativity effects near the sun</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_3">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>537</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
      </widget>
      <widget class="QWidget" name="tab_2">
       <attribute name="title">
diff --git a/kstars/tools/observinglist.cpp b/kstars/tools/observinglist.cpp
index 25ff29a..1a76a2f 100644
--- a/kstars/tools/observinglist.cpp
+++ b/kstars/tools/observinglist.cpp
@@ -1192,7 +1192,7 @@ bool ObservingList::eventFilter( QObject *obj, QEvent *event ) {
     if( obj == ui->ImagePreview ) {
         if( event->type() == QEvent::MouseButtonRelease ) {
             if( currentObject() ) {
-                if( ( ( QFile( CurrentImagePath ).size() < 13000 ) && (  QFile( CurrentTempPath ).size() < 13000 ) ) ) {
+                if( ( ( QFile( CurrentImagePath ).size() < 13000 ) && (  QFile( CurrentTempPath ).size() < 13000 ) ) ) { // FIXME: This size estimate is unreliable.
                     if( ! currentObject()->isSolarSystem() )
                         slotGetImage( Options::obsListPreferDSS() );
                     else


More information about the Kstars-devel mailing list