Removed the 'Beginner' mode settings from the program options and the places that relied on them

Fixed a crash when pasting text into the signature textview after making a new one
Added a few more accelerators some alerts


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19530 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2006-12-16 04:37:23 +00:00
parent e4c4753160
commit ac2c6cebcd
4 changed files with 38 additions and 56 deletions
+26 -17
View File
@@ -144,7 +144,7 @@ bool gColoredQuotes = true;
static uint8 sShowButtonBar = true;
char *gReplyPreamble;
char *signature;
int32 level = L_BEGINNER;
// int32 level = L_BEGINNER;
entry_ref open_dir;
BMessage *print_settings = NULL;
BPoint prefs_window;
@@ -425,7 +425,7 @@ TMailApp::MessageReceived(BMessage *msg)
fPrefsWindow = new TPrefsWindow(BRect(prefs_window.x,
prefs_window.y, prefs_window.x + PREF_WIDTH,
prefs_window.y + PREF_HEIGHT),
&fFont, &level, &sWrapMode, &attachAttributes_mode,
&fFont, NULL, &sWrapMode, &attachAttributes_mode,
&gColoredQuotes, &gDefaultChain, &gUseAccountFrom,
&gReplyPreamble, &signature, &gMailCharacterSet,
&gWarnAboutUnencodableCharacters,
@@ -464,11 +464,11 @@ TMailApp::MessageReceived(BMessage *msg)
FontChange();
break;
case M_BEGINNER:
/* case M_BEGINNER:
case M_EXPERT:
level = msg->what - M_BEGINNER;
break;
*/
case REFS_RECEIVED:
if (msg->HasPointer("window"))
{
@@ -830,7 +830,7 @@ TMailApp::LoadOldSettings()
return status;
file.Read(&mail_window, sizeof(BRect));
file.Read(&level, sizeof(level));
// file.Read(&level, sizeof(level));
font_family fontFamily;
font_style fontStyle;
@@ -930,7 +930,7 @@ TMailApp::SaveSettings()
BMessage settings('BeMl');
settings.AddRect("MailWindowSize", mail_window);
settings.AddInt32("ExperienceLevel", level);
// settings.AddInt32("ExperienceLevel", level);
font_family fontFamily;
font_style fontStyle;
@@ -1001,8 +1001,8 @@ TMailApp::LoadSettings()
mail_window = rect;
int32 int32Value;
if (settings.FindInt32("ExperienceLevel", &int32Value) == B_OK)
level = int32Value;
// if (settings.FindInt32("ExperienceLevel", &int32Value) == B_OK)
// level = int32Value;
const char *fontFamily;
if (settings.FindString("FontFamily", &fontFamily) == B_OK) {
@@ -2102,7 +2102,10 @@ TMailWindow::MessageReceived(BMessage *msg)
case M_DELETE_PREV:
case M_DELETE_NEXT:
{
if (level == L_BEGINNER)
// The Trash already provides a level of Undo to prevent loss of data. This
// alert is a lot like the infamous "Are you sure?" confirmation dialogs
// from Windows 98
/* if (level == L_BEGINNER)
{
beep();
if (!(new BAlert("", MDR_DIALECT_CHOICE (
@@ -2114,7 +2117,7 @@ TMailWindow::MessageReceived(BMessage *msg)
B_WARNING_ALERT))->Go())
break;
}
*/
if (msg->what == M_DELETE_NEXT && (modifiers() & B_SHIFT_KEY))
msg->what = M_DELETE_PREV;
@@ -2308,7 +2311,7 @@ TMailWindow::MessageReceived(BMessage *msg)
(new BAlert("", MDR_DIALECT_CHOICE (
"Sorry, could not find an application that supports the 'Person' data type.",
"Peopleデータ形式をサポートするアプリケーションが見つかりませんでした。"),
MDR_DIALECT_CHOICE ("Ok","了解")))->Go();
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
}
free(arg);
}
@@ -2540,7 +2543,7 @@ TMailWindow::MessageReceived(BMessage *msg)
MDR_DIALECT_CHOICE (
"The spell check feature requires the optional \"words\" file on your BeOS CD.",
"スペルチェク機能はBeOS CDの optional \"words\" ファイルが必要です"),
MDR_DIALECT_CHOICE ("Ok","了解"),
MDR_DIALECT_CHOICE ("OK","了解"),
NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_STOP_ALERT))->Go();
}
@@ -2607,7 +2610,7 @@ TMailWindow::QuitRequested()
|| (fEnclosuresView != NULL && fEnclosuresView->fList->CountItems())))
{
if (fResending) {
result = (new BAlert("",
BAlert *alert = new BAlert("",
MDR_DIALECT_CHOICE (
"Do you wish to send this message before closing?",
"閉じる前に送信しますか?"),
@@ -2615,7 +2618,10 @@ TMailWindow::QuitRequested()
MDR_DIALECT_CHOICE ("Cancel","中止"),
MDR_DIALECT_CHOICE ("Send","送信"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT))->Go();
B_WARNING_ALERT);
alert->SetShortcut(0,'d');
alert->SetShortcut(1,B_ESCAPE);
result = alert->Go();
switch (result) {
case 0: // Discard
@@ -2627,7 +2633,7 @@ TMailWindow::QuitRequested()
break;
}
} else {
result = (new BAlert("",
BAlert *alert = new BAlert("",
MDR_DIALECT_CHOICE (
"Do you wish to save this message as a draft before closing?",
"閉じる前に保存しますか?"),
@@ -2635,7 +2641,10 @@ TMailWindow::QuitRequested()
MDR_DIALECT_CHOICE ("Cancel","中止"),
MDR_DIALECT_CHOICE ("Save","保存"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT))->Go();
B_WARNING_ALERT);
alert->SetShortcut(0,'d');
alert->SetShortcut(1,B_ESCAPE);
result = alert->Go();
switch (result) {
case 0: // Don't Save
break;
@@ -3159,7 +3168,7 @@ TMailWindow::Send(bool now)
beep();
(new BAlert("",
MDR_DIALECT_CHOICE ("E-mail draft could not be saved!","ドラフトは保存できませんでした。"),
MDR_DIALECT_CHOICE ("Ok","了解")))->Go();
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
}
return status;
}
+2 -24
View File
@@ -119,7 +119,6 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont *font, int32 *level, bool *wrap,
BMenuField *menu;
fNewFont = font; fFont = *fNewFont;
fNewLevel = level; fLevel = *fNewLevel;
fNewWrap = wrap; fWrap = *fNewWrap;
fNewAttachAttributes = attachAttributes; fAttachAttributes = *fNewAttachAttributes;
fNewColoredQuotes = cquotes; fColoredQuotes = *fNewColoredQuotes;
@@ -149,7 +148,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont *font, int32 *level, bool *wrap,
// group boxes
r.Set(8,4,Bounds().right - 8,4 + 7 * (height + ITEM_SPACE));
r.Set(8,4,Bounds().right - 8,4 + 6 * (height + ITEM_SPACE));
BBox *interfaceBox = new BBox(r,NULL,B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
interfaceBox->SetLabel(MDR_DIALECT_CHOICE ("User Interface","ユーザーインターフェース"));
view->AddChild(interfaceBox);
@@ -220,14 +219,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont *font, int32 *level, bool *wrap,
menu->SetAlignment(B_ALIGN_RIGHT);
interfaceBox->AddChild(menu);
r.OffsetBy(0,height + ITEM_SPACE);
fLevelMenu = BuildLevelMenu(*level);
menu = new BMenuField(r, "level", LEVEL_TEXT, fLevelMenu,B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT);
interfaceBox->AddChild(menu);
// Mail Accounts
r = mailBox->Bounds();
@@ -381,7 +373,6 @@ TPrefsWindow::MessageReceived(BMessage *msg)
message.what = M_FONT;
be_app->PostMessage(&message);
}
*fNewLevel = fLevel;
*fNewWrap = fWrap;
*fNewAttachAttributes = fAttachAttributes;
@@ -401,15 +392,6 @@ TPrefsWindow::MessageReceived(BMessage *msg)
if (revert)
{
if (fLevel == L_EXPERT)
strcpy(label, "Expert");
else
strcpy(label, "Beginner");
item = fLevelMenu->FindItem(label);
if (item)
item->SetMarked(true);
for (int i = fAccountMenu->CountItems();i-- > 0;)
{
if (BMenuItem *item = fAccountMenu->ItemAt(i))
@@ -495,9 +477,6 @@ TPrefsWindow::MessageReceived(BMessage *msg)
}
break;
case P_LEVEL:
msg->FindInt32("level", fNewLevel);
break;
case P_WRAP:
msg->FindBool("wrap", fNewWrap);
break;
@@ -561,7 +540,6 @@ TPrefsWindow::MessageReceived(BMessage *msg)
old_size = (int32) fFont.Size();
new_size = (int32) fNewFont->Size();
changed = old_size != new_size
|| fLevel != *fNewLevel
|| fWrap != *fNewWrap
|| fAttachAttributes != *fNewAttachAttributes
|| fColoredQuotes != *fNewColoredQuotes
-3
View File
@@ -108,8 +108,6 @@ class TPrefsWindow : public BWindow {
char **fNewPreamble;
char *fSignature;
char **fNewSignature;
int32 fLevel;
int32 *fNewLevel;
BFont fFont;
BFont *fNewFont;
uint32 fEncoding;
@@ -122,7 +120,6 @@ class TPrefsWindow : public BWindow {
BPopUpMenu *fFontMenu;
BPopUpMenu *fSizeMenu;
BPopUpMenu *fLevelMenu;
BPopUpMenu *fWrapMenu, *fColoredQuotesMenu;
BPopUpMenu *fAttachAttributesMenu;
BPopUpMenu *fAccountMenu, *fReplyToMenu;
+10 -12
View File
@@ -51,7 +51,6 @@ All rights reserved.
#include <MDRLanguage.h>
extern BRect signature_window;
extern int32 level;
extern const char *kUndoStrings[];
extern const char *kRedoStrings[];
@@ -177,7 +176,8 @@ TSignatureWindow::MessageReceived(BMessage* msg)
case M_NEW:
if (Clear()) {
fSigView->fName->SetText("");
fSigView->fTextView->SetText(NULL, (int32)0);
// fSigView->fTextView->SetText(NULL, (int32)0);
fSigView->fTextView->SetText("");
fSigView->fName->MakeFocus(true);
}
break;
@@ -187,16 +187,14 @@ TSignatureWindow::MessageReceived(BMessage* msg)
break;
case M_DELETE:
if (level == L_BEGINNER) {
beep();
if (!(new BAlert("",MDR_DIALECT_CHOICE (
"Really delete this signature? This cannot be undone.",
"この署名を削除しますか?"),
MDR_DIALECT_CHOICE ("Cancel","取消l"),
MDR_DIALECT_CHOICE ("Delete","削除"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go())
break;
}
if (!(new BAlert("",MDR_DIALECT_CHOICE (
"Really delete this signature? This cannot be undone.",
"この署名を削除しますか?"),
MDR_DIALECT_CHOICE ("Cancel","取消l"),
MDR_DIALECT_CHOICE ("Delete","削除"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go())
break;
if (fFile) {
delete fFile;
fFile = NULL;