00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "Iguana/Studio/interface/IgStudioSetup.h"
00011
00012 #include <qvariant.h>
00013 #include <qpushbutton.h>
00014 #include <qlabel.h>
00015 #include <qlistbox.h>
00016 #include <qlayout.h>
00017 #include <qtooltip.h>
00018 #include <qwhatsthis.h>
00019
00020
00021
00022
00023
00024
00025
00026
00027 IgStudioSetup::IgStudioSetup( QWidget* parent, const char* name, bool modal, WFlags fl )
00028 : QDialog( parent, name, modal, fl )
00029 {
00030 if ( !name )
00031 setName( "IgStudioSetup" );
00032 IgStudioSetupLayout = new QGridLayout( this, 1, 1, 11, 6, "IgStudioSetupLayout");
00033
00034 m_label = new QLabel( this, "m_label" );
00035 m_label->setAlignment( int( QLabel::AlignVCenter ) );
00036
00037 IgStudioSetupLayout->addWidget( m_label, 0, 0 );
00038
00039 m_layout2 = new QGridLayout( 0, 1, 1, 0, 6, "m_layout2");
00040
00041 m_layout1 = new QGridLayout( 0, 1, 1, 0, 6, "m_layout1");
00042 QSpacerItem* spacer = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
00043 m_layout1->addItem( spacer, 2, 0 );
00044
00045 m_cancel = new QPushButton( this, "m_cancel" );
00046
00047 m_layout1->addWidget( m_cancel, 1, 0 );
00048
00049 m_help = new QPushButton( this, "m_help" );
00050
00051 m_layout1->addWidget( m_help, 3, 0 );
00052
00053 m_ok = new QPushButton( this, "m_ok" );
00054 m_ok->setDefault( TRUE );
00055
00056 m_layout1->addWidget( m_ok, 0, 0 );
00057
00058 m_layout2->addLayout( m_layout1, 0, 1 );
00059
00060 m_configs = new QListBox( this, "m_configs" );
00061
00062 m_layout2->addWidget( m_configs, 0, 0 );
00063
00064 IgStudioSetupLayout->addLayout( m_layout2, 1, 0 );
00065 languageChange();
00066 resize( QSize(350, 200).expandedTo(minimumSizeHint()) );
00067 clearWState( WState_Polished );
00068
00069
00070 connect( m_configs, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( accept() ) );
00071 connect( m_configs, SIGNAL( doubleClicked(QListBoxItem*) ), this, SLOT( accept() ) );
00072 connect( m_cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00073 connect( m_ok, SIGNAL( clicked() ), this, SLOT( accept() ) );
00074 connect( m_help, SIGNAL( clicked() ), this, SLOT( helpSlot() ) );
00075 }
00076
00077
00078
00079
00080 IgStudioSetup::~IgStudioSetup()
00081 {
00082
00083 }
00084
00085
00086
00087
00088
00089 void IgStudioSetup::languageChange()
00090 {
00091 setCaption( tr( "IGUANA Setup" ) );
00092 m_label->setText( tr( "Please select configuration" ) );
00093 m_cancel->setText( tr( "&Cancel" ) );
00094 QToolTip::add( m_cancel, tr( "Terminate setup" ) );
00095 QWhatsThis::add( m_cancel, tr( "<p><b>Cancel Button:</b></p><p>Canceling setup will cause termination of the IGUANA application.</p>" ) );
00096 m_help->setText( tr( "&Help" ) );
00097 QToolTip::add( m_help, tr( "Enter \"What's This\" mode" ) );
00098 QWhatsThis::add( m_help, tr( "<p><b>Help Button:</b></p><p>Clicking on the button will change cursor in the <b><i>what's this</i></b> mode.</p>" ) );
00099 m_ok->setText( tr( "&OK" ) );
00100 QToolTip::add( m_ok, tr( "Load selected extension" ) );
00101 QWhatsThis::add( m_ok, tr( "<p><b>OK Button:</b></p><p>Accept <i><b>selected</b></i> extension from the configuration list to be loaded.<p></p>The extension can be loaded by left mouse button <b>double-click</b> on the selected item.</p>" ) );
00102 QToolTip::add( m_configs, tr( "List of all available extensions" ) );
00103 QWhatsThis::add( m_configs, tr( "<p>The list of currently available extensions is collected from plugin databases defined by <b>$IGUANA_PLUGINS</b> environment variable.</p>" ) );
00104 }
00105
00106 void IgStudioSetup::helpSlot()
00107 {
00108 QWhatsThis::enterWhatsThisMode ();
00109 }
00110