summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/viewatt.cpp
Unidiff
Diffstat (limited to 'noncore/net/mailit/viewatt.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/viewatt.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/net/mailit/viewatt.cpp b/noncore/net/mailit/viewatt.cpp
index 21885c2..293e137 100644
--- a/noncore/net/mailit/viewatt.cpp
+++ b/noncore/net/mailit/viewatt.cpp
@@ -5,86 +5,86 @@
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "resource.h" 20#include "resource.h"
21#include "viewatt.h" 21#include "viewatt.h"
22#include <qwhatsthis.h> 22#include <qwhatsthis.h>
23#include <qpe/applnk.h> 23#include <qpe/applnk.h>
24#include <qpe/mimetype.h> 24#include <qpe/mimetype.h>
25 25
26ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f) 26ViewAtt::ViewAtt(QWidget *parent, const char *name, WFlags f)
27 : QMainWindow(parent, name, f) 27 : QMainWindow(parent, name, f)
28{ 28{
29 setCaption("Exploring attatchments"); 29 setCaption(tr("Exploring attatchments"));
30 30
31 setToolBarsMovable( FALSE ); 31 setToolBarsMovable( FALSE );
32 bar = new QToolBar(this); 32 bar = new QToolBar(this);
33 installButton = new QAction( tr( "Install" ), Resource::loadPixmap( "exec" ), QString::null, CTRL + Key_C, this, 0 ); 33 installButton = new QAction( tr( "Install" ), Resource::loadPixmap( "exec" ), QString::null, CTRL + Key_C, this, 0 );
34 connect(installButton, SIGNAL(activated()), this, SLOT(install()) ); 34 connect(installButton, SIGNAL(activated()), this, SLOT(install()) );
35 installButton->setWhatsThis(tr("Click here to install the attachment to your Documents")); 35 installButton->setWhatsThis(tr("Click here to install the attachment to your Documents"));
36 36
37 listView = new QListView(this, "AttView"); 37 listView = new QListView(this, "AttView");
38 listView->addColumn( "Attatchment" ); 38 listView->addColumn( tr("Attatchment") );
39 listView->addColumn( "Type" ); 39 listView->addColumn( tr("Type") );
40 listView->addColumn( "Installed" ); 40 listView->addColumn( tr("Installed") );
41 setCentralWidget(listView); 41 setCentralWidget(listView);
42 QWhatsThis::add(listView,QWidget::tr("This is an overview about all attachments in the mail")); 42 QWhatsThis::add(listView,QWidget::tr("This is an overview about all attachments in the mail"));
43} 43}
44 44
45void ViewAtt::update(Email *mailIn, bool inbox) 45void ViewAtt::update(Email *mailIn, bool inbox)
46{ 46{
47 QListViewItem *item; 47 QListViewItem *item;
48 Enclosure *ePtr; 48 Enclosure *ePtr;
49 49
50 50
51 51
52 listView->clear(); 52 listView->clear();
53 if (inbox) { 53 if (inbox) {
54 bar->clear(); 54 bar->clear();
55 installButton->addTo( bar ); 55 installButton->addTo( bar );
56 bar->show(); 56 bar->show();
57 } else { 57 } else {
58 bar->hide(); 58 bar->hide();
59 } 59 }
60 60
61 mail = mailIn; 61 mail = mailIn;
62 for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { 62 for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) {
63 63
64 QString isInstalled = "No"; 64 QString isInstalled = tr("No");
65 if (ePtr->installed) 65 if (ePtr->installed)
66 isInstalled = "Yes"; 66 isInstalled = tr("Yes");
67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled); 67 item = new QListViewItem(listView, ePtr->originalName, ePtr->contentType, isInstalled);
68 68
69 const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute; 69 const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute;
70 70
71 MimeType mt(mtypeDef); 71 MimeType mt(mtypeDef);
72 72
73 item->setPixmap(0, mt.pixmap()); 73 item->setPixmap(0, mt.pixmap());
74 74
75 /* 75 /*
76 if (ePtr->contentType == "TEXT") { 76 if (ePtr->contentType == "TEXT") {
77 actions = new QAction( tr("View"), Resource::loadPixmap("TextEditor"), QString::null, CTRL + Key_C, this, 0); 77 actions = new QAction( tr("View"), Resource::loadPixmap("TextEditor"), QString::null, CTRL + Key_C, this, 0);
78 actions->addTo(bar); 78 actions->addTo(bar);
79 } 79 }
80 if (ePtr->contentType == "AUDIO") { 80 if (ePtr->contentType == "AUDIO") {
81 actions = new QAction( tr("Play"), Resource::loadPixmap("SoundPlayer"), QString::null, CTRL + Key_C, this, 0); 81 actions = new QAction( tr("Play"), Resource::loadPixmap("SoundPlayer"), QString::null, CTRL + Key_C, this, 0);
82 actions->addTo(bar); 82 actions->addTo(bar);
83 item->setPixmap(0, Resource::loadPixmap("play")); 83 item->setPixmap(0, Resource::loadPixmap("play"));
84 } 84 }
85 if (ePtr->contentType == "IMAGE") { 85 if (ePtr->contentType == "IMAGE") {
86 actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0); 86 actions = new QAction( tr("Show"), Resource::loadPixmap("pixmap"), QString::null, CTRL + Key_C, this, 0);
87 actions->addTo(bar); 87 actions->addTo(bar);
88 item->setPixmap(0, Resource::loadPixmap("pixmap")); 88 item->setPixmap(0, Resource::loadPixmap("pixmap"));
89 }*/ 89 }*/
90 } 90 }
@@ -95,27 +95,27 @@ void ViewAtt::install()
95 Enclosure *ePtr, *selPtr; 95 Enclosure *ePtr, *selPtr;
96 QListViewItem *item; 96 QListViewItem *item;
97 QString filename; 97 QString filename;
98 DocLnk d; 98 DocLnk d;
99 99
100 item = listView->selectedItem(); 100 item = listView->selectedItem();
101 if (item != NULL) { 101 if (item != NULL) {
102 filename = item->text(0); 102 filename = item->text(0);
103 selPtr = NULL; 103 selPtr = NULL;
104 for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { 104 for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) {
105 if (ePtr->originalName == filename) 105 if (ePtr->originalName == filename)
106 selPtr = ePtr; 106 selPtr = ePtr;
107 } 107 }
108 108
109 if (selPtr == NULL) { 109 if (selPtr == NULL) {
110 qWarning("Internal error, file is not installed to documents"); 110 qWarning("Internal error, file is not installed to documents");
111 return; 111 return;
112 } 112 }
113 113
114 d.setName(selPtr->originalName); 114 d.setName(selPtr->originalName);
115 d.setFile(selPtr->path + selPtr->name); 115 d.setFile(selPtr->path + selPtr->name);
116 d.setType(selPtr->contentType + "/" + selPtr->contentAttribute); 116 d.setType(selPtr->contentType + "/" + selPtr->contentAttribute);
117 d.writeLink(); 117 d.writeLink();
118 selPtr->installed = TRUE; 118 selPtr->installed = TRUE;
119 item->setText(2, "Yes"); 119 item->setText(2, tr("Yes"));
120 } 120 }
121} 121}