00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "celestialbrowserbase.uic.h"
00011
00012 #include <qvariant.h>
00013 #include <qpushbutton.h>
00014 #include <qbuttongroup.h>
00015 #include <qheader.h>
00016 #include <klistview.h>
00017 #include <qradiobutton.h>
00018 #include <qlayout.h>
00019 #include <qtooltip.h>
00020 #include <qwhatsthis.h>
00021 #include <qaction.h>
00022 #include <qmenubar.h>
00023 #include <qpopupmenu.h>
00024 #include <qtoolbar.h>
00025
00026
00027
00028
00029
00030
00031 CelestialBrowserBase::CelestialBrowserBase( QWidget* parent, const char* name, WFlags fl )
00032 : QMainWindow( parent, name, fl )
00033 {
00034 (void)statusBar();
00035 if ( !name )
00036 setName( "CelestialBrowserBase" );
00037 setCentralWidget( new QWidget( this, "qt_central_widget" ) );
00038 CelestialBrowserBaseLayout = new QGridLayout( centralWidget(), 1, 1, 11, 6, "CelestialBrowserBaseLayout");
00039
00040 buttonGroup2 = new QButtonGroup( centralWidget(), "buttonGroup2" );
00041 buttonGroup2->setFrameShape( QButtonGroup::NoFrame );
00042 buttonGroup2->setFrameShadow( QButtonGroup::Plain );
00043 buttonGroup2->setLineWidth( 0 );
00044 buttonGroup2->setColumnLayout(0, Qt::Vertical );
00045 buttonGroup2->layout()->setSpacing( 6 );
00046 buttonGroup2->layout()->setMargin( 0 );
00047 buttonGroup2Layout = new QGridLayout( buttonGroup2->layout() );
00048 buttonGroup2Layout->setAlignment( Qt::AlignTop );
00049
00050 listStars = new KListView( buttonGroup2, "listStars" );
00051 listStars->addColumn( tr( "Name" ) );
00052 listStars->addColumn( tr( "Dist." ) );
00053 listStars->addColumn( tr( "App. Mag." ) );
00054 listStars->addColumn( tr( "Abs. Mag." ) );
00055 listStars->addColumn( tr( "Type" ) );
00056 listStars->setResizeMode( KListView::LastColumn );
00057
00058 buttonGroup2Layout->addMultiCellWidget( listStars, 0, 0, 0, 3 );
00059 spacer3 = new QSpacerItem( 140, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00060 buttonGroup2Layout->addItem( spacer3, 2, 2 );
00061 spacer2 = new QSpacerItem( 140, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00062 buttonGroup2Layout->addItem( spacer2, 1, 2 );
00063
00064 radioPlanets = new QRadioButton( buttonGroup2, "radioPlanets" );
00065
00066 buttonGroup2Layout->addWidget( radioPlanets, 2, 0 );
00067
00068 radioBrightest = new QRadioButton( buttonGroup2, "radioBrightest" );
00069
00070 buttonGroup2Layout->addWidget( radioBrightest, 1, 1 );
00071
00072 radioBrighter = new QRadioButton( buttonGroup2, "radioBrighter" );
00073
00074 buttonGroup2Layout->addWidget( radioBrighter, 2, 1 );
00075
00076 radioNearest = new QRadioButton( buttonGroup2, "radioNearest" );
00077
00078 buttonGroup2Layout->addWidget( radioNearest, 1, 0 );
00079
00080 buttonOk = new QPushButton( buttonGroup2, "buttonOk" );
00081 buttonOk->setAutoDefault( TRUE );
00082 buttonOk->setDefault( TRUE );
00083
00084 buttonGroup2Layout->addWidget( buttonOk, 2, 3 );
00085
00086 refresh = new QPushButton( buttonGroup2, "refresh" );
00087
00088 buttonGroup2Layout->addWidget( refresh, 1, 3 );
00089
00090 CelestialBrowserBaseLayout->addWidget( buttonGroup2, 0, 0 );
00091
00092
00093
00094 languageChange();
00095 resize( QSize(557, 521).expandedTo(minimumSizeHint()) );
00096 clearWState( WState_Polished );
00097
00098
00099 connect( radioNearest, SIGNAL( toggled(bool) ), this, SLOT( slotNearest(bool) ) );
00100 connect( radioBrightest, SIGNAL( toggled(bool) ), this, SLOT( slotBrightest(bool) ) );
00101 connect( radioBrighter, SIGNAL( toggled(bool) ), this, SLOT( slotBrighter(bool) ) );
00102 connect( radioPlanets, SIGNAL( toggled(bool) ), this, SLOT( slotWithPlanets(bool) ) );
00103 connect( listStars, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( slotRightClickOnStar(QListViewItem*,const QPoint&,int) ) );
00104 connect( refresh, SIGNAL( clicked() ), this, SLOT( slotRefresh() ) );
00105 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( close() ) );
00106 }
00107
00108
00109
00110
00111 CelestialBrowserBase::~CelestialBrowserBase()
00112 {
00113
00114 }
00115
00116
00117
00118
00119
00120 void CelestialBrowserBase::languageChange()
00121 {
00122 setCaption( tr( "Celestial Browser" ) );
00123 buttonGroup2->setTitle( QString::null );
00124 listStars->header()->setLabel( 0, tr( "Name" ) );
00125 listStars->header()->setLabel( 1, tr( "Dist." ) );
00126 listStars->header()->setLabel( 2, tr( "App. Mag." ) );
00127 listStars->header()->setLabel( 3, tr( "Abs. Mag." ) );
00128 listStars->header()->setLabel( 4, tr( "Type" ) );
00129 radioPlanets->setText( tr( "With Planets" ) );
00130 radioBrightest->setText( tr( "Brightest (Abs.)" ) );
00131 radioBrighter->setText( tr( "Brightest (App.)" ) );
00132 radioNearest->setText( tr( "Nearest" ) );
00133 buttonOk->setText( tr( "&Close" ) );
00134 buttonOk->setAccel( QKeySequence( tr( "Alt+C" ) ) );
00135 refresh->setText( tr( "Refresh" ) );
00136 }
00137
00138 void CelestialBrowserBase::slotNearest(bool)
00139 {
00140 qWarning( "CelestialBrowserBase::slotNearest(bool): Not implemented yet" );
00141 }
00142
00143 void CelestialBrowserBase::slotBrightest(bool)
00144 {
00145 qWarning( "CelestialBrowserBase::slotBrightest(bool): Not implemented yet" );
00146 }
00147
00148 void CelestialBrowserBase::slotWithPlanets(bool)
00149 {
00150 qWarning( "CelestialBrowserBase::slotWithPlanets(bool): Not implemented yet" );
00151 }
00152
00153 void CelestialBrowserBase::slotRefresh()
00154 {
00155 qWarning( "CelestialBrowserBase::slotRefresh(): Not implemented yet" );
00156 }
00157
00158 void CelestialBrowserBase::slotRightClickOnStar(QListViewItem*,const QPoint&,int)
00159 {
00160 qWarning( "CelestialBrowserBase::slotRightClickOnStar(QListViewItem*,const QPoint&,int): Not implemented yet" );
00161 }
00162
00163 void CelestialBrowserBase::slotBrighter(bool)
00164 {
00165 qWarning( "CelestialBrowserBase::slotBrighter(bool): Not implemented yet" );
00166 }
00167