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