kio Library API Documentation

kpropertiesdesktopbase.cpp

00001 #include <klocale.h>
00002 /****************************************************************************
00003 ** Form implementation generated from reading ui file './kpropertiesdesktopbase.ui'
00004 **
00005 ** Created: Wed Feb 4 11:35:43 2004
00006 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.3   edited May 19 14:22 $)
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "kpropertiesdesktopbase.h"
00012 
00013 #include <qvariant.h>
00014 #include <klineedit.h>
00015 #include <klistview.h>
00016 #include <qlabel.h>
00017 #include <qheader.h>
00018 #include <qpushbutton.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022 
00023 /*
00024  *  Constructs a KPropertiesDesktopBase as a child of 'parent', with the
00025  *  name 'name' and widget flags set to 'f'.
00026  */
00027 KPropertiesDesktopBase::KPropertiesDesktopBase( QWidget* parent, const char* name, WFlags fl )
00028     : QWidget( parent, name, fl )
00029 {
00030     if ( !name )
00031     setName( "KPropertiesDesktopBase" );
00032     KPropertiesDesktopBaseLayout = new QGridLayout( this, 1, 1, 0, 6, "KPropertiesDesktopBaseLayout"); 
00033     QSpacerItem* spacer = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Minimum );
00034     KPropertiesDesktopBaseLayout->addMultiCell( spacer, 4, 4, 3, 4 );
00035 
00036     textLabel7 = new QLabel( this, "textLabel7" );
00037 
00038     KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel7, 5, 5, 0, 6 );
00039 
00040     filetypeList = new KListView( this, "filetypeList" );
00041     filetypeList->addColumn( tr2i18n( "Mimetype" ) );
00042     filetypeList->addColumn( tr2i18n( "Description" ) );
00043     filetypeList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 1, filetypeList->sizePolicy().hasHeightForWidth() ) );
00044     filetypeList->setFullWidth( TRUE );
00045 
00046     KPropertiesDesktopBaseLayout->addMultiCellWidget( filetypeList, 6, 6, 0, 6 );
00047 
00048     nameLabel = new QLabel( this, "nameLabel" );
00049 
00050     KPropertiesDesktopBaseLayout->addMultiCellWidget( nameLabel, 0, 0, 0, 1 );
00051 
00052     nameEdit = new KLineEdit( this, "nameEdit" );
00053 
00054     KPropertiesDesktopBaseLayout->addMultiCellWidget( nameEdit, 0, 0, 2, 6 );
00055 
00056     textLabel2 = new QLabel( this, "textLabel2" );
00057 
00058     KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel2, 1, 1, 0, 1 );
00059 
00060     genNameEdit = new KLineEdit( this, "genNameEdit" );
00061 
00062     KPropertiesDesktopBaseLayout->addMultiCellWidget( genNameEdit, 1, 1, 2, 6 );
00063 
00064     textLabel3 = new QLabel( this, "textLabel3" );
00065 
00066     KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel3, 2, 2, 0, 1 );
00067 
00068     commentEdit = new KLineEdit( this, "commentEdit" );
00069 
00070     KPropertiesDesktopBaseLayout->addMultiCellWidget( commentEdit, 2, 2, 2, 6 );
00071 
00072     textLabel4 = new QLabel( this, "textLabel4" );
00073 
00074     KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel4, 3, 3, 0, 1 );
00075 
00076     commandEdit = new KLineEdit( this, "commandEdit" );
00077 
00078     KPropertiesDesktopBaseLayout->addMultiCellWidget( commandEdit, 3, 3, 2, 5 );
00079 
00080     browseButton = new QPushButton( this, "browseButton" );
00081 
00082     KPropertiesDesktopBaseLayout->addWidget( browseButton, 3, 6 );
00083 
00084     addFiletypeButton = new QPushButton( this, "addFiletypeButton" );
00085 
00086     KPropertiesDesktopBaseLayout->addWidget( addFiletypeButton, 7, 0 );
00087     QSpacerItem* spacer_2 = new QSpacerItem( 53, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
00088     KPropertiesDesktopBaseLayout->addMultiCell( spacer_2, 7, 7, 1, 2 );
00089 
00090     delFiletypeButton = new QPushButton( this, "delFiletypeButton" );
00091 
00092     KPropertiesDesktopBaseLayout->addWidget( delFiletypeButton, 7, 3 );
00093     QSpacerItem* spacer_3 = new QSpacerItem( 53, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
00094     KPropertiesDesktopBaseLayout->addItem( spacer_3, 7, 4 );
00095 
00096     advancedButton = new QPushButton( this, "advancedButton" );
00097 
00098     KPropertiesDesktopBaseLayout->addMultiCellWidget( advancedButton, 7, 7, 5, 6 );
00099     languageChange();
00100     resize( QSize(449, 304).expandedTo(minimumSizeHint()) );
00101     clearWState( WState_Polished );
00102 
00103     // buddies
00104     textLabel7->setBuddy( filetypeList );
00105     nameLabel->setBuddy( nameEdit );
00106     textLabel2->setBuddy( genNameEdit );
00107     textLabel3->setBuddy( commentEdit );
00108     textLabel4->setBuddy( commandEdit );
00109 }
00110 
00111 /*
00112  *  Destroys the object and frees any allocated resources
00113  */
00114 KPropertiesDesktopBase::~KPropertiesDesktopBase()
00115 {
00116     // no need to delete child widgets, Qt does it all for us
00117 }
00118 
00119 /*
00120  *  Sets the strings of the subwidgets using the current
00121  *  language.
00122  */
00123 void KPropertiesDesktopBase::languageChange()
00124 {
00125     textLabel7->setText( tr2i18n( "&Supported file types:" ) );
00126     QWhatsThis::add( textLabel7, tr2i18n( "<qt><p>This list should show the types of file that your application can handle. This list is organized by <u>mimetypes</u>.</p> \n"
00127 "<p>MIME, Multipurpose Internet (e)Mail Extension, is a standard protocol for identifying the type of data based on filename extensions and correspondent <u>mimetypes</u>. Example: the \"bmp\" part that comes after the dot in flower.bmp indicates that it is a specific kind of image, <u>image/x-bmp</u>. To know which application should open each type of file, the system should be informed about the abilities of each application to handle these extensions and mimetypes.</p>\n"
00128 "<p>If you want to associate this application with one or more mimetypes that are not in this list, click on the button <b>Add</b> below. If there are one or more filetypes that this application cannot handle, you may want to remove them from the list clicking on the button <b>Remove</b> below.</p></qt>" ) );
00129     filetypeList->header()->setLabel( 0, tr2i18n( "Mimetype" ) );
00130     filetypeList->header()->setLabel( 1, tr2i18n( "Description" ) );
00131     QWhatsThis::add( filetypeList, tr2i18n( "<qt><p>This list should show the types of file that your application can handle. This list is organized by <u>mimetypes</u>.</p> \n"
00132 "<p>MIME, Multipurpose Internet (e)Mail Extension, is a standard protocol for identifying the type of data based on filename extensions and correspondent <u>mimetypes</u>. Example: the \"bmp\" part that comes after the dot in flower.bmp indicates that it is a specific kind of image, <u>image/x-bmp</u>. To know which application should open each type of file, the system should be informed about the abilities of each application to handle these extensions and mimetypes.</p>\n"
00133 "<p>If you want to associate this application with one or more mimetypes that are not in this list, click on the button <b>Add</b> below. If there are one or more filetypes that this application cannot handle, you may want to remove them from the list clicking on the button <b>Remove</b> below.</p></qt>" ) );
00134     nameLabel->setText( tr2i18n( "&Name:" ) );
00135     QWhatsThis::add( nameLabel, tr2i18n( "Type the name you want to give to this application here. This application will appear under this name in the applications menu and in the panel." ) );
00136     QWhatsThis::add( nameEdit, tr2i18n( "Type the name you want to give to this application here. This application will appear under this name in the applications menu and in the panel." ) );
00137     textLabel2->setText( tr2i18n( "&Description:" ) );
00138     QWhatsThis::add( textLabel2, tr2i18n( "Type the description of this application, based on its use, here. Examples: a dial up application (KPPP) would be \"Dial up tool\"." ) );
00139     QWhatsThis::add( genNameEdit, tr2i18n( "Type the description of this application, based on its use, here. Examples: a dial up application (KPPP) would be \"Dial up tool\"." ) );
00140     textLabel3->setText( tr2i18n( "Comm&ent:" ) );
00141     QWhatsThis::add( textLabel3, tr2i18n( "Type any comment you think is useful here." ) );
00142     QWhatsThis::add( commentEdit, tr2i18n( "Type any comment you think is useful here." ) );
00143     textLabel4->setText( tr2i18n( "Co&mmand:" ) );
00144     QWhatsThis::add( textLabel4, tr2i18n( "Type the command to start this application here.\n"
00145 "\n"
00146 "Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
00147 "%f - a single file name\n"
00148 "%F - a list of files; use for applications that can open several local files at once\n"
00149 "%u - a single URL\n"
00150 "%U - a list of URLs\n"
00151 "%d - the directory of the file to open\n"
00152 "%D - a list of directories\n"
00153 "%i - the icon\n"
00154 "%m - the mini-icon\n"
00155 "%c - the caption" ) );
00156     QWhatsThis::add( commandEdit, tr2i18n( "Type the command to start this application here.\n"
00157 "\n"
00158 "Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
00159 "%f - a single file name\n"
00160 "%F - a list of files; use for applications that can open several local files at once\n"
00161 "%u - a single URL\n"
00162 "%U - a list of URLs\n"
00163 "%d - the directory of the file to open\n"
00164 "%D - a list of directories\n"
00165 "%i - the icon\n"
00166 "%m - the mini-icon\n"
00167 "%c - the caption" ) );
00168     browseButton->setText( tr2i18n( "&Browse..." ) );
00169     QWhatsThis::add( browseButton, tr2i18n( "Click here to browse your file system in order to find the desired executable." ) );
00170     addFiletypeButton->setText( tr2i18n( "Add..." ) );
00171     QWhatsThis::add( addFiletypeButton, tr2i18n( "Click on this button if you want to add a type of file (mimetype) that your application can handle." ) );
00172     delFiletypeButton->setText( tr2i18n( "Remove" ) );
00173     QWhatsThis::add( delFiletypeButton, tr2i18n( "If you want to remove a type of file (mimetype) that your application cannot handle, select the mimetype in the list above and click on this button." ) );
00174     advancedButton->setText( tr2i18n( "Ad&vanced Options..." ) );
00175     QWhatsThis::add( advancedButton, tr2i18n( "Click here to modify the way this application will run, launch feedback, DCOP options or to run it as a different user." ) );
00176 }
00177 
00178 #include "kpropertiesdesktopbase.moc"
KDE Logo
This file is part of the documentation for kio Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:35:06 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003