View Issue Details

IDProjectCategoryView StatusLast Update
0001589WishesPanel.Panel Modespublic2013-02-03 00:33
ReporterMaximus Assigned ToDrKnS  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Platformx86OSWindowsOS VersionXP SP2
Product Version2.0 
Fixed in Version3.0 
Summary0001589: Отображать в колонке панели расширение файла или "Align file extensions"
DescriptionИмя файла сейчас можно показать только так: N[M,O,R]
Что неудобно, когда имена достаточно длинные и различаются только расширениями - чтобы увидеть это расширение нужно или долго и нудно прокручивать панели, либо менять режим так, чтобы расширение "влезло". Последнее прокатит, только если ширина консольного окна таки больше длины имени...

Что предлагается: добавить новый тип "E", который отображает только расширение без точки и только для файлов (для папок "расширение" как таковое не используется).
Опционально, добавить модификатор, отключащий отображение расширения для имени файла, например N[N] - это чтобы не было дублирования информации.

Сейчас в фаре можно выровнять расширения по правому краю, но это не спасает в описанном случае, когда имена действительно длинные.

А "Align file extensions" для длинных имен сейчас фактически не работает. То есть для длинных имен файлов расширение хорошоб бы прилеплять к правому краю, а по центру (перед расширением) показывать метку, что строка не влезла.
TagsNo tags attached.
Build2139

Activities

samlyukov

2010-11-13 04:58

reporter  

ext_c0.zip (5,055 bytes)

samlyukov

2010-11-13 05:00

reporter   bugnote:0005977

Last edited: 2010-11-13 05:35

вот тебе плагин для C0 - отображает расширение, с сорцами, можно допиливать под свои нужды :)

upd. собрал в 10 студии, забыл отцепить MSVCR100.dll

samlyukov

2011-08-07 05:56

reporter   bugnote:0007411

дубль, http://bugs.farmanager.com/view.php?id=536

Maximus

2011-08-07 11:33

reporter   bugnote:0007418

Ну, собственно, колонка "X" в bis сборках давно уже есть. Только вот нет отзывов ) То есть никому не надо?

DrKnS

2011-08-07 11:38

administrator   bugnote:0007419

А патч где?

Maximus

2011-08-07 11:55

reporter   bugnote:0007421

Патч был выложен здесь
http://bugs.farmanager.com/view.php?id=1492
но был проигнорирован?

DrKnS

2011-08-07 12:01

administrator   bugnote:0007422

Не надо сваливать всё в одну кучу.

Maximus

2011-08-07 12:15

reporter   bugnote:0007423

в strmix.hpp под

enum
{
    COLUMN_MARK = 0x80000000,
    ...

уже скоро место закончится :)
Как лучше сделать?

