From 83adc213d05b7c824515dcc13243c4b907bcb3ed Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 7 Jan 2010 02:58:58 +0000 Subject: [PATCH] 2010-01-06 18:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/ideactions.prg * contrib/hbide/ideprojmanager.prg * contrib/hbide/idestylesheets.prg ! Fixed few more artifacts. ! Recent Files and Projects Menu was growing crazy, was a result of not deleting the menu item in XbpMenu() class. More attention is required yet. ! Fixed Viktor's reported bug. * contrib/hbxbp/xbpmenubar.prg ! Fixed a very bad type, copy/paste syndrome. --- harbour/ChangeLog | 14 +++++++ harbour/contrib/hbide/ideactions.prg | 51 ++++++++++-------------- harbour/contrib/hbide/ideprojmanager.prg | 2 + harbour/contrib/hbide/idestylesheets.prg | 15 ++----- harbour/contrib/hbxbp/xbpmenubar.prg | 4 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a731cd4cf4..5800ee232a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-06 18:57 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/ideactions.prg + * contrib/hbide/ideprojmanager.prg + * contrib/hbide/idestylesheets.prg + ! Fixed few more artifacts. + ! Recent Files and Projects Menu was growing crazy, + was a result of not deleting the menu item in XbpMenu() class. + More attention is required yet. + + ! Fixed Viktor's reported bug. + + * contrib/hbxbp/xbpmenubar.prg + ! Fixed a very bad type, copy/paste syndrome. + 2010-01-06 17:53 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/ideprojmanager.prg ! Small fix to prev. diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index e6b03a0897..0ed10a04c0 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -353,7 +353,7 @@ METHOD IdeActions:buildMainMenu() oSubMenu2 := XbpMenu():new( oSubMenu ):create() oSubMenu2:itemSelected := {| nIndex, cFile | cFile := oIde:aIni[ INI_RECENTPROJECTS, nIndex ], ; - oIde:loadProjectProperties( cFile, .F., .F., .T. ) } + ::oPM:loadProperties( cFile, .F., .F., .T. ) } lEmpty := .T. FOR n := 1 TO Len( oIde:aIni[ INI_RECENTPROJECTS ] ) f := hbide_pathNormalized( oIde:aIni[ INI_RECENTPROJECTS, n ], .F. ) @@ -636,30 +636,21 @@ STATIC FUNCTION mnuNormalizeItem( cCaption ) #define QMF_POPUP 1 STATIC FUNCTION hbide_mnuUpdateMRUpopup( oIde, nType ) - LOCAL oMenuBar - LOCAL lEmpty - LOCAL oItem - LOCAL cFindStr - LOCAL nPos - LOCAL n, c + LOCAL oMenuBar, oItem, cFindStr, nPos, n, c - IF Empty(oIde:oDlg ) + IF Empty( oIde:oDlg ) RETURN NIL ENDIF oMenuBar := oIde:oDlg:MenuBar() - lEmpty := .T. nPos := 0 - cFindStr := IIF( nType == INI_RECENTFILES, 'RECENT FILES', 'RECENT PROJECTS') + cFindStr := iif( nType == INI_RECENTFILES, 'RECENT FILES', 'RECENT PROJECTS' ) FOR n := 1 TO oMenuBar:numItems() - IF oMenuBar:aMenuItems[ n, 1 ] != QMF_POPUP LOOP ENDIF -// msgbox( ToString( oMenuBar:aMenuItems[ n ] )) - oItem := oMenuBar:aMenuItems[ n ] c := Upper( oItem[ 3 ] ) c := StrTran( c, '~', '' ) @@ -677,17 +668,17 @@ STATIC FUNCTION hbide_mnuUpdateMRUpopup( oIde, nType ) oItem[ 4 ]:delAllItems() - FOR n := 1 TO Len( oIde:aIni[ nType ] ) - c := hbide_pathNormalized( oIde:aIni[ nType , n ], .F. ) - lEmpty := .F. + IF !empty( oIde:aIni[ nType ] ) + FOR n := 1 TO Len( oIde:aIni[ nType ] ) + c := hbide_pathNormalized( oIde:aIni[ nType, n ], .F. ) - oItem[ 4 ]:addItem( { _T( '~' + hb_NumToHex( n ) + '. ' + c ) , nil } ) + oItem[ 4 ]:addItem( { _T( '~' + hb_NumToHex( n ) + '. ' + c ), nil } ) - IF !hb_FileExists(c) - oItem[ 4 ]:disableItem( n ) - ENDIF - NEXT - IF lEmpty + IF !hb_FileExists( c ) + oItem[ 4 ]:disableItem( n ) + ENDIF + NEXT + ELSE IF nType == INI_RECENTFILES oItem[ 4 ]:addAction( "** No recent files found **" ) ELSE @@ -695,6 +686,7 @@ STATIC FUNCTION hbide_mnuUpdateMRUpopup( oIde, nType ) ENDIF oItem[ 4 ]:disableItem( 1 ) ENDIF + RETURN nil /*----------------------------------------------------------------------*/ @@ -711,22 +703,23 @@ FUNCTION hbide_mnuAddFileToMRU( oIde, cFileName, nType ) cFileName := hbide_pathNormalized( cFileName ) - nPos := aScan( oIde:aIni[ nType ], {|f| hbide_pathNormalized( f ) == cFileName } ) - - IF nPos > 0 + IF ( nPos := aScan( oIde:aIni[ nType ], {|f| hbide_pathNormalized( f ) == cFileName } ) ) > 0 hb_aDel( oIde:aIni[ nType ], nPos, .T. ) ENDIF - AAdd( oIde:aIni[ nType ], '' ) + ASize( oIde:aIni[ nType ], len( oIde:aIni[ nType ] ) + 1 ) AIns( oIde:aIni[ nType ], 1 ) oIde:aIni[ nType,1 ] := cFileName - IF Len( oIde:aIni[ nType ] ) > 15 - aSize( oIde:aIni[ nType ], 15 ) + IF Len( oIde:aIni[ nType ] ) > 25 + aSize( oIde:aIni[ nType ], 25 ) ENDIF - hbide_mnuUpdateMRUpopup( oIde, nType ) +hbide_dbg( nPos, cFileName ) + IF nPos == 0 + hbide_mnuUpdateMRUpopup( oIde, nType ) + ENDIF RETURN nil /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index fe14288308..612fc5471b 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -483,12 +483,14 @@ METHOD IdeProjManager:setCurrentProject( cProjectName ) IF !empty( cOldProject ) IF !empty( oItem := hbide_findProjTreeItem( ::oIde, cOldProject, "Project Name" ) ) oItem:oWidget:setForeground( 0, QBrush():new( "QColor", QColor():new( 0,0,0 ) ) ) + //oItem:oWidget:setBackground( 0, QBrush():new( "QColor", QColor():new( 255,255,255 ) ) ) ENDIF ENDIF /* Set New Color */ IF !empty( ::cWrkProject ) IF !empty( oItem := hbide_findProjTreeItem( ::oIde, ::cWrkProject, "Project Name" ) ) oItem:oWidget:setForeground( 0, ::qBrushWrkProject ) + //oItem:oWidget:setBackground( 0, ::qBrushWrkProject ) hbide_expandChildren( ::oIde, oItem ) ::oProjTree:oWidget:setCurrentItem( oItem:oWidget ) ENDIF diff --git a/harbour/contrib/hbide/idestylesheets.prg b/harbour/contrib/hbide/idestylesheets.prg index 940f5d3977..e77f08f77d 100644 --- a/harbour/contrib/hbide/idestylesheets.prg +++ b/harbour/contrib/hbide/idestylesheets.prg @@ -170,18 +170,9 @@ FUNCTION GetStyleSheet( cWidget ) aadd( txt_, ' QTreeWidget::item:alternate { ' ) aadd( txt_, ' background: #EEEEEE; ' ) aadd( txt_, ' } ' ) - aadd( txt_, ' QTreeWidget::item:selected { ' ) - aadd( txt_, ' border: 1px solid #6a6ea9; ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' QTreeWidget::item:selected:!active { ' ) - aadd( txt_, ' background: rgba( 255, 127, 127, 255 ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' QTreeWidget::item:selected:active { ' ) - aadd( txt_, ' background: rgba( 127,127,255, 255 ); ' ) - aadd( txt_, ' } ' ) - aadd( txt_, ' QTreeWidget::item:hover { ' ) - aadd( txt_, ' background: rgba( 210,201,210,255 ); ' ) - aadd( txt_, '} ' ) + //aadd( txt_, ' QTreeWidget::item:selected { ' ) + //aadd( txt_, ' border: 1px solid #6a6ea9; ' ) + //aadd( txt_, ' } ' ) CASE cWidget == "QTreeWidget" diff --git a/harbour/contrib/hbxbp/xbpmenubar.prg b/harbour/contrib/hbxbp/xbpmenubar.prg index e7a921270c..b92dce4916 100644 --- a/harbour/contrib/hbxbp/xbpmenubar.prg +++ b/harbour/contrib/hbxbp/xbpmenubar.prg @@ -278,8 +278,8 @@ METHOD xbpMenuBar:delItem( nItemIndex ) //::aMenuItems[ nItemIndex, 4 ]:destroy() ELSE oAction := ::aMenuItems[ nItemIndex, 5 ] - Qt_Events_disConnect( ::pEvents, oAction, "triggered(bool)" ) - Qt_Slots_disConnect( ::pSlots, oAction, "hovered()" ) + Qt_Slots_disConnect( ::pSlots, oAction, "triggered(bool)" ) + Qt_Slots_disConnect( ::pSlots, oAction, "hovered()" ) oAction:pPtr := 0 ENDIF ADEL( ::aMenuItems, nItemIndex )