KDevelop API Documentation

uichooser.cpp

Go to the documentation of this file.
00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './uichooser.ui'
00005 **
00006 ** Created: Tue Feb 22 08:58:20 2005
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "uichooser.h"
00013 
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qbuttongroup.h>
00018 #include <qradiobutton.h>
00019 #include <qgroupbox.h>
00020 #include <qcheckbox.h>
00021 #include <qlabel.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 
00026 /*
00027  *  Constructs a UIChooser as a child of 'parent', with the
00028  *  name 'name' and widget flags set to 'f'.
00029  */
00030 UIChooser::UIChooser( QWidget* parent, const char* name, WFlags fl )
00031     : QWidget( parent, name, fl )
00032 {
00033     if ( !name )
00034     setName( "UIChooser" );
00035     UIChooserLayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "UIChooserLayout"); 
00036 
00037     UIModeGroup = new QButtonGroup( this, "UIModeGroup" );
00038     UIModeGroup->setColumnLayout(0, Qt::Vertical );
00039     UIModeGroup->layout()->setSpacing( KDialog::spacingHint() );
00040     UIModeGroup->layout()->setMargin( KDialog::marginHint() );
00041     UIModeGroupLayout = new QVBoxLayout( UIModeGroup->layout() );
00042     UIModeGroupLayout->setAlignment( Qt::AlignTop );
00043 
00044     modeIDEAl = new QRadioButton( UIModeGroup, "modeIDEAl" );
00045     modeIDEAl->setChecked( TRUE );
00046     UIModeGroupLayout->addWidget( modeIDEAl );
00047 
00048     modeMDI = new QRadioButton( UIModeGroup, "modeMDI" );
00049     UIModeGroupLayout->addWidget( modeMDI );
00050 
00051     modeTab = new QRadioButton( UIModeGroup, "modeTab" );
00052     UIModeGroupLayout->addWidget( modeTab );
00053 
00054     modeToplevel = new QRadioButton( UIModeGroup, "modeToplevel" );
00055     UIModeGroupLayout->addWidget( modeToplevel );
00056     UIChooserLayout->addWidget( UIModeGroup );
00057 
00058     layout1 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout1"); 
00059 
00060     TabModeGroup = new QButtonGroup( this, "TabModeGroup" );
00061     TabModeGroup->setColumnLayout(0, Qt::Vertical );
00062     TabModeGroup->layout()->setSpacing( KDialog::spacingHint() );
00063     TabModeGroup->layout()->setMargin( KDialog::marginHint() );
00064     TabModeGroupLayout = new QVBoxLayout( TabModeGroup->layout() );
00065     TabModeGroupLayout->setAlignment( Qt::AlignTop );
00066 
00067     AlwaysShowTabs = new QRadioButton( TabModeGroup, "AlwaysShowTabs" );
00068     AlwaysShowTabs->setChecked( TRUE );
00069     TabModeGroupLayout->addWidget( AlwaysShowTabs );
00070 
00071     ShowWhenMoreThanOneTab = new QRadioButton( TabModeGroup, "ShowWhenMoreThanOneTab" );
00072     TabModeGroupLayout->addWidget( ShowWhenMoreThanOneTab );
00073 
00074     NeverShowTabs = new QRadioButton( TabModeGroup, "NeverShowTabs" );
00075     TabModeGroupLayout->addWidget( NeverShowTabs );
00076     layout1->addWidget( TabModeGroup );
00077 
00078     HoverCloseGroup = new QButtonGroup( this, "HoverCloseGroup" );
00079     HoverCloseGroup->setColumnLayout(0, Qt::Vertical );
00080     HoverCloseGroup->layout()->setSpacing( KDialog::spacingHint() );
00081     HoverCloseGroup->layout()->setMargin( KDialog::marginHint() );
00082     HoverCloseGroupLayout = new QVBoxLayout( HoverCloseGroup->layout() );
00083     HoverCloseGroupLayout->setAlignment( Qt::AlignTop );
00084 
00085     DoNotCloseOnHover = new QRadioButton( HoverCloseGroup, "DoNotCloseOnHover" );
00086     DoNotCloseOnHover->setChecked( TRUE );
00087     HoverCloseGroupLayout->addWidget( DoNotCloseOnHover );
00088 
00089     DoCloseOnHover = new QRadioButton( HoverCloseGroup, "DoCloseOnHover" );
00090     HoverCloseGroupLayout->addWidget( DoCloseOnHover );
00091 
00092     DoDelayedCloseOnHover = new QRadioButton( HoverCloseGroup, "DoDelayedCloseOnHover" );
00093     HoverCloseGroupLayout->addWidget( DoDelayedCloseOnHover );
00094     layout1->addWidget( HoverCloseGroup );
00095     UIChooserLayout->addLayout( layout1 );
00096 
00097     layout2 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 
00098 
00099     IDEAlButtonGroup = new QButtonGroup( this, "IDEAlButtonGroup" );
00100     IDEAlButtonGroup->setColumnLayout(0, Qt::Vertical );
00101     IDEAlButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
00102     IDEAlButtonGroup->layout()->setMargin( KDialog::marginHint() );
00103     IDEAlButtonGroupLayout = new QVBoxLayout( IDEAlButtonGroup->layout() );
00104     IDEAlButtonGroupLayout->setAlignment( Qt::AlignTop );
00105 
00106     IconsOnly = new QRadioButton( IDEAlButtonGroup, "IconsOnly" );
00107     IDEAlButtonGroupLayout->addWidget( IconsOnly );
00108 
00109     TextOnly = new QRadioButton( IDEAlButtonGroup, "TextOnly" );
00110     TextOnly->setChecked( TRUE );
00111     IDEAlButtonGroupLayout->addWidget( TextOnly );
00112 
00113     TextAndIcons = new QRadioButton( IDEAlButtonGroup, "TextAndIcons" );
00114     IDEAlButtonGroupLayout->addWidget( TextAndIcons );
00115     layout2->addWidget( IDEAlButtonGroup );
00116 
00117     TabbedBrowsingGroup = new QGroupBox( this, "TabbedBrowsingGroup" );
00118     TabbedBrowsingGroup->setColumnLayout(0, Qt::Vertical );
00119     TabbedBrowsingGroup->layout()->setSpacing( KDialog::spacingHint() );
00120     TabbedBrowsingGroup->layout()->setMargin( KDialog::marginHint() );
00121     TabbedBrowsingGroupLayout = new QGridLayout( TabbedBrowsingGroup->layout() );
00122     TabbedBrowsingGroupLayout->setAlignment( Qt::AlignTop );
00123 
00124     OpenNewTabAfterCurrent = new QCheckBox( TabbedBrowsingGroup, "OpenNewTabAfterCurrent" );
00125 
00126     TabbedBrowsingGroupLayout->addWidget( OpenNewTabAfterCurrent, 0, 0 );
00127 
00128     ShowTabIcons = new QCheckBox( TabbedBrowsingGroup, "ShowTabIcons" );
00129 
00130     TabbedBrowsingGroupLayout->addWidget( ShowTabIcons, 1, 0 );
00131 
00132     ShowCloseTabsButton = new QCheckBox( TabbedBrowsingGroup, "ShowCloseTabsButton" );
00133 
00134     TabbedBrowsingGroupLayout->addWidget( ShowCloseTabsButton, 2, 0 );
00135     layout2->addWidget( TabbedBrowsingGroup );
00136     UIChooserLayout->addLayout( layout2 );
00137 
00138     textLabel1 = new QLabel( this, "textLabel1" );
00139     textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
00140     textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00141     UIChooserLayout->addWidget( textLabel1 );
00142     languageChange();
00143     resize( QSize(441, 437).expandedTo(minimumSizeHint()) );
00144     clearWState( WState_Polished );
00145 
00146     // signals and slots connections
00147     connect( modeIDEAl, SIGNAL( toggled(bool) ), TabModeGroup, SLOT( setEnabled(bool) ) );
00148     connect( modeMDI, SIGNAL( toggled(bool) ), TabModeGroup, SLOT( setDisabled(bool) ) );
00149     connect( modeTab, SIGNAL( toggled(bool) ), TabModeGroup, SLOT( setEnabled(bool) ) );
00150     connect( modeToplevel, SIGNAL( toggled(bool) ), TabModeGroup, SLOT( setDisabled(bool) ) );
00151     connect( AlwaysShowTabs, SIGNAL( toggled(bool) ), HoverCloseGroup, SLOT( setEnabled(bool) ) );
00152     connect( ShowWhenMoreThanOneTab, SIGNAL( toggled(bool) ), HoverCloseGroup, SLOT( setEnabled(bool) ) );
00153     connect( NeverShowTabs, SIGNAL( toggled(bool) ), HoverCloseGroup, SLOT( setDisabled(bool) ) );
00154     connect( modeIDEAl, SIGNAL( toggled(bool) ), this, SLOT( maybeEnableCloseOnHover(bool) ) );
00155     connect( modeMDI, SIGNAL( toggled(bool) ), this, SLOT( maybeEnableCloseOnHover(bool) ) );
00156     connect( modeTab, SIGNAL( toggled(bool) ), this, SLOT( maybeEnableCloseOnHover(bool) ) );
00157     connect( modeToplevel, SIGNAL( toggled(bool) ), this, SLOT( maybeEnableCloseOnHover(bool) ) );
00158     connect( modeIDEAl, SIGNAL( toggled(bool) ), IDEAlButtonGroup, SLOT( setEnabled(bool) ) );
00159     connect( modeMDI, SIGNAL( toggled(bool) ), IDEAlButtonGroup, SLOT( setDisabled(bool) ) );
00160     connect( modeTab, SIGNAL( toggled(bool) ), IDEAlButtonGroup, SLOT( setDisabled(bool) ) );
00161     connect( modeToplevel, SIGNAL( toggled(bool) ), IDEAlButtonGroup, SLOT( setDisabled(bool) ) );
00162     connect( modeIDEAl, SIGNAL( toggled(bool) ), TabbedBrowsingGroup, SLOT( setEnabled(bool) ) );
00163     connect( modeMDI, SIGNAL( toggled(bool) ), TabbedBrowsingGroup, SLOT( setDisabled(bool) ) );
00164     connect( modeTab, SIGNAL( toggled(bool) ), TabbedBrowsingGroup, SLOT( setEnabled(bool) ) );
00165     connect( modeToplevel, SIGNAL( toggled(bool) ), TabbedBrowsingGroup, SLOT( setDisabled(bool) ) );
00166 }
00167 
00168 /*
00169  *  Destroys the object and frees any allocated resources
00170  */
00171 UIChooser::~UIChooser()
00172 {
00173     // no need to delete child widgets, Qt does it all for us
00174 }
00175 
00176 /*
00177  *  Sets the strings of the subwidgets using the current
00178  *  language.
00179  */
00180 void UIChooser::languageChange()
00181 {
00182     UIModeGroup->setTitle( tr2i18n( "Major &User-Interface Mode" ) );
00183     QWhatsThis::add( UIModeGroup, QString::null );
00184     modeIDEAl->setText( tr2i18n( "I&DEAl window mode" ) );
00185     QWhatsThis::add( modeIDEAl, tr2i18n( "This is a clone of the IDEA user interface, similar to the Tabbed pages mode." ) );
00186     modeMDI->setText( tr2i18n( "C&hildframe window mode" ) );
00187     QWhatsThis::add( modeMDI, tr2i18n( "All tool views are initially docked to the mainframe.\n"
00188 "Editor and browser views will live like toplevel windows within a view area of the mainframe.\n"
00189 "A typical example of this user interface mode is MS Visual Studio 6.0." ) );
00190     modeTab->setText( tr2i18n( "&Tabbed pages mode" ) );
00191     QWhatsThis::add( modeTab, tr2i18n( "All tool views are initially docked to the mainframe.\n"
00192 "Editor and browser views will be stacked in a tab window.\n"
00193 "A typical example of this user interface mode is KDEStudio, our friend C++-IDE in the world of KDE." ) );
00194     modeToplevel->setText( tr2i18n( "To&plevel window mode" ) );
00195     QWhatsThis::add( modeToplevel, tr2i18n( "All editor, browser and tool views will be toplevel windows (directly on desktop).\n"
00196 "The main widget contains the menu, toolbars and statusbar only.\n"
00197 "A typical example of this user interface mode is Borland Delphi 6.0." ) );
00198     TabModeGroup->setTitle( tr2i18n( "Use Tabs" ) );
00199     QWhatsThis::add( TabModeGroup, tr2i18n( "Some prefer not to have a tab bar and switch between documents using other means. Kate is one example of this." ) );
00200     AlwaysShowTabs->setText( tr2i18n( "Always" ) );
00201     ShowWhenMoreThanOneTab->setText( tr2i18n( "When more than one" ) );
00202     NeverShowTabs->setText( tr2i18n( "Never" ) );
00203     HoverCloseGroup->setTitle( tr2i18n( "Use Close on Hover" ) );
00204     QWhatsThis::add( HoverCloseGroup, tr2i18n( "The document tab can optionally be used to close the document, by clicking on the tab icon." ) );
00205     DoNotCloseOnHover->setText( tr2i18n( "No" ) );
00206     DoCloseOnHover->setText( tr2i18n( "Yes" ) );
00207     DoDelayedCloseOnHover->setText( tr2i18n( "Yes, delayed" ) );
00208     IDEAlButtonGroup->setTitle( tr2i18n( "Toolview Tab Layout" ) );
00209     QWhatsThis::add( IDEAlButtonGroup, tr2i18n( "Three different modes for the IDEAl toolview tabs. \"Text and icons\" is the most informative, but takes a lot of space. Those with a smaller screen will typically want \"Icons\"." ) );
00210     IconsOnly->setText( tr2i18n( "Icons" ) );
00211     TextOnly->setText( tr2i18n( "Text" ) );
00212     TextAndIcons->setText( tr2i18n( "Text and icons" ) );
00213     TabbedBrowsingGroup->setTitle( tr2i18n( "Tabbed Browsing" ) );
00214     QWhatsThis::add( TabbedBrowsingGroup, tr2i18n( "Some extra options for the document tabbar." ) );
00215     OpenNewTabAfterCurrent->setText( tr2i18n( "Open &new tab after current tab" ) );
00216     ShowTabIcons->setText( tr2i18n( "Show icons on document tabs" ) );
00217     ShowTabIcons->setAccel( QKeySequence( QString::null ) );
00218     ShowCloseTabsButton->setText( tr2i18n( "Show close button in tab bar" ) );
00219     ShowCloseTabsButton->setAccel( QKeySequence( QString::null ) );
00220     textLabel1->setText( tr2i18n( "Note: Changes will take effect after KDevelop is restarted" ) );
00221 }
00222 
00223 void UIChooser::maybeEnableCloseOnHover(bool)
00224 {
00225     qWarning( "UIChooser::maybeEnableCloseOnHover(bool): Not implemented yet" );
00226 }
00227 
00228 #include "uichooser.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:42 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003