Updating some class/method names, adding "clear global history" button

This commit is contained in:
pinkerton%netscape.com 2002-05-31 15:08:45 +00:00
parent b79f54df84
commit 47b9595439
16 changed files with 142 additions and 12 deletions

View File

@ -14,10 +14,11 @@
},
{
ACTIONS = {
buttonSystemPreferencesClicked = id;
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaChimeraPreferenceNavigation;
LANGUAGE = ObjC;
@ -30,6 +31,26 @@
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
},
{
ACTIONS = {
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaNavigatorPreferenceNavigation;
LANGUAGE = ObjC;
OUTLETS = {
buttonSystemPreferences = NSButton;
checkboxNewTabBlank = NSButton;
checkboxNewWindowBlank = NSButton;
checkboxOpenTabs = NSButton;
sliderHistoryDays = NSSlider;
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;

View File

@ -17,6 +17,10 @@
</dict>
<key>IBLastGroupID</key>
<string>8</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>

View File

@ -26,7 +26,7 @@
class nsIPref;
@interface OrgMozillaNavigatorPreferenceNavigation : NSPreferencePane
@interface OrgMozillaChimeraPreferenceNavigation : NSPreferencePane
{
IBOutlet NSButton *buttonSystemPreferences;
IBOutlet NSButton *checkboxNewTabBlank;
@ -37,8 +37,9 @@ class nsIPref;
nsIPref* mPrefService; // strong, but can't use a comptr here
}
- (IBAction)buttonSystemPreferencesClicked:(id)sender;
- (IBAction)openSystemInternetPanel:(id)sender;
- (IBAction)checkboxClicked:(id)sender;
- (IBAction)checkboxStartPageClicked:(id)sender;
- (IBAction)historyDaysModified:(id)sender;
- (IBAction)clearGlobalHistory:(id)sender;
@end

View File

@ -25,10 +25,11 @@
#include "nsIServiceManager.h"
#include "nsIPrefBranch.h"
#include "nsIPref.h"
#include "nsIBrowserHistory.h"
const int kDefaultExpireDays = 9;
@implementation OrgMozillaNavigatorPreferenceNavigation
@implementation OrgMozillaChimeraPreferenceNavigation
- (void) dealloc
{
@ -75,7 +76,7 @@ const int kDefaultExpireDays = 9;
[checkboxOpenTabs setState:YES];
}
- (IBAction)buttonSystemPreferencesClicked:(id)sender
- (IBAction)openSystemInternetPanel:(id)sender
{
if ([[NSWorkspace sharedWorkspace] openFile:@"/System/Library/PreferencePanes/Internet.prefPane"] == NO) {
// XXXw. pop up a dialog warning that System Preferences couldn't be launched?
@ -130,4 +131,17 @@ const int kDefaultExpireDays = 9;
mPrefService->SetIntPref("browser.history_expire_days", [sender intValue]);
}
//
// clearGlobalHistory:
//
// use the browser history service to clear out the user's global history
//
- (IBAction)clearGlobalHistory:(id)sender
{
nsCOMPtr<nsIBrowserHistory> hist ( do_GetService("@mozilla.org/browser/global-history;1") );
if ( hist )
hist->RemoveAllPages();
}
@end

View File

@ -14,10 +14,11 @@
},
{
ACTIONS = {
buttonSystemPreferencesClicked = id;
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaChimeraPreferenceNavigation;
LANGUAGE = ObjC;
@ -30,6 +31,26 @@
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
},
{
ACTIONS = {
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaNavigatorPreferenceNavigation;
LANGUAGE = ObjC;
OUTLETS = {
buttonSystemPreferences = NSButton;
checkboxNewTabBlank = NSButton;
checkboxNewWindowBlank = NSButton;
checkboxOpenTabs = NSButton;
sliderHistoryDays = NSSlider;
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;

View File

@ -17,6 +17,10 @@
</dict>
<key>IBLastGroupID</key>
<string>8</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>

View File

@ -14,10 +14,11 @@
},
{
ACTIONS = {
buttonSystemPreferencesClicked = id;
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaChimeraPreferenceNavigation;
LANGUAGE = ObjC;
@ -30,6 +31,26 @@
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
},
{
ACTIONS = {
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaNavigatorPreferenceNavigation;
LANGUAGE = ObjC;
OUTLETS = {
buttonSystemPreferences = NSButton;
checkboxNewTabBlank = NSButton;
checkboxNewWindowBlank = NSButton;
checkboxOpenTabs = NSButton;
sliderHistoryDays = NSSlider;
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;

View File

@ -17,6 +17,10 @@
</dict>
<key>IBLastGroupID</key>
<string>8</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>

View File

@ -26,7 +26,7 @@
class nsIPref;
@interface OrgMozillaNavigatorPreferenceNavigation : NSPreferencePane
@interface OrgMozillaChimeraPreferenceNavigation : NSPreferencePane
{
IBOutlet NSButton *buttonSystemPreferences;
IBOutlet NSButton *checkboxNewTabBlank;
@ -37,8 +37,9 @@ class nsIPref;
nsIPref* mPrefService; // strong, but can't use a comptr here
}
- (IBAction)buttonSystemPreferencesClicked:(id)sender;
- (IBAction)openSystemInternetPanel:(id)sender;
- (IBAction)checkboxClicked:(id)sender;
- (IBAction)checkboxStartPageClicked:(id)sender;
- (IBAction)historyDaysModified:(id)sender;
- (IBAction)clearGlobalHistory:(id)sender;
@end

View File

@ -25,10 +25,11 @@
#include "nsIServiceManager.h"
#include "nsIPrefBranch.h"
#include "nsIPref.h"
#include "nsIBrowserHistory.h"
const int kDefaultExpireDays = 9;
@implementation OrgMozillaNavigatorPreferenceNavigation
@implementation OrgMozillaChimeraPreferenceNavigation
- (void) dealloc
{
@ -75,7 +76,7 @@ const int kDefaultExpireDays = 9;
[checkboxOpenTabs setState:YES];
}
- (IBAction)buttonSystemPreferencesClicked:(id)sender
- (IBAction)openSystemInternetPanel:(id)sender
{
if ([[NSWorkspace sharedWorkspace] openFile:@"/System/Library/PreferencePanes/Internet.prefPane"] == NO) {
// XXXw. pop up a dialog warning that System Preferences couldn't be launched?
@ -130,4 +131,17 @@ const int kDefaultExpireDays = 9;
mPrefService->SetIntPref("browser.history_expire_days", [sender intValue]);
}
//
// clearGlobalHistory:
//
// use the browser history service to clear out the user's global history
//
- (IBAction)clearGlobalHistory:(id)sender
{
nsCOMPtr<nsIBrowserHistory> hist ( do_GetService("@mozilla.org/browser/global-history;1") );
if ( hist )
hist->RemoveAllPages();
}
@end

View File

@ -14,10 +14,11 @@
},
{
ACTIONS = {
buttonSystemPreferencesClicked = id;
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaChimeraPreferenceNavigation;
LANGUAGE = ObjC;
@ -30,6 +31,26 @@
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
},
{
ACTIONS = {
checkboxClicked = id;
checkboxStartPageClicked = id;
clearGlobalHistory = id;
historyDaysModified = id;
openSystemInternetPanel = id;
};
CLASS = OrgMozillaNavigatorPreferenceNavigation;
LANGUAGE = ObjC;
OUTLETS = {
buttonSystemPreferences = NSButton;
checkboxNewTabBlank = NSButton;
checkboxNewWindowBlank = NSButton;
checkboxOpenTabs = NSButton;
sliderHistoryDays = NSSlider;
textFieldHistoryDays = NSTextField;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;

View File

@ -17,6 +17,10 @@
</dict>
<key>IBLastGroupID</key>
<string>8</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>