summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opie-smb/opie-smb.control2
-rw-r--r--noncore/net/opie-smb/qsmb.cpp28
-rw-r--r--noncore/net/opie-smb/qsmb.h28
3 files changed, 57 insertions, 1 deletions
diff --git a/noncore/net/opie-smb/opie-smb.control b/noncore/net/opie-smb/opie-smb.control
index fc8c316..2ec46be 100644
--- a/noncore/net/opie-smb/opie-smb.control
+++ b/noncore/net/opie-smb/opie-smb.control
@@ -1,11 +1,11 @@
1Package: opie-smb 1Package: opie-smb
2Files: plugins/application/libopie-smb.so* bin/opie-smb bin/smbfind pics/opie-smb apps/Applications/opie-smb.desktop 2Files: plugins/application/libopie-smb.so* bin/opie-smb bin/smbfind pics/opie-smb apps/Applications/opie-smb.desktop
3Version: $QPE_VERSION$EXTRAVERSION 3Version: $QPE_VERSION$EXTRAVERSION
4Architecture: arm 4Architecture: arm
5Arch: arm 5Arch: arm
6Maintainer: Kurt Korbatits (support@midget.net.au) 6Maintainer: ljp <lpotter@trolltech.com>
7Section: Network 7Section: Network
8Priority: optional 8Priority: optional
9Description: Gui front end for samba utilities. 9Description: Gui front end for samba utilities.
10Source: 10Source:
11Depends: smbclient 11Depends: smbclient
diff --git a/noncore/net/opie-smb/qsmb.cpp b/noncore/net/opie-smb/qsmb.cpp
index d35e09a..d74f240 100644
--- a/noncore/net/opie-smb/qsmb.cpp
+++ b/noncore/net/opie-smb/qsmb.cpp
@@ -1,96 +1,124 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002-2005 Kurt Korbatits <support@midget.net.au>
4           .>+-= Copyright (c) 2005 L. Potter <lpotter@trolltech.com>
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.BIN.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
1#include "qsmb.h" 29#include "qsmb.h"
2#include <qpushbutton.h> 30#include <qpushbutton.h>
3#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
4 32
5#include <string.h> 33#include <string.h>
6#include <qstring.h> 34#include <qstring.h>
7#include <qstringlist.h> 35#include <qstringlist.h>
8#include <qdir.h> 36#include <qdir.h>
9#include <qfileinfo.h> 37#include <qfileinfo.h>
10#include <qtabwidget.h> 38#include <qtabwidget.h>
11 39
12#include <qpe/process.h> 40#include <qpe/process.h>
13#include <qlabel.h> 41#include <qlabel.h>
14#include <qlineedit.h> 42#include <qlineedit.h>
15#include <qcombobox.h> 43#include <qcombobox.h>
16#include <qstringlist.h> 44#include <qstringlist.h>
17#include <qcheckbox.h> 45#include <qcheckbox.h>
18#include <qtextview.h> 46#include <qtextview.h>
19#include <qmessagebox.h> 47#include <qmessagebox.h>
20#include <qtextstream.h> 48#include <qtextstream.h>
21 49
22 50
23#include <pthread.h> 51#include <pthread.h>
24#include <signal.h> 52#include <signal.h>
25#include <ctype.h> 53#include <ctype.h>
26 54
27 55
28#include <netinet/in.h> 56#include <netinet/in.h>
29#include <arpa/inet.h> 57#include <arpa/inet.h>
30#include <rpc/clnt.h> 58#include <rpc/clnt.h>
31 59
32#include <sys/vfs.h> 60#include <sys/vfs.h>
33#include <mntent.h> 61#include <mntent.h>
34 62
35// #include <opie2/odebug.h> 63// #include <opie2/odebug.h>
36// using namespace Opie::Core; 64// using namespace Opie::Core;
37 65
38 66
39Qsmb::Qsmb( QWidget* parent, const char* name, WFlags fl ) 67Qsmb::Qsmb( QWidget* parent, const char* name, WFlags fl )
40 : FormQPESMBBase( parent, name, fl ) 68 : FormQPESMBBase( parent, name, fl )
41{ 69{
42 connect(CBHost, SIGNAL(activated(int)), this, SLOT(hostSelected(int))); 70 connect(CBHost, SIGNAL(activated(int)), this, SLOT(hostSelected(int)));
43 connect(DoItBtn, SIGNAL(clicked()), this, SLOT(DoItClicked())); 71 connect(DoItBtn, SIGNAL(clicked()), this, SLOT(DoItClicked()));
44 connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt())); 72 connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt()));
45 connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked())); 73 connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked()));
46 connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear())); 74 connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear()));
47 connect(ListViewScan, SIGNAL(clicked(QListViewItem*)), this, SLOT(TextViewClicked(QListViewItem*))); 75 connect(ListViewScan, SIGNAL(clicked(QListViewItem*)), this, SLOT(TextViewClicked(QListViewItem*)));
48 76
49 mountpt->setEditable(true); 77 mountpt->setEditable(true);
50 mountpt->insertItem("/mnt/samba1",-1); 78 mountpt->insertItem("/mnt/samba1",-1);
51 mountpt->insertItem("/mnt/samba2",-1); 79 mountpt->insertItem("/mnt/samba2",-1);
52 mountpt->insertItem("/mnt/samba3",-1); 80 mountpt->insertItem("/mnt/samba3",-1);
53 81
54 setTabOrder(BtnScan, username); 82 setTabOrder(BtnScan, username);
55 setTabOrder(username, password); 83 setTabOrder(username, password);
56 setTabOrder(password, CBHost); 84 setTabOrder(password, CBHost);
57 setTabOrder(CBHost, TextViewOutput); 85 setTabOrder(CBHost, TextViewOutput);
58 setTabOrder(TextViewOutput, mountpt); 86 setTabOrder(TextViewOutput, mountpt);
59 setTabOrder(mountpt, DoItBtn); 87 setTabOrder(mountpt, DoItBtn);
60 setTabOrder(DoItBtn, UnmountBtn); 88 setTabOrder(DoItBtn, UnmountBtn);
61 89
62 top_element = NULL; 90 top_element = NULL;
63 scanning = false; 91 scanning = false;
64} 92}
65 93
66Qsmb::~Qsmb() 94Qsmb::~Qsmb()
67{ 95{
68} 96}
69 97
70void Qsmb::clear() 98void Qsmb::clear()
71{ 99{
72 if (scanning) return; 100 if (scanning) return;
73 ListViewScan->clear(); 101 ListViewScan->clear();
74 TextViewOutput->setText(""); 102 TextViewOutput->setText("");
75 CBHost->clear(); 103 CBHost->clear();
76 top_element = NULL; 104 top_element = NULL;
77} 105}
78 106
79void Qsmb::scanClicked() 107void Qsmb::scanClicked()
80{ 108{
81 if (scanning) return; 109 if (scanning) return;
82 pthread_create(&tpid, NULL, runit, (void *)this); 110 pthread_create(&tpid, NULL, runit, (void *)this);
83} 111}
84 112
85void Qsmb::DoItClicked() 113void Qsmb::DoItClicked()
86{ 114{
87 115
88 if( !ListViewScan->selectedItem()) { 116 if( !ListViewScan->selectedItem()) {
89 QMessageBox::warning(this, tr("Error"),tr("<p>No share selected!</p>")); 117 QMessageBox::warning(this, tr("Error"),tr("<p>No share selected!</p>"));
90 return; 118 return;
91 } 119 }
92 if (scanning) return; 120 if (scanning) return;
93 pthread_create(&tpid, NULL, runitm, (void *)this); 121 pthread_create(&tpid, NULL, runitm, (void *)this);
94} 122}
95 123
96void* runit(void* arg) 124void* runit(void* arg)
diff --git a/noncore/net/opie-smb/qsmb.h b/noncore/net/opie-smb/qsmb.h
index 175b2c3..7908837 100644
--- a/noncore/net/opie-smb/qsmb.h
+++ b/noncore/net/opie-smb/qsmb.h
@@ -1,49 +1,77 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002-2005 Kurt Korbatits <support@midget.net.au>
4           .>+-= Copyright (c) 2005 L. Potter <lpotter@trolltech.com>
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.BIN.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
1#ifndef QSMB_H 29#ifndef QSMB_H
2#define QSMB_H 30#define QSMB_H
3 31
4#include "qsmbbase.h" 32#include "qsmbbase.h"
5 33
6#include <stdlib.h> 34#include <stdlib.h>
7#include <stdlib.h> 35#include <stdlib.h>
8#include <stdio.h> 36#include <stdio.h>
9 37
10#include <qlistview.h> 38#include <qlistview.h>
11#include <pthread.h> 39#include <pthread.h>
12 40
13#include <qlistview.h> 41#include <qlistview.h>
14 42
15class Qsmb : public FormQPESMBBase 43class Qsmb : public FormQPESMBBase
16{ 44{
17 Q_OBJECT 45 Q_OBJECT
18 46
19public: 47public:
20 static QString appName() { return QString::fromLatin1("opie-smb"); } 48 static QString appName() { return QString::fromLatin1("opie-smb"); }
21 Qsmb( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 49 Qsmb( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
22 ~Qsmb(); 50 ~Qsmb();
23 void scan(); 51 void scan();
24 void DoIt(); 52 void DoIt();
25 53
26private: 54private:
27 QListViewItem *top_element; 55 QListViewItem *top_element;
28 QComboBox *hosts; 56 QComboBox *hosts;
29 pthread_t tpid; 57 pthread_t tpid;
30 bool scanning; 58 bool scanning;
31 bool isMounted(const QString &); 59 bool isMounted(const QString &);
32 QString getMount(const QString &); 60 QString getMount(const QString &);
33 61
34public slots: 62public slots:
35 void clear(); 63 void clear();
36 void scanClicked(); 64 void scanClicked();
37 void hostSelected(int); 65 void hostSelected(int);
38 void DoItClicked(); 66 void DoItClicked();
39 void umountIt(); 67 void umountIt();
40 QString out; 68 QString out;
41 bool runCommand(const QStringList &); 69 bool runCommand(const QStringList &);
42 70
43private slots: 71private slots:
44 void TextViewClicked(QListViewItem*); 72 void TextViewClicked(QListViewItem*);
45}; 73};
46void* runit(void *arg); 74void* runit(void *arg);
47void* runitm(void *arg); 75void* runitm(void *arg);
48 76
49#endif // QSMB_H 77#endif // QSMB_H