Changeset 2227
- Timestamp:
- 08/24/08 22:26:58 (3 months ago)
- Location:
- v2/branches/dev
- Files:
-
- 2 added
- 26 modified
-
monkey/sdk/xupmanager.h (modified) (1 diff)
-
monkey/src/consolemanager/pCommand.h (modified) (4 diffs)
-
monkey/src/pluginsmanager/XUPPlugin.h (modified) (1 diff)
-
monkey/src/templatesmanager/pTemplatesManager.cpp (modified) (1 diff)
-
monkey/src/templatesmanager/ui/UITemplatesWizard.cpp (modified) (1 diff)
-
monkey/src/workspace/pFileManager.cpp (modified) (2 diffs)
-
monkey/src/workspace/pFileManager.h (modified) (3 diffs)
-
monkey/src/workspace/pWorkspace.cpp (modified) (3 diffs)
-
monkey/src/workspace/pWorkspace.h (modified) (2 diffs)
-
monkey/src/xupmanager/FilteredProjectItemModel.h (modified) (2 diffs)
-
monkey/src/xupmanager/ProjectItemModel.cpp (modified) (2 diffs)
-
monkey/src/xupmanager/ProjectItemModel.h (modified) (2 diffs)
-
monkey/src/xupmanager/XUPItem.cpp (modified) (6 diffs)
-
monkey/src/xupmanager/XUPItem.h (modified) (4 diffs)
-
monkey/src/xupmanager/XUPProjectItem.cpp (added)
-
monkey/src/xupmanager/XUPProjectItem.h (added)
-
monkey/src/xupmanager/ui/UIXUPManager.cpp (modified) (22 diffs)
-
monkey/src/xupmanager/ui/UIXUPManager.h (modified) (3 diffs)
-
monkey/src/xupmanager/ui/UIXUPProjectEditor.cpp (modified) (2 diffs)
-
monkey/src/xupmanager/ui/UIXUPProjectEditor.h (modified) (2 diffs)
-
monkey/src/xupmanager/xupmanager.pri (modified) (2 diffs)
-
plugins/xup/QMakeProjectEditor/src/QMakeProjectEditor.cpp (modified) (1 diff)
-
plugins/xup/QMakeProjectEditor/src/QMakeProjectEditor.h (modified) (2 diffs)
-
plugins/xup/QMakeProjectEditor/src/QMakeProjectEditorDialog.cpp (modified) (2 diffs)
-
plugins/xup/QMakeProjectEditor/src/QMakeProjectEditorDialog.h (modified) (2 diffs)
-
plugins/xup/QMakeProjectEditor/src/QMakeXUPItem.cpp (modified) (4 diffs)
-
plugins/xup/QMakeProjectEditor/src/QMakeXUPItem.h (modified) (1 diff)
-
plugins/xup/xup.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v2/branches/dev/monkey/sdk/xupmanager.h
r1727 r2227 1 1 #include "../src/xupmanager/XUPIO.h" 2 2 #include "../src/xupmanager/XUPItem.h" 3 #include "../src/xupmanager/XUPProjectItem.h" 3 4 #include "../src/xupmanager/ProjectItemModel.h" 4 5 #include "../src/xupmanager/ScopedProjectItemModel.h" -
v2/branches/dev/monkey/src/consolemanager/pCommand.h
r2216 r2227 40 40 #include <QStringList> 41 41 42 class XUP Item;42 class XUPProjectItem; 43 43 44 44 /*! … … 89 89 bool tryAllParsers() const { return mTryAllParsers; } 90 90 QVariant userData() const { return mUserData; } 91 XUP Item* project() const { return mProject; }91 XUPProjectItem* project() const { return mProject; } 92 92 93 93 void setText( const QString& s ) { mText = s; } … … 101 101 void setTryAllParsers( bool b ) { mTryAllParsers = b; } 102 102 void setUserData( const QVariant& data ) { mUserData = data; } 103 void setProject( XUP Item* project ) { mProject = project; }103 void setProject( XUPProjectItem* project ) { mProject = project; } 104 104 105 105 QString toString() const … … 130 130 bool mTryAllParsers; /**< Try to use all availible parsers after parsers from list */ 131 131 QVariant mUserData; /**< Ask PasNox, hot to use it */ 132 XUP Item* mProject; /**< Project, for which command is executing */132 XUPProjectItem* mProject; /**< Project, for which command is executing */ 133 133 }; 134 134 -
v2/branches/dev/monkey/src/pluginsmanager/XUPPlugin.h
r2142 r2227 4 4 #include "BasePlugin.h" 5 5 6 class XUP Item;6 class XUPProjectItem; 7 7 8 8 class Q_MONKEY_EXPORT XUPPlugin : public BasePlugin 9 9 { 10 10 public: 11 virtual bool editProject( XUP Item* project ) = 0;11 virtual bool editProject( XUPProjectItem* project ) = 0; 12 12 }; 13 13 -
v2/branches/dev/monkey/src/templatesmanager/pTemplatesManager.cpp
r2178 r2227 38 38 #include "../workspace/pFileManager.h" 39 39 #include "../xupmanager/XUPItem.h" 40 #include "../xupmanager/XUPProjectItem.h" 40 41 #include "../coremanager/MonkeyCore.h" 41 42 #include "../settingsmanager/Settings.h" -
v2/branches/dev/monkey/src/templatesmanager/ui/UITemplatesWizard.cpp
r1900 r2227 36 36 #include "../../xupmanager/ScopedProjectItemModel.h" 37 37 #include "../../xupmanager/XUPItem.h" 38 #include "../../xupmanager/XUPProjectItem.h" 38 39 #include "../../xupmanager/ui/UIXUPManager.h" 39 40 #include "../../variablesmanager/VariablesManager.h" -
v2/branches/dev/monkey/src/workspace/pFileManager.cpp
r1729 r2227 30 30 #include "pWorkspace.h" 31 31 #include "../xupmanager/ui/UIXUPManager.h" 32 #include "../xupmanager/XUP Item.h"32 #include "../xupmanager/XUPProjectItem.h" 33 33 #include "pAbstractChild.h" 34 34 #include "../coremanager/MonkeyCore.h" … … 42 42 connect( MonkeyCore::workspace(), SIGNAL( currentFileChanged( pAbstractChild*, const QString& ) ), this, SIGNAL( currentFileChanged( pAbstractChild*, const QString& ) ) ); 43 43 // projects 44 connect( MonkeyCore::projectsManager(), SIGNAL( projectAboutToClose( XUP Item* ) ), this, SIGNAL( aboutToClose( XUPItem* ) ) );45 connect( MonkeyCore::projectsManager(), SIGNAL( projectClosed( XUP Item* ) ), this, SIGNAL( closed( XUPItem* ) ) );46 connect( MonkeyCore::projectsManager(), SIGNAL( projectModifiedChanged( XUP Item*, bool ) ), this, SIGNAL( modifiedChanged( XUPItem*, bool ) ) );47 connect( MonkeyCore::projectsManager(), SIGNAL( currentProjectChanged( XUP Item* ) ), this, SIGNAL( currentChanged( XUPItem* ) ) );48 connect( MonkeyCore::projectsManager(), SIGNAL( projectOpen( XUP Item* ) ), this, SIGNAL( opened( XUPItem* ) ) );44 connect( MonkeyCore::projectsManager(), SIGNAL( projectAboutToClose( XUPProjectItem* ) ), this, SIGNAL( aboutToClose( XUPProjectItem* ) ) ); 45 connect( MonkeyCore::projectsManager(), SIGNAL( projectClosed( XUPProjectItem* ) ), this, SIGNAL( closed( XUPProjectItem* ) ) ); 46 connect( MonkeyCore::projectsManager(), SIGNAL( projectModifiedChanged( XUPProjectItem*, bool ) ), this, SIGNAL( modifiedChanged( XUPProjectItem*, bool ) ) ); 47 connect( MonkeyCore::projectsManager(), SIGNAL( currentProjectChanged( XUPProjectItem* ) ), this, SIGNAL( currentChanged( XUPProjectItem* ) ) ); 48 connect( MonkeyCore::projectsManager(), SIGNAL( projectOpen( XUPProjectItem* ) ), this, SIGNAL( opened( XUPProjectItem* ) ) ); 49 49 } 50 50 51 XUP Item* pFileManager::currentProject() const51 XUPProjectItem* pFileManager::currentProject() const 52 52 { return MonkeyCore::projectsManager()->currentProject(); } 53 53 -
v2/branches/dev/monkey/src/workspace/pFileManager.h
r1729 r2227 36 36 37 37 class pAbstractChild; 38 class XUPProjectItem; 38 39 class XUPItem; 39 40 … … 45 46 46 47 public: 47 XUP Item* currentProject() const;48 XUPProjectItem* currentProject() const; 48 49 QString currentProjectFile() const; 49 50 QString currentProjectPath() const; … … 72 73 void currentFileChanged( pAbstractChild*, const QString& ); 73 74 // projects 74 void aboutToClose( XUP Item* );75 void closed( XUP Item* );76 void modifiedChanged( XUP Item*, bool );77 void currentChanged( XUP Item* );78 void opened( XUP Item* );75 void aboutToClose( XUPProjectItem* ); 76 void closed( XUPProjectItem* ); 77 void modifiedChanged( XUPProjectItem*, bool ); 78 void currentChanged( XUPProjectItem* ); 79 void opened( XUPProjectItem* ); 79 80 }; 80 81 -
v2/branches/dev/monkey/src/workspace/pWorkspace.cpp
r2141 r2227 47 47 #include "../templatesmanager/pTemplatesManager.h" 48 48 #include "../xupmanager/ui/UIXUPManager.h" 49 #include "../xupmanager/XUP Item.h"49 #include "../xupmanager/XUPProjectItem.h" 50 50 #include "../pluginsmanager/PluginsManager.h" 51 51 #include "../coremanager/MonkeyCore.h" … … 93 93 connect( listWidget(), SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( internal_listWidget_customContextMenuRequested( const QPoint& ) ) ); 94 94 connect( MonkeyCore::projectsManager(), SIGNAL( projectCustomContextMenuRequested( const QPoint& ) ), this, SLOT( internal_projectsManager_customContextMenuRequested( const QPoint& ) ) ); 95 connect( MonkeyCore::projectsManager(), SIGNAL( currentProjectChanged( XUP Item*, XUPItem* ) ), this, SLOT( internal_currentProjectChanged( XUPItem*, XUPItem* ) ) );95 connect( MonkeyCore::projectsManager(), SIGNAL( currentProjectChanged( XUPProjectItem*, XUPProjectItem* ) ), this, SLOT( internal_currentProjectChanged( XUPProjectItem*, XUPProjectItem* ) ) ); 96 96 connect( MonkeyCore::projectsManager(), SIGNAL( projectInstallCommandRequested( const pCommand&, const QString& ) ), this, SLOT( internal_projectInstallCommandRequested( const pCommand&, const QString& ) ) ); 97 97 connect( MonkeyCore::projectsManager(), SIGNAL( projectUninstallCommandRequested( const pCommand&, const QString& ) ), this, SLOT( internal_projectUninstallCommandRequested( const pCommand&, const QString& ) ) ); … … 415 415 } 416 416 417 void pWorkspace::internal_currentProjectChanged( XUP Item* currentProject, XUPItem* previousProject )417 void pWorkspace::internal_currentProjectChanged( XUPProjectItem* currentProject, XUPProjectItem* previousProject ) 418 418 { 419 419 // uninstall old commands -
v2/branches/dev/monkey/src/workspace/pWorkspace.h
r1985 r2227 36 36 class pAbstractChild; 37 37 class QMainWindow; 38 class XUP Item;38 class XUPProjectItem; 39 39 class QFileSystemWatcher; 40 40 … … 79 79 void internal_listWidget_customContextMenuRequested( const QPoint& ); 80 80 void internal_projectsManager_customContextMenuRequested( const QPoint& pos ); 81 void internal_currentProjectChanged( XUP Item* currentProject, XUPItem* previousProject );81 void internal_currentProjectChanged( XUPProjectItem* currentProject, XUPProjectItem* previousProject ); 82 82 void internal_projectInstallCommandRequested( const pCommand& cmd, const QString& mnu ); 83 83 void internal_projectUninstallCommandRequested( const pCommand& cmd, const QString& mnu ); -
v2/branches/dev/monkey/src/xupmanager/FilteredProjectItemModel.h
r1933 r2227 8 8 9 9 #include "XUPItem.h" 10 #include "XUPProjectItem.h" 10 11 11 12 class ProjectItemModel; … … 38 39 { return mItem; } 39 40 40 XUP Item* project() const41 XUPProjectItem* project() const 41 42 { 42 43 if ( mItem->isProject() ) 43 return mItem;44 return dynamic_cast<XUPProjectItem*> (mItem); 44 45 else if ( mItem->isType( "value" ) ) 45 return mItem->project();46 return dynamic_cast<XUPProjectItem*> (mItem->project()); 46 47 /* 47 48 else if ( mItem->isType( "folder" ) ) -
v2/branches/dev/monkey/src/xupmanager/ProjectItemModel.cpp
r1729 r2227 1 1 #include "ProjectItemModel.h" 2 2 #include "XUPItem.h" 3 #include "XUPProjectItem.h" 3 4 #include "FilteredProjectItemModel.h" 4 5 #include "ScopedProjectItemModel.h" … … 20 21 { QStandardItemModel::appendRow( it ); } 21 22 22 QList<XUP Item*> ProjectItemModel::topLevelProjects( int c ) const23 QList<XUPProjectItem*> ProjectItemModel::topLevelProjects( int c ) const 23 24 { 24 QList<XUP Item*> l;25 QList<XUPProjectItem*> l; 25 26 for ( int i = 0; i < rowCount(); i++ ) 26 l << item( i, c);27 l << dynamic_cast<XUPProjectItem*> (item( i, c )); 27 28 return l; 28 29 } -
v2/branches/dev/monkey/src/xupmanager/ProjectItemModel.h
r1729 r2227 7 7 8 8 class XUPItem; 9 class XUPProjectItem; 9 10 class FilteredProjectItemModel; 10 11 class ScopedProjectItemModel; … … 25 26 void appendRow( XUPItem* ); 26 27 // return all top level proejcts for column 27 QList<XUP Item*> topLevelProjects( int = 0 ) const;28 QList<XUPProjectItem*> topLevelProjects( int = 0 ) const; 28 29 // return the filtered model, ie a view that is beautifull for user 29 30 FilteredProjectItemModel* filteredModel(); -
v2/branches/dev/monkey/src/xupmanager/XUPItem.cpp
r1934 r2227 2 2 #include "ProjectItemModel.h" 3 3 #include "XUPIO.h" 4 #include "../coremanager/MonkeyCore.h" 5 #include "../pluginsmanager/PluginsManager.h" 4 6 5 7 6 #include <QFile> … … 10 9 11 10 XUPItemInfos XUPItem::mXUPItemInfos; 12 QString XUPItem::mProjectSettingsScope = "ProjectSettings";13 11 14 12 XUPItem::XUPItem( const QDomElement e, const QString& s, bool b ) … … 17 15 registerItem(); 18 16 setDomElement( e ); 19 loadProject( s ); 17 loadProject( s ); // FIXME Do it actual for Item ??? 20 18 setModified( b ); 21 19 } … … 223 221 if ( it->isProject() ) 224 222 { 225 connect( it, SIGNAL( aboutToClose( XUP Item* ) ), pit, SIGNAL( aboutToClose( XUPItem* ) ) );226 connect( it, SIGNAL( closed( XUP Item* ) ), pit, SIGNAL( closed( XUPItem* ) ) );223 connect( it, SIGNAL( aboutToClose( XUPProjectItem* ) ), pit, SIGNAL( aboutToClose( XUPProjectItem* ) ) ); 224 connect( it, SIGNAL( closed( XUPProjectItem* ) ), pit, SIGNAL( closed( XUPProjectItem* ) ) ); 227 225 connect( it, SIGNAL( installCommandRequested( const pCommand&, const QString& ) ), pit, SIGNAL( installCommandRequested( const pCommand&, const QString& ) ) ); 228 226 connect( it, SIGNAL( uninstallCommandRequested( const pCommand&, const QString& ) ), pit, SIGNAL( uninstallCommandRequested( const pCommand&, const QString& ) ) ); … … 385 383 } 386 384 387 void XUPItem::closeProject()388 {389 // close child project390 foreach ( XUPItem* it, children( false, false ) )391 if ( it->isProject() )392 it->closeProject();393 // tell we will close the project394 emit aboutToClose( this );395 // emit closed396 emit closed( this );397 }398 399 385 void XUPItem::addFiles( const QStringList& files, XUPItem* scope, const QString& op ) 400 386 { … … 715 701 return v; 716 702 } 717 718 QStringList XUPItem::projectSettingsValues( const QString& variable, const QStringList& defaultValues ) const719 {720 // get the most top level project721 if ( XUPItem* project = topLevelProject() )722 // get project settings scope723 if ( XUPItem* scope = project->scope( mProjectSettingsScope, project, false ) )724 // check for the variable in children725 foreach ( XUPItem* cit, scope->children( false, true ) )726 if ( cit->isType( "variable" ) && cit->defaultValue() == variable )727 return cit->variableValues();728 // else return default list729 return defaultValues;730 }731 732 void XUPItem::setProjectSettingsValues( const QString& variable, const QStringList& values )733 {734 // abort if no files735 if ( variable.isEmpty() )736 return;737 738 // get top level project739 XUPItem* project = topLevelProject();740 // get project settings scope741 XUPItem* scope = project ? project->scope( mProjectSettingsScope, project, !values.isEmpty() ) : 0;742 if ( !scope )743 return;744 745 // get variable item746 XUPItem* vit = 0;747 foreach ( XUPItem* cit, scope->children( false, true ) )748 {749 if ( cit->isType( "variable" ) && cit->defaultValue() == variable )750 {751 vit = cit;752 break;753 }754 }755 756 // check variable exists or not757 bool exists = vit;758 759 // remove variable if needed760 if ( exists && values.isEmpty() )761 {762 // remova variable763 vit->remove();764 // update scope nested if needed765 if ( scope->isType( "scope" ) )766 scope->setValue( "nested", scope->rowCount() > 1 ? "false" : "true" );767 return;768 }769 770 // if not exists, and value is empty, do nothing771 if ( !exists && values.isEmpty() )772 return;773 774 // create variable if needed775 if ( !exists )776 {777 vit = scope->clone( false );778 vit->setDomElement( scope->domElement().ownerDocument().createElement( "variable" ) );779 scope->domElement().appendChild( vit->domElement() );780 vit->setValue( vit->valueName(), variable );781 vit->setValue( "multiline", "true" );782 }783 784 // if same value, return785 if ( vit->variableValues() == values )786 return;787 // clear values788 while ( vit->hasChildren() )789 vit->child( 0 )->remove();790 // set values791 foreach ( const QString& value, values )792 {793 // create item value794 XUPItem* it = vit->clone( false );795 it->setDomElement( vit->domElement().ownerDocument().createElement( "value" ) );796 vit->domElement().appendChild( it->domElement() );797 it->setValue( it->valueName(), value );798 vit->appendRow( it );799 }800 801 // append var item only at last will prevent multiple call of addFilteredValue from filtered view802 if ( !exists )803 scope->appendRow( vit );804 805 // update scope nested if needed806 if ( scope->isType( "scope" ) )807 scope->setValue( "nested", scope->rowCount() > 1 ? "false" : "true" );808 }809 810 void XUPItem::addProjectSettingsValues( const QString& variable, const QStringList& values )811 {812 // abort if no files or values813 if ( variable.isEmpty() || values.isEmpty() )814 return;815 816 // get top level project817 XUPItem* project = topLevelProject();818 // get project settings scope819 XUPItem* scope = project ? project->scope( mProjectSettingsScope, project, !values.isEmpty() ) : 0;820 if ( !scope )821 return;822 823 // get variable item824 XUPItem* vit = 0;825 foreach ( XUPItem* cit, scope->children( false, true ) )826 {827 if ( cit->isType( "variable" ) && cit->defaultValue() == variable )828 {829 vit = cit;830 break;831 }832 }833 834 // check variable exists or not835 bool exists = vit;836 837 // create variable if needed838 if ( !exists )839 {840 vit = scope->clone( false );841 vit->setDomElement( scope->domElement().ownerDocument().createElement( "variable" ) );842 scope->domElement().appendChild( vit->domElement() );843 vit->setValue( vit->valueName(), variable );844 vit->setValue( "multiline", "true" );845 }846 847 // get existing values in variable848 const QStringList existingValues = vit->variableValues();849 // set values850 foreach ( const QString& value, values )851 {852 // create item value if needed853 if ( !existingValues.contains( value ) )854 {855 XUPItem* it = vit->clone( false );856 it->setDomElement( vit->domElement().ownerDocument().createElement( "value" ) );857 vit->domElement().appendChild( it->domElement() );858 it->setValue( it->valueName(), value );859 vit->appendRow( it );860 }861 }862 863 // append var item only at last will prevent multiple call of addFilteredValue from filtered view864 if ( !exists )865 scope->appendRow( vit );866 867 // update scope nested if needed868 if ( scope->isType( "scope" ) )869 scope->setValue( "nested", scope->rowCount() > 1 ? "false" : "true" );870 }871 872 BuilderPlugin* XUPItem::builder( const QString& plugin ) const873 { return MonkeyCore::pluginsManager()->plugin<BuilderPlugin*>( PluginsManager::stAll, projectSettingsValue( "BUILDER", plugin ) ); }874 875 CompilerPlugin* XUPItem::compiler( const QString& plugin ) const876 { return MonkeyCore::pluginsManager()->plugin<CompilerPlugin*>( PluginsManager::stAll, projectSettingsValue( "COMPILER", plugin ) ); }877 878 DebuggerPlugin* XUPItem::debugger( const QString& plugin ) const879 { return MonkeyCore::pluginsManager()->plugin<DebuggerPlugin*>( PluginsManager::stAll, projectSettingsValue( "DEBUGGER", plugin ) ); }880 881 InterpreterPlugin* XUPItem::interpreter( const QString& plugin ) const882 { return MonkeyCore::pluginsManager()->plugin<InterpreterPlugin*>( PluginsManager::stAll, projectSettingsValue( "INTERPRETER", plugin ) ); }883 884 void XUPItem::addCommand( const pCommand& cmd, const QString& mnu )885 {886 if ( cmd.isValid() )887 {888 emit installCommandRequested( cmd, mnu );889 mCommands.insert( mnu, cmd );890 }891 }892 893 void XUPItem::installCommands()894 {895 // get plugins896 BuilderPlugin* bp = builder();897 CompilerPlugin* cp = compiler();898 /*899 DebuggerPlugin* dp = debugger();900 InterpreterPlugin* ip = interpreter();901 */902 903 // build command904 if ( bp )905 {906 pCommand cmd = bp->buildCommand();907 if ( cp )908 cmd.addParsers( cp->compileCommand().parsers() );909 cmd.setUserData( reinterpret_cast<quintptr>( &mCommands ) );910 cmd.setProject( this );911 cmd.setSkipOnError( false );912 addCommand( cmd, "mBuilder/mBuild" );913 }914 915 // compile file command916 if ( cp )917 {918 pCommand cmd = cp->compileCommand();919 cmd.setUserData( reinterpret_cast<quintptr>( &mCommands ) );920 cmd.setProject( this );921 cmd.setSkipOnError( false );922 addCommand( cmd, "mBuilder/mBuild" );923 }924 925 // install builder user command926 if ( bp )927 {928 foreach ( pCommand cmd, bp->userCommands() )929 {930 if ( cp )931 cmd.addParsers( cp->compileCommand().parsers() );932 cmd.setUserData( reinterpret_cast<quintptr>( &mCommands ) );933 cmd.setProject( this );934 cmd.setSkipOnError( false );935 addCommand( cmd, "mBuilder/mUserCommands" );936 }937 }938 939 // install compiler user command940 if ( cp )941 {942 foreach ( pCommand cmd, cp->userCommands() )943 {944 cmd.setUserData( reinterpret_cast<quintptr>( &mCommands ) );945 cmd.setProject( this );946 cmd.setSkipOnError( false );947 addCommand( cmd, "mBuilder/mUserCommands" );948 }949 }950 951 // install debugger user command952 // install interpreter user command953 }954 955 void XUPItem::uninstallCommands()956 {957 foreach ( const pCommand& cmd, mCommands.values() )958 emit uninstallCommandRequested( cmd, mCommands.key( cmd ) );959 mCommands.clear();960 } -
v2/branches/dev/monkey/src/xupmanager/XUPItem.h
r1847 r2227 52 52 53 53 public: 54 static QString mProjectSettingsScope;55 54 56 55 XUPItem( const QDomElement = QDomDocument().toElement(), const QString& = QString(), bool = false ); … …
