Diffstat (limited to 'noncore/apps/odict/searchmethoddlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/searchmethoddlg.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp index 203c663..8a14703 100644 --- a/noncore/apps/odict/searchmethoddlg.cpp +++ b/noncore/apps/odict/searchmethoddlg.cpp | |||
@@ -17,24 +17,25 @@ | |||
17 | #include "searchmethoddlg.h" | 17 | #include "searchmethoddlg.h" |
18 | 18 | ||
19 | #include <qdialog.h> | 19 | #include <qdialog.h> |
20 | #include <qpe/config.h> | 20 | #include <qpe/config.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | 22 | ||
23 | #include <qhbox.h> | 23 | #include <qhbox.h> |
24 | #include <qvbox.h> | 24 | #include <qvbox.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qstring.h> | 27 | #include <qstring.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qdir.h> | ||
29 | 30 | ||
30 | #include <opie/ofileselector.h> | 31 | #include <opie/ofileselector.h> |
31 | #include <opie/ofiledialog.h> | 32 | #include <opie/ofiledialog.h> |
32 | 33 | ||
33 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) | 34 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) |
34 | { | 35 | { |
35 | 36 | ||
36 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); | 37 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); |
37 | QVBox *vbox = new QVBox( this ); | 38 | QVBox *vbox = new QVBox( this ); |
38 | 39 | ||
39 | QHBox *hbox1 = new QHBox( vbox ); | 40 | QHBox *hbox1 = new QHBox( vbox ); |
40 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); | 41 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); |
@@ -81,25 +82,25 @@ void SearchMethodDlg::setupEntries( QString item ) | |||
81 | { | 82 | { |
82 | Config cfg( "odict" ); | 83 | Config cfg( "odict" ); |
83 | cfg.setGroup( "Method_"+itemName ); | 84 | cfg.setGroup( "Method_"+itemName ); |
84 | trenner->setText( cfg.readEntry( "Seperator" ) ); | 85 | trenner->setText( cfg.readEntry( "Seperator" ) ); |
85 | lang1->setText( cfg.readEntry( "Lang1" ) ); | 86 | lang1->setText( cfg.readEntry( "Lang1" ) ); |
86 | lang2->setText( cfg.readEntry( "Lang2" ) ); | 87 | lang2->setText( cfg.readEntry( "Lang2" ) ); |
87 | nameLE->setText( itemName ); | 88 | nameLE->setText( itemName ); |
88 | dictFileLE->setText( cfg.readEntry( "file" ) ); | 89 | dictFileLE->setText( cfg.readEntry( "file" ) ); |
89 | } | 90 | } |
90 | 91 | ||
91 | void SearchMethodDlg::slotBrowse() | 92 | void SearchMethodDlg::slotBrowse() |
92 | { | 93 | { |
93 | itemName=OFileDialog::getOpenFileName( OFileSelector::EXTENDED,"/home/carsten" ); | 94 | itemName=OFileDialog::getOpenFileName( OFileSelector::EXTENDED,QDir::homeDirPath()); |
94 | dictFileLE->setText( itemName ); | 95 | dictFileLE->setText( itemName ); |
95 | } | 96 | } |
96 | 97 | ||
97 | void SearchMethodDlg::saveItem() | 98 | void SearchMethodDlg::saveItem() |
98 | { | 99 | { |
99 | QString name = nameLE->text(); | 100 | QString name = nameLE->text(); |
100 | Config cfg( "odict" ); | 101 | Config cfg( "odict" ); |
101 | cfg.setGroup( "Method_"+name ); | 102 | cfg.setGroup( "Method_"+name ); |
102 | cfg.writeEntry( "Name", name ); | 103 | cfg.writeEntry( "Name", name ); |
103 | cfg.writeEntry( "Seperator", trenner->text() ); | 104 | cfg.writeEntry( "Seperator", trenner->text() ); |
104 | cfg.writeEntry( "Lang1", lang1->text() ); | 105 | cfg.writeEntry( "Lang1", lang1->text() ); |
105 | cfg.writeEntry( "Lang2", lang2->text() ); | 106 | cfg.writeEntry( "Lang2", lang2->text() ); |