From 58ff79ad40e66eeb6217fd0fc53d8d63e44d653d Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 26 May 2011 04:15:41 +0000 Subject: [PATCH] 2011-05-25 21:13 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/idechangelog.prg % Advanced: more complete. You can play building the current entry. --- harbour/ChangeLog | 4 ++ harbour/contrib/hbide/idechangelog.prg | 59 +++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2a7024c4d7..4146a3622d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-25 21:13 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/idechangelog.prg + % Advanced: more complete. You can play building the current entry. + 2011-05-25 21:00 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + contrib/hbide/changelog.ui + Added: miss from prev commit. diff --git a/harbour/contrib/hbide/idechangelog.prg b/harbour/contrib/hbide/idechangelog.prg index 9acfbbf2aa..ef251602a2 100644 --- a/harbour/contrib/hbide/idechangelog.prg +++ b/harbour/contrib/hbide/idechangelog.prg @@ -73,11 +73,14 @@ CLASS IdeChangeLog INHERIT IdeObject + DATA aLog INIT {} + METHOD new( oIde ) METHOD create( oIde ) METHOD destroy() METHOD show() METHOD execEvent( cEvent, p ) + METHOD refresh() ENDCLASS @@ -122,7 +125,11 @@ METHOD IdeChangeLog:show() ::oUI:q_buttonChangelog :setIcon( hbide_image( "dc_folder" ) ) ::oUI:q_buttonAddSrc :setIcon( hbide_image( "dc_plus" ) ) - ::oUI:q_buttonChangelog :connect( "clicked()", {|| ::execEvent( "buttonChangelog_clicked" ) } ) + ::oUI:q_buttonChangelog :connect( "clicked()", {|| ::execEvent( "buttonChangelog_clicked" ) } ) + ::oUI:q_buttonAddSrc :connect( "clicked()", {|| ::execEvent( "buttonAddSrc_clicked" ) } ) + ::oUI:q_buttonDone :connect( "clicked()", {|| ::execEvent( "buttonDone_clicked" ) } ) + ::oUI:q_buttonRefresh :connect( "clicked()", {|| ::execEvent( "buttonRefresh_clicked" ) } ) + ::oUI:q_buttonSave :connect( "clicked()", {|| ::execEvent( "buttonSave_clicked" ) } ) ENDIF @@ -133,19 +140,37 @@ METHOD IdeChangeLog:show() /*----------------------------------------------------------------------*/ METHOD IdeChangeLog:execEvent( cEvent, p ) - LOCAL cPath + LOCAL cTmp HB_SYMBOL_UNUSED( p ) SWITCH cEvent + CASE "buttonSave_clicked" + EXIT + CASE "buttonRefresh_clicked" + ::refresh() + EXIT + CASE "buttonDone_clicked" + IF !empty( cTmp := ::oUI:q_plainCurrentLog:toPlainText() ) + aadd( ::aLog, { "Desc", cTmp, "" } ) + ::refresh() + ENDIF + EXIT + CASE "buttonAddSrc_clicked" + IF !empty( cTmp := ::oUI:q_editSource:text() ) + aadd( ::aLog, { "Source", cTmp, "" } ) + ::refresh() + ENDIF + EXIT CASE "buttonChangelog_clicked" - cPath := hbide_fetchAFile( ::oDlg, "Select a ChangeLog File" ) - IF !empty( cPath ) - ::oUI:q_editChangelog:setText( cPath ) + cTmp := hbide_fetchAFile( ::oDlg, "Select a ChangeLog File" ) + IF !empty( cTmp ) + ::oUI:q_editChangelog:setText( cTmp ) ::oUI:q_plainChangelog:clear() - ::oUI:q_plainChangelog:setPlainText( memoread( cPath ) ) + ::oUI:q_plainChangelog:setPlainText( memoread( cTmp ) ) + ::refresh() ENDIF EXIT @@ -155,3 +180,25 @@ METHOD IdeChangeLog:execEvent( cEvent, p ) /*----------------------------------------------------------------------*/ +METHOD IdeChangeLog:refresh() + LOCAL s := "", a_ + + ::oUI:q_plainLogEntry:clear() + + s := "$<" + strzero( 1, 6 ) + "> " + dtos( date() ) + " " + time() + " Harbour " + + FOR EACH a_ IN ::aLog + IF a_[ 1 ] == "Source" + s += hb_eol() + " * " + a_[ 2 ] + + ELSEIF a_[ 1 ] == "Desc" + s += hb_eol() + " ! " + a_[ 2 ] + + ENDIF + NEXT + + ::oUI:q_plainLogEntry:setPlainText( s ) + + RETURN Self + +/*----------------------------------------------------------------------*/