///////////////////////////////////////////////////////////////////////////////
// nsIObserver
NS_IMETHODIMP
nsDownload::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData)
{
    if (strcmp(aTopic, "onpause") == 0) {
        return Suspend();
    }
    if (strcmp(aTopic, "onresume") == 0) {
        return Resume();
    }
    if (strcmp(aTopic, "oncancel") == 0) {
        SetDialog(nsnull);

        Cancel();
        // Ignoring return value; this function will get called twice,
        // and bad things happen if we return a failure code the second time.
        return NS_OK;
    }

    if (strcmp(aTopic, "alertclickcallback") == 0) {
        // show the download manager
        mDownloadManager->Open(nsnull, this);
        return NS_OK;
    }

    return NS_OK;
}
void SpeedDialConfigController::InitL()
{
	OP_ASSERT(m_thumbnail != NULL);
	if (!m_thumbnail)
		LEAVE(OpStatus::ERR_NULL_POINTER);

	m_dialog = OP_NEW_L(QuickOverlayDialog, ());
	OP_ASSERT(m_thumbnail->GetParentOpSpeedDial());
	m_dialog->SetBoundingWidget(*m_thumbnail->GetParentOpSpeedDial());
	m_dialog->SetAnimationType(QuickOverlayDialog::DIALOG_ANIMATION_FADE);

	m_dialog->SetResizeOnContentChange(FALSE);

	if (m_mode == ADD)
	{
		LEAVE_IF_ERROR(SetDialog("Speed Dial Configuration Dialog", m_dialog));
	}
	else
	{
		LEAVE_IF_ERROR(SetDialog("Speed Dial Edit Dialog", m_dialog));
	}

	InitAddressL();

	if (m_mode == ADD)
	{
		InitPageViewsL();
		InitExtensionViewsL();

		// we want to request enough suggestions to fill all slots;
		// it's not a problem if we request too many ;)
		unsigned num = SUGGESTION_COUNT +
			g_desktop_extensions_manager->GetExtensionsCount();
		LEAVE_IF_ERROR(RequestExtensionsFeed(num));
	}
	else
	{
		InitTitleL();
	}

	LEAVE_IF_ERROR(SetThumbnail(*m_thumbnail));

	if (m_mode == ADD)
		g_desktop_extensions_manager->AddInstallListener(this);
}
void ExtensionInstallGenericController::InitL()
{
	LEAVE_IF_ERROR(SetDialog("Extension Install Dialog"));
	m_widgets = m_dialog->GetWidgetCollection();
	
	m_dialog_mode = ExtensionUtils::GetAccessWindowType(m_gclass);

	return InitControlsL();
}
void PluginEULADialog::InitL()
{
	SetListener(this);
	LEAVE_IF_ERROR(SetDialog("Plugin EULA Dialog"));

	m_loading_icon = m_dialog->GetWidgetCollection()->GetL<QuickIcon>("plugin_eula_loading_icon");

	QuickBrowserView* quick_eula_browser_view = m_dialog->GetWidgetCollection()->GetL<QuickBrowserView>("plugin_eula_browser");
	m_browser_view = quick_eula_browser_view->GetOpBrowserView();

	m_license_label = m_dialog->GetWidgetCollection()->GetL<QuickLabel>("plugin_eula_license_label");

	LEAVE_IF_ERROR(m_browser_view->AddListener(this));

	m_eula_failed = false;
}
Example #5
0
int CALLBACK PrefProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
	case WM_INITDIALOG:
		{
			TCITEM tci1;
			TCITEM tci2;
			TCITEM tci3;
			TCITEM tci4;

			tci1.mask		= TCIF_TEXT;
			tci1.pszText	= _T("Settings");
			tci1.cchTextMax	= strlen("Settings");
			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 0, (LPARAM)&tci1);

			tci2.mask		= TCIF_TEXT;
			tci2.pszText	= _T("Alerts");
			tci2.cchTextMax	= strlen("Alerts");
			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 1, (LPARAM)&tci2);

			tci3.mask		= TCIF_TEXT;
			tci3.pszText	= _T("Events");
			tci3.cchTextMax	= strlen("Events");
			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 2, (LPARAM)&tci3);

			tci4.mask		= TCIF_TEXT;
			tci4.pszText	= _T("About");
			tci4.cchTextMax	= strlen("About");
			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 3, (LPARAM)&tci4);


			/***********************************************************************************/
			/***********************************************************************************/
			/***********************************************************************************/

			g_hPrefTabSettings	= CreateDialog((HINSTANCE)g_hInstance,
									MAKEINTRESOURCE(IDD_SETTINGS),
									hWnd,		
									(DLGPROC)SettingsProc);
			SetDialog(g_hPrefTabSettings,	IDD_SETTINGS);

			g_hPrefTabAlerts	= CreateDialog((HINSTANCE)g_hInstance,
									MAKEINTRESOURCE(IDD_ALERTS),
									hWnd,
									(DLGPROC)AlertsProc);
			SetDialog(g_hPrefTabAlerts,		IDD_ALERTS);

			g_hPrefTabEvents	= CreateDialog((HINSTANCE)g_hInstance,
									MAKEINTRESOURCE(IDD_EVENTS),
									hWnd,		
									(DLGPROC)EventsProc);
			SetDialog(g_hPrefTabEvents,		IDD_EVENTS);

			g_hPrefTabAbout		= CreateDialog((HINSTANCE)g_hInstance,
									MAKEINTRESOURCE(IDD_ABOUT),
									hWnd,
									(DLGPROC)AboutProc);
		}
		break;
	case WM_SHOWWINDOW:
		{
			if(wparam)
			{
				SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_SETCURSEL, 0, 0);
				ShowWindow(g_hPrefTabSettings,	SW_SHOW);
				ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
				ShowWindow(g_hPrefTabEvents,	SW_HIDE);
				ShowWindow(g_hPrefTabAbout,		SW_HIDE);
			}
		}
		break;
	case WM_NOTIFY:
		{
			NMHDR *pData = (NMHDR *)lparam;

			switch(pData->code)
			{
			case TCN_SELCHANGE:
				{
					switch(SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_GETCURSEL, 0, 0))
					{
					case 0:
						{
							ShowWindow(g_hPrefTabSettings,	SW_SHOW);
							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
						}
						break;
					case 1:
						{
							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
							ShowWindow(g_hPrefTabAlerts,	SW_SHOW);
							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
						}
						break;
					case 2:
						{
							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
							ShowWindow(g_hPrefTabEvents,	SW_SHOW);
							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
						}
						break;
					case 3:
						{
							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
							ShowWindow(g_hPrefTabAbout,		SW_SHOW);
						}
						break;
					}
				}
				break;
			}
		}
		break;
	case WM_CLOSE:
		{
			ShowWindow(g_hPrefTabEvents,	SW_HIDE);
			ShowWindow(g_hPrefTabSettings,	SW_HIDE);
			ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
			ShowWindow(g_hPrefTabAbout,		SW_HIDE);
			ShowWindow(hWnd,				SW_HIDE);
			return TRUE;
		}
		break;
	case WM_COMMAND:
		{
			switch(wparam)
			{
			case IDC_PREF_OK:
				{
					CheckPrefs(g_hPrefTabEvents,	IDD_EVENTS);
					CheckPrefs(g_hPrefTabSettings,	IDD_SETTINGS);
					CheckPrefs(g_hPrefTabAlerts,	IDD_ALERTS);

					SavePrefs(0);

					ShowWindow(g_hPrefTabEvents,	SW_HIDE);
					ShowWindow(g_hPrefTabSettings,	SW_HIDE);
					ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
					ShowWindow(g_hPrefTabAbout,		SW_HIDE);
					ShowWindow(hWnd,				SW_HIDE);
					return TRUE;
				}
				break;
			case IDC_PREF_CANCEL:
				{
					ShowWindow(g_hPrefTabEvents,	SW_HIDE);
					ShowWindow(g_hPrefTabSettings,	SW_HIDE);
					ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
					ShowWindow(g_hPrefTabAbout,		SW_HIDE);
					ShowWindow(hWnd,				SW_HIDE);
					return TRUE;
				}
				break;
			case IDC_PREF_APPLY:
				{
					CheckPrefs(g_hPrefTabEvents,	IDD_EVENTS);
					CheckPrefs(g_hPrefTabSettings,	IDD_SETTINGS);
					CheckPrefs(g_hPrefTabAlerts,	IDD_ALERTS);

					SavePrefs(0);
					return FALSE;
				}
				break;
			}
		}
		break;
	case WM_DESTROY:
		{
			SendMessage(g_hPrefTabEvents,	WM_CLOSE, 0, 0);
			SendMessage(g_hPrefTabSettings,	WM_CLOSE, 0, 0);
			SendMessage(g_hPrefTabAbout,	WM_CLOSE, 0, 0);
			SendMessage(g_hPrefTabAlerts,	WM_CLOSE, 0, 0);
		}
		break;
	}

	return FALSE;
}
#include "modules/prefs/prefsmanager/collections/pc_network.h"
#include "modules/widgets/WidgetContainer.h"

