From kstars-devel Thu Sep 04 14:00:42 2008 From: Jason Harris Date: Thu, 04 Sep 2008 14:00:42 +0000 To: kstars-devel Subject: [Kstars-devel] KDE/kdeedu/kstars/kstars/tools Message-Id: <1220536842.961558.12722.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kstars-devel&m=122053686418700 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@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 #include #include #include #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 @@ 0 0 - 464 - 644 + 488 + 764 @@ -99,8 +99,8 @@ - 400 - 600 + 480 + 720 _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel