new option to open explorer subfolders in separate windows

svn path=/trunk/; revision=18209
This commit is contained in:
Martin Fuchs 2005-10-02 11:40:41 +00:00
parent 5ffe4c4880
commit 63935e005c
10 changed files with 88 additions and 52 deletions

View file

@ -238,10 +238,13 @@ MdiSdiDlg::MdiSdiDlg(HWND hwnd)
XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
bool mdi = XMLBool(explorer_options, "mdi", true); bool mdi = XMLBool(explorer_options, "mdi", true);
bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
int id = mdi? IDC_MDI: IDC_SDI; int id = mdi? IDC_MDI: IDC_SDI;
CheckDlgButton(hwnd, id, BST_CHECKED); CheckDlgButton(hwnd, id, BST_CHECKED);
SetFocus(GetDlgItem(hwnd, id)); SetFocus(GetDlgItem(hwnd, id));
CheckDlgButton(hwnd, IDC_SEPARATE_SUBFOLDERS, separateFolders?BST_CHECKED:BST_UNCHECKED);
} }
int MdiSdiDlg::Command(int id, int code) int MdiSdiDlg::Command(int id, int code)
@ -250,8 +253,12 @@ int MdiSdiDlg::Command(int id, int code)
switch(id) { switch(id) {
case IDOK: { case IDOK: {
bool mdi = IsDlgButtonChecked(_hwnd, IDC_MDI)==BST_CHECKED; bool mdi = IsDlgButtonChecked(_hwnd, IDC_MDI)==BST_CHECKED;
bool separateFolders = IsDlgButtonChecked(_hwnd, IDC_SEPARATE_SUBFOLDERS)==BST_CHECKED;
XMLPos explorer_options = g_Globals.get_cfg("general/explorer"); XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
XMLBoolRef(explorer_options, "mdi") = mdi; XMLBoolRef(explorer_options, "mdi") = mdi;
XMLBoolRef(explorer_options, "separate-folders") = separateFolders;
} // fall through } // fall through
case IDCANCEL: case IDCANCEL:

View file

@ -2,14 +2,13 @@
<explorer-cfg> <explorer-cfg>
<general> <general>
<look-and-feel name="classic"/> <look-and-feel name="classic"/>
<explorer mdi="true"/> <explorer mdi="true" separate-folders="true"/>
<language name="EN"/> <language name="EN"/>
</general> </general>
<desktop> <desktop>
<icon-alignment algorithm="simple" start="left-top" direction="horizontal"/> <icon-alignment algorithm="simple" start="left-top" direction="horizontal"/>
</desktop> </desktop>
<desktopbar> <desktopbar>
<options show-clock="true"/> <options show-clock="true"/>
<positions> <positions>

View file

@ -362,7 +362,7 @@ BEGIN
PUSHBUTTON "&Zrušit",IDCANCEL,151,153,50,14 PUSHBUTTON "&Zrušit",IDCANCEL,151,153,50,14
END END
IDD_MDI_SDI DIALOGEX 0, 0, 194, 138 IDD_MDI_SDI DIALOGEX 0, 0, 194, 157
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Volba MDI / SDI módu" CAPTION "Volba MDI / SDI módu"
@ -371,15 +371,18 @@ BEGIN
LTEXT "Prosím zvolte si Vámi upøednostòovaný zpùsob zobrazení oken prùzkumníka:", LTEXT "Prosím zvolte si Vámi upøednostòovaný zpùsob zobrazení oken prùzkumníka:",
IDC_STATIC,7,7,160,8 IDC_STATIC,7,7,160,8
CONTROL "&MDI (Mnoho dokumentový interface)",IDC_MDI,"Button", CONTROL "&MDI (Mnoho dokumentový interface)",IDC_MDI,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,30,121,10 BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,121,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL "&SDI (Jedno dokumentový interface)",IDC_SDI,"Button", CONTROL "&SDI (Jedno dokumentový interface)",IDC_SDI,"Button",
BS_AUTORADIOBUTTON,7,53,115,10 BS_AUTORADIOBUTTON,7,62,115,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13
CONTROL "Open Subfolders in s&eparate windows",
IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,90,135,10
LTEXT "Toto nastavení bude použito jako implicitní pro všechny okna prùzkumníka.", LTEXT "Toto nastavení bude použito jako implicitní pro všechny okna prùzkumníka.",
IDC_STATIC,7,76,174,22 IDC_STATIC,7,111,174,22
DEFPUSHBUTTON "&Nastavit",IDOK,29,105,50,14,WS_GROUP DEFPUSHBUTTON "&Nastavit",IDOK,29,136,50,14,WS_GROUP
PUSHBUTTON "&Zrušit",IDCANCEL,106,105,50,14 PUSHBUTTON "&Zrušit",IDCANCEL,106,136,50,14
END END

View file

@ -360,24 +360,27 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,151,153,50,14 PUSHBUTTON "&Cancel",IDCANCEL,151,153,50,14
END END
IDD_MDI_SDI DIALOGEX 0, 0, 194, 138 IDD_MDI_SDI DIALOGEX 0, 0, 194, 157
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Choose MDI / SDI mode" CAPTION "Choose MDI / SDI mode"
FONT 8, "MS Sans Serif", 0, 0, 0x1 FONT 8, "MS Sans Serif"
BEGIN BEGIN
LTEXT "Please select your prefered explorer user interface:", LTEXT "Please select your prefered explorer user interface:",
IDC_STATIC,7,7,160,8 IDC_STATIC,7,7,160,8
CONTROL "&MDI (multiple document interface)",IDC_MDI,"Button", CONTROL "&MDI (multiple document interface)",IDC_MDI,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,121,10 BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,121,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL "&SDI (single document interface)",IDC_SDI,"Button", CONTROL "&SDI (single document interface)",IDC_SDI,"Button",
BS_AUTORADIOBUTTON,7,62,115,10 BS_AUTORADIOBUTTON,7,62,115,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13
CONTROL "Open Subfolders in s&eparate windows",
IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,90,135,10
LTEXT "This setting will be used as default for all explorer windows in the future.", LTEXT "This setting will be used as default for all explorer windows in the future.",
IDC_STATIC,7,91,174,22 IDC_STATIC,7,111,174,22
DEFPUSHBUTTON "&OK",IDOK,29,117,50,14,WS_GROUP DEFPUSHBUTTON "&OK",IDOK,29,136,50,14,WS_GROUP
PUSHBUTTON "&Cancel",IDCANCEL,106,117,50,14 PUSHBUTTON "&Cancel",IDCANCEL,106,136,50,14
END END

View file

@ -360,22 +360,27 @@ BEGIN
PUSHBUTTON "&Cancelar",IDCANCEL,151,153,50,14 PUSHBUTTON "&Cancelar",IDCANCEL,151,153,50,14
END END
IDD_MDI_SDI DIALOGEX 0, 0, 194, 138 IDD_MDI_SDI DIALOGEX 0, 0, 194, 157
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Elegir modo MDI / SDI" CAPTION "Elegir modo MDI / SDI"
FONT 8, "MS Sans Serif", 0, 0, 0x1 FONT 8, "MS Sans Serif"
BEGIN BEGIN
LTEXT "Por favor, seleccione su interfaz de usuario preferida para el explorador:", LTEXT "Por favor, seleccione su interfaz de usuario preferida para el explorador:",
IDC_STATIC,7,7,170,18 IDC_STATIC,7,7,170,18
CONTROL "&MDI (Multiple Document Interface)",IDC_MDI,"Button", CONTROL "&MDI (Multiple Document Interface)",IDC_MDI,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,30,123,10 BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,123,10
CONTROL "&SDI (Single Document Interface)",IDC_SDI,"Button", CONTROL "&SDI (Single Document Interface)",IDC_SDI,"Button",
BS_AUTORADIOBUTTON,7,53,116,10 BS_AUTORADIOBUTTON,7,62,116,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13
CONTROL "Open Subfolders in s&eparate windows",
IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,90,135,10
LTEXT "Esta configuración se usará por defecto y apartir de ahora para todas las ventanas del explorador.", LTEXT "Esta configuración se usará por defecto y apartir de ahora para todas las ventanas del explorador.",
IDC_STATIC,7,76,174,22 IDC_STATIC,7,111,174,22
DEFPUSHBUTTON "&Aceptar",IDOK,29,105,50,14,WS_GROUP DEFPUSHBUTTON "&Aceptar",IDOK,29,136,50,14,WS_GROUP
PUSHBUTTON "&Cancelar",IDCANCEL,106,105,50,14 PUSHBUTTON "&Cancelar",IDCANCEL,106,136,50,14
END END

View file

@ -330,7 +330,7 @@ BEGIN
PUSHBUTTON "&Ñïðàâêà",254,158,42,47,14 PUSHBUTTON "&Ñïðàâêà",254,158,42,47,14
END END
IDD_MDI_SDI DIALOGEX 0, 0, 194, 138 IDD_MDI_SDI DIALOGEX 0, 0, 194, 157
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Âûáåðèòå ðåæèì MDI / SDI" CAPTION "Âûáåðèòå ðåæèì MDI / SDI"
@ -339,15 +339,18 @@ BEGIN
LTEXT "Âûáåðèòå íàèáîëåå ïðåäïî÷òèòåëüíûé äëÿ âàñ\nâèä ïðîâîäíèêà:", LTEXT "Âûáåðèòå íàèáîëåå ïðåäïî÷òèòåëüíûé äëÿ âàñ\nâèä ïðîâîäíèêà:",
IDC_STATIC,7,7,171,17 IDC_STATIC,7,7,171,17
CONTROL "&MDI (ìíîãîäîêóìåíòíûé íòåðôåéñ)",IDC_MDI,"Button", CONTROL "&MDI (ìíîãîäîêóìåíòíûé íòåðôåéñ)",IDC_MDI,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,30,136,10 BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,136,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL "&SDI (îäíîäîêóìåíòíûé èíòåðôåéñ)",IDC_SDI,"Button", CONTROL "&SDI (îäíîäîêóìåíòíûé èíòåðôåéñ)",IDC_SDI,"Button",
BS_AUTORADIOBUTTON,7,53,134,10 BS_AUTORADIOBUTTON,7,62,134,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13
CONTROL "Open Subfolders in s&eparate windows",
IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,90,135,10
LTEXT "Ýòè íàñòðîéêè áóäóò èñïîëüçîâàííû, êàê çíà÷åíèå ïî óìîë÷àíèþ äëÿ âñåõ îêîí ïðîâîäíèêà â áóäóùåì.", LTEXT "Ýòè íàñòðîéêè áóäóò èñïîëüçîâàííû, êàê çíà÷åíèå ïî óìîë÷àíèþ äëÿ âñåõ îêîí ïðîâîäíèêà â áóäóùåì.",
IDC_STATIC,7,76,174,26 IDC_STATIC,7,107,174,26
DEFPUSHBUTTON "&OK",IDOK,29,105,50,14,WS_GROUP DEFPUSHBUTTON "&OK",IDOK,29,136,50,14,WS_GROUP
PUSHBUTTON "&Cancel",IDCANCEL,106,105,50,14 PUSHBUTTON "&Cancel",IDCANCEL,106,136,50,14
END END
IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174

View file

@ -397,23 +397,26 @@ BEGIN
PUSHBUTTON "&Avbryt",IDCANCEL,151,153,50,14 PUSHBUTTON "&Avbryt",IDCANCEL,151,153,50,14
END END
IDD_MDI_SDI DIALOGEX 0, 0, 194, 138 IDD_MDI_SDI DIALOGEX 0, 0, 194, 157
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Välj MDI / SDI Läge" CAPTION "Välj MDI / SDI Läge"
FONT 8, "MS Sans Serif", 0, 0, 0x1 FONT 8, "MS Sans Serif"
BEGIN BEGIN
LTEXT "Välj det gränssnitt du föredrar:",IDC_STATIC,7,7,160,8 LTEXT "Välj det gränssnitt du föredrar:",IDC_STATIC,7,7,160,8
CONTROL "&MDI (multiple document interface)",IDC_MDI,"Button", CONTROL "&MDI (multiple document interface)",IDC_MDI,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,30,121,10 BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,31,121,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL "&SDI (single document interface)",IDC_SDI,"Button", CONTROL "&SDI (single document interface)",IDC_SDI,"Button",
BS_AUTORADIOBUTTON,7,53,115,10 BS_AUTORADIOBUTTON,7,62,115,10
CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13
CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13
CONTROL "Open Subfolders in s&eparate windows",
IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,7,90,135,10
LTEXT "Den här inställningen kommer att gälla som standard i alla nya explorer-fönster.", LTEXT "Den här inställningen kommer att gälla som standard i alla nya explorer-fönster.",
IDC_STATIC,7,76,174,22 IDC_STATIC,7,107,174,22
DEFPUSHBUTTON "&OK",IDOK,29,105,50,14,WS_GROUP DEFPUSHBUTTON "&OK",IDOK,29,136,50,14,WS_GROUP
PUSHBUTTON "&Avbryt",IDCANCEL,106,105,50,14 PUSHBUTTON "&Avbryt",IDCANCEL,106,136,50,14
END END

View file

@ -164,6 +164,7 @@
#define IDC_WIN_VERSION 1030 #define IDC_WIN_VERSION 1030
#define IDC_MDI 1030 #define IDC_MDI 1030
#define IDC_SDI 1031 #define IDC_SDI 1031
#define IDC_SEPARATE_SUBFOLDERS 1034
#define ID_REFRESH 1704 #define ID_REFRESH 1704
#define ID_ABOUT_WINEFILE 1705 #define ID_ABOUT_WINEFILE 1705
#define IDS_VERSION_STR 5000 #define IDS_VERSION_STR 5000
@ -221,7 +222,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 169 #define _APS_NEXT_RESOURCE_VALUE 169
#define _APS_NEXT_COMMAND_VALUE 40024 #define _APS_NEXT_COMMAND_VALUE 40024
#define _APS_NEXT_CONTROL_VALUE 1034 #define _APS_NEXT_CONTROL_VALUE 1035
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif

View file

@ -103,17 +103,24 @@ int MainFrameBase::OpenShellFolders(LPIDA pida, HWND hFrameWnd)
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
if (attribs & SFGAO_FOLDER) { if (attribs & SFGAO_FOLDER) {
try { try {
XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
bool mdi = XMLBool(explorer_options, "mdi", true);
bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
ShellPath pidl_abs = ShellPath(pidl).create_absolute_pidl(parent_pidl); ShellPath pidl_abs = ShellPath(pidl).create_absolute_pidl(parent_pidl);
if (hFrameWnd) { if (hFrameWnd && (mdi || !separateFolders)) {
if (SendMessage(hFrameWnd, PM_OPEN_WINDOW, OWM_PIDL, (LPARAM)(LPCITEMIDLIST)pidl_abs)) int flags = OWM_PIDL;
if (separateFolders)
flags |= OWM_SEPARATE;
if (SendMessage(hFrameWnd, PM_OPEN_WINDOW, flags, (LPARAM)(LPCITEMIDLIST)pidl_abs))
++cnt; ++cnt;
} else { } else {
HWND hwnd; HWND hwnd;
#ifndef _NO_MDI #ifndef _NO_MDI
XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
bool mdi = XMLBool(explorer_options, "mdi", true);
if (mdi) if (mdi)
hwnd = MDIMainFrame::Create(pidl_abs, 0); hwnd = MDIMainFrame::Create(pidl_abs, 0);
else else
@ -900,7 +907,9 @@ BOOL MDIMainFrame::TranslateMsg(MSG* pmsg)
LRESULT MDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) LRESULT MDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{ {
switch(nmsg) { switch(nmsg) {
case PM_OPEN_WINDOW: {CONTEXT("MDIMainFrame PM_OPEN_WINDOW"); case PM_OPEN_WINDOW: {
CONTEXT("MDIMainFrame PM_OPEN_WINDOW");
TCHAR buffer[MAX_PATH]; TCHAR buffer[MAX_PATH];
LPCTSTR path; LPCTSTR path;
ShellPath shell_path = DesktopFolderPath(); ShellPath shell_path = DesktopFolderPath();
@ -940,11 +949,11 @@ LRESULT MDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
// Shell Namespace as default view // Shell Namespace as default view
ShellChildWndInfo create_info(_hmdiclient, path, shell_path); ShellChildWndInfo create_info(_hmdiclient, path, shell_path);
create_info._pos.showCmd = SW_SHOWMAXIMIZED; create_info._pos.showCmd = wparam&OWM_SEPARATE? SW_SHOWNORMAL: SW_SHOWMAXIMIZED;
create_info._pos.rcNormalPosition.left = 0; create_info._pos.rcNormalPosition.left = CW_USEDEFAULT;
create_info._pos.rcNormalPosition.top = 0; create_info._pos.rcNormalPosition.top = CW_USEDEFAULT;
create_info._pos.rcNormalPosition.right = 600; create_info._pos.rcNormalPosition.right = CW_USEDEFAULT;
create_info._pos.rcNormalPosition.bottom = 280; create_info._pos.rcNormalPosition.bottom = CW_USEDEFAULT;
create_info._open_mode = (OPEN_WINDOW_MODE)wparam; create_info._open_mode = (OPEN_WINDOW_MODE)wparam;
@ -1421,7 +1430,9 @@ LRESULT SDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
} }
break; break;
case PM_OPEN_WINDOW: {CONTEXT("SDIMainFrame PM_OPEN_WINDOW"); case PM_OPEN_WINDOW: {
CONTEXT("SDIMainFrame PM_OPEN_WINDOW");
TCHAR buffer[MAX_PATH]; TCHAR buffer[MAX_PATH];
LPCTSTR path; LPCTSTR path;
ShellPath shell_path = DesktopFolderPath(); ShellPath shell_path = DesktopFolderPath();
@ -1449,9 +1460,10 @@ LRESULT SDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
*buffer = '\0'; *buffer = '\0';
path = buffer; path = buffer;
shell_path = path;
} }
jump_to(shell_path, (OPEN_WINDOW_MODE)wparam); jump_to(shell_path, (OPEN_WINDOW_MODE)wparam); //@todo content of 'path' not used any more
return TRUE;} // success return TRUE;} // success
default: def: default: def:

View file

@ -27,7 +27,7 @@
#define PM_OPEN_WINDOW (WM_APP+0x07) #define PM_OPEN_WINDOW (WM_APP+0x07)
enum OPEN_WINDOW_MODE {OWM_EXPLORE=1, OWM_DETAILS=2, OWM_PIDL=4}; enum OPEN_WINDOW_MODE {OWM_EXPLORE=1, OWM_DETAILS=2, OWM_PIDL=4, OWM_SEPARATE=8};
/// Explorer frame window base class /// Explorer frame window base class