diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 02f3bd1f25..e7444b14df 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-25 09:09 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + + contrib/hbide/resources/harbour_splash.png + + * contrib/hbide/resources/themesex.ui + * contrib/hbide/resources/themesex.uic + + * contrib/hbide/hbide.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/ideobject.prg + * contrib/hbide/idesaveload.prg + * contrib/hbide/idethemes.prg + + + Splash screen popping up at the startup before main + window is displayed. Your comments are welcome. + + ! Enabled menu options which were accidentally got disabled some + time back, do not remember - why. + + ! Themes: centralized "Set as Default" option in "Images" dialog. + Removed from menu option. + + ! Some more rationalizations. + 2010-02-25 16:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbziparc/hbziparc.prg ! Fixed HB_ZIPFILE() not working properly with a password set. diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 9edb1db287..d148b681ca 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -164,7 +164,6 @@ CLASS HbIde DATA qBrushWrkProject DATA qProcess DATA qHelpBrw - DATA qTBarSlctns DATA qTBarLines DATA qTBarPanels DATA qTBarDocks @@ -303,6 +302,16 @@ METHOD HbIde:new( cProjIni ) /*----------------------------------------------------------------------*/ METHOD HbIde:create( cProjIni ) + #if 1 + LOCAL qPixmap, qSplash, nStart + + qPixmap := QPixmap():new( hb_dirBase() + "resources" + hb_osPathSeparator() + "harbour_splash.png" ) + qSplash := QSplashScreen():new() + qSplash:setWindowFlags( hb_bitOr( Qt_WindowStaysOnTopHint, qSplash:windowFlags() ) ) + qSplash:setPixmap( qPixmap ) + qSplash:show() + QApplication():processEvents() + #endif DEFAULT cProjIni TO ::cProjIni ::cProjIni := cProjIni @@ -412,7 +421,15 @@ METHOD HbIde:create( cProjIni ) /* Request Main Window to Appear on the Screen */ ::oDlg:Show() - testPaths() + nStart := seconds() + DO WHILE .t. + QApplication():processEvents() + IF seconds()-nStart > 5 + qSplash:close() + qSplash := NIL + EXIT + ENDIF + ENDDO DO WHILE .t. ::nEvent := AppEvent( @::mp1, @::mp2, @::oXbp ) @@ -468,6 +485,9 @@ METHOD HbIde:create( cProjIni ) ::oXbp:handleEvent( ::nEvent, ::mp1, ::mp2 ) ENDDO + DO WHILE qSplash != NIL + ENDDO + /* Very important - destroy resources */ hbide_dbg( "======================================================" ) hbide_dbg( "Before ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) @@ -512,6 +532,7 @@ METHOD HbIde:execAction( cKey ) CASE "Properties" CASE "SelectProject" CASE "CloseProject" + ::execProjectAction( cKey ) EXIT CASE "New" CASE "Open" diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 8aea7becb6..46f8a69134 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -572,19 +572,22 @@ METHOD IdeActions:buildMainMenu() /*----------------------------------------------------------------------------*/ oSubMenu := XbpMenu():new( oMenuBar ):create() oSubMenu:title := "~Setup" - oSubMenu:addItem( { ::getAction( "DefaultTheme" ), {|| oIde:oThemes:setWrkTheme() } } ) - hbide_menuAddSep( oSubMenu ) oSubMenu2 := hbide_buildCodecMenu( oIde, oSubMenu ) oSubMenu2:title := "~Codecs" oSubMenu:addItem( { oSubMenu2, NIL } ) oMenuBar:addItem( { oSubMenu, NIL } ) /*----------------------------------------------------------------------------*/ - /* Docks */ + /* View */ /*----------------------------------------------------------------------------*/ oSubMenu := XbpMenu():new( oMenuBar ):create() - oSubMenu:title := "~Docks" + oSubMenu:title := "~View" oMenuBar:addItem( { oSubMenu, NIL } ) + + oSubMenu:oWidget:addAction_4( ::qTBarPanels:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::qTBarLines:toggleViewAction() ) + oSubMenu:oWidget:addAction_4( ::qTBarDocks:toggleViewAction() ) + oSubMenu:oWidget:addSeparator() oSubMenu:oWidget:addAction_4( ::oHelpDock:oWidget:toggleViewAction() ) oSubMenu:oWidget:addAction_4( ::oDocViewDock:oWidget:toggleViewAction() ) oSubMenu:oWidget:addSeparator() diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index d283230eac..c3c3057402 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -328,7 +328,7 @@ METHOD IdeDocks:buildDialog() ( aSize[ 2 ] - ::oDlg:currentSize()[ 2 ] ) / 2 } ) ::oIde:setPosAndSizeByIni( ::oDlg:oWidget, MainWindowGeometry ) - ::oDlg:Show() + //::oDlg:Show() /* StatusBar */ ::buildStatusBar() @@ -504,6 +504,7 @@ METHOD IdeDocks:buildToolBarPanels() ::oIde:qTBarPanels := QToolBar():new() ::qTBarPanels:setObjectName( "ToolBar_Panels" ) + ::qTBarPanels:setWindowTitle( "ToolBar: Editor Panels" ) ::qTBarPanels:setAllowedAreas( Qt_LeftToolBarArea ) ::qTBarPanels:setOrientation( Qt_Vertical ) ::qTBarPanels:setIconSize( qSize ) @@ -522,6 +523,7 @@ METHOD IdeDocks:buildToolBarPanels() ::oIde:qTBarLines := QToolBar():new() ::qTBarLines:setObjectName( "ToolBar_Lines" ) + ::qTBarLines:setWindowTitle( "ToolBar: Lines and Blocks" ) ::qTBarLines:setAllowedAreas( Qt_LeftToolBarArea ) ::qTBarLines:setOrientation( Qt_Vertical ) ::qTBarLines:setIconSize( qSize ) @@ -579,6 +581,7 @@ METHOD IdeDocks:buildToolBarPanels() /* Right-hand docks toolbar */ ::oIde:qTBarDocks := QToolBar():new() ::qTBarDocks:setObjectName( "ToolBar_Docks" ) + ::qTBarDocks:setWindowTitle( "ToolBar: Dockable Widgets" ) ::qTBarDocks:setAllowedAreas( Qt_RightToolBarArea ) ::qTBarDocks:setOrientation( Qt_Vertical ) ::qTBarDocks:setIconSize( QSize():new( 16,16 ) ) diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index b5420d7f8c..ee2e7e4ead 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -113,7 +113,6 @@ CLASS IdeObject ACCESS qViewsCombo INLINE ::oIde:qViewsCombo ACCESS qHelpBrw INLINE ::oIde:qHelpBrw - ACCESS qTBarSlctns INLINE ::oIde:qTBarSlctns ACCESS qTBarLines INLINE ::oIde:qTBarLines ACCESS qTBarPanels INLINE ::oIde:qTBarPanels ACCESS qTBarDocks INLINE ::oIde:qTBarDocks diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index 744d238765..16cf6771d5 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -81,7 +81,7 @@ FUNCTION hbide_saveINI( oIde ) aadd( txt_, "ProjectTreeVisible = " + IIF( oIde:lProjTreeVisible, "YES", "NO" ) ) * aadd( txt_, "ProjectTreeGeometry = " + hbide_posAndSize( oIde:oProjTree:oWidget ) ) aadd( txt_, "FunctionListVisible = " + IIF( oIde:lDockRVisible, "YES", "NO" ) ) - aadd( txt_, "FunctionListGeometry = " + hbide_posAndSize( oIde:oFuncList:oWidget ) ) + * aadd( txt_, "FunctionListGeometry = " + hbide_posAndSize( oIde:oFuncList:oWidget ) ) aadd( txt_, "RecentTabIndex = " + hb_ntos( oIde:qTabWidget:currentIndex() ) ) aadd( txt_, "CurrentProject = " + oIde:cWrkProject ) aadd( txt_, "GotoDialogGeometry = " + oIde:aIni[ INI_HBIDE, GotoDialogGeometry ] ) diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index ffbaf2efab..3e0d13ba58 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -80,6 +80,9 @@ #define THM_NUM_ATTRBS 6 +#define applyMenu_triggered_applyToCurrentTab 1 +#define applyMenu_triggered_setAsDefault 2 + /*----------------------------------------------------------------------*/ FUNCTION hbide_loadThemes( oIde ) @@ -104,12 +107,13 @@ CLASS IdeThemes INHERIT IdeObject VAR aControls INIT {} VAR aItems INIT {} VAR aPatterns INIT {} - + VAR aApplyAct INIT {} VAR nCurTheme INIT 1 VAR nCurItem INIT 1 VAR qEdit VAR qHiliter + VAR qMenuApply VAR lCreating INIT .f. @@ -120,6 +124,7 @@ CLASS IdeThemes INHERIT IdeObject METHOD contains( cTheme ) METHOD load( cFile ) METHOD save( lAsk ) + METHOD execEvent( nMode, p ) METHOD getThemeAttribute( cAttr, cTheme ) METHOD buildSyntaxFormat( aAttr ) METHOD setForeBackGround( qEdit, cTheme ) @@ -211,8 +216,16 @@ METHOD IdeThemes:create( oIde, cIniFile ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:destroy() + LOCAL qAct IF !empty( ::oThemes ) + FOR EACH qAct IN ::aApplyAct + ::disconnect( qAct, "triggered(bool)" ) + qAct := NIL + NEXT + ::qMenuApply := NIL + ::aApplyAct := NIL + ::oUI:destroy() ENDIF @@ -220,6 +233,26 @@ METHOD IdeThemes:destroy() /*----------------------------------------------------------------------*/ +METHOD IdeThemes:execEvent( nMode, p ) + LOCAL oEditor + + HB_SYMBOL_UNUSED( p ) + + DO CASE + CASE nMode == applyMenu_triggered_applyToCurrentTab + IF !empty( oEditor := ::oEM:getEditorCurrent() ) + oEditor:applyTheme( ::aThemes[ ::nCurTheme, 1 ] ) + ENDIF + + CASE nMode == applyMenu_triggered_setAsDefault + ::setWrkTheme( ::aThemes[ ::nCurTheme, 1 ] ) + + ENDCASE + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeThemes:setWrkTheme( cTheme ) IF empty( cTheme ) @@ -409,6 +442,7 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:show() + LOCAL qAct IF empty( ::oUI ) ::lCreating := .t. @@ -430,8 +464,7 @@ METHOD IdeThemes:show() ::oUI:signal( "checkBold" , "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_BOLD , i ) } ) ::oUI:signal( "checkUnderline", "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_ULINE , i ) } ) - ::oUI:signal( "buttonClose" , "clicked()", ; - {|| ::oIde:aIni[ INI_HBIDE, ThemesDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ), ::oThemesDock:hide() } ) + ::oUI:signal( "buttonClose" , "clicked()" , {|| ::oThemesDock:hide() } ) * ::oIde:setPosAndSizeByIni( ::oUI:oWidget, ThemesDialogGeometry ) @@ -451,6 +484,25 @@ METHOD IdeThemes:show() ::oUI:qObj[ "buttonClose" ]:setText( GetKeyValue( ::aControls, "buttonClose" , "Close" ) ) ::oUI:qObj[ "buttonCopy" ]:setText( GetKeyValue( ::aControls, "buttonCopy" , "Copy" ) ) + ::qMenuApply := QMenu():new() + // + qAct := QAction():new( ::qMenuApply ) + qAct:setText( "Apply to Current Tab" ) + ::connect( qAct, "triggered(bool)", {|| ::execEvent( applyMenu_triggered_applyToCurrentTab ) } ) + ::qMenuApply:addAction_4( qAct ) + aadd( ::aApplyAct, qAct ) + // + ::qMenuApply:addSeparator() + // + qAct := QAction():new( ::qMenuApply ) + qAct:setText( "Set as Default" ) + ::connect( qAct, "triggered(bool)", {|| ::execEvent( applyMenu_triggered_setAsDefault ) } ) + ::qMenuApply:addAction_4( qAct ) + ::qMenuApply:addAction_4( qAct ) + aadd( ::aApplyAct, qAct ) + // + ::oUI:q_buttonApply:setMenu( ::qMenuApply ) + aeval( ::aThemes, {|e_| ::oUI:qObj[ "comboThemes" ]:addItem( e_[ 1 ] ) } ) aeval( ::aItems , {|e_| ::oUI:qObj[ "comboItems" ]:addItem( e_[ 2 ] ) } ) diff --git a/harbour/contrib/hbide/resources/harbour_splash.png b/harbour/contrib/hbide/resources/harbour_splash.png new file mode 100644 index 0000000000..94d92132b0 Binary files /dev/null and b/harbour/contrib/hbide/resources/harbour_splash.png differ diff --git a/harbour/contrib/hbide/resources/themesex.ui b/harbour/contrib/hbide/resources/themesex.ui index b048ee8cee..e65b960a20 100644 --- a/harbour/contrib/hbide/resources/themesex.ui +++ b/harbour/contrib/hbide/resources/themesex.ui @@ -182,7 +182,7 @@ - Apply + Action diff --git a/harbour/contrib/hbide/resources/themesex.uic b/harbour/contrib/hbide/resources/themesex.uic index 60343e0e26..1d0bb37796 100644 --- a/harbour/contrib/hbide/resources/themesex.uic +++ b/harbour/contrib/hbide/resources/themesex.uic @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading ui file 'themesex.ui' ** -** Created: Wed Feb 24 16:25:25 2010 +** Created: Wed Feb 24 21:34:08 2010 ** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! @@ -211,7 +211,7 @@ public: buttonSave->setText(QApplication::translate("FormThemesEx", "Save", 0, QApplication::UnicodeUTF8)); buttonSaveAs->setText(QApplication::translate("FormThemesEx", "Save As", 0, QApplication::UnicodeUTF8)); buttonCopy->setText(QApplication::translate("FormThemesEx", "Copy", 0, QApplication::UnicodeUTF8)); - buttonApply->setText(QApplication::translate("FormThemesEx", "Apply", 0, QApplication::UnicodeUTF8)); + buttonApply->setText(QApplication::translate("FormThemesEx", "Action", 0, QApplication::UnicodeUTF8)); buttonClose->setText(QApplication::translate("FormThemesEx", "Close", 0, QApplication::UnicodeUTF8)); Q_UNUSED(FormThemesEx); } // retranslateUi