Browse Source

Misc fixes

master
boisso 7 years ago
parent
commit
38c1ec5dd2
  1. 2
      k-meleon/BrowserFrm.cpp
  2. 42
      k-meleon/BrowserWindow.cpp
  3. 2
      k-meleon/DialogEx.h
  4. 16
      k-meleon/MfcEmbed.cpp
  5. 7
      k-meleon/defineMap.cpp
  6. 2
      k-meleon/resource.h

2
k-meleon/BrowserFrm.cpp

@ -375,7 +375,7 @@ int CBrowserFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (InitLayout() == -1)
return -1;
m_wndReBar.RestoreBandSizes();
//m_wndReBar.RestoreBandSizes();
return 0;
}

42
k-meleon/BrowserWindow.cpp

@ -819,30 +819,42 @@ BOOL CBrowserWrapper::InitPrintSettings()
nsCOMPtr<nsIPrintSettingsService> psService =
do_GetService("@mozilla.org/gfx/printsettings-service;1");
NS_ENSURE_TRUE(psService, FALSE);
nsresult rv;
if (theApp.preferences.GetBool("print.use_global_printsettings", false)) {
psService->GetGlobalPrintSettings(getter_AddRefs(mPrintSettings));
NS_ENSURE_TRUE(mPrintSettings, FALSE);
nsString name;
mPrintSettings->GetPrinterName(getter_Copies(name));
if (name.IsEmpty()) {
psService->GetDefaultPrinterName(getter_Copies(name));
mPrintSettings->SetPrinterName(name.get());
}
psService->InitPrintSettingsFromPrinter(name.get(), mPrintSettings);
rv = psService->InitPrintSettingsFromPrefs(mPrintSettings, true, nsIPrintSettings::kInitSaveAll);
} else
rv = psService->GetNewPrintSettings(getter_AddRefs(mPrintSettings));
psService->GetGlobalPrintSettings(getter_AddRefs(mPrintSettings));
NS_ENSURE_TRUE(mPrintSettings, FALSE);
nsresult rv = psService->InitPrintSettingsFromPrefs(mPrintSettings, PR_FALSE, nsIPrintSettings::kInitSaveAll);
return NS_SUCCEEDED(rv);
}
#include "BrowserFrm.h"
#include "BrowserView.h"
BOOL CBrowserWrapper::PrintPreview()
{
nsCOMPtr<nsIWebBrowserPrint> print;
nsIDocShell* shell;
nsCOMPtr<nsIWebBrowserPrint> print;
if (!mPrintSettings) InitPrintSettings();
nsCOMPtr<nsIDOMWindow> dom;
nsresult rv = mWebBrowser->GetContentDOMWindow(getter_AddRefs(dom));
NS_ENSURE_SUCCESS(rv, FALSE);
CBrowserFrame* frm = theApp.CreateNewBrowserFrame(nsIWebBrowserChrome::CHROME_DEFAULT, false, CWnd::FromHandle(mpBrowserGlue->GetBrowserFrameNativeWnd()));
shell = frm->GetActiveView()->GetBrowserWrapper()->GetDocShell();
shell->GetPrintPreview(getter_AddRefs(print));
CBrowserFrame* frm = theApp.CreateNewBrowserFrame(
nsIWebBrowserChrome::CHROME_DEFAULT, false,
CWnd::FromHandle(mpBrowserGlue->GetBrowserFrameNativeWnd()));
frm->GetActiveView()->OpenURL(L"about:blank");
nsIDocShell* shell = frm->GetActiveView()->GetBrowserWrapper()->GetDocShell();
if (shell) shell->GetPrintPreview(getter_AddRefs(print));
if (!print) {
frm->DestroyWindow();
return FALSE;
@ -852,9 +864,9 @@ BOOL CBrowserWrapper::PrintPreview()
// WORKAROUND - FIX ME: Why the print preview doesn't use all the width?
// So I'm forcing the window to reposition itself.
//CRect rect;
//mWndOwner->GetClientRect(rect);
//mBaseWindow->SetPositionAndSize(0, 0, rect.right, rect.bottom, PR_TRUE);
CRect rect;
mWndOwner->GetClientRect(rect);
mBaseWindow->SetPositionAndSize(0, 0, rect.right, rect.bottom, PR_TRUE);
return NS_SUCCEEDED(rv);

2
k-meleon/DialogEx.h

@ -25,7 +25,7 @@ public:
CDialogEx2(UINT nIDTemplate, CWnd* pParentWnd = NULL)
: CDialog(nIDTemplate, pParentWnd) {};
~CDialogEx2() {};
int RunModalLoop(DWORD dwFlags = 0);
//int RunModalLoop(DWORD dwFlags = 0);
INT DoModal()
{
//CMfcEmbedApp *pApp = (CMfcEmbedApp *)AfxGetApp();

16
k-meleon/MfcEmbed.cpp

@ -669,9 +669,6 @@ BOOL CMfcEmbedApp::InitInstance()
#endif
InitializeMenusAccels();
nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1"));
observerService->NotifyObservers (nullptr, "kmeleon-init", nullptr);
// the hidden window will take care of creating the first
// browser window for us
if(!CreateHiddenWindow()){
@ -1359,7 +1356,7 @@ BOOL CMfcEmbedApp::InitializePrefs(){
BOOL CMfcEmbedApp::InitializeMenusAccels(){
CString filename;
CMenuParser menusParser;
CMenuParser menusParser;
filename = GetFolder(DefSettingsFolder) + _T("\\") ACCEL_CONFIG_FILE;
accel.Load(filename);
@ -1367,8 +1364,11 @@ BOOL CMfcEmbedApp::InitializeMenusAccels(){
filename = GetFolder(DefSettingsFolder) + _T("\\") MENU_CONFIG_FILE;
menusParser.Load(filename);
plugins.SendMessage("*", "* Plugin Manager", "Init");
plugins.SendMessage("*", "* Plugin Manager", "Setup2");
plugins.SendMessage("*", "* Plugin Manager", "Init");
plugins.SendMessage("*", "* Plugin Manager", "Setup2");
nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1"));
observerService->NotifyObservers (nullptr, "kmeleon-init", nullptr);
filename = GetFolder(UserSettingsFolder) + _T("\\") ACCEL_CONFIG_FILE;
accel.Load(filename);
@ -1376,8 +1376,8 @@ BOOL CMfcEmbedApp::InitializeMenusAccels(){
filename = GetFolder(UserSettingsFolder) + _T("\\") MENU_CONFIG_FILE;
menusParser.Load(filename);
plugins.SendMessage("*", "* Plugin Manager", "Setup");
plugins.SendMessage("*", "* Plugin Manager", "UserSetup");
plugins.SendMessage("*", "* Plugin Manager", "Setup");
plugins.SendMessage("*", "* Plugin Manager", "UserSetup");
return TRUE;
}

7
k-meleon/defineMap.cpp

@ -93,4 +93,9 @@ DEFINEMAP_ADD(ID_FULLZOOM_INCREASE)
DEFINEMAP_ADD(ID_FULLZOOM_DECREASE)
DEFINEMAP_ADD(ID_MATCH_CASE)
DEFINEMAP_ADD(ID_HIGHLIGHT)
DEFINEMAP_ADD(ID_PAGE_ENABLE_JS)
DEFINEMAP_ADD(ID_PAGE_DISABLE_JS)
DEFINEMAP_ADD(ID_PAGE_TOGGLE_JS)
DEFINEMAP_ADD(ID_ENABLE_JS)
DEFINEMAP_ADD(ID_DISABLE_JS)
DEFINEMAP_ADD(ID_TOGGLE_JS)

2
k-meleon/resource.h

@ -454,7 +454,6 @@
#define ID_COPY_IMAGE_CONTENT 32821
#define ID_FULLZOOM_INCREASE 32822
#define ID_FULLZOOM_DECREASE 32823
#define ID_COOKIES_VIEWER 32919
#define ID_PASSWORDS_VIEWER 32824
#define ID_COOKIE_PERM 32825
#define ID_IMAGE_PERM 32826
@ -479,6 +478,7 @@
#define ID_MATCH_CASE 32915
#define ID_HIGHLIGHT 32916
#define ID_WRAP_AROUND 32917
#define ID_COOKIES_VIEWER 32918
#define ID_PAGE_ENABLE_JS 32919
#define ID_PAGE_DISABLE_JS 32920
#define ID_ENABLE_JS 32921

Loading…
Cancel
Save