summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-12-28 17:25:47 (UTC)
committer cniehaus <cniehaus>2002-12-28 17:25:47 (UTC)
commit58868e48eba21d0f400d6b379cb3e3e5b74561b9 (patch) (unidiff)
treea464d97b6cfb484e12e900a2be61d01f4bfc8d5f
parent5d318b693ab687569051712f5079353ebcb6e659 (diff)
downloadopie-58868e48eba21d0f400d6b379cb3e3e5b74561b9.zip
opie-58868e48eba21d0f400d6b379cb3e3e5b74561b9.tar.gz
opie-58868e48eba21d0f400d6b379cb3e3e5b74561b9.tar.bz2
adding i18n-fixes
@@ -61,10 +61,10 @@ MainWindow :: MainWindow( QWidget *p, ch // Create the main menu menu = menuBar(); //new QMenuBar( this ); - menu->insertItem( "&Settings", settings ); - menu->insertItem( "&Edit", edit ); - menu->insertItem( "&Filter", filter ); - menu->insertItem( "&Help", help ); + menu->insertItem( tr( "&Settings" ), settings ); + menu->insertItem( tr( "&Edit" ), edit ); + menu->insertItem( tr( "&Filter" ), filter ); + menu->insertItem( tr( "&Help" ), help ); mgr = new DataManager(); mgr->loadServers();
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 5f0dabb..b00931e 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1,210 +1,210 @@
1/*************************************************************************** 1/***************************************************************************
2 mainwin.cpp - description 2 mainwin.cpp - description
3 ------------------- 3 -------------------
4 begin : Mon Aug 26 13:32:30 BST 2002 4 begin : Mon Aug 26 13:32:30 BST 2002
5 copyright : (C) 2002 by Andy Qua 5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk 6 email : andy.qua@blueyonder.co.uk
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 17
18#include <iostream> 18#include <iostream>
19using namespace std; 19using namespace std;
20 20
21#include <qmenubar.h> 21#include <qmenubar.h>
22#include <qpopupmenu.h> 22#include <qpopupmenu.h>
23#include <qmessagebox.h> 23#include <qmessagebox.h>
24 24
25#include "mainwin.h" 25#include "mainwin.h"
26#include "datamgr.h" 26#include "datamgr.h"
27#include "networkpkgmgr.h" 27#include "networkpkgmgr.h"
28#include "settingsimpl.h" 28#include "settingsimpl.h"
29#include "helpwindow.h" 29#include "helpwindow.h"
30#include "utils.h" 30#include "utils.h"
31#include "global.h" 31#include "global.h"
32 32
33MainWindow :: MainWindow( QWidget *p, char *name ) 33MainWindow :: MainWindow( QWidget *p, char *name )
34 :QMainWindow( p, name ) 34 :QMainWindow( p, name )
35{ 35{
36#ifdef QWS 36#ifdef QWS
37 showMaximized(); 37 showMaximized();
38#endif 38#endif
39 39
40 setCaption( tr( "AQPkg - Package Manager" ) ); 40 setCaption( tr( "AQPkg - Package Manager" ) );
41 41
42 // Create our menu 42 // Create our menu
43 help = new QPopupMenu( this ); 43 help = new QPopupMenu( this );
44 help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_G ); 44 help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_G );
45 help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A ); 45 help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A );
46 46
47 settings = new QPopupMenu( this ); 47 settings = new QPopupMenu( this );
48 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); 48 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S );
49 49
50 edit = new QPopupMenu( this ); 50 edit = new QPopupMenu( this );
51 edit->insertItem( "&Find", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_I ); 51 edit->insertItem( "&Find", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_I );
52 edit->insertItem( "Find &Next", this, SLOT(repeatSearchForPackage()), Qt::CTRL+Qt::Key_N ); 52 edit->insertItem( "Find &Next", this, SLOT(repeatSearchForPackage()), Qt::CTRL+Qt::Key_N );
53 53
54 filter = new QPopupMenu( this ); 54 filter = new QPopupMenu( this );
55 mnuShowUninstalledPkgsId = filter->insertItem( "Show &Non-Installed Packages", this, SLOT(filterUninstalledPackages()), Qt::CTRL+Qt::Key_U ); 55 mnuShowUninstalledPkgsId = filter->insertItem( "Show &Non-Installed Packages", this, SLOT(filterUninstalledPackages()), Qt::CTRL+Qt::Key_U );
56 mnuShowInstalledPkgsId = filter->insertItem( "Show In&stalled Packages", this, SLOT(filterInstalledPackages()), Qt::CTRL+Qt::Key_S ); 56 mnuShowInstalledPkgsId = filter->insertItem( "Show In&stalled Packages", this, SLOT(filterInstalledPackages()), Qt::CTRL+Qt::Key_S );
57 mnuShowUpgradedPkgsId = filter->insertItem( "Show U&pdated Packages", this, SLOT(filterUpgradedPackages()), Qt::CTRL+Qt::Key_P ); 57 mnuShowUpgradedPkgsId = filter->insertItem( "Show U&pdated Packages", this, SLOT(filterUpgradedPackages()), Qt::CTRL+Qt::Key_P );
58 filter->insertSeparator(); 58 filter->insertSeparator();
59 mnuFilterByCategory = filter->insertItem( "Filter By &Category", this, SLOT(filterCategory()), Qt::CTRL+Qt::Key_C ); 59 mnuFilterByCategory = filter->insertItem( "Filter By &Category", this, SLOT(filterCategory()), Qt::CTRL+Qt::Key_C );
60 mnuSetFilterCategory = filter->insertItem( "Set Filter C&ategory", this, SLOT(setFilterCategory()), Qt::CTRL+Qt::Key_A ); 60 mnuSetFilterCategory = filter->insertItem( "Set Filter C&ategory", this, SLOT(setFilterCategory()), Qt::CTRL+Qt::Key_A );
61 61
62 // Create the main menu 62 // Create the main menu
63 menu = menuBar(); //new QMenuBar( this ); 63 menu = menuBar(); //new QMenuBar( this );
64 menu->insertItem( "&Settings", settings ); 64 menu->insertItem( tr( "&Settings" ), settings );
65 menu->insertItem( "&Edit", edit ); 65 menu->insertItem( tr( "&Edit" ), edit );
66 menu->insertItem( "&Filter", filter ); 66 menu->insertItem( tr( "&Filter" ), filter );
67 menu->insertItem( "&Help", help ); 67 menu->insertItem( tr( "&Help" ), help );
68 68
69 mgr = new DataManager(); 69 mgr = new DataManager();
70 mgr->loadServers(); 70 mgr->loadServers();
71 71
72 stack = new QWidgetStack( this ); 72 stack = new QWidgetStack( this );
73 73
74 networkPkgWindow = new NetworkPackageManager( mgr, stack ); 74 networkPkgWindow = new NetworkPackageManager( mgr, stack );
75 stack->addWidget( networkPkgWindow, 1 ); 75 stack->addWidget( networkPkgWindow, 1 );
76 76
77 setCentralWidget( stack ); 77 setCentralWidget( stack );
78 stack->raiseWidget( networkPkgWindow ); 78 stack->raiseWidget( networkPkgWindow );
79} 79}
80 80
81MainWindow :: ~MainWindow() 81MainWindow :: ~MainWindow()
82{ 82{
83 delete networkPkgWindow; 83 delete networkPkgWindow;
84} 84}
85 85
86void MainWindow :: setDocument( const QString &doc ) 86void MainWindow :: setDocument( const QString &doc )
87{ 87{
88 // Remove path from package 88 // Remove path from package
89 QString package = Utils::getPackageNameFromIpkFilename( doc ); 89 QString package = Utils::getPackageNameFromIpkFilename( doc );
90 std::cout << "Selecting package " << package << std::endl; 90 std::cout << "Selecting package " << package << std::endl;
91 networkPkgWindow->selectLocalPackage( package ); 91 networkPkgWindow->selectLocalPackage( package );
92} 92}
93 93
94void MainWindow :: displaySettings() 94void MainWindow :: displaySettings()
95{ 95{
96 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); 96 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
97 if ( dlg->showDlg( 0 ) ) 97 if ( dlg->showDlg( 0 ) )
98 networkPkgWindow->updateData(); 98 networkPkgWindow->updateData();
99 delete dlg; 99 delete dlg;
100} 100}
101 101
102void MainWindow :: displayHelp() 102void MainWindow :: displayHelp()
103{ 103{
104 HelpWindow *dlg = new HelpWindow( this ); 104 HelpWindow *dlg = new HelpWindow( this );
105 dlg->exec(); 105 dlg->exec();
106 delete dlg; 106 delete dlg;
107} 107}
108 108
109void MainWindow :: searchForPackage() 109void MainWindow :: searchForPackage()
110{ 110{
111 networkPkgWindow->searchForPackage( false ); 111 networkPkgWindow->searchForPackage( false );
112} 112}
113 113
114void MainWindow :: repeatSearchForPackage() 114void MainWindow :: repeatSearchForPackage()
115{ 115{
116 networkPkgWindow->searchForPackage( true ); 116 networkPkgWindow->searchForPackage( true );
117} 117}
118 118
119void MainWindow :: displayAbout() 119void MainWindow :: displayAbout()
120{ 120{
121 QMessageBox::about( this, "About AQPkg", VERSION_TEXT ); 121 QMessageBox::about( this, "About AQPkg", VERSION_TEXT );
122} 122}
123 123
124 124
125void MainWindow :: filterUninstalledPackages() 125void MainWindow :: filterUninstalledPackages()
126{ 126{
127 bool val; 127 bool val;
128 if ( filter->isItemChecked( mnuShowUninstalledPkgsId ) ) 128 if ( filter->isItemChecked( mnuShowUninstalledPkgsId ) )
129 { 129 {
130 val = false; 130 val = false;
131 filter->setItemChecked( mnuShowUninstalledPkgsId, false ); 131 filter->setItemChecked( mnuShowUninstalledPkgsId, false );
132 } 132 }
133 else 133 else
134 { 134 {
135 val = true; 135 val = true;
136 filter->setItemChecked( mnuShowUninstalledPkgsId, true ); 136 filter->setItemChecked( mnuShowUninstalledPkgsId, true );
137 } 137 }
138 138
139 filter->setItemChecked( mnuShowInstalledPkgsId, false ); 139 filter->setItemChecked( mnuShowInstalledPkgsId, false );
140 networkPkgWindow->showOnlyInstalledPackages( false ); 140 networkPkgWindow->showOnlyInstalledPackages( false );
141 filter->setItemChecked( mnuShowUpgradedPkgsId, false ); 141 filter->setItemChecked( mnuShowUpgradedPkgsId, false );
142 networkPkgWindow->showUpgradedPackages( false ); 142 networkPkgWindow->showUpgradedPackages( false );
143 143
144 networkPkgWindow->showOnlyUninstalledPackages( val ); 144 networkPkgWindow->showOnlyUninstalledPackages( val );
145 145
146} 146}
147 147
148void MainWindow :: filterInstalledPackages() 148void MainWindow :: filterInstalledPackages()
149{ 149{
150 bool val; 150 bool val;
151 if ( filter->isItemChecked( mnuShowInstalledPkgsId ) ) 151 if ( filter->isItemChecked( mnuShowInstalledPkgsId ) )
152 { 152 {
153 val = false; 153 val = false;
154 filter->setItemChecked( mnuShowInstalledPkgsId, false ); 154 filter->setItemChecked( mnuShowInstalledPkgsId, false );
155 } 155 }
156 else 156 else
157 { 157 {
158 val = true; 158 val = true;
159 filter->setItemChecked( mnuShowInstalledPkgsId, true ); 159 filter->setItemChecked( mnuShowInstalledPkgsId, true );
160 } 160 }
161 161
162 filter->setItemChecked( mnuShowUninstalledPkgsId, false ); 162 filter->setItemChecked( mnuShowUninstalledPkgsId, false );
163 networkPkgWindow->showOnlyUninstalledPackages( false ); 163 networkPkgWindow->showOnlyUninstalledPackages( false );
164 filter->setItemChecked( mnuShowUpgradedPkgsId, false ); 164 filter->setItemChecked( mnuShowUpgradedPkgsId, false );
165 networkPkgWindow->showUpgradedPackages( false ); 165 networkPkgWindow->showUpgradedPackages( false );
166 166
167 networkPkgWindow->showOnlyInstalledPackages( val ); 167 networkPkgWindow->showOnlyInstalledPackages( val );
168} 168}
169 169
170void MainWindow :: filterUpgradedPackages() 170void MainWindow :: filterUpgradedPackages()
171{ 171{
172 bool val; 172 bool val;
173 if ( filter->isItemChecked( mnuShowUpgradedPkgsId ) ) 173 if ( filter->isItemChecked( mnuShowUpgradedPkgsId ) )
174 { 174 {
175 val = false; 175 val = false;
176 filter->setItemChecked( mnuShowUpgradedPkgsId, false ); 176 filter->setItemChecked( mnuShowUpgradedPkgsId, false );
177 } 177 }
178 else 178 else
179 { 179 {
180 val = true; 180 val = true;
181 filter->setItemChecked( mnuShowUpgradedPkgsId, true ); 181 filter->setItemChecked( mnuShowUpgradedPkgsId, true );
182 } 182 }
183 183
184 filter->setItemChecked( mnuShowUninstalledPkgsId, false ); 184 filter->setItemChecked( mnuShowUninstalledPkgsId, false );
185 networkPkgWindow->showOnlyUninstalledPackages( false ); 185 networkPkgWindow->showOnlyUninstalledPackages( false );
186 filter->setItemChecked( mnuShowInstalledPkgsId, false ); 186 filter->setItemChecked( mnuShowInstalledPkgsId, false );
187 networkPkgWindow->showOnlyInstalledPackages( false ); 187 networkPkgWindow->showOnlyInstalledPackages( false );
188 188
189 networkPkgWindow->showUpgradedPackages( val ); 189 networkPkgWindow->showUpgradedPackages( val );
190} 190}
191 191
192void MainWindow :: setFilterCategory() 192void MainWindow :: setFilterCategory()
193{ 193{
194 if ( networkPkgWindow->setFilterCategory( ) ) 194 if ( networkPkgWindow->setFilterCategory( ) )
195 filter->setItemChecked( mnuFilterByCategory, true ); 195 filter->setItemChecked( mnuFilterByCategory, true );
196} 196}
197 197
198void MainWindow :: filterCategory() 198void MainWindow :: filterCategory()
199{ 199{
200 if ( filter->isItemChecked( mnuFilterByCategory ) ) 200 if ( filter->isItemChecked( mnuFilterByCategory ) )
201 { 201 {
202 networkPkgWindow->filterByCategory( false ); 202 networkPkgWindow->filterByCategory( false );
203 filter->setItemChecked( mnuFilterByCategory, false ); 203 filter->setItemChecked( mnuFilterByCategory, false );
204 } 204 }
205 else 205 else
206 { 206 {
207 if ( networkPkgWindow->filterByCategory( true ) ) 207 if ( networkPkgWindow->filterByCategory( true ) )
208 filter->setItemChecked( mnuFilterByCategory, true ); 208 filter->setItemChecked( mnuFilterByCategory, true );
209 } 209 }
210} 210}