Exemplo n.º 1
0
ThemeManager::ThemeManager()
	: fAddonCount(0)
{
	FENTRY;
	fSettings.MakeEmpty();
	fBackupTheme.MakeEmpty();
	fBackupTheme.what = 'null';//Z_THEME_MESSAGE_WHAT;
	fSelectedTheme = -1;
	fAddonList.MakeEmpty();
	fNames.MakeEmpty();
	LoadAddons();
	AddNames(fNames);
	LoadSettings();

	// XXX: add more
	fThemeImporters.AddItem(new BeThemeImporter());
	fThemeImporters.AddItem(new MSThemeImporter());
	
	// XXX test
/*
	BMessage test('plop');
	BMessage *to;
	test.AddString("plop-plip", "this is a test...\"line cont'd.");
	test.PrintToStream();
	BFile tfile("/tmp/testmsg", B_READ_WRITE|B_CREATE_FILE);
	DumpMessageToStream(&test, tfile, 0, NULL);
	tfile.Seek(0LL, SEEK_SET);
	ParseMessageFromStream(&to, tfile);
	if (to)
		to->PrintToStream();
	else
		PRINT(("no to\n"));
*/
}
Exemplo n.º 2
0
/*------------------------------------------------------------------------------*\
	BmFilterList()
		-	default constructor, creates empty list
\*------------------------------------------------------------------------------*/
BmFilterList::BmFilterList( const char* name)
	:	inherited( name, BM_LogFilter)
{
	LoadAddons();
}
Exemplo n.º 3
0
DialUpView::DialUpView(BRect frame)
	: BView(frame, "DialUpView", B_FOLLOW_ALL, 0),
	fListener(this),
	fUpDownThread(-1),
	fDriverSettings(NULL),
	fCurrentItem(NULL),
	fWatching(PPP_UNDEFINED_INTERFACE_ID),
	fKeepLabel(false)
{
	BRect bounds = Bounds();
		// for caching
	SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
	
	// add messenger to us so add-ons can contact us
	BMessenger messenger(this);
	fAddons.AddMessenger(DUN_MESSENGER, messenger);
	
	// create pop-up with all interfaces and "New..."/"Delete current" items
	fInterfaceMenu = new BPopUpMenu(kLabelCreateNew);
	BRect rect = bounds;
	rect.InsetBy(5, 5);
	rect.bottom = rect.top + 20;
	fMenuField = new BMenuField(rect, "Interfaces", kLabelInterface, fInterfaceMenu);
	fMenuField->SetDivider(StringWidth(fMenuField->Label()) + 5);
	
	rect.top = rect.bottom + 10;
	rect.bottom = bounds.bottom
		- 20 // height of bottom controls
		- 20; // space for bottom controls
	fTabView = new BTabView(rect, "TabView", B_WIDTH_FROM_LABEL);
	BRect tabViewRect(fTabView->Bounds());
	tabViewRect.bottom -= fTabView->TabHeight();
	fAddons.AddRect(DUN_TAB_VIEW_RECT, tabViewRect);
	
	BRect tmpRect(rect);
	tmpRect.top += (tmpRect.Height() - 15) / 2;
	tmpRect.bottom = tmpRect.top + 15;
	fStringView = new BStringView(tmpRect, "NoInterfacesFound",
		kTextNoInterfacesFound);
	fStringView->SetAlignment(B_ALIGN_CENTER);
	fStringView->Hide();
	tmpRect.top = tmpRect.bottom + 10;
	tmpRect.bottom = tmpRect.top + 25;
	fCreateNewButton = new BButton(tmpRect, "CreateNewButton",
		kLabelCreateNewInterface, new BMessage(kMsgCreateNew));
	fCreateNewButton->ResizeToPreferred();
	tmpRect.left = (rect.Width() - fCreateNewButton->Bounds().Width()) / 2 + rect.left;
	fCreateNewButton->MoveTo(tmpRect.left, tmpRect.top);
	fCreateNewButton->Hide();
	
	rect.top = rect.bottom + 15;
	rect.bottom = rect.top + 15;
	rect.right = rect.left + 200;
	fStatusView = new BStringView(rect, "StatusView", kTextNotConnected, B_FOLLOW_BOTTOM);
	
	rect.InsetBy(0, -5);
	rect.left = rect.right + 5;
	rect.right = bounds.right - 5;
	fConnectButton = new BButton(rect, "ConnectButton", kLabelConnect,
		new BMessage(kMsgConnectButton), B_FOLLOW_BOTTOM);
	
	AddChild(fMenuField);
	AddChild(fTabView);
	AddChild(fStringView);
	AddChild(fCreateNewButton);
	AddChild(fStatusView);
	AddChild(fConnectButton);
	
	// initialize
	LoadInterfaces();
	LoadAddons();
	CreateTabs();
	fCurrentItem = NULL;
		// reset, otherwise SelectInterface will not load the settings
	SelectInterface(0);
	UpdateControls();
}