enum
{
    COLUMN_MARK = 0x8000000000000000LL,

или

typedef unsigned __int64 FILEPANEL_COLUMN_MODES;
static const FILEPANEL_COLUMN_MODES
    COLUMN_MARK = 0x8000000000000000LL,

DrKnS

2011-08-07 12:22

administrator   bugnote:0007424

Второе, 64-битные enum'ы не поддерживаются.

Maximus

2011-08-07 19:29

reporter   bugnote:0007425

1. Флаги переделаны в 64битные
2. Для колонки N добавлено: "NN" - без расширений, и "NRF" - альтернативное выравнивание по правому краю
3. Добавлена колонка X - расширение файлов.

Maximus

2011-08-07 19:29

reporter  

ColumnTypes.110807.diff (30,567 bytes)   
Index: panelctype.hpp
===================================================================
--- panelctype.hpp	(revision 6532)
+++ panelctype.hpp	(working copy)
@@ -58,7 +58,8 @@
 	CUSTOM_COLUMN6,
 	CUSTOM_COLUMN7,
 	CUSTOM_COLUMN8,
-	CUSTOM_COLUMN9
+	CUSTOM_COLUMN9,
+	EXTENSION_COLUMN
 };
 
 enum {
Index: panelmix.hpp
===================================================================
--- panelmix.hpp	(revision 6532)
+++ panelmix.hpp	(working copy)
@@ -41,10 +41,9 @@
 int _MakePath1(DWORD Key,string &strPathName, const wchar_t *Param2,int ShortNameAsIs=TRUE);
 
 const string FormatStr_Attribute(DWORD FileAttributes,int Width=-1);
-const string FormatStr_DateTime(const FILETIME *FileTime,int ColumnType,DWORD Flags,int Width);
-const string FormatStr_Size(__int64 UnpSize, __int64 PackSize, __int64 StreamsSize, const string& strName,DWORD FileAttributes,DWORD ShowFolderSize,DWORD ReparseTag,int ColumnType,DWORD Flags,int Width);
-void TextToViewSettings(const wchar_t *ColumnTitles,const wchar_t *ColumnWidths,
-						unsigned int *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int &ColumnCount);
-void ViewSettingsToText(unsigned int *ViewColumnTypes,
-						int *ViewColumnWidths,int *ViewColumnWidthsTypes,int ColumnCount,string &strColumnTitles,
-						string &strColumnWidths);
+const string FormatStr_DateTime(const FILETIME *FileTime,int ColumnType,unsigned __int64 Flags,int Width);
+const string FormatStr_Size(__int64 UnpSize, __int64 PackSize, __int64 StreamsSize, const string& strName,DWORD FileAttributes,DWORD ShowFolderSize,DWORD ReparseTag,int ColumnType,unsigned __int64 Flags,int Width);
+void TextToViewSettings(const wchar_t *ColumnTitles,const wchar_t *ColumnWidths,bool StatusLine,
+						unsigned __int64 *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int &ColumnCount);
+void ViewSettingsToText(unsigned __int64 *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int ColumnCount,
+						bool StatusLine,string &strColumnTitles,string &strColumnWidths);
Index: strmix.hpp
===================================================================
--- strmix.hpp	(revision 6532)
+++ strmix.hpp	(working copy)
@@ -35,25 +35,27 @@
 
 #include "plugin.hpp"
 
-enum
-{
-	COLUMN_MARK           = 0x80000000,
-	COLUMN_NAMEONLY       = 0x40000000,
-	COLUMN_RIGHTALIGN     = 0x20000000,
-	COLUMN_FORMATTED      = 0x10000000,
-	COLUMN_COMMAS         = 0x08000000,
-	COLUMN_THOUSAND       = 0x04000000,
-	COLUMN_BRIEF          = 0x02000000,
-	COLUMN_MONTH          = 0x01000000,
-	COLUMN_FLOATSIZE      = 0x00800000,
-	COLUMN_ECONOMIC       = 0x00400000,
-	COLUMN_MINSIZEINDEX   = 0x00200000,
-	COLUMN_SHOWBYTESINDEX = 0x00100000,
-	COLUMN_FULLOWNER      = 0x00080000,
+typedef unsigned __int64 FILEPANEL_COLUMN_MODES;
+static const FILEPANEL_COLUMN_MODES
+	COLUMN_MARK              = 0x8000000000000000LL,
+	COLUMN_NAMEONLY          = 0x4000000000000000LL,
+	COLUMN_RIGHTALIGN        = 0x2000000000000000LL,
+	COLUMN_FORMATTED         = 0x1000000000000000LL,
+	COLUMN_COMMAS            = 0x0800000000000000LL,
+	COLUMN_THOUSAND          = 0x0400000000000000LL,
+	COLUMN_BRIEF             = 0x0200000000000000LL,
+	COLUMN_MONTH             = 0x0100000000000000LL,
+	COLUMN_FLOATSIZE         = 0x0080000000000000LL,
+	COLUMN_ECONOMIC          = 0x0040000000000000LL,
+	COLUMN_MINSIZEINDEX      = 0x0020000000000000LL,
+	COLUMN_SHOWBYTESINDEX    = 0x0010000000000000LL,
+	COLUMN_FULLOWNER         = 0x0008000000000000LL,
+	COLUMN_NOEXTENSION       = 0x0004000000000000LL,
+	COLUMN_CENTERALIGN       = 0x0002000000000000LL,
+	COLUMN_RIGHTALIGNFORCE   = 0x0001000000000000LL,
 
 	//MINSIZEINDEX ����� �� ����� 0, 1, 2 ��� 3 (K,M,G,T)
-	COLUMN_MINSIZEINDEX_MASK = 0x00000003,
-};
+	COLUMN_MINSIZEINDEX_MASK = 0x0000000000000003LL;
 
 wchar_t* WINAPI QuoteSpace(wchar_t *Str);
 string &QuoteSpace(string &strStr);
@@ -83,7 +85,7 @@
 string& WINAPI FarFormatText(const wchar_t *SrcText, int Width, string &strDestText, const wchar_t* Break, DWORD Flags);
 
 void PrepareUnitStr();
-string& __stdcall FileSizeToStr(string &strDestStr, unsigned __int64 Size, int Width=-1, int ViewFlags=COLUMN_COMMAS);
+string& __stdcall FileSizeToStr(string &strDestStr, unsigned __int64 Size, int Width=-1, unsigned __int64 ViewFlags=COLUMN_COMMAS);
 bool CheckFileSizeStringFormat(const wchar_t *FileSizeStr);
 unsigned __int64 ConvertFileSizeString(const wchar_t *FileSizeStr);
 string &FormatNumber(const wchar_t *Src, string &strDest, int NumDigits=0);
Index: strmix.cpp
===================================================================
--- strmix.cpp	(revision 6532)
+++ strmix.cpp	(working copy)
@@ -628,7 +628,7 @@
 	}
 }
 
-string & WINAPI FileSizeToStr(string &strDestStr, unsigned __int64 Size, int Width, int ViewFlags)
+string & WINAPI FileSizeToStr(string &strDestStr, unsigned __int64 Size, int Width, unsigned __int64 ViewFlags)
 {
 	FormatString strStr;
 	unsigned __int64 Divider;
@@ -640,12 +640,12 @@
 		PrepareUnitStr();
 	}
 
