author | llornkcor <llornkcor> | 2005-08-16 09:05:22 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-08-16 09:05:22 (UTC) |
commit | 2176aa6c353e794798aa8ecddc28be365e94989c (patch) (unidiff) | |
tree | 595d31e18e427fbe93fed75efe70d952b9eacab7 | |
parent | e49f60f79b86a6feb3cae4bc33c19123deec4eb3 (diff) | |
download | opie-2176aa6c353e794798aa8ecddc28be365e94989c.zip opie-2176aa6c353e794798aa8ecddc28be365e94989c.tar.gz opie-2176aa6c353e794798aa8ecddc28be365e94989c.tar.bz2 |
set tab order and fix other things.
-rw-r--r-- | noncore/net/opie-smb/qsmb.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/net/opie-smb/qsmb.cpp b/noncore/net/opie-smb/qsmb.cpp index b978b46..e2ddc7f 100644 --- a/noncore/net/opie-smb/qsmb.cpp +++ b/noncore/net/opie-smb/qsmb.cpp | |||
@@ -37,47 +37,54 @@ | |||
37 | 37 | ||
38 | 38 | ||
39 | Qsmb::Qsmb( QWidget* parent, const char* name, WFlags fl ) | 39 | Qsmb::Qsmb( QWidget* parent, const char* name, WFlags fl ) |
40 | : FormQPESMBBase( parent, name, fl ) | 40 | : FormQPESMBBase( parent, name, fl ) |
41 | { | 41 | { |
42 | connect(CBHost, SIGNAL(activated(int)), this, SLOT(hostSelected(int))); | 42 | connect(CBHost, SIGNAL(activated(int)), this, SLOT(hostSelected(int))); |
43 | connect(DoItBtn, SIGNAL(clicked()), this, SLOT(DoItClicked())); | 43 | connect(DoItBtn, SIGNAL(clicked()), this, SLOT(DoItClicked())); |
44 | connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt())); | 44 | connect(UnmountBtn, SIGNAL(clicked()), this, SLOT(umountIt())); |
45 | connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked())); | 45 | connect(BtnScan, SIGNAL(clicked()), this, SLOT(scanClicked())); |
46 | connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear())); | 46 | connect(BtnClear, SIGNAL(clicked()), this, SLOT(clear())); |
47 | 47 | ||
48 | mountpt->setEditable(true); | 48 | mountpt->setEditable(true); |
49 | mountpt->insertItem("/mnt/samba1",-1); | 49 | mountpt->insertItem("/mnt/samba1",-1); |
50 | mountpt->insertItem("/mnt/samba2",-1); | 50 | mountpt->insertItem("/mnt/samba2",-1); |
51 | mountpt->insertItem("/mnt/samba3",-1); | 51 | mountpt->insertItem("/mnt/samba3",-1); |
52 | 52 | ||
53 | // TextViewOutput | 53 | setTabOrder(BtnScan, username); |
54 | setTabOrder(username, password); | ||
55 | setTabOrder(password, CBHost); | ||
56 | setTabOrder(CBHost, TextViewOutput); | ||
57 | setTabOrder(TextViewOutput, mountpt); | ||
58 | setTabOrder(mountpt, DoItBtn); | ||
59 | setTabOrder(DoItBtn, UnmountBtn); | ||
54 | 60 | ||
55 | top_element = NULL; | 61 | top_element = NULL; |
56 | scanning = false; | 62 | scanning = false; |
57 | } | 63 | } |
58 | 64 | ||
59 | Qsmb::~Qsmb() | 65 | Qsmb::~Qsmb() |
60 | { | 66 | { |
61 | } | 67 | } |
62 | 68 | ||
63 | void Qsmb::clear() | 69 | void Qsmb::clear() |
64 | { | 70 | { |
65 | if (scanning) return; | 71 | if (scanning) return; |
66 | ListViewScan->clear(); | 72 | ListViewScan->clear(); |
67 | TextViewOutput->setText(""); | 73 | TextViewOutput->setText(""); |
74 | CBHost->clear(); | ||
68 | top_element = NULL; | 75 | top_element = NULL; |
69 | } | 76 | } |
70 | 77 | ||
71 | void Qsmb::scanClicked() | 78 | void Qsmb::scanClicked() |
72 | { | 79 | { |
73 | if (scanning) return; | 80 | if (scanning) return; |
74 | pthread_create(&tpid, NULL, runit, (void *)this); | 81 | pthread_create(&tpid, NULL, runit, (void *)this); |
75 | } | 82 | } |
76 | 83 | ||
77 | void Qsmb::DoItClicked() | 84 | void Qsmb::DoItClicked() |
78 | { | 85 | { |
79 | 86 | ||
80 | if( !ListViewScan->selectedItem()) { | 87 | if( !ListViewScan->selectedItem()) { |
81 | QMessageBox::warning(this, tr("Error"),tr("<p>No share selected!</p>")); | 88 | QMessageBox::warning(this, tr("Error"),tr("<p>No share selected!</p>")); |
82 | return; | 89 | return; |
83 | } | 90 | } |
@@ -88,33 +95,34 @@ void Qsmb::DoItClicked() | |||
88 | void* runit(void* arg) | 95 | void* runit(void* arg) |
89 | { | 96 | { |
90 | Qsmb* caller = (Qsmb*)arg; | 97 | Qsmb* caller = (Qsmb*)arg; |
91 | caller->scan(); | 98 | caller->scan(); |
92 | return(0); | 99 | return(0); |
93 | } | 100 | } |
94 | 101 | ||
95 | void* runitm(void* arg) | 102 | void* runitm(void* arg) |
96 | { | 103 | { |
97 | Qsmb* caller = (Qsmb*)arg; | 104 | Qsmb* caller = (Qsmb*)arg; |
98 | caller->DoIt(); | 105 | caller->DoIt(); |
99 | return(0); | 106 | return(0); |
100 | } | 107 | } |
101 | 108 | ||
102 | void Qsmb::scan() | 109 | void Qsmb::scan() |
103 | { | 110 | { |
104 | if (scanning) return; | 111 | clear(); |
112 | // if (scanning) return; | ||
105 | scanning = true; | 113 | scanning = true; |
106 | 114 | ||
107 | QString match; | 115 | QString match; |
108 | QString cmd; | 116 | QString cmd; |
109 | LScan->setText("Scanning..."); | 117 | LScan->setText("Scanning..."); |
110 | qApp->processEvents(); | 118 | qApp->processEvents(); |
111 | 119 | ||
112 | sockaddr_in my_addr; | 120 | sockaddr_in my_addr; |
113 | get_myaddress( &my_addr); | 121 | get_myaddress( &my_addr); |
114 | 122 | ||
115 | QString ip = inet_ntoa( my_addr.sin_addr); | 123 | QString ip = inet_ntoa( my_addr.sin_addr); |
116 | qWarning("IP Address : "+ip); | 124 | qWarning("IP Address : "+ip); |
117 | 125 | ||
118 | match = ip.left(5); | 126 | match = ip.left(5); |
119 | 127 | ||
120 | QStringList ccmd; | 128 | QStringList ccmd; |