#include "adjunct/m2/src/engine/engine.h"

DefaultMailViewPropertiesController::DefaultMailViewPropertiesController(OpWidget* anchor_widget, MailDesktopWindow* mail_window)
: PopupDialogContext(anchor_widget)
, m_mail_window(mail_window)
, m_overlay_dialog(NULL)
{
}

void DefaultMailViewPropertiesController::InitL()
{
	m_overlay_dialog = OP_NEW_L(QuickOverlayDialog, ());
	LEAVE_IF_ERROR(SetDialog("Mail Default View Properties Popup", m_overlay_dialog));

	m_overlay_dialog->SetAnimationType(QuickOverlayDialog::DIALOG_ANIMATION_CALLOUT);
	
	CalloutDialogPlacer* placer = OP_NEW_L(CalloutDialogPlacer, (*GetAnchorWidget()));
	m_overlay_dialog->SetDialogPlacer(placer);
	m_overlay_dialog->SetBoundingWidget(*m_mail_window->GetWidgetContainer()->GetRoot());
}

BOOL DefaultMailViewPropertiesController::CanHandleAction(OpInputAction* action)
{
	switch (action->GetAction())
	{
		case OpInputAction::ACTION_MARK_AS_READ_AUTOMATICALLY:
		case OpInputAction::ACTION_SHOW_LIST_VIEW:
		case OpInputAction::ACTION_SHOW_SPLIT_VIEW:
#include "adjunct/m2/src/engine/engine.h"
#include "adjunct/m2_ui/dialogs/SignatureEditor.h"
#include "adjunct/m2_ui/controllers/ComposeWindowOptionsController.h"
#include "adjunct/m2_ui/windows/ComposeDesktopWindow.h"
#include "adjunct/quick_toolkit/bindings/QuickBinder.h"
#include "adjunct/quick_toolkit/widgets/QuickCheckBox.h"
#include "adjunct/quick_toolkit/widgets/CalloutDialogPlacer.h"
#include "adjunct/quick_toolkit/widgets/QuickOverlayDialog.h"
#include "adjunct/quick_toolkit/widgets/QuickDropDown.h"

#include "modules/widgets/WidgetContainer.h"

void ComposeWindowOptionsController::InitL()
{
	QuickOverlayDialog* overlay_dialog = OP_NEW_L(QuickOverlayDialog, ());
	LEAVE_IF_ERROR(SetDialog("Mail Compose Window Options Popup", overlay_dialog));

	CalloutDialogPlacer* placer = OP_NEW_L(CalloutDialogPlacer, (*GetAnchorWidget()));
	overlay_dialog->SetDialogPlacer(placer);
	overlay_dialog->SetBoundingWidget(*GetAnchorWidget()->GetParentDesktopWindow()->GetWidgetContainer()->GetRoot());
	overlay_dialog->SetAnimationType(QuickOverlayDialog::DIALOG_ANIMATION_CALLOUT);

	LEAVE_IF_ERROR(GetBinder()->Connect("Message_expanded_checkbox", m_expanded_draft));
	m_expanded_draft.Set(g_pcm2->GetIntegerPref(PrefsCollectionM2::PaddingInComposeWindow) == 0);
	LEAVE_IF_ERROR(m_expanded_draft.Subscribe(MAKE_DELEGATE(*this, &ComposeWindowOptionsController::UpdateExpandedDraft)));

	int flags = g_pcm2->GetIntegerPref(PrefsCollectionM2::MailComposeHeaderDisplay);

	for (int i = 0; i < AccountTypes::HEADER_DISPLAY_LAST; i++)
	{
		m_show_flags[i].Set((flags & (1<<i)) != FALSE);
void ModeManagerController::InitL()
{
	LEAVE_IF_ERROR(SetDialog("Mode Manager Dialog"));
	LEAVE_IF_ERROR(InitOptions());
}
Example #9
0
void DialogAppear(void *data)
{
    DialogData *dialogData = (DialogData*) data;
    SetDialog(dialogData->text);
	ShowDialogLayer(dialogData->allowCancel);
}