2012-07-26 09:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/qtgui/hbqtgui.ch
    + Added: QSettings_* and QIODevice_* constants.

  + contrib/hbide/env
  + contrib/hbide/env/pritpalsfav.ide
  + contrib/hbide/settings.qrc
    + Added: new folder containing HbIDE settings embedded as a resource.
       Only one environment is added, quickly, to review its usefulness.
  
  * contrib/hbide/findreplace.prg
    ! Formatting.

  * contrib/hbide/actions.prg
  * contrib/hbide/hbide.hbp
  * contrib/hbide/main.prg
  * contrib/hbide/misc.prg
  * contrib/hbide/saveload.prg
  * contrib/hbide/tools.prg
    + Implemented: Multiple-view of HbIDE's application window.
       The views take care of toolbars associated with mainwindow and 
       all the docking widgets. The view remembers their state and dimensions,
       whether these are visible, floating, etc.

    ; How To:
      1. Click on <Main Toolbar><HbIDE Views> icon.
      2. Opens a FileSave dialog, provide a location and name, 
         your current view will be saved.
      3. Click on <Main Toolbar><HbIDE Views> icon's drop-down menu.
      4. You can see, beside others, an entry <Pritpals Favourite>.
      5. Click on it and see your view is changed instantly.
      6. Repeat #4 and click on the entry representing your view
         saved via #2.
      7. And you are back with your original settings.

        These views are switchable with a click of a key. This also 
        covers a gread demand from users where it is asked that HbIDE 
        should be like, Starter, Advanced, Professional, Enterprised, etc.
        Or where desk-top territory is compalined. For example, activate
        IdeDBU and then make it floatable, adjust windows size to your 
        taste, save this view. Then at single click you can brought it back.
        This is a big productivity boost, believe me.        

      ; REQUEST: send me the useful views you employ in day-to-day needs 
                 and if deemed fit will be included in HbIDE itself for 
                 others to be benefitted.
This commit is contained in:
Pritpal Bedi
2012-07-26 17:16:23 +00:00
parent b977b18a49
commit 76132167a1
11 changed files with 197 additions and 32 deletions

View File

@@ -16,6 +16,53 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-07-26 09:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/qtgui/hbqtgui.ch
+ Added: QSettings_* and QIODevice_* constants.
+ contrib/hbide/env
+ contrib/hbide/env/pritpalsfav.ide
+ contrib/hbide/settings.qrc
+ Added: new folder containing HbIDE settings embedded as a resource.
Only one environment is added, quickly, to review its usefulness.
* contrib/hbide/findreplace.prg
! Formatting.
* contrib/hbide/actions.prg
* contrib/hbide/hbide.hbp
* contrib/hbide/main.prg
* contrib/hbide/misc.prg
* contrib/hbide/saveload.prg
* contrib/hbide/tools.prg
+ Implemented: Multiple-view of HbIDE's application window.
The views take care of toolbars associated with mainwindow and
all the docking widgets. The view remembers their state and dimensions,
whether these are visible, floating, etc.
; How To:
1. Click on <Main Toolbar><HbIDE Views> icon.
2. Opens a FileSave dialog, provide a location and name,
your current view will be saved.
3. Click on <Main Toolbar><HbIDE Views> icon's drop-down menu.
4. You can see, beside others, an entry <Pritpals Favourite>.
5. Click on it and see your view is changed instantly.
6. Repeat #4 and click on the entry representing your view
saved via #2.
7. And you are back with your original settings.
These views are switchable with a click of a key. This also
covers a gread demand from users where it is asked that HbIDE
should be like, Starter, Advanced, Professional, Enterprised, etc.
Or where desk-top territory is compalined. For example, activate
IdeDBU and then make it floatable, adjust windows size to your
taste, save this view. Then at single click you can brought it back.
This is a big productivity boost, believe me.
; REQUEST: send me the useful views you employ in day-to-day needs
and if deemed fit will be included in HbIDE itself for
others to be benefitted.
2012-07-25 11:51 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/lang/fr.c
! old typo in month name, by Guy Roussin

View File

