[Kstars-devel] KDE/kdeedu/kstars/kstars/tools

Jason Harris kstars at 30doradus.org
Thu Sep 4 16:00:42 CEST 2008


SVN commit 857043 by harris:

Make Location button functional.  Add text label to Print button (still 
non-functional).  Make default window size smaller for small screens.

CCMAIL: kstars-devel at kde.org



 M  +23 -0     skycalendar.cpp  
 M  +1 -0      skycalendar.h  
 M  +4 -4      skycalendar.ui  


--- trunk/KDE/kdeedu/kstars/kstars/tools/skycalendar.cpp #857042:857043
@@ -17,12 +17,14 @@
 
 #include "skycalendar.h"
 
+#include <QDesktopWidget>
 #include <kdebug.h>
 #include <KPlotObject>
 #include <KPushButton>
 
 #include "calendarwidget.h"
 #include "geolocation.h"
+#include "locationdialog.h"
 #include "kstars.h"
 #include "kstarsdatetime.h"
 #include "kstarsdata.h"
@@ -46,11 +48,21 @@
     setButtons( KDialog::User1 | KDialog::Close );
     setModal( false );
 
+    //Adjust minimum size for small screens:
+    if ( QApplication::desktop()->availableGeometry().height() <= scUI->CalendarView->height() ) {
+        scUI->CalendarView->setMinimumSize( 400, 600 );
+    }
+    
     scUI->CalendarView->setLimits( -9.0, 9.0, 0.0, 366.0 );
     scUI->CalendarView->setShowGrid( false ); 
     scUI->Year->setValue( ks->data()->lt().date().year() );
 
+    scUI->LocationButton->setText( geo->fullName() );
+    setButtonGuiItem( KDialog::User1, KGuiItem( i18n("&Print..."), QString(), i18n("Print the Sky Calendar") ) );
+
     connect( scUI->CreateButton, SIGNAL(clicked()), this, SLOT(slotFillCalendar()) );
+    connect( scUI->LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()) );
+    connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotPrint() ) );
 }
 
 SkyCalendar::~SkyCalendar() {
@@ -152,4 +164,15 @@
 void SkyCalendar::slotPrint() {
 }
 
+void SkyCalendar::slotLocation() {
+    LocationDialog ld( ks );
+    if ( ld.exec() == QDialog::Accepted ) {                  
+        GeoLocation *newGeo = ld.selectedCity();
+        if ( newGeo ) {
+            geo = newGeo;
+            scUI->LocationButton->setText( geo->fullName() );
+        }
+    }
+}
+
 #include "skycalendar.moc"
--- trunk/KDE/kdeedu/kstars/kstars/tools/skycalendar.h #857042:857043
@@ -48,6 +48,7 @@
     public slots:
         void slotFillCalendar();
         void slotPrint();
+        void slotLocation();
         
     private:
         void addPlanetEvents( int nPlanet );
--- trunk/KDE/kdeedu/kstars/kstars/tools/skycalendar.ui #857042:857043
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>464</width>
-    <height>644</height>
+    <width>488</width>
+    <height>764</height>
    </rect>
   </property>
   <property name="sizePolicy" >
@@ -99,8 +99,8 @@
      </property>
      <property name="minimumSize" >
       <size>
-       <width>400</width>
-       <height>600</height>
+       <width>480</width>
+       <height>720</height>
       </size>
      </property>
     </widget>


More information about the Kstars-devel mailing list