diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/filetypes/newtypedlg.cpp | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/filetypes/newtypedlg.cpp')
-rw-r--r-- | kcontrol/filetypes/newtypedlg.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kcontrol/filetypes/newtypedlg.cpp b/kcontrol/filetypes/newtypedlg.cpp new file mode 100644 index 000000000..24760cf1d --- /dev/null +++ b/kcontrol/filetypes/newtypedlg.cpp @@ -0,0 +1,57 @@ + +#include <qlayout.h> +#include <qlabel.h> +#include <qwhatsthis.h> +#include <qcombobox.h> + +#include <klocale.h> +#include <klineedit.h> + +#include "newtypedlg.h" + +NewTypeDialog::NewTypeDialog(QStringList groups, + QWidget *parent, const char *name) + : KDialogBase(parent, name, true, i18n( "Create New File Type" ), + Ok|Cancel, Ok, true) +{ + QFrame *main = makeMainWidget(); + QVBoxLayout *topl = new QVBoxLayout(main, 0, spacingHint()); + + QGridLayout *grid = new QGridLayout(2, 2); + grid->setColStretch(1, 1); + topl->addLayout(grid); + + QLabel *l = new QLabel(i18n("Group:"), main); + grid->addWidget(l, 0, 0); + + groupCombo = new QComboBox(main); + //groupCombo->setEditable( true ); M.O.: Currently, the code in filetypesview isn't capable of handling + //new top level types; so better not let them be added than crash. + groupCombo->insertStringList(groups); + grid->addWidget(groupCombo, 0, 1); + + QWhatsThis::add( groupCombo, i18n("Select the category under which" + " the new file type should be added.") ); + + l = new QLabel(i18n("Type name:"), main); + grid->addWidget(l, 1, 0); + + typeEd = new KLineEdit(main); + grid->addWidget(typeEd, 1, 1); + + typeEd->setFocus(); + + // Set a minimum size so that caption is not half-hidden + setMinimumSize( 300, 50 ); +} + +QString NewTypeDialog::group() const +{ + return groupCombo->currentText(); +} + + +QString NewTypeDialog::text() const +{ + return typeEd->text(); +} |