Welcome to mirror list, hosted at ThFree Co, Russian Federation.

OptionsDialog.cpp « Explorer « UI « 7zip - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 742adae714aa8f55e6f070793cb967e2bec1454f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// OptionsDialog.cpp

#include "StdAfx.h"

#include "resource.h"

#include "OptionsDialog.h"

#include "Common/StringConvert.h"
#include "Windows/Control/PropertyPage.h"

#include "../../FileManager/LangUtils.h"
#include "FoldersPage/FoldersPage.h"
#include "FoldersPage/resource.h"
#include "SystemPage/SystemPage.h"
#include "SystemPage/resource.h"

extern HINSTANCE g_hInstance;

static void FillInPropertyPage(PROPSHEETPAGE* page, 
    HINSTANCE instance, 
    int dialogID, 
    NWindows::NControl::CPropertyPage *propertyPage,
    CSysString &title)
{
  page->dwSize = sizeof(PROPSHEETPAGE);
  page->dwFlags = PSP_HASHELP;
  page->hInstance = instance;
  page->pszTemplate = MAKEINTRESOURCE(dialogID);
  page->pszIcon = NULL;
  page->pfnDlgProc = NWindows::NControl::ProperyPageProcedure;

  if (title.IsEmpty())
    page->pszTitle = NULL;
  else
  {
    page->dwFlags |= PSP_USETITLE;
    page->pszTitle = title;
  }
  page->lParam = LPARAM(propertyPage);
}

int OptionsDialog(HWND hwndOwner, HINSTANCE hInstance)
{
  const int kNumPages = 2;

  PROPSHEETPAGE pages[kNumPages];
  
  CSystemPage systemPage;
  CFoldersPage foldersPage;
  
  CSysStringVector titles;
  UINT32 langIDs[] = { 0x01000300, 0x01000200};
  for (int i = 0; i < sizeof(langIDs) / sizeof(langIDs[0]); i++)
    titles.Add(GetSystemString(LangLoadString(langIDs[i])));

  FillInPropertyPage(&pages[0], hInstance, IDD_SYSTEM, &systemPage, titles[0]);
  FillInPropertyPage(&pages[1], hInstance, IDD_FOLDERS, &foldersPage, titles[1]);

  PROPSHEETHEADER sheet;

  sheet.dwSize = sizeof(PROPSHEETHEADER);
  sheet.dwFlags = PSH_PROPSHEETPAGE;
  sheet.hwndParent = hwndOwner;
  sheet.hInstance = hInstance;

  CSysString title = LangLoadString(IDS_CONFIG_DIALOG_CAPTION, 0x01000000);

  sheet.pszCaption = title;
  sheet.nPages = sizeof(pages) / sizeof(PROPSHEETPAGE);
  sheet.nStartPage = 0;
  sheet.ppsp = pages;
  
  return (PropertySheet(&sheet));
}

STDMETHODIMP CSevenZipOptions::PluginOptions(HWND hWnd, 
    IPluginOptionsCallback *callback)
{
  /*
  CComBSTR programPath;
  RETUEN_IF_NOT_S_OK(callback->GetProgramPath(programName)));
  */
  OptionsDialog(hWnd, g_hInstance);
  return S_OK;
}

STDMETHODIMP CSevenZipOptions::GetFileExtensions(BSTR *extensions)
{
  /*
  UString extStrings;
  CObjectVector<NZipRootRegistry::CArchiverInfo> formats;
  NZipRootRegistry::ReadArchiverInfoList(formats);
  for(int i = 0; i < formats.Size(); i++)
  {
    if (i != 0)
      extStrings += L' ';
    extStrings += formats[i].Extension;
  }
  CComBSTR valueTemp = extStrings;
  *extensions = valueTemp.Detach();
  return S_OK;
  */
  return E_NOTIMPL;
}