@@ -359,7 +359,9 @@ METHOD IdeActions:buildToolBar()
oTBar:addItem( ::getAction( "TB_RebuildLaunch" ), , , , , , "RebuildLaunch" )
oTBar:addItem( , , , , , nSep )
::oActToolsBtn := oTBar:oWidget:addWidget( ::oIde:oTM:buildToolsButton() )
oTBar:addItem( , , , , , nSep )
::oActToolsBtn := oTBar:oWidget:addWidget( ::oIde:oTM:buildViewsButton() )
oTBar:addItem( , , , , , nSep )
::oIde:oMainToolbar := oTBar
@@ -615,7 +617,6 @@ METHOD IdeActions:buildMainMenu()
hbide_menuAddSep( oSubMenu )
oSubMenu:addItem( { ::getAction( "ChangeLog" ), {|| oIde:execAction( "ChangeLog" ) } } )
hbide_menuAddSep( oSubMenu )
oSubMenu2 := hbide_buildCDPMenu( oIde, oSubMenu ) //hbide_buildCodecMenu( oIde, oSubMenu )
// oSubMenu2:title := "~CodePage"
oSubMenu:addItem( { oSubMenu2, _T( "~CodePage" ) } )

View File

@@ -0,0 +1,2 @@
[General]
hbidesettings="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x3\0\0\0\0\0\0\0\x87\0\0\x2\x9c\xfc\x2\0\0\0\x3\xfb\0\0\0\x1e\0\x64\0o\0\x63\0k\0P\0r\0o\0j\0\x65\0\x63\0t\0T\0r\0\x65\0\x65\x1\0\0\0\x15\0\0\x1\x93\0\0\0]\0\xff\xff\xff\xfb\0\0\0\x1c\0\x64\0o\0\x63\0k\0\x45\0\x64\0i\0t\0o\0r\0T\0\x61\0\x62\0s\x1\0\0\x1\xac\0\0\0\xa4\0\0\0]\0\xff\xff\xff\xfb\0\0\0\x1c\0\x64\0o\0\x63\0k\0S\0k\0l\0t\0n\0s\0T\0r\0\x65\0\x65\x1\0\0\x2T\0\0\0]\0\0\0]\0\xff\xff\xff\0\0\0\x1\0\0\x1\xd5\0\0\x2\x9c\xfc\x1\0\0\0\x2\xfb\0\0\0\x10\0\x64\0o\0\x63\0k\0H\0\x65\0l\0p\0\0\0\x3\x94\0\0\x1\xd5\0\0\0P\0\xff\xff\xff\xfc\0\0\x3u\0\0\x1\xd5\0\0\0\0\0\xff\xff\xff\xfa\xff\xff\xff\xff\x1\0\0\0\xf\xfb\0\0\0\x1a\0\x64\0o\0\x63\0k\0\x44\0o\0\x63\0V\0i\0\x65\0w\0\x65\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\x1\x8e\0\xff\xff\xff\xfb\0\0\0\x18\0\x64\0o\0\x63\0k\0\x46\0u\0n\0\x63\0L\0i\0s\0t\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x1a\0\x64\0o\0\x63\0k\0\x46\0u\0n\0\x63\0t\0i\0o\0n\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x1c\0\x64\0o\0\x63\0k\0P\0r\0o\0p\0\x65\0r\0t\0i\0\x65\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0 \0\x64\0o\0\x63\0k\0\x45\0n\0v\0i\0r\0o\0n\0m\0\x65\0n\0t\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\x1\x6\0\xff\xff\xff\xfb\0\0\0\x18\0\x64\0o\0\x63\0k\0S\0k\0\x65\0l\0\x65\0t\0o\0n\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x14\0\x64\0o\0\x63\0k\0T\0h\0\x65\0m\0\x65\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x1e\0\x64\0o\0\x63\0k\0\x46\0i\0n\0\x64\0I\0n\0\x46\0i\0l\0\x65\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x1a\0\x64\0o\0\x63\0k\0\x44\0o\0\x63\0W\0r\0i\0t\0\x65\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\x1,\0\xff\xff\xff\xfb\0\0\0&\0\x64\0o\0\x63\0k\0S\0o\0u\0r\0\x63\0\x65\0T\0h\0u\0m\0\x62\0n\0\x61\0i\0l\0\0\0\0\0\xff\xff\xff\xff\0\0\0P\0\xff\xff\xff\xfb\0\0\0\x1c\0\x64\0o\0\x63\0k\0Q\0S\0\x63\0i\0n\0t\0i\0l\0l\0\x61\0\0\0\0\0\xff\xff\xff\xff\0\0\0\xb8\0\xff\xff\xff\xfb\0\0\0$\0\x64\0o\0\x63\0k\0R\0\x65\0p\0o\0r\0t\0\x44\0\x65\0s\0i\0g\0n\0\x65\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0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x2\0\0\0\0)"

