This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions

View File

@@ -0,0 +1,85 @@
// SplitDialog.cpp
#include "StdAfx.h"
#include "SplitDialog.h"
#include "Common/StringToInt.h"
#include "Windows/Shell.h"
#include "Windows/FileName.h"
#include "../../SplitUtils.h"
#ifdef LANG
#include "../../LangUtils.h"
#endif
using namespace NWindows;
#ifdef LANG
static CIDLangPair kIDLangPairs[] =
{
{ IDC_STATIC_SPLIT_PATH, 0x03020501 },
{ IDC_STATIC_SPLIT_VOLUME, 0x02000D40 },
};
#endif
bool CSplitDialog::OnInit()
{
#ifdef LANG
LangSetWindowText(HWND(*this), 0x03020500);
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_pathCombo.Attach(GetItem(IDC_COMBO_SPLIT_PATH));
_volumeCombo.Attach(GetItem(IDC_COMBO_SPLIT_VOLUME));
if (!FilePath.IsEmpty())
{
UString title;
GetText(title);
title += ' ';
title += FilePath;
SetText(title);
}
_pathCombo.SetText(Path);
AddVolumeItems(_volumeCombo);
_volumeCombo.SetCurSel(0);
return CModalDialog::OnInit();
}
bool CSplitDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
{
switch(buttonID)
{
case IDC_BUTTON_SPLIT_PATH:
OnButtonSetPath();
return true;
}
return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
}
void CSplitDialog::OnButtonSetPath()
{
CSysString currentPath;
_pathCombo.GetText(currentPath);
CSysString title = TEXT("Specify a location for output folder");
CSysString resultPath;
if (!NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath))
return;
NFile::NName::NormalizeDirPathPrefix(resultPath);
_pathCombo.SetCurSel(-1);
_pathCombo.SetText(resultPath);
}
void CSplitDialog::OnOK()
{
_pathCombo.GetText(Path);
UString volumeString;
_volumeCombo.GetText(volumeString);
volumeString.Trim();
if (!ParseVolumeSizes(volumeString, VolumeSizes))
{
MessageBox((HWND)*this, TEXT("Incorrect volume size"), TEXT("7-Zip"), MB_ICONERROR);
return;
}
CModalDialog::OnOK();
}

View File

@@ -0,0 +1,27 @@
// SplitDialog.h
#ifndef __SPLITDIALOG_H
#define __SPLITDIALOG_H
#include "Common/Types.h"
#include "Windows/Control/Dialog.h"
#include "Windows/Control/ComboBox.h"
#include "resource.h"
class CSplitDialog: public NWindows::NControl::CModalDialog
{
NWindows::NControl::CComboBox _pathCombo;
NWindows::NControl::CComboBox _volumeCombo;
virtual void OnOK();
virtual bool OnInit();
virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
void OnButtonSetPath();
public:
UString FilePath;
UString Path;
CRecordVector<UInt64> VolumeSizes;
INT_PTR Create(HWND parentWindow = 0)
{ return CModalDialog::Create(MAKEINTRESOURCE(IDD_DIALOG_SPLIT), parentWindow); }
};
#endif

View File

@@ -0,0 +1,21 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by resource.rc
//
#define IDD_DIALOG_SPLIT 504
#define IDC_STATIC_SPLIT_PATH 1000
#define IDC_COMBO_SPLIT_PATH 1001
#define IDC_BUTTON_SPLIT_PATH 1002
#define IDC_STATIC_SPLIT_VOLUME 1010
#define IDC_COMBO_SPLIT_VOLUME 1011
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 157
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,106 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG_SPLIT DIALOG DISCARDABLE 0, 0, 237, 103
STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "Split File"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Split to:",IDC_STATIC_SPLIT_PATH,7,7,223,8
COMBOBOX IDC_COMBO_SPLIT_PATH,7,18,193,126,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDC_BUTTON_SPLIT_PATH,210,17,20,14,WS_GROUP
LTEXT "Split to &volumes, bytes:",IDC_STATIC_SPLIT_VOLUME,7,38,
223,8
COMBOBOX IDC_COMBO_SPLIT_VOLUME,7,50,120,52,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,91,82,64,14
PUSHBUTTON "Cancel",IDCANCEL,166,82,64,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG_SPLIT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 230
TOPMARGIN, 7
BOTTOMMARGIN, 96
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////