00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "kpropertiesdesktopbase.h"
00013
00014 #include <qvariant.h>
00015 #include <klineedit.h>
00016 #include <klistview.h>
00017 #include <qlabel.h>
00018 #include <qheader.h>
00019 #include <qpushbutton.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023
00024
00025
00026
00027
00028 KPropertiesDesktopBase::KPropertiesDesktopBase( QWidget* parent, const char* name, WFlags fl )
00029 : QWidget( parent, name, fl )
00030 {
00031 if ( !name )
00032 setName( "KPropertiesDesktopBase" );
00033 KPropertiesDesktopBaseLayout = new QGridLayout( this, 1, 1, 0, 6, "KPropertiesDesktopBaseLayout");
00034 QSpacerItem* spacer = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Minimum );
00035 KPropertiesDesktopBaseLayout->addMultiCell( spacer, 4, 4, 3, 4 );
00036
00037 textLabel7 = new QLabel( this, "textLabel7" );
00038
00039 KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel7, 5, 5, 0, 6 );
00040
00041 filetypeList = new KListView( this, "filetypeList" );
00042 filetypeList->addColumn( tr2i18n( "Mimetype" ) );
00043 filetypeList->addColumn( tr2i18n( "Description" ) );
00044 filetypeList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 1, filetypeList->sizePolicy().hasHeightForWidth() ) );
00045 filetypeList->setFullWidth( TRUE );
00046
00047 KPropertiesDesktopBaseLayout->addMultiCellWidget( filetypeList, 6, 6, 0, 6 );
00048
00049 nameLabel = new QLabel( this, "nameLabel" );
00050
00051 KPropertiesDesktopBaseLayout->addMultiCellWidget( nameLabel, 0, 0, 0, 1 );
00052
00053 nameEdit = new KLineEdit( this, "nameEdit" );
00054
00055 KPropertiesDesktopBaseLayout->addMultiCellWidget( nameEdit, 0, 0, 2, 6 );
00056
00057 textLabel2 = new QLabel( this, "textLabel2" );
00058
00059 KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel2, 1, 1, 0, 1 );
00060
00061 genNameEdit = new KLineEdit( this, "genNameEdit" );
00062
00063 KPropertiesDesktopBaseLayout->addMultiCellWidget( genNameEdit, 1, 1, 2, 6 );
00064
00065 textLabel3 = new QLabel( this, "textLabel3" );
00066
00067 KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel3, 2, 2, 0, 1 );
00068
00069 commentEdit = new KLineEdit( this, "commentEdit" );
00070
00071 KPropertiesDesktopBaseLayout->addMultiCellWidget( commentEdit, 2, 2, 2, 6 );
00072
00073 textLabel4 = new QLabel( this, "textLabel4" );
00074
00075 KPropertiesDesktopBaseLayout->addMultiCellWidget( textLabel4, 3, 3, 0, 1 );
00076
00077 commandEdit = new KLineEdit( this, "commandEdit" );
00078
00079 KPropertiesDesktopBaseLayout->addMultiCellWidget( commandEdit, 3, 3, 2, 5 );
00080
00081 browseButton = new QPushButton( this, "browseButton" );
00082
00083 KPropertiesDesktopBaseLayout->addWidget( browseButton, 3, 6 );
00084
00085 addFiletypeButton = new QPushButton( this, "addFiletypeButton" );
00086
00087 KPropertiesDesktopBaseLayout->addWidget( addFiletypeButton, 7, 0 );
00088 QSpacerItem* spacer_2 = new QSpacerItem( 53, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
00089 KPropertiesDesktopBaseLayout->addMultiCell( spacer_2, 7, 7, 1, 2 );
00090
00091 delFiletypeButton = new QPushButton( this, "delFiletypeButton" );
00092
00093 KPropertiesDesktopBaseLayout->addWidget( delFiletypeButton, 7, 3 );
00094 QSpacerItem* spacer_3 = new QSpacerItem( 53, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
00095 KPropertiesDesktopBaseLayout->addItem( spacer_3, 7, 4 );
00096
00097 advancedButton = new QPushButton( this, "advancedButton" );
00098
00099 KPropertiesDesktopBaseLayout->addMultiCellWidget( advancedButton, 7, 7, 5, 6 );
00100 languageChange();
00101 resize( QSize(449, 304).expandedTo(minimumSizeHint()) );
00102 clearWState( WState_Polished );
00103
00104
00105 textLabel7->setBuddy( filetypeList );
00106 nameLabel->setBuddy( nameEdit );
00107 textLabel2->setBuddy( genNameEdit );
00108 textLabel3->setBuddy( commentEdit );
00109 textLabel4->setBuddy( commandEdit );
00110 }
00111
00112
00113
00114
00115 KPropertiesDesktopBase::~KPropertiesDesktopBase()
00116 {
00117
00118 }
00119
00120
00121
00122
00123
00124 void KPropertiesDesktopBase::languageChange()
00125 {
00126 textLabel7->setText( tr2i18n( "&Supported file types:" ) );
00127 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"
00128 "<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"
00129 "<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>" ) );
00130 filetypeList->header()->setLabel( 0, tr2i18n( "Mimetype" ) );
00131 filetypeList->header()->setLabel( 1, tr2i18n( "Description" ) );
00132 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"
00133 "<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"
00134 "<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>" ) );
00135 nameLabel->setText( tr2i18n( "&Name:" ) );
00136 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." ) );
00137 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." ) );
00138 textLabel2->setText( tr2i18n( "&Description:" ) );
00139 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\"." ) );
00140 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\"." ) );
00141 textLabel3->setText( tr2i18n( "Comm&ent:" ) );
00142 QWhatsThis::add( textLabel3, tr2i18n( "Type any comment you think is useful here." ) );
00143 QWhatsThis::add( commentEdit, tr2i18n( "Type any comment you think is useful here." ) );
00144 textLabel4->setText( tr2i18n( "Co&mmand:" ) );
00145 QWhatsThis::add( textLabel4, tr2i18n( "Type the command to start this application here.\n"
00146 "\n"
00147 "Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
00148 "%f - a single file name\n"
00149 "%F - a list of files; use for applications that can open several local files at once\n"
00150 "%u - a single URL\n"
00151 "%U - a list of URLs\n"
00152 "%d - the directory of the file to open\n"
00153 "%D - a list of directories\n"
00154 "%i - the icon\n"
00155 "%m - the mini-icon\n"
00156 "%c - the caption" ) );
00157 QWhatsThis::add( commandEdit, tr2i18n( "Type the command to start this application here.\n"
00158 "\n"
00159 "Following the command, you can have several place holders which will be replaced with the actual values when the actual program is run:\n"
00160 "%f - a single file name\n"
00161 "%F - a list of files; use for applications that can open several local files at once\n"
00162 "%u - a single URL\n"
00163 "%U - a list of URLs\n"
00164 "%d - the directory of the file to open\n"
00165 "%D - a list of directories\n"
00166 "%i - the icon\n"
00167 "%m - the mini-icon\n"
00168 "%c - the caption" ) );
00169 browseButton->setText( tr2i18n( "&Browse..." ) );
00170 QWhatsThis::add( browseButton, tr2i18n( "Click here to browse your file system in order to find the desired executable." ) );
00171 addFiletypeButton->setText( tr2i18n( "Add..." ) );
00172 QWhatsThis::add( addFiletypeButton, tr2i18n( "Click on this button if you want to add a type of file (mimetype) that your application can handle." ) );
00173 delFiletypeButton->setText( tr2i18n( "Remove" ) );
00174 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." ) );
00175 advancedButton->setText( tr2i18n( "Ad&vanced Options..." ) );
00176 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." ) );
00177 }
00178
00179 #include "kpropertiesdesktopbase.moc"