Just getting back into the swing of things with the New Connection Window.
I'm going to keep plugging away at this app until such that it needs assistance from the net crew. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7430 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+11
-7
@@ -43,18 +43,19 @@ float FormHeightState2 = 282;
|
|||||||
|
|
||||||
BRect windowRect(FormTopDefault,FormLeftDefault,FormLeftDefault+FormWidthDefault,FormTopDefault+FormHeightDefault);
|
BRect windowRect(FormTopDefault,FormLeftDefault,FormLeftDefault+FormWidthDefault,FormTopDefault+FormHeightDefault);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DUN -- constructor for DUN Class
|
// DUN -- constructor for DUN Class
|
||||||
DUN::DUN() : BApplication (APP_SIGNATURE) {
|
DUN::DUN() : BApplication (APP_SIGNATURE)
|
||||||
dunWindow = new DUNWindow(windowRect);
|
{
|
||||||
|
ptrDUNWindow = new DUNWindow(windowRect);
|
||||||
}
|
}
|
||||||
// ------------------------------------------------------------------------------- //
|
// ------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
||||||
// DUN::MessageReceived -- handles incoming messages
|
// DUN::MessageReceived -- handles incoming messages
|
||||||
void DUN::MessageReceived (BMessage *message) {
|
void DUN::MessageReceived (BMessage *message)
|
||||||
switch(message->what) {
|
{
|
||||||
|
switch(message->what)
|
||||||
|
{
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message); // pass it along ...
|
BApplication::MessageReceived(message); // pass it along ...
|
||||||
break;
|
break;
|
||||||
@@ -63,9 +64,12 @@ void DUN::MessageReceived (BMessage *message) {
|
|||||||
// ------------------------------------------------------------------------------- //
|
// ------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
// DUN Main
|
// DUN Main
|
||||||
int main(void) {
|
int main(void)
|
||||||
|
{
|
||||||
DUN theApp;
|
DUN theApp;
|
||||||
theApp.Run();
|
theApp.Run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// end
|
// end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ public:
|
|||||||
DUN();
|
DUN();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
private:
|
private:
|
||||||
DUNWindow* dunWindow;
|
DUNWindow* ptrDUNWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,16 +2,19 @@
|
|||||||
|
|
||||||
DUNWindow - DialUp Networking BWindow
|
DUNWindow - DialUp Networking BWindow
|
||||||
|
|
||||||
Authors: Sikosis (beos@gravity24hr.com)
|
Authors: Sikosis (phil@sikosis.com)
|
||||||
Misza ([email protected])
|
Misza ([email protected])
|
||||||
|
|
||||||
(C) 2002-2003 OpenBeOS under MIT license
|
(C) 2002-2004 OpenBeOS under MIT license
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/*-----WARNING MESSY CODE AHEAD :-)------*/
|
/*-----WARNING MESSY CODE AHEAD :-)------*/
|
||||||
|
|
||||||
|
#include <String.h>
|
||||||
#include "DUNWindow.h"
|
#include "DUNWindow.h"
|
||||||
#include "NewConnectionWindow.h"
|
#include "NewConnectionWindow.h"
|
||||||
|
|
||||||
|
|
||||||
// Add these to Constants file
|
// Add these to Constants file
|
||||||
const int DUN_WINDOW_STATE_DEFAULT = 0; // default - closed
|
const int DUN_WINDOW_STATE_DEFAULT = 0; // default - closed
|
||||||
const int DUN_WINDOW_STATE_ONE = 1; // 1st only
|
const int DUN_WINDOW_STATE_ONE = 1; // 1st only
|
||||||
@@ -28,7 +31,9 @@ float ModemFormHeightDefault = 324;
|
|||||||
BRect windowRectModem(ModemFormTopDefault,ModemFormLeftDefault,ModemFormLeftDefault+ModemFormWidthDefault,ModemFormTopDefault+ModemFormHeightDefault);
|
BRect windowRectModem(ModemFormTopDefault,ModemFormLeftDefault,ModemFormLeftDefault+ModemFormWidthDefault,ModemFormTopDefault+ModemFormHeightDefault);
|
||||||
|
|
||||||
// DUNWindow -- constructor for DUNWindow Class
|
// DUNWindow -- constructor for DUNWindow Class
|
||||||
DUNWindow::DUNWindow(BRect frame) : BWindow (frame, "OBOS Dial-up Networking", B_TITLED_WINDOW, B_NOT_RESIZABLE |B_NOT_ZOOMABLE, 0) {
|
DUNWindow::DUNWindow(BRect frame) : BWindow (frame, "OBOS Dial-up Networking", B_TITLED_WINDOW,
|
||||||
|
B_NOT_RESIZABLE |B_NOT_ZOOMABLE, 0)
|
||||||
|
{
|
||||||
InitWindow();
|
InitWindow();
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
@@ -356,7 +361,7 @@ void DUNWindow::MessageReceived (BMessage *message)
|
|||||||
errormsg->Go();
|
errormsg->Go();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BTN_DISCONNECT:
|
case BTN_DISCONNECT:
|
||||||
{
|
{
|
||||||
disconnectbutton->SetEnabled(false);
|
disconnectbutton->SetEnabled(false);
|
||||||
@@ -401,22 +406,35 @@ void DUNWindow::MessageReceived (BMessage *message)
|
|||||||
|
|
||||||
case MENU_CON_NEW:
|
case MENU_CON_NEW:
|
||||||
{
|
{
|
||||||
|
// open new connection window
|
||||||
ptrNewConnectionWindow = new NewConnectionWindow(BRect(0,0,260,73));
|
ptrNewConnectionWindow = new NewConnectionWindow(BRect(0,0,260,73));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BTN_MODEM:
|
case BTN_MODEM:
|
||||||
{
|
{
|
||||||
|
// open modem window
|
||||||
modemWindow = new ModemWindow(windowRectModem);
|
modemWindow = new ModemWindow(windowRectModem);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BTN_SETTINGS:
|
case BTN_SETTINGS:
|
||||||
{
|
{
|
||||||
|
// open settings window
|
||||||
settingsWindow = new SettingsWindow(BRect(367.0, 268.0, 657.0, 500.0));
|
settingsWindow = new SettingsWindow(BRect(367.0, 268.0, 657.0, 500.0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ADD_NEW_CONNECTION:
|
||||||
|
{
|
||||||
|
// add and set our new connection
|
||||||
|
BString fConnectionName;
|
||||||
|
message->FindString("ConnectionName", &fConnectionName);
|
||||||
|
printf("ConnectionName = %s\n",fConnectionName.String());
|
||||||
|
// add to dropdown
|
||||||
|
// set as current item with tick
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ const uint32 MENU_LOC_DELETE_CURRENT = 'MLDl';
|
|||||||
const uint32 TEST_BOX_1 = 'Tb1';
|
const uint32 TEST_BOX_1 = 'Tb1';
|
||||||
const uint32 TEST_BOX_2 = 'Tb2';
|
const uint32 TEST_BOX_2 = 'Tb2';
|
||||||
|
|
||||||
|
const uint32 ADD_NEW_CONNECTION = 'adnc';
|
||||||
|
|
||||||
|
//const char *kConnectionName = "ConnectionName";
|
||||||
|
|
||||||
struct last_active { int x;int y;};
|
struct last_active { int x;int y;};
|
||||||
class DUNView;
|
class DUNView;
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
NewConnectionWindow - DialUp Networking
|
NewConnectionWindow - DialUp Networking
|
||||||
|
|
||||||
Author: Sikosis (beos@gravity24hr.com)
|
Author: Sikosis (phil@sikosis.com)
|
||||||
|
|
||||||
(C) 2002 OpenBeOS under MIT license
|
(C)2002-2004 OpenBeOS under MIT license
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ Author: Sikosis ([email protected])
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
|
#include "DUNWindow.h"
|
||||||
#include "NewConnectionWindow.h"
|
#include "NewConnectionWindow.h"
|
||||||
#include "DUNView.h"
|
#include "DUNView.h"
|
||||||
|
|
||||||
@@ -101,20 +102,21 @@ void NewConnectionWindow::MessageReceived (BMessage *message)
|
|||||||
switch(message->what)
|
switch(message->what)
|
||||||
{
|
{
|
||||||
case BTN_ADD:
|
case BTN_ADD:
|
||||||
char tmp[256];
|
{
|
||||||
sprintf(tmp,"%s",txtNewConnection->Text());
|
// Send Messages to DUNWindow to Add New Connectionupdate
|
||||||
(new BAlert("",tmp,"tmp"))->Go();
|
BWindow *ptrDUNWindow;
|
||||||
|
ptrDUNWindow = be_app->WindowAt(0); // its the first window
|
||||||
// need to create a new file called txtNewConnection->Text() and
|
BMessage msg(ADD_NEW_CONNECTION);
|
||||||
// place it in the /boot/home/config/settings/DUN/DUNCONNECT directory
|
msg.AddString("ConnectionName", txtNewConnection->Text());
|
||||||
|
BMessenger(ptrDUNWindow).SendMessage(&msg);
|
||||||
|
|
||||||
// before closing we need to change the main window to state 1
|
// before closing we need to change the main window to state 1
|
||||||
|
|
||||||
Quit();
|
Quit();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case BTN_CANCEL:
|
case BTN_CANCEL:
|
||||||
Quit();
|
Quit();
|
||||||
//Hide(); // change later
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user