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