author | cniehaus <cniehaus> | 2003-01-04 15:18:12 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-01-04 15:18:12 (UTC) |
commit | 059caec066275d75501471a49c5465fe4def59cf (patch) (unidiff) | |
tree | 08466d10e4c796fc12e86367860ca7dfd5f829a1 | |
parent | 4a9e13d7b9220b45cbbbdfab5f2ea56ea415d6a7 (diff) | |
download | opie-059caec066275d75501471a49c5465fe4def59cf.zip opie-059caec066275d75501471a49c5465fe4def59cf.tar.gz opie-059caec066275d75501471a49c5465fe4def59cf.tar.bz2 |
ok, now we have no more memleaks (I valgrind'ed and gdb'ed) and some more
feature are working.
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 20 | ||||
-rw-r--r-- | noncore/apps/odict/dingwidget.h | 6 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 9 |
3 files changed, 24 insertions, 11 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index 6154d68..2913836 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -1,105 +1,111 @@ | |||
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 <qhbox.h> | 21 | #include <qhbox.h> |
22 | #include <qlabel.h> | 22 | #include <qlabel.h> |
23 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qtextstream.h> | 27 | #include <qtextstream.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qregexp.h> | 29 | #include <qregexp.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <stdlib.h> // for getenv | 31 | #include <stdlib.h> // for getenv |
32 | 32 | ||
33 | DingWidget::DingWidget(QString word, QTextBrowser *browser_top, QTextBrowser *browser_bottom, QString activated_name) | 33 | DingWidget::DingWidget(QString word, QTextBrowser *browser_top, QTextBrowser *browser_bottom, QString activated_name) |
34 | { | 34 | { |
35 | methodname = activated_name; | 35 | methodname = activated_name; |
36 | queryword = word; | 36 | queryword = word; |
37 | trenner = QString::null; | 37 | trenner = QString::null; |
38 | lines = 0L; | ||
38 | loadValues(); | 39 | loadValues(); |
39 | QString opie_dir = getenv("OPIEDIR"); | 40 | QString opie_dir = getenv("OPIEDIR"); |
40 | QFile file( opie_dir+"/noncore/apps/odict/eng_ita.dic" ); | 41 | QFile file( opie_dir+"/noncore/apps/odict/eng_ita.dic" ); |
41 | QStringList lines; | ||
42 | 42 | ||
43 | if( file.open( IO_ReadOnly ) ) | 43 | if( file.open( IO_ReadOnly ) ) |
44 | { | 44 | { |
45 | QTextStream stream( &file ); | 45 | QTextStream stream( &file ); |
46 | while ( !stream.eof() ) | 46 | while ( !stream.eof() ) |
47 | { | 47 | { |
48 | lines.append( stream.readLine() ); | 48 | lines.append( stream.readLine() ); |
49 | } | 49 | } |
50 | file.close(); | 50 | file.close(); |
51 | } | 51 | } |
52 | 52 | ||
53 | lines = lines.grep( queryword ); | 53 | lines = lines.grep( queryword ); |
54 | 54 | ||
55 | topbrowser = browser_top; | ||
56 | bottombrowser = browser_bottom; | ||
57 | } | ||
58 | |||
59 | void DingWidget::setText() | ||
60 | { | ||
55 | QString top, bottom; | 61 | QString top, bottom; |
56 | parseInfo( lines, top , bottom ); | 62 | QStringList test = lines; |
57 | browser_top->setText( top ); | 63 | parseInfo( test, top , bottom ); |
58 | browser_bottom->setText( bottom ); | 64 | |
65 | topbrowser->setText( top ); | ||
66 | bottombrowser->setText( bottom ); | ||
59 | } | 67 | } |
60 | 68 | ||
61 | void DingWidget::loadValues() | 69 | void DingWidget::loadValues() |
62 | { | 70 | { |
63 | Config cfg( "odict" ); | 71 | Config cfg( "odict" ); |
64 | cfg.setGroup( "Method_"+methodname ); | 72 | cfg.setGroup( "Method_"+methodname ); |
65 | trenner = cfg.readEntry( "Seperator" ); | 73 | trenner = cfg.readEntry( "Seperator" ); |
66 | } | 74 | } |
67 | 75 | ||
68 | void DingWidget::parseInfo( QStringList &lines, QString &top, QString &bottom ) | 76 | void DingWidget::parseInfo( QStringList &lines, QString &top, QString &bottom ) |
69 | { | 77 | { |
70 | 78 | ||
71 | QString current; | 79 | QString current; |
72 | QString left; | 80 | QString left; |
73 | QString right; | 81 | QString right; |
74 | QString html_header = "<html><table>"; | 82 | QString html_header = "<html><table>"; |
75 | QString html_footer = "</table></html>"; | 83 | QString html_footer = "</table></html>"; |
76 | QString html_table_left = "<tr><td width='50'>"; | 84 | QString html_table_left = "<tr><td width='50'>"; |
77 | QString html_table_sep = "</td><td>"; | 85 | QString html_table_sep = "</td><td>"; |
78 | QString html_table_right = "</td></tr>"; | 86 | QString html_table_right = "</td></tr>"; |
79 | QRegExp reg_div( "\\" ); | 87 | QRegExp reg_div( trenner ); |
80 | //QRegExp reg_div( trenner ); | ||
81 | QRegExp reg_word( queryword ); | 88 | QRegExp reg_word( queryword ); |
82 | //QString substitute = "<font color=red>"+queryword+"</font>"; | ||
83 | QString substitute = "<a href=''>"+queryword+"</a>"; | 89 | QString substitute = "<a href=''>"+queryword+"</a>"; |
84 | QStringList toplist, bottomlist; | 90 | QStringList toplist, bottomlist; |
85 | for( QStringList::Iterator it = lines.begin() ; it != lines.end() ; ++it ) | 91 | for( QStringList::Iterator it = lines.begin() ; it != lines.end() ; ++it ) |
86 | { | 92 | { |
87 | current = *it; | 93 | current = *it; |
88 | left = current.left( current.find(reg_div) ); | 94 | left = current.left( current.find(reg_div) ); |
89 | right = current.right( current.length() - current.find(reg_div) - 1 ); | 95 | right = current.right( current.length() - current.find(reg_div) - 1 ); |
90 | if ( left.contains( reg_word ) ) | 96 | if ( left.contains( reg_word ) ) |
91 | { | 97 | { |
92 | left.replace( queryword, substitute ); | 98 | left.replace( queryword, substitute ); |
93 | toplist.append( html_table_left + left + html_table_sep + right + html_table_right ); | 99 | toplist.append( html_table_left + left + html_table_sep + right + html_table_right ); |
94 | } | 100 | } |
95 | else | 101 | else |
96 | { | 102 | { |
97 | right.replace( reg_word, substitute ); | 103 | right.replace( reg_word, substitute ); |
98 | bottomlist.append( html_table_left + right + html_table_sep + left + html_table_right ); | 104 | bottomlist.append( html_table_left + right + html_table_sep + left + html_table_right ); |
99 | } | 105 | } |
100 | } | 106 | } |
101 | 107 | ||
102 | //thats it, the lists are rendered. Lets put them in one string | 108 | //thats it, the lists are rendered. Lets put them in one string |
103 | bottom = html_header + bottomlist.join( "<br>" ) + html_footer; | 109 | bottom = html_header + bottomlist.join( "<br>" ) + html_footer; |
104 | top = html_header + toplist.join( "<br>" ) + html_footer; | 110 | top = html_header + toplist.join( "<br>" ) + html_footer; |
105 | } | 111 | } |
diff --git a/noncore/apps/odict/dingwidget.h b/noncore/apps/odict/dingwidget.h index 1cedb4e..c96039f 100644 --- a/noncore/apps/odict/dingwidget.h +++ b/noncore/apps/odict/dingwidget.h | |||
@@ -1,28 +1,34 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | class QString; | 10 | class QString; |
11 | class QTextBrowser; | 11 | class QTextBrowser; |
12 | class QStringList; | 12 | class QStringList; |
13 | 13 | ||
14 | #include <qstringlist.h> | ||
15 | |||
14 | #include <qstring.h> | 16 | #include <qstring.h> |
15 | 17 | ||
16 | class DingWidget | 18 | class DingWidget |
17 | { | 19 | { |
18 | public: | 20 | public: |
19 | DingWidget(QString word = 0, QTextBrowser* = 0, QTextBrowser* =0, QString activated_name=0); | 21 | DingWidget(QString word = 0, QTextBrowser* = 0, QTextBrowser* =0, QString activated_name=0); |
20 | 22 | ||
23 | void setText(); | ||
24 | QStringList lines; | ||
21 | private: | 25 | private: |
22 | QString search_word; | 26 | QString search_word; |
23 | void parseInfo( QStringList& , QString&, QString& ); | 27 | void parseInfo( QStringList& , QString&, QString& ); |
24 | QString queryword; | 28 | QString queryword; |
25 | void loadValues(); | 29 | void loadValues(); |
26 | QString methodname; | 30 | QString methodname; |
27 | QString trenner; | 31 | QString trenner; |
32 | |||
33 | QTextBrowser *topbrowser, *bottombrowser; | ||
28 | }; | 34 | }; |
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index e0104eb..6f176f9 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -1,193 +1,194 @@ | |||
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> | 21 | #include <qlayout.h> |
22 | #include <qpopupmenu.h> | 22 | #include <qpopupmenu.h> |
23 | #include <qmenubar.h> | 23 | #include <qmenubar.h> |
24 | #include <qmessagebox.h> | 24 | #include <qmessagebox.h> |
25 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qmainwindow.h> | 31 | #include <qmainwindow.h> |
32 | #include <qstring.h> | 32 | #include <qstring.h> |
33 | #include <qaction.h> | 33 | #include <qaction.h> |
34 | #include <qtextbrowser.h> | 34 | #include <qtextbrowser.h> |
35 | #include <qcombobox.h> | 35 | #include <qcombobox.h> |
36 | 36 | ||
37 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
38 | 38 | ||
39 | 39 | ||
40 | ODict::ODict() : QMainWindow() | 40 | ODict::ODict() : QMainWindow() |
41 | { | 41 | { |
42 | 42 | ||
43 | activated_name = QString::null; | 43 | activated_name = QString::null; |
44 | vbox = new QVBox( this ); | 44 | vbox = new QVBox( this ); |
45 | setCaption( tr( "OPIE-Dictionary" ) ); | 45 | setCaption( tr( "OPIE-Dictionary" ) ); |
46 | setupMenus(); | 46 | setupMenus(); |
47 | 47 | ||
48 | QHBox *hbox = new QHBox( vbox ); | 48 | QHBox *hbox = new QHBox( vbox ); |
49 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); | 49 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); |
50 | query_le = new QLineEdit( hbox ); | 50 | query_le = new QLineEdit( hbox ); |
51 | query_co = new QComboBox( hbox ); | 51 | query_co = new QComboBox( hbox ); |
52 | connect( query_co , SIGNAL( activated(int) ), this, SLOT( slotMethodChanged(int) ) ); | 52 | connect( query_co , SIGNAL( activated(int) ), this, SLOT( slotMethodChanged(int) ) ); |
53 | ok_button = new QPushButton( tr( "&Ok" ), hbox ); | 53 | ok_button = new QPushButton( tr( "&Ok" ), hbox ); |
54 | connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); | 54 | connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); |
55 | browser_top = new QTextBrowser( vbox ); | 55 | browser_top = new QTextBrowser( vbox ); |
56 | browser_bottom = new QTextBrowser( vbox ); | 56 | browser_bottom = new QTextBrowser( vbox ); |
57 | 57 | ||
58 | loadConfig(); | 58 | loadConfig(); |
59 | setCentralWidget( vbox ); | 59 | setCentralWidget( vbox ); |
60 | } | 60 | } |
61 | 61 | ||
62 | void ODict::loadConfig() | 62 | void ODict::loadConfig() |
63 | { | 63 | { |
64 | Config cfg ( "odict" ); | 64 | Config cfg ( "odict" ); |
65 | cfg.setGroup( "generalsettings" ); | 65 | cfg.setGroup( "generalsettings" ); |
66 | errorTol = cfg.readEntry( "errtol" ).toInt(); | 66 | errorTol = cfg.readEntry( "errtol" ).toInt(); |
67 | casesens = cfg.readEntry( "casesens" ).toInt(); | 67 | casesens = cfg.readEntry( "casesens" ).toInt(); |
68 | regexp = cfg.readEntry( "regexp" ).toInt(); | 68 | regexp = cfg.readEntry( "regexp" ).toInt(); |
69 | completewords = cfg.readEntry( "completewords" ).toInt(); | 69 | completewords = cfg.readEntry( "completewords" ).toInt(); |
70 | 70 | ||
71 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); | 71 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); |
72 | query_co->clear(); | 72 | query_co->clear(); |
73 | for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) | 73 | for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) |
74 | { | 74 | { |
75 | cfg.setGroup( *it ); | 75 | cfg.setGroup( *it ); |
76 | query_co->insertItem( cfg.readEntry( "Name" ) ); | 76 | query_co->insertItem( cfg.readEntry( "Name" ) ); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | void ODict::saveConfig() | 81 | void ODict::saveConfig() |
82 | { | 82 | { |
83 | Config cfg ( "odict" ); | 83 | Config cfg ( "odict" ); |
84 | cfg.setGroup( "generalsettings" ); | 84 | cfg.setGroup( "generalsettings" ); |
85 | cfg.writeEntry( "errtol" , errorTol ); | 85 | cfg.writeEntry( "errtol" , errorTol ); |
86 | cfg.writeEntry( "casesens" , casesens ); | 86 | cfg.writeEntry( "casesens" , casesens ); |
87 | cfg.writeEntry( "regexp" , regexp ); | 87 | cfg.writeEntry( "regexp" , regexp ); |
88 | cfg.writeEntry( "completewords" , completewords ); | 88 | cfg.writeEntry( "completewords" , completewords ); |
89 | } | 89 | } |
90 | 90 | ||
91 | void ODict::slotDisplayAbout() | 91 | void ODict::slotDisplayAbout() |
92 | { | 92 | { |
93 | QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030104" ) ); | 93 | QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030104" ) ); |
94 | } | 94 | } |
95 | 95 | ||
96 | void ODict::slotStartQuery() | 96 | void ODict::slotStartQuery() |
97 | { | 97 | { |
98 | QString querystring = query_le->text(); | 98 | QString querystring = query_le->text(); |
99 | qDebug("opening dict >%s< for >%s<", activated_name.latin1(),querystring.latin1()); | 99 | qDebug("opening dict >%s< for >%s<", activated_name.latin1(),querystring.latin1()); |
100 | if (querystring.isEmpty()){ | 100 | if (querystring.isEmpty()){ |
101 | qWarning("empty querystring"); | 101 | qWarning("empty querystring"); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | if (!activated_name || activated_name.isEmpty()) | 104 | if (!activated_name || activated_name.isEmpty()) |
105 | QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") ); | 105 | QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") ); |
106 | else | 106 | else |
107 | DingWidget *ding = new DingWidget( querystring , browser_top, browser_bottom, activated_name ); | 107 | DingWidget *ding = new DingWidget( querystring , browser_top, browser_bottom, activated_name ); |
108 | ding->setText(); | ||
108 | } | 109 | } |
109 | 110 | ||
110 | 111 | ||
111 | void ODict::slotSetErrorcount( int count ) | 112 | void ODict::slotSetErrorcount( int count ) |
112 | { | 113 | { |
113 | errorTol = count; | 114 | errorTol = count; |
114 | } | 115 | } |
115 | 116 | ||
116 | void ODict::slotSettings() | 117 | void ODict::slotSettings() |
117 | { | 118 | { |
118 | ConfigDlg dlg( this, "Config" , true); | 119 | ConfigDlg dlg( this, "Config" , true); |
119 | if ( dlg.exec() == QDialog::Accepted ) | 120 | if ( dlg.exec() == QDialog::Accepted ) |
120 | { | 121 | { |
121 | dlg.writeEntries(); | 122 | dlg.writeEntries(); |
122 | loadConfig(); | 123 | loadConfig(); |
123 | } | 124 | } |
124 | else qDebug( "abgebrochen" ); | 125 | else qDebug( "abgebrochen" ); |
125 | } | 126 | } |
126 | 127 | ||
127 | void ODict::slotSetParameter( int count ) | 128 | void ODict::slotSetParameter( int count ) |
128 | { | 129 | { |
129 | if ( count == 0 ) | 130 | if ( count == 0 ) |
130 | { | 131 | { |
131 | if ( casesens ) | 132 | if ( casesens ) |
132 | casesens = false; | 133 | casesens = false; |
133 | else | 134 | else |
134 | casesens = true; | 135 | casesens = true; |
135 | } | 136 | } |
136 | 137 | ||
137 | if ( count == 1 ) | 138 | if ( count == 1 ) |
138 | { | 139 | { |
139 | if ( completewords ) | 140 | if ( completewords ) |
140 | completewords = false; | 141 | completewords = false; |
141 | else | 142 | else |
142 | completewords = true; | 143 | completewords = true; |
143 | } | 144 | } |
144 | if ( count == 2 ) | 145 | if ( count == 2 ) |
145 | { | 146 | { |
146 | if ( regexp ) | 147 | if ( regexp ) |
147 | regexp = false; | 148 | regexp = false; |
148 | else | 149 | else |
149 | regexp = true; | 150 | regexp = true; |
150 | } | 151 | } |
151 | else qWarning( "ERROR" ); | 152 | else qWarning( "ERROR" ); |
152 | } | 153 | } |
153 | 154 | ||
154 | void ODict::slotMethodChanged( int methodnumber ) | 155 | void ODict::slotMethodChanged( int methodnumber ) |
155 | { | 156 | { |
156 | activated_name = query_co->currentText(); | 157 | activated_name = query_co->currentText(); |
157 | } | 158 | } |
158 | 159 | ||
159 | void ODict::setupMenus() | 160 | void ODict::setupMenus() |
160 | { | 161 | { |
161 | menu = new QMenuBar( this ); | 162 | menu = new QMenuBar( this ); |
162 | 163 | ||
163 | settings = new QPopupMenu( menu ); | 164 | settings = new QPopupMenu( menu ); |
164 | setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); | 165 | setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); |
165 | connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); | 166 | connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); |
166 | setting_a->addTo( settings ); | 167 | setting_a->addTo( settings ); |
167 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); | 168 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); |
168 | 169 | ||
169 | parameter = new QPopupMenu( menu ); | 170 | parameter = new QPopupMenu( menu ); |
170 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); | 171 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); |
171 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); | 172 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); |
172 | parameter->insertItem( tr( "Only &complete Words" ), 1 , 1) ; | 173 | parameter->insertItem( tr( "Only &complete Words" ), 1 , 1) ; |
173 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); | 174 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); |
174 | parameter->insertSeparator(); | 175 | parameter->insertSeparator(); |
175 | error_tol_menu = new QPopupMenu( menu ); | 176 | error_tol_menu = new QPopupMenu( menu ); |
176 | error_tol_menu->setCheckable( TRUE ); | 177 | error_tol_menu->setCheckable( TRUE ); |
177 | connect( error_tol_menu, SIGNAL( activated( int ) ), this, SLOT( slotSetErrorcount( int ) ) ); | 178 | connect( error_tol_menu, SIGNAL( activated( int ) ), this, SLOT( slotSetErrorcount( int ) ) ); |
178 | 179 | ||
179 | error_tol_menu->insertItem( tr( "0 Errors" ), 0 ); | 180 | error_tol_menu->insertItem( tr( "0 Errors" ), 0 ); |
180 | error_tol_menu->insertItem( tr( "1 Errors" ), 1 ); | 181 | error_tol_menu->insertItem( tr( "1 Errors" ), 1 ); |
181 | error_tol_menu->insertItem( tr( "2 Errors" ), 2 ); | 182 | error_tol_menu->insertItem( tr( "2 Errors" ), 2 ); |
182 | error_tol_menu->insertItem( tr( "3 Errors" ), 3 ); | 183 | error_tol_menu->insertItem( tr( "3 Errors" ), 3 ); |
183 | error_tol_menu->insertItem( tr( "4 Errors" ), 4 ); | 184 | error_tol_menu->insertItem( tr( "4 Errors" ), 4 ); |
184 | error_tol_menu->insertItem( tr( "Until Hit" ), 5 ); | 185 | error_tol_menu->insertItem( tr( "Until Hit" ), 5 ); |
185 | parameter->insertItem( tr( "&Error tolerance" ), error_tol_menu ); | 186 | parameter->insertItem( tr( "&Error tolerance" ), error_tol_menu ); |
186 | 187 | ||
187 | help = new QPopupMenu( menu ); | 188 | help = new QPopupMenu( menu ); |
188 | help->insertItem("&About",this,SLOT( slotDisplayAbout() )); | 189 | help->insertItem("&About",this,SLOT( slotDisplayAbout() )); |
189 | 190 | ||
190 | menu->insertItem( tr( "Settings" ) , settings ); | 191 | menu->insertItem( tr( "Settings" ) , settings ); |
191 | menu->insertItem( tr( "Parameter" ) , parameter ); | 192 | menu->insertItem( tr( "Parameter" ) , parameter ); |
192 | menu->insertItem( tr( "Help" ) , help ); | 193 | menu->insertItem( tr( "Help" ) , help ); |
193 | } | 194 | } |