Esempio n. 1
0
void ShowAboutWindow(void)
{
	char str[512];
	sprintf(str,
		"Basilisk II\nVersion %d.%d\n\n"
		"Copyright " B_UTF8_COPYRIGHT " 1997-2008 Christian Bauer et al.\n"
		"E-mail: [email protected]\n"
		"http://www.uni-mainz.de/~bauec002/B2Main.html\n\n"
		"Basilisk II comes with ABSOLUTELY NO\n"
		"WARRANTY. This is free software, and\n"
		"you are welcome to redistribute it\n"
		"under the terms of the GNU General\n"
		"Public License.\n",
		VERSION_MAJOR, VERSION_MINOR
	);
	BAlert *about = new BAlert("", str, GetString(STR_OK_BUTTON), NULL, NULL, B_WIDTH_FROM_LABEL);
	BTextView *theText = about->TextView();
	if (theText) {
		theText->SetStylable(true);
		theText->Select(0, 11);
		BFont ourFont;
		theText->SetFontAndColor(be_bold_font);
		theText->GetFontAndColor(2, &ourFont, NULL);
		ourFont.SetSize(24);
		theText->SetFontAndColor(&ourFont);
	}
	about->Go();
}
Esempio n. 2
0
void
WorkspacesView::_AboutRequested()
{
	BString text = B_TRANSLATE("Workspaces\n"
		"written by %1, and %2.\n\n"
		"Copyright %3, Haiku.\n\n"
		"Send windows behind using the Option key. "
		"Move windows to front using the Control key.\n");
	text.ReplaceFirst("%1", "François Revol, Axel Dörfler");
	text.ReplaceFirst("%2", "Matt Madia");
	text.ReplaceFirst("%3", "2002-2008");
		
	BAlert *alert = new BAlert("about", text.String(), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 10, &font);

	alert->Go();
}
Esempio n. 3
0
void
HWindow::AboutRequested()
{
	const char* aboutText = AboutText();
	if (aboutText == NULL)
		return;

	BAlert *about = new BAlert("About", aboutText, "Cool");
	BTextView *v = about->TextView();
	if (v) {
		rgb_color red = {255, 0, 51, 255};
		rgb_color blue = {0, 102, 255, 255};

		v->SetStylable(true);
		char *text = (char*)v->Text();
		char *s = text;
		// set all Be in blue and red
		while ((s = strstr(s, "Be")) != NULL) {
			int32 i = s - text;
			v->SetFontAndColor(i, i+1, NULL, 0, &blue);
			v->SetFontAndColor(i+1, i+2, NULL, 0, &red);
			s += 2;
		}
		// first text line 
		s = strchr(text, '\n');
		BFont font;
		v->GetFontAndColor(0, &font);
		font.SetSize(12); // font.SetFace(B_OUTLINED_FACE);
		v->SetFontAndColor(0, s-text+1, &font, B_FONT_SIZE);
	};
	about->SetFlags(about->Flags() | B_CLOSE_ON_ESCAPE);
	about->Go();
}
Esempio n. 4
0
void
PulseApp::ShowAbout(bool asApplication)
{
	// static version to be used in replicant mode
	BString name;
	if (asApplication)
		name = B_TRANSLATE_SYSTEM_NAME("Pulse");
	else
		name = B_TRANSLATE("Pulse");

	BString message = B_TRANSLATE(
		"%s\n\nBy David Ramsey and Arve Hjønnevåg\n"
		"Revised by Daniel Switkin\n");
	message.ReplaceFirst("%s", name);
	BAlert *alert = new BAlert(B_TRANSLATE("Info"),
		message.String(), B_TRANSLATE("OK"));

	BTextView* view = alert->TextView();
	BFont font;
				
	view->SetStylable(true);			
	view->GetFont(&font);
	
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, name.Length(), &font);
	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
	// Use the asynchronous version so we don't block the window's thread
	alert->Go(NULL);
}
Esempio n. 5
0
void
SyslogDaemon::AboutRequested()
{
	BPath path;
	find_directory(B_SYSTEM_LOG_DIRECTORY, &path);
	path.Append("syslog");

	BString name(B_TRANSLATE("Syslog Daemon"));
	BString message;
	snprintf(message.LockBuffer(512), 512,
		B_TRANSLATE("%s\n\nThis daemon is responsible for collecting "
			"all system messages and write them to the system-wide log "
			"at \"%s\".\n\n"), name.String(), path.Path());
	message.UnlockBuffer();

	BAlert *alert = new BAlert(name.String(), message.String(), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(21);
	font.SetFace(B_BOLD_FACE); 			
	view->SetFontAndColor(0, name.Length(), &font);

	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
	alert->Go(NULL);
}
Esempio n. 6
0
void
Leaves::StartConfig(BView* view)
{
	BRect bounds = view->Bounds();
	bounds.InsetBy(10, 10);
	BRect frame(0, 0, bounds.Width(), 20);

	fDropRateSlider = new BSlider(frame, "drop rate",
		B_TRANSLATE("Drop rate:"), new BMessage(MSG_SET_DROP_RATE),
		kMinimumDropRate, kMaximumDropRate,	B_BLOCK_THUMB,
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM);
	fDropRateSlider->SetValue(fDropRate);
	fDropRateSlider->ResizeToPreferred();
	bounds.bottom -= fDropRateSlider->Bounds().Height() * 1.5;
	fDropRateSlider->MoveTo(bounds.LeftBottom());
	view->AddChild(fDropRateSlider);

	fLeafSizeSlider = new BSlider(frame, "leaf size",
		B_TRANSLATE("Leaf size:"), new BMessage(MSG_SET_LEAF_SIZE),
		kMinimumLeafSize, kMaximumLeafSize,	B_BLOCK_THUMB,
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM);
	fLeafSizeSlider->SetValue(fLeafSize);
	fLeafSizeSlider->ResizeToPreferred();
	bounds.bottom -= fLeafSizeSlider->Bounds().Height() * 1.5;
	fLeafSizeSlider->MoveTo(bounds.LeftBottom());
	view->AddChild(fLeafSizeSlider);

	fSizeVariationSlider = new BSlider(frame, "variation",
		B_TRANSLATE("Size variation:"),	new BMessage(MSG_SET_SIZE_VARIATION),
		0, kMaximumSizeVariation, B_BLOCK_THUMB,
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM);
	fSizeVariationSlider->SetValue(fSizeVariation);
	fSizeVariationSlider->ResizeToPreferred();
	bounds.bottom -= fSizeVariationSlider->Bounds().Height() * 1.5;
	fSizeVariationSlider->MoveTo(bounds.LeftBottom());
	view->AddChild(fSizeVariationSlider);

	BTextView* textView = new BTextView(bounds, B_EMPTY_STRING,
		bounds.OffsetToCopy(0., 0.), B_FOLLOW_ALL, B_WILL_DRAW);
	textView->SetViewColor(view->ViewColor());
	BString name = B_TRANSLATE("Leaves");
	BString text = name;
	text << "\n\n";
	text << B_TRANSLATE("by Deyan Genovski, Geoffry Song");
	text << "\n\n";

	textView->Insert(text.String());
	textView->SetStylable(true);
	textView->SetFontAndColor(0, name.Length(), be_bold_font);
	textView->MakeEditable(false);
	view->AddChild(textView);

	BWindow* window = view->Window();
	if (window) window->AddHandler(this);

	fDropRateSlider->SetTarget(this);
	fLeafSizeSlider->SetTarget(this);
	fSizeVariationSlider->SetTarget(this);
}
Esempio n. 7
0
void
DataTranslationsWindow::_ShowInfoAlert(int32 id)
{
	const char* name = NULL;
	const char* info = NULL;
	BPath path;
	int32 version = 0;
	_GetTranslatorInfo(id, name, info, version, path);

	const char* labels[] = { B_TRANSLATE("Name:"), B_TRANSLATE("Version:"),
		B_TRANSLATE("Info:"), B_TRANSLATE("Path:"), NULL };
	int offsets[4];

	BString message;
	BString temp;

	offsets[0] = 0;
	temp.SetToFormat("%s %s\n", labels[0], name);

	message.Append(temp);

	offsets[1] = message.Length();
	// Convert the version number into a readable format
	temp.SetToFormat("%s %" B_PRId32 ".%" B_PRId32 ".%" B_PRId32 "\n\n", labels[1],
		B_TRANSLATION_MAJOR_VERSION(version),
		B_TRANSLATION_MINOR_VERSION(version),
		B_TRANSLATION_REVISION_VERSION(version));

	message.Append(temp);

	offsets[2] = message.Length();
	temp.SetToFormat("%s\n%s\n\n", labels[2], info);

	message.Append(temp);

	offsets[3] = message.Length();
	temp.SetToFormat("%s %s\n", labels[3], path.Path());

	message.Append(temp);

	BAlert* alert = new BAlert(B_TRANSLATE("Info"), message.String(),
		B_TRANSLATE("OK"));
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetFace(B_BOLD_FACE);

	for (int32 i = 0; labels[i]; i++) {
		view->SetFontAndColor(offsets[i], offsets[i] + strlen(labels[i]), &font);
	}

	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
	alert->Go();
}
Esempio n. 8
0
void
AboutWindow::Show()
{
    BAlert* alert = new BAlert("About" B_UTF8_ELLIPSIS, fText->String(), "Close");
    BTextView* view = alert->TextView();
    BFont font;
    view->SetStylable(true);
    view->GetFont(&font);
    font.SetFace(B_BOLD_FACE);
    font.SetSize(font.Size() * 1.7f);
    view->SetFontAndColor(0, fAppName->Length(), &font);
    alert->Go();
}
Esempio n. 9
0
BTextView*
WizardPageView::CreateDescription(BRect frame, const char* name,
	const char* description)
{
	BTextView* view = new BTextView(frame, "text", 
		frame.OffsetToCopy(0, 0),
		B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
		B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS);
	view->MakeEditable(false);
	view->SetViewColor(ViewColor());
	view->SetStylable(true);
	view->SetText(description);
	return view;
}
void
TeamDescriptionView::SetItem(TeamListItem* item)
{
	fItem = item;
	int32 styleStart = 0;
	int32 styleEnd = 0;
	BTextView* view = NULL;

	if (item == NULL) {
		BString text;
		text.SetToFormat(fInfoString, fSeconds);
		fInfoTextView->SetText(text);
		if (fRebootRunner != NULL && fSeconds < 4) {
			styleStart = text.FindLast('\n');
			styleEnd = text.Length();
		}
		view = fInfoTextView;
	} else {
		BString text = item->Path()->Path();
		if (item->IsSystemServer())
			text << "\n" << fSysComponentString;
		if (item->IsRefusingToQuit()) {
			text << "\n\n" << fQuitOverdueString;
			styleStart = text.FindLast('\n');
			styleEnd = text.Length();
		}
		view = fIconTextView;
		fIconTextView->SetText(text);
		fIconView->SetIcon(item->Path()->Path());
	}

	if (styleStart != styleEnd && view != NULL) {
		BFont font;
		view->GetFont(&font);
		font.SetFace(B_BOLD_FACE);
		view->SetStylable(true);
		view->SetFontAndColor(styleStart, styleEnd, &font);
	}

	if (fLayout == NULL)
		return;

	if (item == NULL)
		fLayout->SetVisibleItem((int32)0);
	else
		fLayout->SetVisibleItem((int32)1);

	Invalidate();
}
Esempio n. 11
0
void
NetServer::AboutRequested()
{
	BAlert *alert = new BAlert("about", "Networking Server\n"
		"\tCopyright " B_UTF8_COPYRIGHT "2006, Antares.\n", "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 17, &font);

	alert->Go(NULL);
}
Esempio n. 12
0
void
FontsApp::AboutRequested()
{
	BAlert *alert = new BAlert("about", B_TRANSLATE("Fonts\n"
		"\tCopyright 2004-2005, Haiku.\n\n"), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 5, &font);

	alert->Go();
}
Esempio n. 13
0
void BepdfApplication::AboutRequested()
{
	BString version;
	BString str("BePDF\n");
	str += B_TRANSLATE("Version");
	str += " ";
	str += GetVersion(version);
	str += "\n";

	str += bePDFCopyright;

	str += "\n";
	str += B_TRANSLATE_COMMENT("Language 'English', translated by the BePDF authors.",
		"Replace 'English' with the language you're translating to, and 'the BePDF authors' with your name or your translation group's name.");
	str += "\n\n";

	str += BString().SetToFormat(B_TRANSLATE_COMMENT("BePDF is based on XPDF %s, %s.", "XPDF version, copyright"),
		xpdfVersion, xpdfCopyright);

	str += GPLCopyright;

	BAlert *about = new BAlert("About", str.String(), "OK");
	BTextView *v = about->TextView();
	if (v) {
		rgb_color red = {255, 0, 51, 255};
		rgb_color blue = {0, 102, 255, 255};

		v->SetStylable(true);
		char *text = (char*)v->Text();
		char *s = text;
		// set all Be in BePDF in blue and red
		while ((s = strstr(s, "BePDF")) != NULL) {
			int32 i = s - text;
			v->SetFontAndColor(i, i+1, NULL, 0, &blue);
			v->SetFontAndColor(i+1, i+2, NULL, 0, &red);
			s += 2;
		}
		// first text line
		s = strchr(text, '\n');
		BFont font;
		v->GetFontAndColor(0, &font);
		font.SetSize(16);
		v->SetFontAndColor(0, s-text+1, &font, B_FONT_SIZE);
	};
	about->Go();
}
Esempio n. 14
0
void
InstallerApp::AboutRequested()
{
	BAlert *alert = new BAlert("about", B_TRANSLATE("Installer\n"
		"\twritten by Jérôme Duval and Stephan Aßmus\n"
		"\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 9, &font);

	alert->Go();
}
Esempio n. 15
0
void
CharacterMap::AboutRequested()
{
	BAlert *alert = new BAlert("about", "CharacterMap\n"
		"\twritten by Axel Dörfler\n"
		"\tCopyright 2009, Antares, Inc.\n", "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 12, &font);

	alert->Go();
}
Esempio n. 16
0
void
DataTranslationsApplication::AboutRequested()
{
	BAlert* alert = new BAlert("about", "DataTranslations\n\twritten by Oliver "
		"Siebenmarck and others\n\tCopyright 2002-2010, Haiku Inc. All rights "
		"reserved.\n", "OK");

	BTextView* view = alert->TextView();
	view->SetStylable(true);

	BFont font;
	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 16, &font);

	alert->Go();
}
Esempio n. 17
0
void
VirtualMemory::AboutRequested()
{
	BAlert* alert = new BAlert("about", TR("VirtualMemory\n"
		"\twritten by Axel Dörfler\n"
		"\tCopyright 2005, Antares.\n"), TR("OK"));
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE); 			
	view->SetFontAndColor(0, 13, &font);

	alert->Go();
}
Esempio n. 18
0
File: hdb.cpp Progetto: mariuz/haiku
/*static*/ void
Debugger::ShowAbout()
{
    BAlert *alert = new BAlert("about", "Debugger\n"
        "\twritten by Philippe Houdoin\n"
        "\tCopyright 2009, Haiku, Inc.\n", "OK");
    BTextView *view = alert->TextView();
    BFont font;

    view->SetStylable(true);

    view->GetFont(&font);
    font.SetSize(18);
    font.SetFace(B_BOLD_FACE);
    view->SetFontAndColor(0, 15, &font);

    alert->Go();
}
Esempio n. 19
0
void
StatusView::_AboutRequested()
{
	BAlert *alert = new BAlert("about", B_TRANSLATE("CPUFrequency\n"
			"\twritten by Clemens Zeidler\n"
			"\tCopyright 2009, Haiku, Inc.\n"),
		B_TRANSLATE("Ok"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 13, &font);

	alert->Go();
}
Esempio n. 20
0
void
PowerStatusReplicant::_AboutRequested()
{
	BAlert* alert = new BAlert(B_TRANSLATE("About"),
		B_TRANSLATE("PowerStatus\n"
			"written by Axel Dörfler, Clemens Zeidler\n"
			"Copyright 2006, Haiku, Inc.\n"), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font);

	alert->Go();
}
Esempio n. 21
0
void
WorkspacesView::_AboutRequested()
{
	BAlert *alert = new BAlert("about", "Workspaces\n"
		"written by François Revol, Axel Dörfler, and Matt Madia.\n\n"
		"Copyright 2002-2008, Antares.\n\n"
		"Send windows behind using the Option key. "
		"Move windows to front using the Control key.\n", "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 10, &font);

	alert->Go();
}
Esempio n. 22
0
void
OverlayView::OverlayAboutRequested()
{
	BAlert *alert = new BAlert("about",
		"OverlayImage\n"
		"Copyright 1999-2010\n\n\t"
		"originally by Seth Flaxman\n\t"
		"modified by Hartmuth Reh\n\t"
		"further modified by Humdinger\n",
		"OK");	
	BTextView *view = alert->TextView();
	BFont font;
	view->SetStylable(true);
	view->GetFont(&font);
	font.SetSize(font.Size() + 7.0f);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 12, &font);
	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);	
	alert->Go();
}
Esempio n. 23
0
void
FileTypes::AboutRequested()
{
	BString aboutText(B_TRANSLATE("FileTypes"));
	int32 titleLength = aboutText.Length();
	aboutText << "\n";
	aboutText << B_TRANSLATE("\twritten by Axel Dörfler\n"
		"\tCopyright 2006-2007, Haiku.\n");
	BAlert *alert = new BAlert("about", aboutText.String(), B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, titleLength, &font);

	alert->Go();
}
Esempio n. 24
0
void
DevicesApplication::ShowAbout()
{
	BAlert* alert = new BAlert("about", "Devices\n"
		"\twritten by Pieter Panman\n"
		"\n"
		"\tBased on listdev by Jérôme Duval\n"
		"\tand the previous Devices preference\n"
		"\tby Jérôme Duval and Sikosis\n"
		"\tCopyright 2009, Haiku, Inc.\n", "OK");
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 7, &font);

	alert->Go();
}
Esempio n. 25
0
void
DataTranslationsWindow::_ShowInfoAlert(int32 id)
{
	const char* name = NULL;
	const char* info = NULL;
	BPath path;
	int32 version = 0;
	_GetTranslatorInfo(id, name, info, version, path);

	BString message;
	// Convert the version number into a readable format
	snprintf(message.LockBuffer(2048), 2048,
		B_TRANSLATE("Name: %s \nVersion: %ld.%ld.%ld\n\n"
			"Info:\n%s\n\nPath:\n%s\n"),
		name, B_TRANSLATION_MAJOR_VERSION(version),
		B_TRANSLATION_MINOR_VERSION(version),
		B_TRANSLATION_REVISION_VERSION(version), info, path.Path());
	message.UnlockBuffer();

	BAlert* alert = new BAlert(B_TRANSLATE("Info"), message.String(),
		B_TRANSLATE("OK"));
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetFace(B_BOLD_FACE);

	const char* labels[] = { B_TRANSLATE("Name:"), B_TRANSLATE("Version:"),
		B_TRANSLATE("Info:"), B_TRANSLATE("Path:"), NULL };
	for (int32 i = 0; labels[i]; i++) {
		int32 index = message.FindFirst(labels[i]);
		view->SetFontAndColor(index, index + strlen(labels[i]), &font);
	}

	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
	alert->Go();
}
Esempio n. 26
0
void
ExpanderApp::AboutRequested()
{
	BString appName = B_TRANSLATE("Expander");
	int nameLength = appName.CountChars();
	BAlert* alert = new BAlert("about",
		appName.Append(B_TRANSLATE("\n\twritten by Jérôme Duval\n"
			"\tCopyright 2004-2006, Haiku Inc.\n\noriginal Be version by \n"
			"Dominic, Hiroshi, Peter, Pavel and Robert\n")),
		B_TRANSLATE("OK"));
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, nameLength, &font);

	alert->Go();
}
void
NetworkStatusView::_AboutRequested()
{
	BString about = B_TRANSLATE(
		"NetworkStatus\n\twritten by %1 and Hugo Santos\n\t%2, Haiku, Inc.\n"
		);
	about.ReplaceFirst("%1", "Axel Dörfler");
		// Append a new developer here
	about.ReplaceFirst("%2", "Copyright 2007-2010");
		// Append a new year here
	BAlert* alert = new BAlert("about", about, B_TRANSLATE("OK"));
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetSize(18);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 13, &font);

	alert->Go();
}
Esempio n. 28
0
void
App::AboutRequested()
{
	BAlert* alert = new BAlert("about",
		B_TRANSLATE("QuickLaunch v1.0\n"
		"\twritten by Humdinger\n"
		"\tCopyright 2010-2015\n\n"
		"QuickLaunch quickly starts any installed application. "
		"Just enter the first few letters of its name and choose "
		"from a list of all found programs.\n\n"
		"Please let me know of any bugs you find or features you "
		"miss. Contact info is in the ReadMe, see menu item 'Help'."),
		B_TRANSLATE("Thank you"));

	BTextView* view = alert->TextView();
	BFont font;
	view->SetStylable(true);
	view->GetFont(&font);
	font.SetSize(font.Size() + 4);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, 11, &font);
	alert->Go();
}
Esempio n. 29
0
void
DataTranslationsWindow::_ShowInfoAlert(int32 id)
{
	const char* name = NULL;
	const char* info = NULL;
	BPath path;
	int32 version = 0;
	_GetTranslatorInfo(id, name, info, version, path);

	BString message;
	message << "Name: " << name << "\nVersion: ";

	// Convert the version number into a readable format
	message << (int)B_TRANSLATION_MAJOR_VERSION(version)
		<< '.' << (int)B_TRANSLATION_MINOR_VERSION(version)
		<< '.' << (int)B_TRANSLATION_REVISION_VERSION(version);
	message << "\nInfo: " << info <<
		"\n\nPath:\n" << path.Path() << "\n";

	BAlert *alert = new BAlert("info", message.String(), "OK");
	BTextView *view = alert->TextView();
	BFont font;

	view->SetStylable(true);

	view->GetFont(&font);
	font.SetFace(B_BOLD_FACE);

	const char* labels[] = {"Name:", "Version:", "Info:", "Path:", NULL};
	for (int32 i = 0; labels[i]; i++) {
		int32 index = message.FindFirst(labels[i]);
		view->SetFontAndColor(index, index + strlen(labels[i]), &font);
	}

	alert->Go();
}
Esempio n. 30
0
void
NetworkStatusView::_ShowConfiguration(BMessage* message)
{
	const char* name;
	if (message->FindString("interface", &name) != B_OK)
		return;

	BNetworkInterface networkInterface(name);
	if (!networkInterface.Exists())
		return;

	BNetworkInterfaceAddress address;
	networkInterface.GetAddressAt(0, address);
		// TODO: We should get all addresses,
		// not just the first one.
	BString text(B_TRANSLATE("%ifaceName information:\n"));
	text.ReplaceFirst("%ifaceName", name);

	size_t boldLength = text.Length();

	text << "\n" << B_TRANSLATE("Address") << ": " << address.Address().ToString();
	text << "\n" << B_TRANSLATE("Broadcast") << ": " << address.Broadcast().ToString();
	text << "\n" << B_TRANSLATE("Netmask") << ": " << address.Mask().ToString();

	BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK"));
	alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
	BTextView* view = alert->TextView();
	BFont font;

	view->SetStylable(true);
	view->GetFont(&font);
	font.SetFace(B_BOLD_FACE);
	view->SetFontAndColor(0, boldLength, &font);

	alert->Go(NULL);
}