KDevelop API Documentation

mimewarningdialog.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 './mimewarningdialog.ui'
00005 **
00006 ** Created: Wed Mar 23 00:00:01 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 "mimewarningdialog.h"
00013 
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qlabel.h>
00017 #include <qbuttongroup.h>
00018 #include <qradiobutton.h>
00019 #include <qcheckbox.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023 
00024 /*
00025  *  Constructs a MimeWarningDialog as a child of 'parent', with the
00026  *  name 'name' and widget flags set to 'f'.
00027  *
00028  *  The dialog will by default be modeless, unless you set 'modal' to
00029  *  TRUE to construct a modal dialog.
00030  */
00031 MimeWarningDialog::MimeWarningDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
00032     : QDialog( parent, name, modal, fl )
00033 {
00034     if ( !name )
00035     setName( "MimeWarningDialog" );
00036     MimeWarningDialogLayout = new QVBoxLayout( this, 11, 6, "MimeWarningDialogLayout"); 
00037 
00038     text = new QLabel( this, "text" );
00039     MimeWarningDialogLayout->addWidget( text );
00040 
00041     buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
00042     buttonGroup1->setFrameShape( QButtonGroup::GroupBoxPanel );
00043     buttonGroup1->setFrameShadow( QButtonGroup::Sunken );
00044     buttonGroup1->setLineWidth( 1 );
00045     buttonGroup1->setColumnLayout(0, Qt::Vertical );
00046     buttonGroup1->layout()->setSpacing( 6 );
00047     buttonGroup1->layout()->setMargin( 11 );
00048     buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
00049     buttonGroup1Layout->setAlignment( Qt::AlignTop );
00050 
00051     open_with_kde = new QRadioButton( buttonGroup1, "open_with_kde" );
00052     open_with_kde->setChecked( TRUE );
00053     buttonGroup1Layout->addWidget( open_with_kde );
00054 
00055     open_as_text = new QRadioButton( buttonGroup1, "open_as_text" );
00056     buttonGroup1Layout->addWidget( open_as_text );
00057 
00058     layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 
00059     spacer2 = new QSpacerItem( 42, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00060     layout3->addItem( spacer2 );
00061 
00062     always_open_as_text = new QCheckBox( buttonGroup1, "always_open_as_text" );
00063     always_open_as_text->setEnabled( FALSE );
00064     layout3->addWidget( always_open_as_text );
00065     spacer3 = new QSpacerItem( 41, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00066     layout3->addItem( spacer3 );
00067     buttonGroup1Layout->addLayout( layout3 );
00068     MimeWarningDialogLayout->addWidget( buttonGroup1 );
00069 
00070     layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
00071     spacer1 = new QSpacerItem( 101, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00072     layout1->addItem( spacer1 );
00073 
00074     pushButton1 = new QPushButton( this, "pushButton1" );
00075     layout1->addWidget( pushButton1 );
00076 
00077     pushButton2 = new QPushButton( this, "pushButton2" );
00078     layout1->addWidget( pushButton2 );
00079     MimeWarningDialogLayout->addLayout( layout1 );
00080     languageChange();
00081     resize( QSize(404, 248).expandedTo(minimumSizeHint()) );
00082     clearWState( WState_Polished );
00083 
00084     // signals and slots connections
00085     connect( open_with_kde, SIGNAL( toggled(bool) ), always_open_as_text, SLOT( setDisabled(bool) ) );
00086     connect( open_as_text, SIGNAL( toggled(bool) ), always_open_as_text, SLOT( setEnabled(bool) ) );
00087     connect( pushButton2, SIGNAL( clicked() ), this, SLOT( reject() ) );
00088     connect( pushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) );
00089 }
00090 
00091 /*
00092  *  Destroys the object and frees any allocated resources
00093  */
00094 MimeWarningDialog::~MimeWarningDialog()
00095 {
00096     // no need to delete child widgets, Qt does it all for us
00097 }
00098 
00099 /*
00100  *  Sets the strings of the subwidgets using the current
00101  *  language.
00102  */
00103 void MimeWarningDialog::languageChange()
00104 {
00105     setCaption( tr2i18n( "Could Not Open File" ) );
00106     text->setText( tr2i18n( "<qt>KDevelop could not open <b>%1</b>\n"
00107 "<br><br>\n"
00108 "No suitable viewer was found for the <b>%2</b> mimetype.</qt>" ) );
00109     buttonGroup1->setTitle( tr2i18n( "What Do You Want to Do?" ) );
00110     open_with_kde->setText( tr2i18n( "Let KDE find a suitable program" ) );
00111     open_as_text->setText( tr2i18n( "Open it in KDevelop as plain text" ) );
00112     always_open_as_text->setText( tr2i18n( "Always open this mimetype as text" ) );
00113     pushButton1->setText( tr2i18n( "&OK" ) );
00114     pushButton2->setText( tr2i18n( "&Cancel" ) );
00115 }
00116 
00117 #include "mimewarningdialog.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 Wed Mar 23 00:03:58 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003