~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/UI/FileManager/CopyDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// CopyDialog.cpp
 
2
 
 
3
#include "StdAfx.h"
 
4
#include "CopyDialog.h"
 
5
 
 
6
#include "Common/StringConvert.h"
 
7
 
 
8
#include "Windows/Control/Static.h"
 
9
#include "Windows/Shell.h"
 
10
#include "Windows/FileName.h"
 
11
 
 
12
#ifdef LANG
 
13
#include "LangUtils.h"
 
14
#endif
 
15
 
 
16
using namespace NWindows;
 
17
 
 
18
#ifdef LANG
 
19
static CIDLangPair kIDLangPairs[] =
 
20
{
 
21
  { IDOK, 0x02000702 },
 
22
  { IDCANCEL, 0x02000710 }
 
23
};
 
24
#endif
 
25
 
 
26
bool CCopyDialog::OnInit()
 
27
{
 
28
  #ifdef LANG
 
29
  LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
 
30
  #endif
 
31
  _path.Attach(GetItem(IDC_COPY_COMBO));
 
32
  SetText(Title);
 
33
 
 
34
  NControl::CStatic staticContol;
 
35
  staticContol.Attach(GetItem(IDC_COPY_STATIC));
 
36
  staticContol.SetText(Static);
 
37
  for (int i = 0; i < Strings.Size(); i++)
 
38
    _path.AddString(Strings[i]);
 
39
  _path.SetText(Value);
 
40
  SetItemText(IDC_COPY_INFO, Info);
 
41
  return CModalDialog::OnInit();
 
42
}
 
43
 
 
44
bool CCopyDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
 
45
{
 
46
  switch(buttonID)
 
47
  {
 
48
    case IDC_COPY_SET_PATH:
 
49
      OnButtonSetPath();
 
50
      return true;
 
51
  }
 
52
  return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
 
53
}
 
54
 
 
55
void CCopyDialog::OnButtonSetPath()
 
56
{
 
57
  UString currentPath;
 
58
  _path.GetText(currentPath);
 
59
 
 
60
  /*
 
61
  #ifdef LANG
 
62
  UString title = LangLoadString(IDS_EXTRACT_SET_FOLDER, 0x02000881);
 
63
  #else
 
64
  UString title = MyLoadString(IDS_EXTRACT_SET_FOLDER);
 
65
  #endif
 
66
  */
 
67
  UString title = LangStringSpec(IDS_SET_FOLDER, 0x03020209);
 
68
  // UString title = L"Specify a location for output folder";
 
69
 
 
70
  UString resultPath;
 
71
  if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath))
 
72
    return;
 
73
  NFile::NName::NormalizeDirPathPrefix(resultPath);
 
74
  _path.SetCurSel(-1);
 
75
  _path.SetText(resultPath);
 
76
}
 
77
 
 
78
void CCopyDialog::OnOK()
 
79
{
 
80
  _path.GetText(Value);
 
81
  CModalDialog::OnOK();
 
82
}