-	int Commas=(ViewFlags & COLUMN_COMMAS);
-	int FloatSize=(ViewFlags & COLUMN_FLOATSIZE);
-	int Economic=(ViewFlags & COLUMN_ECONOMIC);
-	int UseMinSizeIndex=(ViewFlags & COLUMN_MINSIZEINDEX);
-	int MinSizeIndex=(ViewFlags & COLUMN_MINSIZEINDEX_MASK)+1;
-	int ShowBytesIndex=(ViewFlags & COLUMN_SHOWBYTESINDEX);
+	unsigned __int64 Commas=(ViewFlags & COLUMN_COMMAS);
+	unsigned __int64 FloatSize=(ViewFlags & COLUMN_FLOATSIZE);
+	unsigned __int64 Economic=(ViewFlags & COLUMN_ECONOMIC);
+	unsigned __int64 UseMinSizeIndex=(ViewFlags & COLUMN_MINSIZEINDEX);
+	unsigned __int64 MinSizeIndex=(ViewFlags & COLUMN_MINSIZEINDEX_MASK)+1;
+	unsigned __int64 ShowBytesIndex=(ViewFlags & COLUMN_SHOWBYTESINDEX);
 
 	if (ViewFlags & COLUMN_THOUSAND)
 	{
Index: panel.hpp
===================================================================
--- panel.hpp	(revision 6532)
+++ panel.hpp	(working copy)
@@ -40,10 +40,10 @@
 
 struct PanelViewSettings
 {
-	unsigned int ColumnType[PANEL_COLUMNCOUNT];
+	unsigned __int64 ColumnType[PANEL_COLUMNCOUNT];
 	int ColumnWidth[PANEL_COLUMNCOUNT];
 	int ColumnCount;
-	unsigned int StatusColumnType[PANEL_COLUMNCOUNT];
+	unsigned __int64 StatusColumnType[PANEL_COLUMNCOUNT];
 	int StatusColumnWidth[PANEL_COLUMNCOUNT];
 	int StatusColumnCount;
 	DWORD Flags;
Index: flmodes.cpp
===================================================================
--- flmodes.cpp	(revision 6532)
+++ flmodes.cpp	(working copy)
@@ -163,9 +163,9 @@
 		ModeDlg[MD_CHECKBOX_FILESLOWERCASE].Selected=(NewSettings.Flags&PVS_FILELOWERCASE)?1:0;
 		ModeDlg[MD_CHECKBOX_UPPERTOLOWERCASE].Selected=(NewSettings.Flags&PVS_FILEUPPERTOLOWERCASE)?1:0;
 		ViewSettingsToText(NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType,
-		                   NewSettings.ColumnCount,ModeDlg[2].strData,ModeDlg[4].strData);
+		                   NewSettings.ColumnCount,false,ModeDlg[2].strData,ModeDlg[4].strData);
 		ViewSettingsToText(NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,
-		                   NewSettings.StatusColumnCount,ModeDlg[6].strData,ModeDlg[8].strData);
+		                   NewSettings.StatusColumnCount,true,ModeDlg[6].strData,ModeDlg[8].strData);
 		{
 			Dialog Dlg(ModeDlg,ARRAYSIZE(ModeDlg));
 			Dlg.SetPosition(-1,-1,76,17);
@@ -190,9 +190,9 @@
 			NewSettings.Flags|=PVS_FILELOWERCASE;
 		if (ModeDlg[MD_CHECKBOX_UPPERTOLOWERCASE].Selected)
 			NewSettings.Flags|=PVS_FILEUPPERTOLOWERCASE;
-		TextToViewSettings(ModeDlg[MD_EDITTYPES].strData,ModeDlg[MD_EDITWIDTHS].strData,NewSettings.ColumnType,
+		TextToViewSettings(ModeDlg[MD_EDITTYPES].strData,ModeDlg[MD_EDITWIDTHS].strData,false,NewSettings.ColumnType,
 		                   NewSettings.ColumnWidth,NewSettings.ColumnWidthType,NewSettings.ColumnCount);
-		TextToViewSettings(ModeDlg[MD_EDITSTATUSTYPES].strData,ModeDlg[MD_EDITSTATUSWIDTHS].strData,NewSettings.StatusColumnType,
+		TextToViewSettings(ModeDlg[MD_EDITSTATUSTYPES].strData,ModeDlg[MD_EDITSTATUSWIDTHS].strData,true,NewSettings.StatusColumnType,
 		                   NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,NewSettings.StatusColumnCount);
 		ViewSettingsArray[ModeNumber]=NewSettings;
 		CtrlObject->Cp()->LeftPanel->SortFileList(TRUE);
@@ -240,11 +240,11 @@
 		PanelViewSettings NewSettings=ViewSettingsArray[VIEW_0+I];
 
 		if (!strColumnTitles.IsEmpty())
-			TextToViewSettings(strColumnTitles,strColumnWidths,NewSettings.ColumnType,
+			TextToViewSettings(strColumnTitles,strColumnWidths,false,NewSettings.ColumnType,
 			                   NewSettings.ColumnWidth,NewSettings.ColumnWidthType,NewSettings.ColumnCount);
 
 		if (!strStatusColumnTitles.IsEmpty())
-			TextToViewSettings(strStatusColumnTitles,strStatusColumnWidths,NewSettings.StatusColumnType,
+			TextToViewSettings(strStatusColumnTitles,strStatusColumnWidths,true,NewSettings.StatusColumnType,
 			                   NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,NewSettings.StatusColumnCount);
 
 		NewSettings.Flags = (DWORD)Flags;
@@ -267,9 +267,9 @@
 
 		PanelViewSettings NewSettings=ViewSettingsArray[VIEW_0+I];
 		ViewSettingsToText(NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType,
-		                   NewSettings.ColumnCount,strColumnTitles,strColumnWidths);
+		                   NewSettings.ColumnCount,false,strColumnTitles,strColumnWidths);
 		ViewSettingsToText(NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,
-		                   NewSettings.StatusColumnCount,strStatusColumnTitles,strStatusColumnWidths);
+		                   NewSettings.StatusColumnCount,true,strStatusColumnTitles,strStatusColumnWidths);
 
 		FormatString strMode;
 		strMode<<I;
Index: filelist.hpp
===================================================================
--- filelist.hpp	(revision 6532)
+++ filelist.hpp	(working copy)
@@ -238,7 +238,7 @@
 		const FarColor GetShowColor(int Position, int ColorType);
 		void ShowSelectedSize();
 		void ShowTotalSize(OpenPanelInfo &Info);
-		int ConvertName(const wchar_t *SrcName, string &strDest, int MaxLength, int RightAlign, int ShowStatus, DWORD dwFileAttr);
+		int ConvertName(const wchar_t *SrcName, string &strDest, int MaxLength, unsigned __int64 RightAlign, int ShowStatus, DWORD dwFileAttr);
 
 		void Select(FileListItem *SelPtr,int Selection);
 		long SelectFiles(int Mode,const wchar_t *Mask=nullptr);
@@ -275,7 +275,7 @@
 		void DeletePluginItemList(PluginPanelItem *(&ItemList),int &ItemNumber);
 		HANDLE OpenPluginForFile(const wchar_t *FileName,DWORD FileAttr, OPENFILEPLUGINTYPE Type);
 		int PreparePanelView(PanelViewSettings *PanelView);
-		int PrepareColumnWidths(unsigned int *ColumnTypes,int *ColumnWidths,int *ColumnWidthsTypes,int &ColumnCount,bool FullScreen);
+		int PrepareColumnWidths(unsigned __int64 *ColumnTypes,int *ColumnWidths,int *ColumnWidthsTypes,int &ColumnCount,bool FullScreen,bool StatusLine);
 		void PrepareViewSettings(int ViewMode,OpenPanelInfo *PlugInfo);
 
 		void PluginDelete();
Index: flshow.cpp
===================================================================
--- flshow.cpp	(revision 6532)
+++ flshow.cpp	(working copy)
@@ -149,6 +149,9 @@
 				case NAME_COLUMN:
 					IDMessage=MColumnName;
 					break;
+				case EXTENSION_COLUMN:
+					IDMessage=MColumnExtension;
+					break;
 				case SIZE_COLUMN:
 					IDMessage=MColumnSize;
 					break;
@@ -562,17 +565,20 @@
 	}
 }
 
-int FileList::ConvertName(const wchar_t *SrcName,string &strDest,int MaxLength,int RightAlign,int ShowStatus,DWORD FileAttr)
+int FileList::ConvertName(const wchar_t *SrcName,string &strDest,int MaxLength,unsigned __int64 RightAlign,int ShowStatus,DWORD FileAttr)
 {
 	wchar_t *lpwszDest = strDest.GetBuffer(MaxLength+1);
 	wmemset(lpwszDest,L' ',MaxLength);
 	int SrcLength=StrLength(SrcName);
 
-	if (RightAlign && SrcLength>MaxLength)
+	if ((RightAlign & COLUMN_RIGHTALIGNFORCE) || (RightAlign && (SrcLength>MaxLength)))
 	{
-		wmemcpy(lpwszDest,SrcName+SrcLength-MaxLength,MaxLength);
+		if (SrcLength>MaxLength)
+			wmemcpy(lpwszDest,SrcName+SrcLength-MaxLength,MaxLength);
+		else
+			wmemcpy(lpwszDest+MaxLength-SrcLength,SrcName,SrcLength);
 		strDest.ReleaseBuffer(MaxLength);
-		return TRUE;
+		return (SrcLength>MaxLength);
 	}
 
 	const wchar_t *DotPtr;
@@ -629,7 +635,7 @@
 		{
 			TextToViewSettings(Info.PanelModesArray[ViewMode].ColumnTypes,
 			                   Info.PanelModesArray[ViewMode].ColumnWidths,
-			                   ViewSettings.ColumnType,ViewSettings.ColumnWidth,
+			                   false,ViewSettings.ColumnType,ViewSettings.ColumnWidth,
 			                   ViewSettings.ColumnWidthType,ViewSettings.ColumnCount);
 
 			if (Info.PanelModesArray[ViewMode].StatusColumnTypes &&
@@ -637,7 +643,7 @@
 			{
 				TextToViewSettings(Info.PanelModesArray[ViewMode].StatusColumnTypes,
 				                   Info.PanelModesArray[ViewMode].StatusColumnWidths,
-				                   ViewSettings.StatusColumnType,ViewSettings.StatusColumnWidth,
+				                   true,ViewSettings.StatusColumnType,ViewSettings.StatusColumnWidth,
 				                   ViewSettings.StatusColumnWidthType,ViewSettings.StatusColumnCount);
 			}
 			else if (Info.PanelModesArray[ViewMode].Flags&PMFLAGS_DETAILEDSTATUS)
@@ -705,13 +711,13 @@
 int FileList::PreparePanelView(PanelViewSettings *PanelView)
 {
 	PrepareColumnWidths(PanelView->StatusColumnType,PanelView->StatusColumnWidth,PanelView->StatusColumnWidthType,
-	                    PanelView->StatusColumnCount,(PanelView->Flags&PVS_FULLSCREEN)==PVS_FULLSCREEN);
+	                    PanelView->StatusColumnCount,(PanelView->Flags&PVS_FULLSCREEN)==PVS_FULLSCREEN,true);
 	return(PrepareColumnWidths(PanelView->ColumnType,PanelView->ColumnWidth,PanelView->ColumnWidthType,
-	                           PanelView->ColumnCount,(PanelView->Flags&PVS_FULLSCREEN)==PVS_FULLSCREEN));
+	                           PanelView->ColumnCount,(PanelView->Flags&PVS_FULLSCREEN)==PVS_FULLSCREEN,false));
 }
 
 
-int FileList::PrepareColumnWidths(unsigned int *ColumnTypes, int *ColumnWidths, int *ColumnWidthsTypes, int &ColumnCount, bool FullScreen)
+int FileList::PrepareColumnWidths(unsigned __int64 *ColumnTypes, int *ColumnWidths, int *ColumnWidthsTypes, int &ColumnCount, bool FullScreen, bool StatusLine)
 {
 	int TotalWidth,TotalPercentWidth,TotalPercentCount,ZeroLengthCount,EmptyColumns,I;
 	ZeroLengthCount=EmptyColumns=0;
@@ -869,6 +875,8 @@
 	int StatusShown=FALSE;
 	int MaxLeftPos=0,MinLeftPos=FALSE;
 	int ColumnCount=ShowStatus ? ViewSettings.StatusColumnCount:ViewSettings.ColumnCount;
+	unsigned __int64 *ColumnTypes=ShowStatus ? ViewSettings.StatusColumnType:ViewSettings.ColumnType;
+	int *ColumnWidths=ShowStatus ? ViewSettings.StatusColumnWidth:ViewSettings.ColumnWidth;
 
 	for (int I=Y1+1+Opt.ShowColumnTitles,J=CurTopFile; I<Y2-2*Opt.ShowPanelStatus; I++,J++)
 	{
@@ -906,9 +914,7 @@
 			int CurX=WhereX();
 			int CurY=WhereY();
 			int ShowDivider=TRUE;
-			unsigned int *ColumnTypes=ShowStatus ? ViewSettings.StatusColumnType:ViewSettings.ColumnType;
-			int *ColumnWidths=ShowStatus ? ViewSettings.StatusColumnWidth:ViewSettings.ColumnWidth;
-			int ColumnType=ColumnTypes[K] & 0xff;
+			int ColumnType=static_cast<int>(ColumnTypes[K] & 0xff);
 			int ColumnWidth=ColumnWidths[K];
 
 			if (ColumnWidth<0)
@@ -945,7 +951,9 @@
 						ColumnData=ListData[ListPos]->CustomColumnData[ColumnNumber];
 
 					if (!ColumnData)
+					{
 						ColumnData=ListData[ListPos]->strCustomData;//L"";
+					}
 
 					int CurLeftPos=0;
 
@@ -974,7 +982,7 @@
 						case NAME_COLUMN:
 						{
 							int Width=ColumnWidth;
-							int ViewFlags=ColumnTypes[K];
+							unsigned __int64 ViewFlags=ColumnTypes[K];
 
 							if ((ViewFlags & COLUMN_MARK) && Width>2)
 							{
@@ -996,6 +1004,17 @@
 							}
 
 							const wchar_t *NamePtr = ShowShortNames && !ListData[ListPos]->strShortName.IsEmpty() && !ShowStatus ? ListData[ListPos]->strShortName:ListData[ListPos]->strName;
+							
+							string strNameCopy;
+							if (!(ListData[ListPos]->FileAttr & FILE_ATTRIBUTE_DIRECTORY) && (ViewFlags & COLUMN_NOEXTENSION))
+							{
+								const wchar_t *ExtPtr = PointToExt(NamePtr);
+								if (ExtPtr)
+								{
+									strNameCopy.Copy(NamePtr, ExtPtr-NamePtr);
+									NamePtr = strNameCopy;
+								}
+							}
 
 							const wchar_t *NameCopy = NamePtr;
 
@@ -1008,7 +1027,7 @@
 							}
 
 							int CurLeftPos=0;
-							int RightAlign=(ViewFlags & COLUMN_RIGHTALIGN);
+							unsigned __int64 RightAlign=(ViewFlags & (COLUMN_RIGHTALIGN|COLUMN_RIGHTALIGNFORCE));
 							int LeftBracket=FALSE,RightBracket=FALSE;
 
 							if (!ShowStatus && LeftPos)
@@ -1037,9 +1056,14 @@
 										int CurRightPos=LeftPos;
 
 										if (Length+CurRightPos<Width)
+										{
 											CurRightPos=Width-Length;
+										}
 										else
+										{
 											RightBracket=TRUE;
+											LeftBracket=(ViewFlags & COLUMN_RIGHTALIGNFORCE)==COLUMN_RIGHTALIGNFORCE;
+										}
 
 										NamePtr += Length+CurRightPos-Width;
 										RightAlign=FALSE;
@@ -1079,10 +1103,12 @@
 							}
 
 							Text(strName);
-							int NameX=WhereX();
 
+
 							if (!ShowStatus)
 							{
+								int NameX=WhereX();
+								
 								if (LeftBracket)
 								{
 									GotoXY(CurX-1,CurY);
@@ -1111,6 +1137,40 @@
 							}
 						}
 						break;
+						case EXTENSION_COLUMN:
+						{
+							const wchar_t *ExtPtr = nullptr;
+							if (!(ListData[ListPos]->FileAttr & FILE_ATTRIBUTE_DIRECTORY))
+							{
+								const wchar_t *NamePtr = ShowShortNames && !ListData[ListPos]->strShortName.IsEmpty() && !ShowStatus ? ListData[ListPos]->strShortName:ListData[ListPos]->strName;
+								ExtPtr = PointToExt(NamePtr);
+							}
+							if (ExtPtr && *ExtPtr) ExtPtr++; else ExtPtr = L"";
+
+							int ExtLen = (int)wcslen(ExtPtr);
+							bool TooLong = ExtLen > ColumnWidth;
+
+							FS<<fmt::LeftAlign()<<fmt::Width(ColumnWidth)<<fmt::Precision(ColumnWidth)<<ExtPtr;
+
+							if (!ShowStatus && TooLong)
+							{
+								int NameX=WhereX();
+								
+								if (Level == ColumnsInGlobal)
+									SetColor(COL_PANELBOX);
+
+								GotoXY(NameX,CurY);
+								Text(closeBracket);
+								ShowDivider=FALSE;
+
+								if (Level == ColumnsInGlobal)
+									SetColor(COL_PANELTEXT);
+								else
+									SetShowColor(J);
+							}
+							break;
+						}
+						break;
 						case SIZE_COLUMN:
 						case PACKED_COLUMN:
 						case STREAMSSIZE_COLUMN:
Index: flplugin.cpp
===================================================================
--- flplugin.cpp	(revision 6532)
+++ flplugin.cpp	(working copy)
@@ -1096,7 +1096,7 @@
 void FileList::PluginGetColumnTypesAndWidths(string& strColumnTypes,string& strColumnWidths)
 {
 	ViewSettingsToText(ViewSettings.ColumnType,ViewSettings.ColumnWidth,ViewSettings.ColumnWidthType,
-	                   ViewSettings.ColumnCount,strColumnTypes,strColumnWidths);
+	                   ViewSettings.ColumnCount,false,strColumnTypes,strColumnWidths);
 }
 
 void FileList::PluginBeginSelection()
Index: FarEng.hlf.m4
===================================================================
--- FarEng.hlf.m4	(revision 6532)
+++ FarEng.hlf.m4	(working copy)
@@ -3411,14 +3411,18 @@
   - #Column types# - column types are encoded as one or several
 characters, delimited with commas. Allowed column types are:
 
-    N[M,O,R]   - file name
+    N[M,O,R,F,N] - file name
                  where: M - show selection marks;
                         O - show names without paths
                             (intended mainly for plugins);
                         R - right aligned names;
+                        F - for use with R, alternative align mode;
+                        N - do not show extensions in name column;
                  These modifiers may be used in combination,
                  for example NMR
 
+    X          - file extension
+
     S[C,T,F,E] - file size
     P[C,T,F,E] - packed file size
     G[C,T,F,E] - size of file streams
Index: FarRus.hlf.m4
===================================================================
--- FarRus.hlf.m4	(revision 6532)
+++ FarRus.hlf.m4	(working copy)
@@ -3481,13 +3481,17 @@
 или нескольких букв, разделённых запятыми. Допускаются следующие
 типы колонок:
 
-    N[M,O,R]   - имя файла
+    N[M,O,R,F,N] - имя файла
                  где: M - показывать символы пометки;
                       O - показывать имена без путей (предназначено
                           в основном для ~плагинов~@Plugins@);
                       R - выравнивать имена по правому краю;
+                      F - вместе с R включает альтернативный режим выравнивания;
+                      N - не отображать расширения файлов;
                  Эти символы можно комбинировать, например NMR
 
+    X          - расширение файла
+
     S[C,T,F,E] - размер файла
     P[C,T,F,E] - упакованный размер файла
     G[C,T,F,E] - размер потоков файла
Index: farlang.templ.m4
===================================================================
--- farlang.templ.m4	(revision 6532)
+++ farlang.templ.m4	(working copy)
@@ -6486,6 +6486,15 @@
 "Nazwa"
 "Nombre"
 
+MColumnExtension
+"Расширение"
+"Extension"
+upd:"Extension"
+upd:"Extension"
+upd:"Extension"
+upd:"Extension"
+upd:"Extension"
+
 MColumnSize
 "Размер"
 "Size"
Index: findfile.cpp
===================================================================
--- findfile.cpp	(revision 6532)
+++ findfile.cpp	(working copy)
@@ -828,7 +828,7 @@
 			if (Opt.FindOpt.strSearchOutFormatWidth.IsEmpty())
 				Opt.FindOpt.strSearchOutFormatWidth=L"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
 
-			TextToViewSettings(Opt.FindOpt.strSearchOutFormat.CPtr(),Opt.FindOpt.strSearchOutFormatWidth.CPtr(),
+			TextToViewSettings(Opt.FindOpt.strSearchOutFormat.CPtr(),Opt.FindOpt.strSearchOutFormatWidth.CPtr(),false,
                                   Opt.FindOpt.OutColumnTypes,Opt.FindOpt.OutColumnWidths,Opt.FindOpt.OutColumnWidthType,
                                   Opt.FindOpt.OutColumnCount);
         }
@@ -2208,7 +2208,7 @@
 	string strDateStr, strTimeStr;
 	const wchar_t *DisplayName=FindData.strFileName;
 
-	unsigned int *ColumnType=Opt.FindOpt.OutColumnTypes;
+	unsigned __int64 *ColumnType=Opt.FindOpt.OutColumnTypes;
 	int *ColumnWidth=Opt.FindOpt.OutColumnWidths;
 	int ColumnCount=Opt.FindOpt.OutColumnCount;
 	//int *ColumnWidthType=Opt.FindOpt.OutColumnWidthType;
@@ -2217,7 +2217,7 @@
 
 	for (int Count=0; Count < ColumnCount; ++Count)
 	{
-		unsigned int CurColumnType = ColumnType[Count] & 0xFF;
+		int CurColumnType = static_cast<int>(ColumnType[Count] & 0xFF);
 
 		switch (CurColumnType)
 		{
Index: panelmix.cpp
===================================================================
--- panelmix.cpp	(revision 6532)
+++ panelmix.cpp	(working copy)
@@ -48,9 +48,9 @@
 #include "lang.hpp"
 #include "datetime.hpp"
 
-int ColumnTypeWidth[]={0, 6, 6, 8, 5, 14, 14, 14, 14, 6, 0, 0, 3, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+int ColumnTypeWidth[]={0, 6, 6, 8, 5, 14, 14, 14, 14, 6, 0, 0, 3, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
-static const wchar_t *ColumnSymbol[]={L"N",L"S",L"P",L"D",L"T",L"DM",L"DC",L"DA",L"DE",L"A",L"Z",L"O",L"LN",L"F",L"G",L"C0",L"C1",L"C2",L"C3",L"C4",L"C5",L"C6",L"C7",L"C8",L"C9"};
+static const wchar_t *ColumnSymbol[]={L"N",L"S",L"P",L"D",L"T",L"DM",L"DC",L"DA",L"DE",L"A",L"Z",L"O",L"LN",L"F",L"G",L"C0",L"C1",L"C2",L"C3",L"C4",L"C5",L"C6",L"C7",L"C8",L"C9",L"X"};
 
 
 void ShellUpdatePanels(Panel *SrcPanel,BOOL NeedSetUpADir)
@@ -261,8 +261,8 @@
 }
 
 
-void TextToViewSettings(const wchar_t *ColumnTitles,const wchar_t *ColumnWidths,
-                                  unsigned int *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int &ColumnCount)
+void TextToViewSettings(const wchar_t *ColumnTitles,const wchar_t *ColumnWidths,bool StatusLine,
+						unsigned __int64 *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int &ColumnCount)
 {
 	const wchar_t *TextPtr=ColumnTitles;
 
@@ -277,7 +277,7 @@
 
 		if (strArgName.At(0)==L'N')
 		{
-			unsigned int &ColumnType=ViewColumnTypes[ColumnCount];
+			unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
 			ColumnType=NAME_COLUMN;
 			const wchar_t *Ptr = strArgName.CPtr()+1;
 
@@ -294,6 +294,12 @@
 					case L'R':
 						ColumnType|=COLUMN_RIGHTALIGN;
 						break;
+					case L'F':
+						ColumnType|=COLUMN_RIGHTALIGNFORCE;
+						break;
+					case L'N':
+						ColumnType|=COLUMN_NOEXTENSION;
+						break;
 				}
 
 				Ptr++;
@@ -303,7 +309,7 @@
 		{
 			if (strArgName.At(0)==L'S' || strArgName.At(0)==L'P' || strArgName.At(0)==L'G')
 			{
-				unsigned int &ColumnType=ViewColumnTypes[ColumnCount];
+				unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
 				ColumnType=(strArgName.At(0)==L'S') ? SIZE_COLUMN:(strArgName.At(0)==L'P')?PACKED_COLUMN:STREAMSSIZE_COLUMN;
 				const wchar_t *Ptr = strArgName.CPtr()+1;
 
@@ -332,7 +338,7 @@
 			{
 				if (!StrCmpN(strArgName,L"DM",2) || !StrCmpN(strArgName,L"DC",2) || !StrCmpN(strArgName,L"DA",2) || !StrCmpN(strArgName,L"DE",2))
 				{
-					unsigned int &ColumnType=ViewColumnTypes[ColumnCount];
+					unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
 
 					switch (strArgName.At(1))
 					{
@@ -371,7 +377,7 @@
 				{
 					if (strArgName.At(0)==L'O')
 					{
-						unsigned int &ColumnType=ViewColumnTypes[ColumnCount];
+						unsigned __int64 &ColumnType=ViewColumnTypes[ColumnCount];
 						ColumnType=OWNER_COLUMN;
 
 						if (strArgName.At(1)==L'L')
@@ -418,9 +424,8 @@
 }
 
 
-void ViewSettingsToText(unsigned int *ViewColumnTypes,int *ViewColumnWidths,
-                                  int *ViewColumnWidthsTypes,int ColumnCount,string &strColumnTitles,
-                                  string &strColumnWidths)
+void ViewSettingsToText(unsigned __int64 *ViewColumnTypes,int *ViewColumnWidths,int *ViewColumnWidthsTypes,int ColumnCount,
+						bool StatusLine,string &strColumnTitles,string &strColumnWidths)
 {
 	strColumnTitles.Clear();
 	strColumnWidths.Clear();
@@ -428,7 +433,7 @@
 	for (int I=0; I<ColumnCount; I++)
 	{
 		string strType;
-		int ColumnType=ViewColumnTypes[I] & 0xff;
+		int ColumnType=static_cast<int>(ViewColumnTypes[I] & 0xff);
 		strType = ColumnSymbol[ColumnType];
 
 		if (ColumnType==NAME_COLUMN)
@@ -440,7 +445,14 @@
 				strType += L"O";
 
 			if (ViewColumnTypes[I] & COLUMN_RIGHTALIGN)
+			{
 				strType += L"R";
+				if (ViewColumnTypes[I] & COLUMN_RIGHTALIGNFORCE)
+					strType += L"F";
+			}
+
+			if (ViewColumnTypes[I] & COLUMN_NOEXTENSION)
+				strType += L"N";
 		}
 
 		if (ColumnType==SIZE_COLUMN || ColumnType==PACKED_COLUMN || ColumnType==STREAMSSIZE_COLUMN)
@@ -521,7 +533,7 @@
 	return strResult;
 }
 
-const string FormatStr_DateTime(const FILETIME *FileTime,int ColumnType,DWORD Flags,int Width)
+const string FormatStr_DateTime(const FILETIME *FileTime,int ColumnType,unsigned __int64 Flags,int Width)
 {
 	FormatString strResult;
 
@@ -534,8 +546,8 @@
 	}
 
 	int ColumnWidth=Width;
-	int Brief=Flags & COLUMN_BRIEF;
-	int TextMonth=Flags & COLUMN_MONTH;
+	unsigned __int64 Brief=Flags & COLUMN_BRIEF;
+	unsigned __int64 TextMonth=Flags & COLUMN_MONTH;
 	int FullYear=FALSE;
 
 	switch(ColumnType)
@@ -589,7 +601,7 @@
 	return strResult;
 }
 
-const string FormatStr_Size(__int64 UnpSize, __int64 PackSize, __int64 StreamsSize, const string& strName,DWORD FileAttributes,DWORD ShowFolderSize,DWORD ReparseTag,int ColumnType,DWORD Flags,int Width)
+const string FormatStr_Size(__int64 UnpSize, __int64 PackSize, __int64 StreamsSize, const string& strName,DWORD FileAttributes,DWORD ShowFolderSize,DWORD ReparseTag,int ColumnType,unsigned __int64 Flags,int Width)
 {
 	FormatString strResult;
 
Index: config.cpp
===================================================================
--- config.cpp	(revision 6532)
+++ config.cpp	(working copy)
@@ -1023,7 +1023,7 @@
 	{
 		if (Opt.FindOpt.strSearchOutFormatWidth.IsEmpty())
 			Opt.FindOpt.strSearchOutFormatWidth=L"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
-		TextToViewSettings(Opt.FindOpt.strSearchOutFormat.CPtr(),Opt.FindOpt.strSearchOutFormatWidth.CPtr(),
+		TextToViewSettings(Opt.FindOpt.strSearchOutFormat.CPtr(),Opt.FindOpt.strSearchOutFormatWidth.CPtr(),false,
                                   Opt.FindOpt.OutColumnTypes,Opt.FindOpt.OutColumnWidths,Opt.FindOpt.OutColumnWidthType,
                                   Opt.FindOpt.OutColumnCount);
 	}
Index: config.hpp
===================================================================
--- config.hpp	(revision 6532)
+++ config.hpp	(working copy)
@@ -402,7 +402,7 @@
 	string strSearchOutFormat;
 	string strSearchOutFormatWidth;
 	int OutColumnCount;
-	unsigned int OutColumnTypes[20];
+	unsigned __int64 OutColumnTypes[20];
 	int OutColumnWidths[20];
 	int OutColumnWidthType[20];
 };
Index: filelist.cpp
===================================================================
--- filelist.cpp	(revision 6532)
+++ filelist.cpp	(working copy)
@@ -3131,7 +3131,7 @@
 		string strColumnTypes,strColumnWidths;
 //    SetScreenPosition();
 		ViewSettingsToText(ViewSettings.ColumnType,ViewSettings.ColumnWidth,ViewSettings.ColumnWidthType,
-		                   ViewSettings.ColumnCount,strColumnTypes,strColumnWidths);
+		                   ViewSettings.ColumnCount,false,strColumnTypes,strColumnWidths);
 		ProcessPluginEvent(FE_CHANGEVIEWMODE,(void*)strColumnTypes.CPtr());
 	}
 
ColumnTypes.110807.diff (30,567 bytes)   

DrKnS

2011-08-08 09:45

administrator   bugnote:0007427

2139.

Issue History

Date Modified Username Field Change
2010-11-11 09:05 Maximus New Issue
2010-11-13 04:58 samlyukov File Added: ext_c0.zip
2010-11-13 05:00 samlyukov Note Added: 0005977
2010-11-13 05:35 samlyukov Note Edited: 0005977
2011-08-07 05:56 samlyukov Note Added: 0007411
2011-08-07 11:33 Maximus Note Added: 0007418
2011-08-07 11:38 DrKnS Note Added: 0007419
2011-08-07 11:55 Maximus Note Added: 0007421
2011-08-07 12:01 DrKnS Note Added: 0007422
2011-08-07 12:15 Maximus Note Added: 0007423
2011-08-07 12:22 DrKnS Note Added: 0007424
2011-08-07 19:29 Maximus Note Added: 0007425
2011-08-07 19:29 Maximus File Added: ColumnTypes.110807.diff
2011-08-08 09:45 DrKnS Build => 2139
2011-08-08 09:45 DrKnS Note Added: 0007427
2011-08-08 09:45 DrKnS Status new => closed
2011-08-08 09:45 DrKnS Assigned To => DrKnS
2011-08-08 09:45 DrKnS Resolution open => fixed
2011-08-08 09:45 DrKnS Fixed in Version => 3.0
2013-02-03 00:33 alexy Severity minor => feature