View File

@@ -5,7 +5,7 @@
/*
* Harbour Project source code:
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* Copyright 2009-2012 Pritpal Bedi <bedipritpal@hotmail.com>
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
@@ -1558,3 +1558,4 @@ STATIC FUNCTION hbide_isSourceOfType( cSource, aFilter )
/*----------------------------------------------------------------------*/

View File

@@ -95,6 +95,7 @@ changelog.ui
projectwizard.ui
hbide.qrc
settings.qrc
-3rd=hbide_file=hbide.ch

View File

@@ -128,6 +128,7 @@ FUNCTION Main( ... )
SET CENTURY ON
QResource():registerResource_1( hbqtres_HbIde() )
QResource():registerResource_1( hbqtres_Settings() )
oTmp := HbIde():new( hb_aParams() )
#if 0

View File

@@ -286,7 +286,7 @@ FUNCTION hbide_getYesNoCancel( cMsg, cInfo, cTitle )
/*----------------------------------------------------------------------*/
FUNCTION hbide_fetchAFile( oWnd, cTitle, aFlt, cDftDir, cDftSuffix, lAllowMulti )
LOCAL oDlg, cFile
LOCAL oDlg
DEFAULT cTitle TO "Please Select a File"
DEFAULT aFlt TO { { "All Files", "*" } }
@@ -302,15 +302,12 @@ FUNCTION hbide_fetchAFile( oWnd, cTitle, aFlt, cDftDir, cDftSuffix, lAllowMulti
oDlg:oWidget:setDefaultSuffix( cDftSuffix )
ENDIF
cFile := oDlg:open( cDftDir, , lAllowMulti )
oDlg:destroy()
RETURN cFile
RETURN oDlg:open( cDftDir, , lAllowMulti )
/*----------------------------------------------------------------------*/
FUNCTION hbide_saveAFile( oWnd, cTitle, aFlt, cDftFile, cDftSuffix )
LOCAL oDlg, cFile
LOCAL oDlg
DEFAULT cTitle TO "Please Select a File"
@@ -323,10 +320,7 @@ FUNCTION hbide_saveAFile( oWnd, cTitle, aFlt, cDftFile, cDftSuffix )
oDlg:oWidget:setDefaultSuffix( cDftSuffix )
ENDIF
cFile := oDlg:saveAs( cDftFile, .f., .t. )
oDlg:destroy()
RETURN cFile
RETURN oDlg:saveAs( cDftFile, .f., .t. )
/*----------------------------------------------------------------------*/
/* Function to user select a existing folder

View File

@@ -66,6 +66,7 @@
#include "hbide.ch"
#include "common.ch"
#include "fileio.ch"
#include "hbclass.ch"
#include "hbqtgui.ch"
@@ -2269,3 +2270,65 @@ METHOD IdeSetup:setBaseColor()
RETURN Self
/*----------------------------------------------------------------------*/
FUNCTION hbide_saveEnvironment( oIde, cFile )
LOCAL cPath, cExt, oSettings
DEFAULT cFile TO "settings.ide"
cFile := lower( cFile )
hb_fNameSplit( cFile, @cPath, @cFile, @cExt )
IF empty( cExt )
cExt := ".ide"
ENDIF
IF lower( cExt ) != ".ide"
RETURN NIL
ENDIF
IF empty( cPath )
cPath := oIde:oINI:getINIPath()
ENDIF
oSettings := QSettings( cPath + cFile + cExt, QSettings_IniFormat )
HB_TRACE( HB_TR_ALWAYS, oSettings:fileName() )
oSettings:setValue( "hbidesettings", QVariant( oIde:oDlg:oWidget:saveState() ) )
RETURN NIL
/*----------------------------------------------------------------------*/
FUNCTION hbide_restEnvironment( oIde, cFile )
LOCAL cPath, cExt, oSettings
DEFAULT cFile TO "settings.ide"
cFile := lower( cFile )
hb_fNameSplit( cFile, @cPath, @cFile, @cExt )
IF empty( cExt )
cExt := ".ide"
ENDIF
IF lower( cExt ) != ".ide"
RETURN NIL
ENDIF
IF empty( cPath )
cPath := oIde:oINI:getINIPath()
ENDIF
oSettings := QSettings( cPath + cFile + cExt, QSettings_IniFormat )
oIde:oDlg:oWidget:restoreState( oSettings:value( "hbidesettings" ):toByteArray() )
RETURN NIL
/*----------------------------------------------------------------------*/
FUNCTION hbide_restEnvironment_byResource( oIde, cFile )
LOCAL oSettings := QSettings( ":/env/" + cFile + ".ide", QSettings_IniFormat )
oIde:oDlg:oWidget:restoreState( oSettings:value( "hbidesettings" ):toByteArray() )
RETURN NIL
/*----------------------------------------------------------------------*/

View File

@@ -0,0 +1,5 @@
<RCC>
<qresource>
<file>env/pritpalsfav.ide</file>
</qresource>
</RCC>

View File

@@ -92,6 +92,7 @@
CLASS IdeToolsManager INHERIT IdeObject
DATA aAct INIT {}
DATA aSetAct INIT {}
DATA qToolsMenu
DATA qToolsButton
DATA qViewsMenu
@@ -105,6 +106,7 @@ CLASS IdeToolsManager INHERIT IdeObject
DATA aBtns INIT {}
DATA aToolbars INIT { NIL,NIL,NIL,NIL,NIL }
DATA aPlugins INIT {}
DATA cSetsFolderLast
ACCESS aTools INLINE ::oINI:aTools
ACCESS aUserToolBars INLINE ::oINI:aUserToolbars
@@ -142,6 +144,8 @@ METHOD IdeToolsManager:new( oIde )
::oIde := oIde
::cSetsFolderLast := oIde:oINI:getINIPath()
RETURN Self
/*----------------------------------------------------------------------*/
@@ -859,21 +863,30 @@ METHOD IdeToolsManager:buildViewsButton()
cPath := ::oINI:getIniPath()
b_:= directory( cPath + "*.ide" )
aSettings := {}
aadd( aSettings, "Browse..." )
aadd( aSettings, "..." )
aadd( aSettings, "Pritpals Favourite" )
aadd( aSettings, "..." )
FOR EACH a_ IN b_
IF ! ( a_[ 1 ] == "settings.ide" .AND. a_[ 1 ] == "tempsettings.ide" )
aadd( aSettings, strtran( a_[ 1 ], ".ide" ) )
IF ! ( a_[ 1 ] == "settings.ide" ) .AND. ! ( a_[ 1 ] == "tempsettings.ide" )
aadd( aSettings, hbide_pathNormalized( cPath + a_[ 1 ] ) )
ENDIF
NEXT
::qViewsMenu := QMenu()
::qViewsMenu:setStyleSheet( GetStyleSheet( "QMenuPop", ::nAnimantionMode ) )
FOR EACH cView IN aSettings
qAct := ::qViewsMenu:addAction( cView )
qAct:connect( "triggered(bool)", hbide_blockView( Self, cView ) )
aadd( ::aAct, qAct )
IF cView == "..."
qAct := ::qViewsMenu:addSeparator()
ELSE
qAct := ::qViewsMenu:addAction( cView )
qAct:connect( "triggered(bool)", hbide_blockView( Self, cView ) )
ENDIF
aadd( ::aSetAct, { qAct, cView } )
NEXT
::qViewsButton := QToolButton()
::qViewsButton:setObjectName( "HbIDE Views" )
::qViewsButton:setTooltip( "HbIDE Views" )
::qViewsButton:setIcon( QIcon( hbide_image( "view_docks" ) ) )
::qViewsButton:setPopupMode( QToolButton_MenuButtonPopup )
@@ -884,25 +897,42 @@ METHOD IdeToolsManager:buildViewsButton()
/*----------------------------------------------------------------------*/
METHOD IdeToolsManager:execView( cView )
HB_SYMBOL_UNUSED( cView )
hbide_restSettings( ::oIde, cView + ".ide" )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeToolsManager:saveView()
LOCAL cView, qAct
cView := lower( trim( hbide_fetchAString( ::oDlg:oWidget, "", "HbIDE View Name", "New View" ) ) )
IF ! empty( cView ) .AND. cView != "settings" .AND. cView != "tempsettings"
cView := strtran( cView, " ", "_" )
hbide_saveSettings( ::oIde, cView + ".ide" )
qAct := ::qViewsMenu:addAction( cView )
qAct:connect( "triggered(bool)", hbide_blockView( Self, cView ) )
aadd( ::aAct, qAct )
cView := hbide_saveAFile( ::oDlg, "Select a HbIDE Settings File", { { "HbIDE Settings", "*.ide" } }, ::cSetsFolderLast, "ide" )
IF ! empty( cView )
::cSetsFolderLast := cView
cView := lower( hbide_pathNormalized( cView ) )
hbide_saveEnvironment( ::oIde, cView )
IF ascan( ::aSetAct, {|e_| e_[ 2 ] == cView } ) == 0
qAct := ::qViewsMenu:addAction( cView )
qAct:connect( "triggered(bool)", hbide_blockView( Self, cView ) )
aadd( ::aAct, { qAct, cView } )
ENDIF
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeToolsManager:execView( cView )
IF cView == "Browse..."
cView := hbide_fetchAFile( ::oDlg, "Select a HbIDE Settings File", { { "HbIDE Settings", "*.ide" } }, ::cSetsFolderLast, "ide", .f. )
IF empty( cView )
RETURN Self
ENDIF
::cSetsFolderLast := cView
hbide_restEnvironment( ::oIde, cView )
ELSEIF cView == "Pritpals Favourite"
hbide_restEnvironment_byResource( ::oIde, "pritpalsfav" )
ELSE
hbide_restEnvironment( ::oIde, cView )
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/

View File

@@ -2396,6 +2396,26 @@
#define QTreeWidgetItem_Type 0 // The default type for tree widget items.
#define QTreeWidgetItem_UserType 1000 // The minimum value for custom types. Values below UserType are reserved by Qt.
#define QSettings_NativeFormat 0 // Store the settings using the most appropriate storage format for the platform. On Windows, this means the system registry; on Mac OS X, this means the CFPreferences API; on Unix, this means textual configuration files in INI format.
#define QSettings_IniFormat 1 // Store the settings in INI files.
#define QSettings_InvalidFormat 16 // Special value returned by registerFormat().
#define QSettings_UserScope 0 // Store settings in a location specific to the current user (e.g., in the user's home directory).
#define QSettings_SystemScope 1 // Store settings in a global location, so that all users on the same machine access the same set of settings.
#define QSettings_NoError 0 // No error occurred.
#define QSettings_AccessError 1 // An access error occurred (e.g. trying to write to a read-only file).
#define QSettings_FormatError 2 // A format error occurred (e.g. loading a malformed INI file).
#define QIODevice_NotOpen 0x0000 // The device is not open.
#define QIODevice_ReadOnly 0x0001 // The device is open for reading.
#define QIODevice_WriteOnly 0x0002 // The device is open for writing.
#define QIODevice_ReadWrite hb_bitOr( QIODevice_ReadOnly, QIODevice_WriteOnly ) // The device is open for reading and writing.
#define QIODevice_Append 0x0004 // The device is opened in append mode, so that all data is written to the end of the file.
#define QIODevice_Truncate 0x0008 // If possible, the device is truncated before it is opened. All earlier contents of the device are lost.
#define QIODevice_Text 0x0010 // When reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32.
#define QIODevice_Unbuffered 0x0020 // Any buffer in the device is bypassed.
/*----------------------------------------------------------------------*/
// HBQT Defined Constants
/*----------------------------------------------------------------------*/