summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/configdlg.cpp4
-rw-r--r--noncore/apps/odict/dingwidget.cpp3
-rw-r--r--noncore/apps/odict/odict.cpp5
-rw-r--r--noncore/apps/odict/searchmethoddlg.cpp3
4 files changed, 0 insertions, 15 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp
index b12a395..7fa6008 100644
--- a/noncore/apps/odict/configdlg.cpp
+++ b/noncore/apps/odict/configdlg.cpp
@@ -1,79 +1,75 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : ODict 2 application: : ODict
3 3
4 begin : December 2002 4 begin : December 2002
5 copyright : ( C ) 2002, 2003 by Carsten Niehaus 5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17#include "configdlg.h" 17#include "configdlg.h"
18#include "searchmethoddlg.h" 18#include "searchmethoddlg.h"
19 19
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23#include <qdialog.h>
24#include <qlayout.h> 23#include <qlayout.h>
25#include <qhbox.h>
26#include <qvbox.h> 24#include <qvbox.h>
27#include <qlabel.h>
28#include <qlistview.h> 25#include <qlistview.h>
29#include <qpushbutton.h> 26#include <qpushbutton.h>
30#include <qlineedit.h> 27#include <qlineedit.h>
31#include <qstringlist.h>
32 28
33ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) 29ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal)
34{ 30{
35 setCaption( tr( "Options" ) ); 31 setCaption( tr( "Options" ) );
36 QVBoxLayout *vbox_layout = new QVBoxLayout( this ); 32 QVBoxLayout *vbox_layout = new QVBoxLayout( this );
37 search_tab = new QWidget( this , "search_tab" ); 33 search_tab = new QWidget( this , "search_tab" );
38 QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); 34 QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" );
39 35
40 QHBox *hbox = new QHBox( search_tab ); 36 QHBox *hbox = new QHBox( search_tab );
41 list = new QListView( hbox ); 37 list = new QListView( hbox );
42 list->addColumn( tr( "Searchmethod" ) ); 38 list->addColumn( tr( "Searchmethod" ) );
43 loadSearchMethodNames(); 39 loadSearchMethodNames();
44 40
45 QVBox *vbox = new QVBox( hbox ); 41 QVBox *vbox = new QVBox( hbox );
46 new_button = new QPushButton( tr( "New" ) , vbox ); 42 new_button = new QPushButton( tr( "New" ) , vbox );
47 change_button = new QPushButton( tr( "Change" ) , vbox ); 43 change_button = new QPushButton( tr( "Change" ) , vbox );
48 delete_button = new QPushButton( tr( "Delete" ) , vbox ); 44 delete_button = new QPushButton( tr( "Delete" ) , vbox );
49 connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); 45 connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) );
50 connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); 46 connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() ));
51 connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); 47 connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() ));
52 48
53 vbox_layout_searchtab->addWidget( hbox ); 49 vbox_layout_searchtab->addWidget( hbox );
54 50
55 vbox_layout->addWidget( search_tab ); 51 vbox_layout->addWidget( search_tab );
56 52
57 QPEApplication::execDialog( this ); 53 QPEApplication::execDialog( this );
58} 54}
59 55
60void ConfigDlg::slotNewMethod() 56void ConfigDlg::slotNewMethod()
61{ 57{
62 SearchMethodDlg dlg( this, "SearchMethodDlg", true ); 58 SearchMethodDlg dlg( this, "SearchMethodDlg", true );
63 if ( dlg.exec() == QDialog::Accepted ) 59 if ( dlg.exec() == QDialog::Accepted )
64 { 60 {
65 dlg.saveItem(); 61 dlg.saveItem();
66 QListViewItem *item = new QListViewItem( list ); 62 QListViewItem *item = new QListViewItem( list );
67 item->setText( 0 , dlg.nameLE->text() ); 63 item->setText( 0 , dlg.nameLE->text() );
68 } 64 }
69} 65}
70 66
71void ConfigDlg::slotChangeMethod() 67void ConfigDlg::slotChangeMethod()
72{ 68{
73 if ( list->selectedItem() ) 69 if ( list->selectedItem() )
74 { 70 {
75 SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) ); 71 SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) );
76 if ( dlg.exec() == QDialog::Accepted ) 72 if ( dlg.exec() == QDialog::Accepted )
77 { 73 {
78 dlg.saveItem(); 74 dlg.saveItem();
79 QListViewItem *item = list->selectedItem(); 75 QListViewItem *item = list->selectedItem();
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp
index c804385..ef36ee5 100644
--- a/noncore/apps/odict/dingwidget.cpp
+++ b/noncore/apps/odict/dingwidget.cpp
@@ -1,72 +1,69 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : ODict 2 application: : ODict
3 3
4 begin : December 2002 4 begin : December 2002
5 copyright : ( C ) 2002, 2003 by Carsten Niehaus 5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17#include "dingwidget.h" 17#include "dingwidget.h"
18 18
19#include <qfile.h> 19#include <qfile.h>
20#include <qpe/config.h> 20#include <qpe/config.h>
21#include <qstring.h>
22#include <qtextstream.h> 21#include <qtextstream.h>
23#include <qstringlist.h>
24#include <qregexp.h>
25 22
26DingWidget::DingWidget( ) 23DingWidget::DingWidget( )
27{ 24{
28 methodname = QString::null; 25 methodname = QString::null;
29 trenner = QString::null; 26 trenner = QString::null;
30 lines = 0L; 27 lines = 0L;
31} 28}
32 29
33void DingWidget::loadDict( QString name ) 30void DingWidget::loadDict( QString name )
34{ 31{
35 lines.clear(); //as we will load a new list we have to 32 lines.clear(); //as we will load a new list we have to
36 //remove the old one 33 //remove the old one
37 34
38 Config cfg( "odict" ); 35 Config cfg( "odict" );
39 cfg.setGroup( "Method_" + name ); 36 cfg.setGroup( "Method_" + name );
40 QFile file( cfg.readEntry( "file" ) ); 37 QFile file( cfg.readEntry( "file" ) );
41 38
42 if( file.open( IO_ReadOnly ) ) 39 if( file.open( IO_ReadOnly ) )
43 { 40 {
44 QTextStream stream( &file ); 41 QTextStream stream( &file );
45 while ( !stream.eof() ) 42 while ( !stream.eof() )
46 { 43 {
47 lines.append( stream.readLine() ); 44 lines.append( stream.readLine() );
48 } 45 }
49 file.close(); 46 file.close();
50 } 47 }
51 48
52 setDict( name ); 49 setDict( name );
53 50
54 loadValues(); 51 loadValues();
55} 52}
56 53
57QString DingWidget::loadedDict() const 54QString DingWidget::loadedDict() const
58{ 55{
59 return dictName; 56 return dictName;
60} 57}
61 58
62void DingWidget::setCaseSensitive( bool caseS ) 59void DingWidget::setCaseSensitive( bool caseS )
63{ 60{
64 isCaseSensitive = caseS; 61 isCaseSensitive = caseS;
65} 62}
66 63
67void DingWidget::setDict( QString dict ) 64void DingWidget::setDict( QString dict )
68{ 65{
69 methodname = dict; 66 methodname = dict;
70} 67}
71 68
72void DingWidget::setQueryWord( QString qword ) 69void DingWidget::setQueryWord( QString qword )
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 9718c5c..d5c6d75 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -1,79 +1,74 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : ODict 2 application: : ODict
3 3
4 begin : December 2002 4 begin : December 2002
5 copyright : ( C ) 2002, 2003 by Carsten Niehaus 5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17#include "odict.h" 17#include "odict.h"
18#include "configdlg.h" 18#include "configdlg.h"
19#include "dingwidget.h" 19#include "dingwidget.h"
20 20
21#include <qlayout.h>
22#include <qpopupmenu.h>
23#include <qmenubar.h> 21#include <qmenubar.h>
24#include <qmessagebox.h> 22#include <qmessagebox.h>
25#include <qhbox.h>
26#include <qvbox.h> 23#include <qvbox.h>
27#include <qlabel.h> 24#include <qlabel.h>
28#include <qpushbutton.h> 25#include <qpushbutton.h>
29#include <qlineedit.h> 26#include <qlineedit.h>
30#include <qmainwindow.h>
31#include <qstring.h>
32#include <qaction.h> 27#include <qaction.h>
33#include <qtextbrowser.h> 28#include <qtextbrowser.h>
34#include <qcombobox.h> 29#include <qcombobox.h>
35 30
36#include <qpe/resource.h> 31#include <qpe/resource.h>
37#include <qpe/config.h> 32#include <qpe/config.h>
38 33
39ODict::ODict(QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent, name, fl ) 34ODict::ODict(QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent, name, fl )
40{ 35{
41 activated_name = QString::null; 36 activated_name = QString::null;
42 37
43 vbox = new QVBox( this ); 38 vbox = new QVBox( this );
44 setCaption( tr( "Opie-Dictionary" ) ); 39 setCaption( tr( "Opie-Dictionary" ) );
45 setupMenus(); 40 setupMenus();
46 41
47 QHBox *hbox = new QHBox( vbox ); 42 QHBox *hbox = new QHBox( vbox );
48 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); 43 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox );
49 query_label->show(); 44 query_label->show();
50 query_le = new QLineEdit( hbox ); 45 query_le = new QLineEdit( hbox );
51 query_co = new QComboBox( hbox ); 46 query_co = new QComboBox( hbox );
52 connect( query_co , SIGNAL( activated(const QString&) ), this, SLOT( slotMethodChanged(const QString&) ) ); 47 connect( query_co , SIGNAL( activated(const QString&) ), this, SLOT( slotMethodChanged(const QString&) ) );
53 ok_button = new QPushButton( tr( "&Ok" ), hbox ); 48 ok_button = new QPushButton( tr( "&Ok" ), hbox );
54 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); 49 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) );
55 50
56 top_name = new QLabel( vbox ); 51 top_name = new QLabel( vbox );
57 top_name->setAlignment( AlignHCenter ); 52 top_name->setAlignment( AlignHCenter );
58 browser_top = new QTextBrowser( vbox ); 53 browser_top = new QTextBrowser( vbox );
59 bottom_name = new QLabel( vbox ); 54 bottom_name = new QLabel( vbox );
60 bottom_name->setAlignment( AlignHCenter ); 55 bottom_name->setAlignment( AlignHCenter );
61 browser_bottom = new QTextBrowser( vbox ); 56 browser_bottom = new QTextBrowser( vbox );
62 57
63 ding = new DingWidget(); 58 ding = new DingWidget();
64 59
65 loadConfig(); 60 loadConfig();
66 setCentralWidget( vbox ); 61 setCentralWidget( vbox );
67} 62}
68 63
69void ODict::loadConfig() 64void ODict::loadConfig()
70{ 65{
71 /* 66 /*
72 * the name of the last used dictionary 67 * the name of the last used dictionary
73 */ 68 */
74 QString lastname; 69 QString lastname;
75 70
76 Config cfg ( "odict" ); 71 Config cfg ( "odict" );
77 cfg.setGroup( "generalsettings" ); 72 cfg.setGroup( "generalsettings" );
78 casesens = cfg.readEntry( "casesens" ).toInt(); 73 casesens = cfg.readEntry( "casesens" ).toInt();
79 74
diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp
index abe2966..f71cfd8 100644
--- a/noncore/apps/odict/searchmethoddlg.cpp
+++ b/noncore/apps/odict/searchmethoddlg.cpp
@@ -1,79 +1,76 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : ODict 2 application: : ODict
3 3
4 begin : December 2002 4 begin : December 2002
5 copyright : ( C ) 2002, 2003 by Carsten Niehaus 5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17#include "searchmethoddlg.h" 17#include "searchmethoddlg.h"
18 18
19#include <opie2/ofileselector.h> 19#include <opie2/ofileselector.h>
20#include <opie2/ofiledialog.h> 20#include <opie2/ofiledialog.h>
21 21
22#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24 24
25#include <qdialog.h>
26#include <qlayout.h> 25#include <qlayout.h>
27#include <qhbox.h>
28#include <qvbox.h> 26#include <qvbox.h>
29#include <qlabel.h> 27#include <qlabel.h>
30#include <qpushbutton.h> 28#include <qpushbutton.h>
31#include <qstring.h>
32#include <qlineedit.h> 29#include <qlineedit.h>
33#include <qdir.h> 30#include <qdir.h>
34 31
35using Opie::OFileDialog; 32using Opie::OFileDialog;
36using Opie::OFileSelector; 33using Opie::OFileSelector;
37 34
38SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) 35SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal)
39{ 36{
40 37
41 QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); 38 QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" );
42 QVBox *vbox = new QVBox( this ); 39 QVBox *vbox = new QVBox( this );
43 40
44 QHBox *hbox1 = new QHBox( vbox ); 41 QHBox *hbox1 = new QHBox( vbox );
45 QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); 42 QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 );
46 nameLE = new QLineEdit( hbox1 ); 43 nameLE = new QLineEdit( hbox1 );
47 44
48 QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox ); 45 QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox );
49 QHBox *hbox2 = new QHBox( vbox ); 46 QHBox *hbox2 = new QHBox( vbox );
50 dictFileLE = new QLineEdit( hbox2 ); 47 dictFileLE = new QLineEdit( hbox2 );
51 QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 ); 48 QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 );
52 connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); 49 connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) );
53 50
54 QWidget *dummywidget = new QWidget( vbox ); 51 QWidget *dummywidget = new QWidget( vbox );
55 QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget); 52 QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget);
56 QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget); 53 QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget);
57 QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget); 54 QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget);
58 lang1 = new QLineEdit( dummywidget ); 55 lang1 = new QLineEdit( dummywidget );
59 lang2 = new QLineEdit( dummywidget ); 56 lang2 = new QLineEdit( dummywidget );
60 trenner = new QLineEdit( dummywidget ); 57 trenner = new QLineEdit( dummywidget );
61 trenner->setText( "::" ); 58 trenner->setText( "::" );
62 59
63 QGridLayout *grid = new QGridLayout( dummywidget, 2,3 ); 60 QGridLayout *grid = new QGridLayout( dummywidget, 2,3 );
64 grid->addWidget( lag1, 0,0 ); 61 grid->addWidget( lag1, 0,0 );
65 grid->addWidget( devider, 0,1 ); 62 grid->addWidget( devider, 0,1 );
66 grid->addWidget( lag2, 0,2 ); 63 grid->addWidget( lag2, 0,2 );
67 grid->addWidget( lang1, 1,0 ); 64 grid->addWidget( lang1, 1,0 );
68 grid->addWidget( trenner, 1,1 ); 65 grid->addWidget( trenner, 1,1 );
69 grid->addWidget( lang2, 1,2 ); 66 grid->addWidget( lang2, 1,2 );
70 67
71 vbox_layout->addWidget( vbox ); 68 vbox_layout->addWidget( vbox );
72 69
73 QPEApplication::execDialog ( this ); 70 QPEApplication::execDialog ( this );
74 71
75 if( !itemname ) 72 if( !itemname )
76 setCaption( tr( "New Searchmethod" ) ); 73 setCaption( tr( "New Searchmethod" ) );
77 else 74 else
78 { 75 {
79 setCaption( tr( "Change Searchmethod" ) ); 76 setCaption( tr( "Change Searchmethod" ) );