diff -Nru kdesdk-4.7.90/cervisia/cervisia.desktop kdesdk-4.7.95/cervisia/cervisia.desktop --- kdesdk-4.7.90/cervisia/cervisia.desktop 2011-08-22 13:32:15.000000000 +0000 +++ kdesdk-4.7.95/cervisia/cervisia.desktop 2011-12-20 21:00:12.000000000 +0000 @@ -17,7 +17,7 @@ GenericName[es]=Interfaz CVS GenericName[et]=CVS kasutajaliides GenericName[eu]=CVS interfazea -GenericName[fa]=پایانۀ CVS +GenericName[fa]=پایانه CVS GenericName[fi]=Käyttöliittymä CVS:lle GenericName[fr]=Interface graphique pour CVS GenericName[ga]=Comhéadan ar CVS diff -Nru kdesdk-4.7.90/debian/changelog kdesdk-4.7.95/debian/changelog --- kdesdk-4.7.90/debian/changelog 2011-12-20 23:52:45.000000000 +0000 +++ kdesdk-4.7.95/debian/changelog 2011-12-27 20:59:04.000000000 +0000 @@ -1,8 +1,21 @@ +kdesdk (4:4.7.95-0ubuntu1) precise; urgency=low + + [ Philip Muškovac ] + * New upstream release candidate + + [ Felix Geyer ] + * Fix lintian warning debian-changelog-line-too-long. + * Update symbols files. + + -- Philip Muškovac Sat, 24 Dec 2011 18:10:46 +0100 + kdesdk (4:4.7.90-0ubuntu1) precise; urgency=low * new upstream beta release - * Remove kubuntu_no_structures_tool.diff now upstream https://bugs.kde.org/283661 - * Do not use debian abi manager, okteta libraries have their own way of doing this + * Remove kubuntu_no_structures_tool.diff now upstream + https://bugs.kde.org/283661 + * Do not use debian abi manager, okteta libraries have their own way of doing + this * rename several okteta library packages to match upstream -- Jonathan Riddell Thu, 15 Dec 2011 14:17:52 +0000 diff -Nru kdesdk-4.7.90/debian/control kdesdk-4.7.95/debian/control --- kdesdk-4.7.90/debian/control 2011-12-15 21:13:47.000000000 +0000 +++ kdesdk-4.7.95/debian/control 2011-12-27 20:26:04.000000000 +0000 @@ -6,7 +6,7 @@ Uploaders: Fathi Boudra , Sune Vuorela , Armin Berres , Modestas Vainius , George Kiagiadakis , José Manuel Santamaría Lema -Build-Depends: kde-sc-dev-latest (>= 4:4.7.2), +Build-Depends: kde-sc-dev-latest (>= 4:4.7.95), cmake, debhelper (>= 7.3.16), pkg-kde-tools (>= 0.12), kdepimlibs5-dev (>= 4:4.7), libphonon-dev (>= 4:4.3.1), libsvn-dev, libstreamanalyzer-dev (>= 0.6.3), libxslt1-dev, libboost1.46-dev, diff -Nru kdesdk-4.7.90/debian/libkasten1core1.symbols kdesdk-4.7.95/debian/libkasten1core1.symbols --- kdesdk-4.7.90/debian/libkasten1core1.symbols 2011-12-15 20:49:49.000000000 +0000 +++ kdesdk-4.7.95/debian/libkasten1core1.symbols 2011-12-27 20:26:04.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 4:4.7.90 amd64 +# SymbolsHelper-Confirmed: 4:4.7.90 amd64 armel armhf i386 powerpc libkasten1core.so.1 libkasten1core1 #MINVER# _ZN7Kasten110JobManager10executeJobEP4KJob@Base 4:4.7.90 _ZN7Kasten112AbstractTool11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 @@ -167,9 +167,9 @@ _ZN7Kasten123AbstractDocumentFactoryD0Ev@Base 4:4.7.90 _ZN7Kasten123AbstractDocumentFactoryD1Ev@Base 4:4.7.90 _ZN7Kasten123AbstractDocumentFactoryD2Ev@Base 4:4.7.90 - _ZN7Kasten123AbstractOverwriteDialogD0Ev@Base 4:4.7.90 - _ZN7Kasten123AbstractOverwriteDialogD1Ev@Base 4:4.7.90 - _ZN7Kasten123AbstractOverwriteDialogD2Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten123AbstractOverwriteDialogD0Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten123AbstractOverwriteDialogD1Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten123AbstractOverwriteDialogD2Ev@Base 4:4.7.90 _ZN7Kasten123AbstractSyncToRemoteJob11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten123AbstractSyncToRemoteJob11qt_metacastEPKc@Base 4:4.7.90 _ZN7Kasten123AbstractSyncToRemoteJob16staticMetaObjectE@Base 4:4.7.90 @@ -220,9 +220,9 @@ _ZN7Kasten125AbstractModelSynchronizerD0Ev@Base 4:4.7.90 _ZN7Kasten125AbstractModelSynchronizerD1Ev@Base 4:4.7.90 _ZN7Kasten125AbstractModelSynchronizerD2Ev@Base 4:4.7.90 - _ZN7Kasten125AbstractSaveDiscardDialogD0Ev@Base 4:4.7.90 - _ZN7Kasten125AbstractSaveDiscardDialogD1Ev@Base 4:4.7.90 - _ZN7Kasten125AbstractSaveDiscardDialogD2Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten125AbstractSaveDiscardDialogD0Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten125AbstractSaveDiscardDialogD1Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten125AbstractSaveDiscardDialogD2Ev@Base 4:4.7.90 _ZN7Kasten125AbstractSyncFromRemoteJob11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten125AbstractSyncFromRemoteJob11qt_metacastEPKc@Base 4:4.7.90 _ZN7Kasten125AbstractSyncFromRemoteJob16staticMetaObjectE@Base 4:4.7.90 @@ -464,13 +464,13 @@ _ZTIN7Kasten121DocumentCreateManagerE@Base 4:4.7.90 _ZTIN7Kasten122AbstractModelSelectionE@Base 4:4.7.90 _ZTIN7Kasten123AbstractDocumentFactoryE@Base 4:4.7.90 - _ZTIN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTIN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 _ZTIN7Kasten123AbstractSyncToRemoteJobE@Base 4:4.7.90 _ZTIN7Kasten123ModelDataGenerateThreadE@Base 4:4.7.90 _ZTIN7Kasten123ModelStreamEncodeThreadE@Base 4:4.7.90 _ZTIN7Kasten125AbstractFileSystemLoadJobE@Base 4:4.7.90 _ZTIN7Kasten125AbstractModelSynchronizerE@Base 4:4.7.90 - _ZTIN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTIN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 _ZTIN7Kasten125AbstractSyncFromRemoteJobE@Base 4:4.7.90 _ZTIN7Kasten125AbstractSyncWithRemoteJobE@Base 4:4.7.90 _ZTIN7Kasten126AbstractModelDataGeneratorE@Base 4:4.7.90 @@ -497,13 +497,13 @@ _ZTSN7Kasten121DocumentCreateManagerE@Base 4:4.7.90 _ZTSN7Kasten122AbstractModelSelectionE@Base 4:4.7.90 _ZTSN7Kasten123AbstractDocumentFactoryE@Base 4:4.7.90 - _ZTSN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTSN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 _ZTSN7Kasten123AbstractSyncToRemoteJobE@Base 4:4.7.90 _ZTSN7Kasten123ModelDataGenerateThreadE@Base 4:4.7.90 _ZTSN7Kasten123ModelStreamEncodeThreadE@Base 4:4.7.90 _ZTSN7Kasten125AbstractFileSystemLoadJobE@Base 4:4.7.90 _ZTSN7Kasten125AbstractModelSynchronizerE@Base 4:4.7.90 - _ZTSN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTSN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 _ZTSN7Kasten125AbstractSyncFromRemoteJobE@Base 4:4.7.90 _ZTSN7Kasten125AbstractSyncWithRemoteJobE@Base 4:4.7.90 _ZTSN7Kasten126AbstractModelDataGeneratorE@Base 4:4.7.90 @@ -530,13 +530,13 @@ _ZTVN7Kasten121DocumentCreateManagerE@Base 4:4.7.90 _ZTVN7Kasten122AbstractModelSelectionE@Base 4:4.7.90 _ZTVN7Kasten123AbstractDocumentFactoryE@Base 4:4.7.90 - _ZTVN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTVN7Kasten123AbstractOverwriteDialogE@Base 4:4.7.90 _ZTVN7Kasten123AbstractSyncToRemoteJobE@Base 4:4.7.90 _ZTVN7Kasten123ModelDataGenerateThreadE@Base 4:4.7.90 _ZTVN7Kasten123ModelStreamEncodeThreadE@Base 4:4.7.90 _ZTVN7Kasten125AbstractFileSystemLoadJobE@Base 4:4.7.90 _ZTVN7Kasten125AbstractModelSynchronizerE@Base 4:4.7.90 - _ZTVN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTVN7Kasten125AbstractSaveDiscardDialogE@Base 4:4.7.90 _ZTVN7Kasten125AbstractSyncFromRemoteJobE@Base 4:4.7.90 _ZTVN7Kasten125AbstractSyncWithRemoteJobE@Base 4:4.7.90 _ZTVN7Kasten126AbstractModelDataGeneratorE@Base 4:4.7.90 diff -Nru kdesdk-4.7.90/debian/libkasten1gui1.symbols kdesdk-4.7.95/debian/libkasten1gui1.symbols --- kdesdk-4.7.90/debian/libkasten1gui1.symbols 2011-12-15 20:49:50.000000000 +0000 +++ kdesdk-4.7.95/debian/libkasten1gui1.symbols 2011-12-27 20:26:04.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 4:4.7.90 amd64 +# SymbolsHelper-Confirmed: 4:4.7.90 amd64 armel armhf i386 powerpc libkasten1gui.so.1 libkasten1gui1 #MINVER# _ZN7Kasten111ShellWindow11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten111ShellWindow11qt_metacastEPKc@Base 4:4.7.90 @@ -167,10 +167,10 @@ _ZN7Kasten118AbstractToolWidgetD0Ev@Base 4:4.7.90 _ZN7Kasten118AbstractToolWidgetD1Ev@Base 4:4.7.90 _ZN7Kasten118AbstractToolWidgetD2Ev@Base 4:4.7.90 - _ZN7Kasten119AbstractViewFactory16createCopyOfViewEPNS_12AbstractViewE6QFlagsIN2Qt13AlignmentFlagEE@Base 4:4.7.90 - _ZN7Kasten119AbstractViewFactoryD0Ev@Base 4:4.7.90 - _ZN7Kasten119AbstractViewFactoryD1Ev@Base 4:4.7.90 - _ZN7Kasten119AbstractViewFactoryD2Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten119AbstractViewFactory16createCopyOfViewEPNS_12AbstractViewE6QFlagsIN2Qt13AlignmentFlagEE@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten119AbstractViewFactoryD0Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten119AbstractViewFactoryD1Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten119AbstractViewFactoryD2Ev@Base 4:4.7.90 _ZN7Kasten120AbstractGroupedViews11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten120AbstractGroupedViews11qt_metacastEPKc@Base 4:4.7.90 _ZN7Kasten120AbstractGroupedViews12closeRequestERK5QListIPNS_12AbstractViewEE@Base 4:4.7.90 @@ -308,12 +308,12 @@ _ZN7Kasten142ModelEncoderFileSystemExporterConfigEditorD0Ev@Base 4:4.7.90 _ZN7Kasten142ModelEncoderFileSystemExporterConfigEditorD1Ev@Base 4:4.7.90 _ZN7Kasten142ModelEncoderFileSystemExporterConfigEditorD2Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD0Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD1Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD2Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD0Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD1Ev@Base 4:4.7.90 - _ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD2Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD0Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD1Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryD2Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD0Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD1Ev@Base 4:4.7.90 + (arch=!armel !armhf)_ZN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryD2Ev@Base 4:4.7.90 _ZN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryC1EPNS_45AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 _ZN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryC2EPNS_45AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 _ZN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryD0Ev@Base 4:4.7.90 @@ -431,7 +431,7 @@ _ZTIN7Kasten117AbstractLinePopupE@Base 4:4.7.90 _ZTIN7Kasten118AbstractControllerE@Base 4:4.7.90 _ZTIN7Kasten118AbstractToolWidgetE@Base 4:4.7.90 - _ZTIN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTIN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten120AbstractGroupedViewsE@Base 4:4.7.90 _ZTIN7Kasten121AbstractSelectionViewE@Base 4:4.7.90 _ZTIN7Kasten121ModelCodecViewManagerE@Base 4:4.7.90 @@ -447,8 +447,8 @@ _ZTIN7Kasten138AbstractModelStreamEncoderConfigEditorE@Base 4:4.7.90 _ZTIN7Kasten140AbstractModelExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTIN7Kasten142ModelEncoderFileSystemExporterConfigEditorE@Base 4:4.7.90 - _ZTIN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 - _ZTIN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTIN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTIN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 _ZTIN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTIN7Kasten19DummyViewE@Base 4:4.7.90 _ZTIN7Kasten19StatusBarE@Base 4:4.7.90 @@ -466,7 +466,7 @@ _ZTSN7Kasten117AbstractLinePopupE@Base 4:4.7.90 _ZTSN7Kasten118AbstractControllerE@Base 4:4.7.90 _ZTSN7Kasten118AbstractToolWidgetE@Base 4:4.7.90 - _ZTSN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTSN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten120AbstractGroupedViewsE@Base 4:4.7.90 _ZTSN7Kasten121AbstractSelectionViewE@Base 4:4.7.90 _ZTSN7Kasten121ModelCodecViewManagerE@Base 4:4.7.90 @@ -482,8 +482,8 @@ _ZTSN7Kasten138AbstractModelStreamEncoderConfigEditorE@Base 4:4.7.90 _ZTSN7Kasten140AbstractModelExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTSN7Kasten142ModelEncoderFileSystemExporterConfigEditorE@Base 4:4.7.90 - _ZTSN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 - _ZTSN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTSN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTSN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 _ZTSN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTSN7Kasten19DummyViewE@Base 4:4.7.90 _ZTSN7Kasten19StatusBarE@Base 4:4.7.90 @@ -503,7 +503,7 @@ _ZTVN7Kasten117AbstractLinePopupE@Base 4:4.7.90 _ZTVN7Kasten118AbstractControllerE@Base 4:4.7.90 _ZTVN7Kasten118AbstractToolWidgetE@Base 4:4.7.90 - _ZTVN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTVN7Kasten119AbstractViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten120AbstractGroupedViewsE@Base 4:4.7.90 _ZTVN7Kasten121AbstractSelectionViewE@Base 4:4.7.90 _ZTVN7Kasten121ModelCodecViewManagerE@Base 4:4.7.90 @@ -519,8 +519,8 @@ _ZTVN7Kasten138AbstractModelStreamEncoderConfigEditorE@Base 4:4.7.90 _ZTVN7Kasten140AbstractModelExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTVN7Kasten142ModelEncoderFileSystemExporterConfigEditorE@Base 4:4.7.90 - _ZTVN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 - _ZTVN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTVN7Kasten145AbstractModelDataGeneratorConfigEditorFactoryE@Base 4:4.7.90 + (arch=!armel !armhf)_ZTVN7Kasten145AbstractModelStreamEncoderConfigEditorFactoryE@Base 4:4.7.90 _ZTVN7Kasten149ModelEncoderFileSystemExporterConfigEditorFactoryE@Base 4:4.7.90 _ZTVN7Kasten19DummyViewE@Base 4:4.7.90 _ZTVN7Kasten19StatusBarE@Base 4:4.7.90 diff -Nru kdesdk-4.7.90/debian/libkasten1okteta1controllers1.symbols kdesdk-4.7.95/debian/libkasten1okteta1controllers1.symbols --- kdesdk-4.7.90/debian/libkasten1okteta1controllers1.symbols 2011-12-15 20:49:50.000000000 +0000 +++ kdesdk-4.7.95/debian/libkasten1okteta1controllers1.symbols 2011-12-27 20:26:04.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 4:4.7.90 amd64 +# SymbolsHelper-Confirmed: 4:4.7.90 amd64 armel armhf i386 powerpc libkasten1okteta1controllers.so.1 libkasten1okteta1controllers1 #MINVER# _ZN7Kasten110FilterTool11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten110FilterTool11qt_metacastEPKc@Base 4:4.7.90 @@ -13,40 +13,40 @@ _ZN7Kasten110FilterToolD0Ev@Base 4:4.7.90 _ZN7Kasten110FilterToolD1Ev@Base 4:4.7.90 _ZN7Kasten110FilterToolD2Ev@Base 4:4.7.90 - _ZN7Kasten110StructTool10headerDataEii@Base 4:4.7.90 - _ZN7Kasten110StructTool10updateDataERKN6Okteta22ArrayChangeMetricsListE@Base 4:4.7.90 - _ZN7Kasten110StructTool11dataChangedEiPv@Base 4:4.7.90 - _ZN7Kasten110StructTool11dataClearedEv@Base 4:4.7.90 - _ZN7Kasten110StructTool11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 - _ZN7Kasten110StructTool11qt_metacastEPKc@Base 4:4.7.90 - _ZN7Kasten110StructTool12addChildItemEP23TopLevelDataInformation@Base 4:4.7.90 - _ZN7Kasten110StructTool12setByteOrderENS_21StructViewPreferences13EnumByteOrder4typeE@Base 4:4.7.90 - _ZN7Kasten110StructTool12setByteOrderEi@Base 4:4.7.90 - _ZN7Kasten110StructTool13lockStructureERK11QModelIndex@Base 4:4.7.90 - _ZN7Kasten110StructTool14setTargetModelEPNS_13AbstractModelE@Base 4:4.7.90 - _ZN7Kasten110StructTool15childrenRemovedEPK15DataInformationjj@Base 4:4.7.90 - _ZN7Kasten110StructTool15unlockStructureERK11QModelIndex@Base 4:4.7.90 - _ZN7Kasten110StructTool16byteOrderChangedEv@Base 4:4.7.90 - _ZN7Kasten110StructTool16childrenInsertedEPK15DataInformationjj@Base 4:4.7.90 - _ZN7Kasten110StructTool16onContentsChangeERKN6Okteta22ArrayChangeMetricsListE@Base 4:4.7.90 - _ZN7Kasten110StructTool16staticMetaObjectE@Base 4:4.7.90 - _ZN7Kasten110StructTool18cursorIndexChangedEv@Base 4:4.7.90 - _ZN7Kasten110StructTool21byteArrayModelChangedEb@Base 4:4.7.90 - _ZN7Kasten110StructTool21validateAllStructuresEv@Base 4:4.7.90 - _ZN7Kasten110StructTool22onChildItemDataChangedEv@Base 4:4.7.90 - _ZN7Kasten110StructTool22onCursorPositionChangeEi@Base 4:4.7.90 - _ZN7Kasten110StructTool24childrenAboutToBeRemovedEP15DataInformationjj@Base 4:4.7.90 - _ZN7Kasten110StructTool25childrenAboutToBeInsertedEP15DataInformationjj@Base 4:4.7.90 - _ZN7Kasten110StructTool27setSelectedStructuresInViewEv@Base 4:4.7.90 - _ZN7Kasten110StructTool4markERK11QModelIndex@Base 4:4.7.90 - _ZN7Kasten110StructTool6unmarkEv@Base 4:4.7.90 - _ZN7Kasten110StructTool7setDataERK8QVariantiP15DataInformation@Base 4:4.7.90 - _ZN7Kasten110StructTool7setDataERK8QVariantiP15DataInformationj@Base 4:4.7.90 - _ZN7Kasten110StructToolC1Ev@Base 4:4.7.90 - _ZN7Kasten110StructToolC2Ev@Base 4:4.7.90 - _ZN7Kasten110StructToolD0Ev@Base 4:4.7.90 - _ZN7Kasten110StructToolD1Ev@Base 4:4.7.90 - _ZN7Kasten110StructToolD2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool10headerDataEii@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool10updateDataERKN6Okteta22ArrayChangeMetricsListE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool11dataChangedEiPv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool11dataClearedEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool11qt_metacastEPKc@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool12addChildItemEP23TopLevelDataInformation@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool12setByteOrderENS_21StructViewPreferences13EnumByteOrder4typeE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool12setByteOrderEi@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool13lockStructureERK11QModelIndex@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool14setTargetModelEPNS_13AbstractModelE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool15childrenRemovedEPK15DataInformationjj@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool15unlockStructureERK11QModelIndex@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool16byteOrderChangedEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool16childrenInsertedEPK15DataInformationjj@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool16onContentsChangeERKN6Okteta22ArrayChangeMetricsListE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool16staticMetaObjectE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool18cursorIndexChangedEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool21byteArrayModelChangedEb@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool21validateAllStructuresEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool22onChildItemDataChangedEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool22onCursorPositionChangeEi@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool24childrenAboutToBeRemovedEP15DataInformationjj@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool25childrenAboutToBeInsertedEP15DataInformationjj@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool27setSelectedStructuresInViewEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool4markERK11QModelIndex@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool6unmarkEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool7setDataERK8QVariantiP15DataInformation@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructTool7setDataERK8QVariantiP15DataInformationj@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructToolC1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructToolC2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructToolD0Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructToolD1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten110StructToolD2Ev@Base 4:4.7.90 _ZN7Kasten112ChecksumTool11qt_metacallEN11QMetaObject4CallEiPPv@Base 4:4.7.90 _ZN7Kasten112ChecksumTool11qt_metacastEPKc@Base 4:4.7.90 _ZN7Kasten112ChecksumTool12parameterSetEv@Base 4:4.7.90 @@ -133,11 +133,11 @@ _ZN7Kasten114PODDecoderToolD0Ev@Base 4:4.7.90 _ZN7Kasten114PODDecoderToolD1Ev@Base 4:4.7.90 _ZN7Kasten114PODDecoderToolD2Ev@Base 4:4.7.90 - _ZN7Kasten114StructToolViewC1EPNS_10StructToolE@Base 4:4.7.90 - _ZN7Kasten114StructToolViewC2EPNS_10StructToolE@Base 4:4.7.90 - _ZN7Kasten114StructToolViewD0Ev@Base 4:4.7.90 - _ZN7Kasten114StructToolViewD1Ev@Base 4:4.7.90 - _ZN7Kasten114StructToolViewD2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten114StructToolViewC1EPNS_10StructToolE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten114StructToolViewC2EPNS_10StructToolE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten114StructToolViewD0Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten114StructToolViewD1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten114StructToolViewD2Ev@Base 4:4.7.90 _ZN7Kasten115InfoToolFactory6createEv@Base 4:4.7.90 _ZN7Kasten115InfoToolFactoryC1Ev@Base 4:4.7.90 _ZN7Kasten115InfoToolFactoryC2Ev@Base 4:4.7.90 @@ -388,12 +388,12 @@ _ZN7Kasten121SelectRangeControllerD0Ev@Base 4:4.7.90 _ZN7Kasten121SelectRangeControllerD1Ev@Base 4:4.7.90 _ZN7Kasten121SelectRangeControllerD2Ev@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactory6createEv@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactoryC1Ev@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactoryC2Ev@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactoryD0Ev@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactoryD1Ev@Base 4:4.7.90 - _ZN7Kasten121StructuresToolFactoryD2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactory6createEv@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactoryC1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactoryC2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactoryD0Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactoryD1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten121StructuresToolFactoryD2Ev@Base 4:4.7.90 _ZN7Kasten122StringsExtractToolViewC1EPNS_18StringsExtractToolE@Base 4:4.7.90 _ZN7Kasten122StringsExtractToolViewC2EPNS_18StringsExtractToolE@Base 4:4.7.90 _ZN7Kasten122StringsExtractToolViewD0Ev@Base 4:4.7.90 @@ -444,12 +444,12 @@ _ZN7Kasten125StringsExtractToolFactoryD0Ev@Base 4:4.7.90 _ZN7Kasten125StringsExtractToolFactoryD1Ev@Base 4:4.7.90 _ZN7Kasten125StringsExtractToolFactoryD2Ev@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactory6createEPNS_12AbstractToolE@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactoryC1Ev@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactoryC2Ev@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactoryD0Ev@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactoryD1Ev@Base 4:4.7.90 - _ZN7Kasten125StructuresToolViewFactoryD2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactory6createEPNS_12AbstractToolE@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactoryC1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactoryC2Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactoryD0Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactoryD1Ev@Base 4:4.7.90 + (arch=!powerpc)_ZN7Kasten125StructuresToolViewFactoryD2Ev@Base 4:4.7.90 _ZN7Kasten128CharsetConversionToolFactory6createEv@Base 4:4.7.90 _ZN7Kasten128CharsetConversionToolFactoryC1Ev@Base 4:4.7.90 _ZN7Kasten128CharsetConversionToolFactoryC2Ev@Base 4:4.7.90 @@ -489,17 +489,17 @@ _ZNK7Kasten110FilterTool13charCodecNameEv@Base 4:4.7.90 _ZNK7Kasten110FilterTool5titleEv@Base 4:4.7.90 _ZNK7Kasten110FilterTool6filterEi@Base 4:4.7.90 - _ZNK7Kasten110StructTool10childCountEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool10metaObjectEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool11columnCountEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool12isFileLoadedEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool14byteArrayModelEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool17isStructureLockedERK11QModelIndex@Base 4:4.7.90 - _ZNK7Kasten110StructTool20canStructureBeLockedERK11QModelIndex@Base 4:4.7.90 - _ZNK7Kasten110StructTool5titleEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool7childAtEi@Base 4:4.7.90 - _ZNK7Kasten110StructTool7managerEv@Base 4:4.7.90 - _ZNK7Kasten110StructTool9byteOrderEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool10childCountEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool10metaObjectEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool11columnCountEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool12isFileLoadedEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool14byteArrayModelEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool17isStructureLockedERK11QModelIndex@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool20canStructureBeLockedERK11QModelIndex@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool5titleEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool7childAtEi@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool7managerEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten110StructTool9byteOrderEv@Base 4:4.7.90 _ZNK7Kasten112ChecksumTool10metaObjectEv@Base 4:4.7.90 _ZNK7Kasten112ChecksumTool11isApplyableEv@Base 4:4.7.90 _ZNK7Kasten112ChecksumTool13algorithmListEv@Base 4:4.7.90 @@ -527,9 +527,9 @@ _ZNK7Kasten114PODDecoderTool5valueEi@Base 4:4.7.90 _ZNK7Kasten114PODDecoderTool8podCountEv@Base 4:4.7.90 _ZNK7Kasten114PODDecoderTool9nameOfPODEi@Base 4:4.7.90 - _ZNK7Kasten114StructToolView4toolEv@Base 4:4.7.90 - _ZNK7Kasten114StructToolView5titleEv@Base 4:4.7.90 - _ZNK7Kasten114StructToolView6widgetEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten114StructToolView4toolEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten114StructToolView5titleEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten114StructToolView6widgetEv@Base 4:4.7.90 _ZNK7Kasten115PrintController10metaObjectEv@Base 4:4.7.90 _ZNK7Kasten116ChecksumToolView4toolEv@Base 4:4.7.90 _ZNK7Kasten116ChecksumToolView5titleEv@Base 4:4.7.90 @@ -604,10 +604,10 @@ _ZNK7Kasten125PodDecoderToolViewFactory2idEv@Base 4:4.7.90 _ZNK7Kasten125PodDecoderToolViewFactory5titleEv@Base 4:4.7.90 _ZNK7Kasten125PodDecoderToolViewFactory8iconNameEv@Base 4:4.7.90 - _ZNK7Kasten125StructuresToolViewFactory15defaultPositionEv@Base 4:4.7.90 - _ZNK7Kasten125StructuresToolViewFactory2idEv@Base 4:4.7.90 - _ZNK7Kasten125StructuresToolViewFactory5titleEv@Base 4:4.7.90 - _ZNK7Kasten125StructuresToolViewFactory8iconNameEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten125StructuresToolViewFactory15defaultPositionEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten125StructuresToolViewFactory2idEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten125StructuresToolViewFactory5titleEv@Base 4:4.7.90 + (arch=!powerpc)_ZNK7Kasten125StructuresToolViewFactory8iconNameEv@Base 4:4.7.90 _ZNK7Kasten129StringsExtractToolViewFactory15defaultPositionEv@Base 4:4.7.90 _ZNK7Kasten129StringsExtractToolViewFactory2idEv@Base 4:4.7.90 _ZNK7Kasten129StringsExtractToolViewFactory5titleEv@Base 4:4.7.90 @@ -623,14 +623,14 @@ _ZNK7Kasten18InfoTool4sizeEv@Base 4:4.7.90 _ZNK7Kasten18InfoTool5titleEv@Base 4:4.7.90 _ZTIN7Kasten110FilterToolE@Base 4:4.7.90 - _ZTIN7Kasten110StructToolE@Base 4:4.7.90 + (arch=!powerpc)_ZTIN7Kasten110StructToolE@Base 4:4.7.90 _ZTIN7Kasten112ChecksumToolE@Base 4:4.7.90 _ZTIN7Kasten112InfoToolViewE@Base 4:4.7.90 _ZTIN7Kasten113BookmarksToolE@Base 4:4.7.90 _ZTIN7Kasten113ByteTableToolE@Base 4:4.7.90 _ZTIN7Kasten114FilterToolViewE@Base 4:4.7.90 _ZTIN7Kasten114PODDecoderToolE@Base 4:4.7.90 - _ZTIN7Kasten114StructToolViewE@Base 4:4.7.90 + (arch=!powerpc)_ZTIN7Kasten114StructToolViewE@Base 4:4.7.90 _ZTIN7Kasten115InfoToolFactoryE@Base 4:4.7.90 _ZTIN7Kasten115PrintControllerE@Base 4:4.7.90 _ZTIN7Kasten116ChecksumToolViewE@Base 4:4.7.90 @@ -656,7 +656,7 @@ _ZTIN7Kasten121FilterToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten121PodDecoderToolFactoryE@Base 4:4.7.90 _ZTIN7Kasten121SelectRangeControllerE@Base 4:4.7.90 - _ZTIN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTIN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 _ZTIN7Kasten122StringsExtractToolViewE@Base 4:4.7.90 _ZTIN7Kasten123ChecksumToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten123OverwriteModeControllerE@Base 4:4.7.90 @@ -665,20 +665,20 @@ _ZTIN7Kasten125CharsetConversionToolViewE@Base 4:4.7.90 _ZTIN7Kasten125PodDecoderToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten125StringsExtractToolFactoryE@Base 4:4.7.90 - _ZTIN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTIN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten128CharsetConversionToolFactoryE@Base 4:4.7.90 _ZTIN7Kasten129StringsExtractToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten132CharsetConversionToolViewFactoryE@Base 4:4.7.90 _ZTIN7Kasten18InfoToolE@Base 4:4.7.90 _ZTSN7Kasten110FilterToolE@Base 4:4.7.90 - _ZTSN7Kasten110StructToolE@Base 4:4.7.90 + (arch=!powerpc)_ZTSN7Kasten110StructToolE@Base 4:4.7.90 _ZTSN7Kasten112ChecksumToolE@Base 4:4.7.90 _ZTSN7Kasten112InfoToolViewE@Base 4:4.7.90 _ZTSN7Kasten113BookmarksToolE@Base 4:4.7.90 _ZTSN7Kasten113ByteTableToolE@Base 4:4.7.90 _ZTSN7Kasten114FilterToolViewE@Base 4:4.7.90 _ZTSN7Kasten114PODDecoderToolE@Base 4:4.7.90 - _ZTSN7Kasten114StructToolViewE@Base 4:4.7.90 + (arch=!powerpc)_ZTSN7Kasten114StructToolViewE@Base 4:4.7.90 _ZTSN7Kasten115InfoToolFactoryE@Base 4:4.7.90 _ZTSN7Kasten115PrintControllerE@Base 4:4.7.90 _ZTSN7Kasten116ChecksumToolViewE@Base 4:4.7.90 @@ -704,7 +704,7 @@ _ZTSN7Kasten121FilterToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten121PodDecoderToolFactoryE@Base 4:4.7.90 _ZTSN7Kasten121SelectRangeControllerE@Base 4:4.7.90 - _ZTSN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTSN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 _ZTSN7Kasten122StringsExtractToolViewE@Base 4:4.7.90 _ZTSN7Kasten123ChecksumToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten123OverwriteModeControllerE@Base 4:4.7.90 @@ -713,20 +713,20 @@ _ZTSN7Kasten125CharsetConversionToolViewE@Base 4:4.7.90 _ZTSN7Kasten125PodDecoderToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten125StringsExtractToolFactoryE@Base 4:4.7.90 - _ZTSN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTSN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten128CharsetConversionToolFactoryE@Base 4:4.7.90 _ZTSN7Kasten129StringsExtractToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten132CharsetConversionToolViewFactoryE@Base 4:4.7.90 _ZTSN7Kasten18InfoToolE@Base 4:4.7.90 _ZTVN7Kasten110FilterToolE@Base 4:4.7.90 - _ZTVN7Kasten110StructToolE@Base 4:4.7.90 + (arch=!powerpc)_ZTVN7Kasten110StructToolE@Base 4:4.7.90 _ZTVN7Kasten112ChecksumToolE@Base 4:4.7.90 _ZTVN7Kasten112InfoToolViewE@Base 4:4.7.90 _ZTVN7Kasten113BookmarksToolE@Base 4:4.7.90 _ZTVN7Kasten113ByteTableToolE@Base 4:4.7.90 _ZTVN7Kasten114FilterToolViewE@Base 4:4.7.90 _ZTVN7Kasten114PODDecoderToolE@Base 4:4.7.90 - _ZTVN7Kasten114StructToolViewE@Base 4:4.7.90 + (arch=!powerpc)_ZTVN7Kasten114StructToolViewE@Base 4:4.7.90 _ZTVN7Kasten115InfoToolFactoryE@Base 4:4.7.90 _ZTVN7Kasten115PrintControllerE@Base 4:4.7.90 _ZTVN7Kasten116ChecksumToolViewE@Base 4:4.7.90 @@ -752,7 +752,7 @@ _ZTVN7Kasten121FilterToolViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten121PodDecoderToolFactoryE@Base 4:4.7.90 _ZTVN7Kasten121SelectRangeControllerE@Base 4:4.7.90 - _ZTVN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTVN7Kasten121StructuresToolFactoryE@Base 4:4.7.90 _ZTVN7Kasten122StringsExtractToolViewE@Base 4:4.7.90 _ZTVN7Kasten123ChecksumToolViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten123OverwriteModeControllerE@Base 4:4.7.90 @@ -761,7 +761,7 @@ _ZTVN7Kasten125CharsetConversionToolViewE@Base 4:4.7.90 _ZTVN7Kasten125PodDecoderToolViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten125StringsExtractToolFactoryE@Base 4:4.7.90 - _ZTVN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 + (arch=!powerpc)_ZTVN7Kasten125StructuresToolViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten128CharsetConversionToolFactoryE@Base 4:4.7.90 _ZTVN7Kasten129StringsExtractToolViewFactoryE@Base 4:4.7.90 _ZTVN7Kasten132CharsetConversionToolViewFactoryE@Base 4:4.7.90 Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/cervisia/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/cervisia/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/kapptemplate/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/kapptemplate/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/kcachegrind/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/kcachegrind/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/kompare/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/kompare/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/lokalize/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/lokalize/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/okteta/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/okteta/index.cache.bz2 differ Binary files /tmp/Vc5B8t8GCr/kdesdk-4.7.90/doc/umbrello/index.cache.bz2 and /tmp/F1E4kY1clX/kdesdk-4.7.95/doc/umbrello/index.cache.bz2 differ diff -Nru kdesdk-4.7.90/dolphin-plugins/bazaar/fileviewbazaarplugin.desktop kdesdk-4.7.95/dolphin-plugins/bazaar/fileviewbazaarplugin.desktop --- kdesdk-4.7.90/dolphin-plugins/bazaar/fileviewbazaarplugin.desktop 2011-11-04 14:37:53.000000000 +0000 +++ kdesdk-4.7.95/dolphin-plugins/bazaar/fileviewbazaarplugin.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=Bazaar Name[cs]=Bazaar Name[de]=Bazaar +Name[es]=Bazaar Name[hu]=Bazaar +Name[it]=Bazaar +Name[kk]=Bazaar Name[lt]=Bazaar Name[nb]=Bazaar Name[nds]=Bazaar Name[nl]=Bazaar +Name[pa]=ਬਾਜ਼ਾਰ Name[pt]=Bazaar Name[pt_BR]=Bazaar Name[sv]=Bazaar diff -Nru kdesdk-4.7.90/dolphin-plugins/hg/fileviewhgplugin.desktop kdesdk-4.7.95/dolphin-plugins/hg/fileviewhgplugin.desktop --- kdesdk-4.7.90/dolphin-plugins/hg/fileviewhgplugin.desktop 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/dolphin-plugins/hg/fileviewhgplugin.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -3,7 +3,12 @@ Name=Mercurial Name[ca]=Mercurial Name[de]=Mercurial +Name[es]=Mercurial +Name[it]=Mercurial +Name[kk]=Mercurial +Name[nb]=Mercurial Name[nl]=Mercurial +Name[pa]=ਮਰਕਰੀਅਲ Name[pt]=Mercurial Name[pt_BR]=Mercurial Name[sv]=Mercurial diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/akonadiresource/akonadiresource.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/akonadiresource/akonadiresource.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/akonadiresource/akonadiresource.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/akonadiresource/akonadiresource.kdevtemplate 2011-12-20 21:00:10.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,7 +23,10 @@ Name[zh_TW]=C++ Comment=Akonadi Resource Template. A template for an Akonadi PIM data resource Comment[ca]=Una plantilla de recurs de l'Akonadi. Una plantilla per un recurs de dades PIM de l'Akonadi +Comment[es]=Plantilla de recurso de Akonadi. Una plantilla para un recurso de datos PIM de Akonadi Comment[hu]=Akonadi erőforrássablon. Sablon Akonadi PIM adatforráshoz +Comment[it]=Modello di risorsa Akonadi. Un modello per una risorsa di dati PIM Akonadi +Comment[kk]=Akonadi ресурсының үлгісі/ Akonadi PIM дерек көзінің үлгісі Comment[nb]=Akonadi ressursmal. En mal for en Akonadi PIM-ressurs Comment[nl]=Akonadi sjabloon voor hulpbron. Een sjabloon voor een Akonadi PIM gegevenshulpbron Comment[pt]=Modelo de Recurso do Akonadi. Um modelo para um recurso de dados PIM do Akonadi @@ -27,6 +34,7 @@ Comment[sv]=Akonadi-resursmall. En mall för en Akonadi PIM-dataresurs Comment[uk]=Шаблон ресурсу Akonadi. Шаблон для ресурсу даних PIM Akonadi Comment[x-test]=xxAkonadi Resource Template. A template for an Akonadi PIM data resourcexx +Comment[zh_CN]=Akonadi 资源模板。Akonadi 个人信息管理数据资源的模板 Comment[zh_TW]=Akonadi 資源樣本。Akonadi PIM 資料資源的樣本。 Category=KDE/Akonadi Resource Icon=akonadi-resources.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate 2011-11-04 14:37:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,7 +23,10 @@ Name[zh_TW]=C++ Comment=Akonadi Serializer Template. A template for an Akonadi data serializer plugin Comment[ca]=Plantilla de serialitzador de l'Akonadi. Una plantilla per un connector de serialització de dades de l'Akonadi +Comment[es]=Plantilla de serializador de Akonadi. Una plantilla para un complemento serializador de datos de Akonadi Comment[hu]=Akonadi adatkezelő sablon. Sablon Akonadi adatkezelő modulhoz +Comment[it]=Modello di serializzatore Akonadi. Un modello per un'estensione di serializzazione di dati di Akonadi +Comment[kk]=Akonadi тізбектеуіш үлгісі. Akonadi дерек тізбектеуіш плагинің үлгісі Comment[nb]=Akonadi serialisatormal. En mal for et Akonadi-serialisatortillegg Comment[nl]=Akonadi sjabloon voor serialisator. Een sjabloon voor een Akonadi serialisatorplug-in Comment[pt]=Modelo de Serialização do Akonadi. Um modelo para um 'plugin' de serialização de dados do Akonadi @@ -27,6 +34,7 @@ Comment[sv]=Akonadi-serialiseringsmall. En mall för ett Akonadi insticksprogram för dataserialisering Comment[uk]=Шаблон серіалізатора Akonadi. Шаблон для додатка перетворення даних у послідовну форму Akonadi Comment[x-test]=xxAkonadi Serializer Template. A template for an Akonadi data serializer pluginxx +Comment[zh_CN]=Akonadi 数据转换器模板。Akonadi 数据转换器插件的模板 Comment[zh_TW]=Akonadi 序列器樣本。Akonadi 資料序列器外掛程式樣本 Category=KDE/Akonadi Serializer Icon=akonadi-serializer.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/flake/flake.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/flake/flake.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/flake/flake.kdevtemplate 2011-11-04 14:37:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/flake/flake.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=KOffice Shape Template (Flake). A KOffice plugin template with a shape, a tool and a docker (please use ThisFormat for the project name) Comment[ca]=Plantilla de forma del KOffice (floc). Una plantilla de connector del KOffice (amb una forma, una eina i un acoblador (si us plau, useu AquestFormat pel nom del projecte) +Comment[es]=Plantilla de forma para KOffice (Flake). Una plantilla de complemento para KOffice con una forma, una herramienta y un anclaje (use EsteFormato para el nombre del proyecto) +Comment[it]=Modello di forma di KOffice (Flake). Un modello di estensione di KOffice con una forma, uno strumento e un gancio (usa questo formato per il nome del progetto) +Comment[kk]=KOffice форма үлгісі. KOffice форма үлгісінің плагині, құрал мен докері (ThisFormat пішімді жоба атауын пайдаланыңыз) Comment[nb]=KOffice formmal (flak). En KOffice mal for programtillegg med en form, et verktøy og en dokker (bruk ThisFormat som prosjektnavn). Comment[nl]=KOffice sjabloon voor vorm (Flake). Een sjabloonplug-in voor KOffice met een vorm, een hulpmiddel en een verankering (gaarne DezeOpmaak gebruiken voor de projectnaam) Comment[pt]=Modelo de Forma do KOffice (Flake). Um modelo de 'plugin' do KOffice com uma forma, uma ferramenta e uma área acoplável (use por favor EsteFormato como nome do projecto) @@ -26,5 +33,6 @@ Comment[sv]=Koffice-formmall (flinga). En Koffice-insticksmall med en form, ett verktyg och en panel (använd projektnamnet ThisFormat) Comment[uk]=Шаблон форми KOffice (Flake). Шаблон додатка KOffice з формою, інструментом або панеллю (будь ласка, використовуйте назву проекту у форматі ThisFormat) Comment[x-test]=xxKOffice Shape Template (Flake). A KOffice plugin template with a shape, a tool and a docker (please use ThisFormat for the project name)xx +Comment[zh_CN]=KOffice 形状模板(Flake)。包含形状、工具和停靠部件的 KOffice 插件模板(工程名称请使用 ThisFormat) Comment[zh_TW]=KOffice 元件樣本(Flake)。是一套 KOffice 樣本,包含元件、工具與嵌入器(專案名稱請使用此格式) Category=KOffice/Flake diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kapp4/kapp4.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/kapp4/kapp4.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/kapp4/kapp4.kdevtemplate 2011-11-04 14:37:49.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kapp4/kapp4.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -3,11 +3,15 @@ Name=C++ KDE Name[ca]=C++ KDE Name[de]=C++ KDE +Name[es]=C++ KDE Name[hu]=C++ KDE +Name[it]=C++ KDE +Name[kk]=C++ KDE Name[lt]=C++ KDE Name[nb]=C++ KDE Name[nds]=C++ KDE Name[nl]=C++ KDE +Name[pa]=C++ KDE Name[pt]=C++ para KDE Name[pt_BR]=C++ KDE Name[sv]=C++ KDE @@ -17,6 +21,9 @@ Name[zh_TW]=C++ KDE Comment=KDE 4 GUI Application. KDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KConfig XT Comment[ca]=Aplicació IGU del KDE 4. Plantilla simple del KDE4 basada en el CMake, hereva del XMLGuiWindow i que demostra com usar el KConfig XT +Comment[es]=Aplicación de interfaz gráfica para KDE 4. Sencilla plantilla para KDE 4 basada en CMake, que hereda de XMLGuiWindow y demuestra cómo usar KConfig XT +Comment[it]=Applicazione grafica di KDE. Un modello semplice per KDE 4 basato su CMake; eredita da XMLGuiWindow e dimostra come usare KConfig XT. +Comment[kk]=KDE4 GUI қолданбасы. KDE4-тің CMake негіздеген қарапайым үлгісі, XMLGuiWindow-ды туындайды, KConfig XT пайдалануын көрсетеді Comment[nb]=KDE 4 GUI-program. Enkel KDE4-mal basert på CMake, arver fra XMLGuiWindow og viser hvordan du kan bruke KConfig XT. Comment[nl]=KDE 4 GUI-toepassing. Eenvoudig KDE4 sjabloon gebaseerd op CMake, afkomstig van XMLGuiWindow en demonstreert hoe je KConfig XT kunt gebruiken Comment[pt]=Aplicação Gráfica para o KDE4. Um modelo simples para KDE4 com base no CMake, que herda do XMLGuiWindow e demonstra como utilizar o KConfig XT @@ -24,6 +31,7 @@ Comment[sv]=KDE 4-program med grafiskt användargränssnitt. Enkel KDE4-mall baserad på CMake, ärver XMLGuiWindow och demonstrerar hur man använder KConfig XT Comment[uk]=Програма KDE 4 з графічним інтерфейсом. Простий шаблон програми для KDE4, заснований на CMake, успадковує клас XMLGuiWindow і демонструє використання KConfig XT Comment[x-test]=xxKDE 4 GUI Application. KDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KConfig XTxx +Comment[zh_CN]=KDE 4 GUI 应用程序。基于 CMake,继承自 XMLGuiWindow 和演示如何使用 KConfig XT 的 KDE4 简单模板 Comment[zh_TW]=KDE4 使用者介面的應用程式。基於 CMake 的 KDE4 簡單應用程式樣本,從 XMLGuiWindow 繼承而來,用於展示如何使用 KConfig XT Category=KDE/Graphical Icon=kapp4.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,6 +4,10 @@ Name[ca]=Una aplicació QML Name[cs]=Aplikace QML Name[de]=QML-Anwendung +Name[es]=Aplicación QML +Name[it]=Applicazione QML +Name[kk]=QML қолданбасы +Name[nb]=QML-program Name[nl]=QML-toepassing Name[pt]=Aplicação em QML Name[pt_BR]=Aplicativo QML @@ -14,6 +18,9 @@ Name[zh_TW]=QML 應用程式 Comment=KDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KConfig XT and QML Comment[ca]=Plantilla senzilla del KDE4 basada en CMake, que hereta XMLGuiWindow i demostra com usar KConfig XT i QML +Comment[es]=Sencilla plantilla para KDE 4 basada en CMake, que hereda de XMLGuiWindow y demuestra cómo usar KConfig XT y QML +Comment[it]=Un modello semplice per KDE 4 basato su CMake; eredita da XMLGuiWindow e dimostra come usare KConfig XT e QML. +Comment[kk]=KDE4-тің CMake негіздеген қарапайым үлгісі, XMLGuiWindow-ды туындайды, KConfig XT және QML пайдалануын көрсетеді Comment[nb]=Enkel KDE4-mal basert på CMake, arver fra XMLGuiWindow og viser hvordan du kan bruke KConfig XT og QML. Comment[nl]=Eenvoudig KDE4 sjabloon gebaseerd op CMake, afkomstig van XMLGuiWindow en demonstreert hoe u KConfig XT en QML kunt gebruiken Comment[pt]=Um modelo simples para KDE4 com base no CMake, que herda do XMLGuiWindow e demonstra como utilizar o KConfig XT e o QML @@ -21,6 +28,7 @@ Comment[sv]=Enkel KDE4-mall baserad på CMake, ärver XMLGuiWindow och demonstrerar hur man använder KConfig XT och QML Comment[uk]=Програма KDE 4 з графічним інтерфейсом. Простий шаблон програми для KDE4, заснований на CMake, успадковує клас XMLGuiWindow і демонструє використання KConfig XT та QML Comment[x-test]=xxKDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KConfig XT and QMLxx +Comment[zh_CN]=基于 CMake,继承自 XMLGuiWindow 和演示如何使用 KConfig XT 和 QML 的 KDE4 简单模板 Comment[zh_TW]=KDE4 使用者介面的應用程式。基於 CMake 的 KDE4 簡單應用程式樣本,從 XMLGuiWindow 繼承而來,用於展示如何使用 KConfig XT 與 QML Category=KDE/Graphical Icon=kapp4.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kde-simple/kde-simple.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/kde-simple/kde-simple.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/kde-simple/kde-simple.kdevtemplate 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kde-simple/kde-simple.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -2,6 +2,9 @@ [General] Name=Minimal C++ KDE Name[ca]=C++ KDE mínima +Name[es]=C++ KDE mínimo +Name[it]=C++ KDE minimo +Name[kk]=Минималды C++ KDE Name[lt]=Minimalus C++ KDE Name[nb]=Minimal C++ KDE Name[nl]=Minimale C++ KDE @@ -16,6 +19,9 @@ Comment[ca]=Una aplicació IGU del KDE molt bàsica en C++ Comment[cs]=Úplně základní GUI aplikace KDE v C++ Comment[de]=Eine sehr einfache KDE-Anwendung mit grafischer Oberfläche in C++ +Comment[es]=Una aplicación en C++ muy básica con interfaz gráfica para KDE +Comment[it]=Una semplicissima applicazione grafica di KDE in C++ +Comment[kk]=C++ тілдегі өте шектелген KDE GUI қолданбасы Comment[nb]=Et svært enkelt KDE GUI-program i C++ Comment[nl]=Een zeer basale KDE GUI-toepassing in C++ Comment[pt]=Uma aplicação gráfica muito básica do KDE em C++ @@ -23,6 +29,7 @@ Comment[sv]=Ett mycket enkelt KDE-program med grafiskt gränssnitt i C++ Comment[uk]=Мінімалістична програма з графічним інтерфейсом KDE на C++ Comment[x-test]=xxA very basic KDE GUI Application in C++xx +Comment[zh_CN]=非常简单的 C++ KDE GUI 应用程序 Comment[zh_TW]=最基本的 C++ KDE 圖形介面應用程式 Category=KDE/Graphical Icon=kde-simple.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kde-simple/src/%{APPNAMELC}.desktop kdesdk-4.7.95/kapptemplate/templates/C++/kde-simple/src/%{APPNAMELC}.desktop --- kdesdk-4.7.90/kapptemplate/templates/C++/kde-simple/src/%{APPNAMELC}.desktop 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kde-simple/src/%{APPNAMELC}.desktop 2011-12-20 21:00:09.000000000 +0000 @@ -54,7 +54,10 @@ GenericName[ca]=Una aplicació senzilla del KDE GenericName[cs]=Jednoduchá aplikace KDE GenericName[de]=Eine einfache KDE-Anwendung +GenericName[es]=Una aplicación sencilla para KDE GenericName[hu]=Egyszerű KDE alkalmazás +GenericName[it]=Una semplice applicazione di KDE +GenericName[kk]=Қарапайым KDE қолданбасы GenericName[nb]=Et enkelt KDE4-program GenericName[nl]=Een eenvoudige KDE-toepassing GenericName[pt]=Uma Aplicação Simples do KDE @@ -62,4 +65,5 @@ GenericName[sv]=Ett enkelt KDE-program GenericName[uk]=Проста програма для KDE GenericName[x-test]=xxA Simple KDE Applicationxx +GenericName[zh_CN]=简单的 KDE 应用程序 GenericName[zh_TW]=簡單的 KDE 應用程式 diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kofficetext/kofficetext.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/kofficetext/kofficetext.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/kofficetext/kofficetext.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kofficetext/kofficetext.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=KOffice Text-Plugin Template. A KOffice plugin template to add new features for modifying text (use ThisFormat for the project name) Comment[ca]=Plantilla de connector de text del KOffice. Una plantilla de connector del KOffice per afegir noves característiques per modificar text (useu AquestFormat pel nom del projecte) +Comment[es]=Plantilla de complemento de texto para KOffice. Una plantilla de complemento para KOffice que añade nuevas funciones de modificación de texto (use EsteFormato en el nombre del proyecto) +Comment[it]=Modello di estensione di testo di KOffice. Un modello di estensioni di KOffice per aggiungere nuove funzionalità per modificare il testo (usa questo formato per il nome del progetto) +Comment[kk]=KOffice плагин үлгісі. KOffice мәтінді өзгертуге арналған жаңа мүмкіндіктерді қосатын үлгісінің плагині (ThisFormat пішімді жоба атауын пайдаланыңыз) Comment[nb]=KOffice tekstmodul-mal. En KOffice mal for programtillegg som legger til nye muligheter til å endre tekst (bruk ThisFormat som prosjektnavn). Comment[nl]=KOffice sjabloon voor tekst-plug-in. Een plug-in voor KOffice met nieuwe functies voor het wijzigen van tekst(gaarne DezeOpmaak gebruiken voor de projectnaam) Comment[pt]=Modelo de 'Plugin' de Texto do KOffice. Um modelo de 'plugin' do KOffice para adicionar novas funcionalidades de modificação de texto (use por favor EsteFormato como nome do projecto) @@ -26,5 +33,6 @@ Comment[sv]=Mall för Koffice-textinsticksprogram. En Koffice-insticksmodulmall för att lägga till nya funktioner för textmodifiering (använd projektnamnet ThisFormat) Comment[uk]=Шаблон додатка роботи з текстом KOffice. Шаблон додатка KOffice, призначений для додавання нових можливостей зміни тексту (будь ласка, використовуйте назву проекту у форматі ThisFormat) Comment[x-test]=xxKOffice Text-Plugin Template. A KOffice plugin template to add new features for modifying text (use ThisFormat for the project name)xx +Comment[zh_CN]=KOffice 文本插件模板。用于向修改文本功能加入新特性的 KOffice 插件模板(工程名称请使用 ThisFormat) Comment[zh_TW]=KOffice 文字外掛程式樣本。是一套 KOffice 外掛程式樣本,用於新增變更文字的功能(專案名稱請使用此格式) Category=KOffice/Text-Plugin diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/konqplugin/konqplugin.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/konqplugin/konqplugin.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/konqplugin/konqplugin.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/konqplugin/konqplugin.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=KDE 4 Konqueror plugin. KDE4 simple template based on CMake, inherits from KParts::Plugin and demonstrates how to write a konqueror plugin Comment[ca]=Connector del Konqueror de KDE 4. Plantilla simple del KDE4 basada en el CMake, hereva de KParts::Plugin i que demostra com escriure un connector del konqueror +Comment[es]=Complemento de Konqueror para KDE 4. Sencilla plantilla para KDE4 basada en CMake, que hereda de KParts::Plugin y demuestra cómo escribir un complemento para Konqueror +Comment[it]=Estensione di Konqueror per KDE 4. Un modello semplice per KDE 4 basato su CMake; eredita da KParts::Plugin e dimostra come scrivere un'estensione di Konqueror. +Comment[kk]=KDE4 Konqueror плагині. KDE4-тің CMake негіздеген қарапайым үлгісі, Parts::Plugin-ды туындайды, konqueror плагинің қалай жазуыды көрсетеді Comment[nb]=KDE 4 Konqueror programtillegg. Enkel KDE 4-mal basert på CMake, arver fra KParts::Plugin og viser hvordan du kan skrive et programtillegg for konqueror Comment[nl]=KDE 4 plugin voor Konqueror. Eenvoudig KDE4 sjabloon gebaseerd op CMake, krijgt zaken van KParts::Plug-in en demonstreert hoe een konqueror-plug-in te schrijven Comment[pt]='Plugin' do Konqueror para o KDE 4. Um modelo simples para KDE4 com base no CMake, que herda do KParts::Plugin e demonstra como criar um 'plugin' para o Konqueror @@ -26,6 +33,7 @@ Comment[sv]=KDE 4-insticksprogram för Konqueror. Enkel KDE4-mall baserad på CMake, ärver KParts::Plugin och demonstrerar hur man använder skriver ett insticksprogram för Konqueror Comment[uk]=Додаток до Konqueror з KDE 4. Простий шаблон програми для KDE4, заснований на CMake, успадковує клас KParts::Plugin і є зразком додатка до Konqueror. Comment[x-test]=xxKDE 4 Konqueror plugin. KDE4 simple template based on CMake, inherits from KParts::Plugin and demonstrates how to write a konqueror pluginxx +Comment[zh_CN]=KDE 4 Konqueror 插件。基于 CMake,继承自 KParts::Plugin 类,用于演示如何写 konqueror 插件的 KDE4 简单模板 Comment[zh_TW]=KDE 4 Konqueror 外掛程式。是一套基於 CMake 的 KDE4 簡單樣本,從 KParts::Plugin 繼承而來,用於展示如何撰寫 konqueror 外掛程式 Category=KDE/Konqueror Plugin Icon=konqplugin.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/kpartapp/kpartapp.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/kpartapp/kpartapp.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/kpartapp/kpartapp.kdevtemplate 2011-11-04 14:37:51.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/kpartapp/kpartapp.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=KDE 4 KPart Application. KDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KPart Comment[ca]=KPart d'aplicació del KDE 4. Plantilla simple del KDE4 basada en el CMake, hereva del XMLGuiWindow i que demostra com usar el KPart +Comment[es]=Aplicación KPart para KDE 4. Sencilla plantilla para KDE4 basada en CMake, que hereda de XMLGuiWindow y demuestra cómo usar KPart +Comment[it]=Applicazione KPart di KDE 4. Un modello semplice per KDE 4 basato su CMake; eredita da XMLGuiWindow e dimostra come usare KPart. +Comment[kk]=KDE 4 KPart қолданбасы. KDE4-тің CMake негіздеген қарапайым үлгісі, XMLGuiWindow-ды туындайды, KPart-ты пайдалануын көрсетеді Comment[nb]=KDE 4 KPart-program. Enkel KDE4-mal basert på CMake, arver fra XMLGuiWindow og viser hvordan du kan bruke KPart Comment[nl]=KDE 4 KPart toepassing. Eenvoudig KDE4 sjabloon gebaseerd op CMake, afkomstig van XMLGuiWindow en demonstreert hoe je KPart kunt gebruiken Comment[pt]=Aplicação KPart do KDE 4. Um modelo simples para KDE4 com base no CMake, que herda do XMLGuiWindow e demonstra como utilizar o KPart @@ -26,6 +33,7 @@ Comment[sv]=KDE 4 KPart-program. Enkel KDE4-mall baserad på CMake, ärver XMLGuiWindow och demonstrerar hur man använder KPart Comment[uk]=Модуль KPart KDE 4. Простий шаблон програми для KDE4, заснований на CMake, успадковує клас XMLGuiWindow і демонструє використання KPart Comment[x-test]=xxKDE 4 KPart Application. KDE4 simple template based on CMake, inherits from XMLGuiWindow and demonstrates how to use KPartxx +Comment[zh_CN]=KDE 4 KPart 应用程序。基于 CMake,继承自 XMLGuiWindow 和演示如何使用 KPart 的 KDE4 简单模板 Comment[zh_TW]=KDE4 KPart 應用程式,是一套基於 CMake 的 KDE4 簡單應用程式樣本,從 XMLGuiWindow 繼承而來,用於展示如何使用 KPart Category=KDE/KPart Icon=kpartapp.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/ktexteditor/ktexteditor.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/ktexteditor/ktexteditor.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/ktexteditor/ktexteditor.kdevtemplate 2011-11-04 14:37:51.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/ktexteditor/ktexteditor.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=KTextEditor Plugin Template. A KTextEditor plugin template to perform special operations on text in KWrite, Kate, KDevelop etc. (use ThisFormat for the project name) Comment[ca]=Plantilla de connector del KTextEditor. Una plantilla de connector del KTextEditor per realitzar operacions especials de text en KWrite, Kate, KDevelop, etc... (useu AquestFormat pel nom del projecte) +Comment[es]=Plantilla de complemento para KTextEditor. Un complemento de KTextEditor para realizar operaciones especiales sobre el texto en KWrite, Kate, KDevelop, etc. (use EsteFormato para el nombre del proyecto) +Comment[it]=Modello di estensione di KTextEditor. Un modello di estensioni di KTextEditor per effettuare operazioni speciali in KWrite, Kate, KDevelop eccetera (usa questo formato per il nome del progetto). +Comment[kk]=KTextEditor плагинінің үлгісі. Write, Kate, KDevelop т.б. бағдарламаларында мәтінмен арнаулы амалдар істейтін KTextEditor плагиннің үлгісі (ThisFormat пішімді жоба атауын пайдаланыңыз) Comment[nb]=KTextEditor mal for programtillegg. En KTextEditor-mal for programtillegg som utfører spesielle handlinger på tekst i KWrite, Kate, KDevelop osv. (bruk ThisFormat som prosjektnavn). Comment[nl]=Sjabloon voor KTextEditor-plug-in. Een plug-in-sjabloon voor KTextEditor voor het doen van speciale tekstbewerkingen in KWrite, Kate, KDevelop etc. (gaarne DezeOpmaak gebruiken voor de projectnaam) Comment[pt]=Modelo de 'Plugin' do KTextEditor. Um modelo de 'plugin' do KTextEditor para efectuar operações especiais sobre o texto no KWrite, Kate, KDevelop, etc. (use por favor EsteFormato como nome do projecto) @@ -26,5 +33,6 @@ Comment[sv]=Mall för Ktexteditor-insticksprogram. En Ktexteditor-insticksmodulmall för att utföra åtgärder med text i Kwrite, Kate, Kdevlop, etc. (använd projektnamnet ThisFormat) Comment[uk]=Шаблон додатка KTextEditor. Шаблон додатка KTextEditor, призначений для виконання дій над текстом у KWrite, Kate, KDevelop тощо. Будь ласка, використовуйте назву проекту у форматі ThisFormat. Comment[x-test]=xxKTextEditor Plugin Template. A KTextEditor plugin template to perform special operations on text in KWrite, Kate, KDevelop etc. (use ThisFormat for the project name)xx +Comment[zh_CN]=KTextEditor 插件模板。用于向 KWrite、Kate、KDevelop 中的文本进行特殊操作的 KTextEditor 插件模板(工程名称请使用 ThisFormat) Comment[zh_TW]=KTextEditor 外掛程式樣本,用於 KWrite、Kate、KDevelop 等對文字的特殊操作。(專案名稱請使用此格式) Category=KDE/Kate Plugin diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/plasmoid/plasmoid.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/plasmoid/plasmoid.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/plasmoid/plasmoid.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/plasmoid/plasmoid.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=Plasma Applet Template. A plasma applet template displaying an icon and a text Comment[ca]=Plantilla de miniaplicació del Plasma, Una plantilla de miniaplicació del plasma que mostra una icona i un text +Comment[es]=Plantilla de miniaplicación para Plasma. Una plantilla de miniaplicación para Plasma que muestra un icono y un texto +Comment[it]=Modello di programmino Plasma. Un modello di programmino Plasma che visualizza un'icona e del testo +Comment[kk]=Plasma апплет үлгісі. Таңбаша мен мәтінді көрсететін Plasma апплет үлгісі Comment[nb]=Plasma-mal. En mal for et Plasma-element som viser et ikon og en tekst Comment[nl]=Sjabloon voor Plasma-applet. Een sjabloon voor een plasma-applet dat een pictogram en tekst toont Comment[pt]=Modelo de 'Applet' do Plasma. Um modelo de 'applet' do Plasma que mostra um ícone e algum texto @@ -26,6 +33,7 @@ Comment[sv]=Mall för Plasma-miniprogram. En mall för ett Plasma-miniprogram som visar en ikon och en text Comment[uk]=Шаблон аплету Плазми. Шаблон аплету Плазми, який показу піктограму і текст Comment[x-test]=xxPlasma Applet Template. A plasma applet template displaying an icon and a textxx +Comment[zh_CN]=Plasma 小程序模板。显示图标和文本的 plasma 小程序模板 Comment[zh_TW]=Plasma 小程式樣本,用於顯示圖示與文字 Category=KDE/Plasmoid Icon=plasma-applet.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/qmake_qt4guiapp/qmake_qt4guiapp.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/qmake_qt4guiapp/qmake_qt4guiapp.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/qmake_qt4guiapp/qmake_qt4guiapp.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/qmake_qt4guiapp/qmake_qt4guiapp.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,7 +4,10 @@ Name[ca]=Qt - QMake C++ Name[cs]=Qt - QMake C++ Name[de]=Qt - QMake C++ +Name[es]=Qt - QMake C++ Name[hu]=Qt - QMake C++ +Name[it]=C++ con Qt e QMake +Name[kk]=Qt - QMake C++ Name[nb]=Qt – QMake C++ Name[nl]=Qt - QMake C++ Name[pt]=Qt - QMake C++ @@ -16,6 +19,9 @@ Name[zh_TW]=Qt - QMake C++ Comment=Qt4 GUI Application. Generate a QMake/Qt4 based application with graphical user interface (crossplatform compatible) Comment[ca]=Aplicació IGU Qt4. Genera una aplicació basada en QMake/Qt4 amb una interfície gràfica d'usuari (compatible amb multiplataforma) +Comment[es]=Aplicación con interfaz gráfica en Qt4. Genera una aplicación basada en QMake/Qt4 con interfaz gráfica de usuario (compatible multiplataforma) +Comment[it]=Applicazione grafica di Qt4. Genera un'applicazione basata su QMake/Qt4 con interfaccia utente grafica (compatibile su più piattaforme) +Comment[kk]=Qt4 GUI қолданбасы. QMake/Qt4 негіздейтін графикалық интерфейсті ( кроссплатформалық үйлесімді) қолданбасын құрып береді Comment[nb]=Qt4 GUI-program. Lag et QMake/Qt4-basert program med grafisk brukergrensesnitt (kryssplattform) Comment[nl]=Qt4 GUI-toepassing. Genereert een toepassing gebaseerd op QMake/Qt4 met een grafische interface (crossplatform compatibel) Comment[pt]=Aplicação Gráfica do Qt4. Gera uma aplicação baseada no QMake/Qt4 com uma interface gráfica (compatível com várias plataformas) @@ -23,6 +29,7 @@ Comment[sv]=Qt4-program med grafiskt användargränssnitt. Skapar en QMake/Qt4-baserat program med grafiskt användargränssnitt (kompatibelt mellan plattformar) Comment[uk]=Програма Qt4 з графічним інтерфейсом. Створення програми, заснованої на QMake/Qt4, з графічним інтерфейсом (годиться для декількох платформ) Comment[x-test]=xxQt4 GUI Application. Generate a QMake/Qt4 based application with graphical user interface (crossplatform compatible)xx +Comment[zh_CN]=Qt4 GUI 应用程序。生成一个基于 QMake/Qt4 的图形用户界面应用程序(跨平台兼容) Comment[zh_TW]=Qt4 使用者介面應用程式。產生以 QMake/Qt4 為基礎的應用程式,含圖形介面,並且跨平台 ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp Icon=qmake4gui.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/C++/runner/runner.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/C++/runner/runner.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/C++/runner/runner.kdevtemplate 2011-11-04 14:37:52.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/C++/runner/runner.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,11 +4,15 @@ Name[ca]=C++ Name[cs]=C++ Name[de]=C++ +Name[es]=C++ Name[hu]=C++ +Name[it]=C++ +Name[kk]=C++ Name[lt]=C++ Name[nb]=C++ Name[nds]=C++ Name[nl]=C++ +Name[pa]=C++ Name[pt]=C++ Name[pt_BR]=C++ Name[sv]=C++ @@ -19,6 +23,9 @@ Name[zh_TW]=C++ Comment=Plasma Runner Template. A plasma runner template Comment[ca]=Plantilla d'executor de Plasma. Una plantilla d'executor per Plasma +Comment[es]=Plantilla de lanzador para Plasma. Una plantilla de lanzador para Plasma +Comment[it]=Modello di esecutore Plasma. Un modello di esecutore Plasma +Comment[kk]=Plasma жеккіш үлгісі. Plasma-ның бір жеккіш үлгісі Comment[lt]=Plasma Runner šablonas. Plasma runner šablonas Comment[nb]=Plasma kjørermal. En Plasma-kjørermal Comment[nl]=Sjabloon voor Plasma-runner. Een plasma-starter sjabloon @@ -27,6 +34,7 @@ Comment[sv]=Plasma-mall för körning av program. Mall för Plasma körning av program Comment[uk]=Шаблон засобу запуску Плазми Comment[x-test]=xxPlasma Runner Template. A plasma runner templatexx +Comment[zh_CN]=Plasma 启动器模板。plasma 启动器模板 Comment[zh_TW]=Plasma 執行器樣本。 Category=KDE/KRunner Icon=runner.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/Python/pykde4app/pykde4app.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/Python/pykde4app/pykde4app.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/Python/pykde4app/pykde4app.kdevtemplate 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/Python/pykde4app/pykde4app.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,10 +4,14 @@ Name[ca]=Python Name[cs]=Python Name[de]=Python +Name[es]=Python Name[hu]=Python +Name[it]=Python +Name[kk]=Python Name[lt]=Python Name[nb]=Python Name[nl]=Python +Name[pa]=ਪਾਈਥਨ Name[pt]=Python Name[pt_BR]=Python Name[sv]=Python @@ -19,6 +23,9 @@ Comment=PyKDE4 GUI Application. PyKDE4 template - needs PyKDE4 Comment[ca]=Aplicació IGU PyKDE4. Plantilla PyKDE4 - necessita el PyKDE4 Comment[de]=Grafische PyKDE4-Anwendung. Vorlage für PyKDE4 – benötigt PyKDE4 +Comment[es]=Aplicación con interfaz gráfica en PyKDE4. Plantilla PyKDE4 (necesita PyKDE4) +Comment[it]=Applicazione grafica di PyKDE4. Modello PyKDE4 - richiede PyKDE4 +Comment[kk]=PyKDE4 GUI қолданбасы. PyKDE4 үлгсі - PyKDE4-ті қажет етеді Comment[nb]=PyKDE4 GUI-program. PyKDE4-mal – trenger PyKDE4 Comment[nl]=PyKDE4 GUI toepassing. PyKDE4-sjabloon - heeft PyKDE4 nodig Comment[pt]=Aplicação Gráfica em PyKDE4. Modelo do PyKDE4 - necessita do PyKDE4 @@ -26,6 +33,7 @@ Comment[sv]=PyKDE4-program med grafiskt användargränssnitt. Mall för PyKDE4 - kräver PyKDE4 Comment[uk]=Програма PyKDE4 з графічним інтерфейсом. Шаблон PyKDE4 — потрібен PyKDE4 Comment[x-test]=xxPyKDE4 GUI Application. PyKDE4 template - needs PyKDE4xx +Comment[zh_CN]=PyKDE4 GUI 应用程序。PyKDE4 模板 - 需要 PyKDE4 Comment[zh_TW]=PyKDE4 使用者介面應用程式。PyKDE4 樣本─需要 PyKDE4 Icon=pykde4.png Category=KDE/Graphical diff -Nru kdesdk-4.7.90/kapptemplate/templates/Python/pyqt4app/pyqt4app.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/Python/pyqt4app/pyqt4app.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/Python/pyqt4app/pyqt4app.kdevtemplate 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/Python/pyqt4app/pyqt4app.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -2,6 +2,9 @@ [General] Name=Python Qt-only Name[ca]=Python només Qt +Name[es]=Python (solo Qt) +Name[it]=Python con solo Qt +Name[kk]=Python тек Qt ғана Name[lt]=Python tik Qt Name[nb]=Python bare Qt Name[nl]=Alleen Python Qt @@ -16,6 +19,9 @@ Comment=PyQt4 GUI Application. PyQt template using a Designer file - needs PyQt4 Comment[ca]=Aplicació IGU PyQt4. Plantilla PyQt que usa un fitxer de Designer - necessita el PyQt4 Comment[de]=Grafische PyQt4-Anwendung. Vorlage für PyQt mit Qt-Designer-Datei – benötigt PyQt4 +Comment[es]=Aplicación con interfaz gráfica en PyQt4. Plantilla PyQt que usa un archivo de Designer (necesita PyQt4) +Comment[it]=Applicazione grafica di PyQt4. Modello PyQt che usa un file di Designer - richiede PyQt4 +Comment[kk]=PyQt4 GUI қолданбасы. Designer файлын қолданатын PyQT4 үлгсі - PyKQT4-ті қажет етеді Comment[nb]=PyQt4 GUI-program.PyQt-mal som bruker en Designer-fil – trenger PyQt4 Comment[nl]=PyQt4 GUI-toepassing. PyQt-sjabloon met een Designer-bestand - heeft PyQt4 nodig Comment[pt]=Aplicação Gráfica em PyQt4. Um modelo para o PyQt que usa um ficheiro do Designer - necessita do PyQt4 @@ -23,6 +29,7 @@ Comment[sv]=PyQt4-program med grafiskt användargränssnitt. Mall för PyKDE4 som använder en Designer-fil - kräver PyKDE4 Comment[uk]=Програма PyQt4 з графічним інтерфейсом. Шаблон PyQt, з використанням файла Designer — потрібен PyQt4 Comment[x-test]=xxPyQt4 GUI Application. PyQt template using a Designer file - needs PyQt4xx +Comment[zh_CN]=PyQt4 GUI 应用程序。使用 Designer 文件的 PyQt 模板 - 需要 PyQt4 Comment[zh_TW]=PyQt4 使用者介面應用程式。使用設計家檔案的 PyQt 樣本─需要 PyQt4 Icon=pyqt4app.png Category=KDE/Graphical diff -Nru kdesdk-4.7.90/kapptemplate/templates/ruby/kderubyapp/kderubyapp.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/ruby/kderubyapp/kderubyapp.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/ruby/kderubyapp/kderubyapp.kdevtemplate 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/ruby/kderubyapp/kderubyapp.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,7 +4,10 @@ Name[ca]=Ruby Name[cs]=Ruby Name[de]=Ruby +Name[es]=Ruby Name[hu]=Ruby +Name[it]=Ruby +Name[kk]=Ruby Name[lt]=Ruby Name[nb]=Ruby Name[nl]=Ruby @@ -19,6 +22,9 @@ Comment=KDE 4 Ruby GUI Application. KDE4 simple ruby template, inherits from XMLGuiWindow - needs korundum4 Comment[ca]=Aplicació IGU Ruby del KDE 4. Plantilla ruby senzilla del KDE4, hereva del XMLGuiWindow - necessita el «korundum4» Comment[de]=Grafische KDE-4-Ruby-Anwendung. Vorlage für einfache KDE-4-Ruby-Anwendung. Abgeleitet von XMLGuiWindow – benötigt Korundum 4 +Comment[es]=Aplicación Ruby con interfaz gráfica para KDE 4. Sencilla plantilla Ruby para KDE4, que hereda de XMLGuiWindow (necesita korundum4) +Comment[it]=Applicazione grafica di KDE 4 in Ruby. Modello Ruby semplice di KDE4, eredita da XMLGuiWindow - richiede konundrum4 +Comment[kk]=KDE 4 Ruby GUI қолданбасы. KDE4-тің Ruby тілдегі қарапайым үлгісі, XMLGuiWindow-ды туындайды, korundum4-ті қажет етеді Comment[nb]=KDE 4 Ruby GUI-program. KDE4 Enkel Ruby-mal. Arver fra XMLGuiWindow, og trenger korundum4 Comment[nl]=KDE 4 Ruby GUI-toepassing. Eenvoudig Ruby KDE4 sjabloon, afkomstig van XMLGuiWindow - heeft korondum4 nodig Comment[pt]=Aplicação Gráfica em Ruby para o KDE4. Um modelo simples em Ruby para o KDE4, que herda do XMLGuiWindow - necessita do korundum4 @@ -26,6 +32,7 @@ Comment[sv]=KDE 4 Ruby-program med grafiskt användargränssnitt. Enkel KDE4 Ruby-mall, ärver XMLGuiWindow - kräver korundum4 Comment[uk]=Програма на Ruby з графічним інтерфейсом для KDE 4. Простий шаблон KDE4 на ruby, успадковує клас XMLGuiWindow — потрібен korundum4 Comment[x-test]=xxKDE 4 Ruby GUI Application. KDE4 simple ruby template, inherits from XMLGuiWindow - needs korundum4xx +Comment[zh_CN]=KDE4 Ruby GUI 应用程序。继承自 XMLGuiWindow 的 KDE4 简单 ruby 模板 - 需要 korundum4 Comment[zh_TW]=KDE4 Ruby 使用者介面應用程式。KDE4 的簡單 ruby 樣本,從 XMLGuiWindow 繼承而來─需要 korundum4 Category=KDE/Graphical Icon=kderubyapp.png diff -Nru kdesdk-4.7.90/kapptemplate/templates/ruby/kderubyapp/src/%{APPNAMELC}.desktop kdesdk-4.7.95/kapptemplate/templates/ruby/kderubyapp/src/%{APPNAMELC}.desktop --- kdesdk-4.7.90/kapptemplate/templates/ruby/kderubyapp/src/%{APPNAMELC}.desktop 2011-07-27 18:25:20.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/ruby/kderubyapp/src/%{APPNAMELC}.desktop 2011-12-20 21:00:09.000000000 +0000 @@ -66,7 +66,7 @@ GenericName[ga]=Feidhmchlár Ruby KDE4 GenericName[gl]=Un programa en ruby de KDE4 GenericName[hu]=KDE4 Ruby alkalmazás -GenericName[it]=Un'applicazione Ruby di KDE +GenericName[it]=Un'applicazione Ruby di KDE4 GenericName[ja]=KDE 4 Ruby アプリケーション GenericName[kk]=KDE4 Ruby қолданбасы GenericName[km]=កម្មវិធី KDE4 Ruby diff -Nru kdesdk-4.7.90/kapptemplate/templates/ruby/rubykonqplugin/rubykonqplugin.kdevtemplate kdesdk-4.7.95/kapptemplate/templates/ruby/rubykonqplugin/rubykonqplugin.kdevtemplate --- kdesdk-4.7.90/kapptemplate/templates/ruby/rubykonqplugin/rubykonqplugin.kdevtemplate 2011-11-04 14:37:48.000000000 +0000 +++ kdesdk-4.7.95/kapptemplate/templates/ruby/rubykonqplugin/rubykonqplugin.kdevtemplate 2011-12-20 21:00:09.000000000 +0000 @@ -4,7 +4,10 @@ Name[ca]=Ruby Name[cs]=Ruby Name[de]=Ruby +Name[es]=Ruby Name[hu]=Ruby +Name[it]=Ruby +Name[kk]=Ruby Name[lt]=Ruby Name[nb]=Ruby Name[nl]=Ruby @@ -18,6 +21,9 @@ Name[zh_TW]=Ruby Comment=KDE 4 Ruby Konqueror plugin. KDE4 simple template based on CMake, inherits from KParts::Plugin and demonstrates how to write a konqueror plugin in Ruby Comment[ca]=Connector Ruby del Konqueror de KDE 4. Plantilla simple del KDE4 basada en el CMake, hereva de KParts::Plugin i que demostra com escriure un connector del konqueror en Ruby +Comment[es]=Complemento de Konqueror en Ruby para KDE 4. Sencilla plantilla para KDE 4 basada en CMake, que hereda de KParts::Plugin y demuestra cómo escribir un complemento para Konqueror en Ruby +Comment[it]=Estensione di Konqueror per KDE 4 in Ruby. Un modello semplice per KDE 4 basato su CMake; eredita da KParts::Plugin e dimostra come scrivere un'estensione di Konqueror in Ruby. +Comment[kk]=KDE 4 Ruby Konqueror плагині. KDE4-тің CMake негіздеген қарапайым үлгісі, KParts::Plugin-ды туындайды, konqueror плагинің Ruby-де қалай жазуыды көрсетеді Comment[nb]=KDE 4 Ruby Konqueror programtillegg, Enkel KDE4-mal basert på CMake, arver fra KParts::Plugin og viser hvordan du kan skrive et programtillegg for konqueror i Ruby Comment[nl]=KDE 4 Ruby plugin voor Konqueror. Eenvoudig KDE4 sjabloon gebaseerd op CMake, krijgt zaken van KParts::Plugin en demonstreert hoe een konqueror-plug-in in Ruby te schrijven Comment[pt]='Plugin' do Konqueror em Ruby para o KDE 4. Um modelo simples para KDE4 com base no CMake, que herda do KParts::Plugin e demonstra como criar um 'plugin' para o Konqueror em Ruby @@ -25,6 +31,7 @@ Comment[sv]=KDE 4 Ruby-insticksprogram för Konqueror. Enkel KDE4-mall baserad på CMake, ärver KParts::Plugin och demonstrerar hur man använder skriver ett insticksprogram för Konqueror i Ruby Comment[uk]=Додаток до Konqueror з KDE 4 на Ruby. Простий шаблон програми для KDE4, заснований на CMake, успадковує клас KParts::Plugin і є зразком додатка до Konqueror мовою Ruby. Comment[x-test]=xxKDE 4 Ruby Konqueror plugin. KDE4 simple template based on CMake, inherits from KParts::Plugin and demonstrates how to write a konqueror plugin in Rubyxx +Comment[zh_CN]=KDE 4 Ruby Konqueror 插件。基于 CMake,继承自 KParts::Plugin,用于演示如何用 Ruby 语言编写 Konqueror 插件的简单模板 Comment[zh_TW]=KDE4 Ruby Konqueror 外掛程式。基於 CMake 的 KDE4 簡單樣本,從 KParts::Plugin 繼承而來,用於展示如何以 Ruby 撰寫 konqueror 外掛程式 Category=KDE/Konqueror Plugin Icon=konqplugin.png diff -Nru kdesdk-4.7.90/kcachegrind/kcachegrind/kcachegrind.desktop kdesdk-4.7.95/kcachegrind/kcachegrind/kcachegrind.desktop --- kdesdk-4.7.90/kcachegrind/kcachegrind/kcachegrind.desktop 2011-10-11 14:51:44.000000000 +0000 +++ kdesdk-4.7.95/kcachegrind/kcachegrind/kcachegrind.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -78,7 +78,7 @@ GenericName[es]=Interfaz del analizador de rendimiento GenericName[et]=Profileerimisrakendus GenericName[eu]=Profilatzailearen interfazea -GenericName[fa]=پایانۀ گزارش‌گیر +GenericName[fa]=پایانه گزارش‌گیر GenericName[fi]=Profiloijan käyttöliittymä GenericName[fr]=Interface de profilage GenericName[ga]=Comhéadan ar Phróifíleoir @@ -139,7 +139,7 @@ Comment[gl]=Visualización dos datos da análise de rendemento Comment[hu]=Teljesítményprofil-adatok megjelenítése Comment[is]=Sjónræn framsetning gagna úr afkastakönnun -Comment[it]=Visualizzazione dei dati di profiling delle prestazioni +Comment[it]=Visualizzazione dei dati di profilo delle prestazioni Comment[ja]=パフォーマンスプロファイルデータを視覚化 Comment[kk]=Деректерді профильдеудің визуализациясы Comment[km]=កា​រ​មើល​ឃើញ​ការ​អនុវត្ត​របស់​ទិន្នន័យ​ទម្រង់ diff -Nru kdesdk-4.7.90/kcachegrind/qcachegrind/qcachegrind.desktop kdesdk-4.7.95/kcachegrind/qcachegrind/qcachegrind.desktop --- kdesdk-4.7.90/kcachegrind/qcachegrind/qcachegrind.desktop 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/kcachegrind/qcachegrind/qcachegrind.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -8,7 +8,10 @@ Name=QCachegrind Name[ca]=QCachegrind Name[de]=QCachegrind +Name[es]=QCachegrind Name[hu]=QCachegrind +Name[it]=QCachegrind +Name[kk]=QCachegrind Name[lt]=QCachegrind Name[nb]=QCachegrind Name[nl]=QCachegrind @@ -34,7 +37,7 @@ GenericName[es]=Interfaz del analizador de rendimiento GenericName[et]=Profileerimisrakendus GenericName[eu]=Profilatzailearen interfazea -GenericName[fa]=پایانۀ گزارش‌گیر +GenericName[fa]=پایانه گزارش‌گیر GenericName[fi]=Profiloijan käyttöliittymä GenericName[fr]=Interface de profilage GenericName[ga]=Comhéadan ar Phróifíleoir @@ -95,7 +98,7 @@ Comment[gl]=Visualización dos datos da análise de rendemento Comment[hu]=Teljesítményprofil-adatok megjelenítése Comment[is]=Sjónræn framsetning gagna úr afkastakönnun -Comment[it]=Visualizzazione dei dati di profiling delle prestazioni +Comment[it]=Visualizzazione dei dati di profilo delle prestazioni Comment[ja]=パフォーマンスプロファイルデータを視覚化 Comment[kk]=Деректерді профильдеудің визуализациясы Comment[km]=កា​រ​មើល​ឃើញ​ការ​អនុវត្ត​របស់​ទិន្នន័យ​ទម្រង់ diff -Nru kdesdk-4.7.90/kioslave/svn/ksvnd/ksvnd.desktop kdesdk-4.7.95/kioslave/svn/ksvnd/ksvnd.desktop --- kdesdk-4.7.90/kioslave/svn/ksvnd/ksvnd.desktop 2011-07-27 18:25:24.000000000 +0000 +++ kdesdk-4.7.95/kioslave/svn/ksvnd/ksvnd.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -15,7 +15,7 @@ Name[es]=Módulo de Subversion de KDED Name[et]=KDED Subversioni moodul Name[eu]=KDED Subversion modulua -Name[fa]=پیمانۀ زیرنسخۀ KDED +Name[fa]=پیمانه زیرنسخه KDED Name[fi]=KDED Subversion -moduuli Name[fr]=Module KDED pour Subversion Name[ga]=Modúl Subversion KDED diff -Nru kdesdk-4.7.90/kioslave/svn/svnhelper/apply_patch.desktop kdesdk-4.7.95/kioslave/svn/svnhelper/apply_patch.desktop --- kdesdk-4.7.90/kioslave/svn/svnhelper/apply_patch.desktop 2011-07-27 18:25:24.000000000 +0000 +++ kdesdk-4.7.95/kioslave/svn/svnhelper/apply_patch.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -75,7 +75,7 @@ Comment[es]=Aplicar el parche a otra carpeta o archivo Comment[et]=Paiga rakendamine teisele kataloogile/failile Comment[eu]=Aplikatu adabakia beste karpeta/fitxategi bati -Comment[fa]=اعمال کژنه به پوشه/پروندۀ دیگر +Comment[fa]=اعمال کژنه به پوشه/پرونده دیگر Comment[fi]=Toteuta korjaus toiseen kansioon/tiedostoon Comment[fr]=Applique le correctif à un autre dossier/fichier Comment[ga]=Cuir an paiste i bhfeidhm ar fhillteán/chomhad eile diff -Nru kdesdk-4.7.90/kioslave/svn/svnhelper/subversion.desktop kdesdk-4.7.95/kioslave/svn/svnhelper/subversion.desktop --- kdesdk-4.7.90/kioslave/svn/svnhelper/subversion.desktop 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/kioslave/svn/svnhelper/subversion.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -249,7 +249,7 @@ Comment[es]=Eliminar cualquier cambio local. Atención: esto no se puede deshacer. Comment[et]=Eemaldab kõik kohalikud muudatused. Hoiatus: seda ei saa tagasi võtta. Comment[eu]=Kendu lokalki egindako aldaketak. Abisua: ekintza hau ezin da desegin. -Comment[fa]=حذف همۀ تغییرات ایجادشدۀ محلی. اخطار - این نمی‌تواند انجام نشود. +Comment[fa]=حذف همه تغییرات ایجادشده محلی. اخطار - این نمی‌تواند انجام نشود. Comment[fi]=Poista kaikki paikallisesti tehdyt muutokset. Varoitus - muutosta ei voi perua. Comment[fr]=Annule toutes les modifications effectuées localement. Avertissement - il est impossible d'annuler cette action. Comment[ga]=Cealaigh aon athruithe a rinneadh go logánta. Rabhadh - ní bheidh tú in ann na hathruithe seo a fháil ar ais. @@ -361,7 +361,7 @@ Comment[es]=Renombrar un archivo localmente y en el repositorio. Use esto en lugar de añadir y eliminar para renombrar un archivo. Comment[et]=Faili ümbernimetamine nii kohalikult kui hoidlas. See on eelistatud viis faili ümbernimetamisel lisamise ja kustutamise asemel. Comment[eu]=Berrizendatu fitxategi bat lokalki eta biltegian. Erabili hau fitxategia ezabatu eta berriro gehitu ordez. -Comment[fa]=تغییر نام پروندۀ محلی و در مخزن. به جای افزودن و حذف، برای تغییر نام پرونده از این استفاده کنید. +Comment[fa]=تغییر نام پرونده محلی و در مخزن. به جای افزودن و حذف، برای تغییر نام پرونده از این استفاده کنید. Comment[fi]=Muuta paikallisen ja versionhallinnassa olevan tiedoston nimeä. Muuta tiedoston nimeä mieluummin näin kuin lisäämällä ja poistamalla. Comment[fr]=Renomme un fichier localement et dans le référentiel. Utilisez cette option pour renommer un fichier, au lieu de le supprimer puis l'ajouter. Comment[ga]=Athraigh ainm comhaid logánta agus sa stór. Úsáid é seo in ionad an comhad a scriosadh agus a chur ar ais chun a ainm a athrú. @@ -677,7 +677,7 @@ Comment[es]=Cambiar una determinada copia de trabajo a otra rama Comment[et]=Antud töökoopia lülitamine teise harru Comment[eu]=aldatu laneko kopia bat beste adar batekin -Comment[fa]=سودهی رونوشت کار داده‌شده به شاخۀ دیگر +Comment[fa]=سودهی رونوشت کار داده‌شده به شاخه دیگر Comment[fi]=Vaihda annettu työkopio toiseen haaraan Comment[fr]=Bascule la copie de travail indiquée vers une autre branche Comment[ga]=Athraigh an chóip oibre sonraithe go brainse eile @@ -785,7 +785,7 @@ Comment[es]=Mezclar los cambios entre esta y otra rama Comment[et]=Selle ja teise haru muudatuste ühendamine Comment[eu]=Bateratu hau eta beste adar baten arteko aldaketak -Comment[fa]=تغییرات بین این شاخه و شاخۀ دیگر را ادغام می‌کند +Comment[fa]=تغییرات بین این شاخه و شاخه دیگر را ادغام می‌کند Comment[fi]=Yhdistä tämän ja toisen haaran väliset muutokset Comment[fr]=Fusionne les modifications entre cette branche et une autre Comment[ga]=Cumaisc athruithe idir an brainse seo agus brainse eile diff -Nru kdesdk-4.7.90/kompare/kompare.desktop kdesdk-4.7.95/kompare/kompare.desktop --- kdesdk-4.7.90/kompare/kompare.desktop 2011-10-11 14:51:43.000000000 +0000 +++ kdesdk-4.7.95/kompare/kompare.desktop 2011-12-20 21:00:10.000000000 +0000 @@ -81,7 +81,7 @@ GenericName[es]=Interfaz Diff/Patch GenericName[et]=Diff/patch kasutajaliides GenericName[eu]=Desberdintasun/Adabaki interfazea -GenericName[fa]=پایانۀ Diff/کژنه +GenericName[fa]=پایانه Diff/کژنه GenericName[fi]=Diff/Patch-käyttöliittymä GenericName[fr]=Interface graphique pour Diff et Patch GenericName[ga]=Comhéadan Diff/Patch diff -Nru kdesdk-4.7.90/kuiviewer/kuiviewer.desktop kdesdk-4.7.95/kuiviewer/kuiviewer.desktop --- kdesdk-4.7.90/kuiviewer/kuiviewer.desktop 2011-08-22 13:32:16.000000000 +0000 +++ kdesdk-4.7.95/kuiviewer/kuiviewer.desktop 2011-12-20 21:00:12.000000000 +0000 @@ -74,7 +74,7 @@ GenericName[es]=Visor de archivos UI de Qt Designer GenericName[et]=Qt Designeri UI-failide näitaja GenericName[eu]=Qt Designer UI fitxartegi ikusgailua -GenericName[fa]=مشاهده‌گر پروندۀ واسط نگاره‌ای طراح Qt +GenericName[fa]=مشاهده‌گر پرونده واسط نگاره‌ای طراح Qt GenericName[fi]=Qt Designerin UI-tiedostojen katselin GenericName[fr]=Afficheur de fichiers d'interface graphique de Qt Designer GenericName[ga]=Amharcán Comhad Qt Designer diff -Nru kdesdk-4.7.90/lokalize/scripts/newprojectwizard.py kdesdk-4.7.95/lokalize/scripts/newprojectwizard.py --- kdesdk-4.7.90/lokalize/scripts/newprojectwizard.py 2011-07-27 18:25:32.000000000 +0000 +++ kdesdk-4.7.95/lokalize/scripts/newprojectwizard.py 2011-12-20 21:00:12.000000000 +0000 @@ -427,9 +427,6 @@ for langlang in [lang, lang[:2],'templates']: - os.system('svn --set-depth files up "%s/trunk/l10n-kde4/%s"' % (localsvnroot, langlang)) - os.system('svn --set-depth files up "%s/trunk/l10n-kde4/%s"' % (localsvnroot, langlang)) - self.reportProgress(5) os.system('svn --set-depth infinity up "%s/trunk/l10n-kde4/%s/messages"' % (localsvnroot, langlang)) os.system('svn --set-depth infinity up "%s/trunk/l10n-kde4/%s/messages"' % (localsvnroot, langlang)) self.reportProgress(15) diff -Nru kdesdk-4.7.90/lokalize/src/catalog/cmd.cpp kdesdk-4.7.95/lokalize/src/catalog/cmd.cpp --- kdesdk-4.7.90/lokalize/src/catalog/cmd.cpp 2011-12-02 21:33:51.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/catalog/cmd.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -104,7 +104,16 @@ || (otherPos.offset!=_pos.offset+_str.size()) ) return false; - _str += static_cast(other)->_str; + const QString& otherStr = static_cast(other)->_str; + + if (otherStr.isEmpty() || _str.isEmpty()) //just a precaution + return false; + + //be close to behaviour of LibreOffice + if (!_str.at(_str.size()-1).isSpace() && otherStr.at(0).isSpace()) + return false; + + _str += otherStr; return true; } diff -Nru kdesdk-4.7.90/lokalize/src/cataloglistview/cataloglistview.cpp kdesdk-4.7.95/lokalize/src/cataloglistview/cataloglistview.cpp --- kdesdk-4.7.90/lokalize/src/cataloglistview/cataloglistview.cpp 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/cataloglistview/cataloglistview.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -41,6 +41,9 @@ #include #include +#include +#include + #include #include @@ -60,6 +63,18 @@ QTreeView::keyReleaseEvent(e); } } + + //HACK to prevent redundant repaintings when widget isn't visible + void paintEvent(QPaintEvent* event) + { + if (QMdiSubWindow* sw=qobject_cast(parent()->parent()->parent()->parent())) + { + if (sw->mdiArea()->currentSubWindow()!=sw) + return; + } + + return QTreeView::paintEvent(event); + } }; @@ -120,7 +135,8 @@ m_browser->setColumnWidth(0,m_browser->columnWidth(0)/3); m_browser->setSortingEnabled(true); m_browser->sortByColumn(0, Qt::AscendingOrder); - m_browser->setWordWrap(true); + m_browser->setWordWrap(false); + m_browser->setUniformRowHeights(true); m_browser->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); diff -Nru kdesdk-4.7.90/lokalize/src/editortab.cpp kdesdk-4.7.95/lokalize/src/editortab.cpp --- kdesdk-4.7.90/lokalize/src/editortab.cpp 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/editortab.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -284,7 +284,7 @@ connect(m_view, SIGNAL(signalChanged(uint)), m_notesView, SLOT(removeErrorNotes())); connect(m_notesView,SIGNAL(escaped()),this,SLOT(setProperFocus())); - action=glossary->addAction(QLatin1String("edit_addnote"),m_notesView,SLOT(addNoteUI())); + action=edit->addAction(QLatin1String("edit_addnote"),m_notesView,SLOT(addNoteUI())); //action->setShortcut(Qt::CTRL+glist[i]); action->setText(i18nc("@action:inmenu","Add a note")); @@ -1317,6 +1317,17 @@ } */ +//HACK to prevent redundant repaintings when widget isn't visible +void EditorTab::paintEvent(QPaintEvent* event) +{ + if (QMdiSubWindow* sw=qobject_cast(parent())) + { + if (sw->mdiArea()->currentSubWindow()!=sw) + return; + } + LokalizeSubwindowBase2::paintEvent(event); +} + void EditorTab::indexWordsForCompletion() { CompletionStorage::instance()->scanCatalog(m_catalog); diff -Nru kdesdk-4.7.90/lokalize/src/editortab.h kdesdk-4.7.95/lokalize/src/editortab.h --- kdesdk-4.7.90/lokalize/src/editortab.h 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/editortab.h 2011-12-20 21:00:12.000000000 +0000 @@ -241,6 +241,9 @@ void fileAutoSaveFailedWarning(const QString&); +protected: + void paintEvent(QPaintEvent* event); + private: void setupAccel(); void setupActions(); diff -Nru kdesdk-4.7.90/lokalize/src/lokalizemainwindow.cpp kdesdk-4.7.95/lokalize/src/lokalizemainwindow.cpp --- kdesdk-4.7.90/lokalize/src/lokalizemainwindow.cpp 2011-08-07 15:48:24.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/lokalizemainwindow.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -90,6 +90,9 @@ m_mdiArea->setViewMode(QMdiArea::TabbedView); m_mdiArea->setActivationOrder(QMdiArea::ActivationHistoryOrder); m_mdiArea->setDocumentMode(true); +#if QT_VERSION >= 0x040800 + m_mdiArea->setTabsMovable(true); +#endif setCentralWidget(m_mdiArea); connect(m_mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(slotSubWindowActivated(QMdiSubWindow*))); @@ -928,6 +931,25 @@ +DelayedFileOpener::DelayedFileOpener(const KUrl::List& urls, LokalizeMainWindow* lmw) + : QObject() + , m_urls(urls) + , m_lmw(lmw) +{ + //do the work just after project load handlind is finished + //(i.e. all the files from previous project session are loaded) + QTimer::singleShot(1,this,SLOT(doOpen())); +} + +void DelayedFileOpener::doOpen() +{ + int lastIndex=m_urls.count()-1; + for (int i=0;i<=lastIndex;i++) + m_lmw->fileOpen(m_urls.at(i), 0, /*set as active*/i==lastIndex); + deleteLater(); +} + + #include "lokalizemainwindow.moc" //these have to be included somewhere ;) #include "lokalizesubwindowbase.moc" diff -Nru kdesdk-4.7.90/lokalize/src/lokalizemainwindow.h kdesdk-4.7.95/lokalize/src/lokalizemainwindow.h --- kdesdk-4.7.90/lokalize/src/lokalizemainwindow.h 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/lokalizemainwindow.h 2011-12-20 21:00:12.000000000 +0000 @@ -176,4 +176,19 @@ }; +class DelayedFileOpener: public QObject +{ +Q_OBJECT +public: + DelayedFileOpener(const KUrl::List& urls, LokalizeMainWindow* lmw); + +private slots: + void doOpen(); + +private: + KUrl::List m_urls; + LokalizeMainWindow* m_lmw; +}; + + #endif diff -Nru kdesdk-4.7.90/lokalize/src/lokalize.notifyrc kdesdk-4.7.95/lokalize/src/lokalize.notifyrc --- kdesdk-4.7.90/lokalize/src/lokalize.notifyrc 2011-12-02 21:33:51.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/lokalize.notifyrc 2011-12-20 21:00:12.000000000 +0000 @@ -144,6 +144,9 @@ [Event/NoSqlModulesAvailable] Name=No Qt Sql modules were found Name[ca]=No s'ha trobat cap mòdul Qt Sql +Name[es]=No se han encontrado módulos SQL para Qt +Name[it]=Non è stato trovato nessun modulo Qt Sql +Name[kk]=Qt Sql модульдері табылмаған Name[nb]=Fant ingen Qt SQL-moduler Name[nl]=Geen Qt-Sql-modules gevonden Name[pt]=Não foram encontrados módulos de SQL do Qt diff -Nru kdesdk-4.7.90/lokalize/src/main.cpp kdesdk-4.7.95/lokalize/src/main.cpp --- kdesdk-4.7.90/lokalize/src/main.cpp 2011-12-02 21:33:51.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/main.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -110,12 +110,13 @@ } LokalizeMainWindow* lmw=new LokalizeMainWindow; SettingsController::instance()->setMainWindowPtr(lmw); - kWarning()<<"showing LokalizeMainWindow"; lmw->show(); - kWarning()<<"LokalizeMainWindow shown"; - int j=args->count(); - while (--j>=0) - lmw->fileOpen(args->url(j)); + + KUrl::List urls; + for (int j=0; jcount(); j++) + urls << args->url(j); + if (urls.size()) + new DelayedFileOpener(urls, lmw); Project::instance()->model()->setCompleteScan(args->isSet("projectscan")); args->clear(); diff -Nru kdesdk-4.7.90/lokalize/src/msgctxtview.cpp kdesdk-4.7.95/lokalize/src/msgctxtview.cpp --- kdesdk-4.7.90/lokalize/src/msgctxtview.cpp 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/msgctxtview.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -174,6 +174,7 @@ if (link.scheme()=="note") { + int capabilities=m_catalog->capabilities(); if (!m_editor) { m_editor=new NoteEditor(this); @@ -182,14 +183,21 @@ connect(m_editor,SIGNAL(rejected()),this,SLOT(noteEditRejected())); } m_editor->setNoteAuthors(m_catalog->noteAuthors()); - if (path.endsWith("add")) - m_editor->setNote(Note(),-1); - else + QVector notes=m_catalog->notes(m_entry.toDocPosition()); + int noteIndex=-1;//means add new note + Note note; + if (!path.endsWith("add")) { - int pos=path.toInt(); - m_editor->setNote(m_catalog->notes(m_entry.toDocPosition()).at(pos),pos); + noteIndex=path.toInt(); + note=notes.at(noteIndex); } - m_editor->setFromFieldVisible(m_catalog->capabilities()&KeepsNoteAuthors); + else if (!(capabilities&MultipleNotes) && notes.size()) + { + noteIndex=0; //so we don't overwrite the only possible note + note=notes.first(); + } + m_editor->setNote(note,noteIndex); + m_editor->setFromFieldVisible(capabilities&KeepsNoteAuthors); m_stackedLayout->setCurrentIndex(1); } else if (link.scheme()=="src") diff -Nru kdesdk-4.7.90/lokalize/src/tm/dbfilesmodel.cpp kdesdk-4.7.95/lokalize/src/tm/dbfilesmodel.cpp --- kdesdk-4.7.90/lokalize/src/tm/dbfilesmodel.cpp 2011-08-07 15:48:24.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/tm/dbfilesmodel.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -136,7 +136,8 @@ void DBFilesModel::updateStats(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - if (m_timeSinceLastUpdate.elapsed()<60000) + if (m_timeSinceLastUpdate.elapsed()<60000 + || !topLeft.isValid() || !bottomRight.isValid()) return; qDebug()<<"DBFilesModel::updateStats() called"; diff -Nru kdesdk-4.7.90/lokalize/src/tm/tmtab.cpp kdesdk-4.7.95/lokalize/src/tm/tmtab.cpp --- kdesdk-4.7.90/lokalize/src/tm/tmtab.cpp 2011-08-22 13:32:17.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/tm/tmtab.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -102,6 +102,7 @@ bgBrush=scheme.background(KColorScheme::NormalBackground); painter->fillRect(option.rect, bgBrush); + painter->setClipRect(option.rect.adjusted(0,0,-2,0)); //painter->setFont(option.font); RowColumnUnion rc; @@ -113,26 +114,32 @@ QString text=index.data(TMDBModel::HtmlDisplayRole).toString(); cache.insert(rc.v, new QStaticText(text)); cache.object(rc.v)->setTextFormat(index.column()setTextWidth(option.rect.width()); - painter->drawStaticText(option.rect.topLeft(), *staticText); + //staticText->setTextWidth(rectWidth-4); + QPoint textStartPoint=option.rect.topLeft(); + textStartPoint.rx()+=2; + painter->drawStaticText(textStartPoint, *staticText); + if (staticText->size().width()<=rectWidth-4) + { + painter->restore(); + return; + } + painter->setPen(bgBrush.color()); QPoint p1=option.rect.topRight(); QPoint p2=option.rect.bottomRight(); - int limit=qMin(16, option.rect.width()); + int limit=qMin(8, rectWidth-2); int i=limit; while(--i>0) { painter->setOpacity(float(i)/limit); painter->drawLine(p1, p2); - int newX=p1.x()-1; - p1.setX(newX); - p2.setX(newX); + p1.rx()--; + p2.rx()--; } painter->restore(); } @@ -644,7 +651,7 @@ while (--column>=0) { //view->resizeColumnToContents(i); - int sum=0; + /* int max=0; int count=qMin(rowCount, 32); for (int row=0;rowitemDelegate()->sizeHint(QStyleOptionViewItemV2(),m_model->index(row,column)).width(); if (w>max) max=w; - sum+=w; - //qWarning()<index(row,column).isValid(); - //qWarning()<sizeHintForIndex(m_model->index(row,column)); - //qWarning()<data(m_model->index(row,column), Qt::SizeHintRole).toSize(); - //qWarning()<span(m_model->index(row,column)); } if (count) //qWarning()<<(sum/count); - //view->setColumnWidth(column, max); - //view->setColumnWidth(column, maxInitialWidths[column]); view->setColumnWidth(column, qMin(max, maxInitialWidths[column])); + */ + view->setColumnWidth(column, maxInitialWidths[column]); } view->setFocus(); //END resizeColumnToContents diff -Nru kdesdk-4.7.90/lokalize/src/version.h kdesdk-4.7.95/lokalize/src/version.h --- kdesdk-4.7.90/lokalize/src/version.h 2011-07-27 18:25:33.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/version.h 2011-12-20 21:00:12.000000000 +0000 @@ -4,9 +4,9 @@ // Description: // // -// Copyright: 2007 Nick Shaforostoff +// Copyright: 2007-2012 Nick Shaforostoff // // #ifndef LOKALIZE_VERSION -#define LOKALIZE_VERSION "1.2" +#define LOKALIZE_VERSION "1.4" #endif diff -Nru kdesdk-4.7.90/lokalize/src/xlifftextedit.cpp kdesdk-4.7.95/lokalize/src/xlifftextedit.cpp --- kdesdk-4.7.90/lokalize/src/xlifftextedit.cpp 2011-08-22 13:32:17.000000000 +0000 +++ kdesdk-4.7.95/lokalize/src/xlifftextedit.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -1258,7 +1258,6 @@ else { m_catalog->beginMacro(i18nc("@item Undo action item","Copy source to target")); - DocPosition pos=m_currentPos;pos.offset=0; removeTargetSubstring(0,-1,/*refresh*/false); insertCatalogString(sourceWithTags,0,/*refresh*/false); m_catalog->endMacro(); diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/test/scriptvalueconvertertest.cpp kdesdk-4.7.95/okteta/kasten/controllers/test/scriptvalueconvertertest.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/test/scriptvalueconvertertest.cpp 2011-08-22 13:32:07.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/test/scriptvalueconvertertest.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -124,4 +124,4 @@ QTEST_MAIN(ScriptValueConverterTest) -#include "scriptvalueconvertertest.moc" \ No newline at end of file +#include "scriptvalueconvertertest.moc" diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/bookmarks/bookmarkscontroller.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/bookmarks/bookmarkscontroller.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/bookmarks/bookmarkscontroller.cpp 2011-11-17 20:59:17.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/bookmarks/bookmarkscontroller.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -64,22 +64,22 @@ mDeleteAction = actionCollection->addAction( QLatin1String("bookmark_remove") ); mDeleteAction->setText( i18nc("@action:inmenu","Remove Bookmark") ); - connect( mDeleteAction, SIGNAL(triggered(bool) ), SLOT(deleteBookmark()) ); + connect( mDeleteAction, SIGNAL(triggered(bool)), SLOT(deleteBookmark()) ); mDeleteAction->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_B ); mDeleteAllAction = actionCollection->addAction( QLatin1String("bookmark_remove_all") ); mDeleteAllAction->setText( i18nc("@action:inmenu","Remove All Bookmarks") ); - connect( mDeleteAllAction, SIGNAL(triggered(bool) ), SLOT(deleteAllBookmarks()) ); + connect( mDeleteAllAction, SIGNAL(triggered(bool)), SLOT(deleteAllBookmarks()) ); // mDeleteAllAction->setShortcut( Qt::CTRL + Qt::Key_G ); mGotoNextBookmarkAction = actionCollection->addAction( QLatin1String("bookmark_next") ); mGotoNextBookmarkAction->setText( i18nc("@action:inmenu","Go to Next Bookmark") ); - connect( mGotoNextBookmarkAction, SIGNAL(triggered(bool) ), SLOT(gotoNextBookmark()) ); + connect( mGotoNextBookmarkAction, SIGNAL(triggered(bool)), SLOT(gotoNextBookmark()) ); mGotoNextBookmarkAction->setShortcut( Qt::ALT + Qt::Key_Down ); mGotoPreviousBookmarkAction = actionCollection->addAction( QLatin1String("bookmark_previous") ); mGotoPreviousBookmarkAction->setText( i18nc("@action:inmenu","Go to Previous Bookmark") ); - connect( mGotoPreviousBookmarkAction, SIGNAL(triggered(bool) ), SLOT(gotoPreviousBookmark()) ); + connect( mGotoPreviousBookmarkAction, SIGNAL(triggered(bool)), SLOT(gotoPreviousBookmark()) ); mGotoPreviousBookmarkAction->setShortcut( Qt::ALT + Qt::Key_Up ); mBookmarksActionGroup = new QActionGroup( this ); // TODO: do we use this only for the signal mapping? diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/selectrange/selectrangecontroller.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/selectrange/selectrangecontroller.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/selectrange/selectrangecontroller.cpp 2011-11-17 20:59:17.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/selectrange/selectrangecontroller.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -48,7 +48,7 @@ mSelectAction->setText( i18nc("@action:inmenu","&Select range...") ); mSelectAction->setIcon( KIcon(QLatin1String("select-rectangular")) ); mSelectAction->setShortcut( Qt::CTRL + Qt::Key_E ); - connect( mSelectAction, SIGNAL(triggered(bool) ), SLOT(select()) ); + connect( mSelectAction, SIGNAL(triggered(bool)), SLOT(select()) ); mTool = new SelectRangeTool(); connect( mTool, SIGNAL(isUsableChanged(bool)), diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/selectrange/selectrangeview.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/selectrange/selectrangeview.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/selectrange/selectrangeview.cpp 2011-11-17 20:59:17.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/selectrange/selectrangeview.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -139,7 +139,7 @@ setTabOrder( mRelativeCheckBox, mBackwardsCheckBox ); setTabOrder( mBackwardsCheckBox, mSelectButton ); - connect( mTool, SIGNAL(isApplyableChanged(bool)), SLOT( onApplyableChanged(bool)) ); + connect( mTool, SIGNAL(isApplyableChanged(bool)), SLOT(onApplyableChanged(bool)) ); onApplyableChanged( mTool->isApplyable() ); } diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.cpp 2011-10-11 14:51:59.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -71,6 +71,11 @@ { kDebug() << "old child count: " << childCount(); + if (!mData) + { + kWarning() << "mData == null"; + return QScriptValue(); + } //arrays with length zero are useless -> minimum is 0 if (newLength < 0) return context ? context->throwError(QLatin1String("new Array length is less than zero: ") @@ -89,14 +94,19 @@ QScriptValue ArrayDataInformation::setArrayType(QScriptValue type, QScriptContext* context) { + if (!mData) + { + kWarning() << "mData == null"; + return QScriptValue(); + } ScriptValueConverter conv(type, QLatin1String("dummy")); DataInformation* newChildType = conv.convert(); //return if conversion failed if (!newChildType) { if (context) - return context->throwError(QLatin1String("String '") + type.toString() - + QLatin1String("' is not a valid identifier for a primitive data type")); + return context->throwError(QLatin1String("'") + type.toString() + + QLatin1String("' is not a valid identifier for a data type")); else return QScriptValue(); } @@ -107,18 +117,21 @@ delete newChildType; return true; } + newChildType->setParent(this); uint len = mData->length(); TopLevelDataInformation* topLevel = topLevelDataInformation(); if (len > 0) { topLevel->_childrenAboutToBeRemoved(this, 0, len - 1); delete mData; + mData = 0; topLevel->_childrenRemoved(this, 0, len - 1); } else { //no need to emit the signals, which cause expensive model update delete mData; //don't emit the signals + mData = 0; } @@ -145,6 +158,8 @@ QVariant ArrayDataInformation::childData(int row, int column, int role) const { + if (!mData) + return QVariant(); Q_ASSERT(uint(row) < mData->length()); if (column == 0 && role == Qt::DisplayRole) { @@ -184,12 +199,22 @@ BitCount32 ArrayDataInformation::offset(unsigned int index) const { + if (!mData) + { + kWarning() << "mData == null"; + return 0; + } return mData->offset(index); } qint64 ArrayDataInformation::readData(Okteta::AbstractByteArrayModel* input, Okteta::Address address, BitCount64 bitsRemaining, quint8* bitOffset) { + if (!mData) + { + kWarning() << "mData == null"; + return -1; + } if (*bitOffset != 0) { kWarning() << "in array " << name() << ": bit offset != 0 (" << *bitOffset << "), adding padding," @@ -207,6 +232,11 @@ bool ArrayDataInformation::setChildData(uint row, const QVariant& value, Okteta::AbstractByteArrayModel* out, Okteta::Address address, BitCount64 bitsRemaining, quint8 bitOffset) { + if (!mData) + { + kWarning() << "mData == null"; + return false; + } if (bitOffset != 0) { kWarning() << "in array " << name() << ": bit offset != 0 (" << bitOffset << "), adding padding," diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.h kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.h --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.h 2011-10-11 14:51:59.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/array/arraydatainformation.h 2011-12-20 21:00:12.000000000 +0000 @@ -94,11 +94,15 @@ inline int ArrayDataInformation::length() const { + if (!mData) + return 0; return mData->length(); } inline QString ArrayDataInformation::typeName() const { + if (!mData) + return QString(); return mData->typeName(); //don't show name of child //return i18nc("array type then length", "%1[%2]", data->typeName(), childCount()); //TODO @@ -106,6 +110,8 @@ inline BitCount32 ArrayDataInformation::size() const { + if (!mData) + return 0; return mData->size(); } @@ -116,11 +122,15 @@ inline DataInformation* ArrayDataInformation::childAt(unsigned int idx) const { + if (!mData) + return 0; return mData->childAt(idx); } inline unsigned int ArrayDataInformation::childCount() const { + if (!mData) + return 0; return mData->length(); } @@ -131,36 +141,50 @@ inline int ArrayDataInformation::indexOf(const DataInformation*const data) const { + if (!mData) + return 0; return mData->indexOf(data); } inline QScriptValue ArrayDataInformation::childToScriptValue(uint index, QScriptEngine* engine, ScriptHandlerInfo* handlerInfo) const { + if (!mData) + return QScriptValue(); return mData->toScriptValue(index, engine, handlerInfo); } inline BitCount32 ArrayDataInformation::childSize(int index) const { + if (!mData) + return 0; return mData->sizeAt(index); } inline Qt::ItemFlags ArrayDataInformation::childFlags(int row, int column, bool fileLoaded) const { + if (!mData) + return 0; return mData->childFlags(row, column, fileLoaded); } inline QWidget* ArrayDataInformation::createChildEditWidget(uint index, QWidget* parent) const { + if (!mData) + return 0; return mData->createChildEditWidget(index, parent); } inline QVariant ArrayDataInformation::dataFromChildWidget(uint index, const QWidget* w) const { + if (!mData) + return QVariant(); return mData->dataFromChildWidget(index, w); } inline void ArrayDataInformation::setChildWidgetData(uint index, QWidget* w) const { + if (!mData) + return; mData->setChildWidgetData(index, w); } diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/datainformation.h kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/datainformation.h --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/datainformation.h 2011-11-17 20:59:16.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/datainformation.h 2011-12-20 21:00:12.000000000 +0000 @@ -60,7 +60,7 @@ class DataInformation: public DataInformationBase { protected: - DataInformation(const DataInformation&); + explicit DataInformation(const DataInformation&); public: virtual DataInformation* clone() const = 0; DataInformation(const QString& name, DataInformationBase* parent = NULL); diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/booldatainformation.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/booldatainformation.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/booldatainformation.cpp 2011-11-17 20:59:16.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/booldatainformation.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -24,7 +24,7 @@ template QString BoolDataInformation::valueString() const { - if (!DataInformation::mWasAbleToRead) + if (!BoolDataInformation::mWasAbleToRead) return i18nc("invalid value (out of range)", "<invalid>"); return BoolDataInformation::valueString(UnsignedDataInformation::mValue); } diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/uintdatainformation.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/uintdatainformation.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/uintdatainformation.cpp 2011-11-17 20:59:16.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/uintdatainformation.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -51,7 +51,7 @@ template QString UIntDataInformation::valueString() const { - if (!DataInformation::mWasAbleToRead) + if (!UIntDataInformation::mWasAbleToRead) return i18nc("invalid value (out of range)", "<invalid>"); return UIntDataInformation::valueString(UnsignedDataInformation::mValue); } diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/unsigneddatainformation.h kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/unsigneddatainformation.h --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/datatypes/primitive/unsigneddatainformation.h 2011-11-17 20:59:16.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/datatypes/primitive/unsigneddatainformation.h 2011-12-20 21:00:12.000000000 +0000 @@ -161,7 +161,7 @@ return T(value.toUInt()); } -//specialise for 64 bit +//specialize for 64 bit template<> inline quint64 UnsignedDataInformation::fromVariant(const QVariant& value) { diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/examples/dynamic-array-js/main.js kdesdk-4.7.95/okteta/kasten/controllers/view/structures/examples/dynamic-array-js/main.js --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/examples/dynamic-array-js/main.js 2011-07-27 18:25:27.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/examples/dynamic-array-js/main.js 2011-12-20 21:00:12.000000000 +0000 @@ -10,11 +10,14 @@ len: uint8(), arrayType : enumeration("TypeEnum", uint8(), typeEnumValues), // length of this array is always equal to min(len.value, 100) - dynArray : array(uint8(), 10, null, updateLength), - + dynArray : array(uint8(), 10), + //this array changes type depending on the value of arrayType - typeChangingArray : array(char(), 10, null, updateType), - },validateLength); + typeChangingArray : array(char(), 10), + }); + object.validationFunc = validateLength; + object.child("dynArray").updateFunc = updateLength; + object.child("typeChangingArray").updateFunc = updateType; return object; } @@ -29,11 +32,11 @@ function updateType(mainStruct) { var type = mainStruct.arrayType.value; if (type == typeEnumValues.char && this.childType != char()) - this.setArrayType(char()); + this.childType = char(); else if (type == typeEnumValues.int16 && this.childType != int16()) - this.setArrayType(int16()); + this.childType = int16(); else if (type == typeEnumValues.int32 && this.childType != int32()) - this.setArrayType(int32()); + this.childType = int32(); } function validateLength() { @@ -41,7 +44,6 @@ this.len.validationError = "len must be no bigger than 100"; else this.len.valid = true; - var type = this.arrayType.value; if (type == 0 || type == 1 || type == 2) this.arrayType.valid = true; diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/examples/flags/flags.desktop kdesdk-4.7.95/okteta/kasten/controllers/view/structures/examples/flags/flags.desktop --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/examples/flags/flags.desktop 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/examples/flags/flags.desktop 2011-12-20 21:00:12.000000000 +0000 @@ -6,6 +6,9 @@ Name=Testing bitflags Name[ca]=Proves de «bitflags» +Name[es]=Prueba de indicadores de bits +Name[it]=Flag di bit di prova +Name[kk]=Сынақ бит-жалаушалары Name[nl]=Bitflags testen Name[pt]=Teste de campos de 'bits' Name[pt_BR]=Teste de bitflags @@ -15,6 +18,9 @@ Name[zh_TW]=測試位元旗標 Comment=A test for bitflags Comment[ca]=Una prova per a «bitflags» +Comment[es]=Una prueba para indicadores de bits +Comment[it]=Una prova per flag di bit +Comment[kk]=Бит-жалаушаларыың сынағы Comment[nl]=Een test voor bitflags Comment[pt]=Um teste para os campos de 'bits' Comment[pt_BR]=Um teste para bitflags diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/structtreemodel.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/structures/structtreemodel.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/structtreemodel.cpp 2011-11-17 20:59:16.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/structtreemodel.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -232,8 +232,7 @@ static_cast (parent.internalPointer()); if (!parentItem) { - kDebug() - << "parentItem is NULL"; + kDebug() << "parentItem is NULL"; return mTool->childCount(); } return parentItem->childCount(); diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/structures/structview.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/structures/structview.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/structures/structview.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/structures/structview.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -288,39 +288,39 @@ const QModelIndex current = mStructTreeView->selectionModel()->currentIndex(); if (!current.isValid()) { -kWarning () << "invalid index " << current << " -> returning"; -} + kWarning() << "invalid index " << current << " -> returning"; + return; + } -if (lock) -{ - mTool->lockStructure(current); -} -else -{ - mTool->unlockStructure(current); -} + if (lock) + { + mTool->lockStructure(current); + } + else + { + mTool->unlockStructure(current); + } } void StructView::setLockButtonStated(bool structureLocked) { -if (structureLocked) -{ - mLockStructureButton->setIcon(KIcon(QLatin1String("object-unlocked"))); - mLockStructureButton->setText(i18nc("@action:pushbutton" - " unlock the starting offset of the current structure", "Unlock")); - mLockStructureButton->setToolTip(i18nc("@info:tooltip", - "Unlock selected structure, i.e. the starting offset is" - " always set to the current cursor position.")); -} -else -{ - mLockStructureButton->setIcon(KIcon(QLatin1String("object-locked"))); - mLockStructureButton->setText(i18nc("@action:pushbutton" - " unlock the starting offset of the current structure", "Lock")); - mLockStructureButton->setToolTip(i18nc("@info:tooltip", - "Lock selected structure to current offset.")); -} - + if (structureLocked) + { + mLockStructureButton->setIcon(KIcon(QLatin1String("object-unlocked"))); + mLockStructureButton->setText(i18nc("@action:pushbutton" + " unlock the starting offset of the current structure", "Unlock")); + mLockStructureButton->setToolTip(i18nc("@info:tooltip", + "Unlock selected structure, i.e. the starting offset is" + " always set to the current cursor position.")); + } + else + { + mLockStructureButton->setIcon(KIcon(QLatin1String("object-locked"))); + mLockStructureButton->setText(i18nc("@action:pushbutton" + " unlock the starting offset of the current structure", "Lock")); + mLockStructureButton->setToolTip(i18nc("@info:tooltip", + "Lock selected structure to current offset.")); + } } } diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/viewconfig/viewconfigcontroller.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/viewconfig/viewconfigcontroller.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/viewconfig/viewconfigcontroller.cpp 2011-11-17 20:59:17.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/viewconfig/viewconfigcontroller.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -72,12 +72,12 @@ // bytes per line mSetBytesPerLineAction = actionCollection->addAction( QLatin1String("view_bytesperline") ); mSetBytesPerLineAction->setText( i18nc("@action:inmenu","Set Bytes per Line...") ); - connect( mSetBytesPerLineAction, SIGNAL(triggered(bool) ), SLOT(setBytesPerLine()) ); + connect( mSetBytesPerLineAction, SIGNAL(triggered(bool)), SLOT(setBytesPerLine()) ); // byte groups size mSetBytesPerGroupAction = actionCollection->addAction( QLatin1String("view_bytespergroup") ); mSetBytesPerGroupAction->setText( i18nc("@action:inmenu","Set Bytes per Group...") ); - connect( mSetBytesPerGroupAction, SIGNAL(triggered(bool) ), SLOT(setBytesPerGroup()) ); + connect( mSetBytesPerGroupAction, SIGNAL(triggered(bool)), SLOT(setBytesPerGroup()) ); // resize style mResizeStyleAction = actionCollection->add( QLatin1String("resizestyle") ); diff -Nru kdesdk-4.7.90/okteta/kasten/controllers/view/viewprofiles/viewprofilesmanagecontroller.cpp kdesdk-4.7.95/okteta/kasten/controllers/view/viewprofiles/viewprofilesmanagecontroller.cpp --- kdesdk-4.7.90/okteta/kasten/controllers/view/viewprofiles/viewprofilesmanagecontroller.cpp 2011-11-17 20:59:18.000000000 +0000 +++ kdesdk-4.7.95/okteta/kasten/controllers/view/viewprofiles/viewprofilesmanagecontroller.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -46,7 +46,7 @@ mManageAction = actionCollection->addAction( "settings_profiles_manage" ); mManageAction->setText( i18nc("@action:inmenu","Manage View Profiles...") ); - connect( mManageAction, SIGNAL(triggered(bool) ), SLOT(manageProfiles()) ); + connect( mManageAction, SIGNAL(triggered(bool)), SLOT(manageProfiles()) ); } void ViewProfilesManageController::setTargetModel( AbstractModel* model ) diff -Nru kdesdk-4.7.90/okteta/libs/kasten/core/tests/testdocumenttest.cpp kdesdk-4.7.95/okteta/libs/kasten/core/tests/testdocumenttest.cpp --- kdesdk-4.7.90/okteta/libs/kasten/core/tests/testdocumenttest.cpp 2011-11-17 20:59:20.000000000 +0000 +++ kdesdk-4.7.95/okteta/libs/kasten/core/tests/testdocumenttest.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -123,7 +123,7 @@ Kasten1::TestDocument* document = new Kasten1::TestDocument(); - QSignalSpy* changedSpy = new QSignalSpy( document, SIGNAL(localSyncStateChanged( Kasten1::LocalSyncState )) ); + QSignalSpy* changedSpy = new QSignalSpy( document, SIGNAL(localSyncStateChanged(Kasten1::LocalSyncState)) ); const Kasten1::LocalSyncState localSyncState = Kasten1::LocalHasChanges; document->setLocalSyncState( localSyncState ); diff -Nru kdesdk-4.7.90/okteta/libs/kasten/gui/system/multidocumentstrategy_p.cpp kdesdk-4.7.95/okteta/libs/kasten/gui/system/multidocumentstrategy_p.cpp --- kdesdk-4.7.90/okteta/libs/kasten/gui/system/multidocumentstrategy_p.cpp 2011-11-17 20:59:19.000000000 +0000 +++ kdesdk-4.7.95/okteta/libs/kasten/gui/system/multidocumentstrategy_p.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -21,7 +21,6 @@ */ #include "multidocumentstrategy_p.h" -#include "multidocumentstrategy.h" // lib #include "createdialog.h" @@ -31,7 +30,6 @@ #include // Kasten core #include -#include #include #include // Qt diff -Nru kdesdk-4.7.90/okteta/libs/kasten/gui/system/singledocumentstrategy_p.cpp kdesdk-4.7.95/okteta/libs/kasten/gui/system/singledocumentstrategy_p.cpp --- kdesdk-4.7.90/okteta/libs/kasten/gui/system/singledocumentstrategy_p.cpp 2011-11-17 20:59:19.000000000 +0000 +++ kdesdk-4.7.95/okteta/libs/kasten/gui/system/singledocumentstrategy_p.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -20,7 +20,6 @@ License along with this library. If not, see . */ -#include "singledocumentstrategy.h" #include "singledocumentstrategy_p.h" // lib @@ -31,7 +30,6 @@ #include // Kasten core #include -#include #include #include #include @@ -103,7 +101,7 @@ Q_Q( SingleDocumentStrategy ); // TODO: show dialog in this process, meanwhile start other process, but hidden, - // on result of dialog pass on the paramaters + // on result of dialog pass on the parameters if( ! mDocumentManager->isEmpty() ) { const QString executable = QCoreApplication::applicationFilePath(); diff -Nru kdesdk-4.7.90/okteta/program/about.cpp kdesdk-4.7.95/okteta/program/about.cpp --- kdesdk-4.7.90/okteta/program/about.cpp 2011-07-27 18:25:32.000000000 +0000 +++ kdesdk-4.7.95/okteta/program/about.cpp 2011-12-20 21:00:12.000000000 +0000 @@ -28,7 +28,7 @@ // Program static const char ProgramId[] = "okteta"; -static const char ProgramVersion[] = "0.7.60"; +static const char ProgramVersion[] = "0.7.90"; static const char ProgramHomepage[] = "http://utils.kde.org/projects/okteta"; // Author static const char FWHKEmailAddress[] = "kossebau@kde.org"; diff -Nru kdesdk-4.7.90/scripts/createtarball/config.ini kdesdk-4.7.95/scripts/createtarball/config.ini --- kdesdk-4.7.90/scripts/createtarball/config.ini 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/scripts/createtarball/config.ini 2011-12-20 21:00:09.000000000 +0000 @@ -137,10 +137,11 @@ version = 1.1.3 [skanlite] +gitModule = yes mainmodule = extragear submodule = graphics kde_release = no -version = 0.7 +version = 0.8 docs = yes [kio_gopher] diff -Nru kdesdk-4.7.90/scripts/createtarball/create_tarball.rb kdesdk-4.7.95/scripts/createtarball/create_tarball.rb --- kdesdk-4.7.90/scripts/createtarball/create_tarball.rb 2011-11-17 20:59:14.000000000 +0000 +++ kdesdk-4.7.95/scripts/createtarball/create_tarball.rb 2011-12-20 21:00:09.000000000 +0000 @@ -245,7 +245,15 @@ revString = " Rev " + options.rev end - puts "-> Fetching " + appdata["mainmodule"] + "/" + appdata["submodulepath"] + app + revString + " into " + appdata["folder"] + "..." + if appdata["gitModule"] + if !appdata["gitTag"] + temp = { "gitTag" => "HEAD" } + appdata = appdata.merge(temp) + end + puts "-> Fetching git://anongit.kde.org/" + app + ".git " + appdata["gitTag"] + " into " + appdata["folder"] + "..." + else + puts "-> Fetching " + appdata["mainmodule"] + "/" + appdata["submodulepath"] + app + revString + " into " + appdata["folder"] + "..." + end # Remove old folder, if exists `rm -rf #{appdata["folder"]} 2> /dev/null` `rm -rf #{appdata["folder"]}.tar.bz2 2> /dev/null` @@ -265,29 +273,34 @@ end # Do the main checkouts. - if appdata["wholeModule"] - `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]} #{rev} #{app}-tmp` + if appdata["gitModule"] + `mkdir #{app}` + `git archive --remote git://anongit.kde.org/#{app}.git #{appdata["gitTag"]} | tar -x` else - `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]}#{app} #{rev} #{app}-tmp` - end - Dir.chdir( app + "-tmp" ) - - if appdata["docs"] != "no" - if !appdata["docpath"] - temp = { "docpath" => "doc/#{app}" } - appdata = appdata.merge(temp) + if appdata["wholeModule"] + `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]} #{rev} #{app}-tmp` + else + `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]}#{app} #{rev} #{app}-tmp` end + Dir.chdir( app + "-tmp" ) - `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]}/#{appdata["docpath"]} #{rev} doc` - end + if appdata["docs"] != "no" + if !appdata["docpath"] + temp = { "docpath" => "doc/#{app}" } + appdata = appdata.merge(temp) + end + `svn co #{svnroot}/#{appdata["mainmodule"]}/#{appdata["submodulepath"]}/#{appdata["docpath"]} #{rev} doc` + end - # Move them to the toplevel - `/bin/mv * ..` - Dir.chdir( ".." ) + # Move them to the toplevel + `/bin/mv * ..` + Dir.chdir( ".." ) - `find -name ".svn" | xargs rm -rf` - `rm -rf #{app}-tmp` + `find -name ".svn" | xargs rm -rf` + `rm -rf #{app}-tmp` + end + # translations if appdata["translations"] != "no" && options.translations puts "-> Fetching l10n docs for #{appdata["submodulepath"]}#{app} #{revString}..." @@ -426,7 +439,7 @@ end # add doc generation to compilation - if appdata["docs"] != "no" + if (appdata["docs"] != "no") && (!appdata["gitModule"]) `echo "add_subdirectory( doc )" >> CMakeLists.txt` end diff -Nru kdesdk-4.7.90/scripts/kde-emacs/kde-emacs-bindings.el kdesdk-4.7.95/scripts/kde-emacs/kde-emacs-bindings.el --- kdesdk-4.7.90/scripts/kde-emacs/kde-emacs-bindings.el 2011-07-27 18:25:20.000000000 +0000 +++ kdesdk-4.7.95/scripts/kde-emacs/kde-emacs-bindings.el 2011-12-20 21:00:09.000000000 +0000 @@ -79,7 +79,7 @@ ;; Some example bindings, feel free to customize :) (define-key global-map [(meta up)] 'scroll-other-up) (define-key global-map [(meta down)] 'scroll-other-down) -(define-key global-map [(control j)] 'goto-line) +(global-set-key [(control j)] 'goto-line) (global-set-key [(control %)] 'match-paren) ;;for all buffers :) (if (featurep 'igrep) @@ -118,20 +118,39 @@ ) (define-key global-map [(shift button3)] 'mouse-function-menu) -(define-key global-map [(shift f4)] 'makeclean) -(define-key global-map [(f4)] 'make) -(define-key global-map [(f5)] 'makeinstall) -(define-key global-map [(shift f5)] 'makeinstallexec) ; TODO replace with run-current-program -(define-key global-map [(shift f6)] 'makethisfile) -(if kde-emacs-newline-semicolon +(if kde-emacs-newline-semicolon (define-key c++-mode-map "\;" 'insert-semicolon)) -(define-key c++-mode-map [(f6)] 'kde-switch-cpp-h) -(define-key c-mode-map [(f6)] 'kde-switch-cpp-h) -(define-key c++-mode-map [(f7)] 'switch-to-function-def) -(define-key c-mode-map [(f7)] 'switch-to-function-def) -(define-key c++-mode-map [(f9)] 'agulbra-make-member) -(define-key c-mode-map [(f9)] 'agulbra-make-member) -(define-key global-map [(meta n)] 'next-error) + +(if kde-emacs-use-qtcreator-shortcuts + (progn + ;(define-key global-map [(shift f4)] 'makeclean) + (define-key global-map [(control b)] 'make) + (define-key global-map [(control B)] 'makeinstall) + ;(define-key global-map [(shift f5)] 'makeinstallexec) ; TODO replace with run-current-program + (define-key global-map [(shift f6)] 'makethisfile) + (define-key c++-mode-map [(f4)] 'kde-switch-cpp-h) + (define-key c-mode-map [(f4)] 'kde-switch-cpp-h) + (define-key c++-mode-map [(shift f2)] 'switch-to-function-def) + (define-key c-mode-map [(shift f2)] 'switch-to-function-def) + (define-key c++-mode-map [(control shift f2)] 'agulbra-make-member) + (define-key c-mode-map [(control shift f2)] 'agulbra-make-member) + (define-key global-map [(f6)] 'next-error) + ) +; else + (progn ; Historic default keybindings + (define-key global-map [(shift f4)] 'makeclean) + (define-key global-map [(f4)] 'make) + (define-key global-map [(f5)] 'makeinstall) + (define-key global-map [(shift f5)] 'makeinstallexec) ; TODO replace with run-current-program + (define-key c++-mode-map [(f6)] 'kde-switch-cpp-h) + (define-key c-mode-map [(f6)] 'kde-switch-cpp-h) + (define-key c++-mode-map [(f7)] 'switch-to-function-def) + (define-key c-mode-map [(f7)] 'switch-to-function-def) + (define-key c++-mode-map [(f9)] 'agulbra-make-member) + (define-key c-mode-map [(f9)] 'agulbra-make-member) + (define-key global-map [(meta n)] 'next-error) + ) +) ; kde-emacs-headers: (define-key c++-mode-map [(f10)] 'kdab-insert-header) diff -Nru kdesdk-4.7.90/scripts/kde-emacs/kde-emacs-vars.el kdesdk-4.7.95/scripts/kde-emacs/kde-emacs-vars.el --- kdesdk-4.7.90/scripts/kde-emacs/kde-emacs-vars.el 2011-11-04 14:37:43.000000000 +0000 +++ kdesdk-4.7.95/scripts/kde-emacs/kde-emacs-vars.el 2011-12-20 21:00:09.000000000 +0000 @@ -110,6 +110,11 @@ :group 'kde-devel :type 'boolean) +(defcustom kde-emacs-use-qtcreator-shortcuts nil + "Set this to true to get from kde-emacs-bindings.el the same shortcuts as Qt Creator." + :group 'kde-devel + :type 'boolean) + (defcustom kde-header-protection-parts-to-show 1 "Set this variable to the number of parts from the file name you want to be used for the defined word in the header-protection function.. E.g. setting this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a diff -Nru kdesdk-4.7.90/umbrello/umbrello/assocrules.cpp kdesdk-4.7.95/umbrello/umbrello/assocrules.cpp --- kdesdk-4.7.90/umbrello/umbrello/assocrules.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/assocrules.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -23,6 +23,7 @@ #include "activitywidget.h" #include "signalwidget.h" #include "forkjoinwidget.h" +#include "umlscene.h" // kde includes #include @@ -71,7 +72,7 @@ if( !bValid ) { // Special case: Subsystem realizes interface in component diagram UMLView *view = UMLApp::app()->currentView(); - if (view && view->type() == Uml::DiagramType::Component && + if (view && view->umlScene()->type() == Uml::DiagramType::Component && widgetType == WidgetBase::wt_Package && (assocType == Uml::AssociationType::Generalization || assocType == Uml::AssociationType::Realization)) bValid = true; diff -Nru kdesdk-4.7.90/umbrello/umbrello/classifier.cpp kdesdk-4.7.95/umbrello/umbrello/classifier.cpp --- kdesdk-4.7.90/umbrello/umbrello/classifier.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/classifier.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -187,12 +187,14 @@ int i = 0; for (; i < pCount; ++i) { Model_Utils::NameAndType_ListIt nt(params.begin() + i); - UMLClassifier *c = dynamic_cast((*nt).m_type); + UMLClassifier *type = dynamic_cast((*nt).m_type); UMLClassifier *testType = testParams.at(i)->getType(); - if (c == NULL) { //template parameter + if (type == NULL && testType == NULL) { //no parameter type + continue; + } else if (type == NULL) { //template parameter if (testType->name() != "class") break; - } else if (c != testType) + } else if (type != testType) break; } if (i == pCount) diff -Nru kdesdk-4.7.90/umbrello/umbrello/clipboard/umlclipboard.cpp kdesdk-4.7.95/umbrello/umbrello/clipboard/umlclipboard.cpp --- kdesdk-4.7.90/umbrello/umbrello/clipboard/umlclipboard.cpp 2011-07-27 18:25:24.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/clipboard/umlclipboard.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -112,7 +112,7 @@ foreach (UMLObject* o, objects ) { UMLListViewItem *item = listView->findUMLObject(o); if(item) { - listView->setSelected(item, true); + listView->setCurrentItem(item); } } } @@ -302,12 +302,9 @@ m_ViewList.append( view ); } else if ( Model_Utils::typeIsFolder(type) ) { onlyAttsOps = false; - if(item->childCount()) { - child = (UMLListViewItem*)item->firstChild(); - while(child) { - checkItemForCopyType(child, withDiagrams, withObjects, onlyAttsOps); - child = (UMLListViewItem*)child->nextSibling(); - } + for (int i =0; i < item->childCount(); i++) { + child = (UMLListViewItem*)item->child(i); + checkItemForCopyType(child, withDiagrams, withObjects, onlyAttsOps); } } } @@ -321,8 +318,8 @@ bool UMLClipboard::insertItemChildren(UMLListViewItem * item, UMLListViewItemList& selectedItems) { if (item->childCount()) { - UMLListViewItem * child = (UMLListViewItem*)item->firstChild(); - while (child) { + for(int i = 0; i < item->childCount(); i++) { + UMLListViewItem * child = (UMLListViewItem*)item->child(i); m_ItemList.append(child); int type = child->type(); if (type == UMLListViewItem::lvt_Actor || @@ -336,7 +333,6 @@ selectedItems.removeAll(child); } insertItemChildren(child, selectedItems); - child = (UMLListViewItem*)child->nextSibling(); } } return true; @@ -356,15 +352,14 @@ } UMLDoc *doc = UMLApp::app()->document(); UMLListView *listView = UMLApp::app()->listView(); - UMLListViewItem *childItem = static_cast(parent->firstChild()); - while (childItem) { + for (int i = 0; i < parent->childCount(); i++) { + UMLListViewItem *childItem = static_cast(parent->child(i)); Uml::IDType oldID = childItem->getID(); Uml::IDType newID = chgLog->findNewID(oldID); UMLListViewItem *shouldNotExist = listView->findItem(newID); if (shouldNotExist) { uError() << "new list view item " << ID2STR(newID) << " already exists (internal error)"; - childItem = static_cast(childItem->nextSibling()); continue; } UMLObject *newObj = doc->findObjectById(newID); @@ -376,7 +371,6 @@ } else { uDebug() << "no UMLObject found for lvitem " << ID2STR(newID); } - childItem = static_cast(childItem->nextSibling()); } return true; } @@ -464,18 +458,22 @@ } UMLListView *listView = UMLApp::app()->listView(); + listView->startUpdate(); foreach ( UMLListViewItem* itemdata, itemdatalist ) { UMLListViewItem* item = listView->createItem(*itemdata, *idchanges); if(!item) { + listView->endUpdate(); return false; } if(itemdata->childCount()) { if(!pasteChildren(item, idchanges)) { + listView->endUpdate(); return false; } } } + listView->endUpdate(); return result; } @@ -502,14 +500,17 @@ return false; } + listView->startUpdate(); foreach ( UMLListViewItem* itemdata, itemdatalist ) { UMLListViewItem* item = listView->createItem(*itemdata, *idchanges); if(itemdata->childCount()) { if(!pasteChildren(item, idchanges)) { + listView->endUpdate(); return false; } } } + listView->endUpdate(); return result; } @@ -769,13 +770,10 @@ */ bool UMLClipboard::insertItemChildren( UMLListViewItem * item ) { - if( item->childCount() ) { - UMLListViewItem * child =dynamic_cast( item->firstChild() ); - while( child ) { - m_ItemList.append( child ); - insertItemChildren( child ); - child = dynamic_cast( child->nextSibling() ); - } + for (int i = 0; i < item->childCount(); i++) { + UMLListViewItem * child =dynamic_cast( item->child(i) ); + m_ItemList.append( child ); + insertItemChildren( child ); } return true; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/clipboard/umldragdata.cpp kdesdk-4.7.95/umbrello/umbrello/clipboard/umldragdata.cpp --- kdesdk-4.7.90/umbrello/umbrello/clipboard/umldragdata.cpp 2011-07-27 18:25:24.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/clipboard/umldragdata.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -16,7 +16,7 @@ #include "idchangelog.h" #include "uml.h" #include "umldoc.h" -#include "umlview.h" +#include "umlscene.h" #include "umlobject.h" #include "folder.h" #include "classifier.h" @@ -687,7 +687,7 @@ QDomNode associationWidgetNode = associationWidgetsNode.firstChild(); QDomElement associationWidgetElement = associationWidgetNode.toElement(); while ( !associationWidgetElement.isNull() ) { - AssociationWidget* associationWidget = new AssociationWidget(view); + AssociationWidget* associationWidget = new AssociationWidget(view->umlScene()); if (associationWidget->loadFromXMI(associationWidgetElement, widgets)) associations.append(associationWidget); else { diff -Nru kdesdk-4.7.90/umbrello/umbrello/CMakeLists.txt kdesdk-4.7.95/umbrello/umbrello/CMakeLists.txt --- kdesdk-4.7.90/umbrello/umbrello/CMakeLists.txt 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/CMakeLists.txt 2011-12-20 21:00:11.000000000 +0000 @@ -212,6 +212,7 @@ dialogs/classwizard.cpp dialogs/codeeditor.cpp dialogs/codegenerationpolicypage.cpp + dialogs/codeimportoptionspage.cpp dialogs/codeviewerdialog.cpp dialogs/codevieweroptionspage.cpp dialogs/codetextedit.cpp @@ -222,7 +223,6 @@ dialogs/exportallviewsdialog.cpp dialogs/notedialog.cpp dialogs/objectnodedialog.cpp - dialogs/importprojectdlg.cpp dialogs/overwritedialogue.cpp dialogs/pkgcontentspage.cpp dialogs/parmpropdlg.cpp @@ -246,9 +246,9 @@ ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/codeviewerdialogbase.ui ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/codevieweroptionsbase.ui ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/exportallviewsdialogbase.ui - ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/importprojectdlgbase.ui ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/umlrolepropertiesbase.ui ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/diagrampropertiespage.ui + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/codeimportoptionspage.ui ) set(librefactoring_SRCS diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/cppimport.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/cppimport.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/cppimport.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/cppimport.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -109,6 +109,7 @@ ms_driver->reset(); // The driver shall attempt to parse included files. ms_driver->setResolveDependencesEnabled( true ); + // FIXME: port to win32 // Add some standard include paths ms_driver->addIncludePath( "/usr/include" ); ms_driver->addIncludePath( "/usr/include/c++" ); diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/import_utils.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/import_utils.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/import_utils.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/import_utils.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -13,6 +13,7 @@ // app includes #include "association.h" +#include "artifact.h" #include "attribute.h" #include "classifier.h" #include "debug_utils.h" @@ -26,6 +27,7 @@ #include "uml.h" #include "umldoc.h" #include "umlobject.h" +#include "umbrellosettings.h" // kde includes #include @@ -168,6 +170,18 @@ { QString name = inName; UMLDoc *umldoc = UMLApp::app()->document(); + if (type == UMLObject::ot_Artifact) { + if (!Settings::optionState().codeImportState.createArtifacts) + return 0; + QFileInfo fi(name); + UMLFolder *componentView = umldoc->rootFolder(Uml::ModelType::Component); + UMLObject *o = Object_Factory::createUMLObject(type, fi.fileName(), componentView, false); + UMLArtifact *a = static_cast(o); + a->setDrawAsType(UMLArtifact::file); + a->setDoc(comment); + uDebug() << name << comment; + return o; + } UMLFolder *logicalView = umldoc->rootFolder(Uml::ModelType::Logical); const Uml::ProgrammingLanguage pl = UMLApp::app()->activeLanguage(); if (parentPkg == NULL) { @@ -212,7 +226,7 @@ } int wantNamespace = KMessageBox::Yes; if (pl == Uml::ProgrammingLanguage::Cpp) { - /* We know std and Qt are namespaces */ + // We know std and Qt are namespaces. if (scopeName != "std" && scopeName != "Qt") { wantNamespace = KMessageBox::questionYesNo(NULL, i18n("Is the scope %1 a namespace or a class?", scopeName), diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -228,6 +228,12 @@ // ------------------------------------------------------------------------ +FileAST::FileAST() +{ +} + +// ------------------------------------------------------------------------ + LinkageBodyAST::LinkageBodyAST() { } diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/ast.h kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/ast.h --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/ast.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/ast.h 2011-12-20 21:00:11.000000000 +0000 @@ -171,6 +171,7 @@ NodeType_TemplateParameter, NodeType_TemplateParameterList, NodeType_Condition, + NodeType_File, NodeType_Custom = 2000 }; @@ -422,6 +423,32 @@ void operator = ( const DeclarationAST& source ); }; +class FileAST: public DeclarationAST +{ +public: + typedef AUTO_PTR Node; + enum { Type = NodeType_File }; + + DECLARE_ALLOC( FileAST ) + + public: + FileAST(); + + QString fileName() { return m_fileName; } + void setFileName(QString fileName) { m_fileName = fileName; } + + QList nodeList() { return m_nodeList; } + void addNode( AST::Node& node ); + +private: + QList m_nodeList; + QString m_fileName; + +private: + FileAST( const FileAST& source ); + void operator = ( const FileAST& source ); +}; + class AccessDeclarationAST: public DeclarationAST { public: diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp 2011-08-07 15:48:22.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -60,6 +60,13 @@ TreeParser::parseTranslationUnit( ast ); } +void CppTree2Uml::parseFile( FileAST* ast ) +{ + Import_Utils::createUMLObject(UMLObject::ot_Artifact, ast->fileName(), + 0, + ast->comment()); +} + void CppTree2Uml::parseNamespace( NamespaceAST* ast ) { if (m_clsCnt > 0) { diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h 2011-09-26 11:24:06.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.h 2011-12-20 21:00:11.000000000 +0000 @@ -36,6 +36,7 @@ // declarations //virtual void parseDeclaration( DeclarationAST* ); // use parent method //virtual void parseLinkageSpecification( LinkageSpecificationAST* ); // use parent method + virtual void parseFile( FileAST* ast ); virtual void parseNamespace( NamespaceAST* ); //virtual void parseNamespaceAlias( NamespaceAliasAST* ); // use parent method //virtual void parseUsing( UsingAST* ); // use parent method diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -421,12 +421,23 @@ bool Parser::parseDeclaration(DeclarationAST::Node& node) { //uDebug() << "--- tok = " << (*m_tokenIt).text() << " -- " << "Parser::parseDeclaration()"; + bool firstToken = m_tokenIt == lex->tokenBegin(); QString comment; while ((*m_tokenIt) == Token_comment) { comment += (*m_tokenIt).text(); ++m_tokenIt; } + + if (firstToken) + { + FileAST::Node ast = CreateNode(); + ast->setComment(comment); + ast->setFileName(m_driver->currentFileName()); + node = ast; + return true; + } + if ((*m_tokenIt).isNull()) return false; diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -47,6 +47,10 @@ return; switch (declaration->nodeType()) { + case NodeType_File: + parseFile(static_cast(declaration)); + break; + case NodeType_LinkageSpecification: parseLinkageSpecification(static_cast(declaration)); break; @@ -89,6 +93,12 @@ } } +void TreeParser::parseFile(FileAST* decl) +{ + //uDebug() << "TreeParser::parseFile()"; + Q_UNUSED(decl); +} + void TreeParser::parseLinkageSpecification(LinkageSpecificationAST* ast) { //uDebug() << "TreeParser::parseLinkageSpecification()"; diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.h kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.h --- kdesdk-4.7.90/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/kdevcppparser/tree_parser.h 2011-12-20 21:00:11.000000000 +0000 @@ -33,6 +33,7 @@ // declarations virtual void parseDeclaration( DeclarationAST* ); + virtual void parseFile( FileAST* ); virtual void parseLinkageSpecification( LinkageSpecificationAST* ); virtual void parseNamespace( NamespaceAST* ); virtual void parseNamespaceAlias( NamespaceAliasAST* ); diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimport/nativeimportbase.cpp kdesdk-4.7.95/umbrello/umbrello/codeimport/nativeimportbase.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimport/nativeimportbase.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimport/nativeimportbase.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -394,7 +394,7 @@ uError() << msgPrefix << "cannot open file"; return false; } - log("parsing..."); + log(nameWithoutPath, "parsing..."); // Scan the input file into the QStringList m_source. m_source.clear(); m_srcIndex = 0; @@ -422,7 +422,7 @@ skipStmt(); m_comment.clear(); } - log("...end of parse"); + log(nameWithoutPath, "...end of parse"); return true; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/codeimpwizard/codeimpthread.cpp kdesdk-4.7.95/umbrello/umbrello/codeimpwizard/codeimpthread.cpp --- kdesdk-4.7.90/umbrello/umbrello/codeimpwizard/codeimpthread.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/codeimpwizard/codeimpthread.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -33,8 +33,8 @@ : //QThread(parent), m_file(file) { - connect(this, SIGNAL(askQuestion(QString, QMessageBox::StandardButton*)), - this, SLOT(questionAsked(QString, QMessageBox::StandardButton*))); + connect(this, SIGNAL(askQuestion(QString,QMessageBox::StandardButton*)), + this, SLOT(questionAsked(QString,QMessageBox::StandardButton*))); } /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/controller/notewidgetcontroller.cpp kdesdk-4.7.95/umbrello/umbrello/controller/notewidgetcontroller.cpp --- kdesdk-4.7.90/umbrello/umbrello/controller/notewidgetcontroller.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/controller/notewidgetcontroller.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -44,7 +44,7 @@ { Q_UNUSED(me); //TODO Copied from old code. What it does? - if (m_noteWidget->m_DiagramLink == Uml::id_None) { + if (m_noteWidget->m_diagramLink == Uml::id_None) { // setup popup menu if not already created. if ( !m_noteWidget->m_pMenu ) m_noteWidget->setupPopupMenu(); @@ -53,6 +53,6 @@ m_noteWidget->slotMenuSelection(action); } else { UMLDoc *umldoc = UMLApp::app()->document(); - umldoc->changeCurrentView(m_noteWidget->m_DiagramLink); + umldoc->changeCurrentView(m_noteWidget->m_diagramLink); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/controller/umlwidgetcontroller.cpp kdesdk-4.7.95/umbrello/umbrello/controller/umlwidgetcontroller.cpp --- kdesdk-4.7.90/umbrello/umbrello/controller/umlwidgetcontroller.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/controller/umlwidgetcontroller.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -126,7 +126,7 @@ m_shiftPressed = false; - int count = m_widget->m_pView->getSelectCount(true); + int count = m_widget->m_scene->getSelectCount(true); if (me->button() == Qt::LeftButton) { if (m_widget->isSelected() && count > 1) { //Single selection is made in release event if the widget wasn't moved @@ -196,7 +196,7 @@ m_moved = true; //Maybe needed by AssociationWidget - m_widget->m_bStartMove = true; + m_widget->m_startMove = true; setSelectionBounds(); } @@ -250,13 +250,13 @@ // Move any selected associations. - foreach(AssociationWidget* aw, m_widget->m_pView->getSelectedAssocs()) { + foreach(AssociationWidget* aw, m_widget->m_scene->getSelectedAssocs()) { if (aw->getSelected()) { aw->moveEntireAssoc(diffX, diffY); } } - m_widget->m_pView->resizeCanvasToItems(); + m_widget->m_scene->resizeCanvasToItems(); updateSelectionBounds(diffX, diffY); } @@ -273,7 +273,7 @@ widget->adjustAssocs(widget->getX(), widget->getY()); } - m_widget->m_bStartMove = false; + m_widget->m_startMove = false; } /** @@ -311,7 +311,7 @@ m_leftButtonDown = false; if (!m_moved && !m_resized) { - if (!m_shiftPressed && (m_widget->m_pView->getSelectCount(true) > 1)) { + if (!m_shiftPressed && (m_widget->m_scene->getSelectCount(true) > 1)) { selectSingle(me); } else if (!m_wasSelected) { deselect(me); @@ -337,7 +337,7 @@ if (m_inResizeArea) { m_inResizeArea = false; - m_widget->m_pView->setCursor(Qt::ArrowCursor); + m_widget->m_scene->setCursor(Qt::ArrowCursor); } else { m_inMoveArea = false; } @@ -360,7 +360,7 @@ } //TODO Copied from old code. Does it really work as intended? - UMLWidget *bkgnd = m_widget->m_pView->widgetAt(me->pos()); + UMLWidget *bkgnd = m_widget->m_scene->widgetAt(me->pos()); if (bkgnd) { //uDebug() << "setting Z to " << bkgnd->getZ() + 1; m_widget->setZ(bkgnd->getZ() + 1); @@ -406,13 +406,13 @@ { const int m = 10; - if (m_widget->m_bResizable && + if (m_widget->m_resizable && me->x() >= (m_widget->getX() + m_widget->width() - m) && me->y() >= (m_widget->getY() + m_widget->height() - m)) { - m_widget->m_pView->setCursor(getResizeCursor()); + m_widget->m_scene->setCursor(getResizeCursor()); return true; } else { - m_widget->m_pView->setCursor(Qt::ArrowCursor); + m_widget->m_scene->setCursor(Qt::ArrowCursor); return false; } } @@ -516,8 +516,8 @@ */ void UMLWidgetController::resetSelection() { - m_widget->m_pView->clearSelected(); - m_widget->m_pView->resetToolbar(); + m_widget->m_scene->clearSelected(); + m_widget->m_scene->resetToolbar(); m_widget->setSelected(false); m_wasSelected = false; @@ -530,7 +530,7 @@ */ void UMLWidgetController::selectSingle(QMouseEvent *me) { - m_widget->m_pView->clearSelected(); + m_widget->m_scene->clearSelected(); //Adds the widget to the selected widgets list, but as it has been cleared //only the current widget is selected @@ -544,9 +544,9 @@ */ void UMLWidgetController::selectMultiple(QMouseEvent *me) { - m_widget->m_bSelected = true; - m_widget->setSelected(m_widget->m_bSelected); - m_widget->m_pView->setSelected(m_widget, me); + m_widget->m_selected = true; + m_widget->setSelected(m_widget->m_selected); + m_widget->m_scene->setSelected(m_widget, me); m_wasSelected = true; } @@ -558,9 +558,9 @@ */ void UMLWidgetController::deselect(QMouseEvent *me) { - m_widget->m_bSelected = false; - m_widget->setSelected(m_widget->m_bSelected); - m_widget->m_pView->setSelected(m_widget, me); + m_widget->m_selected = false; + m_widget->setSelected(m_widget->m_selected); + m_widget->m_scene->setSelected(m_widget, me); //m_wasSelected is false implicitly, no need to set it again } @@ -621,9 +621,9 @@ */ void UMLWidgetController::setSelectionBounds() { - if (m_widget->m_pView->getSelectCount() > 0) { + if (m_widget->m_scene->getSelectCount() > 0) { m_selectedWidgetsList.clear(); - m_widget->m_pView->getSelectedWidgets(m_selectedWidgetsList, false); + m_widget->m_scene->getSelectedWidgets(m_selectedWidgetsList, false); updateSelectionBounds(1, 1); } @@ -679,7 +679,7 @@ resizeWidget(newW, newH); m_widget->adjustAssocs(m_widget->getX(), m_widget->getY()); - m_widget->m_pView->resizeCanvasToItems(); + m_widget->m_scene->resizeCanvasToItems(); } /** @@ -811,8 +811,8 @@ */ int newX = me->x() + m_widget->getX() - m_prevX - m_pressOffsetX; int newY = me->y() + m_widget->getY() - m_prevY - m_pressOffsetY; - int maxX = m_widget->m_pView->canvas()->width(); - int maxY = m_widget->m_pView->canvas()->height(); + int maxX = m_widget->m_scene->canvas()->width(); + int maxY = m_widget->m_scene->canvas()->height(); m_prevX = newX; m_prevY = newY; diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/activitydialog.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/activitydialog.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/activitydialog.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/activitydialog.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -30,8 +30,8 @@ #include #include -ActivityDialog::ActivityDialog( UMLView * pView, ActivityWidget * pWidget ) - : KPageDialog(pView) +ActivityDialog::ActivityDialog(QWidget * parent, ActivityWidget * pWidget) + : KPageDialog(parent) { setCaption( i18n("Properties") ); setButtons( Ok | Apply | Cancel | Help ); @@ -39,7 +39,6 @@ setModal( true ); setFaceType( KPageDialog::List ); showButtonSeparator( true ); - m_pView = pView; m_pActivityWidget = pWidget; m_bChangesMade = false; setupPages(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/activitydialog.h kdesdk-4.7.95/umbrello/umbrello/dialogs/activitydialog.h --- kdesdk-4.7.90/umbrello/umbrello/dialogs/activitydialog.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/activitydialog.h 2011-12-20 21:00:10.000000000 +0000 @@ -42,7 +42,7 @@ /** * Constructor */ - ActivityDialog( UMLView * pView, ActivityWidget * pWidget ); + ActivityDialog(QWidget * parent, ActivityWidget * pWidget); bool getChangesMade() { return m_bChangesMade; diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/assocgenpage.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/assocgenpage.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/assocgenpage.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/assocgenpage.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -79,7 +79,7 @@ QLabel *pAssocNameL = NULL; KLineEdit* nameField = Dialog_Utils::makeLabeledEditField( nameGB, nameLayout, 0, pAssocNameL, i18nc("name of association widget", "Name:"), - m_pAssocNameLE, m_pAssociationWidget->name() ); + m_pAssocNameLE, m_pAssociationWidget->objectName() ); nameField->setFocus(); // document diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/codeeditor.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/codeeditor.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/codeeditor.cpp 2011-09-26 11:24:06.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/codeeditor.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -176,7 +176,7 @@ delete dlg; } else if ( (dynamic_cast(obj)) ) { - if (obj->showProperties()) { + if (obj->showPropertiesPagedDialog()) { rebuildView(para); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ralf Habacker * + * * + * This is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2, or (at your option) * + * any later version. * + * * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this package; see the file COPYING. If not, write to * + * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * + * Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +// own header +#include "codeimportoptionspage.h" + +// app includes +#include "optionstate.h" + +// qt includes + + +/** + * Constructor. + * @param parent the parent (wizard) of this wizard page + */ +CodeImportOptionsPage::CodeImportOptionsPage(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); + createArtifactCheckBox->setChecked(Settings::optionState().codeImportState.createArtifacts); +} + +/** + * destructor + */ +CodeImportOptionsPage::~CodeImportOptionsPage() +{ +} + +/** + * sets default values + */ +void CodeImportOptionsPage::setDefaults() +{ + createArtifactCheckBox->setChecked(true); +} + +/** + * Reads the set values from their corresponding widgets, writes them back to + * the data structure, and notifies clients. + */ +void CodeImportOptionsPage::apply() +{ + Settings::optionState().codeImportState.createArtifacts = createArtifactCheckBox->isChecked(); + emit applyClicked(); +} diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.h kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.h --- kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.h 1970-01-01 00:00:00.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.h 2011-12-20 21:00:10.000000000 +0000 @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ralf Habacker * + * * + * This is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2, or (at your option) * + * any later version. * + * * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this package; see the file COPYING. If not, write to * + * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * + * Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef CODEIMPORTOPTIONSPAGE_H +#define CODEIMPORTOPTIONSPAGE_H + +#include +#include "ui_codeimportoptionspage.h" + +/** + * This class is used in the code generation wizard and + * also in SettingsDlg. + * + * @author Ralf Habacker + */ +class CodeImportOptionsPage : public QWidget, private Ui::CodeImportOptionsPage +{ + Q_OBJECT +public: + CodeImportOptionsPage(QWidget *parent = 0); + ~CodeImportOptionsPage(); + void setDefaults(); + void apply(); + +signals: + void applyClicked(); + +protected: +}; + +#endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.ui kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.ui --- kdesdk-4.7.90/umbrello/umbrello/dialogs/codeimportoptionspage.ui 1970-01-01 00:00:00.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/codeimportoptionspage.ui 2011-12-20 21:00:10.000000000 +0000 @@ -0,0 +1,38 @@ + + + CodeImportOptionsPage + + + + 0 + 0 + 409 + 123 + + + + + + + C++- Import + + + + + 10 + 20 + 331 + 21 + + + + for each imported file create an artifact in the component view + + + + + + + + + diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlgbase.ui kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlgbase.ui --- kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlgbase.ui 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlgbase.ui 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ - - ImportProjectDlgBase - - - - 0 - 0 - 319 - 179 - - - - - - - 15 - - - - - - - The base directory that contains the project - - - &Directory of the project: - - - false - - - m_kURL - - - - - - - The base directory that contains the project - - - - - - - - - - - The language of the project - - - Language: - - - false - - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 16 - - - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
- - KUrlRequester - QFrame -
kurlrequester.h
-
-
- - -
diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlg.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlg.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlg.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlg.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -/*************************************************************************** - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * copyright (C) 2007-2011 * - * Umbrello UML Modeller Authors * - ***************************************************************************/ - -// own header -#include "importprojectdlg.h" - -// kde includes -#include - -// qt includes -#include -#include - -const QString ImportProjectDlg::ADA = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::Ada); -const QString ImportProjectDlg::CPP = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::Cpp); -const QString ImportProjectDlg::IDL = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::IDL); -const QString ImportProjectDlg::JAVA = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::Java); -const QString ImportProjectDlg::PASCAL = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::Pascal); -const QString ImportProjectDlg::PYTHON = Uml::ProgrammingLanguage::toString(Uml::ProgrammingLanguage::Python); - -/** - * Constructor for ImportProjectDlg. - * - * @param list The list of source files. - * @param pl The preselected programming language - * @param parent The parent of the dialog. - * @param name The internal name. - * @param modal If modal is true the dialog will block input to other the windows - * in the application until it's closed. - * @param fl Window flags. - * - * @see KDialog::KDialog - */ -ImportProjectDlg::ImportProjectDlg(QStringList* list, const Uml::ProgrammingLanguage pl, - QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) - : KDialog(parent, fl), - m_fileList(list) -{ - setObjectName(name); - setModal(modal); - setupUi(mainWidget()); - setInitialSize(QSize(330, 190)); - QStringList languages; - - languages += ImportProjectDlg::ADA; - languages += ImportProjectDlg::CPP; - languages += ImportProjectDlg::IDL; - languages += ImportProjectDlg::JAVA; - languages += ImportProjectDlg::PASCAL; - languages += ImportProjectDlg::PYTHON; - - m_language->addItems(languages); - - QString selectedLanguage = ImportProjectDlg::CPP; - if (pl == Uml::ProgrammingLanguage::IDL) { - selectedLanguage = ImportProjectDlg::IDL; - } else if (pl == Uml::ProgrammingLanguage::Python) { - selectedLanguage = ImportProjectDlg::PYTHON; - } else if (pl == Uml::ProgrammingLanguage::Java) { - selectedLanguage = ImportProjectDlg::JAVA; - } else if (pl == Uml::ProgrammingLanguage::Pascal) { - selectedLanguage = ImportProjectDlg::PASCAL; - } else if (pl == Uml::ProgrammingLanguage::Ada) { - selectedLanguage = ImportProjectDlg::ADA; - } - - QRegExp languageRegExp(selectedLanguage,Qt::CaseSensitive, QRegExp::FixedString); - m_language->setCurrentIndex(languages.indexOf(languageRegExp)); - m_language->setEditable(false); - m_kURL->setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly); -} - -/** - * Destructor. - */ -ImportProjectDlg::~ImportProjectDlg() -{ -} - -/** - * Recursively get all the sources files that matches the filters from the given path. - * @param path path to the parent directory - * @param filters file extensions of the wanted files - */ -void ImportProjectDlg::getFiles(const QString& path, QStringList& filters) -{ - QDir searchDir(path); - if (searchDir.exists()) { - foreach (const QFileInfo &file, searchDir.entryList(filters, QDir::Files)) - m_fileList->append(searchDir.absoluteFilePath(file.fileName())); - foreach (const QFileInfo &subDir, searchDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks)) - getFiles(searchDir.absoluteFilePath(subDir.fileName()), filters); - } -} - -/* -void ImportProjectDlg::languageChange() -{ - ImportProjectDlgBase::languageChange(); -} -*/ - -/** - * Inherited slot. - * Once the directory and the language are choose, it looks recursively for the source files of this programming language - * in this directory - */ -void ImportProjectDlg::accept() -{ - const KUrl url = m_kURL->url(); - if (url.isEmpty()) { - KMessageBox::sorry(this, i18n("You have to choose a directory.")); - return; - } - QDir dir(url.toLocalFile()); - if (!dir.exists()){ - KMessageBox::sorry(this, i18n("This directory does not exist.")); - return; - } - QStringList filter; - QString language = m_language->currentText(); - if (language == ImportProjectDlg::ADA) { - filter += "*.ads"; - filter += "*.ada"; - } else if (language == ImportProjectDlg::IDL) { - filter += "*.idl"; - } else if (language == ImportProjectDlg::JAVA) { - filter += "*.java"; - } if (language == ImportProjectDlg::PASCAL) { - filter += "*.pas"; - } if (language == ImportProjectDlg::PYTHON) { - filter += "*.py"; - } else { - //C++ - filter += "*.h"; - filter += "*.hh"; - filter += "*.hpp"; - filter += "*.hxx"; - filter += "*.H"; - } - m_fileList->clear(); - getFiles(url.toLocalFile(), filter); - if (m_fileList->empty()) { - KMessageBox::sorry(this, i18n("No source file in this directory.")); - return; - } - KDialog::accept(); -} - -#include "importprojectdlg.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlg.h kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlg.h --- kdesdk-4.7.90/umbrello/umbrello/dialogs/importprojectdlg.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/importprojectdlg.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/*************************************************************************** - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * copyright (C) 2007-2011 * - * Umbrello UML Modeller Authors * - ***************************************************************************/ - -#ifndef IMPORTPROJECTDLG_H -#define IMPORTPROJECTDLG_H - -// application specific includes -#include "ui_importprojectdlgbase.h" -#include "basictypes.h" - -/** - * Dialog for collecting the "Import project" params and searching the files that match the params. - * Inherits ImportProjectDlgBase - * The user chooses the directory with a KUrlRequester widget and chooses the language in a combobox. - * The slot accept() do the search - */ -class ImportProjectDlg : public KDialog, private Ui::ImportProjectDlgBase -{ - Q_OBJECT -public: - ImportProjectDlg(QStringList* list, const Uml::ProgrammingLanguage pl, - QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); - virtual ~ImportProjectDlg(); - -protected slots: - virtual void accept(); - -private: - virtual void getFiles(const QString& aPath, QStringList& filters); - - QStringList* m_fileList; - - static const QString ADA; - static const QString CPP; - static const QString IDL; - static const QString JAVA; - static const QString PASCAL; - static const QString PYTHON; -}; - -#endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/selectopdlg.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/selectopdlg.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/selectopdlg.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/selectopdlg.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -31,8 +31,8 @@ #include #include -SelectOpDlg::SelectOpDlg(UMLView * parent, UMLClassifier * c) - : KDialog( parent) +SelectOpDlg::SelectOpDlg(QWidget * parent, UMLClassifier * c) + : KDialog(parent) { setCaption( i18n("Select Operation") ); setButtons( Ok | Cancel ); @@ -43,7 +43,6 @@ QFrame *frame = new QFrame( this ); setMainWidget( frame ); - m_pView = parent; QVBoxLayout * topLayout = new QVBoxLayout(frame); m_pOpGB = new QGroupBox(i18n("Select Operation"), frame); diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/selectopdlg.h kdesdk-4.7.95/umbrello/umbrello/dialogs/selectopdlg.h --- kdesdk-4.7.90/umbrello/umbrello/dialogs/selectopdlg.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/selectopdlg.h 2011-12-20 21:00:10.000000000 +0000 @@ -40,7 +40,7 @@ * @param parent The parent to this instance. * @param c The concept to get the operations from. */ - SelectOpDlg(UMLView * parent, UMLClassifier * c); + SelectOpDlg(QWidget * parent, UMLClassifier * c); /** * Standard deconstructor. diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/settingsdlg.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/settingsdlg.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/settingsdlg.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/settingsdlg.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -12,6 +12,7 @@ #include "settingsdlg.h" // app includes +#include "codeimportoptionspage.h" #include "codegenoptionspage.h" #include "codevieweroptionspage.h" #include "dialog_utils.h" @@ -41,6 +42,7 @@ setupFontPage(); setupUIPage(); setupClassPage(); + setupCodeImportPage(); setupCodeGenPage(); setupCodeViewerPage(state->codeViewerState); connect(this,SIGNAL(okClicked()),this,SLOT(slotOk())); @@ -352,6 +354,17 @@ m_ClassWidgets.m_pOperationScopeCB->completionObject()->addItem( type ); } +void SettingsDlg::setupCodeImportPage() +{ + //setup code importer settings page + KVBox * page = new KVBox(); + pageCodeImport = new KPageWidgetItem( page,i18n("Code Importer") ); + pageCodeImport->setHeader( i18n("Code Import Settings") ); + pageCodeImport->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_CodeImport) ); + addPage( pageCodeImport ); + m_pCodeImportPage = new CodeImportOptionsPage(page); +} + void SettingsDlg::setupCodeGenPage() { //setup code generation settings page @@ -399,6 +412,7 @@ applyPage( pageGeneral); applyPage( pageUserInterface ); applyPage( pageCodeViewer); + applyPage( pageCodeImport ); applyPage( pageCodeGen ); applyPage( pageFont ); accept(); @@ -441,7 +455,14 @@ m_ClassWidgets.m_pAttribScopeCB->setCurrentIndex(1); // Private m_ClassWidgets.m_pOperationScopeCB->setCurrentIndex(0); // Public } - else if ( current == pageCodeGen || current == pageCodeViewer ) + else if ( current == pageCodeImport ) + { + m_pCodeImportPage->setDefaults(); + } + else if ( current == pageCodeGen ) + { + } + else if ( current == pageCodeViewer ) { } } @@ -489,6 +510,10 @@ m_pOptionState->classState.defaultAttributeScope = (Uml::Visibility::Value) m_ClassWidgets.m_pAttribScopeCB->currentIndex(); m_pOptionState->classState.defaultOperationScope = (Uml::Visibility::Value) m_ClassWidgets.m_pOperationScopeCB->currentIndex(); } + else if ( item == pageCodeImport ) + { + m_pCodeImportPage->apply(); + } else if ( item == pageCodeGen ) { m_pCodeGenPage->apply(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/settingsdlg.h kdesdk-4.7.95/umbrello/umbrello/dialogs/settingsdlg.h --- kdesdk-4.7.90/umbrello/umbrello/dialogs/settingsdlg.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/settingsdlg.h 2011-12-20 21:00:10.000000000 +0000 @@ -28,6 +28,7 @@ // app includes #include "optionstate.h" +class CodeImportOptionsPage; class CodeGenOptionsPage; class CodeViewerOptionsPage; @@ -138,6 +139,7 @@ void setupUIPage(); void setupGeneralPage(); void setupClassPage(); + void setupCodeImportPage(); void setupCodeGenPage(); void setupCodeViewerPage(Settings::CodeViewerState options); void applyPage( KPageWidgetItem* ); @@ -148,11 +150,12 @@ UIWidgets m_UiWidgets; ClassWidgets m_ClassWidgets; Settings::OptionState *m_pOptionState; + CodeImportOptionsPage * m_pCodeImportPage; CodeGenOptionsPage * m_pCodeGenPage; CodeViewerOptionsPage * m_pCodeViewerPage; bool m_bChangesApplied; - KPageWidgetItem *pageCodeViewer, *pageFont, *pageCodeGen, *pageUserInterface, *pageGeneral, *pageClass; + KPageWidgetItem *pageCodeViewer, *pageFont, *pageCodeImport, *pageCodeGen, *pageUserInterface, *pageGeneral, *pageClass; private slots: void slotApply(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/dialogs/umlentityattributedialog.cpp kdesdk-4.7.95/umbrello/umbrello/dialogs/umlentityattributedialog.cpp --- kdesdk-4.7.90/umbrello/umbrello/dialogs/umlentityattributedialog.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/dialogs/umlentityattributedialog.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -160,7 +160,7 @@ insertTypesSorted(m_pEntityAttribute->getTypeName()); m_pNameLE->setFocus(); - connect( m_pNameLE, SIGNAL(textChanged (QString)), SLOT(slotNameChanged(QString))); + connect( m_pNameLE, SIGNAL(textChanged(QString)), SLOT(slotNameChanged(QString))); connect( m_pAutoIncrementCB, SIGNAL(clicked(bool)), this, SLOT(slotAutoIncrementStateChanged(bool))); slotNameChanged(m_pNameLE->text() ); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/docwindow.cpp kdesdk-4.7.95/umbrello/umbrello/docwindow.cpp --- kdesdk-4.7.90/umbrello/umbrello/docwindow.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/docwindow.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -24,6 +24,7 @@ #include "umlobject.h" #include "umlview.h" #include "umlwidget.h" +#include "umlscene.h" /** * Constructor. @@ -115,11 +116,11 @@ // the file is marked modified, if the documentation differs // we don't do this on startup/load of a xmi file, because every time // modified is set, we get another undo/redo backup point - if ( (startup == false) && (m_pDocTE->toPlainText() != m_pUMLView->getDoc()) ) { + if ( startup == false && m_pDocTE->toPlainText() != m_pUMLView->umlScene()->getDoc() ) { mark_modified = true; } - m_pUMLView->setDoc( m_pDocTE->toPlainText() ); + m_pUMLView->umlScene()->setDoc( m_pDocTE->toPlainText() ); } else if ( m_pUMLWidget ) { // the file is marked modified, if the documentation differs // we don't do this on startup/load of a xmi file, because every time @@ -183,7 +184,7 @@ return; } m_pUMLView = view; - m_pDocTE->setText( m_pUMLView->getDoc() ); + m_pDocTE->setText( m_pUMLView->umlScene()->getDoc() ); } /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/folder.cpp kdesdk-4.7.95/umbrello/umbrello/folder.cpp --- kdesdk-4.7.90/umbrello/umbrello/folder.cpp 2011-10-11 14:51:51.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/folder.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -19,6 +19,7 @@ #include "optionstate.h" #include "object_factory.h" #include "model_utils.h" +#include "umlscene.h" // kde includes #include @@ -132,7 +133,7 @@ } foreach (UMLView* v, m_diagrams) { - v->activateAfterLoad(); + v->umlScene()->activateAfterLoad(); } // Make sure we have a treeview item for each diagram. // It may happen that we are missing them after switching off tabbed widgets. @@ -151,7 +152,7 @@ UMLView *UMLFolder::findView(Uml::IDType id) { foreach (UMLView* v, m_diagrams ) { - if (v->getID() == id) { + if (v->umlScene()->getID() == id) { return v; } } @@ -180,7 +181,7 @@ UMLView *UMLFolder::findView(Uml::DiagramType type, const QString &name, bool searchAllScopes) { foreach (UMLView* v, m_diagrams) { - if (v->type() == type && v->name() == name) { + if (v->umlScene()->type() == type && v->umlScene()->name() == name) { return v; } } @@ -226,7 +227,7 @@ foreach (UMLView* v, m_diagrams ) { // TODO ------------------ check this code - bad: calling back to UMLDoc::removeView() - v->removeAllAssociations(); // note : It may not be apparent, but when we remove all associations + v->umlScene()->removeAllAssociations(); // note : It may not be apparent, but when we remove all associations // from a view, it also causes any UMLAssociations that lack parent // association widgets (but once had them) to remove themselves from // this document. @@ -278,7 +279,7 @@ QDomElement diagramsElement = qDoc.createElement("diagrams"); foreach (UMLView* pView, m_diagrams ) { - pView->saveToXMI(qDoc, diagramsElement); + pView->umlScene()->saveToXMI(qDoc, diagramsElement); } QDomElement extension = qDoc.createElement("XMI.extension"); extension.setAttribute("xmi.extender", "umbrello"); @@ -376,8 +377,8 @@ continue; } UMLView * pView = new UMLView(this); - pView->setOptionState(optionState); - if (pView->loadFromXMI(diagram)) { + pView->umlScene()->setOptionState(optionState); + if (pView->umlScene()->loadFromXMI(diagram)) { pView->hide(); umldoc->addView(pView); } else { diff -Nru kdesdk-4.7.90/umbrello/umbrello/icon_utils.cpp kdesdk-4.7.95/umbrello/umbrello/icon_utils.cpp --- kdesdk-4.7.90/umbrello/umbrello/icon_utils.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/icon_utils.cpp 2011-12-20 21:00:10.000000000 +0000 @@ -191,6 +191,8 @@ return "preferences-desktop-theme"; case it_Properties_Class: return "document-properties"; + case it_Properties_CodeImport: + return "text-x-generic"; case it_Properties_CodeGeneration: return "text-x-generic"; case it_Properties_CodeViewer: diff -Nru kdesdk-4.7.90/umbrello/umbrello/icon_utils.h kdesdk-4.7.95/umbrello/umbrello/icon_utils.h --- kdesdk-4.7.90/umbrello/umbrello/icon_utils.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/icon_utils.h 2011-12-20 21:00:11.000000000 +0000 @@ -68,6 +68,7 @@ it_Properties_Roles, it_Properties_UserInterface, it_Properties_Class, + it_Properties_CodeImport, it_Properties_CodeGeneration, it_Properties_CodeViewer, it_Properties_Columns, diff -Nru kdesdk-4.7.90/umbrello/umbrello/linepath.cpp kdesdk-4.7.95/umbrello/umbrello/linepath.cpp --- kdesdk-4.7.90/umbrello/umbrello/linepath.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/linepath.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -17,7 +17,6 @@ // qt includes #include -#include #include // application includes @@ -29,29 +28,29 @@ #include "umldoc.h" #include "uml.h" -LinePath::Circle::Circle(Q3Canvas * canvas, int radius /* = 0 */) - : Q3CanvasEllipse(radius * 2, radius * 2, canvas) +LinePath::Circle::Circle(UMLViewCanvas * canvas, int radius /* = 0 */) + : UMLSceneEllipse(radius * 2, radius * 2, canvas) { } void LinePath::Circle::setX(int x) { - Q3CanvasItem::setX( (double) x ); + UMLSceneItem::setX( (double) x ); } void LinePath::Circle::setY(int y) { - Q3CanvasItem::setY( (double) y ); + UMLSceneItem::setY( (double) y ); } void LinePath::Circle::setRadius(int radius) { - Q3CanvasEllipse::setSize(radius * 2, radius * 2); + UMLSceneEllipse::setSize(radius * 2, radius * 2); } int LinePath::Circle::getRadius() const { - return (Q3CanvasEllipse::height() / 2); + return (UMLSceneEllipse::height() / 2); } void LinePath::Circle::drawShape(QPainter& p) @@ -115,10 +114,10 @@ return QPoint( -1, -1 ); if( pointIndex == count ) { - Q3CanvasLine * line = m_LineList.last(); + UMLSceneLine * line = m_LineList.last(); return line -> endPoint(); } - Q3CanvasLine * line = m_LineList.at( pointIndex ); + UMLSceneLine * line = m_LineList.at( pointIndex ); return line -> startPoint(); } @@ -136,7 +135,7 @@ } if( pointIndex == count) { - Q3CanvasLine * line = m_LineList.last(); + UMLSceneLine * line = m_LineList.last(); QPoint p = line -> startPoint(); line -> setPoints( p.x(), p.y(), point.x(), point.y() ); moveSelected( pointIndex ); @@ -144,14 +143,14 @@ return true; } if( pointIndex == 0 ) { - Q3CanvasLine * line = m_LineList.first(); + UMLSceneLine * line = m_LineList.first(); QPoint p = line -> endPoint(); line -> setPoints( point.x(), point.y(), p.x(), p.y() ); moveSelected( pointIndex ); update(); return true; } - Q3CanvasLine * line = m_LineList.at( pointIndex ); + UMLSceneLine * line = m_LineList.at( pointIndex ); QPoint p = line -> endPoint(); line -> setPoints( point.x(), point.y(), p.x(), p.y() ); line = m_LineList.at( pointIndex - 1 ); @@ -173,7 +172,7 @@ if ( pointIndex >= count ) return false; - Q3CanvasLine * line = m_LineList.at( pointIndex ); + UMLSceneLine * line = m_LineList.at( pointIndex ); /* check if the given point is the start or end point of the line */ if ( ( @@ -202,11 +201,11 @@ const bool bLoading = UMLApp::app()->document()->loading(); if( count == 1 || pointIndex == 1) { - Q3CanvasLine * first = m_LineList.first(); + UMLSceneLine * first = m_LineList.first(); QPoint sp = first -> startPoint(); QPoint ep = first -> endPoint(); first -> setPoints( sp.x(), sp.y(), point.x(), point.y() ); - Q3CanvasLine * line = new Q3CanvasLine( getScene() ); + UMLSceneLine * line = new UMLSceneLine( getScene() ); line -> setZ( -2 ); line -> setPoints( point.x(), point.y(), ep.x(), ep.y() ); line -> setPen( getPen() ); @@ -217,11 +216,11 @@ return true; } if( count + 1 == pointIndex ) { - Q3CanvasLine * before = m_LineList.last(); + UMLSceneLine * before = m_LineList.last(); QPoint sp = before -> startPoint(); QPoint ep = before -> endPoint(); before -> setPoints( sp.x(), sp.y(), point.x(), point.y() ); - Q3CanvasLine * line = new Q3CanvasLine( getScene() ); + UMLSceneLine * line = new UMLSceneLine( getScene() ); line -> setPoints( point.x(), point.y(), ep.x(), ep.y() ); line -> setZ( -2 ); line -> setPen( getPen() ); @@ -231,11 +230,11 @@ setupSelected(); return true; } - Q3CanvasLine * before = m_LineList.at( pointIndex - 1 ); + UMLSceneLine * before = m_LineList.at( pointIndex - 1 ); QPoint sp = before -> startPoint(); QPoint ep = before -> endPoint(); before -> setPoints( sp.x(), sp.y(), point.x(), point.y() ); - Q3CanvasLine * line = new Q3CanvasLine(getScene() ); + UMLSceneLine * line = new UMLSceneLine(getScene() ); line -> setPoints( point.x(), point.y(), ep.x(), ep.y() ); line -> setZ( -2 ); line -> setPen( getPen() ); @@ -259,7 +258,7 @@ /* we don't know if the user clicked on the start- or endpoint of a * line segment */ - Q3CanvasLine * current_line = m_LineList.at( pointIndex ); + UMLSceneLine * current_line = m_LineList.at( pointIndex ); if (abs( current_line -> endPoint().x() - point.x() ) <= delta && abs( current_line -> endPoint().y() - point.y() ) <= delta) @@ -271,7 +270,7 @@ /* the next segment will get the starting point from the current one, * which is going to be removed */ - Q3CanvasLine * next_line = m_LineList.at( pointIndex + 1 ); + UMLSceneLine * next_line = m_LineList.at( pointIndex + 1 ); QPoint startPoint = current_line -> startPoint(); QPoint endPoint = next_line -> endPoint(); next_line -> setPoints(startPoint.x(), startPoint.y(), @@ -289,7 +288,7 @@ /* the previous segment will get the end point from the current one, * which is going to be removed */ - Q3CanvasLine * previous_line = m_LineList.at( pointIndex - 1 ); + UMLSceneLine * previous_line = m_LineList.at( pointIndex - 1 ); QPoint startPoint = previous_line -> startPoint(); QPoint endPoint = current_line -> endPoint(); previous_line -> setPoints(startPoint.x(), startPoint.y(), @@ -313,7 +312,7 @@ { int count = m_LineList.count(); if( count == 0 ) { - Q3CanvasLine * line = new Q3CanvasLine(getScene() ); + UMLSceneLine * line = new UMLSceneLine(getScene() ); line -> setPoints( start.x(), start.y(),end.x(),end.y() ); line -> setZ( -2 ); line -> setPen( getPen() ); @@ -343,12 +342,12 @@ */ int LinePath::onLinePath( const QPoint &position ) { - Q3CanvasItemList list = getScene()->collisions( position ); + UMLSceneItemList list = getScene()->collisions( position ); int index = -1; - Q3CanvasItemList::iterator end(list.end()); - for(Q3CanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) { - if( ( index = m_LineList.indexOf( (Q3CanvasLine*)*item_it ) ) != -1 ) + UMLSceneItemList::iterator end(list.end()); + for(UMLSceneItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) { + if( ( index = m_LineList.indexOf( (UMLSceneLine*)*item_it ) ) != -1 ) break; }//end for return index; @@ -373,8 +372,8 @@ */ void LinePath::setAssocType( Uml::AssociationType type ) { - QList::Iterator it = m_LineList.begin(); - QList::Iterator end = m_LineList.end(); + QList::Iterator it = m_LineList.begin(); + QList::Iterator end = m_LineList.end(); for( ; it != end; ++it ) (*it) -> setPen( getPen() ); @@ -436,7 +435,7 @@ void LinePath::setLineColor( const QColor &color ) { uint linewidth = 0; - Q3CanvasLine * line = 0; + UMLSceneLine * line = 0; Q_FOREACH( line, m_LineList ) { linewidth = line->pen().width(); @@ -490,7 +489,7 @@ void LinePath::setLineWidth( uint width ) { QColor linecolor; - Q3CanvasLine * line = 0; + UMLSceneLine * line = 0; Q_FOREACH( line, m_LineList ) { linecolor = line->pen().color(); @@ -526,8 +525,8 @@ } if( (int)m_RectList.count() + 1 != lineCount ) setupSelected(); - Q3CanvasRectangle * rect = 0; - Q3CanvasLine * line = 0; + UMLSceneRectangle * rect = 0; + UMLSceneLine * line = 0; if( pointIndex == lineCount || lineCount == 1) { line = m_LineList.last(); QPoint p = line -> endPoint(); @@ -552,17 +551,17 @@ { qDeleteAll( m_RectList.begin(), m_RectList.end() ); m_RectList.clear(); - Q3CanvasLine * line = 0; + UMLSceneLine * line = 0; Q_FOREACH( line, m_LineList ) { QPoint sp = line -> startPoint(); - Q3CanvasRectangle *rect = Widget_Utils::decoratePoint(sp); + UMLSceneRectangle *rect = Widget_Utils::decoratePoint(sp); m_RectList.append( rect ); } //special case for last point line = m_LineList.last(); QPoint p = line -> endPoint(); - Q3CanvasRectangle *rect = Widget_Utils::decoratePoint(p); + UMLSceneRectangle *rect = Widget_Utils::decoratePoint(p); m_RectList.append( rect ); update(); } @@ -670,7 +669,7 @@ void LinePath::updateHead() { int count = m_HeadList.count(); - Q3CanvasLine * line = 0; + UMLSceneLine * line = 0; switch( getAssocType() ) { case Uml::AssociationType::State: @@ -765,7 +764,7 @@ { QPen pen( getLineColor(), getLineWidth() ); for (int i = 0; i < by; i++) { - Q3CanvasLine * line = new Q3CanvasLine( getScene() ); + UMLSceneLine * line = new UMLSceneLine( getScene() ); line -> setZ( 0 ); line -> setPen( pen ); line -> setVisible( true ); @@ -780,7 +779,7 @@ { qDeleteAll( m_HeadList.begin(), m_HeadList.end() ); m_HeadList.clear(); - Q3Canvas * canvas = getScene(); + UMLViewCanvas * canvas = getScene(); switch( getAssocType() ) { case Uml::AssociationType::Activity: case Uml::AssociationType::Exception: @@ -794,7 +793,7 @@ case Uml::AssociationType::Generalization: case Uml::AssociationType::Realization: growList(m_HeadList, 3); - m_pClearPoly = new Q3CanvasPolygon( canvas ); + m_pClearPoly = new UMLScenePolygon( canvas ); m_pClearPoly -> setVisible( true ); m_pClearPoly -> setBrush( QBrush( Qt::white ) ); m_pClearPoly -> setZ( -1 ); @@ -803,7 +802,7 @@ case Uml::AssociationType::Composition: case Uml::AssociationType::Aggregation: growList(m_HeadList, 4); - m_pClearPoly = new Q3CanvasPolygon( canvas ); + m_pClearPoly = new UMLScenePolygon( canvas ); m_pClearPoly -> setVisible( true ); if( getAssocType() == Uml::AssociationType::Aggregation ) m_pClearPoly->setBrush( QBrush( Qt::white ) ); @@ -897,7 +896,7 @@ { if( !m_bParallelLineCreated ) return; - Q3CanvasLine * line = 0; + UMLSceneLine * line = 0; QPoint common = m_ParallelLines.at( 0 ); QPoint p = m_ParallelLines.at( 1 ); line = m_ParallelList.at( 0 ); @@ -957,12 +956,12 @@ * This class doesn't hold this information but is a wrapper * method to stop calls to undefined variable like m_pAssociation. */ -Q3Canvas * LinePath::getScene() +UMLViewCanvas * LinePath::getScene() { if( !m_pAssociation ) return 0; const UMLView * view = m_pAssociation->umlScene(); - return view->canvas(); + return static_cast(view->canvas()); } /** @@ -1157,11 +1156,11 @@ int count = m_LineList.count(); if (count == 0) return; - Q3Canvas * canvas = getScene(); + UMLViewCanvas * canvas = getScene(); if (canvas == NULL) return; for (int i = 0; i < count ; i++) { - Q3CanvasLine *line = m_LineList.at(i); + UMLSceneLine *line = m_LineList.at(i); line -> setCanvas( canvas ); line -> setPen( getPen() ); } @@ -1198,7 +1197,7 @@ if ( m_LineList.count() < 1 ) { return; } - Q3CanvasLine* firstLine = m_LineList.first(); + UMLSceneLine* firstLine = m_LineList.first(); QPoint startPoint = firstLine->startPoint(); QPoint endPoint = firstLine->endPoint(); QPoint centrePoint; @@ -1232,8 +1231,8 @@ } } -LinePath::SubsetSymbol::SubsetSymbol(Q3Canvas* canvas) - : Q3CanvasEllipse(canvas) { +LinePath::SubsetSymbol::SubsetSymbol(UMLViewCanvas* canvas) + : UMLSceneEllipse(canvas) { inclination = 0; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/linepath.h kdesdk-4.7.95/umbrello/umbrello/linepath.h --- kdesdk-4.7.90/umbrello/umbrello/linepath.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/linepath.h 2011-12-20 21:00:11.000000000 +0000 @@ -12,11 +12,12 @@ #define LINEPATH_H #include "basictypes.h" +#include "umlscene.h" #include #include #include -#include +#include /* how many pixels a user could click around a point */ #define POINT_DELTA 5 @@ -28,8 +29,8 @@ class QPainter; // typedefs -typedef QList LineList; -typedef QList RectList; +typedef QList LineList; +typedef QList RectList; /** * @author Paul Hensgen @@ -103,10 +104,10 @@ * We can't use QCanvasEllipse directly for this because it doesn't * use the pen, i.e. QCanvasEllipse only draws filled ellipses. */ - class Circle : public Q3CanvasEllipse + class Circle : public UMLSceneEllipse { public: - explicit Circle(Q3Canvas * canvas, int radius = 0); + explicit Circle(UMLViewCanvas * canvas, int radius = 0); void setRadius(int radius); int getRadius() const; void setX(int x); @@ -118,10 +119,10 @@ /** * Draw the subset Symbol */ - class SubsetSymbol : public Q3CanvasEllipse + class SubsetSymbol : public UMLSceneEllipse { public: - explicit SubsetSymbol(Q3Canvas* canvas); + explicit SubsetSymbol(UMLViewCanvas* canvas); /** * Sets the Inclination of the Subset Symbol w.r.t horizontal x axis @@ -137,7 +138,7 @@ int inclination; }; - Q3Canvas * getScene(); + UMLViewCanvas * getScene(); Uml::AssociationType getAssocType() const; @@ -177,7 +178,7 @@ */ QPoint m_ArrowPointA, m_ArrowPointB, m_MidPoint, m_EgdePoint; - Q3CanvasPolygon* m_pClearPoly; ///< A polygon object to blank out any lines we don't want to see. + UMLScenePolygon* m_pClearPoly; ///< A polygon object to blank out any lines we don't want to see. Circle* m_pCircle; ///< The transparent circle required by containment associations. SubsetSymbol* m_pSubsetSymbol; ///< The subset notation required by Child to Category associations. QPolygon m_ParallelLines; ///< Contains the calculated points for the parallel line on a collaboration message to use. diff -Nru kdesdk-4.7.90/umbrello/umbrello/listpopupmenu.cpp kdesdk-4.7.95/umbrello/umbrello/listpopupmenu.cpp --- kdesdk-4.7.90/umbrello/umbrello/listpopupmenu.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/listpopupmenu.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -617,12 +617,6 @@ case mt_Internalize_Folder: m_actions[m] = addAction(i18n("Internalize Folder")); break; - case mt_Import_Classes: - m_actions[m] = addAction(Icon_Utils::BarIcon(Icon_Utils::it_Import_Class), i18n("Import Classes...")); - break; - case mt_Import_Project: - m_actions[m] = addAction(Icon_Utils::BarIcon(Icon_Utils::it_Import_Project), i18n("Import Project...")); - break; case mt_Reset_Label_Positions: m_actions[m] = addAction(i18n("Reset Label Positions")); break; @@ -1211,9 +1205,6 @@ addSeparator(); insert(mt_Paste); addSeparator(); - insert(mt_Import_Classes); - insert(mt_Import_Project); - addSeparator(); insert(mt_Expand_All); insert(mt_Collapse_All); break; @@ -1259,8 +1250,6 @@ case mt_Logical_Folder: insertContainerItems(true); insertStdItems(); - insert(mt_Import_Classes); - insert(mt_Import_Project); insertSubmodelAction(); addSeparator(); insert(mt_Expand_All); diff -Nru kdesdk-4.7.90/umbrello/umbrello/listpopupmenu.h kdesdk-4.7.95/umbrello/umbrello/listpopupmenu.h --- kdesdk-4.7.90/umbrello/umbrello/listpopupmenu.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/listpopupmenu.h 2011-12-20 21:00:11.000000000 +0000 @@ -153,8 +153,6 @@ mt_Rename, mt_Delete, mt_Export_Image, - mt_Import_Classes, - mt_Import_Project, mt_Sequence_Number, mt_Cut, mt_Copy, diff -Nru kdesdk-4.7.90/umbrello/umbrello/model_utils.cpp kdesdk-4.7.95/umbrello/umbrello/model_utils.cpp --- kdesdk-4.7.90/umbrello/umbrello/model_utils.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/model_utils.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -30,6 +30,7 @@ #include "uml.h" #include "umllistview.h" #include "umllistviewitem.h" +#include "umlscene.h" #include "umlview.h" #include "codegenerator.h" diff -Nru kdesdk-4.7.90/umbrello/umbrello/optionstate.h kdesdk-4.7.95/umbrello/umbrello/optionstate.h --- kdesdk-4.7.90/umbrello/umbrello/optionstate.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/optionstate.h 2011-12-20 21:00:11.000000000 +0000 @@ -25,6 +25,7 @@ page_font, page_UI, page_class, + page_codeimport, page_codegen, page_codeview }; @@ -126,12 +127,17 @@ RubyCodeGenerationState rubyCodeGenerationState; }; +struct CodeImportState { + bool createArtifacts; +}; + struct OptionState { GeneralState generalState; UIState uiState; ClassState classState; CodeViewerState codeViewerState; CodeGenerationState codeGenerationState; + CodeImportState codeImportState; }; OptionState& optionState(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatearrow.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstatearrow.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatearrow.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatearrow.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,22 +11,19 @@ // own header #include "toolbarstatearrow.h" -// qt includes -#include - // app includes #include "associationwidget.h" #include "uml.h" -#include "umlview.h" +#include "umlscene.h" #include "umlwidget.h" /** * Creates a new ToolBarStateArrow. * - * @param umlView The UMLView to use. + * @param umlScene The UMLScene to use. */ -ToolBarStateArrow::ToolBarStateArrow(UMLView *umlView) - : ToolBarState(umlView) +ToolBarStateArrow::ToolBarStateArrow(UMLScene *umlScene) + : ToolBarState(umlScene) { init(); } @@ -87,7 +84,7 @@ m_startPosition = m_pMouseEvent->pos(); for (int i = 0; i < 4; i++) { - Q3CanvasLine* line = new Q3CanvasLine(m_pUMLView->canvas()); + UMLSceneLine* line = new UMLSceneLine(m_pUMLScene->canvas()); line->setPoints(m_pMouseEvent->x(), m_pMouseEvent->y(), m_pMouseEvent->x(), m_pMouseEvent->y()); line->setPen(QPen(QColor("grey"), 0, Qt::DotLine)); @@ -128,7 +125,7 @@ delete m_selectionRect.takeFirst(); m_selectionRect.clear(); } else if (m_pMouseEvent->button() == Qt::RightButton) { - m_pUMLView->setMenu(); + m_pUMLScene->setMenu(); } } @@ -181,7 +178,7 @@ void ToolBarStateArrow::mouseMoveEmpty() { if (m_selectionRect.count() == 4) { - Q3CanvasLine* line = m_selectionRect.at(0); + UMLSceneLine* line = m_selectionRect.at(0); line->setPoints(m_startPosition.x(), m_startPosition.y(), m_pMouseEvent->x(), m_startPosition.y()); @@ -197,7 +194,7 @@ line->setPoints(m_startPosition.x(), m_pMouseEvent->y(), m_startPosition.x(), m_startPosition.y()); - m_pUMLView->selectWidgets(m_startPosition.x(), m_startPosition.y(), + m_pUMLScene->selectWidgets(m_startPosition.x(), m_startPosition.y(), m_pMouseEvent->x(), m_pMouseEvent->y()); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatearrow.h kdesdk-4.7.95/umbrello/umbrello/toolbarstatearrow.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatearrow.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatearrow.h 2011-12-20 21:00:10.000000000 +0000 @@ -12,12 +12,9 @@ #define TOOLBARSTATEARROW_H #include "toolbarstate.h" +#include "umlscene.h" #include -#include - -class UMLView; -class Q3CanvasLine; /** * Arrow tool for select, move and resize widgets and associations. @@ -33,7 +30,7 @@ Q_OBJECT public: - ToolBarStateArrow(UMLView *umlView); + ToolBarStateArrow(UMLScene *umlScene); virtual ~ToolBarStateArrow(); virtual void init(); @@ -59,7 +56,7 @@ /** * The selection rectangle that contains the four lines of its borders. */ - QList m_selectionRect; + QList m_selectionRect; /** * The start position of the selection rectangle. diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstateassociation.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstateassociation.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstateassociation.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstateassociation.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -21,25 +21,22 @@ #include "model_utils.h" #include "uml.h" #include "umlobject.h" -#include "umlview.h" -#include "umllistview.h" +#include "umlscene.h" #include "umldoc.h" #include "umlwidget.h" +#include "umllistview.h" // kde includes #include #include -// qt includes -#include - /** * Creates a new ToolBarStateAssociation. * - * @param umlView The UMLView to use. + * @param umlScene The UMLScene to use. */ -ToolBarStateAssociation::ToolBarStateAssociation(UMLView *umlView) - : ToolBarStatePool(umlView) +ToolBarStateAssociation::ToolBarStateAssociation(UMLScene *umlScene) + : ToolBarStatePool(umlScene) { m_firstWidget = 0; m_associationLine = 0; @@ -78,7 +75,7 @@ * It executes the base method and then updates the position of the * association line, if any. */ -void ToolBarStateAssociation::mouseMove(QMouseEvent* ome) +void ToolBarStateAssociation::mouseMove(UMLSceneMouseEvent* ome) { ToolBarStatePool::mouseMove(ome); @@ -185,17 +182,17 @@ pos.setX(widget->getX() + (widget->getWidth() / 2)); pos.setY(widget->getY() + (widget->getHeight() / 2)); //TODO why is this needed? - m_pUMLView->setPos(pos); + m_pUMLScene->setPos(pos); m_firstWidget = widget; - m_associationLine = new Q3CanvasLine(m_pUMLView->canvas()); + m_associationLine = new UMLSceneLine(m_pUMLScene->canvas()); m_associationLine->setPoints(pos.x(), pos.y(), pos.x(), pos.y()); - m_associationLine->setPen(QPen(m_pUMLView->getLineColor(), m_pUMLView->getLineWidth(), Qt::DashLine)); + m_associationLine->setPen(QPen(m_pUMLScene->getLineColor(), m_pUMLScene->getLineWidth(), Qt::DashLine)); m_associationLine->setVisible(true); - m_pUMLView->viewport()->setMouseTracking(true); + m_pUMLScene->viewport()->setMouseTracking(true); } /** @@ -229,7 +226,7 @@ valid = AssocRules::allowAssociation(type, widgetA, widgetB); } if (valid) { - AssociationWidget *temp = new AssociationWidget(m_pUMLView, widgetA, type, widgetB); + AssociationWidget *temp = new AssociationWidget(m_pUMLScene, widgetA, type, widgetB); addAssociationInViewAndDoc(temp); if (type == Uml::AssociationType::Containment) { UMLListView *lv = UMLApp::app()->listView(); @@ -298,14 +295,14 @@ void ToolBarStateAssociation::addAssociationInViewAndDoc(AssociationWidget* assoc) { // append in view - if (m_pUMLView->addAssociation(assoc, false)) { + if (m_pUMLScene->addAssociation(assoc, false)) { // if view went ok, then append in document UMLAssociation *umla = assoc->getAssociation(); if (umla == NULL) { // association without model representation in UMLDoc return; } - Uml::ModelType m = Model_Utils::convert_DT_MT(m_pUMLView->type()); + Uml::ModelType m = Model_Utils::convert_DT_MT(m_pUMLScene->type()); UMLDoc *umldoc = UMLApp::app()->document(); umla->setUMLPackage(umldoc->rootFolder(m)); UMLApp::app()->document()->addAssociation(umla); diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstateassociation.h kdesdk-4.7.95/umbrello/umbrello/toolbarstateassociation.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstateassociation.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstateassociation.h 2011-12-20 21:00:11.000000000 +0000 @@ -14,8 +14,6 @@ #include "basictypes.h" #include "toolbarstatepool.h" -class Q3CanvasLine; - /** * Association tool to create associations between widgets. * With association tool, two widgets are selected clicking with left button on @@ -40,14 +38,14 @@ Q_OBJECT public: - ToolBarStateAssociation(UMLView *umlView); + ToolBarStateAssociation(UMLScene *umlScene); virtual ~ToolBarStateAssociation(); virtual void init(); virtual void cleanBeforeChange(); - virtual void mouseMove(QMouseEvent* ome); + virtual void mouseMove(UMLSceneMouseEvent* ome); public slots: @@ -79,7 +77,7 @@ * The association line shown while the first widget is selected and the * second one wasn't selected yet. */ - Q3CanvasLine* m_associationLine; + UMLSceneLine* m_associationLine; }; diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstate.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstate.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstate.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstate.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -20,7 +20,7 @@ #include "floatingdashlinewidget.h" #include "objectwidget.h" #include "uml.h" -#include "umlview.h" +#include "umlscene.h" #include "umlwidget.h" /** @@ -38,14 +38,14 @@ */ void ToolBarState::init() { - m_pUMLView->viewport()->setMouseTracking(false); + m_pUMLScene->viewport()->setMouseTracking(false); m_pMouseEvent = 0; m_currentWidget = 0; m_currentAssociation = 0; - connect(m_pUMLView, SIGNAL(sigAssociationRemoved(AssociationWidget*)), + connect(m_pUMLScene, SIGNAL(sigAssociationRemoved(AssociationWidget*)), this, SLOT(slotAssociationRemoved(AssociationWidget*))); - connect(m_pUMLView, SIGNAL(sigWidgetRemoved(UMLWidget*)), + connect(m_pUMLScene, SIGNAL(sigWidgetRemoved(UMLWidget*)), this, SLOT(slotWidgetRemoved(UMLWidget*))); } @@ -56,9 +56,9 @@ */ void ToolBarState::cleanBeforeChange() { - disconnect(m_pUMLView, SIGNAL(sigAssociationRemoved(AssociationWidget*)), + disconnect(m_pUMLScene, SIGNAL(sigAssociationRemoved(AssociationWidget*)), this, SLOT(slotAssociationRemoved(AssociationWidget*))); - disconnect(m_pUMLView, SIGNAL(sigWidgetRemoved(UMLWidget*)), + disconnect(m_pUMLScene, SIGNAL(sigWidgetRemoved(UMLWidget*)), this, SLOT(slotWidgetRemoved(UMLWidget*))); } @@ -73,21 +73,21 @@ * @param ome The received event. * @see setCurrentElement() */ -void ToolBarState::mousePress(QMouseEvent* ome) +void ToolBarState::mousePress(UMLSceneMouseEvent* ome) { setMouseEvent(ome, QEvent::MouseButtonPress); - m_pUMLView->viewport()->setMouseTracking(true); + m_pUMLScene->viewport()->setMouseTracking(true); //TODO Doesn't another way of emiting the signal exist? A method only for //that seems a bit dirty. - m_pUMLView->emitRemovePopupMenu(); + m_pUMLScene->emitRemovePopupMenu(); // TODO: Check who needs this. - m_pUMLView->setPos(m_pMouseEvent->pos()); + m_pUMLScene->setPos(m_pMouseEvent->pos()); //TODO check why - m_pUMLView->setPaste(false); + m_pUMLScene->setPaste(false); setCurrentElement(); @@ -109,15 +109,15 @@ * * @param ome The received event. */ -void ToolBarState::mouseRelease(QMouseEvent* ome) +void ToolBarState::mouseRelease(UMLSceneMouseEvent* ome) { setMouseEvent(ome, QEvent::MouseButtonRelease); // Set the position of the mouse // TODO, should only be available in this state? - m_pUMLView->setPos(m_pMouseEvent->pos()); + m_pUMLScene->setPos(m_pMouseEvent->pos()); - m_pUMLView->viewport()->setMouseTracking(false); + m_pUMLScene->viewport()->setMouseTracking(false); if (getCurrentWidget()) { mouseReleaseWidget(); @@ -142,11 +142,11 @@ * * @param ome The received event. */ -void ToolBarState::mouseDoubleClick(QMouseEvent* ome) +void ToolBarState::mouseDoubleClick(UMLSceneMouseEvent* ome) { setMouseEvent(ome, QEvent::MouseButtonDblClick); - UMLWidget* currentWidget = m_pUMLView->widgetAt(m_pMouseEvent->pos()); + UMLWidget* currentWidget = m_pUMLScene->widgetAt(m_pMouseEvent->pos()); AssociationWidget* currentAssociation = getAssociationAt(m_pMouseEvent->pos()); if (currentWidget) { setCurrentWidget(currentWidget); @@ -166,7 +166,7 @@ * Events are delivered to the specific methods, depending on where the cursor * was pressed. It uses the current widget or association set in press event, * if any. - * Then, the view is scrolled if needed (if the cursor is moved in any of the + * Then, the scene is scrolled if needed (if the cursor is moved in any of the * 30 pixels width area from left, top, right or bottom sides, and there is * more diagram currently not being shown in that direction). * This method is only called when mouse tracking is enabled and the mouse @@ -174,7 +174,7 @@ * * @param ome The received event. */ -void ToolBarState::mouseMove(QMouseEvent* ome) +void ToolBarState::mouseMove(UMLSceneMouseEvent* ome) { setMouseEvent(ome, QEvent::MouseMove); @@ -189,22 +189,22 @@ //Scrolls the view int vx = ome->x(); int vy = ome->y(); - int contsX = m_pUMLView->contentsX(); - int contsY = m_pUMLView->contentsY(); - int visw = m_pUMLView->visibleWidth(); - int vish = m_pUMLView->visibleHeight(); + int contsX = m_pUMLScene->contentsX(); + int contsY = m_pUMLScene->contentsY(); + int visw = m_pUMLScene->visibleWidth(); + int vish = m_pUMLScene->visibleHeight(); int dtr = visw - (vx-contsX); int dtb = vish - (vy-contsY); int dtt = (vy-contsY); int dtl = (vx-contsX); - if (dtr < 30) m_pUMLView->scrollBy(30-dtr,0); - if (dtb < 30) m_pUMLView->scrollBy(0,30-dtb); - if (dtl < 30) m_pUMLView->scrollBy(-(30-dtl),0); - if (dtt < 30) m_pUMLView->scrollBy(0,-(30-dtt)); + if (dtr < 30) m_pUMLScene->scrollBy(30-dtr,0); + if (dtb < 30) m_pUMLScene->scrollBy(0,30-dtb); + if (dtl < 30) m_pUMLScene->scrollBy(-(30-dtl),0); + if (dtt < 30) m_pUMLScene->scrollBy(0,-(30-dtt)); } /** - * An association was removed from the UMLView. + * An association was removed from the UMLScene. * If the association removed was the current association, the current * association is set to 0. * It can be extended in subclasses if needed. @@ -231,14 +231,15 @@ /** * Creates a new ToolBarState. - * UMLView is set as parent of this QObject, and name is left empty. + * UMLScene is set as parent of this QObject, and name is left empty. * Protected to avoid classes other than derived to create objects of this * class. * - * @param umlView The UMLView to use. + * @param umlScene The UMLScene to use. */ -ToolBarState::ToolBarState(UMLView *umlView) - : QObject(umlView), m_pUMLView(umlView) +ToolBarState::ToolBarState(UMLScene *umlScene) + : QObject(umlScene), + m_pUMLScene(umlScene) { m_pMouseEvent = NULL; init(); @@ -276,14 +277,14 @@ return; } - ObjectWidget* objectWidgetLine = m_pUMLView->onWidgetDestructionBox(m_pMouseEvent->pos()); + ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetDestructionBox(m_pMouseEvent->pos()); if (objectWidgetLine) { setCurrentWidget(objectWidgetLine); return; } // Check widgets. - UMLWidget *widget = m_pUMLView->widgetAt(m_pMouseEvent->pos()); + UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos()); if (widget) { setCurrentWidget(widget); return; @@ -312,7 +313,7 @@ */ void ToolBarState::mousePressEmpty() { - m_pUMLView->clearSelected(); + m_pUMLScene->clearSelected(); } /** @@ -361,7 +362,7 @@ */ void ToolBarState::mouseDoubleClickEmpty() { - m_pUMLView->clearSelected(); + m_pUMLScene->clearSelected(); } /** @@ -452,17 +453,17 @@ /** * Sets m_pMouseEvent as the equivalent of the received event after transforming it - * using the inverse world matrix in the UMLView. + * using the inverse world matrix in the UMLScene. * This method is called at the beginning of the main event handler methods. * * @param ome The mouse event to transform. * @param type The type of the event. */ -void ToolBarState::setMouseEvent(QMouseEvent* ome, const QEvent::Type &type) +void ToolBarState::setMouseEvent(UMLSceneMouseEvent* ome, const QEvent::Type &type) { delete m_pMouseEvent; - m_pMouseEvent = new QMouseEvent(type, m_pUMLView->inverseWorldMatrix().map(ome->pos()), + m_pMouseEvent = new UMLSceneMouseEvent(type, m_pUMLScene->inverseWorldMatrix().map(ome->pos()), ome->button(),ome->buttons(),ome->modifiers()); } @@ -477,7 +478,7 @@ */ MessageWidget* ToolBarState::getMessageAt(const QPoint& pos) { - foreach ( MessageWidget* message, m_pUMLView->getMessageList() ) { + foreach ( MessageWidget* message, m_pUMLScene->getMessageList() ) { if (message->isVisible() && message->onWidget(pos)) { return message; } @@ -496,7 +497,7 @@ */ AssociationWidget* ToolBarState::getAssociationAt(const QPoint& pos) { - foreach ( AssociationWidget* association, m_pUMLView->getAssociationList() ) { + foreach ( AssociationWidget* association, m_pUMLScene->getAssociationList() ) { if (association->onAssociation(pos)) { return association; } @@ -516,7 +517,7 @@ { FloatingDashLineWidget* floatingline = 0; - foreach ( UMLWidget* widget, m_pUMLView->getWidgetList() ) { + foreach ( UMLWidget* widget, m_pUMLScene->getWidgetList() ) { if (widget->baseType() == WidgetBase::wt_FloatingDashLine){ if (dynamic_cast(widget)->onLine(pos)) { floatingline = dynamic_cast(widget); diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatefactory.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstatefactory.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatefactory.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatefactory.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -37,7 +37,7 @@ } -ToolBarState* ToolBarStateFactory::getState(const WorkToolBar::ToolBar_Buttons &toolbarButton, UMLView *umlView) +ToolBarState* ToolBarStateFactory::getState(const WorkToolBar::ToolBar_Buttons &toolbarButton, UMLScene *umlScene) { int key = getKey(toolbarButton); @@ -47,13 +47,13 @@ { // When you add a new state, make sure you also increase the // NR_OF_TOOLBAR_STATES - case 0: m_states[0] = new ToolBarStateOther(umlView); break; - case 1: m_states[1] = new ToolBarStateAssociation(umlView); break; - case 2: m_states[2] = new ToolBarStateMessages(umlView); break; + case 0: m_states[0] = new ToolBarStateOther(umlScene); break; + case 1: m_states[1] = new ToolBarStateAssociation(umlScene); break; + case 2: m_states[2] = new ToolBarStateMessages(umlScene); break; // This case has no pool. - case 3: m_states[3] = new ToolBarStateArrow(umlView); break; - case 4: m_states[4] = new ToolBarStateOneWidget(umlView); break; + case 3: m_states[3] = new ToolBarStateArrow(umlScene); break; + case 4: m_states[4] = new ToolBarStateOneWidget(umlScene); break; } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatefactory.h kdesdk-4.7.95/umbrello/umbrello/toolbarstatefactory.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatefactory.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatefactory.h 2011-12-20 21:00:11.000000000 +0000 @@ -39,7 +39,7 @@ // Destructor virtual ~ToolBarStateFactory(); - ToolBarState* getState(const WorkToolBar::ToolBar_Buttons &toolbarButton, UMLView* umlView); + ToolBarState* getState(const WorkToolBar::ToolBar_Buttons &toolbarButton, UMLScene* umlScene); protected: int getKey(const WorkToolBar::ToolBar_Buttons &toolbarButton) const; diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstate.h kdesdk-4.7.95/umbrello/umbrello/toolbarstate.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstate.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstate.h 2011-12-20 21:00:10.000000000 +0000 @@ -11,16 +11,17 @@ #ifndef TOOLBARSTATE_H #define TOOLBARSTATE_H +#include "umlscene.h" + #include #include #include -class QMouseEvent; class AssociationWidget; class MessageWidget; class FloatingDashLineWidget; -class UMLView; +class UMLScene; class UMLWidget; /** @@ -78,10 +79,10 @@ virtual void cleanBeforeChange(); - virtual void mousePress(QMouseEvent *ome); - virtual void mouseRelease(QMouseEvent* ome); - virtual void mouseDoubleClick(QMouseEvent* ome); - virtual void mouseMove(QMouseEvent* ome); + virtual void mousePress(UMLSceneMouseEvent *ome); + virtual void mouseRelease(UMLSceneMouseEvent* ome); + virtual void mouseDoubleClick(UMLSceneMouseEvent* ome); + virtual void mouseMove(UMLSceneMouseEvent* ome); public slots: @@ -90,7 +91,7 @@ protected: - ToolBarState(UMLView *umlView); + ToolBarState(UMLScene *umlScene); virtual void setCurrentElement(); @@ -115,20 +116,20 @@ virtual AssociationWidget* getCurrentAssociation() const; virtual void setCurrentAssociation(AssociationWidget* currentAssociation); - void setMouseEvent(QMouseEvent* ome, const QEvent::Type &type); + void setMouseEvent(UMLSceneMouseEvent* ome, const QEvent::Type &type); AssociationWidget* getAssociationAt(const QPoint& pos); MessageWidget* getMessageAt(const QPoint& pos); FloatingDashLineWidget* getFloatingLineAt(const QPoint& pos); - UMLView* m_pUMLView; ///< The UMLView. + UMLScene* m_pUMLScene; ///< The UMLScene. /** * The mouse event currently in use. * This event is the equivalent of the received event after transforming it - * using the inverse world matrix in the UMLView. + * using the inverse world matrix in the UMLScene. */ - QMouseEvent* m_pMouseEvent; + UMLSceneMouseEvent* m_pMouseEvent; private: diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatemessages.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstatemessages.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatemessages.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatemessages.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -19,21 +19,19 @@ #include "uml.h" #include "umldoc.h" #include "umlview.h" +#include "umlscene.h" // kde includes #include #include -// qt includes -#include - /** * Creates a new ToolBarStateMessages. * - * @param umlView The UMLView to use. + * @param umlScene The UMLScene to use. */ -ToolBarStateMessages::ToolBarStateMessages(UMLView *umlView) - : ToolBarStatePool(umlView) +ToolBarStateMessages::ToolBarStateMessages(UMLScene *umlScene) + : ToolBarStatePool(umlScene) { m_firstObject = 0; m_messageLine = 0; @@ -75,7 +73,7 @@ * It executes the base method and then updates the position of the * message line, if any. */ -void ToolBarStateMessages::mouseMove(QMouseEvent* ome) +void ToolBarStateMessages::mouseMove(UMLSceneMouseEvent* ome) { ToolBarStatePool::mouseMove(ome); @@ -111,7 +109,7 @@ { m_isObjectWidgetLine = false; - ObjectWidget* objectWidgetLine = m_pUMLView->onWidgetLine(m_pMouseEvent->pos()); + ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->pos()); if (objectWidgetLine) { setCurrentWidget(objectWidgetLine); m_isObjectWidgetLine = true; @@ -122,7 +120,7 @@ //However, the applied patch doesn't seem to be necessary no more, so it was removed //The widgets weren't got from UMLView, but from a method in this class similarto the //one in UMLView but containing special code to handle the zoom - UMLWidget *widget = m_pUMLView->widgetAt(m_pMouseEvent->pos()); + UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos()); if (widget) { setCurrentWidget(widget); return; @@ -179,10 +177,10 @@ xclick = m_pMouseEvent->x(); yclick = m_pMouseEvent->y(); - MessageWidget* message = new MessageWidget(m_pUMLView, m_firstObject,xclick, yclick, msgType); + MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject,xclick, yclick, msgType); cleanMessage(); - m_pUMLView->getMessageList().append(message); + m_pUMLScene->getMessageList().append(message); xclick = 0; yclick = 0; @@ -191,7 +189,7 @@ //Shouldn't it cancel also the whole creation? ft->showOperationDialog(); message->setTextPosition(); - m_pUMLView->getWidgetList().append(ft); + m_pUMLScene->getWidgetList().append(ft); UMLApp::app()->document()->setModified(); } @@ -200,13 +198,13 @@ xclick = m_pMouseEvent->x(); yclick = m_pMouseEvent->y(); - m_messageLine = new Q3CanvasLine(m_pUMLView->canvas()); + m_messageLine = new UMLSceneLine(m_pUMLScene->canvas()); m_messageLine->setPoints(m_pMouseEvent->x(), m_pMouseEvent->y(), m_pMouseEvent->x(), m_pMouseEvent->y()); - m_messageLine->setPen(QPen(m_pUMLView->getLineColor(), m_pUMLView->getLineWidth(), Qt::DashLine)); + m_messageLine->setPen(QPen(m_pUMLScene->getLineColor(), m_pUMLScene->getLineWidth(), Qt::DashLine)); m_messageLine->setVisible(true); - m_pUMLView->viewport()->setMouseTracking(true); + m_pUMLScene->viewport()->setMouseTracking(true); } else { cleanMessage(); @@ -226,9 +224,9 @@ Uml::Sequence_Message_Type msgType = getMessageType(); if (msgType == Uml::sequence_message_found && xclick!=0 && yclick!=0) { - MessageWidget* message = new MessageWidget(m_pUMLView, m_firstObject,xclick, yclick, msgType); + MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject,xclick, yclick, msgType); cleanMessage(); - m_pUMLView->getMessageList().append(message); + m_pUMLScene->getMessageList().append(message); xclick = 0; yclick = 0; @@ -238,18 +236,18 @@ //Shouldn't it cancel also the whole creation? ft->showOperationDialog(); message->setTextPosition(); - m_pUMLView->getWidgetList().append(ft); + m_pUMLScene->getWidgetList().append(ft); UMLApp::app()->document()->setModified(); } else { - m_messageLine = new Q3CanvasLine(m_pUMLView->canvas()); + m_messageLine = new UMLSceneLine(m_pUMLScene->canvas()); m_messageLine->setPoints(m_pMouseEvent->x(), m_pMouseEvent->y(), m_pMouseEvent->x(), m_pMouseEvent->y()); - m_messageLine->setPen(QPen(m_pUMLView->getLineColor(), m_pUMLView->getLineWidth(), Qt::DashLine)); + m_messageLine->setPen(QPen(m_pUMLScene->getLineColor(), m_pUMLScene->getLineWidth(), Qt::DashLine)); m_messageLine->setVisible(true); - m_pUMLView->viewport()->setMouseTracking(true); + m_pUMLScene->viewport()->setMouseTracking(true); } } @@ -281,19 +279,19 @@ y = m_messageLine->startPoint().y(); } - MessageWidget* message = new MessageWidget(m_pUMLView, m_firstObject, + MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject, secondObject, y, msgType); cleanMessage(); - m_pUMLView->getMessageList().append(message); + m_pUMLScene->getMessageList().append(message); FloatingTextWidget *ft = message->floatingTextWidget(); //TODO cancel doesn't cancel the creation of the message, only cancels setting an operation. //Shouldn't it cancel also the whole creation? ft->showOperationDialog(); message->setTextPosition(); - m_pUMLView->getWidgetList().append(ft); + m_pUMLScene->getWidgetList().append(ft); UMLApp::app()->document()->setModified(); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatemessages.h kdesdk-4.7.95/umbrello/umbrello/toolbarstatemessages.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatemessages.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatemessages.h 2011-12-20 21:00:11.000000000 +0000 @@ -14,8 +14,6 @@ #include "basictypes.h" #include "toolbarstatepool.h" -class Q3CanvasLine; -class QMouseEvent; class ObjectWidget; /** @@ -52,14 +50,14 @@ Q_OBJECT public: - ToolBarStateMessages(UMLView *umlView); + ToolBarStateMessages(UMLScene *umlScene); virtual ~ToolBarStateMessages(); virtual void init(); virtual void cleanBeforeChange(); - virtual void mouseMove(QMouseEvent* ome); + virtual void mouseMove(UMLSceneMouseEvent* ome); public slots: @@ -100,7 +98,7 @@ * The message line shown while the first widget is selected and the * second one wasn't selected yet. */ - Q3CanvasLine* m_messageLine; + UMLSceneLine* m_messageLine; /** * If there is a current widget, it is true if the press event happened on diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstateother.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstateother.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstateother.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstateother.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -35,6 +35,7 @@ #include "objectwidget.h" #include "objectnodewidget.h" #include "pinwidget.h" +#include "umlscene.h" #include "model_utils.h" // for ENUM_NAMES only #include @@ -45,8 +46,8 @@ * Creates a new ToolBarStateOther. * @param umlView The UMLView to use. */ -ToolBarStateOther::ToolBarStateOther(UMLView *umlView) - : ToolBarStatePool(umlView) +ToolBarStateOther::ToolBarStateOther(UMLScene *umlScene) + : ToolBarStatePool(umlScene) { } @@ -82,11 +83,11 @@ if (!newWidget()) { // Is UMLObject? - m_pUMLView->setCreateObject(true); + m_pUMLScene->setCreateObject(true); Object_Factory::createUMLObject(getObjectType()); } - m_pUMLView->resizeCanvasToItems(); + m_pUMLScene->resizeCanvasToItems(); } } @@ -135,81 +136,81 @@ switch (getButton()) { case WorkToolBar::tbb_Note: - umlWidget = new NoteWidget(m_pUMLView, NoteWidget::Normal); + umlWidget = new NoteWidget(m_pUMLScene, NoteWidget::Normal); break; case WorkToolBar::tbb_Box: - umlWidget = new BoxWidget(m_pUMLView); + umlWidget = new BoxWidget(m_pUMLScene); break; case WorkToolBar::tbb_Text: - umlWidget = new FloatingTextWidget(m_pUMLView, Uml::TextRole::Floating, ""); + umlWidget = new FloatingTextWidget(m_pUMLScene, Uml::TextRole::Floating, ""); break; // Activity buttons case WorkToolBar::tbb_Initial_Activity: - umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Initial); + umlWidget = new ActivityWidget(m_pUMLScene, ActivityWidget::Initial); break; case WorkToolBar::tbb_Activity: - umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Normal); + umlWidget = new ActivityWidget(m_pUMLScene, ActivityWidget::Normal); break; case WorkToolBar::tbb_End_Activity: - umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::End); + umlWidget = new ActivityWidget(m_pUMLScene, ActivityWidget::End); break; case WorkToolBar::tbb_Final_Activity: - umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Final); + umlWidget = new ActivityWidget(m_pUMLScene, ActivityWidget::Final); break; case WorkToolBar::tbb_Branch: - umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Branch); + umlWidget = new ActivityWidget(m_pUMLScene, ActivityWidget::Branch); break; case WorkToolBar::tbb_Fork: case WorkToolBar::tbb_StateFork: - umlWidget = new ForkJoinWidget(m_pUMLView); + umlWidget = new ForkJoinWidget(m_pUMLScene); break; case WorkToolBar::tbb_Initial_State: - umlWidget = new StateWidget(m_pUMLView, StateWidget::Initial); + umlWidget = new StateWidget(m_pUMLScene, StateWidget::Initial); break; case WorkToolBar::tbb_State: - umlWidget = new StateWidget(m_pUMLView, StateWidget::Normal); + umlWidget = new StateWidget(m_pUMLScene, StateWidget::Normal); break; case WorkToolBar::tbb_End_State: - umlWidget = new StateWidget(m_pUMLView, StateWidget::End); + umlWidget = new StateWidget(m_pUMLScene, StateWidget::End); break; case WorkToolBar::tbb_Send_Signal: - umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Send); + umlWidget = new SignalWidget(m_pUMLScene, SignalWidget::Send); break; case WorkToolBar::tbb_Accept_Signal: - umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Accept); + umlWidget = new SignalWidget(m_pUMLScene, SignalWidget::Accept); break; case WorkToolBar::tbb_Accept_Time_Event: - umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Time); + umlWidget = new SignalWidget(m_pUMLScene, SignalWidget::Time); break; case WorkToolBar::tbb_Region: - umlWidget = new RegionWidget(m_pUMLView); + umlWidget = new RegionWidget(m_pUMLScene); break; case WorkToolBar::tbb_Seq_Combined_Fragment: - umlWidget = new CombinedFragmentWidget(m_pUMLView); + umlWidget = new CombinedFragmentWidget(m_pUMLScene); break; case WorkToolBar::tbb_Object_Node: - umlWidget = new ObjectNodeWidget(m_pUMLView, ObjectNodeWidget::Data); + umlWidget = new ObjectNodeWidget(m_pUMLScene, ObjectNodeWidget::Data); break; case WorkToolBar::tbb_PrePostCondition: - umlWidget = new NoteWidget(m_pUMLView, NoteWidget::Normal); + umlWidget = new NoteWidget(m_pUMLScene, NoteWidget::Normal); break; default: @@ -283,7 +284,7 @@ // Create the widget. Some setup functions can remove the widget. if (umlWidget != 0) { - m_pUMLView->setupNewWidget(umlWidget); + m_pUMLScene->setupNewWidget(umlWidget); } return true; diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstateother.h kdesdk-4.7.95/umbrello/umbrello/toolbarstateother.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstateother.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstateother.h 2011-12-20 21:00:11.000000000 +0000 @@ -27,7 +27,7 @@ Q_OBJECT public: - ToolBarStateOther(UMLView *umlView); + ToolBarStateOther(UMLScene *umlScene); virtual ~ToolBarStateOther(); private: diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatepool.cpp kdesdk-4.7.95/umbrello/umbrello/toolbarstatepool.cpp --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatepool.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatepool.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -49,10 +49,10 @@ * Protected to avoid classes other than derived to create objects of this * class. * - * @param umlView The UMLView to use. + * @param umlScene The UMLScene to use. */ -ToolBarStatePool::ToolBarStatePool(UMLView *umlView) - : ToolBarState(umlView) +ToolBarStatePool::ToolBarStatePool(UMLScene *umlScene) + : ToolBarState(umlScene) { m_ToolBarButton = WorkToolBar::tbb_Arrow; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/toolbarstatepool.h kdesdk-4.7.95/umbrello/umbrello/toolbarstatepool.h --- kdesdk-4.7.90/umbrello/umbrello/toolbarstatepool.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/toolbarstatepool.h 2011-12-20 21:00:11.000000000 +0000 @@ -31,7 +31,7 @@ protected: - ToolBarStatePool(UMLView *umlView); + ToolBarStatePool(UMLScene *umlScene); private: diff -Nru kdesdk-4.7.90/umbrello/umbrello/umbrello.kcfg kdesdk-4.7.95/umbrello/umbrello/umbrello.kcfg --- kdesdk-4.7.90/umbrello/umbrello/umbrello.kcfg 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umbrello.kcfg 2011-12-20 21:00:11.000000000 +0000 @@ -261,6 +261,13 @@ grey + + + + Create an artifact in the component view for each imported file + true + + diff -Nru kdesdk-4.7.90/umbrello/umbrello/uml.cpp kdesdk-4.7.95/umbrello/umbrello/uml.cpp --- kdesdk-4.7.90/umbrello/umbrello/uml.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/uml.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -40,7 +40,6 @@ #include "codeimportingwizard.h" #include "codeviewerdialog.h" #include "diagramprintpage.h" -#include "importprojectdlg.h" #include "settingsdlg.h" #include "classimport.h" #include "refactoringassistant.h" @@ -50,6 +49,7 @@ // docgenerators #include "docbookgenerator.h" #include "xhtmlgenerator.h" +#include "umlscene.h" // kde includes #include @@ -142,6 +142,7 @@ m_printSettings = 0; m_printer = new QPrinter; m_printer->setFullPage(true); + m_dlg = NULL; readOptionState(); initActions(); @@ -269,19 +270,9 @@ QAction* impWizard = actionCollection()->addAction("importing_wizard"); impWizard->setIcon(Icon_Utils::SmallIcon(Icon_Utils::it_Import_Class)); - impWizard->setText(i18n("NEW Code &Importing Wizard...")); + impWizard->setText(i18n("Code &Importing Wizard...")); connect(impWizard, SIGNAL(triggered(bool)), this, SLOT(slotImportingWizard())); - QAction* importClasses = actionCollection()->addAction("import_class"); - importClasses->setIcon(Icon_Utils::SmallIcon(Icon_Utils::it_Import_Class)); - importClasses->setText(i18n("OLD &Import Classes...")); - connect(importClasses, SIGNAL(triggered(bool)), this, SLOT(slotImportClasses())); - - QAction* importProject = actionCollection()->addAction("import_project"); - importProject->setIcon(Icon_Utils::SmallIcon(Icon_Utils::it_Import_Project)); - importProject->setText(i18n("OLD Import &Project...")); - connect(importProject, SIGNAL(triggered(bool)), this, SLOT(slotImportProject())); - QAction* genWizard = actionCollection()->addAction("generation_wizard"); genWizard->setText(i18n("&Code Generation Wizard...")); connect(genWizard, SIGNAL(triggered(bool)), this, SLOT(slotExecGenerationWizard())); @@ -983,6 +974,8 @@ // now write the basic defaults to config m_commoncodegenpolicy->writeConfig(); + UmbrelloSettings::setCreateArtifacts(optionState.codeImportState.createArtifacts); + UmbrelloSettings::self()->writeConfig(); } @@ -1143,11 +1136,13 @@ "*.xmi.tar.bz2|Bzip2 Compressed XMI Files (*.xmi.tar.bz2)\n" "*.mdl|Rose model files"), this, i18n("Open File")); if (!url.isEmpty()) { + m_listView->setSortingEnabled(false); if (m_doc->openDocument(url)) { fileOpenRecent->addUrl( url ); } enablePrint(true); setCaption(m_doc->url().fileName(), false); + m_listView->setSortingEnabled(true); } } slotUpdateViews(); @@ -1304,8 +1299,8 @@ if(!slotPrintSettings()) return; - QPrintPreviewDialog *preview = new QPrintPreviewDialog(m_printer,this); - connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter *))); + QPointer preview = new QPrintPreviewDialog(m_printer,this); + connect(preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter*))); preview->exec(); delete m_printSettings; m_printSettings = 0; @@ -1433,7 +1428,7 @@ void UMLApp::slotEditCopy() { slotStatusMsg(i18n("Copying selection to clipboard...")); - bool fromview = (currentView() && currentView()->getSelectCount()); + bool fromview = (currentView() && currentView()->umlScene()->getSelectCount()); editCutCopy( fromview ); resetStatusMsg(); m_doc->setModified( true ); @@ -1555,7 +1550,7 @@ */ void UMLApp::slotAlignLeft() { - currentView()->alignLeft(); + currentView()->umlScene()->alignLeft(); } /** @@ -1563,7 +1558,7 @@ */ void UMLApp::slotAlignRight() { - currentView()->alignLeft(); + currentView()->umlScene()->alignLeft(); } /** @@ -1571,7 +1566,7 @@ */ void UMLApp::slotAlignTop() { - currentView()->alignTop(); + currentView()->umlScene()->alignTop(); } /** @@ -1579,7 +1574,7 @@ */ void UMLApp::slotAlignBottom() { - currentView()->alignBottom(); + currentView()->umlScene()->alignBottom(); } /** @@ -1587,7 +1582,7 @@ */ void UMLApp::slotAlignVerticalMiddle() { - currentView()->alignVerticalMiddle(); + currentView()->umlScene()->alignVerticalMiddle(); } /** @@ -1595,7 +1590,7 @@ */ void UMLApp::slotAlignHorizontalMiddle() { - currentView()->alignHorizontalMiddle(); + currentView()->umlScene()->alignHorizontalMiddle(); } /** @@ -1603,7 +1598,7 @@ */ void UMLApp::slotAlignVerticalDistribute() { - currentView()->alignVerticalDistribute(); + currentView()->umlScene()->alignVerticalDistribute(); } /** @@ -1611,7 +1606,7 @@ */ void UMLApp::slotAlignHorizontalDistribute() { - currentView()->alignHorizontalDistribute(); + currentView()->umlScene()->alignHorizontalDistribute(); } /** @@ -1747,7 +1742,7 @@ */ void UMLApp::slotCopyChanged() { - if (m_listView->selectedItemsCount() || (currentView() && currentView()->getSelectCount())) { + if (m_listView->selectedItemsCount() || (currentView() && currentView()->umlScene()->getSelectCount())) { editCopy->setEnabled(true); editCut->setEnabled(true); } @@ -1798,10 +1793,11 @@ m_viewStack->hide(); foreach (UMLView *view, views) { + UMLScene *scene = view->umlScene(); m_viewStack->removeWidget(view); - int tabIndex = m_tabWidget->addTab(view, view->name()); - m_tabWidget->setTabIcon(tabIndex, Icon_Utils::iconSet(view->type())); - m_tabWidget->setTabToolTip(tabIndex, view->name()); + int tabIndex = m_tabWidget->addTab(view, scene->name()); + m_tabWidget->setTabIcon(tabIndex, Icon_Utils::iconSet(scene->type())); + m_tabWidget->setTabToolTip(tabIndex, scene->name()); } m_layout->addWidget(m_tabWidget); m_tabWidget->show(); @@ -1990,6 +1986,9 @@ optionState.codeGenerationState.rubyCodeGenerationState.autoGenerateAttributeAccessors = UmbrelloSettings::autoGenerateAttributeAccessorsRuby(); optionState.codeGenerationState.rubyCodeGenerationState.autoGenerateAssocAccessors = UmbrelloSettings::autoGenerateAssocAccessorsRuby(); + // code importer options + optionState.codeImportState.createArtifacts = UmbrelloSettings::createArtifacts(); + // general config options will be read when created } @@ -2301,7 +2300,7 @@ */ void UMLApp::slotCurrentViewClearDiagram() { - currentView()->clearDiagram(); + currentView()->umlScene()->clearDiagram(); } /** @@ -2309,8 +2308,8 @@ */ void UMLApp::slotCurrentViewToggleSnapToGrid() { - currentView()->toggleSnapToGrid(); - viewSnapToGrid->setChecked( currentView()->getSnapToGrid() ); + currentView()->umlScene()->toggleSnapToGrid(); + viewSnapToGrid->setChecked( currentView()->umlScene()->getSnapToGrid() ); } /** @@ -2318,8 +2317,8 @@ */ void UMLApp::slotCurrentViewToggleShowGrid() { - currentView()->toggleShowGrid(); - viewShowGrid->setChecked( currentView()->getShowSnapGrid() ); + currentView()->umlScene()->toggleShowGrid(); + viewShowGrid->setChecked( currentView()->umlScene()->getShowSnapGrid() ); } /** @@ -2327,7 +2326,7 @@ */ void UMLApp::slotCurrentViewExportImage() { - currentView()->getImageExporter()->exportView(); + currentView()->umlScene()->getImageExporter()->exportView(); } /** @@ -2343,7 +2342,7 @@ */ void UMLApp::slotCurrentViewProperties() { - currentView()->showPropDialog(); + currentView()->umlScene()->showPropDialog(); } /** @@ -2361,8 +2360,8 @@ viewProperties->setEnabled( bState ); filePrint->setEnabled( bState ); if ( currentView() ) { - viewSnapToGrid->setChecked( currentView()->getSnapToGrid() ); - viewShowGrid->setChecked( currentView()->getShowSnapGrid() ); + viewSnapToGrid->setChecked( currentView()->umlScene()->getSnapToGrid() ); + viewShowGrid->setChecked( currentView()->umlScene()->getShowSnapGrid() ); } } @@ -2388,8 +2387,8 @@ UMLViewList views = m_doc->viewIterator(); foreach (UMLView *view , views ) { - menu->addAction(view->name(), view, SLOT(slotShowView())); - view->fileLoaded(); + menu->addAction(view->umlScene()->name(), view->umlScene(), SLOT(slotShowView())); + view->umlScene()->fileLoaded(); } } @@ -2412,52 +2411,6 @@ } /** - * Import classes menu selection. - * TODO: Will be deleted. - */ -void UMLApp::slotImportClasses() -{ - m_doc->setLoading(true); - // File selection is separated from invocation of ClassImport::import() - // because the user might decide to choose a language different from - // the active language (by using the "All Files" option). - QString preselectedExtension; - const Uml::ProgrammingLanguage pl = m_codegen->language(); - if (pl == Uml::ProgrammingLanguage::IDL) { - preselectedExtension = i18n("*.idl|IDL Files (*.idl)"); - } else if (pl == Uml::ProgrammingLanguage::Python) { - preselectedExtension = i18n("*.py|Python Files (*.py *.pyw)"); - } else if (pl == Uml::ProgrammingLanguage::Java) { - preselectedExtension = i18n("*.java|Java Files (*.java)"); - } else if (pl == Uml::ProgrammingLanguage::Pascal) { - preselectedExtension = i18n("*.pas|Pascal Files (*.pas)"); - } else if (pl == Uml::ProgrammingLanguage::Ada) { - preselectedExtension = i18n("*.ads *.ada|Ada Files (*.ads *.ada)"); - } else { - preselectedExtension = i18n("*.h *.hh *.hpp *.hxx *.H|Header Files (*.h *.hh *.hpp *.hxx *.H)"); - } - preselectedExtension.append("\n*|" + i18n("All Files")); - QStringList fileList = KFileDialog::getOpenFileNames(KUrl(), preselectedExtension, - this, i18n("Select Code to Import") ); - importFiles(&fileList); -} - -/** - * Import project menu selection. - * TODO: Will be deleted. - */ -void UMLApp::slotImportProject() -{ - QStringList listFile; - - QPointer importDlg = new ImportProjectDlg(&listFile, m_codegen->language(), this); - if (importDlg->exec() == KDialog::Accepted) { - importFiles(&listFile); - } - delete importDlg; -} - -/** * Runs the code importing wizard. */ void UMLApp::slotImportingWizard() @@ -2492,9 +2445,9 @@ { UMLView *view = currentView(); if (view) { - connect(view, SIGNAL(sigShowGridToggled(bool)), + connect(view->umlScene(), SIGNAL(sigShowGridToggled(bool)), this, SLOT(slotShowGridToggled(bool))); - connect(view, SIGNAL(sigSnapToGridToggled(bool)), + connect(view->umlScene(), SIGNAL(sigSnapToGridToggled(bool)), this, SLOT(slotSnapToGridToggled(bool))); } } @@ -2520,7 +2473,7 @@ */ void UMLApp::slotSelectAll() { - currentView()->selectAll(); + currentView()->umlScene()->selectAll(); } /** @@ -2529,7 +2482,7 @@ void UMLApp::slotDeleteSelectedWidget() { if ( currentView() ) { - currentView()->deleteSelection(); + currentView()->umlScene()->deleteSelection(); } else { uWarning() << " trying to delete widgets when there is no current view (see bug 59774)"; @@ -2541,7 +2494,7 @@ */ void UMLApp::slotDeleteDiagram() { - m_doc->removeDiagram( currentView()->getID() ); + m_doc->removeDiagram( currentView()->umlScene()->getID() ); } /** @@ -2556,7 +2509,7 @@ setCurrentView(view); } m_tabWidget->removeTab(m_tabWidget->indexOf(view)); - view->setIsOpen(false); + view->umlScene()->setIsOpen(false); } } @@ -2642,7 +2595,7 @@ { // in case we have selected something in the diagram, move it by one pixel // to the direction pointed by the cursor key - if (m_view == NULL || !m_view->getSelectCount() || e->modifiers() != Qt::AltModifier) { + if (m_view == NULL || !m_view->umlScene()->getSelectCount() || e->modifiers() != Qt::AltModifier) { e->ignore(); return; } @@ -2665,7 +2618,7 @@ e->ignore(); return; } - m_view->moveSelectedBy(dx, dy); + m_view->umlScene()->moveSelectedBy(dx, dy); // notify about modification only at the first key release of possible sequence of auto repeat key releases, // this reduces the slow down caused by setModified() and makes the cursor moving of widgets smoother @@ -2744,10 +2697,10 @@ Settings::OptionState optionState = Settings::optionState(); if (optionState.generalState.tabdiagrams) { int tabIndex = m_tabWidget->indexOf(view); - if ((tabIndex < 0) && view->isOpen()) { - tabIndex = m_tabWidget->addTab(view, view->name()); - m_tabWidget->setTabIcon(tabIndex, Icon_Utils::iconSet(view->type())); - m_tabWidget->setTabToolTip(tabIndex, view->name()); + if ((tabIndex < 0) && (view->umlScene()->isOpen())) { + tabIndex = m_tabWidget->addTab(view, view->umlScene()->name()); + m_tabWidget->setTabIcon(tabIndex, Icon_Utils::iconSet(view->umlScene()->type())); + m_tabWidget->setTabToolTip(tabIndex, view->umlScene()->name()); } m_tabWidget->setCurrentIndex(tabIndex); } @@ -2759,14 +2712,14 @@ view->show(); } qApp->processEvents(); - slotStatusMsg(view->name()); + slotStatusMsg(view->umlScene()->name()); UMLListViewItem* lvitem = m_listView->findView(view); if (lvitem) { m_listView->setCurrentItem(lvitem); } - DEBUG(DBG_SRC) << "name=" << view->name() - << ", isOpen=" << view->isOpen() - << ", id=" << ID2STR(view->getID()); + DEBUG(DBG_SRC) << "name=" << view->umlScene()->name() + << ", isOpen=" << view->umlScene()->isOpen() + << ", id=" << ID2STR(view->umlScene()->getID()); } /** @@ -2806,7 +2759,7 @@ { UMLView* view = ( UMLView* )tab; if (view) { - m_doc->changeCurrentView( view->getID() ); + m_doc->changeCurrentView( view->umlScene()->getID() ); } } @@ -3040,4 +2993,4 @@ return m_config.data(); } -#include "uml.moc" +//#include "uml.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/umldoc.cpp kdesdk-4.7.95/umbrello/umbrello/umldoc.cpp --- kdesdk-4.7.90/umbrello/umbrello/umldoc.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umldoc.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -45,6 +45,8 @@ #include "listpopupmenu.h" #include "cmds.h" #include "diagramprintpage.h" +#include "umlscene.h" +#include "worktoolbar.h" // kde includes #include @@ -80,7 +82,8 @@ * Constructor for the fileclass of the application. */ UMLDoc::UMLDoc() - : m_Name(i18n("UML Model")), + : m_datatypeRoot(0), + m_Name(i18n("UML Model")), m_modelID("m1"), m_count(0), m_modified(false), @@ -138,6 +141,7 @@ */ void UMLDoc::createDatatypeFolder() { + delete m_datatypeRoot; m_datatypeRoot = new UMLFolder("Datatypes", "Datatypes"); m_datatypeRoot->setLocalName(i18n("Datatypes")); m_datatypeRoot->setUMLPackage(m_root[Uml::ModelType::Logical]); @@ -150,6 +154,7 @@ */ UMLDoc::~UMLDoc() { + delete m_datatypeRoot; delete m_pChangeLog; m_pChangeLog = 0; } @@ -166,7 +171,7 @@ uError() << "argument is NULL"; return; } - UMLFolder *f = view->folder(); + UMLFolder *f = view->umlScene()->folder(); if (f == 0) { uError() << "view folder is not set"; return; @@ -175,13 +180,13 @@ UMLApp * pApp = UMLApp::app(); if ( pApp->listView() ) { - connect(this, SIGNAL(sigObjectRemoved(UMLObject*)), view, SLOT(slotObjectRemoved(UMLObject*))); + connect(this, SIGNAL(sigObjectRemoved(UMLObject*)), view->umlScene(), SLOT(slotObjectRemoved(UMLObject*))); } pApp->setCurrentView(view); if ( !m_bLoading ) { view->show(); - emit sigDiagramChanged(view->type()); + emit sigDiagramChanged(view->umlScene()->type()); } pApp->setDiagramMenuItemsState(true); @@ -207,10 +212,10 @@ } view->hide(); //remove all widgets before deleting view - view->removeAllWidgets(); - UMLFolder *f = view->folder(); + view->umlScene()->removeAllWidgets(); + UMLFolder *f = view->umlScene()->folder(); if (f == 0) { - uError() << view->name() << ": view->folder() returns NULL"; + uError() << view->umlScene()->name() << ": view->getFolder() returns NULL"; return; } f->removeView(view); @@ -324,7 +329,7 @@ UMLListView *listView = UMLApp::app()->listView(); if (listView) { - listView->init(); + listView->clean(); // store old setting - for restore of last setting bool m_bLoading_old = m_bLoading; m_bLoading = true; // This is to prevent document becoming modified. @@ -344,7 +349,8 @@ } // Restore the datatype folder, it has been deleted above. createDatatypeFolder(); - listView->theDatatypeFolder()->setUMLObject(m_datatypeRoot); + // this creates to much items only Logical View should be created + listView->init(); /* Remove any stereotypes. if (m_stereoList.count() > 0) { UMLStereotype *s; @@ -1244,15 +1250,15 @@ KMessageBox::error(0, i18n("That is an invalid name for a diagram."), i18n("Invalid Name")); } else if (!findView(type, name)) { UMLView* view = new UMLView(folder); - view->setOptionState( Settings::optionState() ); - view->setName( name ); - view->setType( type ); - view->setID( UniqueID::gen() ); + view->umlScene()->setOptionState( Settings::optionState() ); + view->umlScene()->setName( name ); + view->umlScene()->setType( type ); + view->umlScene()->setID( UniqueID::gen() ); addView(view); - emit sigDiagramCreated( view->getID() ); + emit sigDiagramCreated( view->umlScene()->getID() ); setModified(true); UMLApp::app()->enablePrint(true); - changeCurrentView( view->getID() ); + changeCurrentView( view->umlScene()->getID() ); return view; } else { KMessageBox::error(0, i18n("A diagram is already using that name."), i18n("Not a Unique Name")); @@ -1272,9 +1278,9 @@ bool ok = false; UMLView *view = findView(id); - Uml::DiagramType type = view->type(); + Uml::DiagramType type = view->umlScene()->type(); - QString oldName= view->name(); + QString oldName= view->umlScene()->name(); while (true) { QString name = KInputDialog::getText(i18nc("renaming diagram", "Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app()); @@ -1285,7 +1291,7 @@ KMessageBox::error(0, i18n("That is an invalid name for a diagram."), i18n("Invalid Name")); } else if (!findView(type, name)) { - view->setName(name); + view->umlScene()->setName(name); emit sigDiagramRenamed(id); setModified(true); break; @@ -1374,9 +1380,9 @@ UMLApp* pApp = UMLApp::app(); UMLView* view = findView(id); if (view) { - view->setIsOpen(true); + view->umlScene()->setIsOpen(true); pApp->setCurrentView(view); - emit sigDiagramChanged(view->type()); + emit sigDiagramChanged(view->umlScene()->type()); pApp->setDiagramMenuItemsState( true ); setModified(true); emit sigCurrentViewChanged(); @@ -1432,7 +1438,7 @@ uError() << "m_pCurrentRoot is NULL"; return 0; } - UMLFolder *f = currentView->folder(); + UMLFolder *f = currentView->umlScene()->folder(); while (f->umlPackage()) { f = static_cast(f->umlPackage()); } @@ -1676,7 +1682,7 @@ Uml::IDType viewID = Uml::id_None; UMLView *currentView = UMLApp::app()->currentView(); if (currentView) { - viewID = currentView->getID(); + viewID = currentView->umlScene()->getID(); } docElement.setAttribute( "viewid", ID2STR(viewID) ); docElement.setAttribute( "documentation", m_Doc ); @@ -1878,7 +1884,7 @@ } m_Name = element.attribute( "name", i18n("UML Model") ); UMLListView *lv = UMLApp::app()->listView(); - lv->setColumnText(0, m_Name); + lv->setTitle(0, m_Name); seen_UMLObjects = true; } else if (tagEq(tag, "Package") || tagEq(tag, "Class") || @@ -2227,12 +2233,12 @@ // reading the corresponding diagram: // + allow using per-diagram color and line-width settings // + avoid crashes due to uninitialized values for lineWidth - pView->setOptionState( state ); + pView->umlScene()->setOptionState( state ); bool success = false; if (tag == "UISDiagram") { - success = pView->loadUISDiagram(element); + success = pView->umlScene()->loadUISDiagram(element); } else { - success = pView->loadFromXMI(element); + success = pView->umlScene()->loadFromXMI(element); } if (!success) { uWarning() << "failed load on viewdata loadfromXMI"; @@ -2241,8 +2247,8 @@ } // Put diagram in default predefined folder. // @todo pass in the parent folder - it might be a user defined one. - Uml::ModelType mt = Model_Utils::convert_DT_MT(pView->type()); - pView->setFolder(m_root[mt]); + Uml::ModelType mt = Model_Utils::convert_DT_MT(pView->umlScene()->type()); + pView->umlScene()->setFolder(m_root[mt]); pView->hide(); addView( pView ); emit sigSetStatusbarProgress( ++count ); @@ -2623,20 +2629,20 @@ } int i = 0; - QString viewName = (QString)pView->name(); + QString viewName = pView->umlScene()->name(); QString name = viewName; - while (findView(pView->type(), name) != 0) { + while ( findView(pView->umlScene()->type(), name) != 0) { name = viewName + '_' + QString::number(++i); } if (i) { //If name was modified - pView->setName(name); + pView->umlScene()->setName(name); } - Uml::IDType result = assignNewID(pView->getID()); - pView->setID(result); + Uml::IDType result = assignNewID(pView->umlScene()->getID()); + pView->umlScene()->setID(result); - pView->activateAfterLoad( true ); - pView->endPartialWidgetPaste(); - pView->setOptionState( Settings::optionState() ); + pView->umlScene()->activateAfterLoad( true ); + pView->umlScene()->endPartialWidgetPaste(); + pView->umlScene()->setOptionState( Settings::optionState() ); addView(pView); setModified(true); return true; @@ -2743,9 +2749,9 @@ if (view) { Settings::OptionState optionState = Settings::optionState(); if (optionState.generalState.tabdiagrams) { - UMLApp::app()->tabWidget()->setTabText( UMLApp::app()->tabWidget()->indexOf(view), view->name() ); + UMLApp::app()->tabWidget()->setTabText( UMLApp::app()->tabWidget()->indexOf(view), view->umlScene()->name() ); } - emit sigDiagramRenamed( view->getID() ); + emit sigDiagramRenamed( view->umlScene()->getID() ); } else { uError() << "Cannot signal diagram renamed - view is NULL!"; @@ -2798,7 +2804,7 @@ } UMLListViewItem::ListViewType type = UMLListViewItem::lvt_Unknown; - switch ( view->type() ) { + switch ( view->umlScene()->type() ) { case Uml::DiagramType::Class: type = UMLListViewItem::lvt_Class_Diagram; break; @@ -2843,7 +2849,7 @@ // DEBUG(DBG_SRC) << "create popup for ListView_Type " << type; m_pTabPopupMenu = new ListPopupMenu(UMLApp::app()->mainViewWidget(), type, 0); m_pTabPopupMenu->popup(point); - connect(m_pTabPopupMenu, SIGNAL(triggered(QAction*)), view, SLOT(slotMenuSelection(QAction*))); + connect(m_pTabPopupMenu, SIGNAL(triggered(QAction*)), view->umlScene(), SLOT(slotMenuSelection(QAction*))); } /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/uml.h kdesdk-4.7.95/umbrello/umbrello/uml.h --- kdesdk-4.7.90/umbrello/umbrello/uml.h 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/uml.h 2011-12-20 21:00:10.000000000 +0000 @@ -236,8 +236,6 @@ void slotCurrentViewExportImage(); void slotAllViewsExportImage(); void slotCurrentViewProperties(); - void slotImportClasses(); - void slotImportProject(); void slotClassWizard(); void slotAddDefaultDatatypes(); void slotCurrentViewChanged(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/umllistview.cpp kdesdk-4.7.95/umbrello/umbrello/umllistview.cpp --- kdesdk-4.7.90/umbrello/umbrello/umllistview.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umllistview.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,25 +11,6 @@ // own header #include "umllistview.h" -// qt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// kde includes -#include -#include -#include -#include -#include - // app includes #include "actor.h" #include "classifier.h" @@ -56,6 +37,7 @@ #include "umldoc.h" #include "umllistviewitemlist.h" #include "umllistviewitem.h" +#include "umlscene.h" #include "umlview.h" #include "umlviewimageexporter.h" #include "usecase.h" @@ -72,35 +54,24 @@ #include "umlforeignkeyconstraintdialog.h" #include "umlcheckconstraintdialog.h" -#ifdef WANT_LVTOOLTIP -class LVToolTip : public QToolTip -{ -public: - LVToolTip(QWidget* parent) : QToolTip(parent) {} - virtual ~LVToolTip() {} -protected: - /** - * Reimplemented from QToolTip for internal reasons. - * At classifiers, only the method names are shown in the list view - - * we use a tooltip for the full signature display. - * Once K3ListView's tooltip overriding mechanism works, we can kick - * this class out (TODO). - */ - virtual void maybeTip(const QPoint& pos) { - UMLListView *lv = UMLApp::app()->listView(); - UMLListViewItem * item = (UMLListViewItem*)lv->itemAt(pos); - if (item == 0) - return; - UMLObject *obj = item->getUMLObject(); - if (obj == 0 || obj->getBaseType() != UMLObject::ot_Operation) - return; - UMLOperation *op = static_cast(obj); - QString text = op->toString(Uml::st_ShowSig); - QRect rect = lv->itemRect(item); - tip(rect, text); - } -}; -#endif +// kde includes +#include +#include +#include +#include +#include + +// qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /** * Constructs the tree view. @@ -108,7 +79,7 @@ * @param parent The parent to this. */ UMLListView::UMLListView(QWidget *parent) - : K3ListView(parent), + : QTreeWidget(parent), m_rv(0), m_datatypeFolder(0), m_menu(0), @@ -119,28 +90,19 @@ m_bCreatingChildObject(false) { //setup list view - setAcceptDrops(true); - setDropVisualizer(false); - setItemsMovable(true); - setItemsRenameable(true); - setSelectionModeExt(FileManager); - setFocusPolicy(Qt::StrongFocus); - setDragEnabled(true); - setColumnWidthMode(0, Manual); - setDefaultRenameAction(Accept); - setResizeMode(LastColumn); - header()->setClickEnabled(true); + //setAcceptDrops(true); + //setDropVisualizer(false); + //setItemsMovable(true); + //setItemsRenameable(true); + //setSelectionModeExt(FileManager); + //setFocusPolicy(Qt::StrongFocus); + //setDragEnabled(true); + //setColumnWidthMode(0, Manual); + //setDefaultRenameAction(Accept); + //setResizeMode(LastColumn); + //header()->setClickEnabled(true); //add columns and initial items - addColumn(m_doc->name()); - -#ifdef WANT_LVTOOLTIP - /* In KDE-3.3, we cannot use K3ListView's builtin mechanism for - overriding the tooltips. Instead, see the above class LVToolTip. - setShowToolTips( true ); - setTooltipColumn( 0 ); - */ - (void) new LVToolTip(viewport()); -#endif + //addColumn(m_doc->name()); for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) { m_lv[i] = 0; @@ -148,11 +110,13 @@ DEBUG_REGISTER(DBG_SRC); + m_editItem = 0; //setup slots/signals - connect(this, SIGNAL(collapsed(Q3ListViewItem*)), - this, SLOT(slotCollapsed(Q3ListViewItem*))); - connect(this, SIGNAL(expanded(Q3ListViewItem*)), this, SLOT(slotExpanded(Q3ListViewItem*))); + connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(slotCollapsed(QTreeWidgetItem*))); + connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(slotExpanded(QTreeWidgetItem*))); connect(UMLApp::app(), SIGNAL(sigCutSuccessful()), this, SLOT(slotCutSuccessful())); + connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotItemChanged(QTreeWidgetItem*, int))); + connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotItemSelectionChanged())); } /** @@ -160,39 +124,118 @@ */ UMLListView::~UMLListView() { + delete m_datatypeFolder; +} + +/** + * Sets the title. + * @param column column in which to write + * @param text the text to write + */ +void UMLListView::setTitle(int column, const QString &text) +{ + headerItem()->setText(column, text); +} + +/** + * Handler for item changed signals. + */ +void UMLListView::slotItemChanged(QTreeWidgetItem * item, int column) +{ + if (m_editItem) { + DEBUG(DBG_SRC) << item->text(column); + cancelRename(m_editItem); + } +} + +/** + * Handlerfor item selection changed signals. + */ +void UMLListView::slotItemSelectionChanged() +{ + if (m_editItem) { + cancelRename(m_editItem); + } +} + +/** + * Calls updateFolder() on the item to update the icon to open. + */ +void UMLListView::slotExpanded(QTreeWidgetItem * item) +{ + UMLListViewItem * myItem = static_cast(item); + if (isExpandable(myItem->type())) + myItem->updateFolder(); +} + +/** + * Calls updateFolder() on the item to update the icon to closed. + */ +void UMLListView::slotCollapsed(QTreeWidgetItem * item) +{ + UMLListViewItem * myItem = static_cast(item); + if (isExpandable(myItem->type())) + myItem->updateFolder(); } +/** + * Event handler for the tool tip event. + * Works only for operations to show the signature. + */ +bool UMLListView::event(QEvent *e) +{ + if (e->type() == QEvent::ToolTip) { + QHelpEvent *helpEvent = static_cast(e); + UMLListViewItem * item = static_cast(itemAt(helpEvent->pos())); + if (item) { + QToolTip::showText(helpEvent->globalPos(), item->toolTip()); + } else { + QToolTip::hideText(); + e->ignore(); + } + return true; + } + return QTreeWidget::event(e); +} + +/** + * Event filter. + */ bool UMLListView::eventFilter(QObject *o, QEvent *e) { if (e->type() != QEvent::MouseButtonPress || qstrcmp("QHeader", metaObject()->className()) != 0) - return Q3ListView::eventFilter(o, e); + return QTreeWidget::eventFilter(o, e); QMouseEvent *me = static_cast(e); if (me->button() == Qt::RightButton) { if (m_menu) { m_menu->hide(); disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); delete m_menu; + m_menu = 0; } - UMLListViewItem * temp = (UMLListViewItem*)currentItem(); - m_menu = new ListPopupMenu(this, UMLListViewItem::lvt_Model, temp->umlObject()); + UMLListViewItem * currItem = static_cast(currentItem()); + m_menu = new ListPopupMenu(this, UMLListViewItem::lvt_Model, currItem->umlObject()); m_menu->popup(me->globalPos()); connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); return true; } - return Q3ListView::eventFilter(o, e); + return QTreeWidget::eventFilter(o, e); } -void UMLListView::contentsMousePressEvent(QMouseEvent *me) +/** + * Handler for mouse press events. + * @param me the mouse event + */ +void UMLListView::mousePressEvent(QMouseEvent *me) { UMLView *currentView = UMLApp::app()->currentView(); if (currentView) - currentView->clearSelected(); + currentView->umlScene()->clearSelected(); if (me->modifiers() != Qt::ShiftModifier) clearSelection(); // Get the UMLListViewItem at the point where the mouse pointer was pressed - QPoint pt = this->Q3ScrollView::contentsToViewport(me->pos()); - UMLListViewItem * item = (UMLListViewItem*)itemAt(pt); + UMLListViewItem * item = (UMLListViewItem*)itemAt(me->pos()); const Qt::ButtonState button = me->button(); @@ -210,6 +253,7 @@ m_dragStartPosition = me->pos(); } + if (button == Qt::RightButton) { if (m_menu != 0) { m_menu->hide(); @@ -223,10 +267,14 @@ connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); }//end if right button - K3ListView::contentsMousePressEvent(me); + QTreeWidget::mousePressEvent(me); } -void UMLListView::contentsMouseMoveEvent(QMouseEvent* me) +/** + * Handler for mouse move events. + * @param me the mouse event + */ +void UMLListView::mouseMoveEvent(QMouseEvent* me) { if (!(me->buttons() & Qt::LeftButton)) return; @@ -239,23 +287,26 @@ drag->exec(Qt::CopyAction); } -void UMLListView::contentsMouseReleaseEvent(QMouseEvent *me) +/** + * Handler for mouse release event. + * @param me the mouse event + */ +void UMLListView::mouseReleaseEvent(QMouseEvent *me) { if (me->button() != Qt::LeftButton) { - this->K3ListView::contentsMouseReleaseEvent(me); + QTreeWidget::mouseReleaseEvent(me); return; } - const QPoint pt = this->Q3ScrollView::contentsToViewport(me->pos()); - UMLListViewItem *item = dynamic_cast(itemAt(pt)); + UMLListViewItem *item = dynamic_cast(itemAt(me->pos())); if (item == 0 || !Model_Utils::typeIsDiagram(item->type())) { - this->K3ListView::contentsMouseReleaseEvent(me); + QTreeWidget::mouseReleaseEvent(me); return; } // Switch to diagram on mouse release - not on mouse press // because the user might intend a drag-to-note. m_doc->changeCurrentView(item->getID()); UMLApp::app()->docWindow()->showDocumentation(m_doc->findView(item->getID()), false); - this->K3ListView::contentsMouseReleaseEvent(me); + QTreeWidget::mouseReleaseEvent(me); } /** @@ -265,10 +316,19 @@ void UMLListView::keyPressEvent(QKeyEvent *ke) { UMLView *view = UMLApp::app()->currentView(); - if (view && view->getSelectCount()) { + if (view && view->umlScene()->getSelectCount()) { // Widgets have been selected in the diagram area, // assume they handle the keypress. ke->accept(); // munge and do nothing + } else if (m_editItem) { + const int k = ke->key(); + if (k == Qt::Key_Return) + endRename(m_editItem); + else { + QWidget *editor = indexWidget(indexFromItem(m_editItem)); + if (editor) + QCoreApplication::sendEvent(editor,ke); + } } else { const int k = ke->key(); @@ -278,8 +338,20 @@ foreach(UMLListViewItem *item, itemsSelected) { deleteItem(item); } - } else { - Q3ListView::keyPressEvent(ke); // let parent handle it + } + else if (k == Qt::Key_Up || k == Qt::Key_Down) { + UMLListViewItem *current = static_cast(currentItem()); + UMLListViewItem *item = static_cast((k == Qt::Key_Down) ? itemBelow(current) : itemAbove(current)); + if (item) { + Uml::IDType id = item->getID(); + UMLObject *o = item->umlObject(); + setCurrentItem(item); + m_doc->changeCurrentView(id); + UMLApp::app()->docWindow()->showDocumentation(o, false); + } + } + else { + QTreeWidget::keyPressEvent(ke); // let parent handle it } } } @@ -408,14 +480,6 @@ addNewItem(temp, UMLListViewItem::lvt_CheckConstraint); break; - case ListPopupMenu::mt_Import_Classes: - UMLApp::app()->slotImportClasses(); - break; - - case ListPopupMenu::mt_Import_Project: - UMLApp::app()->slotImportProject(); - break; - case ListPopupMenu::mt_Expand_All: expandAll(temp); break; @@ -452,7 +516,7 @@ delete fileDialog; if (selURL.isEmpty()) return; - QString path = selURL.path(); + QString path = selURL.toLocalFile(); QString fileName = path; if (fileName.startsWith(rootDir)) { fileName.remove(rootDir); @@ -511,14 +575,14 @@ i18n("Enter the new name of the model:"), m_doc->name(), &ok, UMLApp::app()); if (ok) { - setColumnText(0, name); + setTitle(0, name); m_doc->setName(name); } break; } case ListPopupMenu::mt_Rename: - temp->startRename(0); + startRename(temp); break; case ListPopupMenu::mt_Delete: @@ -535,7 +599,7 @@ return; } UMLApp::app()->docWindow()->updateDocumentation(false); - pView->showPropDialog(); + pView->umlScene()->showPropDialog(); UMLApp::app()->docWindow()->showDocumentation(pView, true); temp->cancelRename(0); return; @@ -545,7 +609,7 @@ umlType = object->baseType(); if (Model_Utils::typeIsCanvasWidget(lvt)) { - object->showProperties(ClassPropDlg::page_gen); + object->showPropertiesPagedDialog(ClassPropDlg::page_gen); } else if (umlType == UMLObject::ot_EnumLiteral) { // Show the Enum Literal Dialog UMLEnumLiteral* selectedEnumLiteral = static_cast(object); @@ -596,7 +660,11 @@ } else { uWarning() << "calling properties on unknown type"; } - temp->cancelRename(0); + // Bug 268469: Changing the package of a class deletes the old widget. + // By reloading the current item we are sure to not use a destroyed object + temp = (UMLListViewItem*)currentItem(); + if (temp) + temp->cancelRename(0); break; case ListPopupMenu::mt_Logical_Folder: @@ -697,14 +765,16 @@ */ void UMLListView::slotDiagramCreated(Uml::IDType id) { - if (m_doc->loading()) + if (m_doc->loading()) { return; + } UMLView *v = m_doc->findView(id); - if (!v) + if (!v) { return; - const Uml::DiagramType dt = v->type(); + } + const Uml::DiagramType dt = v->umlScene()->type(); UMLListViewItem * temp = 0, *p = findFolderForDiagram(dt); - temp = new UMLListViewItem(p, v->name(), Model_Utils::convert_DT_LVT(dt), id); + temp = new UMLListViewItem(p, v->umlScene()->name(), Model_Utils::convert_DT_LVT(dt), id); setSelected(temp, true); UMLApp::app()->docWindow()->showDocumentation(v , false); } @@ -834,7 +904,7 @@ } if (m_doc->loading()) return; - ensureItemVisible(newItem); + scrollToItem(newItem); newItem->setOpen(true); clearSelection(); setSelected(newItem, true); @@ -970,7 +1040,7 @@ const UMLListViewItem::ListViewType lvt = Model_Utils::convert_OT_LVT(child); childItem = new UMLListViewItem(parentItem, text, lvt, child); if (! m_doc->loading()) { - ensureItemVisible(childItem); + scrollToItem(childItem); clearSelection(); setSelected(childItem, true); } @@ -1054,12 +1124,15 @@ UMLApp::app()->docWindow()->updateDocumentation(true); } +/** + * + */ UMLDragData* UMLListView::getDragData() { - UMLListViewItemList selecteditems = selectedItems(); + UMLListViewItemList itemsSelected = selectedItems(); UMLListViewItemList list; - foreach(UMLListViewItem* item, selecteditems) { + foreach(UMLListViewItem* item, itemsSelected) { UMLListViewItem::ListViewType type = item->type(); if (!Model_Utils::typeIsCanvasWidget(type) && !Model_Utils::typeIsDiagram(type) && !Model_Utils::typeIsClassifierList(type)) { @@ -1081,8 +1154,8 @@ */ UMLListViewItem * UMLListView::findUMLObjectInFolder(UMLListViewItem* folder, UMLObject* obj) { - UMLListViewItem *item = static_cast(folder->firstChild()); - while (item) { + for (int i=0; i < folder->childCount(); ++i) { + UMLListViewItem *item = folder->childItem(i); switch (item->type()) { case UMLListViewItem::lvt_Actor : case UMLListViewItem::lvt_UseCase : @@ -1113,7 +1186,6 @@ default: break; } - item = static_cast(item->nextSibling()); } return 0; } @@ -1126,14 +1198,13 @@ */ UMLListViewItem * UMLListView::findUMLObject(const UMLObject *p) const { - UMLListViewItem *item = static_cast(firstChild()); - while (item) { + for (int i=0; i < topLevelItemCount(); ++i) { + UMLListViewItem *item = static_cast(topLevelItem(i)); UMLListViewItem *testItem = item->findUMLObject(p); if (testItem) return testItem; - item = static_cast(item->nextSibling()); } - return item; + return 0; } /** @@ -1154,13 +1225,13 @@ UMLListViewItem* UMLListView::findView(UMLView* v) { if (!v) { - uWarning() << "returning 0"; + uWarning() << "returning 0 - param is 0."; return 0; } UMLListViewItem* item; - Uml::DiagramType dType = v->type(); + Uml::DiagramType dType = v->umlScene()->type(); UMLListViewItem::ListViewType type = Model_Utils::convert_DT_LVT(dType); - Uml::IDType id = v->getID(); + Uml::IDType id = v->umlScene()->getID(); if (dType == Uml::DiagramType::UseCase) { item = m_lv[Uml::ModelType::UseCase]; } else if (dType == Uml::DiagramType::Component) { @@ -1172,37 +1243,39 @@ } else { item = m_lv[Uml::ModelType::Logical]; } - - UMLListViewItem* searchStartItem = (UMLListViewItem *)item->firstChild(); - - UMLListViewItem* foundItem = recursiveSearchForView(searchStartItem, type, id); - - if (!foundItem) { - uWarning() << "returning 0 at UMLListView::findView"; + for (int i=0; i < item->childCount(); i++) { + UMLListViewItem* foundItem = recursiveSearchForView(item->childItem(i), type, id); + if (foundItem) + return foundItem; } - return foundItem; + uWarning() << "returning 0 at UMLListView::findView"; + return 0; } /** * Searches the tree for a diagram (view). + * Warning: these method may return in some cases the wrong diagram * Used by findView(). */ UMLListViewItem* UMLListView::recursiveSearchForView(UMLListViewItem* listViewItem, UMLListViewItem::ListViewType type, Uml::IDType id) { - while (listViewItem) { - if (Model_Utils::typeIsFolder(listViewItem->type())) { - UMLListViewItem* child = (UMLListViewItem *)listViewItem->firstChild(); + if (!listViewItem) + return 0; + // @TODO check this + //if (listViewItem->getType() == type && listViewItem->getID() == id) + // return listViewItem; + + if (Model_Utils::typeIsFolder(listViewItem->type())) { + for (int i=0; i < listViewItem->childCount(); i++) { + UMLListViewItem* child = listViewItem->childItem(i); UMLListViewItem* resultListViewItem = recursiveSearchForView(child, type, id); - if (resultListViewItem) { + if (resultListViewItem) return resultListViewItem; - } - } else { - if (listViewItem->type() == type && listViewItem->getID() == id) { - return listViewItem; - } } - listViewItem = (UMLListViewItem*)listViewItem->nextSibling(); + } else { + if (listViewItem->type() == type && listViewItem->getID() == id) + return listViewItem; } return 0; } @@ -1215,13 +1288,10 @@ */ UMLListViewItem* UMLListView::findItem(Uml::IDType id) { - UMLListViewItem *temp; - Q3ListViewItemIterator it(this); - for (; (temp = (UMLListViewItem*)it.current()); ++it) { - UMLListViewItem * item = temp->findItem(id); - if (item) - return item; - } + UMLListViewItem *topLevel = static_cast(topLevelItem(0)); + UMLListViewItem *item = topLevel->findItem(id); + if (item) + return item; return 0; } @@ -1236,6 +1306,7 @@ if (m_rv == 0) { m_rv = new UMLListViewItem(this, i18n("Views"), UMLListViewItem::lvt_View); m_rv->setID("Views"); + //m_rv->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicator); for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) { Uml::ModelType mt = Uml::ModelType::Value(i); @@ -1248,12 +1319,14 @@ deleteChildrenOf(m_lv[i]); } UMLFolder *datatypeFolder = m_doc->datatypeFolder(); - if (!m_datatypeFolder) + if (!m_datatypeFolder) { m_datatypeFolder = new UMLListViewItem(m_lv[Uml::ModelType::Logical], datatypeFolder->localName(), UMLListViewItem::lvt_Datatype_Folder, datatypeFolder); + } m_rv->setOpen(true); - for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) + for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) { m_lv[i]->setOpen(true); + } m_datatypeFolder->setOpen(false); //setup misc. @@ -1262,6 +1335,18 @@ m_bStartedCut = m_bStartedCopy = false; m_bIgnoreCancelRename = true; m_bCreatingChildObject = false; + headerItem()->setHidden(true); +} + +/** + * Remove all items and subfolders of the main folders. + * Special case: The datatype folder, child of the logical view, is not deleted. + */ +void UMLListView::clean() +{ + for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) + deleteChildrenOf(m_lv[i]); + //deleteChildrenOf(m_datatypeFolder); } /** @@ -1278,7 +1363,10 @@ setSelected(temp, true); } -void UMLListView::contentsMouseDoubleClickEvent(QMouseEvent * me) +/** + * Event handler for mouse double click. + */ +void UMLListView::mouseDoubleClickEvent(QMouseEvent * me) { UMLListViewItem * item = static_cast(currentItem()); if (!item || me->button() != Qt::LeftButton) @@ -1290,7 +1378,7 @@ if (!pView) return; UMLApp::app()->docWindow()->updateDocumentation(false); - pView->showPropDialog(); + pView->umlScene()->showPropDialog(); UMLApp::app()->docWindow()->showDocumentation(pView, true); item->cancelRename(0); return; @@ -1298,14 +1386,15 @@ //else see if an object UMLObject * object = item->umlObject(); //continue only if we are on a UMLObject - if (!object) + if (!object) { return; - + } UMLObject::ObjectType type = object->baseType(); int page = ClassPropDlg::page_gen; - if (Model_Utils::isClassifierListitem(type)) + if (Model_Utils::isClassifierListitem(type)) { object = (UMLObject *)object->parent(); + } //set what page to show switch (type) { @@ -1329,20 +1418,23 @@ } if (object) - object->showProperties(page); + object->showPropertiesPagedDialog(page); item->cancelRename(0); //double click can cause it to go into rename mode. } +/** + * Event handler for accepting drag request. + * @param event the drop event + * @return success state + */ bool UMLListView::acceptDrag(QDropEvent* event) const { - QPoint mousePoint = ((UMLListView*)this)->contentsToViewport(event->pos()); - - UMLListViewItem* item = (UMLListViewItem*)itemAt(mousePoint); + UMLListViewItem* item = (UMLListViewItem*)itemAt(event->pos()); if (!item) { - DEBUG(DBG_SRC) << "itemAt(mousePoint) returns 0"; + DEBUG(DBG_SRC) << "itemAt(mouse position) returns 0"; return false; } - ((Q3ListView*)this)->setCurrentItem((Q3ListViewItem*)item); + ((QTreeWidget*)this)->setCurrentItem((QTreeWidgetItem*)item); UMLDragData::LvTypeAndID_List list; if (! UMLDragData::getClip3TypeAndID(event->mimeData(), list)) { @@ -1693,10 +1785,10 @@ // QObject does not permit changing the parent(). if (att == 0) { uError() << "moveObject internal error: srcObj " - << srcObj->name() << " is not a UMLAttribute"; + << srcObj->name() << " is not a UMLAttribute"; } else if (oldParentClassifier->takeItem(att) == -1) { uError() << "moveObject: oldParentClassifier->takeItem(att " - << att->name() << ") returns 0"; + << att->name() << ") returns 0"; } else { const QString& nm = att->name(); UMLAttribute *newAtt = newParentClassifier->createAttribute(nm, @@ -1764,7 +1856,7 @@ /** * Something has been dragged and dropped onto the list view. */ -void UMLListView::slotDropped(QDropEvent* de, Q3ListViewItem* parent, Q3ListViewItem* item) +void UMLListView::slotDropped(QDropEvent* de, UMLListViewItem* parent, UMLListViewItem* item) { Q_UNUSED(parent); item = (UMLListViewItem *)currentItem(); @@ -1788,17 +1880,16 @@ /** * Get selected items. - * * @return the list of selected items */ UMLListViewItemList UMLListView::selectedItems() { UMLListViewItemList itemList; - Q3ListViewItemIterator it(this); + UMLListViewItemIterator it(this); // iterate through all items of the list view - for (; it.current(); ++it) { - if (it.current()->isSelected()) { - UMLListViewItem *item = (UMLListViewItem*)it.current(); + for (; *it; ++it) { + if ((*it)->isSelected()) { + UMLListViewItem *item = (UMLListViewItem*)*it; itemList.append(item); } } @@ -1809,18 +1900,17 @@ /** * Get selected items, but only root elements selected (without children). - * - * @return the list of selected items + * @return the list of selected root items */ UMLListViewItemList UMLListView::selectedItemsRoot() { UMLListViewItemList itemList; - Q3ListViewItemIterator it(this); + QTreeWidgetItemIterator it(this); // iterate through all items of the list view - for (; it.current(); ++it) { - if (it.current()->isSelected()) { - UMLListViewItem *item = (UMLListViewItem*)it.current(); + for (; *it; ++it) { + if ((*it)->isSelected()) { + UMLListViewItem *item = (UMLListViewItem*)*it; // this is the trick, we select only the item with a parent unselected // since we can't select a child and its grandfather without its parent // we would be able to delete each item individually, without an invalid iterator @@ -1844,21 +1934,21 @@ if (!view) { return 0; } - UMLListViewItem::ListViewType lvt = Model_Utils::convert_DT_LVT(view->type()); + UMLListViewItem::ListViewType lvt = Model_Utils::convert_DT_LVT(view->umlScene()->type()); UMLListViewItem *parent = 0; - UMLFolder *f = view->folder(); + UMLFolder *f = view->umlScene()->folder(); if (f) { parent = findUMLObject(f); if (parent == 0) - uError() << view->name() << ": findUMLObject(" << f->name() << ") returns 0"; + uError() << view->umlScene()->name() << ": findUMLObject(" << f->name() << ") returns 0"; } else { - DEBUG(DBG_SRC) << view->name() << ": no parent folder set, using predefined folder"; + DEBUG(DBG_SRC) << view->umlScene()->name() << ": no parent folder set, using predefined folder"; } if (parent == 0) { parent = determineParentItem(lvt); - lvt = Model_Utils::convert_DT_LVT(view->type()); + lvt = Model_Utils::convert_DT_LVT(view->umlScene()->type()); } - UMLListViewItem *item = new UMLListViewItem(parent, view->name(), lvt, view->getID()); + UMLListViewItem *item = new UMLListViewItem(parent, view->umlScene()->name(), lvt, view->umlScene()->getID()); return item; } @@ -1866,7 +1956,7 @@ * CHECK - This is perhaps redundant since the * UMLListViewItemData => UMLListViewItem merge. * Creates a new UMLListViewItem from a UMLListViewItem, if - * parent is null the ListView Decides who is going to be the parent. + * parent is null the ListView decides who is going to be the parent. */ UMLListViewItem* UMLListView::createItem(UMLListViewItem& Data, IDChangeLog& IDChanges, UMLListViewItem* parent /*= 0*/) @@ -1946,8 +2036,8 @@ if (v == 0) { return 0; } - const UMLListViewItem::ListViewType lvt = Model_Utils::convert_DT_LVT(v->type()); - item = new UMLListViewItem(parent, v->name(), lvt, newID); + const UMLListViewItem::ListViewType lvt = Model_Utils::convert_DT_LVT(v->umlScene()->type()); + item = new UMLListViewItem(parent, v->umlScene()->name(), lvt, newID); } break; default: @@ -1958,10 +2048,10 @@ } /** - * Determine the parent ListViewItem given a ListView_Type. + * Determine the parent ListViewItem given a ListViewType. * This parent is used for creating new UMLListViewItems. * - * @param lvt The ListView_Type for which to lookup the parent. + * @param lvt The ListViewType for which to lookup the parent. * @return Pointer to the parent UMLListViewItem chosen. */ UMLListViewItem* UMLListView::determineParentItem(UMLListViewItem::ListViewType lvt) const @@ -2004,11 +2094,11 @@ */ int UMLListView::selectedItemsCount() { - Q3ListViewItemIterator it(this); + QTreeWidgetItemIterator it(this); int count = 0; // iterate through all items of the list view - for (; it.current(); ++it) { - if (it.current()->isSelected()) { + for (; *it; ++it) { + if ((*it)->isSelected()) { count++; } } @@ -2024,23 +2114,27 @@ return m_doc; } +/** + * Event handler for lost focus. + * @param fe the focus event + */ void UMLListView::focusOutEvent(QFocusEvent * fe) { Qt::FocusReason reason = fe->reason(); - if (reason != Qt::PopupFocusReason) { + if (reason != Qt::PopupFocusReason && reason != Qt::MouseFocusReason) { clearSelection(); - triggerUpdate(); + //triggerUpdate(); } //repaint(); - Q3ListView::focusOutEvent(fe); + QTreeWidget::focusOutEvent(fe); } /** * Determines the root listview type of the given UMLListViewItem. * Starts at the given item, compares it against each of the * predefined root views (Root, Logical, UseCase, Component, - * Deployment, EntityRelationship.) Returns the ListView_Type + * Deployment, EntityRelationship.) Returns the ListViewType * of the matching root view; if no match then continues the * search using the item's parent, then grandparent, and so forth. * Returns UMLListViewItem::lvt_Unknown if no match at all is found. @@ -2085,36 +2179,32 @@ } /** - * Calls updateFolder() on the item to update the icon to open. + * Connects to the signal that @ref UMLApp emits when a + * cut operation is successful. */ -void UMLListView::slotExpanded(Q3ListViewItem * item) +void UMLListView::slotCutSuccessful() { - UMLListViewItem * myItem = static_cast(item); - if (isExpandable(myItem->type())) - myItem->updateFolder(); + if (m_bStartedCut) { + popupMenuSel(m_menu->getAction(ListPopupMenu::mt_Delete)); + //deletion code here + m_bStartedCut = false; + } } /** - * Calls updateFolder() on the item to update the icon to closed. + * TODO: still in use? */ -void UMLListView::slotCollapsed(Q3ListViewItem * item) +void UMLListView::startUpdate() { - UMLListViewItem * myItem = static_cast(item); - if (isExpandable(myItem->type())) - myItem->updateFolder(); + setSortingEnabled(false); } /** - * Connects to the signal that @ref UMLApp emits when a - * cut operation is successful. + * TODO: still in use? */ -void UMLListView::slotCutSuccessful() +void UMLListView::endUpdate() { - if (m_bStartedCut) { - popupMenuSel(m_menu->getAction(ListPopupMenu::mt_Delete)); - //deletion code here - m_bStartedCut = false; - } + setSortingEnabled(true); } /** @@ -2162,9 +2252,6 @@ newItem->setIcon(icon); newItem->setOpen(true); newItem->setCreating(true); - newItem->startRename(0); // calls QListView::ensureItemVisible() - // When the user accepts the rename operation, UMLListViewItem::okRename() - // is called (automatically by QListViewItem.) } /** @@ -2172,7 +2259,7 @@ */ bool UMLListView::itemRenamed(UMLListViewItem * item, int col) { - Q_UNUSED(col); + DEBUG(DBG_SRC) << item->text(col); //if true the item was cancel before this message if (m_bIgnoreCancelRename) { return true; @@ -2180,7 +2267,7 @@ m_bIgnoreCancelRename = true; UMLListViewItem * renamedItem = static_cast< UMLListViewItem *>(item) ; UMLListViewItem::ListViewType type = renamedItem->type(); - QString newText = renamedItem->text(0); + QString newText = renamedItem->text(col); renamedItem->setCreating(false); // If the type is empty then delete it. @@ -2518,7 +2605,7 @@ connectNewObjectsSlots(newObject); item->setUMLObject(newObject); item->setText(text); - ensureItemVisible(item); + scrollToItem(item); // as it's a ClassifierListItem add it to the childObjectMap of the parent UMLClassifierListItem* classifierListItem = static_cast(newObject); @@ -2537,6 +2624,7 @@ UMLView* UMLListView::createDiagram(UMLListViewItem * item, Uml::DiagramType type) { QString name = item->text(0); + DEBUG(DBG_SRC) << name << " / type=" << type.toString(); UMLView * view = m_doc->findView(type, name); if (view) { delete item; @@ -2550,15 +2638,15 @@ return 0; } view = new UMLView(parentFolder); - view->setName(name); - view->setType(type); - view->setID(UniqueID::gen()); + view->umlScene()->setName(name); + view->umlScene()->setType(type); + view->umlScene()->setID(UniqueID::gen()); m_doc->addView(view); - view->setOptionState(Settings::optionState()); - item->setID(view->getID()); - item->setText(name); - view->activate(); - m_doc->changeCurrentView(view->getID()); + view->umlScene()->setOptionState(Settings::optionState()); + item->setID(view->umlScene()->getID()); + item->setText(0, name); + view->umlScene()->activate(); + m_doc->changeCurrentView(view->umlScene()->getID()); return view; } @@ -2642,7 +2730,7 @@ UMLPackage *pkg = static_cast(parentItem->umlObject()); if (pkg == 0) { uError() << "internal error - " - << "parent listviewitem is package but has no UMLObject"; + << "parent listviewitem is package but has no UMLObject"; return true; } return (pkg->findObject(name) == 0); @@ -2670,16 +2758,47 @@ } /** + * Renaming of an item has started. + * @param item the item which will be renamed + */ +void UMLListView::startRename(UMLListViewItem* item) +{ + if (m_editItem) + cancelRename(m_editItem); + openPersistentEditor(item,0); + m_editItem = item; + m_bIgnoreCancelRename = true; +} + +/** * Cancel rename event has occurred for the given item. */ -void UMLListView::cancelRename(UMLListViewItem * item) +void UMLListView::cancelRename(UMLListViewItem* item) { + // delete pointer first to lock slotItemChanged + m_editItem = 0; + closePersistentEditor(item,0); if (!m_bIgnoreCancelRename) { delete item; m_bIgnoreCancelRename = true; } } +/** + * Renaming of an item has ended. + * @param item the item which was renamed or not + */ +void UMLListView::endRename(UMLListViewItem* item) +{ + // delete pointer first to lock slotItemChanged + m_editItem = 0; + closePersistentEditor(item,0); + item->okRename(0); +} + +/** + * + */ void UMLListView::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) { QDomElement listElement = qDoc.createElement("listview"); @@ -2687,14 +2806,11 @@ qElement.appendChild(listElement); } +/** + * + */ bool UMLListView::loadFromXMI(QDomElement & element) { - /* - deleteChildrenOf( m_ucv ); - deleteChildrenOf( m_lv ); - deleteChildrenOf( m_cmpv ); - deleteChildrenOf( m_dplv ); - */ QDomNode node = element.firstChild(); QDomElement domElement = node.toElement(); m_doc->writeToStatusBar(i18n("Loading listview...")); @@ -2717,6 +2833,9 @@ return true; } +/** + * + */ bool UMLListView::loadChildrenFromXMI(UMLListViewItem * parent, QDomElement & element) { QDomNode node = element.firstChild(); @@ -2813,10 +2932,10 @@ item = findItem(nID); if (item == 0) { uError() << "INTERNAL ERROR: " - << "findItem(id " << ID2STR(nID) << ") returns 0"; + << "findItem(id " << ID2STR(nID) << ") returns 0"; /* if (pObject && pObject->getUMLPackage() && - parent->getType() != UMLListViewItem::lvt_Package) { + parent->type() != UMLListViewItem::lvt_Package) { // Pre-1.2 file format: // Objects were not nested in their packages. // Synthesize the nesting here. @@ -2875,14 +2994,14 @@ item = findItem(nID); if (item == 0) { DEBUG(DBG_SRC) << "item " << ID2STR(nID) << " (of type " - << lvType << ") does not yet exist..."; + << UMLListViewItem::toString(lvType) << ") does not yet exist..."; UMLObject* umlObject = parent->umlObject(); if (!umlObject) { - DEBUG(DBG_SRC) << "And also the parent->getUMLObject() does not exist"; + DEBUG(DBG_SRC) << "And also the parent->umlObject() does not exist"; return false; } if (nID == Uml::id_None) { - uWarning() << "lvtype " << lvType << " has id -1"; + uWarning() << "lvtype " << UMLListViewItem::toString(lvType) << " has id -1"; } else { UMLClassifier *classifier = dynamic_cast(umlObject); if (classifier) { @@ -2892,8 +3011,8 @@ label = umlObject->name(); item = new UMLListViewItem(parent, label, lvType, umlObject); } else { - DEBUG(DBG_SRC) << "lvtype " << lvType << " child object " - << ID2STR(nID) << " not found"; + DEBUG(DBG_SRC) << "lvtype " << UMLListViewItem::toString(lvType) + << " child object " << ID2STR(nID) << " not found"; } } else { DEBUG(DBG_SRC) << "cast to classifier object failed"; @@ -2924,7 +3043,7 @@ item = new UMLListViewItem(parent, label, lvType, nID); } else { uError() << "INTERNAL ERROR: unexpected listview type " - << lvType << " (ID " << ID2STR(nID) << ")"; + << UMLListViewItem::toString(lvType) << " (ID " << ID2STR(nID) << ")"; } break; }//end switch @@ -2936,7 +3055,7 @@ } } else { uWarning() << "unused list view item " << ID2STR(nID) - << " of lvtype " << lvType; + << " of lvtype " << UMLListViewItem::toString(lvType); } domElement = node.toElement(); }//end while @@ -2946,24 +3065,25 @@ /** * Open all items in the list view. */ -void UMLListView::expandAll(Q3ListViewItem *item) +void UMLListView::expandAll(UMLListViewItem *item) { - if (!item) item = firstChild(); - item->setOpen(true); - for (item = item->firstChild(); item; item = item->nextSibling()) { - item->setOpen(true); + if (!item) item = static_cast(topLevelItem(0)); + for (int i = 0; i < item->childCount(); i++) { + expandAll(item->childItem(i)); } + item->setExpanded(true); } /** * Close all items in the list view. */ -void UMLListView::collapseAll(Q3ListViewItem *item) +void UMLListView::collapseAll(UMLListViewItem *item) { - if (!item) item = firstChild(); - item->setOpen(false); - for (item = item->firstChild(); item; item = item->nextSibling()) - item->setOpen(false); + if (!item) item = static_cast(topLevelItem(0)); + for (int i = 0; i < item->childCount(); i++) { + collapseAll(item->childItem(i)); + } + item->setExpanded(false); } /** @@ -3037,13 +3157,17 @@ if (!parent) { return; } - if (parent == m_lv[Uml::ModelType::Logical]) + if (parent == m_lv[Uml::ModelType::Logical]) { + delete m_datatypeFolder; m_datatypeFolder = 0; - while (parent->firstChild()) { - delete parent->firstChild(); } + for (int i=0; i < parent->childCount(); i++) + parent->removeChild(parent->child(i)); } +/** + * + */ void UMLListView::closeDatatypesFolder() { m_datatypeFolder->setOpen(false); @@ -3079,14 +3203,12 @@ } UMLCanvasObject *canvasObj = dynamic_cast(object); if (canvasObj) { - /** - * We cannot just delete canvasObj here: What if the object - * is still being used by others (for example, as a parameter - * or return type of an operation) ? - * Deletion should not have been permitted in the first place - * if the object still has users - but Umbrello is lacking - * that logic. - */ + // We cannot just delete canvasObj here: What if the object + // is still being used by others (for example, as a parameter + // or return type of an operation) ? + // Deletion should not have been permitted in the first place + // if the object still has users - but Umbrello is lacking + // that logic. canvasObj->removeAllChildObjects(); } if (object) { @@ -3102,29 +3224,34 @@ return true; } - +/** + * + */ void UMLListView::dragEnterEvent(QDragEnterEvent* event) { event->accept(); - K3ListView::dragEnterEvent(event); + QTreeWidget::dragEnterEvent(event); } - +/** + * + */ void UMLListView::dragMoveEvent(QDragMoveEvent* event) { event->accept(); - K3ListView::dragMoveEvent( event ); + QTreeWidget::dragMoveEvent( event ); } +/** + * + */ void UMLListView::dropEvent(QDropEvent* event) { if ( !acceptDrag( event ) ) { event->ignore(); } else { - QPoint mousePoint = ((UMLListView*)this)->contentsToViewport(event->pos()); - - UMLListViewItem* item = (UMLListViewItem*)itemAt(mousePoint); + UMLListViewItem* item = static_cast(itemAt(event->pos())); if (!item) { DEBUG(DBG_SRC) << "itemAt(mousePoint) returns 0"; event->ignore(); @@ -3132,11 +3259,12 @@ } slotDropped(event, 0, item); } - K3ListView::dropEvent( event ); + QTreeWidget::dropEvent( event ); } /** * Set the background color. + * @param color the new background color */ void UMLListView::setBackgroundColor(const QColor & color) { @@ -3145,5 +3273,28 @@ setPalette(palette); } +/** + * Overloading operator for debugging output. + */ +QDebug operator<<(QDebug out, const UMLListView& view) +{ + UMLListViewItem* header = static_cast(view.headerItem()); + if (header) { + out << *header; + for(int indx = 0; indx < header->childCount(); ++indx) { + UMLListViewItem* item = static_cast(header->child(indx)); + if (item) { + out << indx << " - " << *item << endl; + } + else { + out << indx << " - " << "" << endl; + } + } + } + else { + out << ""; + } + return out.space(); +} #include "umllistview.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/umllistview.h kdesdk-4.7.95/umbrello/umbrello/umllistview.h --- kdesdk-4.7.90/umbrello/umbrello/umllistview.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umllistview.h 2011-12-20 21:00:11.000000000 +0000 @@ -22,8 +22,6 @@ #include #include -#include - class QEvent; class QMouseEvent; class QFocusEvent; @@ -47,7 +45,7 @@ * @author Paul Hensgen * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class UMLListView : public K3ListView +class UMLListView : public QTreeWidget { Q_OBJECT public: @@ -59,12 +57,20 @@ UMLDoc * document() const; void init(); + void clean(); void setView(UMLView* view); UMLListViewItemList selectedItems(); UMLListViewItemList selectedItemsRoot(); int selectedItemsCount(); + // port qt3 + void setTitle(int column, const QString &text); + int getSelectedItems(UMLListViewItemList &ItemList); + int getSelectedItemsRoot(UMLListViewItemList &ItemList); + + void startUpdate(); + void endUpdate(); UMLListViewItem* createDiagramItem(UMLView *view); @@ -96,8 +102,11 @@ bool isUnique(UMLListViewItem * item, const QString &name); + void startRename(UMLListViewItem * item); void cancelRename(UMLListViewItem * item); + void endRename(UMLListViewItem * item); + void setSelected(UMLListViewItem * item, bool state) { setItemSelected((QTreeWidgetItem*)item,state); } void setStartedCut(bool startedCut); void setStartedCopy(bool startedCopy); bool startedCopy() const; @@ -122,21 +131,22 @@ bool loadFromXMI(QDomElement & element); bool loadChildrenFromXMI(UMLListViewItem * parent, QDomElement & element); - friend QDebug operator<< (QDebug out, const UMLListView& view); + friend QDebug operator<<(QDebug out, const UMLListView& view); protected: + bool event(QEvent *e); bool eventFilter(QObject *o, QEvent *e); - void contentsMouseReleaseEvent(QMouseEvent * me); - void contentsMousePressEvent(QMouseEvent *me); - void contentsMouseMoveEvent(QMouseEvent* me); - void contentsMouseDoubleClickEvent(QMouseEvent * me); - void focusOutEvent ( QFocusEvent * fe); + void mouseReleaseEvent(QMouseEvent *me); + void mousePressEvent(QMouseEvent *me); + void mouseMoveEvent(QMouseEvent *me); + void mouseDoubleClickEvent(QMouseEvent *me); + void focusOutEvent (QFocusEvent *fe); UMLDragData* getDragData(); bool acceptDrag(QDropEvent* event) const; - void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent* ke); void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent* event); void dropEvent(QDropEvent* event); @@ -169,16 +179,19 @@ void popupMenuSel(QAction* action); - void slotDropped(QDropEvent* de, Q3ListViewItem* parent, Q3ListViewItem* item); - - void slotExpanded(Q3ListViewItem* item); - void slotCollapsed(Q3ListViewItem* item); + void slotDropped(QDropEvent* de, UMLListViewItem* parent, UMLListViewItem* item); - void expandAll(Q3ListViewItem *item); - void collapseAll(Q3ListViewItem *item); + void expandAll(UMLListViewItem *item); + void collapseAll(UMLListViewItem *item); void slotCutSuccessful(); +protected slots: + void slotItemChanged(QTreeWidgetItem *, int); + void slotItemSelectionChanged(); + void slotExpanded(QTreeWidgetItem* item); + void slotCollapsed(QTreeWidgetItem* item); + private: UMLListViewItem* recursiveSearchForView(UMLListViewItem* folder, @@ -196,7 +209,7 @@ bool m_bIgnoreCancelRename; bool m_bCreatingChildObject; ///< when creating an attribute or an operation to stop it adding a second listViewItem QPoint m_dragStartPosition; - + UMLListViewItem* m_editItem; }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/umllistviewitem.cpp kdesdk-4.7.95/umbrello/umbrello/umllistviewitem.cpp --- kdesdk-4.7.90/umbrello/umbrello/umllistviewitem.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umllistviewitem.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,19 +11,6 @@ // own header #include "umllistviewitem.h" -// system includes -#include - -// qt includes -#include -#include -#include -#include - -// kde includes -#include -#include - // app includes #include "debug_utils.h" #include "folder.h" @@ -42,7 +29,20 @@ #include "uml.h" #include "cmds.h" -UMLListView* UMLListViewItem::s_pListView = 0; +// kde includes +#include +#include + +// qt includes +#include +#include +#include +#include + +// system includes +#include + +#define DBG_LVI "UMLListViewItem" /** * Sets up an instance. @@ -53,17 +53,18 @@ * @param o The object it represents. */ UMLListViewItem::UMLListViewItem(UMLListView * parent, const QString &name, - UMLListViewItem::ListViewType t, UMLObject* o) - : Q3ListViewItem(parent, name) + ListViewType t, UMLObject* o) + : QTreeWidgetItem(parent) { - init(parent); + init(); m_type = t; m_object = o; - if (o) + if (o) { m_id = o->id(); + } setIcon(Icon_Utils::it_Home); setText(name); - setRenameEnabled(0, false); +// setRenameEnabled(0, false); } /** @@ -72,11 +73,12 @@ * @param parent The parent to this instance. */ UMLListViewItem::UMLListViewItem(UMLListView * parent) - : Q3ListViewItem(parent) + : QTreeWidgetItem(parent) { - init(parent); - if (parent == NULL) - uDebug() << "UMLListViewItem constructor called with a NULL listview parent"; + init(); + if (parent == 0) { + DEBUG(DBG_LVI) << "UMLListViewItem constructor called with a NULL listview parent"; + } } /** @@ -85,7 +87,7 @@ * @param parent The parent to this instance. */ UMLListViewItem::UMLListViewItem(UMLListViewItem * parent) - : Q3ListViewItem(parent) + : QTreeWidgetItem(parent) { init(); } @@ -98,8 +100,8 @@ * @param t The type of this instance. * @param o The object it represents. */ -UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, UMLListViewItem::ListViewType t, UMLObject*o) - : Q3ListViewItem(parent, name) +UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, ListViewType t, UMLObject*o) + : QTreeWidgetItem(parent) { init(); m_type = t; @@ -114,7 +116,7 @@ updateObject(); m_id = o->id(); } - setRenameEnabled(0, !Model_Utils::typeIsRootView(t)); +// setRenameEnabled(0, !Model_Utils::typeIsRootView(t)); setText(name); } @@ -126,35 +128,35 @@ * @param t The type of this instance. * @param id The id of this instance. */ -UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, UMLListViewItem::ListViewType t, Uml::IDType id) - : Q3ListViewItem(parent, name) +UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, ListViewType t, Uml::IDType id) + : QTreeWidgetItem(parent) { init(); m_type = t; m_id = id; switch (m_type) { - case UMLListViewItem::lvt_Collaboration_Diagram: + case lvt_Collaboration_Diagram: setIcon(Icon_Utils::it_Diagram_Collaboration); break; - case UMLListViewItem::lvt_Class_Diagram: + case lvt_Class_Diagram: setIcon(Icon_Utils::it_Diagram_Class); break; - case UMLListViewItem::lvt_State_Diagram: + case lvt_State_Diagram: setIcon(Icon_Utils::it_Diagram_State); break; - case UMLListViewItem::lvt_Activity_Diagram: + case lvt_Activity_Diagram: setIcon(Icon_Utils::it_Diagram_Activity); break; - case UMLListViewItem::lvt_Sequence_Diagram: + case lvt_Sequence_Diagram: setIcon(Icon_Utils::it_Diagram_Sequence); break; - case UMLListViewItem::lvt_Component_Diagram: + case lvt_Component_Diagram: setIcon(Icon_Utils::it_Diagram_Component); break; - case UMLListViewItem::lvt_Deployment_Diagram: + case lvt_Deployment_Diagram: setIcon(Icon_Utils::it_Diagram_Deployment); break; - case UMLListViewItem::lvt_UseCase_Diagram: + case lvt_UseCase_Diagram: setIcon(Icon_Utils::it_Diagram_Usecase); break; default: @@ -164,7 +166,7 @@ // to set pixmap to folder. doesn't hurt diagrams. updateFolder(); setText(name); - setRenameEnabled(0, true); + //setRenameEnabled(0, true); } /** @@ -177,16 +179,42 @@ /** * Initializes key variables of the class. */ -void UMLListViewItem::init(UMLListView * parent) +void UMLListViewItem::init() { - m_type = UMLListViewItem::lvt_Unknown; + m_type = lvt_Unknown; m_bCreating = false; - m_object = NULL; + m_object = 0; m_id = Uml::id_None; - m_nChildren = 0; - if (s_pListView == NULL && parent != NULL) { - uDebug() << "s_pListView still NULL, setting it now "; - s_pListView = parent; + DEBUG_REGISTER(DBG_LVI); +} + +/** + * Returns the signature of items that are operations. + * @return signature of an operation item, else an empty string + */ +QString UMLListViewItem::toolTip() +{ + UMLObject *obj = umlObject(); + if (obj) { + switch (obj->baseType()) { + case UMLObject::ot_Class: + return obj->doc(); + case UMLObject::ot_Operation: + { + UMLOperation *op = static_cast(obj); + return op->toString(Uml::SignatureType::ShowSig); + } + case UMLObject::ot_Attribute: + { + UMLAttribute *at = static_cast(obj); + return at->toString(Uml::SignatureType::ShowSig); + } + default: + return QString(); + } + } + else { + return QString(); } } @@ -214,7 +242,7 @@ void UMLListViewItem::deleteChildItem(UMLClassifierListItem *child) { UMLListViewItem *childItem = findChildObject(child); - if (childItem == NULL) { + if (childItem == 0) { uError() << child->name() << ": child listview item not found"; return; } @@ -222,6 +250,11 @@ delete childItem; } +void UMLListViewItem::setVisible(bool state) +{ + setHidden(!state); +} + /** * Returns the id this class represents. * @@ -229,8 +262,9 @@ */ Uml::IDType UMLListViewItem::getID() const { - if (m_object) + if (m_object) { return m_object->id(); + } return m_id; } @@ -238,16 +272,16 @@ * Sets the id this class represents. * This only sets the ID locally, not at the UMLObject that is perhaps * associated to this UMLListViewItem. - * - * @return The id this class represents. + * @param id the id this class represents */ void UMLListViewItem::setID(Uml::IDType id) { if (m_object) { Uml::IDType oid = m_object->id(); - if (id != Uml::id_None && oid != id) - uDebug() << "new id " << ID2STR(id) << " does not agree with object id " + if (id != Uml::id_None && oid != id) { + DEBUG(DBG_LVI) << "new id " << ID2STR(id) << " does not agree with object id " << ID2STR(oid); + } } m_id = id; } @@ -278,12 +312,13 @@ */ bool UMLListViewItem::isOwnParent(Uml::IDType listViewItemID) { - Q3ListViewItem *lvi = (Q3ListViewItem*)s_pListView->findItem(listViewItemID); - if (lvi == NULL) { + UMLListView* listView = static_cast(treeWidget()); + QTreeWidgetItem *lvi = static_cast(listView->findItem(listViewItemID)); + if (lvi == 0) { uError() << "ListView->findItem(" << ID2STR(listViewItemID) << ") returns NULL"; return true; } - for (Q3ListViewItem *self = (Q3ListViewItem*)this; self; self = self->parent()) { + for (QTreeWidgetItem *self = static_cast(this); self; self = self->parent()) { if (lvi == self) return true; } @@ -295,7 +330,7 @@ */ void UMLListViewItem::updateObject() { - if (m_object == NULL) + if (m_object == 0) return; Uml::Visibility scope = m_object->visibility(); @@ -318,7 +353,7 @@ /* case UMLObject::ot_Folder: { - Uml::ListView_Type lvt = Model_Utils::convert_OT_LVT(m_object); + ListViewType lvt = Model_Utils::convert_OT_LVT(m_object); icon = Model_Utils::convert_LVT_IT(lvt); } break; @@ -366,7 +401,7 @@ Icon_Utils::IconType icon = Model_Utils::convert_LVT_IT(m_type); if (icon) { if (Model_Utils::typeIsFolder(m_type)) - icon = (Icon_Utils::IconType)((int)icon + (int)isOpen()); + icon = (Icon_Utils::IconType)((int)icon + (int)isExpanded()); setIcon(icon); } } @@ -375,9 +410,9 @@ * Overrides default method. * Will call default method but also makes sure correct icon is shown. */ -void UMLListViewItem::setOpen(bool open) +void UMLListViewItem::setOpen(bool expand) { - Q3ListViewItem::setOpen(open); + QTreeWidgetItem::setExpanded(expand); updateFolder(); } @@ -395,11 +430,12 @@ void UMLListViewItem::setText(int column, const QString &newText) { m_label = newText; - Q3ListViewItem::setText(column, newText); + QTreeWidgetItem::setText(column, newText); } /** * Returns the current text. + * :TODO: not used anywhere */ QString UMLListViewItem::getText() const { @@ -419,24 +455,36 @@ */ void UMLListViewItem::setIcon(Icon_Utils::IconType iconType) { - setPixmap(0, Icon_Utils::SmallIcon(iconType)); + QPixmap p = Icon_Utils::SmallIcon(iconType); + QTreeWidgetItem::setIcon(0, QIcon(p)); +} + +/** + * Start the rename process. + */ +void UMLListViewItem::startRename(int col) +{ + DEBUG(DBG_LVI) << this << " - column=" << col << ", text=" << text(col); + m_label = text(col); // keep the old text + if (m_bCreating) { + UMLListView* listView = static_cast(treeWidget()); + listView->cancelRename(this); + } } /** * This function is called if the user presses Enter during in-place renaming - * of the item in column col, reimplemented from QlistViewItem + * of the item in column col. */ void UMLListViewItem::okRename(int col) { - QString oldText = m_label; // copy old name - Q3ListViewItem::okRename(col); - UMLDoc* doc = s_pListView->document(); + DEBUG(DBG_LVI) << this << " - column=" << col << ", text=" << text(col); + UMLListView* listView = static_cast(treeWidget()); + UMLDoc* doc = listView->document(); if (m_bCreating) { m_bCreating = false; - QString savedLabel = m_label; - m_label = text(col); - if (s_pListView->itemRenamed(this, col)) { - s_pListView->ensureItemVisible(this); + if (listView->itemRenamed(this, col)) { +//:TODO: listView->ensureItemVisible(this); doc->setModified(true); } else { delete this; @@ -444,7 +492,7 @@ return; } QString newText = text(col); - if (newText == oldText) { + if (newText == m_label) { return; } if (newText.isEmpty()) { @@ -452,24 +500,24 @@ return; } switch (m_type) { - case UMLListViewItem::lvt_UseCase: - case UMLListViewItem::lvt_Actor: - case UMLListViewItem::lvt_Class: - case UMLListViewItem::lvt_Package: - case UMLListViewItem::lvt_UseCase_Folder: - case UMLListViewItem::lvt_Logical_Folder: - case UMLListViewItem::lvt_Component_Folder: - case UMLListViewItem::lvt_Deployment_Folder: - case UMLListViewItem::lvt_EntityRelationship_Folder: - case UMLListViewItem::lvt_Interface: - case UMLListViewItem::lvt_Datatype: - case UMLListViewItem::lvt_Enum: - case UMLListViewItem::lvt_EnumLiteral: - case UMLListViewItem::lvt_Subsystem: - case UMLListViewItem::lvt_Component: - case UMLListViewItem::lvt_Node: - case UMLListViewItem::lvt_Category: - if (m_object == NULL || !doc->isUnique(newText)) { + case lvt_UseCase: + case lvt_Actor: + case lvt_Class: + case lvt_Package: + case lvt_UseCase_Folder: + case lvt_Logical_Folder: + case lvt_Component_Folder: + case lvt_Deployment_Folder: + case lvt_EntityRelationship_Folder: + case lvt_Interface: + case lvt_Datatype: + case lvt_Enum: + case lvt_EnumLiteral: + case lvt_Subsystem: + case lvt_Component: + case lvt_Node: + case lvt_Category: + if (m_object == 0 || !doc->isUnique(newText)) { cancelRenameWithMsg(); return; } @@ -478,8 +526,8 @@ m_label = newText; break; - case UMLListViewItem::lvt_Operation: { - if (m_object == NULL) { + case lvt_Operation: { + if (m_object == 0) { cancelRenameWithMsg(); return; } @@ -524,13 +572,13 @@ Model_Utils::psText(st), i18n("Rename canceled")); } - Q3ListViewItem::setText(0, m_label); + setText(m_label); break; } - case UMLListViewItem::lvt_Attribute: - case UMLListViewItem::lvt_EntityAttribute: { - if (m_object == NULL) { + case lvt_Attribute: + case lvt_EntityAttribute: { + if (m_object == 0) { cancelRenameWithMsg(); return; } @@ -557,15 +605,15 @@ Model_Utils::psText(st), i18n("Rename canceled")); } - Q3ListViewItem::setText(0, m_label); + setText(m_label); break; } - case UMLListViewItem::lvt_PrimaryKeyConstraint: - case UMLListViewItem::lvt_UniqueConstraint: - case UMLListViewItem::lvt_ForeignKeyConstraint: - case UMLListViewItem::lvt_CheckConstraint: { - if (m_object == NULL) { + case lvt_PrimaryKeyConstraint: + case lvt_UniqueConstraint: + case lvt_ForeignKeyConstraint: + case lvt_CheckConstraint: { + if (m_object == 0) { cancelRenameWithMsg(); return; } @@ -588,12 +636,12 @@ Model_Utils::psText(st), i18n("Rename canceled")); } - Q3ListViewItem::setText(0, m_label); + setText(m_label); break; } - case UMLListViewItem::lvt_Template: { - if (m_object == NULL) { + case lvt_Template: { + if (m_object == 0) { cancelRenameWithMsg(); return; } @@ -615,26 +663,27 @@ Model_Utils::psText(st), i18n("Rename canceled")); } - Q3ListViewItem::setText(0, m_label); + setText(m_label); break; } - case UMLListViewItem::lvt_UseCase_Diagram: - case UMLListViewItem::lvt_Class_Diagram: - case UMLListViewItem::lvt_Sequence_Diagram: - case UMLListViewItem::lvt_Collaboration_Diagram: - case UMLListViewItem::lvt_State_Diagram: - case UMLListViewItem::lvt_Activity_Diagram: - case UMLListViewItem::lvt_Component_Diagram: - case UMLListViewItem::lvt_Deployment_Diagram: { + case lvt_UseCase_Diagram: + case lvt_Class_Diagram: + case lvt_Sequence_Diagram: + case lvt_Collaboration_Diagram: + case lvt_State_Diagram: + case lvt_Activity_Diagram: + case lvt_Component_Diagram: + case lvt_Deployment_Diagram: { UMLView *view = doc->findView(getID()); - if (view == NULL) { + if (view == 0) { cancelRenameWithMsg(); return; } UMLView *anotherView = doc->findView(view->type(), newText); - if (anotherView && anotherView->getID() == getID()) + if (anotherView && anotherView->getID() == getID()) { anotherView = 0; + } if (anotherView) { cancelRenameWithMsg(); return; @@ -648,7 +697,7 @@ KMessageBox::error(0, i18n("Renaming an item of listview type %1 is not yet implemented.", m_type), i18n("Function Not Implemented")); - Q3ListViewItem::setText(0, m_label); + setText(m_label); break; } doc->setModified(true); @@ -659,10 +708,11 @@ */ void UMLListViewItem::cancelRenameWithMsg() { + DEBUG(DBG_LVI) << this << " - column=" << ":TODO:col" << ", text=" << text(0); KMessageBox::error(0, i18n("The name you entered was invalid.\nRenaming process has been canceled."), i18n("Name Not Valid")); - Q3ListViewItem::setText(0, m_label); + setText(m_label); } /** @@ -670,9 +720,11 @@ */ void UMLListViewItem::cancelRename(int col) { - Q3ListViewItem::cancelRename(col); + DEBUG(DBG_LVI) << this << " - column=" << col << ", text=" << text(col); + Q_UNUSED(col); if (m_bCreating) { - s_pListView->cancelRename(this); + UMLListView* listView = static_cast(treeWidget()); + listView->cancelRename(this); } } @@ -681,11 +733,12 @@ * Sort the listview items by type and position within the corresponding list * of UMLObjects. If the item does not have an UMLObject then place it last. */ -int UMLListViewItem::compare(Q3ListViewItem *other, int col, bool ascending) const +#if 0 +int UMLListViewItem::compare(QTreeWidgetItem *other, int col, bool ascending) const { UMLListViewItem *ulvi = static_cast(other); - UMLListViewItem::ListViewType ourType = type(); - UMLListViewItem::ListViewType otherType = ulvi->type(); + ListViewType ourType = type(); + ListViewType otherType = ulvi->type(); if (ourType < otherType) return -1; @@ -696,59 +749,59 @@ const int alphaOrder = key(col, ascending).compare(other->key(col, ascending)); int retval = 0; QString dbgPfx = "compare(type=" + QString::number((int)ourType) - + ", self=" + getText() + ", other=" + ulvi->getText() + + ", self=" + text() + ", other=" + ulvi->text() + "): return "; UMLObject *otherObj = ulvi->umlObject(); - if (m_object == NULL) { + if (m_object == 0) { retval = (subItem ? 1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (m_object==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (m_object==0)"; #endif return retval; } - if (otherObj == NULL) { + if (otherObj == 0) { retval = (subItem ? -1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (otherObj==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherObj==0)"; #endif return retval; } UMLClassifier *ourParent = dynamic_cast(m_object->parent()); UMLClassifier *otherParent = dynamic_cast(otherObj->parent()); - if (ourParent == NULL) { + if (ourParent == 0) { retval = (subItem ? 1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (ourParent==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (ourParent==0)"; #endif return retval; } - if (otherParent == NULL) { + if (otherParent == 0) { retval = (subItem ? -1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (otherParent==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherParent==0)"; #endif return retval; } if (ourParent != otherParent) { retval = (subItem ? 0 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (ourParent != otherParent)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (ourParent != otherParent)"; #endif return retval; } UMLClassifierListItem *thisUmlItem = dynamic_cast(m_object); UMLClassifierListItem *otherUmlItem = dynamic_cast(otherObj); - if (thisUmlItem == NULL) { + if (thisUmlItem == 0) { retval = (subItem ? 1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (thisUmlItem==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (thisUmlItem==0)"; #endif return retval; } - if (otherUmlItem == NULL) { + if (otherUmlItem == 0) { retval = (subItem ? -1 : alphaOrder); #ifdef DEBUG_LVITEM_INSERTION_ORDER - uDebug() << dbgPfx << retval << " because (otherUmlItem==NULL)"; + DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherUmlItem==0)"; #endif return retval; } @@ -767,15 +820,7 @@ } return (myIndex < otherIndex ? -1 : myIndex > otherIndex ? 1 : 0); } - -/** - * Returns the number of children of the UMLListViewItem - * containing this object - */ -int UMLListViewItem::childCount() const -{ - return m_nChildren; -} +#endif /** * Create a deep copy of this UMLListViewItem, but using the @@ -784,18 +829,17 @@ */ UMLListViewItem* UMLListViewItem::deepCopy(UMLListViewItem *newParent) { - QString nm = getText(); - UMLListViewItem::ListViewType t = type(); + QString nm = text(0); + ListViewType t = type(); UMLObject *o = umlObject(); UMLListViewItem* newItem; if (o) newItem = new UMLListViewItem(newParent, nm, t, o); else newItem = new UMLListViewItem(newParent, nm, t, m_id); - UMLListViewItem *childItem = static_cast(firstChild()); - while (childItem) { + for (int i=0; i < childCount(); i++) { + UMLListViewItem *childItem = static_cast(child(i)); childItem->deepCopy(newItem); - childItem = static_cast(childItem->nextSibling()); } return newItem; } @@ -809,14 +853,13 @@ { if (m_object == o) return this; - UMLListViewItem *childItem = static_cast(firstChild()); - while (childItem) { - UMLListViewItem *inner = childItem->findUMLObject(o); - if (inner) - return inner; - childItem = static_cast(childItem->nextSibling()); + for (int i = 0; i < childCount(); i++) { + UMLListViewItem *item = static_cast(child(i)); + UMLListViewItem *testItem = item->findUMLObject(o); + if (testItem) + return testItem; } - return NULL; + return 0; } /** @@ -831,7 +874,7 @@ if (it != m_comap.end()) { return *it; } - return NULL; + return 0; } /** @@ -844,16 +887,17 @@ */ UMLListViewItem * UMLListViewItem::findItem(Uml::IDType id) { - if (getID() == id) + if (getID() == id) { return this; - UMLListViewItem *childItem = static_cast(firstChild()); - while (childItem) { + } + for (int i = 0; i < childCount(); ++i) { + UMLListViewItem *childItem = static_cast(child(i)); UMLListViewItem *inner = childItem->findItem(id); - if (inner) + if (inner) { return inner; - childItem = static_cast(childItem->nextSibling()); + } } - return NULL; + return 0; } /** @@ -864,24 +908,24 @@ QDomElement itemElement = qDoc.createElement("listitem"); Uml::IDType id = getID(); QString idStr = ID2STR(id); - //uDebug() << "id = " << idStr << ", type = " << m_type; + //DEBUG(DBG_LVI) << "id = " << idStr << ", type = " << m_type; if (id != Uml::id_None) itemElement.setAttribute("id", idStr); itemElement.setAttribute("type", m_type); - UMLFolder *extFolder = NULL; - if (m_object == NULL) { - if (! Model_Utils::typeIsDiagram(m_type) && m_type != UMLListViewItem::lvt_View) - uError() << m_label << ": m_object is NULL"; - if (m_type != UMLListViewItem::lvt_View) - itemElement.setAttribute("label", m_label); + UMLFolder *extFolder = 0; + if (m_object == 0) { + if (! Model_Utils::typeIsDiagram(m_type) && m_type != lvt_View) + uError() << text(0) << ": m_object is NULL"; + if (m_type != lvt_View) + itemElement.setAttribute("label", text(0)); } else if (m_object->id() == Uml::id_None) { - if (m_label.isEmpty()) { - uDebug() << "Skipping empty item"; + if (text(0).isEmpty()) { + DEBUG(DBG_LVI) << "Skipping empty item"; return; } - uDebug() << "saving local label " << m_label << " because umlobject ID is not set"; - if (m_type != UMLListViewItem::lvt_View) - itemElement.setAttribute("label", m_label); + DEBUG(DBG_LVI) << "saving local label " << text(0) << " because umlobject ID is not set"; + if (m_type != lvt_View) + itemElement.setAttribute("label", text(0)); } else if (m_object->baseType() == UMLObject::ot_Folder) { extFolder = static_cast(m_object); if (!extFolder->folderFile().isEmpty()) { @@ -890,12 +934,11 @@ return; } } - itemElement.setAttribute("open", isOpen()); + itemElement.setAttribute("open", isExpanded()); QDomElement folderRoot; - UMLListViewItem *childItem = static_cast(firstChild()); - while (childItem) { + for (int i=0; i < childCount(); i++) { + UMLListViewItem *childItem = static_cast(child(i)); childItem->saveToXMI(qDoc, itemElement); - childItem = dynamic_cast(childItem->nextSibling()); } qElement.appendChild(itemElement); } @@ -916,14 +959,131 @@ return false; } - m_nChildren = qElement.childNodes().count(); - m_id = STR2ID(id); - if (m_id != Uml::id_None) - m_object = s_pListView->document()->findObjectById(m_id); - m_type = (UMLListViewItem::ListViewType)(type.toInt()); + if (m_id != Uml::id_None) { + UMLListView* listView = static_cast(treeWidget()); + m_object = listView->document()->findObjectById(m_id); + } + m_type = (ListViewType)(type.toInt()); if (m_object) updateObject(); setOpen((bool)open.toInt()); return true; } + +UMLListViewItem* UMLListViewItem::childItem(int i) +{ + return static_cast(child(i)); +} + +QString UMLListViewItem::toString(ListViewType type) +{ + switch (type) { + case lvt_View: + return "lvt_View"; + case lvt_Logical_View: + return "lvt_Logical_View"; + case lvt_UseCase_View: + return "lvt_UseCase_View"; + case lvt_Logical_Folder: + return "lvt_Logical_Folder"; + case lvt_UseCase_Folder: + return "lvt_UseCase_Folder"; + case lvt_UseCase_Diagram: + return "lvt_UseCase_Diagram"; + case lvt_Collaboration_Diagram: + return "lvt_Collaboration_Diagram"; + case lvt_Class_Diagram: + return "lvt_Class_Diagram"; + case lvt_State_Diagram: + return "lvt_State_Diagram"; + case lvt_Activity_Diagram: + return "lvt_Activity_Diagram"; + case lvt_Sequence_Diagram: + return "lvt_Sequence_Diagram"; + case lvt_Actor: + return "lvt_Actor"; + case lvt_UseCase: + return "lvt_UseCase"; + case lvt_Class: + return "lvt_Class"; + case lvt_Attribute: + return "lvt_Attribute"; + case lvt_Operation: + return "lvt_Operation"; + case lvt_Template: + return "lvt_Template"; + case lvt_Interface: + return "lvt_Interface"; + case lvt_Package: + return "lvt_Package"; + case lvt_Component_Diagram: + return "lvt_Component_Diagram"; + case lvt_Component_Folder: + return "lvt_Component_Folder"; + case lvt_Component_View: + return "lvt_Component_View"; + case lvt_Component: + return "lvt_Component"; + case lvt_Diagrams: + return "lvt_Diagrams"; + case lvt_Artifact: + return "lvt_Artifact"; + case lvt_Deployment_Diagram: + return "lvt_Deployment_Diagram"; + case lvt_Deployment_Folder: + return "lvt_Deployment_Folder"; + case lvt_Deployment_View: + return "lvt_Deployment_View"; + case lvt_Node: + return "lvt_Node"; + case lvt_Datatype: + return "lvt_Datatype"; + case lvt_Datatype_Folder: + return "lvt_Datatype_Folder"; + case lvt_Enum: + return "lvt_Enum"; + case lvt_Entity: + return "lvt_Entity"; + case lvt_EntityAttribute: + return "lvt_EntityAttribute"; + case lvt_EntityRelationship_Diagram: + return "lvt_EntityRelationship_Diagram"; + case lvt_EntityRelationship_Folder: + return "lvt_EntityRelationship_Folder"; + case lvt_EntityRelationship_Model: + return "lvt_EntityRelationship_Model"; + case lvt_Subsystem: + return "lvt_Subsystem"; + case lvt_Model: + return "lvt_Model"; + case lvt_EnumLiteral: + return "lvt_EnumLiteral"; + case lvt_UniqueConstraint: + return "lvt_UniqueConstraint"; + case lvt_PrimaryKeyConstraint: + return "lvt_PrimaryKeyConstraint"; + case lvt_ForeignKeyConstraint: + return "lvt_ForeignKeyConstraint"; + case lvt_CheckConstraint: + return "lvt_CheckConstraint"; + case lvt_Category: + return "lvt_Category"; + case lvt_Unknown: + return "lvt_Unknown"; + default: + return "? ListViewType ?"; + } +} + +/** + * Overloading operator for debugging output. + */ +QDebug operator<<(QDebug out, const UMLListViewItem& item) +{ + out.nospace() << "UMLListViewItem: " << item.text(0) + << ", type=" << UMLListViewItem::toString(item.type()) + << ", id=" << ID2STR(item.getID()) + << ", children=" << item.childCount(); + return out.space(); +} diff -Nru kdesdk-4.7.90/umbrello/umbrello/umllistviewitem.h kdesdk-4.7.95/umbrello/umbrello/umllistviewitem.h --- kdesdk-4.7.90/umbrello/umbrello/umllistviewitem.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umllistviewitem.h 2011-12-20 21:00:11.000000000 +0000 @@ -11,7 +11,7 @@ #ifndef UMLLISTVIEWITEM_H #define UMLLISTVIEWITEM_H -#include +#include #include #include #include @@ -24,6 +24,8 @@ class UMLObject; class UMLClassifierListItem; +typedef QTreeWidgetItemIterator UMLListViewItemIterator; + /** * Items used by the class @ref UMLListView. This is needed as the type * and object information is required to be stored. @@ -33,7 +35,7 @@ * @see UMLListView * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class UMLListViewItem : public Q3ListViewItem +class UMLListViewItem : public QTreeWidgetItem { public: enum ListViewType @@ -111,25 +113,26 @@ void updateObject(); void updateFolder(); - void setOpen( bool open ); - void setText(int column, const QString &text); void setText(const QString &text ); QString getText() const; + void setVisible(bool state); + + QString toolTip(); void setCreating(bool creating); void setIcon(Icon_Utils::IconType iconType); - void cancelRename( int col ); + void startRename(int col); + void cancelRename(int col); + void okRename(int col); void addClassifierListItem(UMLClassifierListItem *child, UMLListViewItem *childItem); void deleteChildItem(UMLClassifierListItem *child); - virtual int compare(Q3ListViewItem *other, int col, bool ascending) const; - - int childCount() const; + //virtual int compare(UMLListViewItem *other, int col, bool ascending) const; UMLListViewItem* deepCopy(UMLListViewItem *newParent); @@ -137,20 +140,20 @@ UMLListViewItem* findChildObject(UMLClassifierListItem *cli); UMLListViewItem* findItem(Uml::IDType id); - void saveToXMI( QDomDocument& qDoc, QDomElement& qElement); + UMLListViewItem* childItem(int i); + + void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); bool loadFromXMI(QDomElement& qElement); -protected: - void init(UMLListView * parent = 0); + bool isOpen() { return isExpanded(); } + void setOpen(bool state); - void okRename( int col ); + friend QDebug operator<<(QDebug out, const UMLListViewItem& item); - void cancelRenameWithMsg(); +protected: + void init(); - /** - * This list view all the instance of this class are displayed on. - */ - static UMLListView * s_pListView; + void cancelRenameWithMsg(); /** * Auxiliary map of child UMLLisViewItems keyed by UMLClassifierListItem. @@ -163,11 +166,9 @@ bool m_bCreating; ///< flag to set the state of creating ListViewType m_type; Uml::IDType m_id; - int m_nChildren; UMLObject * m_object; QString m_label; ChildObjectMap m_comap; - }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlobject.cpp kdesdk-4.7.95/umbrello/umbrello/umlobject.cpp --- kdesdk-4.7.90/umbrello/umbrello/umlobject.cpp 2011-10-11 14:51:51.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlobject.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -116,7 +116,7 @@ * @param assoc Whether to show association page. * @return True if we modified the object. */ -bool UMLObject::showProperties(int page, bool assoc) +bool UMLObject::showPropertiesPagedDialog(int page, bool assoc) { Q_UNUSED(page); DocWindow *docwindow = UMLApp::app()->docWindow(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlobject.h kdesdk-4.7.95/umbrello/umbrello/umlobject.h --- kdesdk-4.7.90/umbrello/umbrello/umlobject.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlobject.h 2011-12-20 21:00:11.000000000 +0000 @@ -128,7 +128,8 @@ void setInPaste(bool bInPaste = true); - virtual bool showProperties(int page = 0, bool assoc = false); + // FIXME: merge with showPropertiesDialog() + virtual bool showPropertiesPagedDialog(int page = 0, bool assoc = false); virtual bool resolveRef(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlscene.h kdesdk-4.7.95/umbrello/umbrello/umlscene.h --- kdesdk-4.7.90/umbrello/umbrello/umlscene.h 1970-01-01 00:00:00.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlscene.h 2011-12-20 21:00:11.000000000 +0000 @@ -0,0 +1,60 @@ +/*************************************************************************** + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * copyright (C) 2002-2011 * + * Umbrello UML Modeller Authors * + ***************************************************************************/ +#ifndef UMLSCENE_H +#define UMLSCENE_H + +#include "umlview.h" + +#include +#include + +/** + * UMLScene instances represent diagrams. + * The UMLScene class inherits from UMLView yet and + * in the future from QGraphicsScene. + */ +class UMLScene : public UMLView +{ +public: + UMLScene(UMLFolder *parentFolder) : UMLView(parentFolder) {} +}; + +/// uml related types - makes it easier to switch to QGraphicsScene types +// base types +typedef QPoint UMLScenePoint; +// event types +typedef QKeyEvent UMLSceneKeyEvent; +typedef QKeyEvent UMLSceneKeyEvent; +typedef QHoverEvent UMLSceneHoverEvent; +typedef QContextMenuEvent UMLSceneContextMenuEvent; +//typedef QDragDropEvent UMLSceneDragDropEvent; + +typedef Q3CanvasLine UMLSceneLine; +typedef Q3CanvasRectangle UMLSceneRectangle; +typedef Q3CanvasItem UMLSceneItem; +typedef Q3CanvasPolygon UMLScenePolygon; +typedef Q3CanvasEllipse UMLSceneEllipse; +typedef Q3CanvasItemList UMLSceneItemList; + +/** + qt3 migration wrapper for QMouseEvent +*/ +class UMLSceneMouseEvent : public QMouseEvent +{ +public: + UMLSceneMouseEvent(Type type, const QPoint & position, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) + : QMouseEvent(type, position, button, buttons, modifiers) + { + } + + UMLScenePoint scenePos() { return pos(); } +}; + +#endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewcanvas.cpp kdesdk-4.7.95/umbrello/umbrello/umlviewcanvas.cpp --- kdesdk-4.7.90/umbrello/umbrello/umlviewcanvas.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewcanvas.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -57,7 +57,7 @@ void UMLViewCanvas::drawBackground(QPainter & painter, const QRect & clip) { Q_UNUSED(clip); -//? Q3Canvas::drawBackground( painter, clip ); +//? UMLViewCanvas::drawBackground( painter, clip ); if( m_pView->getShowSnapGrid() ) { painter.setPen( m_gridColor ); int gridX = m_pView->getSnapX(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewcanvas.h kdesdk-4.7.95/umbrello/umbrello/umlviewcanvas.h --- kdesdk-4.7.90/umbrello/umbrello/umlviewcanvas.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewcanvas.h 2011-12-20 21:00:10.000000000 +0000 @@ -11,8 +11,9 @@ #ifndef UMLVIEWCANVAS_H #define UMLVIEWCANVAS_H -#include #include "optionstate.h" +#include + /** *@author Paul Hensgen diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlview.cpp kdesdk-4.7.95/umbrello/umbrello/umlview.cpp --- kdesdk-4.7.90/umbrello/umbrello/umlview.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlview.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -131,6 +131,7 @@ m_nCanvasWidth = UMLView::defaultCanvasSize; m_nCanvasHeight = UMLView::defaultCanvasSize; m_nCollaborationId = 0; + m_scene = reinterpret_cast(this); // Initialize other data //m_AssociationList.setAutoDelete( true ); @@ -150,7 +151,7 @@ m_pIDChangesLog = 0; m_pMenu = 0; - m_pImageExporter = new UMLViewImageExporter(this); + m_pImageExporter = new UMLViewImageExporter(m_scene); //setup graphical items setCanvas(new UMLViewCanvas(this,m_Options)); @@ -177,7 +178,7 @@ // Create the ToolBarState factory. This class is not a singleton, because it // needs a pointer to this object. m_pToolBarStateFactory = new ToolBarStateFactory(); - m_pToolBarState = m_pToolBarStateFactory->getState(WorkToolBar::tbb_Arrow, this); + m_pToolBarState = m_pToolBarStateFactory->getState(WorkToolBar::tbb_Arrow, m_scene); m_pDoc = UMLApp::app()->document(); m_pFolder = parentFolder; @@ -413,18 +414,18 @@ m_WidgetList.append(w); m_pDoc->setModified(); - UMLApp::app()->executeCommand(new CmdCreateWidget(this, w)); + UMLApp::app()->executeCommand(new CmdCreateWidget(umlScene(), w)); } void UMLView::contentsMouseReleaseEvent(QMouseEvent* ome) { - m_pToolBarState->mouseRelease(ome); + m_pToolBarState->mouseRelease(static_cast(ome)); } void UMLView::slotToolBarChanged(int c) { m_pToolBarState->cleanBeforeChange(); - m_pToolBarState = m_pToolBarStateFactory->getState((WorkToolBar::ToolBar_Buttons)c, this); + m_pToolBarState = m_pToolBarStateFactory->getState((WorkToolBar::ToolBar_Buttons)c, m_scene); m_pToolBarState->init(); m_bPaste = false; @@ -489,7 +490,7 @@ return; } - UMLWidget* newWidget = Widget_Factory::createWidget(this, o); + UMLWidget* newWidget = Widget_Factory::createWidget(umlScene(), o); if (newWidget == NULL) return; @@ -797,7 +798,7 @@ void UMLView::contentsMouseMoveEvent(QMouseEvent* ome) { - m_pToolBarState->mouseMove(ome); + m_pToolBarState->mouseMove(static_cast(ome)); } // search both our UMLWidget AND MessageWidget lists @@ -939,7 +940,7 @@ void UMLView::contentsMouseDoubleClickEvent(QMouseEvent* ome) { - m_pToolBarState->mouseDoubleClick(ome); + m_pToolBarState->mouseDoubleClick(static_cast(ome)); } QRect UMLView::getDiagramRect() @@ -1239,7 +1240,7 @@ void UMLView::contentsMousePressEvent(QMouseEvent* ome) { - m_pToolBarState->mousePress(ome); + m_pToolBarState->mousePress(static_cast(ome)); //TODO should be managed by widgets when are selected. Right now also has some //problems, such as clicking on a widget, and clicking to move that widget shows //documentation of the diagram instead of keeping the widget documentation. @@ -2050,7 +2051,7 @@ if (newParentWidget == NULL) return; // Create the new containment association. - AssociationWidget *a = new AssociationWidget(this, newParentWidget, + AssociationWidget *a = new AssociationWidget(umlScene(), newParentWidget, Uml::AssociationType::Containment, selfWidget); a->calculateEndingPoints(); a->setActivated(true); @@ -2162,7 +2163,7 @@ continue; } // Create the AssociationWidget. - assocwidget = new AssociationWidget(this); + assocwidget = new AssociationWidget(umlScene()); assocwidget->setWidget(widgetA, A); assocwidget->setWidget(widgetB, B); assocwidget->setAssociationType(assocType); @@ -2199,7 +2200,7 @@ if (widget->rect().contains(w->rect())) continue; // create the containment AssocWidget - AssociationWidget *a = new AssociationWidget(this, widget, + AssociationWidget *a = new AssociationWidget(umlScene(), widget, Uml::AssociationType::Containment, w); a->calculateEndingPoints(); a->setActivated(true); @@ -2226,7 +2227,7 @@ if (!breakFlag || pWidget->rect().contains(widget->rect())) return; // create the containment AssocWidget - AssociationWidget *a = new AssociationWidget(this, pWidget, Uml::AssociationType::Containment, widget); + AssociationWidget *a = new AssociationWidget(umlScene(), pWidget, Uml::AssociationType::Containment, widget); a->calculateEndingPoints(); a->setActivated(true); if (! addAssociation(a)) @@ -2318,7 +2319,7 @@ // stereotyped <>, create a UniAssociation widget. if (type->stereotype() == "CORBAInterface") assocType = Uml::AssociationType::UniAssociation; - AssociationWidget *a = new AssociationWidget(this, widget, assocType, w, attr); + AssociationWidget *a = new AssociationWidget(umlScene(), widget, assocType, w, attr); a->calculateEndingPoints(); a->setVisibility(attr->visibility(), B); /* @@ -2348,7 +2349,7 @@ // create an aggregation AssocWidget from the ClassifierWidget // to the widget of the referenced type AssociationWidget *a = new AssociationWidget - (this, widget, Uml::AssociationType::Aggregation, w, attr); + (umlScene(), widget, Uml::AssociationType::Aggregation, w, attr); a->calculateEndingPoints(); a->setVisibility(attr->visibility(), B); //a->setChangeability(true, B); @@ -2430,7 +2431,7 @@ // for foreign key contstraint, we need to create the association type Uml::AssociationType::Relationship. // The referenced entity is the "1" part (Role A) and the entity holding the relationship is the "many" part. ( Role B) - AssociationWidget *a = new AssociationWidget(this, w, assocType, widget); + AssociationWidget *a = new AssociationWidget(umlScene(), w, assocType, widget); a->setUMLObject(fkConstraint); a->calculateEndingPoints(); //a->setVisibility(attr->getVisibility(), B); @@ -2623,7 +2624,7 @@ break; case ListPopupMenu::mt_FloatText: { - FloatingTextWidget* ft = new FloatingTextWidget(this); + FloatingTextWidget* ft = new FloatingTextWidget(umlScene()); ft->showChangeTextDialog(); //if no text entered delete if (!FloatingTextWidget::isTextValid(ft->text())) { @@ -2721,13 +2722,13 @@ break; case ListPopupMenu::mt_Initial_State: { - StateWidget* state = new StateWidget(this, StateWidget::Initial); + StateWidget* state = new StateWidget(umlScene(), StateWidget::Initial); setupNewWidget(state); } break; case ListPopupMenu::mt_End_State: { - StateWidget* state = new StateWidget(this, StateWidget::End); + StateWidget* state = new StateWidget(umlScene(), StateWidget::End); setupNewWidget(state); } break; @@ -2738,7 +2739,7 @@ i18n("Enter the name of the new state:"), i18n("new state"), &ok, UMLApp::app()); if (ok) { - StateWidget* state = new StateWidget(this); + StateWidget* state = new StateWidget(umlScene()); state->setName(name); setupNewWidget(state); } @@ -2746,20 +2747,20 @@ break; case ListPopupMenu::mt_Initial_Activity: { - ActivityWidget* activity = new ActivityWidget(this, ActivityWidget::Initial); + ActivityWidget* activity = new ActivityWidget(umlScene(), ActivityWidget::Initial); setupNewWidget(activity); } break; case ListPopupMenu::mt_End_Activity: { - ActivityWidget* activity = new ActivityWidget(this, ActivityWidget::End); + ActivityWidget* activity = new ActivityWidget(umlScene(), ActivityWidget::End); setupNewWidget(activity); } break; case ListPopupMenu::mt_Branch: { - ActivityWidget* activity = new ActivityWidget(this, ActivityWidget::Branch); + ActivityWidget* activity = new ActivityWidget(umlScene(), ActivityWidget::Branch); setupNewWidget(activity); } break; @@ -2770,7 +2771,7 @@ i18n("Enter the name of the new activity:"), i18n("new activity"), &ok, UMLApp::app()); if (ok) { - ActivityWidget* activity = new ActivityWidget(this, ActivityWidget::Normal); + ActivityWidget* activity = new ActivityWidget(umlScene(), ActivityWidget::Normal); activity->setName(name); setupNewWidget(activity); } @@ -3411,7 +3412,7 @@ QString tag = widgetElement.tagName(); QString idstr = widgetElement.attribute("xmi.id", "-1"); - UMLWidget* widget = Widget_Factory::makeWidgetFromXMI(tag, idstr, this); + UMLWidget* widget = Widget_Factory::makeWidgetFromXMI(tag, idstr, umlScene()); if (widget == NULL) return NULL; @@ -3432,7 +3433,7 @@ QString tag = messageElement.tagName(); if (tag == "messagewidget" || tag == "UML:MessageWidget") { // for bkwd compatibility - message = new MessageWidget(this, sequence_message_asynchronous, + message = new MessageWidget(umlScene(), sequence_message_asynchronous, Uml::id_Reserved); if (!message->loadFromXMI(messageElement)) { delete message; @@ -3461,7 +3462,7 @@ if (tag == "assocwidget" || tag == "UML:AssocWidget") { // for bkwd compatibility countr++; - AssociationWidget *assoc = new AssociationWidget(this); + AssociationWidget *assoc = new AssociationWidget(umlScene()); if (!assoc->loadFromXMI(assocElement)) { uError() << "could not loadFromXMI association widget:" << assoc << ", bad XMI file? Deleting from umlview."; @@ -3541,7 +3542,7 @@ UMLWidget *widget = NULL; switch (ot) { case UMLObject::ot_Class: - widget = new ClassifierWidget(this, static_cast(o)); + widget = new ClassifierWidget(umlScene(), static_cast(o)); break; case UMLObject::ot_Association: { UMLAssociation *umla = static_cast(o); @@ -3556,7 +3557,7 @@ UMLWidget *wB = findWidget(objB->id()); if (wA != NULL && wB != NULL) { AssociationWidget *aw = - new AssociationWidget(this, wA, at, wB, umla); + new AssociationWidget(umlScene(), wA, at, wB, umla); aw->syncToModel(); m_AssociationList.append(aw); } else { diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlview.h kdesdk-4.7.95/umbrello/umbrello/umlview.h --- kdesdk-4.7.90/umbrello/umbrello/umlview.h 2011-09-26 11:24:06.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlview.h 2011-12-20 21:00:11.000000000 +0000 @@ -14,7 +14,7 @@ // system includes #include #include -#include +#include #include //local includes @@ -50,6 +50,7 @@ class QMouseEvent; class QPrinter; class QShowEvent; +class UMLScene; /** * UMLView instances represent diagrams. @@ -76,8 +77,8 @@ * TODO: Check if we should pass an UMLScene instead of an UMLView * at places where we see "view->umlScene()->doSomething()". */ - UMLView* umlScene() { - return this; + UMLScene* umlScene() { + return m_scene; } // Accessors and other methods dealing with loaded/saved data @@ -1157,6 +1158,10 @@ /** * The folder in which this UMLView is contained */ + UMLScene *m_scene; + /** + * The folder in which this UMLView is contained + */ UMLFolder *m_pFolder; /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewimageexporter.cpp kdesdk-4.7.95/umbrello/umbrello/umlviewimageexporter.cpp --- kdesdk-4.7.90/umbrello/umbrello/umlviewimageexporter.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewimageexporter.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -15,7 +15,7 @@ #include "umlviewimageexportermodel.h" #include "uml.h" #include "umldoc.h" -#include "umlview.h" +#include "umlscene.h" //kde include files #include @@ -32,9 +32,9 @@ /** * Constructor for UMLViewImageExporter. */ -UMLViewImageExporter::UMLViewImageExporter(UMLView* view) +UMLViewImageExporter::UMLViewImageExporter(UMLScene* scene) { - m_view = view; + m_scene = scene; m_imageMimeType = UMLApp::app()->imageMimeType(); } @@ -69,7 +69,7 @@ // export the view app->document()->writeToStatusBar(i18n("Exporting view...")); - QString error = UMLViewImageExporterModel().exportView(m_view, + QString error = UMLViewImageExporterModel().exportView(m_scene, UMLViewImageExporterModel::mimeTypeToImageType(m_imageMimeType), m_imageURL); if (!error.isNull()) { KMessageBox::error(app, i18n("An error happened when exporting the image:\n") + error); @@ -125,7 +125,7 @@ // configure & show the file dialog KUrl url; - QPointer dialog = new KFileDialog(url, QString(), m_view); + QPointer dialog = new KFileDialog(url, QString(), UMLApp::app()); prepareFileDialog(dialog); dialog->exec(); @@ -133,7 +133,7 @@ success = false; } else { - m_view->clearSelected(); // Thanks to Peter Soetens for the idea + m_scene->clearSelected(); // Thanks to Peter Soetens for the idea // update image url and mime type m_imageMimeType = dialog->currentMimeFilter(); @@ -174,7 +174,7 @@ directory.setPath(docURL.directory()); fileDialog->setUrl(directory); - fileDialog->setSelection(m_view->name() + '.' + UMLViewImageExporterModel::mimeTypeToImageType(m_imageMimeType)); + fileDialog->setSelection(m_scene->name() + '.' + UMLViewImageExporterModel::mimeTypeToImageType(m_imageMimeType)); } else { fileDialog->setUrl(m_imageURL); fileDialog->setSelection(m_imageURL.fileName()); diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewimageexporter.h kdesdk-4.7.95/umbrello/umbrello/umlviewimageexporter.h --- kdesdk-4.7.90/umbrello/umbrello/umlviewimageexporter.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewimageexporter.h 2011-12-20 21:00:11.000000000 +0000 @@ -14,19 +14,19 @@ #include #include -class UMLView; +class UMLScene; class KFileDialog; /** - * Exports the view as an image. + * Exports the scene as an image. * This class takes care of asking the user the needed parameters and - * then exports the view. + * then exports the scene. */ class UMLViewImageExporter { public: - UMLViewImageExporter(UMLView* view); + UMLViewImageExporter(UMLScene* scene); virtual ~UMLViewImageExporter(); void exportView(); @@ -36,7 +36,7 @@ private: - UMLView* m_view; ///< The view to export. + UMLScene* m_scene; ///< The scene to export. KUrl m_imageURL; ///< The URL used to save the image. QString m_imageMimeType; ///< The mime type used to save the image. diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewimageexportermodel.cpp kdesdk-4.7.95/umbrello/umbrello/umlviewimageexportermodel.cpp --- kdesdk-4.7.90/umbrello/umbrello/umlviewimageexportermodel.cpp 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewimageexportermodel.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -37,6 +37,7 @@ #include "uml.h" #include "umldoc.h" #include "umlview.h" +#include "umlscene.h" #define DBG_IEM "UMLViewImageExporterModel" @@ -184,11 +185,12 @@ UMLViewList views = app->document()->viewIterator(); foreach (UMLView *view , views ) { KUrl url = directory; - url.addPath(getDiagramFileName(view, imageType, useFolders)); + url.addPath(getDiagramFileName(view->umlScene(), imageType, useFolders)); - QString returnString = exportView(view, imageType, url); + QString returnString = exportView(view->umlScene(), imageType, url); if (!returnString.isNull()) { - errors.append(view->name() + ": " + returnString); + // [PORT] + errors.append(view->umlScene()->name() + ": " + returnString); } } @@ -210,8 +212,12 @@ * @return The message error if some problem occurred when exporting, or * QString() if all went fine. */ -QString UMLViewImageExporterModel::exportView(UMLView* view, const QString &imageType, const KUrl &url) const +QString UMLViewImageExporterModel::exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const { + if (!scene) { + return i18n("Empty scene"); + } + // create the needed directories if (!prepareDirectory(url)) { return i18n("Can not create directory: %1", url.directory()); @@ -229,14 +235,13 @@ fileName = tmpFile.fileName(); } - // check that the diagram isn't empty - QRect rect = view->getDiagramRect(); + QRectF rect = scene->getDiagramRect(); if (rect.isEmpty()) { return i18n("Can not save an empty diagram"); } // exporting the view to the file - if (!exportViewTo(view, imageType, fileName)) { + if (!exportViewTo(scene, imageType, fileName)) { return i18n("A problem occurred while saving diagram in %1", fileName); } @@ -252,19 +257,25 @@ /** * Returns the diagram file name. - * @param view the diagram + * @param scene the diagram * @param imageType the image type as file name extension * @param useFolders flag whether to add folder to the file name * @return the file name with extension */ -QString UMLViewImageExporterModel::getDiagramFileName(UMLView *view, const QString &imageType, bool useFolders /* = false */) const +QString UMLViewImageExporterModel::getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders /* = false */) const { + if (scene) { if (useFolders) { qApp->processEvents(); //:TODO: still needed ??? - return Model_Utils::treeViewBuildDiagramName(view->getID()); + return Model_Utils::treeViewBuildDiagramName(scene->getID()); + } + else { + return scene->name() + '.' + imageType.toLower();; + } } else { - return view->name() + '.' + imageType.toLower(); + uWarning() << "Scene is null!"; + return QString(); } } @@ -299,30 +310,35 @@ } /** - * Exports the view to the file 'fileName' as the specified type. + * Exports the scene to the file 'fileName' as the specified type. * - * @param view The view to export. - * @param imageType The type of the image the view will be exported to. + * @param scene The scene to export. + * @param imageType The type of the image the scene will be exported to. * @param fileName The name of the file where the image will be saved. * @return True if the operation was successful, * false if a problem occurred while exporting. */ -bool UMLViewImageExporterModel::exportViewTo(UMLView* view, const QString &imageType, const QString &fileName) const +bool UMLViewImageExporterModel::exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const { + if (!scene) { + uWarning() << "Scene is null!"; + return false; + } + // remove 'blue squares' from exported picture. - view->clearSelected(); + scene->clearSelected(); QString imageMimeType = UMLViewImageExporterModel::imageTypeToMimeType(imageType); if (imageMimeType == "image/x-eps") { - if (!exportViewToEps(view, fileName, true)) { + if (!exportViewToEps(scene, fileName, true)) { return false; } } else if (imageMimeType == "image/svg+xml") { - if (!exportViewToSvg(view, fileName)) { + if (!exportViewToSvg(scene, fileName)) { return false; } } else { - if (!exportViewToPixmap(view, imageType, fileName)) { + if (!exportViewToPixmap(scene, imageType, fileName)) { return false; } } @@ -333,15 +349,20 @@ /** * Exports the view to the file 'fileName' as EPS. * - * @param view The view to export. + * @param scene The scene to export. * @param fileName The name of the file where the image will be saved. * @param isEPS The file is an eps file and needs adjusting * of the eps bounding box values. * @return True if the operation was successful, * false if a problem occurred while exporting. */ -bool UMLViewImageExporterModel::exportViewToEps(UMLView* view, const QString &fileName, bool isEPS) const +bool UMLViewImageExporterModel::exportViewToEps(UMLScene* scene, const QString &fileName, bool isEPS) const { + if (!scene) { + uWarning() << "Scene is null!"; + return false; + } + bool exportSuccessful = true; // print the image to a normal postscript file, @@ -369,11 +390,11 @@ // make sure the widget sizes will be according to the // actually used printer font, important for getDiagramRect() // and the actual painting - view->forceUpdateWidgetFontMetrics(painter); + scene->forceUpdateWidgetFontMetrics(painter); - QRect rect = view->getDiagramRect(); + QRect rect = scene->getDiagramRect(); painter->translate(-rect.x(), -rect.y()); - view->getDiagram(rect, *painter); + scene->getDiagram(rect, *painter); int resolution = printer->resolution(); @@ -387,7 +408,7 @@ exportSuccessful = fixEPS(fileName, rect); } // next painting will most probably be to a different device (i.e. the screen) - view->forceUpdateWidgetFontMetrics(0); + scene->forceUpdateWidgetFontMetrics(0); return exportSuccessful; } @@ -448,16 +469,20 @@ /** * Exports the view to the file 'fileName' as SVG. * - * @param view The view to export. + * @param scene The scene to export. * @param fileName The name of the file where the image will be saved. * @return True if the operation was successful, * false if a problem occurred while exporting. */ -bool UMLViewImageExporterModel::exportViewToSvg(UMLView* view, const QString &fileName) const +bool UMLViewImageExporterModel::exportViewToSvg(UMLScene* scene, const QString &fileName) const { + if (!scene) { + uWarning() << "Scene is null!"; + return false; + } + bool exportSuccessful; - QRect rect = view->getDiagramRect(); - DEBUG(DBG_IEM) << rect; + QRect rect = scene->getDiagramRect(); QSvgGenerator generator; generator.setFileName(fileName); @@ -468,17 +493,17 @@ // make sure the widget sizes will be according to the // actually used printer font, important for getDiagramRect() // and the actual painting - view->forceUpdateWidgetFontMetrics(&painter); + scene->forceUpdateWidgetFontMetrics(&painter); painter.translate(-rect.x(),-rect.y()); - view->getDiagram(rect, painter); + scene->getDiagram(rect, painter); painter.end(); //FIXME: Determine the status of svg generation. exportSuccessful = true; // next painting will most probably be to a different device (i.e. the screen) - view->forceUpdateWidgetFontMetrics(0); + scene->forceUpdateWidgetFontMetrics(0); DEBUG(DBG_IEM) << "saving to file " << fileName << " successful=" << exportSuccessful; return exportSuccessful; @@ -488,18 +513,23 @@ * Exports the view to the file 'fileName' as a pixmap of the specified type. * The valid types are those supported by QPixmap save method. * - * @param view The view to export. + * @param scene The scene to export. * @param imageType The type of the image the view will be exported to. * @param fileName The name of the file where the image will be saved. * @return True if the operation was successful, * false if a problem occurred while exporting. */ -bool UMLViewImageExporterModel::exportViewToPixmap(UMLView* view, const QString &imageType, const QString &fileName) const +bool UMLViewImageExporterModel::exportViewToPixmap(UMLScene* scene, const QString &imageType, const QString &fileName) const { + if (!scene) { + uWarning() << "Scene is null!"; + return false; + } + bool exportSuccessful; - QRect rect = view->getDiagramRect(); + QRect rect = scene->getDiagramRect(); QPixmap diagram(rect.width(), rect.height()); - view->getDiagram(rect, diagram); + scene->getDiagram(rect, diagram); exportSuccessful = diagram.save(fileName, qPrintable(imageType.toUpper())); DEBUG(DBG_IEM) << "saving to file " << fileName << " , imageType=" << imageType << " successful=" << exportSuccessful; diff -Nru kdesdk-4.7.90/umbrello/umbrello/umlviewimageexportermodel.h kdesdk-4.7.95/umbrello/umbrello/umlviewimageexportermodel.h --- kdesdk-4.7.90/umbrello/umbrello/umlviewimageexportermodel.h 2011-07-27 18:25:26.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/umlviewimageexportermodel.h 2011-12-20 21:00:11.000000000 +0000 @@ -15,7 +15,7 @@ #include // forward declarations -class UMLView; +class UMLScene; class KUrl; /** @@ -42,18 +42,18 @@ virtual ~UMLViewImageExporterModel(); QStringList exportAllViews(const QString &imageType, const KUrl &directory, bool useFolders) const; - QString exportView(UMLView* view, const QString &imageType, const KUrl &url) const; + QString exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const; private: - QString getDiagramFileName(UMLView *view, const QString &imageType, bool useFolders = false) const; + QString getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders = false) const; bool prepareDirectory(const KUrl &url) const; - bool exportViewTo(UMLView* view, const QString &imageType, const QString &fileName) const; - bool exportViewToSvg(UMLView* view, const QString &fileName) const; - bool exportViewToPixmap(UMLView* view, const QString &imageType, const QString &fileName) const; - bool exportViewToEps(UMLView* view, const QString &fileName, bool isEPS) const; + bool exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const; + bool exportViewToSvg(UMLScene* scene, const QString &fileName) const; + bool exportViewToPixmap(UMLScene* scene, const QString &imageType, const QString &fileName) const; + bool exportViewToEps(UMLScene* scene, const QString &fileName, bool isEPS) const; bool fixEPS(const QString &fileName, const QRect& rect) const; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/activitywidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/activitywidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/activitywidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/activitywidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -11,36 +12,153 @@ // own header #include "activitywidget.h" -// qt includes -#include -#include -#include - -// kde includes -#include -#include - // app includes +#include "activitydialog.h" +#include "debug_utils.h" +#include "docwindow.h" +#include "listpopupmenu.h" #include "uml.h" #include "umldoc.h" -#include "docwindow.h" +#include "umlscene.h" #include "umlview.h" -#include "listpopupmenu.h" -#include "dialogs/activitydialog.h" -ActivityWidget::ActivityWidget(UMLView * view, ActivityType activityType, Uml::IDType id ) - : UMLWidget(view, id) +// kde includes +#include +#include + +/** + * Creates a Activity widget. + * + * @param scene The parent of the widget. + * @param activityType The type of activity. + * @param id The ID to assign (-1 will prompt a new ID.) + */ +ActivityWidget::ActivityWidget(UMLScene * scene, ActivityType activityType, Uml::IDType id ) + : UMLWidget(scene, id), + m_activityType(activityType) { UMLWidget::setBaseType( WidgetBase::wt_Activity ); - setActivityType( activityType ); updateComponentSize(); } +/** + * destructor + */ ActivityWidget::~ActivityWidget() { } -void ActivityWidget::draw(QPainter & p, int offsetX, int offsetY) +/** + * Returns the type of activity. + */ +ActivityWidget::ActivityType ActivityWidget::activityType() const +{ + return m_activityType; +} + +/** + * Sets the type of activity. + */ +void ActivityWidget::setActivityType( ActivityType activityType ) +{ + m_activityType = activityType; + updateComponentSize(); + UMLWidget::m_resizable = true; +} + +/** + * Determines whether a toolbar button represents an Activity. + * CHECK: currently unused - can this be removed? + * + * @param tbb The toolbar button enum input value. + * @param resultType The ActivityType corresponding to tbb. + * This is only set if tbb is an Activity. + * @return True if tbb represents an Activity. + */ +bool ActivityWidget::isActivity(WorkToolBar::ToolBar_Buttons tbb, + ActivityType& resultType) +{ + bool status = true; + switch (tbb) { + case WorkToolBar::tbb_Initial_Activity: + resultType = Initial; + break; + case WorkToolBar::tbb_Activity: + resultType = Normal; + break; + case WorkToolBar::tbb_End_Activity: + resultType = End; + break; + case WorkToolBar::tbb_Final_Activity: + resultType = Final; + break; + case WorkToolBar::tbb_Branch: + resultType = Branch; + break; + default: + status = false; + break; + } + return status; +} + +/** + * This method get the name of the preText attribute + */ +QString ActivityWidget::preconditionText() +{ + return m_preconditionText; +} + +/** + * This method set the name of the preText attribute + */ +void ActivityWidget::setPreconditionText(const QString& aPreText) +{ + m_preconditionText = aPreText; + updateComponentSize(); + adjustAssocs( getX(), getY() ); +} + +/** + * This method get the name of the postText attribute + */ +QString ActivityWidget::postconditionText() +{ + return m_postconditionText ; +} + + /** + * This method set the name of the postText attribute + */ +void ActivityWidget::setPostconditionText(const QString& aPostText) +{ + m_postconditionText = aPostText; + updateComponentSize(); + adjustAssocs( getX(), getY() ); +} + +/** + * Reimplemented from UMLWidget::showPropertiesDialog to show a + * properties dialog for an ActivityWidget. + */ +void ActivityWidget::showPropertiesDialog() +{ + DocWindow *docwindow = UMLApp::app()->docWindow(); + docwindow->updateDocumentation(false); + + QPointer dialog = new ActivityDialog(umlScene(), this); + if (dialog->exec() && dialog->getChangesMade()) { + docwindow->showDocumentation(this, true); + UMLApp::app()->document()->setModified(true); + } + delete dialog; +} + +/** + * Overrides the standard paint event. + */ +void ActivityWidget::paint(QPainter & p, int offsetX, int offsetY) { int w = width(); int h = height(); @@ -50,9 +168,8 @@ float y; QPen pen = p.pen(); - switch ( m_ActivityType ) + switch ( m_activityType ) { - case Normal : UMLWidget::setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) { @@ -165,15 +282,50 @@ } break; - } - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } +/** + * Loads the widget from the "activitywidget" XMI element. + */ +bool ActivityWidget::loadFromXMI( QDomElement & qElement ) +{ + if( !UMLWidget::loadFromXMI( qElement ) ) + return false; + setName(qElement.attribute( "activityname", "" )); + setDocumentation(qElement.attribute( "documentation", "" )); + setPreconditionText(qElement.attribute( "precondition", "" )); + setPostconditionText(qElement.attribute( "postcondition", "" )); + + QString type = qElement.attribute( "activitytype", "1" ); + setActivityType( (ActivityType)type.toInt() ); + + return true; +} + +/** + * Saves the widget to the "activitywidget" XMI element. + */ +void ActivityWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement activityElement = qDoc.createElement( "activitywidget" ); + UMLWidget::saveToXMI( qDoc, activityElement ); + activityElement.setAttribute( "activityname", name() ); + activityElement.setAttribute( "documentation", documentation() ); + activityElement.setAttribute( "precondition", preconditionText() ); + activityElement.setAttribute( "postcondition", postconditionText() ); + activityElement.setAttribute( "activitytype", m_activityType ); + qElement.appendChild( activityElement ); +} + +/** + * Overrides Method from UMLWidget. + */ void ActivityWidget::constrain(int& width, int& height) { - if (m_ActivityType == Normal || m_ActivityType == Invok || m_ActivityType == Param) { + if (m_activityType == Normal || m_activityType == Invok || m_activityType == Param) { QSize minSize = calculateSize(); if (width < minSize.width()) width = minSize.width(); @@ -185,7 +337,7 @@ width = height; else if (height > width) height = width; - if (m_ActivityType == Branch) { + if (m_activityType == Branch) { if (width < 20) { width = 20; height = 20; @@ -204,10 +356,40 @@ } } +/** + * Captures any popup menu signals for menus it created. + */ +void ActivityWidget::slotMenuSelection(QAction* action) +{ + bool ok = false; + QString n = name(); + + ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + + switch( sel ) { + case ListPopupMenu::mt_Rename: + n = KInputDialog::getText( i18n("Enter Activity Name"), i18n("Enter the name of the new activity:"), n, &ok ); + if( ok && !n.isEmpty()) { + setName(n); + } + break; + + case ListPopupMenu::mt_Properties: + showPropertiesDialog(); + break; + + default: + UMLWidget::slotMenuSelection(action); + } +} + +/** + * Overrides method from UMLWidget + */ QSize ActivityWidget::calculateSize() { int width, height; - if ( m_ActivityType == Normal || m_ActivityType == Invok || m_ActivityType == Param ) { + if ( m_activityType == Normal || m_activityType == Invok || m_activityType == Param ) { const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); @@ -218,9 +400,9 @@ textWidth = textWidth > ACTIVITY_WIDTH ? textWidth : ACTIVITY_WIDTH; - if (m_ActivityType == Invok) { + if (m_activityType == Invok) { height += 40; - } else if (m_ActivityType == Param) { + } else if (m_activityType == Param) { QString maxSize; maxSize = name().length() > postconditionText().length() ? name() : postconditionText(); @@ -241,130 +423,4 @@ return QSize(width, height); } -ActivityWidget::ActivityType ActivityWidget::activityType() const -{ - return m_ActivityType; -} - -void ActivityWidget::setActivityType( ActivityType activityType ) -{ - m_ActivityType = activityType; - updateComponentSize(); - UMLWidget::m_bResizable = true; -} - -void ActivityWidget::slotMenuSelection(QAction* action) -{ - bool ok = false; - QString name = m_Text; - - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); - switch( sel ) { - case ListPopupMenu::mt_Rename: - name = KInputDialog::getText( i18n("Enter Activity Name"), i18n("Enter the name of the new activity:"), m_Text, &ok ); - if( ok && name.length() > 0 ) - m_Text = name; - break; - - case ListPopupMenu::mt_Properties: - showProperties(); - break; - - default: - UMLWidget::slotMenuSelection(action); - } -} - -void ActivityWidget::showProperties() -{ - DocWindow *docwindow = UMLApp::app()->docWindow(); - docwindow->updateDocumentation(false); - - QPointer dialog = new ActivityDialog(m_pView, this); - if (dialog->exec() && dialog->getChangesMade()) { - docwindow->showDocumentation(this, true); - UMLApp::app()->document()->setModified(true); - } - delete dialog; -} - -bool ActivityWidget::isActivity(WorkToolBar::ToolBar_Buttons tbb, - ActivityType& resultType) -{ - bool status = true; - switch (tbb) { - case WorkToolBar::tbb_Initial_Activity: - resultType = Initial; - break; - case WorkToolBar::tbb_Activity: - resultType = Normal; - break; - case WorkToolBar::tbb_End_Activity: - resultType = End; - break; - case WorkToolBar::tbb_Final_Activity: - resultType = Final; - break; - case WorkToolBar::tbb_Branch: - resultType = Branch; - break; - default: - status = false; - break; - } - return status; -} - -void ActivityWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement activityElement = qDoc.createElement( "activitywidget" ); - UMLWidget::saveToXMI( qDoc, activityElement ); - activityElement.setAttribute( "activityname", m_Text ); - activityElement.setAttribute( "documentation", m_Doc ); - activityElement.setAttribute( "precondition", preText ); - activityElement.setAttribute( "postcondition", postText ); - activityElement.setAttribute( "activitytype", m_ActivityType ); - qElement.appendChild( activityElement ); -} - -bool ActivityWidget::loadFromXMI( QDomElement & qElement ) -{ - if( !UMLWidget::loadFromXMI( qElement ) ) - return false; - m_Text = qElement.attribute( "activityname", "" ); - m_Doc = qElement.attribute( "documentation", "" ); - preText = qElement.attribute( "precondition", "" ); - postText = qElement.attribute( "postcondition", "" ); - - QString type = qElement.attribute( "activitytype", "1" ); - setActivityType( (ActivityType)type.toInt() ); - - return true; -} - -void ActivityWidget::setPreconditionText(const QString& aPreText) -{ - preText=aPreText; - updateComponentSize(); - adjustAssocs( getX(), getY() ); -} - -QString ActivityWidget::preconditionText() -{ - return preText; -} - -void ActivityWidget::setPostconditionText(const QString& aPostText) -{ - postText=aPostText; - updateComponentSize(); - adjustAssocs( getX(), getY() ); -} - -QString ActivityWidget::postconditionText() -{ - return postText; -} - #include "activitywidget.moc" - diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/activitywidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/activitywidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/activitywidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/activitywidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -1,10 +1,11 @@ /*************************************************************************** + * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * copyright (C) 2002-2009 * + * copyright (C) 2002-2011 * * Umbrello UML Modeller Authors * ***************************************************************************/ @@ -34,8 +35,6 @@ { Q_OBJECT - QString preText; - QString postText; public: enum ActivityType { @@ -48,97 +47,36 @@ Param }; - /** - * Creates a Activity widget. - * - * @param view The parent of the widget. - * @param activityType The type of activity. - * @param id The ID to assign (-1 will prompt a new ID.) - */ - explicit ActivityWidget( UMLView * view, ActivityType activityType = Normal, Uml::IDType id = Uml::id_None ); - - /** - * destructor - */ + explicit ActivityWidget( UMLScene * scene, ActivityType activityType = Normal, Uml::IDType id = Uml::id_None ); virtual ~ActivityWidget(); - /** - * Overrides the standard paint event. - */ - void draw(QPainter & p, int offsetX, int offsetY); - - /** - * Overrides Method from UMLWidget. - */ - void constrain(int& width, int& height); - - /** - * Returns the type of activity. - */ ActivityType activityType() const; - - /** - * Sets the type of activity. - */ void setActivityType( ActivityType activityType ); - /** - * Show a properties dialog for an ActivityWidget. - */ - void showProperties(); - - /** - * Determines whether a toolbar button represents an Activity. - * CHECK: currently unused - can this be removed? - * - * @param tbb The toolbar button enum input value. - * @param resultType The ActivityType corresponding to tbb. - * This is only set if tbb is an Activity. - * @return True if tbb represents an Activity. - */ static bool isActivity( WorkToolBar::ToolBar_Buttons tbb, ActivityType& resultType ); - /** - * Saves the widget to the "activitywidget" XMI element. - */ - void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); + QString preconditionText(); + void setPreconditionText(const QString&); - /** - * Loads the widget from the "activitywidget" XMI element. - */ - bool loadFromXMI( QDomElement & qElement ); + QString postconditionText(); + void setPostconditionText(const QString&); - /** - * This method set the name of the preText attribute - */ - void setPreconditionText(const QString&); + virtual void showPropertiesDialog(); - /** - * This method get the name of the preText attribute - */ - QString preconditionText(); + virtual void paint(QPainter & p, int offsetX, int offsetY); - /** - * This method set the name of the postText attribute - */ - void setPostconditionText(const QString&); + virtual bool loadFromXMI( QDomElement & qElement ); + virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); - /** - * This method get the name of the postText attribute - */ - QString postconditionText(); + void constrain(int& width, int& height); + +public Q_SLOTS: + virtual void slotMenuSelection(QAction* action); protected: - /** - * Overrides method from UMLWidget - */ QSize calculateSize(); - - /** - * Type of activity. - */ - ActivityType m_ActivityType; + ActivityType m_activityType; ///< Type of activity. /** * Type of normal activity (Invok or not). @@ -146,12 +84,8 @@ */ bool m_NormalActivityType; -public slots: - - /** - * Captures any popup menu signals for menus it created. - */ - void slotMenuSelection(QAction* action); + QString m_preconditionText; + QString m_postconditionText; }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/actorwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/actorwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/actorwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/actorwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -11,9 +12,6 @@ // own header file #include "actorwidget.h" -// system includes -#include - // local includes #include "actor.h" #include "umlview.h" @@ -21,11 +19,11 @@ /** * Constructs an ActorWidget. * - * @param view The parent of this ActorWidget. + * @param scene The parent of this ActorWidget. * @param o The Actor class this ActorWidget will display. */ -ActorWidget::ActorWidget(UMLView * view, UMLActor *a) - : UMLWidget(view, a) +ActorWidget::ActorWidget(UMLScene * scene, UMLActor *a) + : UMLWidget(scene, a) { setBaseType(WidgetBase::wt_Actor); } @@ -40,7 +38,7 @@ /** * Overrides the standard paint event. */ -void ActorWidget::draw(QPainter & p, int offsetX, int offsetY) +void ActorWidget::paint(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); if( UMLWidget::getUseFillColour() ) @@ -72,11 +70,22 @@ p.setPen(QPen(Qt::black)); p.drawText(offsetX + A_MARGIN, offsetY + h - fontHeight, w - A_MARGIN * 2, fontHeight, Qt::AlignCenter, name()); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } /** + * Saves the widget to the "actorwidget" XMI element. + * Note: For loading from XMI, the inherited parent method is used. + */ +void ActorWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement actorElement = qDoc.createElement( "actorwidget" ); + UMLWidget::saveToXMI( qDoc, actorElement ); + qElement.appendChild( actorElement ); +} + +/** * Overrides method from UMLWidget. */ QSize ActorWidget::calculateSize() @@ -90,13 +99,4 @@ return QSize(width, height); } -/** - * Saves the widget to the "actorwidget" XMI element. - * Note: For loading from XMI, the inherited parent method is used. - */ -void ActorWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement actorElement = qDoc.createElement( "actorwidget" ); - UMLWidget::saveToXMI( qDoc, actorElement ); - qElement.appendChild( actorElement ); -} + diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/actorwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/actorwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/actorwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/actorwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -29,8 +30,8 @@ * If the UMLActor class that this ActorWidget is displaying is deleted, the * @ref UMLView will make sure that this instance is also deleted. * - * The ActorWidget class inherits from the @ref UMLWidget class which adds most - * of the functionality to this class. + * The ActorWidget class inherits from the @ref UMLWidget class + * which adds most of the functionality to this class. * * @short A graphical version of a UML Actor. * @author Paul Hensgen @@ -38,16 +39,15 @@ * @see UMLView * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ - class ActorWidget : public UMLWidget { public: - ActorWidget(UMLView * view, UMLActor *o); + ActorWidget(UMLScene * scene, UMLActor *o); virtual ~ActorWidget(); - void draw(QPainter & p, int offsetX, int offsetY); + virtual void paint(QPainter & p, int offsetX, int offsetY); - void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); + virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); protected: QSize calculateSize(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/artifactwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/artifactwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/artifactwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/artifactwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,74 +11,145 @@ // own header #include "artifactwidget.h" -// qt/kde includes -#include - // app includes #include "artifact.h" #include "debug_utils.h" #include "umlview.h" - -ArtifactWidget::ArtifactWidget(UMLView *view, UMLArtifact *a) - : UMLWidget(view, a) +/** + * Constructs a ArtifactWidget. + * + * @param scene The parent of this ArtifactWidget. + * @param a The Artifact this widget will be representing. + */ +ArtifactWidget::ArtifactWidget(UMLScene *scene, UMLArtifact *a) + : UMLWidget(scene, a) { init(); setSize(100, 30); updateComponentSize(); } +/** + * Destructor. + */ +ArtifactWidget::~ArtifactWidget() +{ +} + +/** + * Reimplemented to paint the articraft widget. Some part of specific + * drawing is delegeted to private method like drawAsFile.. + */ +void ArtifactWidget::paint(QPainter& p, int offsetX, int offsetY) +{ + UMLWidget::setPenFromSettings(p); + if ( UMLWidget::getUseFillColour() ) { + p.setBrush( UMLWidget::getFillColor() ); + } else { + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); + } + + UMLArtifact *umlart = static_cast(m_pObject); + UMLArtifact::Draw_Type drawType = umlart->getDrawAsType(); + switch (drawType) { + case UMLArtifact::defaultDraw: + return drawAsNormal(p, offsetX, offsetY); + break; + case UMLArtifact::file: + return drawAsFile(p, offsetX, offsetY); + break; + case UMLArtifact::library: + return drawAsLibrary(p, offsetX, offsetY); + break; + case UMLArtifact::table: + return drawAsTable(p, offsetX, offsetY); + break; + + default: + uWarning() << "Artifact drawn as unknown type"; + break; + } +} + +/** + * Reimplemented from WidgetBase::saveToXMI to save the widget to + * the "artifactwidget" XMI element. + */ +void ArtifactWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) +{ + QDomElement conceptElement = qDoc.createElement("artifactwidget"); + UMLWidget::saveToXMI(qDoc, conceptElement); + qElement.appendChild(conceptElement); +} + +/** + * Overrides method from UMLWidget. + */ +QSize ArtifactWidget::calculateSize() +{ + if ( !m_pObject) { + return UMLWidget::calculateSize(); + } + UMLArtifact *umlart = static_cast(m_pObject); + if (umlart->getDrawAsType() == UMLArtifact::defaultDraw) { + return calculateNormalSize(); + } else { + return calculateIconSize(); + } +} +/** + * Initializes key variables of the class. + */ void ArtifactWidget::init() { UMLWidget::setBaseType( WidgetBase::wt_Artifact ); m_pMenu = 0; } -ArtifactWidget::~ArtifactWidget() +/** + * calculates the size when drawing as an icon (it's the same size for all icons) + */ +QSize ArtifactWidget::calculateIconSize() { + const QFontMetrics &fm = getFontMetrics(FT_BOLD_ITALIC); + const int fontHeight = fm.lineSpacing(); + + int width = fm.width( m_pObject->name() ); + + width = width<50 ? 50 : width; + + int height = 50 + fontHeight; + + return QSize(width, height); } -void ArtifactWidget::drawAsNormal(QPainter& p, int offsetX, int offsetY) +/** + * calculates the size for drawing as a box + */ +QSize ArtifactWidget::calculateNormalSize() { - int w = width(); - int h = height(); - QFont font = UMLWidget::font(); - font.setBold(true); - const QFontMetrics &fm = getFontMetrics(FT_BOLD); + const QFontMetrics &fm = getFontMetrics(FT_BOLD_ITALIC); const int fontHeight = fm.lineSpacing(); - QString stereotype = m_pObject->stereotype(); - p.drawRect(offsetX, offsetY, w, h); - - p.setPen( QPen(Qt::black) ); - p.setFont(font); - - if (!stereotype.isEmpty()) { - p.drawText(offsetX + ARTIFACT_MARGIN, offsetY + (h/2) - fontHeight, - w, fontHeight, Qt::AlignCenter, m_pObject->stereotype(true)); - } + int width = fm.width( m_pObject->name() ); - int lines; - if (!stereotype.isEmpty()) { - lines = 2; - } else { - lines = 1; + int tempWidth = 0; + if(!m_pObject->stereotype().isEmpty()) { + tempWidth = fm.width( m_pObject->stereotype(true) ); } + width = tempWidth>width ? tempWidth : width; + width += ARTIFACT_MARGIN * 2; - if (lines == 1) { - p.drawText(offsetX, offsetY + (h/2) - (fontHeight/2), - w, fontHeight, Qt::AlignCenter, name()); - } else { - p.drawText(offsetX, offsetY + (h/2), - w, fontHeight, Qt::AlignCenter, name()); - } + int height = (2*fontHeight) + (ARTIFACT_MARGIN * 2); - if(m_bSelected) { - drawSelected(&p, offsetX, offsetY); - } + return QSize(width, height); } +/** + * draw as a file icon + */ void ArtifactWidget::drawAsFile(QPainter& p, int offsetX, int offsetY) { const int w = width(); @@ -107,11 +178,14 @@ p.drawText(offsetX, offsetY + h - fontHeight, w, fontHeight, Qt::AlignCenter, name()); - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * draw as a library file icon + */ void ArtifactWidget::drawAsLibrary(QPainter& p, int offsetX, int offsetY) { //FIXME this should have gears on it @@ -141,11 +215,14 @@ p.drawText(offsetX, offsetY + h - fontHeight, w, fontHeight, Qt::AlignCenter, name()); - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * draw as a database table icon + */ void ArtifactWidget::drawAsTable(QPainter& p, int offsetX, int offsetY) { const int w = width(); @@ -177,91 +254,51 @@ p.drawText(offsetX, offsetY + h - fontHeight, w, fontHeight, Qt::AlignCenter, name()); - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } -void ArtifactWidget::draw(QPainter& p, int offsetX, int offsetY) -{ - UMLWidget::setPenFromSettings(p); - if ( UMLWidget::getUseFillColour() ) { - p.setBrush( UMLWidget::getFillColor() ); - } else { - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); - } - - UMLArtifact *umlart = static_cast(m_pObject); - UMLArtifact::Draw_Type drawType = umlart->getDrawAsType(); - switch (drawType) { - case UMLArtifact::defaultDraw: - return drawAsNormal(p, offsetX, offsetY); - break; - case UMLArtifact::file: - return drawAsFile(p, offsetX, offsetY); - break; - case UMLArtifact::library: - return drawAsLibrary(p, offsetX, offsetY); - break; - case UMLArtifact::table: - return drawAsTable(p, offsetX, offsetY); - break; - default: - uWarning() << "Artifact drawn as unknown type"; - break; - } -} - -QSize ArtifactWidget::calculateIconSize() +/** + * draw as a box + */ +void ArtifactWidget::drawAsNormal(QPainter& p, int offsetX, int offsetY) { - const QFontMetrics &fm = getFontMetrics(FT_BOLD_ITALIC); + int w = width(); + int h = height(); + QFont font = UMLWidget::font(); + font.setBold(true); + const QFontMetrics &fm = getFontMetrics(FT_BOLD); const int fontHeight = fm.lineSpacing(); + QString stereotype = m_pObject->stereotype(); - int width = fm.width( m_pObject->name() ); - - width = width<50 ? 50 : width; - - int height = 50 + fontHeight; - - return QSize(width, height); -} - -QSize ArtifactWidget::calculateNormalSize() -{ - const QFontMetrics &fm = getFontMetrics(FT_BOLD_ITALIC); - const int fontHeight = fm.lineSpacing(); + p.drawRect(offsetX, offsetY, w, h); - int width = fm.width( m_pObject->name() ); + p.setPen( QPen(Qt::black) ); + p.setFont(font); - int tempWidth = 0; - if(!m_pObject->stereotype().isEmpty()) { - tempWidth = fm.width( m_pObject->stereotype(true) ); + if (!stereotype.isEmpty()) { + p.drawText(offsetX + ARTIFACT_MARGIN, offsetY + (h/2) - fontHeight, + w, fontHeight, Qt::AlignCenter, m_pObject->stereotype(true)); } - width = tempWidth>width ? tempWidth : width; - width += ARTIFACT_MARGIN * 2; - - int height = (2*fontHeight) + (ARTIFACT_MARGIN * 2); - - return QSize(width, height); -} -QSize ArtifactWidget::calculateSize() -{ - if ( !m_pObject) { - return UMLWidget::calculateSize(); + int lines; + if (!stereotype.isEmpty()) { + lines = 2; + } else { + lines = 1; } - UMLArtifact *umlart = static_cast(m_pObject); - if (umlart->getDrawAsType() == UMLArtifact::defaultDraw) { - return calculateNormalSize(); + + if (lines == 1) { + p.drawText(offsetX, offsetY + (h/2) - (fontHeight/2), + w, fontHeight, Qt::AlignCenter, name()); } else { - return calculateIconSize(); + p.drawText(offsetX, offsetY + (h/2), + w, fontHeight, Qt::AlignCenter, name()); } -} -void ArtifactWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) -{ - QDomElement conceptElement = qDoc.createElement("artifactwidget"); - UMLWidget::saveToXMI(qDoc, conceptElement); - qElement.appendChild(conceptElement); + if(m_selected) { + drawSelected(&p, offsetX, offsetY); + } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/artifactwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/artifactwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/artifactwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/artifactwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -5,99 +5,55 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * copyright (C) 2003-2006 * + * copyright (C) 2003-2011 * * Umbrello UML Modeller Authors * ***************************************************************************/ #ifndef ARTIFACTWIDGET_H #define ARTIFACTWIDGET_H - #include "umlwidget.h" -class UMLView; +class UMLScene; class UMLArtifact; #define ARTIFACT_MARGIN 5 /** - * Defines a graphical version of the Artifact. - * Most of the functionality will come from the @ref UMLArtifact class. + * Defines a graphical version of the @ref UMLArtifact. + * Most of the functionality will come from the @ref UMLWidget class. * * @short A graphical version of a Artifact. * @author Jonathan Riddell * @see UMLWidget * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class ArtifactWidget : public UMLWidget { +class ArtifactWidget : public UMLWidget +{ public: - - /** - * Constructs a ArtifactWidget. - * - * @param view The parent of this ArtifactWidget. - * @param a The Artifact this widget will be representing. - */ - ArtifactWidget(UMLView *view, UMLArtifact *a); - - /** - * destructor - */ + ArtifactWidget(UMLScene *scene, UMLArtifact *a); virtual ~ArtifactWidget(); - /** - * Overrides standard method - */ - void draw(QPainter& p, int offsetX, int offsetY); + virtual void paint(QPainter& p, int offsetX, int offsetY); - /** - * Saves the widget to the "artifactwidget" XMI element. - * Note: For loading from XMI, the inherited parent method is used. - */ - void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + // Note: For loading from XMI, the inherited parent method is + // used. + virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); protected: - /** - * Overrides method from UMLWidget. - */ QSize calculateSize(); private: - /** - * Initializes key variables of the class. - */ void init(); - - /** - * calculates the size when drawing as an icon (it's the same size for all icons) - */ QSize calculateIconSize(); - - /** - * calculates the size for drawing as a box - */ QSize calculateNormalSize(); - /** - * draw as a file icon - */ void drawAsFile(QPainter& p, int offsetX, int offsetY); - - /** - * draw as a library file icon - */ void drawAsLibrary(QPainter& p, int offsetX, int offsetY); - - /** - * draw as a database table icon - */ void drawAsTable(QPainter& p, int offsetX, int offsetY); - - /** - * draw as a box - */ void drawAsNormal(QPainter& p, int offsetX, int offsetY); + /** * The right mouse button menu */ diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/associationwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/associationwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/associationwidget.cpp 2011-12-02 21:33:50.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/associationwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -17,7 +17,6 @@ // qt includes #include -#include #include #include #include @@ -57,19 +56,19 @@ // this constructor really only for loading from XMI, otherwise it // is bad..and shouldn't be allowed as it creates an incomplete // associationwidget. -AssociationWidget::AssociationWidget(UMLView *view) - : WidgetBase(view) +AssociationWidget::AssociationWidget(UMLScene *scene) + : WidgetBase(scene) { - init(view); + init(); } // the preferred constructor -AssociationWidget::AssociationWidget(UMLView *view, UMLWidget* pWidgetA, +AssociationWidget::AssociationWidget(UMLScene *scene, UMLWidget* pWidgetA, Uml::AssociationType assocType, UMLWidget* pWidgetB, UMLObject *umlobject /* = NULL */) - : WidgetBase(view) + : WidgetBase(scene) { - init(view); + init(); if (umlobject) { setUMLObject(umlobject); } else { @@ -122,7 +121,7 @@ // permits us to have more than one message between two objects. if (isCollaboration()) { // Create a temporary name to bring on setName() - int collabID = m_pView->generateCollaborationId(); + int collabID = m_scene->generateCollaborationId(); setName('m' + QString::number(collabID)); } } @@ -135,10 +134,10 @@ { m_LinePath = Other.m_LinePath; - m_pView = Other.m_pView; + m_scene = Other.m_scene; if (Other.m_pName) { - m_pName = new FloatingTextWidget(m_pView); + m_pName = new FloatingTextWidget(m_scene); *m_pName = *(Other.m_pName); } else { m_pName = NULL; @@ -151,21 +150,21 @@ lhs.m_nTotalCount = rhs.m_nTotalCount; if (rhs.m_pMulti) { - lhs.m_pMulti = new FloatingTextWidget(m_pView); + lhs.m_pMulti = new FloatingTextWidget(m_scene); *(lhs.m_pMulti) = *(rhs.m_pMulti); } else { lhs.m_pMulti = NULL; } if (rhs.m_pRole) { - lhs.m_pRole = new FloatingTextWidget(m_pView); + lhs.m_pRole = new FloatingTextWidget(m_scene); *(lhs.m_pRole) = *(rhs.m_pRole); } else { lhs.m_pRole = NULL; } if (rhs.m_pChangeWidget) { - lhs.m_pChangeWidget = new FloatingTextWidget(m_pView); + lhs.m_pChangeWidget = new FloatingTextWidget(m_scene); *(lhs.m_pChangeWidget) = *(rhs.m_pChangeWidget); } else { lhs.m_pChangeWidget = NULL; @@ -176,11 +175,11 @@ lhs.m_WidgetRegion = rhs.m_WidgetRegion; } - m_bActivated = Other.m_bActivated; + m_activated = Other.m_activated; m_unNameLineSegment = Other.m_unNameLineSegment; m_pMenu = Other.m_pMenu; setUMLAssociation(Other.getAssociation()); - m_bSelected = Other.m_bSelected; + m_selected = Other.m_selected; m_nMovingPoint = Other.m_nMovingPoint; return *this; @@ -390,13 +389,13 @@ return; newLabel = true; - m_pName = new FloatingTextWidget(m_pView, CalculateNameType(Uml::TextRole::Name), strName); + m_pName = new FloatingTextWidget(m_scene, CalculateNameType(Uml::TextRole::Name), strName); m_pName->setLink(this); } else { m_pName->setText(strName); if (! FloatingTextWidget::isTextValid(strName)) { //m_pName->hide(); - m_pView->removeWidget(m_pName); + m_scene->removeWidget(m_pName); m_pName = NULL; return; } @@ -405,7 +404,7 @@ setTextPosition(Uml::TextRole::Name); if (newLabel) { m_pName->setActivated(); - m_pView->addWidget(m_pName); + m_scene->addWidget(m_pName); } m_pName->show(); @@ -431,18 +430,18 @@ if (! FloatingTextWidget::isTextValid(text)) { if (ft) { // Remove preexisting FloatingTextWidget - m_pView->removeWidget(ft); // physically deletes ft + m_scene->removeWidget(ft); // physically deletes ft ft = NULL; } return; } if (ft == NULL) { - ft = new FloatingTextWidget(m_pView, tr, text); + ft = new FloatingTextWidget(m_scene, tr, text); ft->setLink(this); ft->activate(); setTextPosition(tr); - m_pView->addWidget(ft); + m_scene->addWidget(ft); } else { bool newLabel = ft->text().isEmpty(); ft->setText(text); @@ -521,7 +520,7 @@ QString message; if (isCollaboration()) { if (m_pObject != NULL) { - message = multiplicity(A) + ": " + operationText(m_pView); + message = multiplicity(A) + ": " + operationText(m_scene); } else { message = multiplicity(A) + ": " + getName(); } @@ -609,9 +608,9 @@ return; newLabel = true; - m_role[role].m_pChangeWidget = new FloatingTextWidget(m_pView, tr, strChangeWidget); + m_role[role].m_pChangeWidget = new FloatingTextWidget(m_scene, tr, strChangeWidget); m_role[role].m_pChangeWidget->setLink(this); - m_pView->addWidget(m_role[role].m_pChangeWidget); + m_scene->addWidget(m_role[role].m_pChangeWidget); m_role[role].m_pChangeWidget->setPreText("{"); // all types have this m_role[role].m_pChangeWidget->setPostText("}"); // all types have this } else { @@ -704,15 +703,15 @@ } } - if (m_bActivated) + if (m_activated) return true; Uml::AssociationType type = associationType(); if (m_role[A].m_pWidget == NULL) - setWidget(m_pView->findWidget(getWidgetID(A)), A); + setWidget(m_scene->findWidget(getWidgetID(A)), A); if (m_role[B].m_pWidget == NULL) - setWidget(m_pView->findWidget(getWidgetID(B)), B); + setWidget(m_scene->findWidget(getWidgetID(B)), B); if(!m_role[A].m_pWidget || !m_role[B].m_pWidget) { uDebug() << "Can not make association!"; @@ -737,7 +736,7 @@ robj.m_pRole->show(); else robj.m_pRole->hide(); - if (m_pView->type() == DiagramType::Collaboration) + if (m_scene->type() == DiagramType::Collaboration) robj.m_pRole->setUMLObject(robj.m_pWidget->umlObject()); robj.m_pRole->activate(); } @@ -790,7 +789,7 @@ createAssocClassLine(); } - m_bActivated = true; + m_activated = true; return true; } @@ -798,13 +797,13 @@ Uml::TextRole AssociationWidget::CalculateNameType(Uml::TextRole defaultRole) { TextRole result = defaultRole; - if( m_pView->type() == DiagramType::Collaboration ) { + if( m_scene->type() == DiagramType::Collaboration ) { if(m_role[A].m_pWidget == m_role[B].m_pWidget) { result = TextRole::Coll_Message;//for now same as other Coll_Message } else { result = TextRole::Coll_Message; } - } else if( m_pView->type() == DiagramType::Sequence ) { + } else if( m_scene->type() == DiagramType::Sequence ) { if(m_role[A].m_pWidget == m_role[B].m_pWidget) { result = TextRole::Seq_Message_Self; } else { @@ -875,21 +874,21 @@ robj.m_pWidget = 0; } if(robj.m_pRole) { - m_pView->removeWidget(robj.m_pRole); + m_scene->removeWidget(robj.m_pRole); robj.m_pRole = 0; } if(robj.m_pMulti) { - m_pView->removeWidget(robj.m_pMulti); + m_scene->removeWidget(robj.m_pMulti); robj.m_pMulti = 0; } if(robj.m_pChangeWidget) { - m_pView->removeWidget(robj.m_pChangeWidget); + m_scene->removeWidget(robj.m_pChangeWidget); robj.m_pChangeWidget = 0; } } if(m_pName) { - m_pView->removeWidget(m_pName); + m_scene->removeWidget(m_pName); m_pName = 0; } @@ -1167,7 +1166,7 @@ // -> avoid movement during opening // -> print warn and stay at old position uWarning() << "called during load of XMI for ViewType: " - << m_pView->type() << ", and BaseType: " << baseType(); + << m_scene->type() << ", and BaseType: " << baseType(); return; } /*to be here a line segment has moved. @@ -1378,16 +1377,16 @@ updateAssociations( regionCount, region, role ); } -/** Read property of bool m_bActivated. */ +/** Read property of bool m_activated. */ bool AssociationWidget::isActivated() { - return m_bActivated; + return m_activated; } -/** Set the m_bActivated flag of a widget but does not perform the Activate method */ +/** Set the m_activated flag of a widget but does not perform the Activate method */ void AssociationWidget::setActivated(bool active /*=true*/) { - m_bActivated = active; + m_activated = active; } /** @@ -1505,7 +1504,7 @@ // -> there is something wrong // -> avoid movement during opening // -> print warn and stay at old position - uDebug() << "called during load of XMI for ViewType: " << m_pView->type() + uDebug() << "called during load of XMI for ViewType: " << m_scene->type() << ", and BaseType: " << baseType(); return; } @@ -1533,8 +1532,8 @@ // safety. We DON'T want to go off the screen if(newY < 0) newY = 0; - newX = m_pView->snappedX( newX ); - newY = m_pView->snappedY( newY ); + newX = m_scene->snappedX( newX ); + newY = m_scene->snappedY( newY ); p.setX( newX ); p.setY( newY ); m_LinePath.setPoint( i, p ); @@ -2431,7 +2430,7 @@ void AssociationWidget::createAssocClassLine() { if (m_pAssocClassLine == NULL) - m_pAssocClassLine = new Q3CanvasLine(m_pView->canvas()); + m_pAssocClassLine = new UMLSceneLine(m_scene->canvas()); computeAssocClassLine(); QPen pen(lineColor(), lineWidth(), Qt::DashLine); m_pAssocClassLine->setPen(pen); @@ -2516,7 +2515,7 @@ { // clear other selected stuff on the screen of ShiftKey if( me->modifiers() != Qt::ShiftModifier ) - m_pView->clearSelected(); + m_scene->clearSelected(); m_nMovingPoint = -1; //make sure we should be here depending on the button @@ -2525,14 +2524,14 @@ QPoint mep = me->pos(); // See if `mep' is on the connecting line to the association class if (onAssocClassLine(mep)) { - m_bSelected = true; + m_selected = true; selectAssocClassLine(); return; } // See if the user has clicked on a point to start moving the line segment // from that point checkPoints(mep); - setSelected( !m_bSelected ); + setSelected( !m_selected ); } void AssociationWidget::mouseReleaseEvent(QMouseEvent * me) @@ -2596,7 +2595,7 @@ else menuType = ListPopupMenu::mt_Association_Selected; } - m_pMenu = new ListPopupMenu(m_pView, menuType); + m_pMenu = new ListPopupMenu(m_scene, menuType); m_pMenu->popup(me->globalPos()); connect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotMenuSelection(QAction*))); if (isCollaboration()) @@ -2611,7 +2610,7 @@ */ void AssociationWidget::showPropertiesDialog() { - QPointer dlg = new AssocPropDlg(static_cast(m_pView), this ); + QPointer dlg = new AssocPropDlg(static_cast(m_scene), this ); if (dlg->exec()) { QString name = getName(); QString doc = documentation(); @@ -2640,7 +2639,7 @@ setChangeability(cA, A); setChangeability(cB, B); - m_pView->showDocumentation(this, true); + m_scene->showDocumentation(this, true); } delete dlg; } @@ -2672,7 +2671,7 @@ // here just in case - remove later after testing uDebug() << "mt_Properties: assoctype is " << atype; } else { //standard assoc dialog - m_pView->updateDocumentation( false ); + m_scene->updateDocumentation( false ); showPropertiesDialog(); } break; @@ -2681,9 +2680,9 @@ if (m_pAssocClassLineSel0) removeAssocClassLine(); else if (getAssociation()) - m_pView->removeAssocInViewAndDoc(this); + m_scene->removeAssocInViewAndDoc(this); else - m_pView->removeAssoc(this); + m_scene->removeAssoc(this); break; case ListPopupMenu::mt_Rename_MultiA: @@ -2695,12 +2694,12 @@ oldText = ""; newText = KInputDialog::getText(i18n("Multiplicity"), i18n("Enter multiplicity:"), - oldText, NULL, m_pView,&v); + oldText, NULL, m_scene,&v); if (newText != oldText) { if (FloatingTextWidget::isTextValid(newText)) { setMultiplicity(newText, r); } else { - m_pView->removeWidget(m_role[r].m_pMulti); + m_scene->removeWidget(m_role[r].m_pMulti); m_role[r].m_pMulti = NULL; } } @@ -2713,12 +2712,12 @@ oldText = ""; newText = KInputDialog::getText(i18n("Association Name"), i18n("Enter association name:"), - oldText, NULL, m_pView, &v); + oldText, NULL, m_scene, &v); if (newText != oldText) { if (FloatingTextWidget::isTextValid(newText)) { setName(newText); } else { - m_pView->removeWidget(m_pName); + m_scene->removeWidget(m_pName); m_pName = NULL; } } @@ -2733,12 +2732,12 @@ oldText = ""; newText = KInputDialog::getText(i18n("Role Name"), i18n("Enter role name:"), - oldText, NULL, m_pView, &v); + oldText, NULL, m_scene, &v); if (newText != oldText) { if (FloatingTextWidget::isTextValid(newText)) { setRoleName(newText, r); } else { - m_pView->removeWidget(m_role[r].m_pRole); + m_scene->removeWidget(m_role[r].m_pRole); m_role[r].m_pRole = NULL; } } @@ -2747,7 +2746,7 @@ case ListPopupMenu::mt_Change_Font: { QFont fnt = font(); - if( KFontDialog::getFont( fnt, KFontChooser::NoDisplayFlags, m_pView ) ) + if( KFontDialog::getFont( fnt, KFontChooser::NoDisplayFlags, m_scene ) ) lwSetFont(fnt); } break; @@ -2755,8 +2754,8 @@ case ListPopupMenu::mt_Change_Font_Selection: { QFont fnt = font(); - if( KFontDialog::getFont( fnt, KFontChooser::NoDisplayFlags, m_pView ) ) { - m_pView->selectionSetFont( fnt ); + if( KFontDialog::getFont( fnt, KFontChooser::NoDisplayFlags, m_scene ) ) { + m_scene->selectionSetFont( fnt ); m_umldoc->setModified(true); } } @@ -2766,14 +2765,14 @@ { /* QColor newColour; if( KColorDialog::getColor(newColour) ) { - m_pView->selectionSetLineColor(newColour); + m_scene->selectionSetLineColor(newColour); m_umldoc->setModified(true); }*/ } break; case ListPopupMenu::mt_Cut: - m_pView->setStartedCut(); + m_scene->setStartedCut(); UMLApp::app()->slotEditCut(); break; @@ -2914,16 +2913,16 @@ QPoint p = me->pos(); QPoint oldp = m_LinePath.getPoint(m_nMovingPoint); - if( m_pView->getSnapToGrid() ) { - int newX = m_pView->snappedX( p.x() ); - int newY = m_pView->snappedY( p.y() ); + if( m_scene->getSnapToGrid() ) { + int newX = m_scene->snappedX( p.x() ); + int newY = m_scene->snappedY( p.y() ); p.setX(newX); p.setY(newY); } // Prevent the moving vertex from disappearing underneath a widget // (else there's no way to get it back.) - UMLWidget *onW = m_pView->widgetAt(p); + UMLWidget *onW = m_scene->widgetAt(p); if (onW && onW->baseType() != WidgetBase::wt_Box) { // boxes are transparent const int pX = p.x(); const int pY = p.y(); @@ -2950,7 +2949,7 @@ //move event called now QMoveEvent m(p, oldp); moveEvent(&m); - m_pView->resizeCanvasToItems(); + m_scene->resizeCanvasToItems(); } /** @@ -2980,7 +2979,7 @@ if(region == Error) return 0; int widgetCount = 0; - AssociationWidgetList list = m_pView->getAssociationList(); + AssociationWidgetList list = m_scene->getAssociationList(); foreach ( AssociationWidget* assocwidget, list ) { //don't count this association if (assocwidget == this) @@ -3200,7 +3199,7 @@ { if( region == Error ) return; - AssociationWidgetList list = m_pView->getAssociationList(); + AssociationWidgetList list = m_scene->getAssociationList(); UMLWidget *ownWidget = m_role[role].m_pWidget; m_positions_len = 0; @@ -3351,8 +3350,8 @@ cw = ww * index / totalCount; } - int snapX = m_pView->snappedX(x + cw); - int snapY = m_pView->snappedY(y + ch); + int snapX = m_scene->snappedX(x + cw); + int snapY = m_scene->snappedY(y + ch); QPoint pt; if (angular) { @@ -3395,7 +3394,7 @@ void AssociationWidget::setSelected(bool _select /* = true */) { - m_bSelected = _select; + m_selected = _select; if( m_pName) m_pName->setSelected( _select ); if( m_role[A].m_pRole ) @@ -3418,10 +3417,10 @@ // overwrites the docwindow, but we want the main association doc // to win. if( _select ) { - if( m_pView->getSelectCount() == 0 ) - m_pView->showDocumentation( this, false ); + if( m_scene->getSelectCount() == 0 ) + m_scene->showDocumentation( this, false ); } else - m_pView->updateDocumentation( true ); + m_scene->updateDocumentation( true ); qApp->processEvents(); m_LinePath.setSelected( _select ); @@ -3438,9 +3437,9 @@ { if (m_pAssocClassLine == NULL) return false; - Q3CanvasItemList list = m_pView->canvas()->collisions(point); - Q3CanvasItemList::iterator end(list.end()); - for (Q3CanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it) { + UMLSceneItemList list = m_scene->canvas()->collisions(point); + UMLSceneItemList::iterator end(list.end()); + for (UMLSceneItemList::iterator item_it(list.begin()); item_it != end; ++item_it) { if (*item_it == m_pAssocClassLine) return true; } @@ -3487,8 +3486,8 @@ QPoint p = m_LinePath.getPoint( i ); int newX = p.x() + x; int newY = p.y() + y; - newX = m_pView->snappedX( newX ); - newY = m_pView->snappedY( newY ); + newX = m_scene->snappedX( newX ); + newY = m_scene->snappedY( newY ); p.setX( newX ); p.setY( newY ); m_LinePath.setPoint( i, p ); @@ -3600,7 +3599,7 @@ return; } m_pObject = NULL; - m_pView->removeAssoc(this); + m_scene->removeAssoc(this); } /** @@ -3618,9 +3617,9 @@ setRoleName(attr->name(), B); } -void AssociationWidget::init (UMLView *view) +void AssociationWidget::init() { - WidgetBase::init(view, WidgetBase::wt_Association); + WidgetBase::init(WidgetBase::wt_Association); // pointers to floating text widgets objects owned by this association m_pName = 0; @@ -3645,10 +3644,10 @@ m_role[A].m_Changeability = Uml::Changeability::Changeable; m_role[B].m_Changeability = Uml::Changeability::Changeable; m_positions_len = 0; - m_bActivated = false; + m_activated = false; m_unNameLineSegment = 0; m_pMenu = 0; - m_bSelected = false; + m_selected = false; m_nMovingPoint = -1; m_nLinePathSegmentIndex = -1; m_pAssocClassWidget = NULL; @@ -3661,8 +3660,8 @@ m_umldoc = UMLApp::app()->document(); m_LinePath.setAssociation( this ); - connect(m_pView, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); - connect(m_pView, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); + connect(m_scene, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); + connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); } /** @@ -4073,7 +4072,7 @@ if( r == "-1" ) return false; Uml::TextRole role = Uml::TextRole::Value(r.toInt()); - FloatingTextWidget *ft = new FloatingTextWidget(m_pView, role, "", Uml::id_Reserved); + FloatingTextWidget *ft = new FloatingTextWidget(m_scene, role, "", Uml::id_Reserved); if( ! ft->loadFromXMI(element) ) { // Most likely cause: The FloatingTextWidget is empty. delete ft; @@ -4151,8 +4150,8 @@ */ bool AssociationWidget::loadFromXMI( QDomElement & qElement ) { - const MessageWidgetList& messages = m_pView->getMessageList(); - return loadFromXMI( qElement, m_pView->getWidgetList(), &messages ); + const MessageWidgetList& messages = m_scene->getMessageList(); + return loadFromXMI( qElement, m_scene->getWidgetList(), &messages ); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/associationwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/associationwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/associationwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/associationwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -22,10 +22,9 @@ #include class ListPopupMenu; -class Q3CanvasLine; class ClassifierWidget; class UMLDoc; -class UMLView; +class UMLScene; class UMLAssociation; class UMLClassifierListItem; class UMLAttribute; @@ -67,20 +66,20 @@ /** * Constructor. * - * @param view The parent view of this widget. + * @param scene The parent view of this widget. */ - AssociationWidget(UMLView *view); + AssociationWidget(UMLScene *scene); /** * Constructor. * - * @param view The parent view of this widget. + * @param scene The parent view of this widget. * @param WidgetA Pointer to the role A widget for the association. * @param Type The AssociationType for this association. * @param WidgetB Pointer to the role B widget for the association. * @param umlobject Pointer to the underlying UMLObject (if applicable.) */ - AssociationWidget(UMLView *view, UMLWidget* WidgetA, + AssociationWidget(UMLScene *scene, UMLWidget* WidgetA, Uml::AssociationType Type, UMLWidget* WidgetB, UMLObject *umlobject = NULL); @@ -238,14 +237,14 @@ QString toString(); /** - * Read property of bool m_bActivated. + * Read property of bool m_activated. * * @return True if this AssociationWidget has been activated. */ bool isActivated(); /** - * Set the m_bActivated flag of a widget but does not perform the + * Set the m_activated flag of a widget but does not perform the * activate method. * * @param active The flag status to set. @@ -265,7 +264,7 @@ * @return Returns the state of whether the widget is selected. */ bool getSelected() const { - return m_bSelected; + return m_selected; } /** @@ -840,7 +839,7 @@ /** * Initialize attributes of this class at construction time. */ - void init (UMLView *view); + void init(); /** * Auxiliary method for calculateEndingPoints(). @@ -883,7 +882,7 @@ * Flag which is true if the activate method has been called for this * class instance. */ - bool m_bActivated; + bool m_activated; /** * When the association has a Role Floating Text this text should move @@ -895,7 +894,7 @@ uint m_unNameLineSegment; UMLDoc * m_umldoc; ///< just a shorthand for UMLApp::app()->getDocument() ListPopupMenu *m_pMenu; - bool m_bSelected; + bool m_selected; int m_nMovingPoint; /** @@ -934,9 +933,9 @@ QPoint m_oldRoleBPoint; int m_nLinePathSegmentIndex; ///< anchor for m_pAssocClassLine - Q3CanvasLine *m_pAssocClassLine; ///< used for connecting assoc. class + UMLSceneLine *m_pAssocClassLine; ///< used for connecting assoc. class /// selection adornment for the endpoints of the assoc. class connecting line - Q3CanvasRectangle *m_pAssocClassLineSel0, *m_pAssocClassLineSel1; + UMLSceneRectangle *m_pAssocClassLineSel0, *m_pAssocClassLineSel1; ClassifierWidget *m_pAssocClassWidget; ///< used if we have an assoc. class diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/boxwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/boxwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/boxwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/boxwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,39 +11,49 @@ // own header #include "boxwidget.h" -// qt/kde includes -#include - -#include "debug_utils.h" - -BoxWidget::BoxWidget(UMLView * view, Uml::IDType id) - : UMLWidget(view, id) +/** + * Constructs a BoxWidget. + * + * @param scene The parent to this widget. + * @param id The ID to assign (-1 will prompt a new ID.) + */ +BoxWidget::BoxWidget(UMLScene * scene, Uml::IDType id) + : UMLWidget(scene, id) { setSize(100,80); UMLWidget::setBaseType(WidgetBase::wt_Box); - WidgetBase::m_bUsesDiagramLineColour = false; // boxes be black + WidgetBase::m_usesDiagramLineColour = false; // boxes be black WidgetBase::m_LineColour = QColor("black"); setZ(m_origZ = 0); } +/** + * destructor + */ BoxWidget::~BoxWidget() { } -void BoxWidget::draw(QPainter& p, int offsetX, int offsetY) +/** + * Draws a rectangle. + */ +void BoxWidget::paint(QPainter& p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); p.drawRect( offsetX, offsetY, width(), height() ); - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * Saves the widget to the "boxwidget" XMI element. + * Note: For loading from XMI, the inherited parent method is used. + */ void BoxWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) { QDomElement boxElement = qDoc.createElement("boxwidget"); UMLWidget::saveToXMI(qDoc, boxElement); qElement.appendChild(boxElement); } - diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/boxwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/boxwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/boxwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/boxwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -11,15 +11,9 @@ #ifndef BOXWIDGET_H #define BOXWIDGET_H -//qt includes -#include - //app includes #include "umlwidget.h" -// fwd decl. -class UMLView; - /** * Displays a rectangular box. * These widgets are diagram specific. They will still need a unique id @@ -33,30 +27,11 @@ class BoxWidget : public UMLWidget { public: - - /** - * Constructs a BoxWidget. - * - * @param view The parent to this widget. - * @param id The ID to assign (-1 will prompt a new ID.) - */ - explicit BoxWidget(UMLView * view, Uml::IDType id = Uml::id_None); - - /** - * destructor - */ + explicit BoxWidget(UMLScene * scene, Uml::IDType id = Uml::id_None); virtual ~BoxWidget(); - /** - * Draws a rectangle. - */ - void draw(QPainter & p, int offsetX, int offsetY); - - /** - * Saves the widget to the "boxwidget" XMI element. - * Note: For loading from XMI, the inherited parent method is used. - */ - void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + virtual void paint(QPainter & p, int offsetX, int offsetY); + virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/categorywidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/categorywidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/categorywidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/categorywidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -20,8 +20,8 @@ #include "umlview.h" #include "listpopupmenu.h" -CategoryWidget::CategoryWidget(UMLView * view, UMLCategory *o) - : UMLWidget(view, o) +CategoryWidget::CategoryWidget(UMLScene * scene, UMLCategory *o) + : UMLWidget(scene, o) { UMLWidget::setBaseType(WidgetBase::wt_Category); //updateComponentSize(); Doing this during loadFromXMI() gives futile updates. @@ -32,7 +32,7 @@ { } -void CategoryWidget::draw(QPainter & p, int offsetX, int offsetY) +void CategoryWidget::paint(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) @@ -73,7 +73,7 @@ p.drawText(offsetX + UC_MARGIN, offsetY + textStartY, r - UC_MARGIN * 2, fontHeight, Qt::AlignCenter, letterType ); UMLWidget::setPenFromSettings(p); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/categorywidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/categorywidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/categorywidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/categorywidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -43,7 +43,7 @@ * @param view The parent of the widget. * @param o The UMLObject to represent. */ - CategoryWidget(UMLView * view, UMLCategory *o); + CategoryWidget(UMLScene * scene, UMLCategory *o); /** @@ -54,7 +54,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Saves this Category to file. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/classifierwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/classifierwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/classifierwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/classifierwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -24,14 +24,14 @@ #include "listpopupmenu.h" #include "object_factory.h" -ClassifierWidget::ClassifierWidget(UMLView * view, UMLClassifier *c) - : UMLWidget(view, c) +ClassifierWidget::ClassifierWidget(UMLScene * scene, UMLClassifier *c) + : UMLWidget(scene, c) { init(); if (c != NULL && c->isInterface()) { WidgetBase::setBaseType(WidgetBase::wt_Interface); - m_bShowStereotype = true; - m_bShowAttributes = false; + m_showStereotype = true; + m_showAttributes = false; updateSigs(); } } @@ -49,37 +49,38 @@ { WidgetBase::setBaseType(WidgetBase::wt_Class); - const Settings::OptionState& ops = m_pView->optionState(); - m_bShowAccess = ops.classState.showVisibility; - m_bShowOperations = ops.classState.showOps; - m_bShowPublicOnly = ops.classState.showPublicOnly; - m_bShowPackage = ops.classState.showPackage; + const Settings::OptionState& ops = m_scene->optionState(); + m_showAccess = ops.classState.showVisibility; + m_showOperations = ops.classState.showOps; + m_showPublicOnly = ops.classState.showPublicOnly; + m_showPackage = ops.classState.showPackage; m_ShowAttSigs = Uml::SignatureType::ShowSig; /* setShowOpSigs( ops.classState.showOpSig ); Cannot do that because we get "pure virtual method called". Open code: */ if( !ops.classState.showOpSig ) { - if (m_bShowAccess) + if (m_showAccess) m_ShowOpSigs = Uml::SignatureType::NoSig; else m_ShowOpSigs = Uml::SignatureType::NoSigNoVis; - } else if (m_bShowAccess) + } else if (m_showAccess) m_ShowOpSigs = Uml::SignatureType::ShowSig; else m_ShowOpSigs = Uml::SignatureType::SigNoVis; - m_bShowAttributes = ops.classState.showAtts; - m_bShowStereotype = ops.classState.showStereoType; - m_bDrawAsCircle = false; + m_showAttributes = ops.classState.showAtts; + m_showStereotype = ops.classState.showStereoType; + m_drawAsCircle = false; m_pAssocWidget = NULL; + setShowAttSigs( ops.classState.showAttSig ); } void ClassifierWidget::updateSigs() { //turn on scope - if (m_bShowAccess) { + if (m_showAccess) { if (m_ShowOpSigs == Uml::SignatureType::NoSigNoVis) { m_ShowOpSigs = Uml::SignatureType::NoSig; } else if (m_ShowOpSigs == Uml::SignatureType::SigNoVis) { @@ -92,7 +93,7 @@ m_ShowOpSigs = Uml::SignatureType::NoSigNoVis; } } - if (m_bShowAccess) { + if (m_showAccess) { if (m_ShowAttSigs == Uml::SignatureType::NoSigNoVis) m_ShowAttSigs = Uml::SignatureType::NoSig; else if (m_ShowAttSigs == Uml::SignatureType::SigNoVis) @@ -109,7 +110,7 @@ void ClassifierWidget::toggleShowStereotype() { - m_bShowStereotype = !m_bShowStereotype; + m_showStereotype = !m_showStereotype; updateSigs(); updateComponentSize(); update(); @@ -117,12 +118,12 @@ bool ClassifierWidget::getShowOps() const { - return m_bShowOperations; + return m_showOperations; } void ClassifierWidget::setShowOps(bool _show) { - m_bShowOperations = _show; + m_showOperations = _show; updateSigs(); updateComponentSize(); update(); @@ -130,7 +131,7 @@ void ClassifierWidget::toggleShowOps() { - m_bShowOperations = !m_bShowOperations; + m_showOperations = !m_showOperations; updateSigs(); updateComponentSize(); update(); @@ -138,31 +139,31 @@ bool ClassifierWidget::getShowPublicOnly() const { - return m_bShowPublicOnly; + return m_showPublicOnly; } void ClassifierWidget::setShowPublicOnly(bool _status) { - m_bShowPublicOnly = _status; + m_showPublicOnly = _status; updateComponentSize(); update(); } void ClassifierWidget::toggleShowPublicOnly() { - m_bShowPublicOnly = !m_bShowPublicOnly; + m_showPublicOnly = !m_showPublicOnly; updateComponentSize(); update(); } bool ClassifierWidget::getShowVisibility() const { - return m_bShowAccess; + return m_showAccess; } void ClassifierWidget::setShowVisibility(bool _visibility) { - m_bShowAccess = _visibility; + m_showAccess = _visibility; updateSigs(); updateComponentSize(); update(); @@ -170,7 +171,7 @@ void ClassifierWidget::toggleShowVisibility() { - m_bShowAccess = !m_bShowAccess; + m_showAccess = !m_showAccess; updateSigs(); updateComponentSize(); update(); @@ -184,11 +185,11 @@ void ClassifierWidget::setShowOpSigs(bool _status) { if( !_status ) { - if (m_bShowAccess) + if (m_showAccess) m_ShowOpSigs = Uml::SignatureType::NoSig; else m_ShowOpSigs = Uml::SignatureType::NoSigNoVis; - } else if (m_bShowAccess) + } else if (m_showAccess) m_ShowOpSigs = Uml::SignatureType::ShowSig; else m_ShowOpSigs = Uml::SignatureType::SigNoVis; @@ -199,12 +200,12 @@ void ClassifierWidget::toggleShowOpSigs() { if (m_ShowOpSigs == Uml::SignatureType::ShowSig || m_ShowOpSigs == Uml::SignatureType::SigNoVis) { - if (m_bShowAccess) { + if (m_showAccess) { m_ShowOpSigs = Uml::SignatureType::NoSig; } else { m_ShowOpSigs = Uml::SignatureType::NoSigNoVis; } - } else if (m_bShowAccess) { + } else if (m_showAccess) { m_ShowOpSigs = Uml::SignatureType::ShowSig; } else { m_ShowOpSigs = Uml::SignatureType::SigNoVis; @@ -215,19 +216,19 @@ bool ClassifierWidget::getShowPackage() const { - return m_bShowPackage; + return m_showPackage; } void ClassifierWidget::setShowPackage(bool _status) { - m_bShowPackage = _status; + m_showPackage = _status; updateComponentSize(); update(); } void ClassifierWidget::toggleShowPackage() { - m_bShowPackage = !m_bShowPackage; + m_showPackage = !m_showPackage; updateSigs(); updateComponentSize(); update(); @@ -243,7 +244,7 @@ void ClassifierWidget::setShowAtts(bool _show) { - m_bShowAttributes = _show; + m_showAttributes = _show; updateSigs(); updateComponentSize(); @@ -261,12 +262,12 @@ void ClassifierWidget::setShowAttSigs(bool _status) { if( !_status ) { - if (m_bShowAccess) + if (m_showAccess) m_ShowAttSigs = Uml::SignatureType::NoSig; else m_ShowAttSigs = Uml::SignatureType::NoSigNoVis; } - else if (m_bShowAccess) + else if (m_showAccess) m_ShowAttSigs = Uml::SignatureType::ShowSig; else m_ShowAttSigs = Uml::SignatureType::SigNoVis; @@ -278,7 +279,7 @@ void ClassifierWidget::toggleShowAtts() { - m_bShowAttributes = !m_bShowAttributes; + m_showAttributes = !m_showAttributes; updateSigs(); updateComponentSize(); update(); @@ -288,12 +289,12 @@ { if (m_ShowAttSigs == Uml::SignatureType::ShowSig || m_ShowAttSigs == Uml::SignatureType::SigNoVis) { - if (m_bShowAccess) { + if (m_showAccess) { m_ShowAttSigs = Uml::SignatureType::NoSig; } else { m_ShowAttSigs = Uml::SignatureType::NoSigNoVis; } - } else if (m_bShowAccess) { + } else if (m_showAccess) { m_ShowAttSigs = Uml::SignatureType::ShowSig; } else { m_ShowAttSigs = Uml::SignatureType::SigNoVis; @@ -307,7 +308,7 @@ int count = 0; UMLClassifierListItemList list = classifier()->getFilteredList(ot); foreach (UMLClassifierListItem *m , list ) { - if (!(m_bShowPublicOnly && m->visibility() != Uml::Visibility::Public)) + if (!(m_showPublicOnly && m->visibility() != Uml::Visibility::Public)) count++; } return count; @@ -315,7 +316,7 @@ int ClassifierWidget::displayedOperations() { - if (!m_bShowOperations) + if (!m_showOperations) return 0; return displayedMembers(UMLObject::ot_Operation); } @@ -325,7 +326,7 @@ if (!m_pObject) { return UMLWidget::calculateSize(); } - if (classifier()->isInterface() && m_bDrawAsCircle) { + if (classifier()->isInterface() && m_drawAsCircle) { return calculateAsCircleSize(); } @@ -335,7 +336,7 @@ int width = 0, height = 0; // consider stereotype - if (m_bShowStereotype && !m_pObject->stereotype().isEmpty()) { + if (m_showStereotype && !m_pObject->stereotype().isEmpty()) { height += fontHeight; // ... width const QFontMetrics &bfm = UMLWidget::getFontMetrics(UMLWidget::FT_BOLD); @@ -348,12 +349,11 @@ height += fontHeight; // ... width QString displayedName; - if (m_bShowPackage) + if (m_showPackage) displayedName = m_pObject->fullyQualifiedName(); else displayedName = m_pObject->name(); const UMLWidget::FontType nft = (m_pObject->isAbstract() ? FT_BOLD_ITALIC : FT_BOLD); - //const int nameWidth = getFontMetrics(nft).boundingRect(displayName).width(); const int nameWidth = UMLWidget::getFontMetrics(nft).size(0,displayedName).width(); if (nameWidth > width) width = nameWidth; @@ -367,7 +367,7 @@ // calculate width of the attributes UMLClassifierListItemList list = classifier()->getFilteredList(UMLObject::ot_Attribute); foreach (UMLClassifierListItem *a , list ) { - if (m_bShowPublicOnly && a->visibility() != Uml::Visibility::Public) + if (m_showPublicOnly && a->visibility() != Uml::Visibility::Public) continue; const int attWidth = fm.size(0,a->toString(m_ShowAttSigs)).width(); if (attWidth > width) @@ -384,7 +384,7 @@ // ... width UMLOperationList list(classifier()->getOpList()); foreach (UMLOperation* op , list) { - if (m_bShowPublicOnly && op->visibility() != Uml::Visibility::Public) + if (m_showPublicOnly && op->visibility() != Uml::Visibility::Public) continue; const QString displayedOp = op->toString(m_ShowOpSigs); UMLWidget::FontType oft; @@ -407,7 +407,7 @@ // allow for height margin - if (!m_bShowOperations && !m_bShowAttributes && !m_bShowStereotype) { + if (!m_showOperations && !m_showAttributes && !m_showStereotype) { height += MARGIN * 2; } @@ -525,7 +525,7 @@ int ClassifierWidget::displayedAttributes() { - if (!m_bShowAttributes) + if (!m_showAttributes) return 0; return displayedMembers(UMLObject::ot_Attribute); } @@ -549,15 +549,15 @@ return static_cast(m_pObject); } -void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) +void ClassifierWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) p.setBrush( UMLWidget::getFillColor() ); else - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); - if (classifier()->isInterface() && m_bDrawAsCircle) { + if (classifier()->isInterface() && m_drawAsCircle) { drawAsCircle(p, offsetX, offsetY); return; } @@ -611,8 +611,8 @@ font.setBold(true); QString stereo = m_pObject->stereotype(); /* if no stereotype is given we don't want to show the empty << >> */ - const bool showStereotype = (m_bShowStereotype && !stereo.isEmpty()); - const bool showNameOnly = (!m_bShowOperations && !m_bShowAttributes && !showStereotype); + const bool showStereotype = (m_showStereotype && !stereo.isEmpty()); + const bool showNameOnly = (!m_showOperations && !m_showAttributes && !showStereotype); int nameHeight = fontHeight; if (showNameOnly) { nameHeight = h; @@ -625,7 +625,7 @@ // draw name QString name; - if (m_bShowPackage) { + if (m_showPackage) { name = m_pObject->fullyQualifiedName(); } else { name = this->name(); @@ -645,7 +645,7 @@ // draw attributes const int numAtts = displayedAttributes(); - if (m_bShowAttributes) { + if (m_showAttributes) { drawMembers(p, UMLObject::ot_Attribute, m_ShowAttSigs, textX, m_bodyOffsetY, fontHeight); } @@ -662,12 +662,12 @@ } // draw operations - if (m_bShowOperations) { + if (m_showOperations) { drawMembers(p, UMLObject::ot_Operation, m_ShowOpSigs, textX, m_bodyOffsetY, fontHeight); } - if (UMLWidget::m_bSelected) + if (UMLWidget::m_selected) UMLWidget::drawSelected(&p, offsetX, offsetY); } @@ -678,7 +678,7 @@ const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); QString name; - if ( m_bShowPackage ) { + if ( m_showPackage ) { name = m_pObject->fullyQualifiedName(); } else { name = this->name(); @@ -691,7 +691,7 @@ p.setFont(font); p.drawText(offsetX, offsetY + CIRCLE_SIZE, w, fontHeight, Qt::AlignCenter, name); - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } @@ -705,7 +705,7 @@ int width = CIRCLE_SIZE; QString displayedName; - if (m_bShowPackage) { + if (m_showPackage) { displayedName = m_pObject->fullyQualifiedName(); } else { displayedName = m_pObject->name(); @@ -725,7 +725,7 @@ f.setBold(false); UMLClassifierListItemList list = classifier()->getFilteredList(ot); foreach (UMLClassifierListItem *obj , list ) { - if (m_bShowPublicOnly && obj->visibility() != Uml::Visibility::Public) + if (m_showPublicOnly && obj->visibility() != Uml::Visibility::Public) continue; QString text = obj->toString(sigType); f.setItalic( obj->isAbstract() ); @@ -742,19 +742,19 @@ void ClassifierWidget::setDrawAsCircle(bool drawAsCircle) { - m_bDrawAsCircle = drawAsCircle; + m_drawAsCircle = drawAsCircle; updateComponentSize(); update(); } bool ClassifierWidget::getDrawAsCircle() const { - return m_bDrawAsCircle; + return m_drawAsCircle; } void ClassifierWidget::toggleDrawAsCircle() { - m_bDrawAsCircle = !m_bDrawAsCircle; + m_drawAsCircle = !m_drawAsCircle; updateSigs(); updateComponentSize(); update(); @@ -765,9 +765,9 @@ WidgetBase::setBaseType(WidgetBase::wt_Class); classifier()->setBaseType(UMLObject::ot_Class); - const Settings::OptionState& ops = m_pView->optionState(); - m_bShowAttributes = ops.classState.showAtts; - m_bShowStereotype = ops.classState.showStereoType; + const Settings::OptionState& ops = m_scene->optionState(); + m_showAttributes = ops.classState.showAtts; + m_showStereotype = ops.classState.showStereoType; updateComponentSize(); update(); @@ -778,8 +778,8 @@ WidgetBase::setBaseType(WidgetBase::wt_Interface); classifier()->setBaseType(UMLObject::ot_Interface); - m_bShowAttributes = false; - m_bShowStereotype = true; + m_showAttributes = false; + m_showStereotype = true; updateComponentSize(); update(); @@ -805,17 +805,17 @@ else conceptElement = qDoc.createElement("classwidget"); UMLWidget::saveToXMI( qDoc, conceptElement ); - conceptElement.setAttribute( "showoperations", m_bShowOperations ); - conceptElement.setAttribute( "showpubliconly", m_bShowPublicOnly ); + conceptElement.setAttribute( "showoperations", m_showOperations ); + conceptElement.setAttribute( "showpubliconly", m_showPublicOnly ); conceptElement.setAttribute( "showopsigs", m_ShowOpSigs ); - conceptElement.setAttribute( "showpackage", m_bShowPackage ); - conceptElement.setAttribute( "showscope", m_bShowAccess ); + conceptElement.setAttribute( "showpackage", m_showPackage ); + conceptElement.setAttribute( "showscope", m_showAccess ); if (! umlc->isInterface()) { - conceptElement.setAttribute("showattributes", m_bShowAttributes); + conceptElement.setAttribute("showattributes", m_showAttributes); conceptElement.setAttribute("showattsigs", m_ShowAttSigs); } if (umlc->isInterface() || umlc->isAbstract()) - conceptElement.setAttribute("drawascircle", m_bDrawAsCircle); + conceptElement.setAttribute("drawascircle", m_drawAsCircle); qElement.appendChild( conceptElement ); } @@ -832,14 +832,14 @@ QString showscope = qElement.attribute( "showscope", "0" ); QString drawascircle = qElement.attribute("drawascircle", "0"); - m_bShowAttributes = (bool)showatts.toInt(); - m_bShowOperations = (bool)showops.toInt(); - m_bShowPublicOnly = (bool)showpubliconly.toInt(); + m_showAttributes = (bool)showatts.toInt(); + m_showOperations = (bool)showops.toInt(); + m_showPublicOnly = (bool)showpubliconly.toInt(); m_ShowAttSigs = Uml::SignatureType::Value(showattsigs.toInt()); m_ShowOpSigs = Uml::SignatureType::Value(showopsigs.toInt()); - m_bShowPackage = (bool)showpackage.toInt(); - m_bShowAccess = (bool)showscope.toInt(); - m_bDrawAsCircle = (bool)drawascircle.toInt(); + m_showPackage = (bool)showpackage.toInt(); + m_showAccess = (bool)showscope.toInt(); + m_drawAsCircle = (bool)drawascircle.toInt(); return true; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/classifierwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/classifierwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/classifierwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/classifierwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -32,10 +32,10 @@ /** * Constructs a ClassifierWidget. * - * @param view The parent of this ClassifierWidget. + * @param scene The parent of this ClassifierWidget. * @param o The UMLObject to represent. */ - ClassifierWidget(UMLView * view, UMLClassifier * o); + ClassifierWidget(UMLScene * scene, UMLClassifier * o); /** * Destructor. @@ -162,7 +162,7 @@ * @return True if attributes are shown. */ bool getShowAtts() const { - return m_bShowAttributes; + return m_showAttributes; } /** @@ -269,7 +269,7 @@ * Overrides standard method. * Auxiliary to reimplementations in the derived classes. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Extends base method to adjust also the association of a class @@ -335,13 +335,13 @@ QSize calculateAsCircleSize(); /** - * Updates m_ShowOpSigs to match m_bShowVisibility. + * Updates m_ShowOpSigs to match m_showVisibility. */ void updateSigs(); /** * Return the number of displayed members of the given ObjectType. - * Takes into consideration m_bShowPublicOnly but not other settings, + * Takes into consideration m_showPublicOnly but not other settings, */ int displayedMembers(UMLObject::ObjectType ot); @@ -359,12 +359,12 @@ void drawMembers(QPainter & p, UMLObject::ObjectType ot, Uml::SignatureType sigType, int x, int y, int fontHeight); - bool m_bShowOperations; ///< Loaded/saved item. - bool m_bShowPublicOnly; ///< Loaded/saved item. - bool m_bShowAccess; ///< Loaded/saved item. - bool m_bShowPackage; ///< Loaded/saved item. - bool m_bShowAttributes; ///< Loaded/saved item. - bool m_bDrawAsCircle; ///< Loaded/saved item. + bool m_showOperations; ///< Loaded/saved item. + bool m_showPublicOnly; ///< Loaded/saved item. + bool m_showAccess; ///< Loaded/saved item. + bool m_showPackage; ///< Loaded/saved item. + bool m_showAttributes; ///< Loaded/saved item. + bool m_drawAsCircle; ///< Loaded/saved item. Uml::SignatureType m_ShowAttSigs; ///< Loaded/saved item. Uml::SignatureType m_ShowOpSigs; ///< Loaded/saved item. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/combinedfragmentwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/combinedfragmentwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/combinedfragmentwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/combinedfragmentwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -28,8 +28,8 @@ #include "listpopupmenu.h" #include "dialog_utils.h" -CombinedFragmentWidget::CombinedFragmentWidget(UMLView * view, CombinedFragmentType combinedfragmentType, Uml::IDType id ) - : UMLWidget(view, id) +CombinedFragmentWidget::CombinedFragmentWidget(UMLScene * scene, CombinedFragmentType combinedfragmentType, Uml::IDType id ) + : UMLWidget(scene, id) { UMLWidget::setBaseType( WidgetBase::wt_CombinedFragment ); setCombinedFragmentType( combinedfragmentType ); @@ -43,7 +43,7 @@ } } -void CombinedFragmentWidget::draw(QPainter & p, int offsetX, int offsetY) +void CombinedFragmentWidget::paint(QPainter & p, int offsetX, int offsetY) { int w = width(); int h = height(); @@ -121,7 +121,7 @@ p.drawText(offsetX + COMBINED_FRAGMENT_MARGIN, offsetY , w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, "alt"); // dash lines - m_dashLines.first()->draw(p,getX(),getY()); + m_dashLines.first()->paint(p,getX(),getY()); for(QList::iterator it=m_dashLines.begin() ; it!=m_dashLines.end() ; ++it) { (*it)->setX(getX()); old_Y = (*it)->getYMin(); @@ -138,7 +138,7 @@ w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, "parallel"); // dash lines if (m_dashLines.size() != 0) { - m_dashLines.first()->draw(p,getX(),getY()); + m_dashLines.first()->paint(p,getX(),getY()); for(QList::iterator it=m_dashLines.begin() ; it!=m_dashLines.end() ; ++it) { (*it)->setX(getX()); old_Y = (*it)->getYMin(); @@ -158,7 +158,7 @@ p.drawLine(offsetX + line_width, offsetY + 20, offsetX + line_width + 10, offsetY + 10); p.drawLine(offsetX + line_width + 10, offsetY + 10, offsetX + line_width + 10, offsetY); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -189,11 +189,11 @@ void CombinedFragmentWidget::setCombinedFragmentType( CombinedFragmentType combinedfragmentType ) { m_CombinedFragment = combinedfragmentType; - UMLWidget::m_bResizable = true ; //(m_CombinedFragment == Normal); + UMLWidget::m_resizable = true ; //(m_CombinedFragment == Normal); // creates a dash line if the combined fragment type is alternative or parallel if(m_CombinedFragment == Alt && m_dashLines.isEmpty()) { - m_dashLines.push_back(new FloatingDashLineWidget(m_pView)); + m_dashLines.push_back(new FloatingDashLineWidget(m_scene)); if(m_CombinedFragment == Alt) { m_dashLines.back()->setText("else"); @@ -203,7 +203,7 @@ m_dashLines.back()->setYMax(getY() + getHeight()); m_dashLines.back()->setY(getY() + height()/2); m_dashLines.back()->setSize(getWidth(), 0); - m_pView->setupNewWidget(m_dashLines.back()); + m_scene->setupNewWidget(m_dashLines.back()); } } @@ -294,7 +294,7 @@ while ( !element.isNull() ) { QString tag = element.tagName(); if (tag == "floatingdashlinewidget") { - FloatingDashLineWidget * fdlwidget = new FloatingDashLineWidget(m_pView); + FloatingDashLineWidget * fdlwidget = new FloatingDashLineWidget(m_scene); m_dashLines.push_back(fdlwidget); if( !fdlwidget->loadFromXMI(element) ) { // Most likely cause: The FloatingTextWidget is empty. @@ -302,7 +302,7 @@ return false; } else { - m_pView->setupNewWidget(fdlwidget); + m_scene->setupNewWidget(fdlwidget); } } else { uError() << "unknown tag " << tag; @@ -324,7 +324,7 @@ switch (sel) { // for alternative or parallel combined fragments case ListPopupMenu::mt_AddInteractionOperand: - m_dashLines.push_back(new FloatingDashLineWidget(m_pView)); + m_dashLines.push_back(new FloatingDashLineWidget(m_scene)); if(m_CombinedFragment == Alt) { m_dashLines.back()->setText("else"); @@ -334,7 +334,7 @@ m_dashLines.back()->setYMax(getY() + getHeight()); m_dashLines.back()->setY(getY() + getHeight() / 2); m_dashLines.back()->setSize(getWidth(), 0); - m_pView->setupNewWidget(m_dashLines.back()); + m_scene->setupNewWidget(m_dashLines.back()); break; case ListPopupMenu::mt_Rename: diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/combinedfragmentwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/combinedfragmentwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/combinedfragmentwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/combinedfragmentwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -54,11 +54,11 @@ /** * Creates a Combined Fragment widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param combinedfragmentType The type of combined fragment. * @param id The ID to assign (-1 will prompt a new ID.) */ - explicit CombinedFragmentWidget( UMLView * view, CombinedFragmentType combinedfragmentType = Ref, Uml::IDType id = Uml::id_None ); + explicit CombinedFragmentWidget( UMLScene * scene, CombinedFragmentType combinedfragmentType = Ref, Uml::IDType id = Uml::id_None ); /** @@ -69,7 +69,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Returns the type of combined fragment. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/componentwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/componentwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/componentwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/componentwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -19,8 +19,8 @@ #include "debug_utils.h" #include "umlview.h" -ComponentWidget::ComponentWidget(UMLView * view, UMLComponent *c) - : UMLWidget(view, c) +ComponentWidget::ComponentWidget(UMLScene * scene, UMLComponent *c) + : UMLWidget(scene, c) { init(); } @@ -30,11 +30,11 @@ UMLWidget::setBaseType(WidgetBase::wt_Component); setSize(100, 30); m_pMenu = 0; - //set defaults from m_pView - if (m_pView) { + //set defaults from m_scene + if (m_scene) { //check to see if correct - const Settings::OptionState& ops = m_pView->optionState(); - m_bShowStereotype = ops.classState.showStereoType; + const Settings::OptionState& ops = m_scene->optionState(); + m_showStereotype = ops.classState.showStereoType; } //maybe loading and this may not be set. if (m_pObject) { @@ -47,7 +47,7 @@ { } -void ComponentWidget::draw(QPainter & p, int offsetX, int offsetY) +void ComponentWidget::paint(QPainter & p, int offsetX, int offsetY) { UMLComponent *umlcomp = static_cast(m_pObject); if (umlcomp == NULL) @@ -61,7 +61,7 @@ if ( UMLWidget::getUseFillColour() ) { p.setBrush( UMLWidget::getFillColor() ); } else { - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); } const int w = width(); @@ -103,7 +103,7 @@ w - (COMPONENT_MARGIN*4), fontHeight, Qt::AlignCenter, nameStr ); } - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/componentwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/componentwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/componentwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/componentwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -33,10 +33,10 @@ /** * Constructs a ComponentWidget. * - * @param view The parent of this ComponentWidget. + * @param scene The parent of this ComponentWidget. * @param c The UMLComponent this will be representing. */ - ComponentWidget(UMLView * view, UMLComponent *c); + ComponentWidget(UMLScene * scene, UMLComponent *c); /** * destructor @@ -46,7 +46,7 @@ /** * Overrides standard method */ - void draw(QPainter& p, int offsetX, int offsetY); + void paint(QPainter& p, int offsetX, int offsetY); /** * Saves to the "componentwidget" XMI element. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/datatypewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/datatypewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/datatypewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/datatypewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -16,37 +16,44 @@ // app includes #include "classifier.h" +#include "classifierlistitem.h" #include "debug_utils.h" #include "operation.h" -#include "classifierlistitem.h" -#include "umlview.h" #include "umldoc.h" +#include "umlview.h" #define CIRCLE_SIZE 30 -DatatypeWidget::DatatypeWidget(UMLView* view, UMLClassifier *d) : UMLWidget(view, d) + +/** + * Constructs an DatatypeWidget. + * + * @param scene The parent of this DatatypeWidget. + * @param d The UMLClassifier this will be representing. + */ +DatatypeWidget::DatatypeWidget(UMLScene *scene, UMLClassifier *d) + : UMLWidget(scene, d) { init(); } +/** + * Standard deconstructor. + */ DatatypeWidget::~DatatypeWidget() { } -void DatatypeWidget::init() -{ - UMLWidget::setBaseType(WidgetBase::wt_Datatype); - setSize(100, 30); - m_pMenu = 0; -} - -void DatatypeWidget::draw(QPainter& p, int offsetX, int offsetY) +/** + * Overrides standard method. + */ +void DatatypeWidget::paint(QPainter& p, int offsetX, int offsetY) { setPenFromSettings(p); if (UMLWidget::getUseFillColour()) { p.setBrush(UMLWidget::getFillColor()); } else { - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); } int w = width(); @@ -70,11 +77,32 @@ p.drawText(offsetX + DATATYPE_MARGIN, offsetY + fontHeight, w - DATATYPE_MARGIN * 2, fontHeight, Qt::AlignCenter, name()); - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * Loads from a "datatypewidget" XMI element. + */ +bool DatatypeWidget::loadFromXMI( QDomElement & qElement ) +{ + return UMLWidget::loadFromXMI(qElement); +} + +/** + * Saves to the "datatypewidget" XMI element. + */ +void DatatypeWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement conceptElement = qDoc.createElement("datatypewidget"); + UMLWidget::saveToXMI(qDoc, conceptElement); + qElement.appendChild(conceptElement); +} + +/** + * Overrides method from UMLWidget. + */ QSize DatatypeWidget::calculateSize() { if (!m_pObject) { @@ -104,15 +132,12 @@ return QSize(width, height); } -void DatatypeWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement conceptElement = qDoc.createElement("datatypewidget"); - UMLWidget::saveToXMI(qDoc, conceptElement); - qElement.appendChild(conceptElement); -} - -bool DatatypeWidget::loadFromXMI( QDomElement & qElement ) +/** + * Initializes key variables of the class. + */ +void DatatypeWidget::init() { - return UMLWidget::loadFromXMI(qElement); + UMLWidget::setBaseType(WidgetBase::wt_Datatype); + setSize(100, 30); + m_pMenu = 0; } - diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/datatypewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/datatypewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/datatypewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/datatypewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -5,7 +5,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * copyright (C) 2003-2007 * + * copyright (C) 2003-2011 * * Umbrello UML Modeller Authors * ***************************************************************************/ @@ -29,45 +29,20 @@ */ class DatatypeWidget : public UMLWidget { public: - - /** - * Constructs an DatatypeWidget. - * - * @param view The parent of this DatatypeWidget. - * @param d The UMLClassifier this will be representing. - */ - DatatypeWidget(UMLView* view, UMLClassifier *d); - - /** - * Standard deconstructor. - */ + DatatypeWidget(UMLScene *scene, UMLClassifier *d); virtual ~DatatypeWidget(); - /** - * Overrides standard method. - */ - void draw(QPainter& p, int offsetX, int offsetY); + void paint(QPainter& p, int offsetX, int offsetY); - /** - * Saves to the "datatypewidget" XMI element. - */ + bool loadFromXMI(QDomElement& qElement); void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - /** - * Loads from a "datatypewidget" XMI element. - */ - bool loadFromXMI(QDomElement& qElement); +public Q_SLOTS: protected: - /** - * Overrides method from UMLWidget. - */ QSize calculateSize(); private: - /** - * Initializes key variables of the class. - */ void init(); /** @@ -75,7 +50,6 @@ */ ListPopupMenu* m_pMenu; -public slots: }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/entitywidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/entitywidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/entitywidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/entitywidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -11,55 +12,50 @@ // own header #include "entitywidget.h" -// qt/kde includes -#include - // app includes +#include "classifier.h" +#include "classifierlistitem.h" #include "debug_utils.h" #include "entity.h" #include "entityattribute.h" -#include "uniqueconstraint.h" #include "foreignkeyconstraint.h" -#include "classifier.h" -#include "umlclassifierlistitemlist.h" -#include "classifierlistitem.h" -#include "umlview.h" -#include "umldoc.h" -#include "uml.h" #include "listpopupmenu.h" #include "object_factory.h" +#include "uml.h" +#include "umlclassifierlistitemlist.h" +#include "umldoc.h" +#include "umlview.h" +#include "uniqueconstraint.h" -EntityWidget::EntityWidget(UMLView* view, UMLObject* o) - : UMLWidget(view, o) +/** + * Constructs an EntityWidget. + * + * @param scene The parent of this EntityWidget. + * @param o The UMLObject this will be representing. + */ +EntityWidget::EntityWidget(UMLScene *scene, UMLObject* o) + : UMLWidget(scene, o) { init(); } -void EntityWidget::init() -{ - UMLWidget::setBaseType(WidgetBase::wt_Entity); - setSize(100, 30); - - //set defaults from m_pView - if (m_pView) { - //check to see if correct - //const Settings::OptionState& ops = m_pView->getOptionState(); - } - if (! UMLApp::app()->document()->loading()) - updateComponentSize(); -} - +/** + * Destructor. + */ EntityWidget::~EntityWidget() { } -void EntityWidget::draw(QPainter& p, int offsetX, int offsetY) +/** + * Draws the entity as a rectangle with a box underneith with a list of literals + */ +void EntityWidget::paint(QPainter& p, int offsetX, int offsetY) { setPenFromSettings(p); if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColor()); else - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); const int w = width(); const int h = height(); @@ -123,11 +119,75 @@ y+=fontHeight; } - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * Saves to the "entitywidget" XMI element. + */ +void EntityWidget::saveToXMI( QDomDocument& qDoc, QDomElement& qElement ) +{ + QDomElement conceptElement = qDoc.createElement("entitywidget"); + UMLWidget::saveToXMI(qDoc, conceptElement); + qElement.appendChild(conceptElement); +} + +/** + * Will be called when a menu selection has been made from the popup + * menu. + * + * @param action The action that has been selected. + */ +void EntityWidget::slotMenuSelection(QAction* action) +{ + ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + switch(sel) { + case ListPopupMenu::mt_EntityAttribute: + if (Object_Factory::createChildObject(static_cast(m_pObject), + UMLObject::ot_EntityAttribute) ) { + UMLApp::app()->document()->setModified(); + } + break; + + case ListPopupMenu::mt_PrimaryKeyConstraint: + case ListPopupMenu::mt_UniqueConstraint: + if ( UMLObject* obj = Object_Factory::createChildObject(static_cast(m_pObject), + UMLObject::ot_UniqueConstraint) ) { + UMLApp::app()->document()->setModified(); + + if ( sel == ListPopupMenu::mt_PrimaryKeyConstraint ) { + UMLUniqueConstraint* uc = static_cast(obj); + static_cast(m_pObject)->setAsPrimaryKey(uc); + } + } + break; + + case ListPopupMenu::mt_ForeignKeyConstraint: + if (Object_Factory::createChildObject(static_cast(m_pObject), + UMLObject::ot_ForeignKeyConstraint) ) { + UMLApp::app()->document()->setModified(); + + } + break; + + case ListPopupMenu::mt_CheckConstraint: + if (Object_Factory::createChildObject(static_cast(m_pObject), + UMLObject::ot_CheckConstraint) ) { + UMLApp::app()->document()->setModified(); + + } + break; + + default: + UMLWidget::slotMenuSelection(action); + } +} + +/** + * Overrides method from UMLWidget. + */ QSize EntityWidget::calculateSize() { if (!m_pObject) { @@ -184,64 +244,19 @@ return QSize(width, height); } -void EntityWidget::slotMenuSelection(QAction* action) -{ - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); - switch(sel) { - case ListPopupMenu::mt_EntityAttribute: - if (Object_Factory::createChildObject(static_cast(m_pObject), - UMLObject::ot_EntityAttribute) ) { - UMLApp::app()->document()->setModified(); - } - break; - - case ListPopupMenu::mt_PrimaryKeyConstraint: - case ListPopupMenu::mt_UniqueConstraint: - if ( UMLObject* obj = Object_Factory::createChildObject(static_cast(m_pObject), - UMLObject::ot_UniqueConstraint) ) { - UMLApp::app()->document()->setModified(); - - if ( sel == ListPopupMenu::mt_PrimaryKeyConstraint ) { - UMLUniqueConstraint* uc = static_cast(obj); - static_cast(m_pObject)->setAsPrimaryKey(uc); - } - } - break; - - case ListPopupMenu::mt_ForeignKeyConstraint: - if (Object_Factory::createChildObject(static_cast(m_pObject), - UMLObject::ot_ForeignKeyConstraint) ) { - UMLApp::app()->document()->setModified(); - - } - break; - - case ListPopupMenu::mt_CheckConstraint: - if (Object_Factory::createChildObject(static_cast(m_pObject), - UMLObject::ot_CheckConstraint) ) { - UMLApp::app()->document()->setModified(); - - } - break; - - default: - UMLWidget::slotMenuSelection(action); - } - -} - -void EntityWidget::saveToXMI( QDomDocument& qDoc, QDomElement& qElement ) +/** + * Initializes key variables of the class. + */ +void EntityWidget::init() { - QDomElement conceptElement = qDoc.createElement("entitywidget"); - UMLWidget::saveToXMI(qDoc, conceptElement); - qElement.appendChild(conceptElement); -} + UMLWidget::setBaseType(WidgetBase::wt_Entity); + setSize(100, 30); -bool EntityWidget::loadFromXMI( QDomElement & qElement ) -{ - if ( !UMLWidget::loadFromXMI(qElement) ) { - return false; + //set defaults from m_scene + if (m_scene) { + //check to see if correct + //const Settings::OptionState& ops = m_scene->getOptionState(); } - return true; + if (! UMLApp::app()->document()->loading()) + updateComponentSize(); } - diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/entitywidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/entitywidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/entitywidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/entitywidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -13,7 +14,7 @@ #include "umlwidget.h" -class UMLView; +class UMLScene; #define ENTITY_MARGIN 5 @@ -28,55 +29,26 @@ */ class EntityWidget : public UMLWidget { + Q_OBJECT public: + explicit EntityWidget(UMLScene *scene, UMLObject* o); + virtual ~EntityWidget(); - /** - * Constructs an EntityWidget. - * - * @param view The parent of this EntityWidget. - * @param o The UMLObject this will be representing. - */ - EntityWidget(UMLView* view, UMLObject* o); - - /** - * Standard deconstructor. - */ - ~EntityWidget(); - - /** - * Initializes key variables of the class. - */ - void init(); - /** - * Draws the entity as a rectangle with a box underneith with a list of literals - */ - void draw(QPainter& p, int offsetX, int offsetY); - - /** - * Saves to the "entitywidget" XMI element. - */ - void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - - /** - * Loads from an "entitywidget" XMI element. - */ - bool loadFromXMI(QDomElement& qElement); + virtual void paint(QPainter& p, int offsetX, int offsetY); + + // UMLWidget::loadFromXMI is used to load this widget. + virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + +public Q_SLOTS: + virtual void slotMenuSelection(QAction* action); protected: - /** - * Overrides method from UMLWidget. - */ QSize calculateSize(); -public slots: - /** - * Will be called when a menu selection has been made from the - * popup menu. - * - * @param action The action that has been selected. - */ - void slotMenuSelection(QAction* action); +private: + void init(); + }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/enumwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/enumwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/enumwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/enumwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,56 +11,83 @@ // own header #include "enumwidget.h" -// qt/kde includes -#include - // app includes +#include "classifier.h" +#include "classifierlistitem.h" #include "debug_utils.h" #include "enum.h" #include "enumliteral.h" -#include "classifier.h" -#include "umlclassifierlistitemlist.h" -#include "classifierlistitem.h" -#include "umlview.h" -#include "umldoc.h" -#include "uml.h" #include "listpopupmenu.h" #include "object_factory.h" +#include "uml.h" +#include "umlclassifierlistitemlist.h" +#include "umldoc.h" +#include "umlscene.h" + -EnumWidget::EnumWidget(UMLView* view, UMLObject* o) - : UMLWidget(view, o) +/** + * Constructs an instance of EnumWidget. + * + * @param scene The parent of this EnumWidget. + * @param o The UMLObject this will be representing. + */ +EnumWidget::EnumWidget(UMLScene *scene, UMLObject* o) + : UMLWidget(scene, o), + m_showPackage(false) { init(); } -void EnumWidget::init() +/** + * Destructor. + */ +EnumWidget::~EnumWidget() { - UMLWidget::setBaseType(WidgetBase::wt_Enum); - setSize(100, 30); - //set defaults from m_pView - if (m_pView) { - //check to see if correct - const Settings::OptionState& ops = m_pView->optionState(); - m_bShowPackage = ops.classState.showPackage; - } else { - // For completeness only. Not supposed to happen. - m_bShowPackage = false; - } - if (! UMLApp::app()->document()->loading()) - updateComponentSize(); } -EnumWidget::~EnumWidget() +/** + * Returns the status of whether to show Package. + * + * @return True if package is shown. + */ +bool EnumWidget::showPackage() const +{ + return m_showPackage; +} + +/** + * Set the status of whether to show Package. + * + * @param _status True if package shall be shown. + */ +void EnumWidget::setShowPackage(bool _status) { + m_showPackage = _status; + updateComponentSize(); + update(); } -void EnumWidget::draw(QPainter& p, int offsetX, int offsetY) +/** + * Toggles the status of whether to show package. + */ +void EnumWidget::toggleShowPackage() +{ + m_showPackage = !m_showPackage; + updateComponentSize(); + update(); +} + +/** + * Draws the enum as a rectangle with a box underneith with a list of literals + * Reimplemented from UMLWidget::paint + */ +void EnumWidget::paint(QPainter& p, int offsetX, int offsetY) { setPenFromSettings(p); if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColor()); else - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); const int w = width(); const int h = height(); @@ -68,7 +95,7 @@ const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); QString name; - if ( m_bShowPackage ) { + if ( m_showPackage ) { name = m_pObject->fullyQualifiedName(); } else { name = this->name(); @@ -110,11 +137,64 @@ y+=fontHeight; } - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } +/** + * Loads from an "enumwidget" XMI element. + */ +bool EnumWidget::loadFromXMI( QDomElement & qElement ) +{ + if ( !UMLWidget::loadFromXMI(qElement) ) { + return false; + } + QString showpackage = qElement.attribute("showpackage", "0"); + + m_showPackage = (bool)showpackage.toInt(); + + return true; +} + +/** + * Saves to the "enumwidget" XMI element. + */ +void EnumWidget::saveToXMI( QDomDocument& qDoc, QDomElement& qElement ) +{ + QDomElement conceptElement = qDoc.createElement("enumwidget"); + UMLWidget::saveToXMI(qDoc, conceptElement); + + conceptElement.setAttribute("showpackage", m_showPackage); + qElement.appendChild(conceptElement); +} + +/** + * Will be called when a menu selection has been made from the + * popup menu. + * + * @param action The action that has been selected. + */ +void EnumWidget::slotMenuSelection(QAction* action) +{ + ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + if (sel == ListPopupMenu::mt_EnumLiteral) { + if (Object_Factory::createChildObject(static_cast(m_pObject), + UMLObject::ot_EnumLiteral) ) { + /* I don't know why it works without these calls: + updateComponentSize(); + update(); + */ + UMLApp::app()->document()->setModified(); + } + return; + } + UMLWidget::slotMenuSelection(action); +} + +/** + * Overrides method from UMLWidget. + */ QSize EnumWidget::calculateSize() { if (!m_pObject) { @@ -147,7 +227,7 @@ //now set the width of the concept //set width to name to start with - if (m_bShowPackage) { + if (m_showPackage) { width = getFontMetrics(FT_BOLD_ITALIC).boundingRect(m_pObject->fullyQualifiedName()).width(); } else { width = getFontMetrics(FT_BOLD_ITALIC).boundingRect(name()).width(); @@ -171,60 +251,22 @@ return QSize(width, height); } -void EnumWidget::slotMenuSelection(QAction* action) -{ - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); - if (sel == ListPopupMenu::mt_EnumLiteral) { - if (Object_Factory::createChildObject(static_cast(m_pObject), - UMLObject::ot_EnumLiteral) ) { - /* I don't know why it works without these calls: - updateComponentSize(); - update(); - */ - UMLApp::app()->document()->setModified(); - } - return; - } - UMLWidget::slotMenuSelection(action); -} - -void EnumWidget::setShowPackage(bool _status) -{ - m_bShowPackage = _status; - updateComponentSize(); - update(); -} - -bool EnumWidget::getShowPackage() const -{ - return m_bShowPackage; -} - -void EnumWidget::saveToXMI( QDomDocument& qDoc, QDomElement& qElement ) -{ - QDomElement conceptElement = qDoc.createElement("enumwidget"); - UMLWidget::saveToXMI(qDoc, conceptElement); - - conceptElement.setAttribute("showpackage", m_bShowPackage); - qElement.appendChild(conceptElement); -} - -bool EnumWidget::loadFromXMI( QDomElement & qElement ) +/** + * Initializes key variables of the class. + */ +void EnumWidget::init() { - if ( !UMLWidget::loadFromXMI(qElement) ) { - return false; + UMLWidget::setBaseType(WidgetBase::wt_Enum); + setSize(100, 30); + //set defaults from m_scene + if (m_scene) { + //check to see if correct + const Settings::OptionState& ops = m_scene->optionState(); + m_showPackage = ops.classState.showPackage; + } else { + // For completeness only. Not supposed to happen. + m_showPackage = false; } - QString showpackage = qElement.attribute("showpackage", "0"); - - m_bShowPackage = (bool)showpackage.toInt(); - - return true; -} - -void EnumWidget::toggleShowPackage() -{ - m_bShowPackage = !m_bShowPackage; - updateComponentSize(); - update(); + if (! UMLApp::app()->document()->loading()) + updateComponentSize(); } - diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/enumwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/enumwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/enumwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/enumwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -12,9 +12,10 @@ #ifndef ENUMWIDGET_H #define ENUMWIDGET_H + #include "umlwidget.h" -class UMLView; +class UMLScene; #define ENUM_MARGIN 5 @@ -27,79 +28,33 @@ * @see UMLWidget * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class EnumWidget : public UMLWidget { +class EnumWidget : public UMLWidget +{ + Q_OBJECT public: + explicit EnumWidget(UMLScene *scene, UMLObject* o); + virtual ~EnumWidget(); - /** - * Constructs an EnumWidget. - * - * @param view The parent of this EnumWidget. - * @param o The UMLObject this will be representing. - */ - EnumWidget(UMLView* view, UMLObject* o); - - /** - * Standard deconstructor. - */ - ~EnumWidget(); - - /** - * Initializes key variables of the class. - */ - void init(); - - /** - * Returns the status of whether to show Package. - * - * @return True if package is shown. - */ - bool getShowPackage() const; - - /** - * Toggles the status of whether to show package. - */ + bool showPackage() const; + void setShowPackage(bool _status); void toggleShowPackage(); - /** - * Set the status of whether to show Package. - * - * @param _status True if package shall be shown. - */ - void setShowPackage(bool _status); + virtual void paint(QPainter& p, int offsetX, int offsetY); + + virtual bool loadFromXMI(QDomElement& qElement); + virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - /** - * Draws the enum as a rectangle with a box underneith with a list of literals - */ - void draw(QPainter& p, int offsetX, int offsetY); - - /** - * Saves to the "enumwidget" XMI element. - */ - void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - - /** - * Loads from an "enumwidget" XMI element. - */ - bool loadFromXMI(QDomElement& qElement); +public Q_SLOTS: + virtual void slotMenuSelection(QAction* action); protected: - /** - * Overrides method from UMLWidget. - */ QSize calculateSize(); - bool m_bShowPackage; + bool m_showPackage; private: + void init(); -public slots: - /** - * Will be called when a menu selection has been made from the - * popup menu. - * - * @param action The action that has been selected. - */ - void slotMenuSelection(QAction* action); }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/floatingdashlinewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/floatingdashlinewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/floatingdashlinewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/floatingdashlinewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -23,11 +23,11 @@ // qt includes #include -FloatingDashLineWidget::FloatingDashLineWidget(UMLView * view, Uml::IDType id) - : UMLWidget(view, id) +FloatingDashLineWidget::FloatingDashLineWidget(UMLScene * scene, Uml::IDType id) + : UMLWidget(scene, id) { UMLWidget::setBaseType(WidgetBase::wt_FloatingDashLine); - m_bResizable = false; + m_resizable = false; m_Text = ""; updateComponentSize(); } @@ -36,7 +36,7 @@ { } -void FloatingDashLineWidget::draw(QPainter & p, int /*offsetX*/, int /*offsetY*/) +void FloatingDashLineWidget::paint(QPainter & p, int /*offsetX*/, int /*offsetY*/) { const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); @@ -47,7 +47,7 @@ Qt::AlignLeft, '[' + m_Text + ']'); p.setPen(QPen(UMLWidget::lineColor(), 0, Qt::DashLine)); p.drawLine(getX(), getY(), getX() + getWidth(), getY()); - if(m_bSelected) + if(m_selected) drawSelected(&p, getX(), getY()); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/floatingdashlinewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/floatingdashlinewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/floatingdashlinewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/floatingdashlinewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -36,10 +36,10 @@ public: /** * Creates a floating dash line. - * @param view The parent of the widget + * @param scene The parent of the widget * @param id The ID to assign (-1 will prompt a new ID) */ - explicit FloatingDashLineWidget(UMLView * view, Uml::IDType id = Uml::id_None); + explicit FloatingDashLineWidget(UMLScene * scene, Uml::IDType id = Uml::id_None); /** * destructor @@ -49,7 +49,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); void slotMenuSelection(QAction* action); /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/floatingtextwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/floatingtextwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/floatingtextwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/floatingtextwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -42,14 +42,14 @@ /** * Constructs a FloatingTextWidget instance. * - * @param view The parent of this FloatingTextWidget. + * @param scene The parent of this FloatingTextWidget. * @param role The role this FloatingTextWidget will take up. * @param text The main text to display. * @param id The ID to assign (-1 will prompt a new ID.) */ -FloatingTextWidget::FloatingTextWidget(UMLView * view, Uml::TextRole role, +FloatingTextWidget::FloatingTextWidget(UMLScene * scene, Uml::TextRole role, const QString& text, Uml::IDType id) - : UMLWidget(view, id, new FloatingTextWidgetController(this)) + : UMLWidget(scene, id, new FloatingTextWidgetController(this)) { init(); m_Text = text; @@ -74,7 +74,7 @@ m_Type = WidgetBase::wt_Text; // initialize non-saved (i.e. volatile) data m_linkWidget = NULL; - UMLWidget::m_bResizable = false; + UMLWidget::m_resizable = false; } /** @@ -87,7 +87,7 @@ /** * Overrides default method */ -void FloatingTextWidget::draw(QPainter & p, int offsetX, int offsetY) +void FloatingTextWidget::paint(QPainter & p, int offsetX, int offsetY) { int w = width(); int h = height(); @@ -95,7 +95,7 @@ QColor textColor(50, 50, 50); p.setPen(textColor); p.drawText( offsetX, offsetY,w,h, Qt::AlignCenter, displayText() ); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -128,11 +128,11 @@ ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); switch(sel) { case ListPopupMenu::mt_Properties: - showProperties(); + showPropertiesDialog(); break; case ListPopupMenu::mt_Delete: - m_pView->removeWidget(this); + m_scene->removeWidget(this); break; case ListPopupMenu::mt_New_Operation: // needed by AssociationWidget @@ -147,7 +147,7 @@ bool ok = false; QString opText = KInputDialog::getText(i18nc("operation name", "Name"), i18n("Enter operation name:"), - text(), &ok, m_pView); + text(), &ok, m_scene); if (ok) m_linkWidget->setCustomOpText(opText); return; @@ -171,7 +171,7 @@ case ListPopupMenu::mt_Change_Font: { QFont font = UMLWidget::font(); - if( KFontDialog::getFont( font, KFontChooser::NoDisplayFlags, m_pView ) ) { + if( KFontDialog::getFont( font, KFontChooser::NoDisplayFlags, m_scene ) ) { if( m_textRole == Uml::TextRole::Floating || m_textRole == Uml::TextRole::Seq_Message ) { setFont( font ); } else if (m_linkWidget) { @@ -217,7 +217,7 @@ t = i18n("ERROR"); } bool ok = false; - QString newText = KInputDialog::getText(i18n("Rename"), t, text(), &ok, m_pView, &v); + QString newText = KInputDialog::getText(i18n("Rename"), t, text(), &ok, m_scene, &v); if (!ok || newText == text()) return; @@ -260,7 +260,7 @@ MessageWidget *msg = dynamic_cast(m_linkWidget); if (msg) { msg->setName(QString()); - m_pView->removeWidget(this); + m_scene->removeWidget(this); } } return; @@ -300,7 +300,7 @@ QString seqNum, op; m_linkWidget->seqNumAndOp(seqNum, op); if (seqNum.length() > 0 || op.length() > 0) { - if (! m_pView->getShowOpSig()) + if (! m_scene->getShowOpSig()) op.replace( QRegExp("\\(.*\\)"), "()" ); m_Text = seqNum.append(": ").append( op ); } else @@ -344,7 +344,7 @@ void FloatingTextWidget::showChangeTextDialog() { bool ok = false; - QString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), text(), &ok, m_pView); + QString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), text(), &ok, m_scene); if (ok && newText != text() && isTextValid(newText)) { setText( newText ); @@ -372,7 +372,7 @@ return; } - QPointer selectDlg = new SelectOpDlg(m_pView, c); + QPointer selectDlg = new SelectOpDlg(m_scene, c); selectDlg->setSeqNumber( seqNum ); if (m_linkWidget->operation() == NULL) { selectDlg->setCustomOp( opText ); @@ -549,7 +549,7 @@ * for the floating text widget, the rename dialog for floating text or * the options dialog for the link widget are shown. */ -void FloatingTextWidget::showProperties() +void FloatingTextWidget::showPropertiesDialog() { if (m_textRole == Uml::TextRole::Coll_Message || m_textRole == Uml::TextRole::Coll_Message_Self || m_textRole == Uml::TextRole::Seq_Message || m_textRole == Uml::TextRole::Seq_Message_Self) { diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/floatingtextwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/floatingtextwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/floatingtextwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/floatingtextwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -16,7 +16,7 @@ class FloatingTextWidgetController; class LinkWidget; -class UMLView; +class UMLScene; /** * @short Displays a line of text or an operation. @@ -51,7 +51,7 @@ static const int restrictPositionMin = 0; static const int restrictPositionMax = 3000; - explicit FloatingTextWidget(UMLView * view, Uml::TextRole role = Uml::TextRole::Floating, + explicit FloatingTextWidget(UMLScene * scene, Uml::TextRole role = Uml::TextRole::Floating, const QString& text = "", Uml::IDType id = Uml::id_None); virtual ~FloatingTextWidget(); @@ -96,14 +96,14 @@ static bool isTextValid(const QString &text); - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); void handleRename(); void changeName(const QString& newText); void showOperationDialog(); - void showProperties(); + void showPropertiesDialog(); void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); bool loadFromXMI( QDomElement & qElement ); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/forkjoinwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/forkjoinwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/forkjoinwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/forkjoinwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -23,12 +23,12 @@ /** * Constructs a ForkJoinWidget. * - * @param view The parent to this widget. + * @param scene The parent to this widget. * @param drawVertical Whether to draw the plate horizontally or vertically. * @param id The ID to assign (-1 will prompt a new ID.) */ -ForkJoinWidget::ForkJoinWidget(UMLView * view, bool drawVertical, Uml::IDType id) - : BoxWidget(view, id), m_drawVertical(drawVertical) +ForkJoinWidget::ForkJoinWidget(UMLScene * scene, bool drawVertical, Uml::IDType id) + : BoxWidget(scene, id), m_drawVertical(drawVertical) { init(); } @@ -64,11 +64,11 @@ /** * Draws a slim solid black rectangle. */ -void ForkJoinWidget::draw(QPainter& p, int offsetX, int offsetY) +void ForkJoinWidget::paint(QPainter& p, int offsetX, int offsetY) { p.fillRect( offsetX, offsetY, width(), height(), QBrush( Qt::black )); - if (m_bSelected) { + if (m_selected) { drawSelected(&p, offsetX, offsetY); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/forkjoinwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/forkjoinwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/forkjoinwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/forkjoinwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -18,7 +18,7 @@ #include // fwd decl. -class UMLView; +class UMLScene; /** * @short Displays a fork/join plate in a state diagram. @@ -30,7 +30,7 @@ { public: - explicit ForkJoinWidget(UMLView * view, bool drawVertical = false, Uml::IDType id = Uml::id_None); + explicit ForkJoinWidget(UMLScene * scene, bool drawVertical = false, Uml::IDType id = Uml::id_None); virtual ~ForkJoinWidget(); /** @@ -44,7 +44,7 @@ void slotMenuSelection(QAction* action); - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); bool loadFromXMI(QDomElement & qElement); void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/linkwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/linkwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/linkwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/linkwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -41,7 +41,7 @@ * Return the operation text. * When no view parameter is given, the current view * is taken instead. - * @param view the given view + * @param scene the given view * @return the operation text */ QString LinkWidget::operationText(UMLView *view) diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/linkwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/linkwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/linkwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/linkwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -19,6 +19,7 @@ class UMLClassifier; class UMLOperation; class FloatingTextWidget; +class UMLScene; class UMLView; /** @@ -69,7 +70,7 @@ */ virtual void setCustomOpText(const QString &opText) = 0; - QString operationText(UMLView *view = NULL); + QString operationText(UMLView *view = 0); virtual void resetTextPositions(); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/messagewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/messagewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/messagewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/messagewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -35,10 +35,10 @@ #include "uniqueid.h" #include "listpopupmenu.h" -MessageWidget::MessageWidget(UMLView * view, ObjectWidget* a, ObjectWidget* b, +MessageWidget::MessageWidget(UMLScene * scene, ObjectWidget* a, ObjectWidget* b, int y, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id /* = Uml::id_None */) - : UMLWidget(view, id, new MessageWidgetController(this)) + : UMLWidget(scene, id, new MessageWidgetController(this)) { init(); m_pOw[Uml::A] = a; @@ -58,15 +58,15 @@ this->activate(); } -MessageWidget::MessageWidget(UMLView * view, Uml::Sequence_Message_Type seqMsgType, Uml::IDType id) - : UMLWidget(view, id, new MessageWidgetController(this)) +MessageWidget::MessageWidget(UMLScene * scene, Uml::Sequence_Message_Type seqMsgType, Uml::IDType id) + : UMLWidget(scene, id, new MessageWidgetController(this)) { init(); m_sequenceMessageType = seqMsgType; } -MessageWidget::MessageWidget(UMLView * view, ObjectWidget* a, int xclick, int yclick, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id /*= Uml::id_None*/) - : UMLWidget(view, id, new MessageWidgetController(this)) +MessageWidget::MessageWidget(UMLScene * scene, ObjectWidget* a, int xclick, int yclick, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id /*= Uml::id_None*/) + : UMLWidget(scene, id, new MessageWidgetController(this)) { init(); m_pOw[Uml::A] = a; @@ -92,8 +92,8 @@ void MessageWidget::init() { UMLWidget::setBaseType(WidgetBase::wt_Message); - m_bIgnoreSnapToGrid = true; - m_bIgnoreSnapComponentSizeToGrid = true; + m_ignoreSnapToGrid = true; + m_ignoreSnapComponentSizeToGrid = true; m_pOw[Uml::A] = m_pOw[Uml::B] = NULL; m_pFText = NULL; m_nY = 0; @@ -108,12 +108,12 @@ { if (m_sequenceMessageType == Uml::sequence_message_synchronous || m_pOw[Uml::A] == m_pOw[Uml::B]) - UMLWidget::m_bResizable = true; + UMLWidget::m_resizable = true; else - UMLWidget::m_bResizable = false; + UMLWidget::m_resizable = false; } -void MessageWidget::draw(QPainter& p, int offsetX, int offsetY) +void MessageWidget::paint(QPainter& p, int offsetX, int offsetY) { if(!m_pOw[Uml::A] || !m_pOw[Uml::B]) { return; @@ -219,7 +219,7 @@ drawArrow(p, offsetX + 18, offsetY + h - 3, w - 18, Qt::RightArrow, true); // return arrow } - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } @@ -264,7 +264,7 @@ drawArrow(p, offsetX, offsetY + 4, w, Qt::LeftArrow); } - if (m_bSelected) + if (m_selected) drawSelected(&p, offsetX, offsetY); } @@ -294,7 +294,7 @@ drawArrow(p, offsetX, lineY, w, Qt::LeftArrow); } - if (m_bSelected) + if (m_selected) drawSelected(&p, offsetX, offsetY); } @@ -333,7 +333,7 @@ drawArrow(p, offsetX + h, offsetY, w - h, Qt::LeftArrow); } - if (m_bSelected) + if (m_selected) drawSelected(&p, offsetX, offsetY); } @@ -369,7 +369,7 @@ drawArrow(p, x2, offsetY, w, Qt::RightArrow); } - if (m_bSelected) + if (m_selected) drawSelected(&p, offsetX, offsetY); } @@ -463,7 +463,7 @@ return; } //TODO why this condition? -/* if (m_pView->getSelectCount() > 2) { +/* if (m_scene->getSelectCount() > 2) { return; }*/ @@ -504,7 +504,7 @@ calculateWidget(); if( !m_pFText ) return; - if (m_pView->getSelectCount(true) > 1) + if (m_scene->getSelectCount(true) > 1) return; setTextPosition(); } @@ -522,7 +522,7 @@ ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); if(sel == ListPopupMenu::mt_Delete) { // This will clean up this widget and the text widget: - m_pView -> removeWidget(this); + m_scene -> removeWidget(this); } else { UMLWidget::slotMenuSelection( action ); @@ -531,10 +531,10 @@ bool MessageWidget::activate(IDChangeLog * /*Log = 0*/) { - m_pView->resetPastePoint(); + m_scene->resetPastePoint(); // UMLWidget::activate(Log); CHECK: I don't think we need this ? if (m_pOw[Uml::A] == NULL) { - UMLWidget *pWA = m_pView->findWidget(m_widgetAId); + UMLWidget *pWA = m_scene->findWidget(m_widgetAId); if (pWA == NULL) { uDebug() << "role A object " << ID2STR(m_widgetAId) << " not found"; return false; @@ -547,7 +547,7 @@ } } if (m_pOw[Uml::B] == NULL) { - UMLWidget *pWB = m_pView->findWidget(m_widgetBId); + UMLWidget *pWB = m_scene->findWidget(m_widgetBId); if (pWB == NULL) { uDebug() << "role B object " << ID2STR(m_widgetBId) << " not found"; return false; @@ -577,7 +577,7 @@ Uml::TextRole tr = Uml::TextRole::Seq_Message; if (m_pOw[Uml::A] == m_pOw[Uml::B]) tr = Uml::TextRole::Seq_Message_Self; - m_pFText = new FloatingTextWidget( m_pView, tr, "" ); + m_pFText = new FloatingTextWidget( m_scene, tr, "" ); m_pFText->setFont(UMLWidget::font()); } if (op) @@ -605,7 +605,7 @@ { if (ft == NULL) return; - QString displayText = m_SequenceNumber + ": " + operationText(m_pView); + QString displayText = m_SequenceNumber + ": " + operationText(m_scene); ft->setText(displayText); setTextPosition(); } @@ -863,7 +863,7 @@ UMLWidget::cleanup(); if (m_pFText) { - m_pView->removeWidget(m_pFText); + m_scene->removeWidget(m_pFText); m_pFText = NULL; } } @@ -873,13 +873,13 @@ UMLWidget::setSelected( _select ); if( !m_pFText || m_pFText->displayText().isEmpty()) return; - if( m_bSelected && m_pFText -> getSelected() ) + if( m_selected && m_pFText -> getSelected() ) return; - if( !m_bSelected && !m_pFText -> getSelected() ) + if( !m_selected && !m_pFText -> getSelected() ) return; - m_pView -> setSelected( m_pFText, 0 ); - m_pFText -> setSelected( m_bSelected ); + m_scene -> setSelected( m_pFText, 0 ); + m_pFText -> setSelected( m_selected ); } int MessageWidget::getMinY() @@ -999,7 +999,7 @@ if ( !element.isNull() ) { QString tag = element.tagName(); if (tag == "floatingtext") { - m_pFText = new FloatingTextWidget( m_pView, tr, operationText(m_pView), m_textId ); + m_pFText = new FloatingTextWidget( m_scene, tr, operationText(m_scene), m_textId ); if( ! m_pFText->loadFromXMI(element) ) { // Most likely cause: The FloatingTextWidget is empty. delete m_pFText; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/messagewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/messagewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/messagewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/messagewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -48,7 +48,7 @@ /** * Constructs a MessageWidget. * - * @param view The parent to this class. + * @param scene The parent to this class. * @param a The role A widget for this message. * @param b The role B widget for this message. * @param y The vertical position to display this message. @@ -56,30 +56,30 @@ * @param id A unique id used for deleting this object cleanly. * The default (-1) will prompt generation of a new ID. */ - MessageWidget(UMLView * view, ObjectWidget* a, ObjectWidget* b, + MessageWidget(UMLScene * scene, ObjectWidget* a, ObjectWidget* b, int y, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id = Uml::id_None); /** * Constructs a MessageWidget. * - * @param view The parent to this class. + * @param scene The parent to this class. * @param sequenceMessageType The Uml::Sequence_Message_Type of this message widget * @param id The ID to assign (-1 will prompt a new ID.) */ - MessageWidget(UMLView * view, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id = Uml::id_None); + MessageWidget(UMLScene * scene, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id = Uml::id_None); /** * Constructs a Lost or Found MessageWidget. * - * @param view The parent to this class. + * @param scene The parent to this class. * @param a The role A widget for this message. * @param xclick The horizontal position clicked by the user * @param yclick The vertical position clicked by the user * @param sequenceMessageType Whether lost or found * @param id The ID to assign (-1 will prompt a new ID.) */ - MessageWidget(UMLView * view, ObjectWidget* a, int xclick, int yclick, Uml::Sequence_Message_Type sequenceMessageType, + MessageWidget(UMLScene * scene, ObjectWidget* a, int xclick, int yclick, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id = Uml::id_None); @@ -270,7 +270,7 @@ /** * Calls drawSynchronous() or drawAsynchronous() */ - void draw(QPainter& p, int offsetX, int offsetY); + void paint(QPainter& p, int offsetX, int offsetY); /** * Draws the calling arrow with filled in arrowhead, the @@ -416,14 +416,14 @@ static void drawSolidArrowhead(QPainter& p, int x, int y, Qt::ArrowType direction); /** - * Update the UMLWidget::m_bResizable flag according to the + * Update the UMLWidget::m_resizable flag according to the * charactersitics of this message. */ void updateResizability(); /** * Sets the size. - * If m_pView->getSnapComponentSizeToGrid() is true, then + * If m_scene->getSnapComponentSizeToGrid() is true, then * set the next larger size that snaps to the grid. */ // void setSize(int width,int height); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/nodewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/nodewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/nodewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/nodewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -22,8 +22,8 @@ #include "umldoc.h" #include "umlview.h" -NodeWidget::NodeWidget(UMLView * view, UMLNode *n ) - : UMLWidget(view, n) +NodeWidget::NodeWidget(UMLScene * scene, UMLNode *n ) + : UMLWidget(scene, n) { UMLWidget::setBaseType(WidgetBase::wt_Node); setZ(m_origZ = 1); // above box but below UMLWidget because may embed widgets @@ -36,13 +36,13 @@ { } -void NodeWidget::draw(QPainter & p, int offsetX, int offsetY) +void NodeWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) { p.setBrush( UMLWidget::getFillColor() ); } else { - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); } const int w = width(); const int h = height(); @@ -94,7 +94,7 @@ bodyWidth, fontHeight, Qt::AlignCenter, nameStr); } - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/nodewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/nodewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/nodewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/nodewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -31,10 +31,10 @@ /** * Constructs a NodeWidget. * - * @param view The parent of this NodeWidget. + * @param scene The parent of this NodeWidget. * @param n The UMLNode this will be representing. */ - NodeWidget(UMLView * view, UMLNode *n ); + NodeWidget(UMLScene * scene, UMLNode *n ); /** * destructor @@ -44,7 +44,7 @@ /** * Overrides standard method. */ - void draw(QPainter& p, int offsetX, int offsetY); + void paint(QPainter& p, int offsetX, int offsetY); /** * Saves to the "nodewidget" XMI element. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/notewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/notewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/notewidget.cpp 2011-09-26 11:24:06.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/notewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -24,23 +24,95 @@ #include "notewidgetcontroller.h" #include "notedialog.h" #include "umldoc.h" -#include "umlview.h" +#include "umlscene.h" #include "uml.h" -NoteWidget::NoteWidget(UMLView * view, NoteType noteType , Uml::IDType id) - : UMLWidget(view, id, new NoteWidgetController(this)) +/** + * Constructs a NoteWidget. + * + * @param scene The parent to this widget. + * @param noteType The NoteWidget::NoteType of this NoteWidget + * @param id The unique id of the widget. + * The default (-1) will prompt a new ID. + */ +NoteWidget::NoteWidget(UMLScene * scene, NoteType noteType , Uml::IDType id) + : UMLWidget(scene, id, new NoteWidgetController(this)) { UMLWidget::setBaseType(WidgetBase::wt_Note); - m_DiagramLink = Uml::id_None; - m_NoteType = noteType; + m_diagramLink = Uml::id_None; + m_noteType = noteType; setZ(20); //make sure always on top. } +/** + * destructor + */ +NoteWidget::~NoteWidget() +{ +} + +/** + * Override default method. + */ +void NoteWidget::paint(QPainter & p, int offsetX, int offsetY) +{ + const int margin = 10; + int w = width()-1; + int h = height()-1; + const QFontMetrics &fm = getFontMetrics(FT_NORMAL); + const int fontHeight = fm.lineSpacing(); + QPolygon poly(6); + poly.setPoint(0, offsetX, offsetY); + poly.setPoint(1, offsetX, offsetY + h); + poly.setPoint(2, offsetX + w, offsetY + h); + poly.setPoint(3, offsetX + w, offsetY + margin); + poly.setPoint(4, offsetX + w - margin, offsetY); + poly.setPoint(5, offsetX, offsetY); + + setPenFromSettings(p); + if ( UMLWidget::getUseFillColour() ) { + QBrush brush( UMLWidget::getFillColor() ); + p.setBrush(brush); + p.drawPolygon(poly); + } else + p.drawPolyline(poly); + p.drawLine(offsetX + w - margin, offsetY, offsetX + w - margin, offsetY + margin); + p.drawLine(offsetX + w - margin, offsetY + margin, offsetX + w, offsetY + margin); + p.setPen(Qt::black); + switch(m_noteType) { + case NoteWidget::PreCondition : + p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< precondition >>"); + break; + case NoteWidget::PostCondition : + p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< postcondition >>"); + break; + case NoteWidget::Transformation : + p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< transformation >>"); + break; + case NoteWidget::Normal : + default : + break; + } + + if (m_selected) { + drawSelected(&p, offsetX, offsetY); + } + +// drawText(&p, offsetX, offsetY); + drawTextWordWrap(&p, offsetX, offsetY); +} + +/** + * Returns the type of note. + */ NoteWidget::NoteType NoteWidget::getNoteType() const { - return m_NoteType; + return m_noteType; } +/** + * Returns the type of note. + */ NoteWidget::NoteType NoteWidget::getNoteType(const QString& noteType) const { if (noteType == "Precondition") @@ -53,129 +125,195 @@ return NoteWidget::Normal; } +/** + * Sets the type of note. + */ void NoteWidget::setNoteType( NoteType noteType ) { - m_NoteType = noteType; + m_noteType = noteType; } +/** + * Sets the type of note. + */ void NoteWidget::setNoteType( const QString& noteType ) { setNoteType(getNoteType(noteType)); } -NoteWidget::~NoteWidget() -{ -} - -void NoteWidget::setDiagramLink(Uml::IDType viewID) -{ - UMLDoc *umldoc = UMLApp::app()->document(); - UMLView *view = umldoc->findView(viewID); - if (view == NULL) { - uError() << "no view found for viewID " << ID2STR(viewID); - return; - } - QString linkText("Diagram: " + view->name()); - setDocumentation(linkText); - m_DiagramLink = viewID; -} - -Uml::IDType NoteWidget::getDiagramLink() const -{ - return m_DiagramLink; -} - +/** + * Override method from UMLWidget. + */ void NoteWidget::setFont(QFont font) { UMLWidget::setFont(font); } +/** + * Override method from UMLWidget. + */ void NoteWidget::setX( int x ) { UMLWidget::setX(x); } +/** + * Override method from UMLWidget. + */ void NoteWidget::setY( int y ) { UMLWidget::setY(y); } +/** + * Returns the text in the box. + * + * @return The text in the box. + */ QString NoteWidget::documentation() const { return m_Text; } +/** + * Sets the note documentation. + * + * @param newText The text to set the documentation to. + */ void NoteWidget::setDocumentation(const QString &newText) { m_Text = newText; update(); } -void NoteWidget::draw(QPainter & p, int offsetX, int offsetY) +/** + * Return the ID of the diagram hyperlinked to this note. + * + * @return ID of an UMLView, or Uml::id_None if no + * hyperlink is set. + */ +Uml::IDType NoteWidget::getDiagramLink() const { - const int margin = 10; - int w = width()-1; - int h = height()-1; - const QFontMetrics &fm = getFontMetrics(FT_NORMAL); - const int fontHeight = fm.lineSpacing(); - QPolygon poly(6); - poly.setPoint(0, offsetX, offsetY); - poly.setPoint(1, offsetX, offsetY + h); - poly.setPoint(2, offsetX + w, offsetY + h); - poly.setPoint(3, offsetX + w, offsetY + margin); - poly.setPoint(4, offsetX + w - margin, offsetY); - poly.setPoint(5, offsetX, offsetY); + return m_diagramLink; +} - setPenFromSettings(p); - if ( UMLWidget::getUseFillColour() ) { - QBrush brush( UMLWidget::getFillColor() ); - p.setBrush(brush); - p.drawPolygon(poly); - } else - p.drawPolyline(poly); - p.drawLine(offsetX + w - margin, offsetY, offsetX + w - margin, offsetY + margin); - p.drawLine(offsetX + w - margin, offsetY + margin, offsetX + w, offsetY + margin); - p.setPen(Qt::black); - switch(m_NoteType) { - case NoteWidget::PreCondition : - p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< precondition >>"); - break; - case NoteWidget::PostCondition : - p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< postcondition >>"); - break; - case NoteWidget::Transformation : - p.drawText(offsetX, offsetY + margin, w, fontHeight, Qt::AlignCenter, "<< transformation >>"); - break; - case NoteWidget::Normal : - default : - break; +/** + * Set the ID of the diagram hyperlinked to this note. + * To switch off the hyperlink, set this to Uml::id_None. + * + * @param sceneID ID of an UMLView. + */ +void NoteWidget::setDiagramLink(Uml::IDType viewID) +{ + UMLDoc *umldoc = UMLApp::app()->document(); + UMLView *view = umldoc->findView(viewID); + if (view == NULL) { + uError() << "no view found for viewID " << ID2STR(viewID); + return; } + QString linkText("Diagram: " + view->name()); + setDocumentation(linkText); + m_diagramLink = viewID; +} - if (m_bSelected) { - drawSelected(&p, offsetX, offsetY); +/** +* Display a dialogBox to allow the user to choose the note's type +*/ +void NoteWidget::askForNoteType(UMLWidget* &targetWidget) +{ + bool pressedOK = false; + const QStringList list = QStringList() << "Precondition" << "Postcondition" << "Transformation"; + QString type = KInputDialog::getItem (i18n("Note Type"), i18n("Select the Note Type"), list, 0, false, &pressedOK, UMLApp::app()); + + if (pressedOK) { + dynamic_cast(targetWidget)->setNoteType(type); + } else { + targetWidget->cleanup(); + delete targetWidget; + targetWidget = NULL; } +} -// drawText(&p, offsetX, offsetY); - drawTextWordWrap(&p, offsetX, offsetY); +/** + * Loads a "notewidget" XMI element. + */ +bool NoteWidget::loadFromXMI( QDomElement & qElement ) +{ + if( !UMLWidget::loadFromXMI( qElement ) ) + return false; + setZ( 20 ); //make sure always on top. + setDocumentation( qElement.attribute("text", "") ); + QString diagramlink = qElement.attribute("diagramlink", ""); + if (!diagramlink.isEmpty()) + m_diagramLink = STR2ID(diagramlink); + QString type = qElement.attribute("noteType", ""); + setNoteType( (NoteType)type.toInt() ); + return true; } +/** + * Saves to the "notewidget" XMI element. + */ +void NoteWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement noteElement = qDoc.createElement( "notewidget" ); + UMLWidget::saveToXMI( qDoc, noteElement ); + noteElement.setAttribute( "text", documentation() ); + if (m_diagramLink != Uml::id_None) + noteElement.setAttribute( "diagramlink", ID2STR(m_diagramLink) ); + noteElement.setAttribute( "noteType", m_noteType); + qElement.appendChild( noteElement ); +} + +/** + * Will be called when a menu selection has been made from the popup + * menu. + * + * @param action The action that has been selected. + */ +void NoteWidget::slotMenuSelection(QAction* action) +{ + NoteDialog * dlg = 0; + UMLDoc *doc = UMLApp::app()->document(); + ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + switch(sel) { + case ListPopupMenu::mt_Rename: + m_scene->updateDocumentation( false ); + dlg = new NoteDialog( m_scene, this ); + if( dlg->exec() ) { + m_scene->showDocumentation( this, true ); + doc->setModified(true); + update(); + } + delete dlg; + break; + + default: + UMLWidget::slotMenuSelection(action); + break; + } +} + +/** + * Overrides method from UMLWidget. + */ QSize NoteWidget::calculateSize() { int width = 60; int height = 30; const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int textWidth = fm.width(m_Text); - if (m_NoteType == PreCondition) { + if (m_noteType == PreCondition) { const int widthtemp = fm.width("<< precondition >>"); width = textWidth > widthtemp ? textWidth : widthtemp; width += 10; } - else if (m_NoteType == PostCondition) { + else if (m_noteType == PostCondition) { const int widthtemp = fm.width("<< postcondition >>"); width = textWidth > widthtemp ? textWidth : widthtemp; width += 10; } - else if (m_NoteType == Transformation) { + else if (m_noteType == Transformation) { const int widthtemp = fm.width("<< transformation >>"); width = textWidth > widthtemp ? textWidth : widthtemp; width += 10; @@ -186,29 +324,6 @@ return QSize(width, height); } -void NoteWidget::slotMenuSelection(QAction* action) -{ - NoteDialog * dlg = 0; - UMLDoc *doc = UMLApp::app()->document(); - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); - switch(sel) { - case ListPopupMenu::mt_Rename: - m_pView->updateDocumentation( false ); - dlg = new NoteDialog( m_pView, this ); - if( dlg->exec() ) { - m_pView->showDocumentation( this, true ); - doc->setModified(true); - update(); - } - delete dlg; - break; - - default: - UMLWidget::slotMenuSelection(action); - break; - } -} - /** * Draws the text. Auxiliary to draw(). * Implemented without word wrap. @@ -371,45 +486,5 @@ }//end for } -void NoteWidget::askForNoteType(UMLWidget* &targetWidget) -{ - bool pressedOK = false; - const QStringList list = QStringList() << "Precondition" << "Postcondition" << "Transformation"; - QString type = KInputDialog::getItem (i18n("Note Type"), i18n("Select the Note Type"), list, 0, false, &pressedOK, UMLApp::app()); - - if (pressedOK) { - dynamic_cast(targetWidget)->setNoteType(type); - } else { - targetWidget->cleanup(); - delete targetWidget; - targetWidget = NULL; - } -} - -void NoteWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement noteElement = qDoc.createElement( "notewidget" ); - UMLWidget::saveToXMI( qDoc, noteElement ); - noteElement.setAttribute( "text", documentation() ); - if (m_DiagramLink != Uml::id_None) - noteElement.setAttribute( "diagramlink", ID2STR(m_DiagramLink) ); - noteElement.setAttribute( "noteType", m_NoteType); - qElement.appendChild( noteElement ); -} - -bool NoteWidget::loadFromXMI( QDomElement & qElement ) -{ - if( !UMLWidget::loadFromXMI( qElement ) ) - return false; - setZ( 20 ); //make sure always on top. - setDocumentation( qElement.attribute("text", "") ); - QString diagramlink = qElement.attribute("diagramlink", ""); - if (!diagramlink.isEmpty()) - m_DiagramLink = STR2ID(diagramlink); - QString type = qElement.attribute("noteType", ""); - setNoteType( (NoteType)type.toInt() ); - return true; -} - #include "notewidget.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/notewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/notewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/notewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/notewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -43,115 +43,49 @@ PostCondition, Transformation }; - - /** - * Constructs a NoteWidget. - * - * @param view The parent to this widget. - * @param noteType The NoteWidget::NoteType of this NoteWidget - * @param id The unique id of the widget. - * The default (-1) will prompt a new ID. - */ - explicit NoteWidget(UMLView * view, NoteWidget::NoteType noteType = Normal, Uml::IDType id = Uml::id_None ); - - /** - * destructor - */ + explicit NoteWidget(UMLScene * scene, NoteWidget::NoteType noteType = Normal, Uml::IDType id = Uml::id_None ); virtual ~NoteWidget(); - /** - * Returns the type of note. - */ + void paint(QPainter & p, int offsetX, int offsetY); + NoteType getNoteType() const; NoteType getNoteType(const QString& noteType) const; - - /** - * Sets the type of note. - */ void setNoteType( NoteType noteType ); void setNoteType( const QString& noteType ); - /** - * Overrides method from UMLWidget. - */ - QSize calculateSize(); - - /** - * Returns the text in the box. - * - * @return The text in the box. - */ QString documentation() const; - - /** - * Sets the note documentation. - * - * @param newText The text to set the documentation to. - */ void setDocumentation(const QString &newText); - /** - * Set the ID of the diagram hyperlinked to this note. - * To switch off the hyperlink, set this to Uml::id_None. - * - * @param viewID ID of an UMLView. - */ - void setDiagramLink(Uml::IDType viewID); - - /** - * Return the ID of the diagram hyperlinked to this note. - * - * @return ID of an UMLView, or Uml::id_None if no - * hyperlink is set. - */ Uml::IDType getDiagramLink() const; + void setDiagramLink(Uml::IDType viewID); - /** - * Override default method. - */ - void draw(QPainter & p, int offsetX, int offsetY); - - /** - * Override method from UMLWidget. - */ + // this method is obsolate void setFont(QFont font); - /** - * Override method from UMLWidget. - */ + // this method is obsolate void setX(int x); - - /** - * Override method from UMLWidget. - */ + // this method is obsolate void setY(int y); - /** - * Display a dialogBox to allow the user to choose the note's type - */ void askForNoteType(UMLWidget* &targetWidget); - /** - * Saves to the "notewidget" XMI element. - */ + bool loadFromXMI( QDomElement & qElement ); void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); - /** - * Loads a "notewidget" XMI element. - */ - bool loadFromXMI( QDomElement & qElement ); -public slots: +public Q_SLOTS: void slotMenuSelection(QAction* action); protected: - Uml::IDType m_DiagramLink; ///< Data loaded/saved. - NoteType m_NoteType; ///< Type of note. - QString l_Type; ///< Label to see the note's type. - + QSize calculateSize(); void drawText(QPainter * p = NULL, int offsetX = 0, int offsetY = 0); void drawTextWordWrap(QPainter * p = NULL, int offsetX = 0, int offsetY = 0); + Uml::IDType m_diagramLink; ///< Data loaded/saved. + NoteType m_noteType; ///< Type of note. + QString m_type; ///< Label to see the note's type. + + private: QString m_Text; }; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/objectnodewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/objectnodewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/objectnodewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/objectnodewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -33,8 +33,8 @@ #include "listpopupmenu.h" #include "objectnodedialog.h" -ObjectNodeWidget::ObjectNodeWidget(UMLView * view, ObjectNodeType objectNodeType, Uml::IDType id ) - : UMLWidget(view, id) +ObjectNodeWidget::ObjectNodeWidget(UMLScene * scene, ObjectNodeType objectNodeType, Uml::IDType id ) + : UMLWidget(scene, id) { UMLWidget::setBaseType( WidgetBase::wt_ObjectNode ); setObjectNodeType( objectNodeType ); @@ -46,7 +46,7 @@ { } -void ObjectNodeWidget::draw(QPainter & p, int offsetX, int offsetY) +void ObjectNodeWidget::paint(QPainter & p, int offsetX, int offsetY) { int w = width(); int h = height(); @@ -103,7 +103,7 @@ } setPenFromSettings(p); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -170,7 +170,7 @@ void ObjectNodeWidget::setObjectNodeType( ObjectNodeType objectNodeType ) { m_ObjectNodeType = objectNodeType; - UMLWidget::m_bResizable = true; + UMLWidget::m_resizable = true; } void ObjectNodeWidget::setObjectNodeType( const QString& type ) @@ -203,7 +203,7 @@ break; case ListPopupMenu::mt_Properties: - showProperties(); + showPropertiesDialog(); break; default: @@ -211,12 +211,12 @@ } } -void ObjectNodeWidget::showProperties() +void ObjectNodeWidget::showPropertiesDialog() { DocWindow *docwindow = UMLApp::app()->docWindow(); docwindow->updateDocumentation(false); - QPointer dialog = new ObjectNodeDialog(m_pView, this); + QPointer dialog = new ObjectNodeDialog(m_scene, this); if (dialog->exec() && dialog->getChangesMade()) { docwindow->showDocumentation(this, true); UMLApp::app()->document()->setModified(true); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/objectnodewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/objectnodewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/objectnodewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/objectnodewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -46,11 +46,11 @@ /** * Creates a Object Node widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param objectNodeType The type of object node * @param id The ID to assign (-1 will prompt a new ID.) */ - explicit ObjectNodeWidget( UMLView * view, ObjectNodeType objectNodeType = Normal, Uml::IDType id = Uml::id_None ); + explicit ObjectNodeWidget( UMLScene * scene, ObjectNodeType objectNodeType = Normal, Uml::IDType id = Uml::id_None ); /** @@ -61,7 +61,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Returns the type of object node. @@ -89,7 +89,7 @@ * Show a properties dialog for an ObjectNodeWidget. * */ - virtual void showProperties(); + virtual void showPropertiesDialog(); /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/objectwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/objectwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/objectwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/objectwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -36,8 +36,8 @@ */ static const int sequenceLineMargin = 20; -ObjectWidget::ObjectWidget(UMLView * view, UMLObject *o, Uml::IDType lid) - : UMLWidget(view, o) +ObjectWidget::ObjectWidget(UMLScene * scene, UMLObject *o, Uml::IDType lid) + : UMLWidget(scene, o) { init(); if( lid != Uml::id_None ) @@ -52,11 +52,11 @@ UMLWidget::setBaseType(WidgetBase::wt_Object); m_nLocalID = Uml::id_None; m_InstanceName = ""; - m_bMultipleInstance = false; - m_bDrawAsActor = false; - m_bShowDestruction = false; - if( m_pView != NULL && m_pView->type() == Uml::DiagramType::Sequence ) { - m_pLine = new SeqLineWidget( m_pView, this ); + m_multipleInstance = false; + m_drawAsActor = false; + m_showDestruction = false; + if( m_scene != NULL && m_scene->type() == Uml::DiagramType::Sequence ) { + m_pLine = new SeqLineWidget( m_scene, this ); //Sets specific widget controller for sequence diagrams delete m_widgetController; @@ -70,15 +70,15 @@ { } -void ObjectWidget::draw(QPainter & p , int offsetX, int offsetY) +void ObjectWidget::paint(QPainter & p , int offsetX, int offsetY) { - if ( m_bDrawAsActor ) + if ( m_drawAsActor ) drawActor( p, offsetX, offsetY ); else drawObject( p, offsetX, offsetY ); setPenFromSettings(p); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -95,7 +95,7 @@ i18n("Enter object name:"), m_InstanceName, &ok, - m_pView, + m_scene, validator); if (ok) { m_InstanceName = name; @@ -108,7 +108,7 @@ break; } case ListPopupMenu::mt_Properties: - showProperties(); + showPropertiesDialog(); updateComponentSize(); moveEvent( 0 ); update(); @@ -135,7 +135,7 @@ const int fontHeight = fm.lineSpacing(); const QString t = m_InstanceName + " : " + m_pObject->name(); const int textWidth = fm.width(t); - if ( m_bDrawAsActor ) { + if ( m_drawAsActor ) { width = textWidth > A_WIDTH?textWidth:A_WIDTH; height = A_HEIGHT + fontHeight + A_MARGIN; width += A_MARGIN * 2; @@ -143,7 +143,7 @@ width = textWidth > O_WIDTH?textWidth:O_WIDTH; height = fontHeight + O_MARGIN * 2; width += O_MARGIN * 2; - if (m_bMultipleInstance) { + if (m_multipleInstance) { width += 10; height += 10; } @@ -154,16 +154,16 @@ void ObjectWidget::setDrawAsActor( bool drawAsActor ) { - m_bDrawAsActor = drawAsActor; + m_drawAsActor = drawAsActor; updateComponentSize(); } void ObjectWidget::setMultipleInstance(bool multiple) { //make sure only calling this in relation to an object on a collab. diagram - if(m_pView->type() != Uml::DiagramType::Collaboration) + if(m_scene->type() != Uml::DiagramType::Collaboration) return; - m_bMultipleInstance = multiple; + m_multipleInstance = multiple; updateComponentSize(); update(); } @@ -172,7 +172,7 @@ { if (! UMLWidget::activate(ChangeLog)) return false; - if (m_bShowDestruction && m_pLine) + if (m_showDestruction && m_pLine) m_pLine->setupDestructionBox(); moveEvent(0); return true; @@ -205,8 +205,8 @@ void ObjectWidget::slotColorChanged(Uml::IDType /*viewID*/) { - UMLWidget::setFillColour( m_pView->getFillColor() ); - UMLWidget::setLineColor( m_pView->getLineColor() ); + UMLWidget::setFillColour( m_scene->getFillColor() ); + UMLWidget::setLineColor( m_scene->getLineColor() ); if( m_pLine) m_pLine->setPen( QPen( UMLWidget::lineColor(), UMLWidget::lineWidth(), Qt::DashLine ) ); @@ -221,7 +221,7 @@ } } -void ObjectWidget::showProperties() +void ObjectWidget::showPropertiesDialog() { DocWindow *docwindow = UMLApp::app()->docWindow(); docwindow->updateDocumentation(false); @@ -245,13 +245,13 @@ if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColor()); else - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); const int w = width(); const int h = height(); const QString t = m_InstanceName + " : " + m_pObject->name(); int multiInstOfst = 0; - if ( m_bMultipleInstance ) { + if ( m_multipleInstance ) { p.drawRect(offsetX + 10, offsetY + 10, w - 10, h - 10); p.drawRect(offsetX + 5, offsetY + 5, w - 10, h - 10); multiInstOfst = 10; @@ -326,7 +326,7 @@ void ObjectWidget::setShowDestruction( bool bShow ) { - m_bShowDestruction = bShow; + m_showDestruction = bShow; if( m_pLine ) m_pLine -> setupDestructionBox(); } @@ -341,7 +341,7 @@ int y = this -> getY() + getHeight(); if( m_pLine) y += m_pLine -> getLineLength(); - if ( m_bShowDestruction ) + if ( m_showDestruction ) y += 10; return y; } @@ -397,10 +397,10 @@ QDomElement objectElement = qDoc.createElement( "objectwidget" ); UMLWidget::saveToXMI( qDoc, objectElement ); objectElement.setAttribute( "instancename", m_InstanceName ); - objectElement.setAttribute( "drawasactor", m_bDrawAsActor ); - objectElement.setAttribute( "multipleinstance", m_bMultipleInstance ); + objectElement.setAttribute( "drawasactor", m_drawAsActor ); + objectElement.setAttribute( "multipleinstance", m_multipleInstance ); objectElement.setAttribute( "localid", ID2STR(m_nLocalID) ); - objectElement.setAttribute( "decon", m_bShowDestruction ); + objectElement.setAttribute( "decon", m_showDestruction ); qElement.appendChild( objectElement ); } @@ -414,10 +414,10 @@ QString localid = qElement.attribute( "localid", "0" ); QString decon = qElement.attribute( "decon", "0" ); - m_bDrawAsActor = (bool)draw.toInt(); - m_bMultipleInstance = (bool)multi.toInt(); + m_drawAsActor = (bool)draw.toInt(); + m_multipleInstance = (bool)multi.toInt(); m_nLocalID = STR2ID(localid); - m_bShowDestruction = (bool)decon.toInt(); + m_showDestruction = (bool)decon.toInt(); return true; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/objectwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/objectwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/objectwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/objectwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -38,11 +38,11 @@ /** * Creates an ObjectWidget. * - * @param view The parent to this object. + * @param scene The parent to this object. * @param o The object it will be representing. * @param lid The local id for the object. */ - ObjectWidget(UMLView * view, UMLObject *o, Uml::IDType lid = Uml::id_None ); + ObjectWidget(UMLScene * scene, UMLObject *o, Uml::IDType lid = Uml::id_None ); /** * destructor @@ -100,7 +100,7 @@ * @return True if object is representing a multi-object. */ bool multipleInstance() const { - return m_bMultipleInstance; + return m_multipleInstance; } /** @@ -127,7 +127,7 @@ /** * Override default method. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Overrides the standard operation. @@ -142,7 +142,7 @@ /** * Show a properties dialog for an ObjectWidget. */ - void showProperties(); + void showPropertiesDialog(); /** * Returns whether to draw as an Actor or not. @@ -150,7 +150,7 @@ * @return True if widget is drawn as an actor. */ bool drawAsActor() const { - return m_bDrawAsActor; + return m_drawAsActor; } /** @@ -173,7 +173,7 @@ * @return True if destruction on sequence line is shown. */ bool showDestruction() const { - return m_bShowDestruction; + return m_showDestruction; } /** @@ -309,19 +309,19 @@ * Determines whether to draw an object as a multiple object * instance. */ - bool m_bMultipleInstance; + bool m_multipleInstance; /** * Determines whether the object should be drawn as an Actor or * an Object. */ - bool m_bDrawAsActor; + bool m_drawAsActor; /** * Determines whether to show object destruction on sequence * diagram line. */ - bool m_bShowDestruction; + bool m_showDestruction; private: /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/packagewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/packagewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/packagewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/packagewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -22,8 +22,8 @@ #include "umlview.h" #include "umlobject.h" -PackageWidget::PackageWidget(UMLView * view, UMLPackage *o) - : UMLWidget(view, o) +PackageWidget::PackageWidget(UMLScene * scene, UMLPackage *o) + : UMLWidget(scene, o) { init(); } @@ -34,11 +34,11 @@ setSize(100, 30); setZ(m_origZ = 1); // above box but below UMLWidget because may embed widgets m_pMenu = 0; - //set defaults from m_pView - if (m_pView) { + //set defaults from m_scene + if (m_scene) { //check to see if correct - const Settings::OptionState& ops = m_pView->optionState(); - m_bShowStereotype = ops.classState.showStereoType; + const Settings::OptionState& ops = m_scene->optionState(); + m_showStereotype = ops.classState.showStereoType; } //maybe loading and this may not be set. if (m_pObject && !UMLApp::app()->document()->loading()) @@ -49,13 +49,13 @@ { } -void PackageWidget::draw(QPainter & p, int offsetX, int offsetY) +void PackageWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) p.setBrush( UMLWidget::getFillColor() ); else - p.setBrush( m_pView->viewport()->palette().color(QPalette::Background) ); + p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); int w = width(); int h = height(); @@ -94,7 +94,7 @@ p.drawText(offsetX, offsetY + (fontHeight*lines) + PACKAGE_MARGIN, w, fontHeight, Qt::AlignCenter, name() ); - if(m_bSelected) { + if(m_selected) { drawSelected(&p, offsetX, offsetY); } } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/packagewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/packagewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/packagewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/packagewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -33,10 +33,10 @@ /** * Constructs a PackageWidget. * - * @param view The parent of this PackageWidget. + * @param scene The parent of this PackageWidget. * @param o The UMLObject this will be representing. */ - PackageWidget(UMLView * view, UMLPackage * o); + PackageWidget(UMLScene * scene, UMLPackage * o); /** * destructor @@ -46,7 +46,7 @@ /** * Overrides standard method. */ - void draw(QPainter& p, int offsetX, int offsetY); + void paint(QPainter& p, int offsetX, int offsetY); /** * Saves to the "packagewidget" XMI element. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/pinwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/pinwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/pinwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/pinwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -23,7 +23,7 @@ #include "uml.h" #include "umldoc.h" #include "docwindow.h" -#include "umlview.h" +#include "umlscene.h" #include "uniqueid.h" #include "listpopupmenu.h" #include "floatingtextwidget.h" @@ -32,8 +32,8 @@ #include #include -PinWidget::PinWidget(UMLView * view, UMLWidget* a, Uml::IDType id) - : UMLWidget(view, id) +PinWidget::PinWidget(UMLScene * scene, UMLWidget* a, Uml::IDType id) + : UMLWidget(scene, id) { init(); m_pOw = a; @@ -42,8 +42,8 @@ y = y < getMinY() ? getMinY() : y; m_nY = y; - m_pName = new FloatingTextWidget(view, Uml::TextRole::Floating, ""); - view->setupNewWidget(m_pName); + m_pName = new FloatingTextWidget(scene, Uml::TextRole::Floating, ""); + scene->setupNewWidget(m_pName); m_pName->setX(0); m_pName->setY(0); this->activate(); @@ -56,15 +56,15 @@ void PinWidget::init() { UMLWidget::setBaseType(WidgetBase::wt_Pin); - m_bIgnoreSnapToGrid = true; - m_bIgnoreSnapComponentSizeToGrid = true; - m_bResizable = false ; + m_ignoreSnapToGrid = true; + m_ignoreSnapComponentSizeToGrid = true; + m_resizable = false ; m_pOw = NULL; m_nY = 0; setVisible(true); } -void PinWidget::draw(QPainter & p, int offsetX, int offsetY) +void PinWidget::paint(QPainter & p, int offsetX, int offsetY) { int w = 10; int h = 10; @@ -141,7 +141,7 @@ setPenFromSettings(p); m_pName->setVisible(( m_pName->text().length() > 0 )); m_pName->updateComponentSize(); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -217,7 +217,7 @@ Uml::IDType aId = STR2ID(widgetaid); - UMLWidget *pWA = m_pView -> findWidget( aId ); + UMLWidget *pWA = m_scene -> findWidget( aId ); if (pWA == NULL) { uDebug() << "role A object " << ID2STR(aId) << " not found"; return false; @@ -228,7 +228,7 @@ QString textid = qElement.attribute( "textid", "-1" ); Uml::IDType textId = STR2ID(textid); if (textId != Uml::id_None) { - UMLWidget *flotext = m_pView -> findWidget( textId ); + UMLWidget *flotext = m_scene -> findWidget( textId ); if (flotext != NULL) { // This only happens when loading files produced by // umbrello-1.3-beta2. @@ -246,7 +246,7 @@ if ( !element.isNull() ) { QString tag = element.tagName(); if (tag == "floatingtext") { - m_pName = new FloatingTextWidget( m_pView, Uml::TextRole::Floating, m_Text, textId ); + m_pName = new FloatingTextWidget( m_scene, Uml::TextRole::Floating, m_Text, textId ); if( ! m_pName->loadFromXMI(element) ) { // Most likely cause: The FloatingTextWidget is empty. delete m_pName; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/pinwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/pinwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/pinwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/pinwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -43,11 +43,11 @@ /** * Creates a Pin widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param a The widget to which this pin is attached. * @param id The ID to assign (-1 will prompt a new ID.) */ - PinWidget( UMLView * view, UMLWidget* a, Uml::IDType id = Uml::id_None ); + PinWidget( UMLScene * scene, UMLWidget* a, Uml::IDType id = Uml::id_None ); /** * destructor @@ -62,7 +62,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/preconditionwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/preconditionwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/preconditionwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/preconditionwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -29,8 +29,8 @@ // qt includes #include -PreconditionWidget::PreconditionWidget(UMLView * view, ObjectWidget* a, Uml::IDType id ) - : UMLWidget(view, id) +PreconditionWidget::PreconditionWidget(UMLScene * scene, ObjectWidget* a, Uml::IDType id ) + : UMLWidget(scene, id) { init(); m_pOw = a; @@ -52,15 +52,15 @@ void PreconditionWidget::init() { UMLWidget::setBaseType(WidgetBase::wt_Precondition); - m_bIgnoreSnapToGrid = true; - m_bIgnoreSnapComponentSizeToGrid = true; - m_bResizable = true ; + m_ignoreSnapToGrid = true; + m_ignoreSnapComponentSizeToGrid = true; + m_resizable = true ; m_pOw = NULL; m_nY = 0; setVisible(true); } -void PreconditionWidget::draw(QPainter & p, int /*offsetX*/, int offsetY) +void PreconditionWidget::paint(QPainter & p, int /*offsetX*/, int offsetY) { int w = width(); int h = height(); @@ -94,7 +94,7 @@ p.drawText(x + PRECONDITION_MARGIN, y + textStartY, w - PRECONDITION_MARGIN * 2, fontHeight, Qt::AlignCenter, precondition_value); } - if(m_bSelected) + if(m_selected) drawSelected(&p, x, y); } @@ -144,7 +144,7 @@ bool PreconditionWidget::activate(IDChangeLog * Log /*= 0*/) { - m_pView->resetPastePoint(); + m_scene->resetPastePoint(); UMLWidget::activate(Log); if (m_pOw == NULL) { uDebug() << "cannot make precondition"; @@ -192,7 +192,7 @@ m_nY = getMaxY(); calculateDimensions(); - if (m_pView->getSelectCount(true) > 1) + if (m_scene->getSelectCount(true) > 1) return; } @@ -239,7 +239,7 @@ Uml::IDType aId = STR2ID(widgetaid); - UMLWidget *pWA = m_pView -> findWidget( aId ); + UMLWidget *pWA = m_scene -> findWidget( aId ); if (pWA == NULL) { uDebug() << "role A object " << ID2STR(aId) << " not found"; return false; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/preconditionwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/preconditionwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/preconditionwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/preconditionwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -41,11 +41,11 @@ /** * Creates a Precondition widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param a The role A widget for this precondition. * @param id The ID to assign (-1 will prompt a new ID.) */ - PreconditionWidget( UMLView * view, ObjectWidget* a, Uml::IDType id = Uml::id_None ); + PreconditionWidget( UMLScene * scene, ObjectWidget* a, Uml::IDType id = Uml::id_None ); /** @@ -61,7 +61,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/regionwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/regionwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/regionwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/regionwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -28,15 +28,15 @@ #include "umlview.h" #include "floatingtextwidget.h" -RegionWidget::RegionWidget(UMLView * view, Uml::IDType id) - : UMLWidget(view, id) { +RegionWidget::RegionWidget(UMLScene * scene, Uml::IDType id) + : UMLWidget(scene, id) { UMLWidget::setBaseType( WidgetBase::wt_Region ); updateComponentSize(); } RegionWidget::~RegionWidget() {} -void RegionWidget::draw(QPainter & p, int offsetX, int offsetY) +void RegionWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); const int w = width(); @@ -50,7 +50,7 @@ p.drawRoundRect(offsetX, offsetY, w, h, (h * 60) / w, 60); } - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/regionwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/regionwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/regionwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/regionwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -28,10 +28,10 @@ /** * Creates a Region widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param id The ID to assign (-1 will prompt a new ID.) */ - explicit RegionWidget( UMLView * view, Uml::IDType id = Uml::id_None ); + explicit RegionWidget( UMLScene * scene, Uml::IDType id = Uml::id_None ); /** * destructor @@ -41,7 +41,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Sets the name of the REGION. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/seqlinewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/seqlinewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/seqlinewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/seqlinewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -26,9 +26,9 @@ int const SeqLineWidget::m_nMouseDownEpsilonX = 20; SeqLineWidget::SeqLineWidget( UMLView * pView, ObjectWidget * pObject ) - : Q3CanvasLine( pView -> canvas() ) + : UMLSceneLine( pView -> canvas() ) { - m_pView = pView; + m_scene = pView; m_pObject = pObject; setPen( QPen( m_pObject->lineColor(), 0, Qt::DashLine ) ); setZ( 0 ); @@ -84,7 +84,7 @@ { int endX = startX; int endY = startY + m_nLengthY; - Q3CanvasLine::setPoints( startX, startY, endX, endY ); + UMLSceneLine::setPoints( startX, startY, endX, endY ); moveDestructionBox(); } @@ -110,13 +110,13 @@ rect.setWidth( 14 ); rect.setHeight( 14 ); - m_DestructionBox.line1 = new Q3CanvasLine( m_pView->canvas() ); + m_DestructionBox.line1 = new UMLSceneLine( m_scene->canvas() ); m_DestructionBox.setLine1Points(rect); m_DestructionBox.line1->setVisible( true ); m_DestructionBox.line1->setPen( QPen(m_pObject->lineColor(), 2) ); m_DestructionBox.line1->setZ( 3 ); - m_DestructionBox.line2 = new Q3CanvasLine( m_pView -> canvas() ); + m_DestructionBox.line2 = new UMLSceneLine( m_scene -> canvas() ); m_DestructionBox.setLine2Points(rect); m_DestructionBox.line2->setVisible( true ); m_DestructionBox.line2->setPen( QPen(m_pObject->lineColor(), 2) ); @@ -150,5 +150,5 @@ } setPoints( sp.x(), sp.y(), sp.x(), newY ); moveDestructionBox(); - m_pView->resizeCanvasToItems(); + m_scene->resizeCanvasToItems(); } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/seqlinewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/seqlinewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/seqlinewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/seqlinewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -12,9 +12,9 @@ #ifndef SEQLINEWIDGET_H #define SEQLINEWIDGET_H -#include +#include "umlscene.h" -class UMLView; +class UMLScene; class ObjectWidget; /** @@ -22,7 +22,7 @@ * @author Paul Hensgen * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class SeqLineWidget : public Q3CanvasLine { +class SeqLineWidget : public UMLSceneLine { public: /** * Constructor. @@ -114,12 +114,12 @@ /** * View displayed on. */ - UMLView * m_pView; + UMLView * m_scene; /// The destruction box. struct DestructionBox { - Q3CanvasLine * line1; - Q3CanvasLine * line2; + UMLSceneLine * line1; + UMLSceneLine * line2; void setLine1Points(QRect rect) { line1->setPoints( rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height() ); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/signalwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/signalwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/signalwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/signalwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,55 +11,67 @@ // own header #include "signalwidget.h" -// qt includes -#include -#include - -// kde includes -#include -#include - // app includes #include "basictypes.h" #include "debug_utils.h" +#include "docwindow.h" +#include "floatingtextwidget.h" +#include "linkwidget.h" +#include "listpopupmenu.h" #include "uml.h" #include "umldoc.h" #include "uniqueid.h" -#include "docwindow.h" -#include "umlwidget.h" #include "umlview.h" -#include "floatingtextwidget.h" -#include "linkwidget.h" +#include "umlwidget.h" + +// kde includes +#include +#include + +// qt includes +#include +#include -// #include "dialogs/signaldialog.h" -#include "listpopupmenu.h" -SignalWidget::SignalWidget(UMLView * view, SignalType signalType, Uml::IDType id) - : UMLWidget(view, id) +/** + * Creates a Signal widget. + * + * @param scene The parent of the widget. + * @param signalType The type of Signal. + * @param id The ID to assign (-1 will prompt a new ID.) + */ +SignalWidget::SignalWidget(UMLScene *scene, SignalType signalType, Uml::IDType id) + : UMLWidget(scene, id) { UMLWidget::setBaseType(WidgetBase::wt_Signal); - m_SignalType = signalType; + m_signalType = signalType; updateComponentSize(); m_pName = NULL; if (signalType == SignalWidget::Time) { - m_pName = new FloatingTextWidget(view, Uml::TextRole::Floating,""); - view->setupNewWidget(m_pName); + m_pName = new FloatingTextWidget(scene, Uml::TextRole::Floating,""); + scene->setupNewWidget(m_pName); m_pName->setX(0); m_pName->setY(0); } } +/** + * destructor + */ SignalWidget::~SignalWidget() { } -void SignalWidget::draw(QPainter & p, int offsetX, int offsetY) +/** + * Overrides the standard paint event. + */ +void SignalWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); const int w = width(); const int h = height(); QPolygon a; - switch (m_SignalType) + switch (m_signalType) { case Send : if(UMLWidget::getUseFillColour()) @@ -141,46 +153,34 @@ break; default: - uWarning() << "Unknown signal type:" << m_SignalType; + uWarning() << "Unknown signal type:" << m_signalType; break; } - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } +/** + * Overrides the UMLWidget method. + */ void SignalWidget::setX(int newX) { m_oldX = getX(); UMLWidget::setX(newX); } +/** + * Overrides the UMLWidget method. + */ void SignalWidget::setY(int newY) { m_oldY = getY(); UMLWidget::setY(newY); } -QSize SignalWidget::calculateSize() -{ - int width = SIGNAL_WIDTH, height = SIGNAL_HEIGHT; - const QFontMetrics &fm = getFontMetrics(FT_BOLD); - const int fontHeight = fm.lineSpacing(); - int textWidth = fm.width(getName()); - - if (m_SignalType == Accept) - textWidth = int((float)textWidth * 1.3f); - height = fontHeight; - if (m_SignalType != Time) - { - width = textWidth > SIGNAL_WIDTH?textWidth:SIGNAL_WIDTH; - height = height > SIGNAL_HEIGHT?height:SIGNAL_HEIGHT; - } - width += SIGNAL_MARGIN * 2; - height += SIGNAL_MARGIN * 2; - - return QSize(width, height); -} - +/** + * Sets the name of the signal. + */ void SignalWidget::setName(const QString &strName) { m_Text = strName; @@ -190,43 +190,40 @@ } } +/** + * Returns the name of the Signal. + */ QString SignalWidget::getName() const { return m_Text; } +/** + * Returns the type of Signal. + */ SignalWidget::SignalType SignalWidget::getSignalType() const { - return m_SignalType; + return m_signalType; } +/** + * Sets the type of Signal. + */ void SignalWidget::setSignalType( SignalType signalType ) { - m_SignalType = signalType; -} - -void SignalWidget::slotMenuSelection(QAction* action) -{ - bool ok = false; - QString name = m_Text; - - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); - switch( sel ) { - case ListPopupMenu::mt_Rename: - name = KInputDialog::getText( i18n("Enter signal name"), i18n("Enter the signal name :"), m_Text, &ok ); - if( ok && name.length() > 0 ) - setName(name); - break; - - default: - UMLWidget::slotMenuSelection(action); - } + m_signalType = signalType; } -void SignalWidget::showProperties() +/** + * Show a properties dialog for a UMLWidget. + */ +void SignalWidget::showPropertiesDialog() { } +/** + * Overrides mouseMoveEvent. + */ void SignalWidget::mouseMoveEvent(QMouseEvent* me) { UMLWidget::mouseMoveEvent(me); @@ -238,20 +235,9 @@ } } -void SignalWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement signalElement = qDoc.createElement( "signalwidget" ); - UMLWidget::saveToXMI( qDoc, signalElement ); - signalElement.setAttribute( "signalname", m_Text ); - signalElement.setAttribute( "documentation", m_Doc ); - signalElement.setAttribute( "signaltype", m_SignalType ); - if (m_pName && !m_pName->text().isEmpty()) { - signalElement.setAttribute( "textid", ID2STR(m_pName->id()) ); - m_pName -> saveToXMI( qDoc, signalElement ); - } - qElement.appendChild( signalElement ); -} - +/** + * Loads a "signalwidget" XMI element. + */ bool SignalWidget::loadFromXMI( QDomElement & qElement ) { if( !UMLWidget::loadFromXMI( qElement ) ) @@ -266,7 +252,7 @@ if (getSignalType() == Time) { if (textId != Uml::id_None) { - UMLWidget *flotext = m_pView -> findWidget( textId ); + UMLWidget *flotext = m_scene -> findWidget( textId ); if (flotext != NULL) { // This only happens when loading files produced by // umbrello-1.3-beta2. @@ -284,7 +270,7 @@ if ( !element.isNull() ) { QString tag = element.tagName(); if (tag == "floatingtext") { - m_pName = new FloatingTextWidget( m_pView, Uml::TextRole::Floating, m_Text, textId ); + m_pName = new FloatingTextWidget( m_scene, Uml::TextRole::Floating, m_Text, textId ); if( ! m_pName->loadFromXMI(element) ) { // Most likely cause: The FloatingTextWidget is empty. delete m_pName; @@ -297,4 +283,67 @@ return true; } +/** + * Creates the "signalwidget" XMI element. + */ +void SignalWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement signalElement = qDoc.createElement( "signalwidget" ); + UMLWidget::saveToXMI( qDoc, signalElement ); + signalElement.setAttribute( "signalname", m_Text ); + signalElement.setAttribute( "documentation", m_Doc ); + signalElement.setAttribute( "signaltype", m_signalType ); + if (m_pName && !m_pName->text().isEmpty()) { + signalElement.setAttribute( "textid", ID2STR(m_pName->id()) ); + m_pName -> saveToXMI( qDoc, signalElement ); + } + qElement.appendChild( signalElement ); +} + +/** + * Show a properties dialog for a SignalWidget. + * + */ +void SignalWidget::slotMenuSelection(QAction* action) +{ + bool ok = false; + QString name = m_Text; + + ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + switch( sel ) { + case ListPopupMenu::mt_Rename: + name = KInputDialog::getText( i18n("Enter signal name"), i18n("Enter the signal name :"), m_Text, &ok ); + if( ok && name.length() > 0 ) + setName(name); + break; + + default: + UMLWidget::slotMenuSelection(action); + } +} + +/** + * Overrides method from UMLWidget + */ +QSize SignalWidget::calculateSize() +{ + int width = SIGNAL_WIDTH, height = SIGNAL_HEIGHT; + const QFontMetrics &fm = getFontMetrics(FT_BOLD); + const int fontHeight = fm.lineSpacing(); + int textWidth = fm.width(getName()); + + if (m_signalType == Accept) + textWidth = int((float)textWidth * 1.3f); + height = fontHeight; + if (m_signalType != Time) + { + width = textWidth > SIGNAL_WIDTH?textWidth:SIGNAL_WIDTH; + height = height > SIGNAL_HEIGHT?height:SIGNAL_HEIGHT; + } + width += SIGNAL_MARGIN * 2; + height += SIGNAL_MARGIN * 2; + + return QSize(width, height); +} + #include "signalwidget.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/signalwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/signalwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/signalwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/signalwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -5,27 +5,30 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * copyright (C) 2002-2006 * + * copyright (C) 2002-2011 * * Umbrello UML Modeller Authors * ***************************************************************************/ #ifndef SIGNALWIDGET_H #define SIGNALWIDGET_H -#include -#include -#include "umlwidget.h" -#include "worktoolbar.h" + #include "floatingtextwidget.h" #include "linkwidget.h" +#include "umlwidget.h" +#include "worktoolbar.h" #define SIGNAL_MARGIN 5 #define SIGNAL_WIDTH 45 #define SIGNAL_HEIGHT 15 -class SignalWidget : public UMLWidget { +/** + * Represents a Send signal, Accept signal or Time event on an + * Activity diagram. + */ +class SignalWidget : public UMLWidget +{ Q_OBJECT public: - /// Enumeration that codes the different types of signal. enum SignalType { @@ -34,90 +37,34 @@ Time }; - /** - * Creates a Signal widget. - * - * @param view The parent of the widget. - * @param signalType The type of Signal. - * @param id The ID to assign (-1 will prompt a new ID.) - */ - explicit SignalWidget( UMLView * view, SignalType signalType = Send, Uml::IDType id = Uml::id_None ); - - /** - * destructor - */ + explicit SignalWidget( UMLScene * scene, SignalType signalType = Send, Uml::IDType id = Uml::id_None ); virtual ~SignalWidget(); - /** - * Overrides the standard paint event. - */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); - /** - * Overrides the UMLWidget method. - */ void setX(int newX); - /** - * Overrides the UMLWidget method. - */ void setY(int newY); - /** - * Sets the name of the signal. - */ virtual void setName(const QString &strName); - - /** - * Returns the name of the Signal. - */ virtual QString getName() const; - /** - * Returns the type of Signal. - */ SignalType getSignalType() const; - - /** - * Sets the type of Signal. - */ void setSignalType( SignalType signalType ); - void slotMenuSelection(QAction* action); + virtual void showPropertiesDialog(); - /** - * Show a properties dialog for a SignalWidget. - * - */ - virtual void showProperties(); - - - /** - * Overrides mouseMoveEvent. - */ void mouseMoveEvent(QMouseEvent *me); - /** - * Creates the "signalwidget" XMI element. - */ - void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); + virtual bool loadFromXMI( QDomElement & qElement ); + virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); - /** - * Loads a "signalwidget" XMI element. - */ - bool loadFromXMI( QDomElement & qElement ); +public Q_SLOTS: + virtual void slotMenuSelection(QAction* action); protected: - /** - * Overrides method from UMLWidget - */ QSize calculateSize(); /** - * Type of signal. - */ - SignalType m_SignalType; - - /** * Save the value of the widget to know how to move the floatingtext */ int m_oldX; @@ -130,6 +77,7 @@ */ FloatingTextWidget* m_pName; + SignalType m_signalType; ///< Type of signal }; #endif diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/statewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/statewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/statewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/statewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -29,8 +29,8 @@ #include "statedialog.h" #include "listpopupmenu.h" -StateWidget::StateWidget(UMLView * view, StateType stateType, Uml::IDType id) - : UMLWidget(view, id) +StateWidget::StateWidget(UMLScene * scene, StateType stateType, Uml::IDType id) + : UMLWidget(scene, id) { UMLWidget::setBaseType(WidgetBase::wt_State); m_StateType = stateType; @@ -42,7 +42,7 @@ { } -void StateWidget::draw(QPainter & p, int offsetX, int offsetY) +void StateWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); const int w = width(); @@ -110,7 +110,7 @@ uWarning() << "Unknown state type:" << m_StateType; break; } - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } @@ -178,7 +178,7 @@ break; case ListPopupMenu::mt_Properties: - showProperties(); + showPropertiesDialog(); break; case ListPopupMenu::mt_New_Activity: @@ -227,12 +227,12 @@ return true; } -void StateWidget::showProperties() +void StateWidget::showPropertiesDialog() { DocWindow *docwindow = UMLApp::app()->docWindow(); docwindow->updateDocumentation(false); - QPointer dialog = new StateDialog(m_pView, this); + QPointer dialog = new StateDialog(m_scene, this); if (dialog->exec() && dialog->getChangesMade()) { docwindow->showDocumentation(this, true); UMLApp::app()->document()->setModified(true); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/statewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/statewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/statewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/statewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -52,11 +52,11 @@ /** * Creates a State widget. * - * @param view The parent of the widget. + * @param scene The parent of the widget. * @param stateType The type of state. * @param id The ID to assign (-1 will prompt a new ID.) */ - explicit StateWidget( UMLView * view, StateType stateType = Normal, Uml::IDType id = Uml::id_None ); + explicit StateWidget( UMLScene * scene, StateType stateType = Normal, Uml::IDType id = Uml::id_None ); /** * destructor @@ -66,7 +66,7 @@ /** * Overrides the standard paint event. */ - void draw(QPainter & p, int offsetX, int offsetY); + void paint(QPainter & p, int offsetX, int offsetY); /** * Sets the name of the State. @@ -116,7 +116,7 @@ /** * Show a properties dialog for a StateWidget. */ - void showProperties(); + void showPropertiesDialog(); /** * Returns true if the given toolbar button represents a State. diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/toolbarstateonewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/toolbarstateonewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/toolbarstateonewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/toolbarstateonewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -11,85 +12,118 @@ // own header #include "toolbarstateonewidget.h" -// local includes -#include "debug_utils.h" +// app includes +#include "activitywidget.h" #include "dialog_utils.h" #include "floatingtextwidget.h" -#include "pinwidget.h" -#include "preconditionwidget.h" #include "messagewidget.h" #include "objectwidget.h" -#include "activitywidget.h" +#include "pinwidget.h" +#include "preconditionwidget.h" #include "regionwidget.h" -#include "umlwidget.h" #include "uml.h" #include "umldoc.h" -#include "umlview.h" +#include "umlscene.h" +#include "umlwidget.h" // kde includes #include #include -#include - using namespace Uml; -ToolBarStateOneWidget::ToolBarStateOneWidget(UMLView *umlView) - : ToolBarStatePool(umlView) +/** + * Creates a new ToolBarStateOneWidget. + * + * @param umlView The UMLView to use. + */ +ToolBarStateOneWidget::ToolBarStateOneWidget(UMLScene *umlScene) + : ToolBarStatePool(umlScene), + m_firstObject(0), + m_isObjectWidgetLine(false) { - m_umlView = umlView; - m_firstObject = 0; } +/** + * Destroys this ToolBarStateOneWidget. + */ ToolBarStateOneWidget::~ToolBarStateOneWidget() { } -void ToolBarStateOneWidget::init() -{ - ToolBarStatePool::init(); -} - +/** + * Called when the current tool is changed to use another tool. + * Executes base method and cleans the message. + */ void ToolBarStateOneWidget::cleanBeforeChange() { ToolBarStatePool::cleanBeforeChange(); } -void ToolBarStateOneWidget::mouseMove(QMouseEvent* ome) +/** + * Called when a mouse event happened. + * It executes the base method and then updates the position of the + * message line, if any. + */ +void ToolBarStateOneWidget::mouseMove(UMLSceneMouseEvent* ome) { ToolBarStatePool::mouseMove(ome); } +/** + * A widget was removed from the UMLView. + * If the widget removed was the current widget, the current widget is set + * to 0. + * Also, if it was the first object, the message is cleaned. + */ void ToolBarStateOneWidget::slotWidgetRemoved(UMLWidget* widget) { ToolBarState::slotWidgetRemoved(widget); } +/** + * Selects only widgets, but no associations. + * Overrides base class method. + * If the press event happened on the line of an object, the object is set + * as current widget. If the press event happened on a widget, the widget is + * set as current widget. + */ void ToolBarStateOneWidget::setCurrentElement() { m_isObjectWidgetLine = false; - ObjectWidget* objectWidgetLine = m_pUMLView->onWidgetLine(m_pMouseEvent->pos()); + ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos()); if (objectWidgetLine) { setCurrentWidget(objectWidgetLine); m_isObjectWidgetLine = true; return; } - UMLWidget *widget = m_pUMLView->widgetAt(m_pMouseEvent->pos()); + UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos()); if (widget) { setCurrentWidget(widget); return; } } +/** + * Called when the release event happened on a widget. + * If the button pressed isn't left button or the widget isn't an object + * widget, the message is cleaned. + * If the release event didn't happen on the line of an object and the first + * object wasn't selected, nothing is done. If the first object was already + * selected, a creation message is made. + * If the event happened on the line of an object, the first object or the + * second are set, depending on whether the first object was already set or + * not. + */ void ToolBarStateOneWidget::mouseReleaseWidget() { - WidgetBase::WidgetType widgetType = getWidgetType(); + WidgetBase::WidgetType type = widgetType(); - if (widgetType == WidgetBase::wt_Precondition) { + if (type == WidgetBase::wt_Precondition) { m_firstObject = 0; } - if (widgetType == WidgetBase::wt_Pin) { + if (type == WidgetBase::wt_Pin) { m_firstObject = 0; } @@ -100,7 +134,7 @@ return; } - if (!m_firstObject && widgetType == WidgetBase::wt_Pin) { + if (!m_firstObject && type == WidgetBase::wt_Pin) { setWidget(getCurrentWidget()); return ; } @@ -115,36 +149,52 @@ } +/** + * Called when the release event happened on an empty space. + * Cleans the message. + * Empty spaces are not only actual empty spaces, but also associations. + */ void ToolBarStateOneWidget::mouseReleaseEmpty() { } +/** + * Sets the first object of the message using the specified object. + * The temporal visual message is created and mouse tracking enabled, so + * mouse events will be delivered. + * + * @param firstObject The first object of the message. + */ void ToolBarStateOneWidget::setWidget(UMLWidget* firstObject) { m_firstObject = firstObject; - UMLWidget * umlwidget = NULL; - //m_pUMLView->viewport()->setMouseTracking(true); - if (getWidgetType() == WidgetBase::wt_Precondition) { - umlwidget = new PreconditionWidget(m_pUMLView, static_cast(m_firstObject)); + UMLWidget * umlwidget = 0; + //m_pUMLScene->viewport()->setMouseTracking(true); + if (widgetType() == WidgetBase::wt_Precondition) { + umlwidget = new PreconditionWidget(m_pUMLScene, static_cast(m_firstObject)); Dialog_Utils::askNameForWidget(umlwidget, i18n("Enter Precondition Name"), i18n("Enter the precondition"), i18n("new precondition")); // Create the widget. Some setup functions can remove the widget. } - if (getWidgetType() == WidgetBase::wt_Pin) { - umlwidget = new PinWidget(m_pUMLView, m_firstObject); + if (widgetType() == WidgetBase::wt_Pin) { + umlwidget = new PinWidget(m_pUMLScene, m_firstObject); // Create the widget. Some setup functions can remove the widget. } - if (umlwidget != NULL) { - m_pUMLView->setupNewWidget(umlwidget); + if (umlwidget) { + m_pUMLScene->setupNewWidget(umlwidget); } } - -WidgetBase::WidgetType ToolBarStateOneWidget::getWidgetType() +/** + * Returns the widget type of this tool. + * + * @return The widget type of this tool. + */ +WidgetBase::WidgetType ToolBarStateOneWidget::widgetType() { if (getButton() == WorkToolBar::tbb_Seq_Precondition) { return WidgetBase::wt_Precondition; @@ -158,4 +208,12 @@ return WidgetBase::wt_Pin; } +/** + * Goes back to the initial state. + */ +void ToolBarStateOneWidget::init() +{ + ToolBarStatePool::init(); +} + #include "toolbarstateonewidget.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/toolbarstateonewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/toolbarstateonewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/toolbarstateonewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/toolbarstateonewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -14,10 +15,6 @@ #include "toolbarstatepool.h" #include "widgetbase.h" -class ObjectWidget; -class QMouseEvent; -class UMLWidget; - /** * Sequence tool to create components linked with one object in sequence diagram * like precondition. @@ -28,110 +25,36 @@ { Q_OBJECT public: - - /** - * Creates a new ToolBarStateOneWidget. - * - * @param umlView The UMLView to use. - */ - ToolBarStateOneWidget(UMLView *umlView); - - /** - * Destroys this ToolBarStateOneWidget. - */ + ToolBarStateOneWidget(UMLScene *umlScene); virtual ~ToolBarStateOneWidget(); - /** - * Goes back to the initial state. - */ - virtual void init(); - - /** - * Called when the current tool is changed to use another tool. - * Executes base method and cleans the message. - */ virtual void cleanBeforeChange(); - /** - * Called when a mouse event happened. - * It executes the base method and then updates the position of the - * message line, if any. - */ - virtual void mouseMove(QMouseEvent* ome); - -public slots: + // FIXME: obsolate + virtual void mouseMove(UMLSceneMouseEvent* ome); - /** - * A widget was removed from the UMLView. - * If the widget removed was the current widget, the current widget is set - * to 0. - * Also, if it was the first object, the message is cleaned. - */ +public Q_SLOTS: virtual void slotWidgetRemoved(UMLWidget* widget); protected: - - /** - * Selects only widgets, but no associations. - * Overrides base class method. - * If the press event happened on the line of an object, the object is set - * as current widget. If the press event happened on a widget, the widget is - * set as current widget. - */ virtual void setCurrentElement(); - /** - * Called when the release event happened on a widget. - * If the button pressed isn't left button or the widget isn't an object - * widget, the message is cleaned. - * If the release event didn't happen on the line of an object and the first - * object wasn't selected, nothing is done. If the first object was already - * selected, a creation message is made. - * If the event happened on the line of an object, the first object or the - * second are set, depending on whether the first object was already set or - * not. - */ virtual void mouseReleaseWidget(); - - /** - * Called when the release event happened on an empty space. - * Cleans the message. - * Empty spaces are not only actual empty spaces, but also associations. - */ virtual void mouseReleaseEmpty(); -protected: - - /** - * Sets the first object of the message using the specified object. - * The temporal visual message is created and mouse tracking enabled, so - * mouse events will be delivered. - * - * @param firstObject The first object of the message. - */ void setWidget(UMLWidget* firstObject); + WidgetBase::WidgetType widgetType(); + UMLWidget* m_firstObject; ///< The first object in the message. /** - * Returns the widget type of this tool. - * - * @return The widget type of this tool. - */ - WidgetBase::WidgetType getWidgetType(); - - - /** - * The first object in the message. - */ - UMLWidget* m_firstObject; - - UMLView * m_umlView; - /** * If there is a current widget, it is true if the press event happened on * the line of an object, or false if it happened on a normal UMLWidget. */ bool m_isObjectWidgetLine; +private: + virtual void init(); }; #endif //TOOLBARSTATEONEWIDGET_H diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/umlwidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/umlwidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/umlwidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/umlwidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -42,8 +42,8 @@ using namespace Uml; -UMLWidget::UMLWidget(UMLView * view, UMLObject * o, UMLWidgetController *widgetController /* = 0*/) - : WidgetBase(view), Q3CanvasRectangle(view->canvas()), +UMLWidget::UMLWidget(UMLScene * scene, UMLObject * o, UMLWidgetController *widgetController /* = 0*/) + : WidgetBase(scene), UMLSceneRectangle(scene->canvas()), m_pMenu(0), m_menuIsEmbedded(false) { if (widgetController) { @@ -59,8 +59,8 @@ } } -UMLWidget::UMLWidget(UMLView * view, Uml::IDType id /* = Uml::id_None */, UMLWidgetController *widgetController /* = 0*/) - : WidgetBase(view), Q3CanvasRectangle(view->canvas()), +UMLWidget::UMLWidget(UMLScene *scene, Uml::IDType id /* = Uml::id_None */, UMLWidgetController *widgetController /* = 0*/) + : WidgetBase(scene), UMLSceneRectangle(scene->canvas()), m_pMenu(0) { if (widgetController) { @@ -87,38 +87,39 @@ if (this == &other) return *this; + WidgetBase::operator=(other); + // assign members loaded/saved - m_bUseFillColour = other.m_bUseFillColour; - m_nId = other.m_nId; - m_Type = other.m_Type; - setX(other.getX()); - setY(other.getY()); + m_useFillColour = other.m_useFillColour; + m_usesDiagramFillColour = other.m_usesDiagramFillColour; + m_usesDiagramUseFillColour = other.m_usesDiagramUseFillColour; + m_FillColour = other.m_FillColour; m_Assocs = other.m_Assocs; + m_Text = other.m_Text; //new m_Font = other.m_Font; - Q3CanvasRectangle::setSize(other.width(), other.height()); - m_bUsesDiagramFillColour = other.m_bUsesDiagramFillColour; - m_bUsesDiagramLineColour = other.m_bUsesDiagramLineColour; - m_bUsesDiagramLineWidth = other.m_bUsesDiagramLineWidth; - m_bUsesDiagramUseFillColour = other.m_bUsesDiagramUseFillColour; - m_LineColour = other.m_LineColour; - m_LineWidth = other.m_LineWidth; - m_FillColour = other.m_FillColour; - m_bIsInstance = other.m_bIsInstance; + m_isInstance = other.m_isInstance; + m_instanceName = other.m_instanceName; m_instanceName = other.m_instanceName; + m_showStereotype = other.m_showStereotype; + setX(other.getX()); + setY(other.getY()); + UMLSceneRectangle::setSize(other.width(), other.height()); // assign volatile (non-saved) members - m_bSelected = other.m_bSelected; - m_bStartMove = other.m_bStartMove; + m_selected = other.m_selected; + m_startMove = other.m_startMove; m_nPosX = other.m_nPosX; - m_pObject = other.m_pObject; - m_pView = other.m_pView; + m_origZ = other.m_origZ; //new m_pMenu = other.m_pMenu; - m_bResizable = other.m_bResizable; + m_menuIsEmbedded = other.m_menuIsEmbedded; + m_pDoc = other.m_pDoc; //new + m_resizable = other.m_resizable; for (unsigned i = 0; i < FT_INVALID; ++i) m_pFontMetrics[i] = other.m_pFontMetrics[i]; - m_bActivated = other.m_bActivated; - m_bIgnoreSnapToGrid = other.m_bIgnoreSnapToGrid; - m_bIgnoreSnapComponentSizeToGrid = other.m_bIgnoreSnapComponentSizeToGrid; + m_activated = other.m_activated; + m_ignoreSnapToGrid = other.m_ignoreSnapToGrid; + m_ignoreSnapComponentSizeToGrid = other.m_ignoreSnapComponentSizeToGrid; + // m_widgetController do not have any settings return *this; } @@ -159,7 +160,7 @@ // NOTE: In the comparison tests we are going to do, we don't need these values. // They will actually stop things functioning correctly so if you change these, be aware of that. /* - if(m_bUseFillColour != other.m_bUseFillColour) + if(m_useFillColour != other.m_useFillColour) return false; if(m_nId != other.m_nId) return false; @@ -188,10 +189,10 @@ adjustAssocs(getX(), getY()); //adjust assoc lines. switch (m_Type) { case WidgetBase::wt_Class: - m_pView->createAutoAttributeAssociations(this); + m_scene->createAutoAttributeAssociations(this); break; case WidgetBase::wt_Entity: - m_pView->createAutoConstraintAssociations(this); + m_scene->createAutoConstraintAssociations(this); break; default: break; @@ -223,44 +224,44 @@ void UMLWidget::init() { m_nId = Uml::id_None; - m_bIsInstance = false; - if (m_pView) { - m_bUseFillColour = true; - m_bUsesDiagramFillColour = true; - m_bUsesDiagramUseFillColour = true; - const Settings::OptionState& optionState = m_pView->optionState(); + m_isInstance = false; + if (m_scene) { + m_useFillColour = true; + m_usesDiagramFillColour = true; + m_usesDiagramUseFillColour = true; + const Settings::OptionState& optionState = m_scene->optionState(); m_FillColour = optionState.uiState.fillColor; m_Font = optionState.uiState.font; - m_bShowStereotype = optionState.classState.showStereoType; + m_showStereotype = optionState.classState.showStereoType; } else { - uError() << "SERIOUS PROBLEM - m_pView is NULL"; - m_bUseFillColour = false; - m_bUsesDiagramFillColour = false; - m_bUsesDiagramUseFillColour = false; - m_bShowStereotype = false; + uError() << "SERIOUS PROBLEM - m_scene is NULL"; + m_useFillColour = false; + m_usesDiagramFillColour = false; + m_usesDiagramUseFillColour = false; + m_showStereotype = false; } for (int i = 0; i < (int)FT_INVALID; ++i) m_pFontMetrics[(UMLWidget::FontType)i] = 0; - m_bResizable = true; + m_resizable = true; - m_bSelected = false; - m_bStartMove = false; - m_bActivated = false; - m_bIgnoreSnapToGrid = false; - m_bIgnoreSnapComponentSizeToGrid = false; + m_selected = false; + m_startMove = false; + m_activated = false; + m_ignoreSnapToGrid = false; + m_ignoreSnapComponentSizeToGrid = false; m_pMenu = 0; m_pDoc = UMLApp::app()->document(); m_nPosX = 0; - connect(m_pView, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); - connect(m_pView, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); + connect(m_scene, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); + connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); - connect(m_pView, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); - connect(m_pView, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); + connect(m_scene, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); + connect(m_scene, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); - // connect( m_pView, SIGNAL(sigColorChanged(int)), this, SLOT(slotColorChanged(int))); + // connect( m_scene, SIGNAL(sigColorChanged(int)), this, SLOT(slotColorChanged(int))); m_pObject = NULL; setZ(m_origZ = 2); // default for most widgets } @@ -280,7 +281,7 @@ case ListPopupMenu::mt_Delete: //remove self from diagram - m_pView->removeWidget(this); + m_scene->removeWidget(this); break; //UMLWidgetController::doMouseDoubleClick relies on this implementation @@ -289,13 +290,13 @@ wt == WidgetBase::wt_Package || wt == WidgetBase::wt_Interface || wt == WidgetBase::wt_Datatype || wt == WidgetBase::wt_Component || wt == WidgetBase::wt_Artifact || wt == WidgetBase::wt_Node || wt == WidgetBase::wt_Enum || wt == WidgetBase::wt_Entity || - (wt == WidgetBase::wt_Class && m_pView->type() == Uml::DiagramType::Class)) { + (wt == WidgetBase::wt_Class && m_scene->type() == Uml::DiagramType::Class)) { UMLApp::app()->beginMacro(i18n("Change Properties")); - showProperties(); + showPropertiesDialog(); UMLApp::app()->endMacro(); } else if (wt == wt_Object) { UMLApp::app()->beginMacro(i18n("Change Properties")); - m_pObject->showProperties(); + m_pObject->showPropertiesPagedDialog(); UMLApp::app()->endMacro(); } else { uWarning() << "making properties dialog for unknown widget type"; @@ -304,32 +305,32 @@ break; case ListPopupMenu::mt_Line_Color: - widget = m_pView->getFirstMultiSelectedWidget(); + widget = m_scene->getFirstMultiSelectedWidget(); if (widget) { newColour = widget->lineColor(); } if (KColorDialog::getColor(newColour)) { - m_pView->selectionSetLineColor(newColour); + m_scene->selectionSetLineColor(newColour); m_pDoc->setModified(true); } break; case ListPopupMenu::mt_Fill_Color: - widget = m_pView->getFirstMultiSelectedWidget(); + widget = m_scene->getFirstMultiSelectedWidget(); if (widget) { newColour = widget->getFillColor(); } if (KColorDialog::getColor(newColour)) { - m_pView->selectionSetFillColor(newColour); + m_scene->selectionSetFillColor(newColour); m_pDoc->setModified(true); } break; case ListPopupMenu::mt_Use_Fill_Color: - m_bUseFillColour = !m_bUseFillColour; - m_bUsesDiagramUseFillColour = false; - m_pView->selectionUseFillColor(m_bUseFillColour); + m_useFillColour = !m_useFillColour; + m_usesDiagramUseFillColour = false; + m_scene->selectionUseFillColor(m_useFillColour); break; case ListPopupMenu::mt_Show_Attributes_Selection: case ListPopupMenu::mt_Show_Operations_Selection: @@ -340,7 +341,7 @@ case ListPopupMenu::mt_Show_Packages_Selection: case ListPopupMenu::mt_Show_Stereotypes_Selection: case ListPopupMenu::mt_Show_Public_Only_Selection: - m_pView->selectionToggleShow(sel); + m_scene->selectionToggleShow(sel); m_pDoc->setModified(true); break; @@ -353,20 +354,20 @@ } case ListPopupMenu::mt_Delete_Selection: - m_pView->deleteSelection(); + m_scene->deleteSelection(); break; case ListPopupMenu::mt_Change_Font: case ListPopupMenu::mt_Change_Font_Selection: { QFont font = UMLWidget::font(); - if (KFontDialog::getFont(font, KFontChooser::NoDisplayFlags, m_pView)) { - UMLApp::app()->executeCommand(new CmdChangeFontSelection(m_pDoc, m_pView, font)); + if (KFontDialog::getFont(font, KFontChooser::NoDisplayFlags, m_scene)) { + UMLApp::app()->executeCommand(new CmdChangeFontSelection(m_pDoc, m_scene, font)); } } break; case ListPopupMenu::mt_Cut: - m_pView->setStartedCut(); + m_scene->setStartedCut(); UMLApp::app()->slotEditCut(); break; @@ -389,7 +390,7 @@ // In principle we clone all the uml objects. { UMLObject *pClone = m_pObject->clone(); - m_pView->addObject(pClone); + m_scene->addObject(pClone); } break; @@ -415,17 +416,17 @@ void UMLWidget::slotColorChanged(Uml::IDType viewID) { //only change if on the diagram concerned - if (m_pView->getID() != viewID) { + if (m_scene->getID() != viewID) { return; } - if (m_bUsesDiagramFillColour) { - m_FillColour = m_pView->getFillColor(); + if (m_usesDiagramFillColour) { + m_FillColour = m_scene->getFillColor(); } - if (m_bUsesDiagramLineColour) { - m_LineColour = m_pView->getLineColor(); + if (m_usesDiagramLineColour) { + m_LineColour = m_scene->getLineColor(); } - if (m_bUsesDiagramUseFillColour) { - m_bUseFillColour = m_pView->getUseFillColor(); + if (m_usesDiagramUseFillColour) { + m_useFillColour = m_scene->getUseFillColor(); } update(); } @@ -433,11 +434,11 @@ void UMLWidget::slotLineWidthChanged(Uml::IDType viewID) { //only change if on the diagram concerned - if (m_pView->getID() != viewID) { + if (m_scene->getID() != viewID) { return; } - if (m_bUsesDiagramLineWidth) { - m_LineWidth = m_pView->getLineWidth(); + if (m_usesDiagramLineWidth) { + m_LineWidth = m_scene->getLineWidth(); } update(); } @@ -449,8 +450,8 @@ void UMLWidget::setUseFillColour(bool fc) { - m_bUseFillColour = fc; - m_bUsesDiagramUseFillColour = false; + m_useFillColour = fc; + m_usesDiagramUseFillColour = false; update(); } @@ -479,7 +480,7 @@ void UMLWidget::setFillColourcmd(const QColor &colour) { m_FillColour = colour; - m_bUsesDiagramFillColour = false; + m_usesDiagramFillColour = false; update(); } @@ -499,7 +500,7 @@ p->fillRect(offsetX + w - s, offsetY, s, s, brush); // Draw the resize anchor in the lower right corner. - if (m_bResizable) { + if (m_resizable) { brush.setColor(Qt::red); const int right = offsetX + w; const int bottom = offsetY + h; @@ -522,16 +523,16 @@ } setFont(m_Font); setSize(getWidth(), getHeight()); - m_bActivated = true; + m_activated = true; updateComponentSize(); - if (m_pView->getPaste()) { + if (m_scene->getPaste()) { FloatingTextWidget * ft = 0; - QPoint point = m_pView->getPastePoint(); + QPoint point = m_scene->getPastePoint(); int x = point.x() + getX(); int y = point.y() + getY(); x = x < 0 ? 0 : x; y = y < 0 ? 0 : y; - if (m_pView->type() == Uml::DiagramType::Sequence) { + if (m_scene->type() == Uml::DiagramType::Sequence) { switch (baseType()) { case WidgetBase::wt_Object: case WidgetBase::wt_Precondition : @@ -569,21 +570,21 @@ setX(getX()); setY(getY()); } - if (m_pView->getPaste()) - m_pView->createAutoAssociations(this); + if (m_scene->getPaste()) + m_scene->createAutoAssociations(this); updateComponentSize(); return true; } -/** Read property of bool m_bActivated. */ +/** Read property of bool m_activated. */ bool UMLWidget::isActivated() { - return m_bActivated; + return m_activated; } void UMLWidget::setActivated(bool Active /*=true*/) { - m_bActivated = Active; + m_activated = Active; } void UMLWidget::addAssoc(AssociationWidget* pAssoc) @@ -641,7 +642,7 @@ } } -void UMLWidget::showProperties() +void UMLWidget::showPropertiesDialog() { // will already be selected so make sure docWindow updates the doc // back it the widget @@ -670,12 +671,12 @@ m_menuIsEmbedded = false; //if in a multi- selection to a specific m_pMenu for that // NEW: ask UMLView to count ONLY the widgets and not their floatingtextwidgets - int count = m_pView->getSelectCount(true); + int count = m_scene->getSelectCount(true); //a MessageWidget when selected will select its text widget and vice versa //so take that into account for popup menu. // determine multi state - bool multi = (m_bSelected && count > 1); + bool multi = (m_selected && count > 1); // if multiple selected items have the same type bool unique = false; @@ -683,10 +684,10 @@ // if multiple items are selected, we have to check if they all have the same // base type if (multi == true) - unique = m_pView->checkUniqueSelection(); + unique = m_scene->checkUniqueSelection(); // create the right click context menu - m_pMenu = new ListPopupMenu(m_pView, this, multi, unique); + m_pMenu = new ListPopupMenu(m_scene, this, multi, unique); // disable the "view code" menu for simple code generators if (UMLApp::app()->isSimpleCodeGeneratorActive()) @@ -739,18 +740,18 @@ void UMLWidget::drawShape(QPainter &p) { - draw(p, getX(), getY()); + paint(p, getX(), getY()); } void UMLWidget::setSelected(bool _select) { const WidgetBase::WidgetType wt = m_Type; if (_select) { - if (m_pView->getSelectCount() == 0) { + if (m_scene->getSelectCount() == 0) { if (widgetHasUMLObject(wt)) { - m_pView->showDocumentation(m_pObject, false); + m_scene->showDocumentation(m_pObject, false); } else { - m_pView->showDocumentation(this, false); + m_scene->showDocumentation(this, false); } }//end if /* if (wt != wt_Text && wt != wt_Box) { @@ -760,13 +761,13 @@ /* if (wt != wt_Text && wt != wt_Box) { setZ(m_origZ); } */ - if (m_bSelected) - m_pView->updateDocumentation(true); + if (m_selected) + m_scene->updateDocumentation(true); } - m_bSelected = _select; + m_selected = _select; const QPoint pos(getX(), getY()); - UMLWidget *bkgnd = m_pView->widgetAt(pos); + UMLWidget *bkgnd = m_scene->widgetAt(pos); if (bkgnd && bkgnd != this && _select) { uDebug() << "setting Z to " << bkgnd->getZ() + 1 << ", SelectState: " << _select; setZ(bkgnd->getZ() + 1); @@ -786,40 +787,40 @@ setSelected(false); } -void UMLWidget::setView(UMLView * v) +void UMLWidget::setScene(UMLScene * v) { //remove signals from old view - was probably 0 anyway - disconnect(m_pView, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); - disconnect(m_pView, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); - disconnect(m_pView, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); - disconnect(m_pView, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); - m_pView = v; - connect(m_pView, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); - connect(m_pView, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); - connect(m_pView, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); - connect(m_pView, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); + disconnect(m_scene, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); + disconnect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); + disconnect(m_scene, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); + disconnect(m_scene, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); + m_scene = v; + connect(m_scene, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu())); + connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected())); + connect(m_scene, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType))); + connect(m_scene, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType))); } void UMLWidget::setX(int x) { - if (!m_bIgnoreSnapToGrid) { - x = m_pView->snappedX(x); + if (!m_ignoreSnapToGrid) { + x = m_scene->snappedX(x); } - Q3CanvasItem::setX(x); + UMLSceneItem::setX(x); } void UMLWidget::setY(int y) { - if (!m_bIgnoreSnapToGrid) { - y = m_pView->snappedX(y); + if (!m_ignoreSnapToGrid) { + y = m_scene->snappedX(y); } - Q3CanvasItem::setY(y); + UMLSceneItem::setY(y); } void UMLWidget::setZ(int z) { m_origZ = getZ(); - Q3CanvasItem::setZ(z); + UMLSceneItem::setZ(z); } void UMLWidget::setName(const QString &strName) @@ -870,39 +871,38 @@ void UMLWidget::setIgnoreSnapToGrid(bool to) { - m_bIgnoreSnapToGrid = to; + m_ignoreSnapToGrid = to; } bool UMLWidget::getIgnoreSnapToGrid() const { - return m_bIgnoreSnapToGrid; + return m_ignoreSnapToGrid; } void UMLWidget::setSize(int width, int height) { // snap to the next larger size that is a multiple of the grid - if (!m_bIgnoreSnapComponentSizeToGrid - && m_pView->getSnapComponentSizeToGrid()) { + if (!m_ignoreSnapComponentSizeToGrid + && m_scene->getSnapComponentSizeToGrid()) { // integer divisions - int numX = width / m_pView->getSnapX(); - int numY = height / m_pView->getSnapY(); + int numX = width / m_scene->getSnapX(); + int numY = height / m_scene->getSnapY(); // snap to the next larger valid value - if (width > numX * m_pView->getSnapX()) - width = (numX + 1) * m_pView->getSnapX(); - if (height > numY * m_pView->getSnapY()) - height = (numY + 1) * m_pView->getSnapY(); + if (width > numX * m_scene->getSnapX()) + width = (numX + 1) * m_scene->getSnapX(); + if (height > numY * m_scene->getSnapY()) + height = (numY + 1) * m_scene->getSnapY(); } - Q3CanvasRectangle::setSize(width, height); + UMLSceneRectangle::setSize(width, height); } void UMLWidget::updateComponentSize() { if (m_pDoc->loading()) return; - const int w = getWidth(); - const int h = getHeight(); - setSize(w, h); + QSize size = calculateSize(); + setSize(size.width(), size.height()); adjustAssocs(getX(), getY()); // adjust assoc lines } @@ -966,7 +966,6 @@ setFontMetrics(fontType, painter.fontMetrics()); } -//FIXME this is probably the source of problems with widgets not being wide enough QFontMetrics &UMLWidget::getFontMetrics(UMLWidget::FontType fontType) { if (m_pFontMetrics[fontType] == 0) { @@ -1014,14 +1013,14 @@ void UMLWidget::setShowStereotype(bool _status) { - m_bShowStereotype = _status; + m_showStereotype = _status; updateComponentSize(); update(); } bool UMLWidget::getShowStereotype() const { - return m_bShowStereotype; + return m_showStereotype; } void UMLWidget::moveEvent(QMoveEvent* /*me*/) @@ -1037,24 +1036,24 @@ WidgetBase::saveToXMI(qDoc, qElement); qElement.setAttribute("xmi.id", ID2STR(id())); qElement.setAttribute("font", m_Font.toString()); - qElement.setAttribute("usefillcolor", m_bUseFillColour); + qElement.setAttribute("usefillcolor", m_useFillColour); qElement.setAttribute("x", getX()); qElement.setAttribute("y", getY()); qElement.setAttribute("width", getWidth()); qElement.setAttribute("height", getHeight()); // for consistency the following attributes now use american spelling for "color" - qElement.setAttribute("usesdiagramfillcolor", m_bUsesDiagramFillColour); - qElement.setAttribute("usesdiagramusefillcolor", m_bUsesDiagramUseFillColour); - if (m_bUsesDiagramFillColour) { + qElement.setAttribute("usesdiagramfillcolor", m_usesDiagramFillColour); + qElement.setAttribute("usesdiagramusefillcolor", m_usesDiagramUseFillColour); + if (m_usesDiagramFillColour) { qElement.setAttribute("fillcolor", "none"); } else { qElement.setAttribute("fillcolor", m_FillColour.name()); } - qElement.setAttribute("isinstance", m_bIsInstance); + qElement.setAttribute("isinstance", m_isInstance); if (!m_instanceName.isEmpty()) qElement.setAttribute("instancename", m_instanceName); - if (m_bShowStereotype) - qElement.setAttribute("showstereotype", m_bShowStereotype); + if (m_showStereotype) + qElement.setAttribute("showstereotype", m_showStereotype); } bool UMLWidget::loadFromXMI(QDomElement & qElement) @@ -1090,9 +1089,9 @@ << " for widget with xmi.id " << ID2STR(m_nId) << endl; //setFont( m_Font ); } - m_bUseFillColour = (bool)usefillcolor.toInt(); - m_bUsesDiagramFillColour = (bool)usesDiagramFillColour.toInt(); - m_bUsesDiagramUseFillColour = (bool)usesDiagramUseFillColour.toInt(); + m_useFillColour = (bool)usefillcolor.toInt(); + m_usesDiagramFillColour = (bool)usesDiagramFillColour.toInt(); + m_usesDiagramUseFillColour = (bool)usesDiagramUseFillColour.toInt(); setSize(w.toInt(), h.toInt()); setX(x.toInt()); setY(y.toInt()); @@ -1100,10 +1099,10 @@ m_FillColour = QColor(fillColour); } QString isinstance = qElement.attribute("isinstance", "0"); - m_bIsInstance = (bool)isinstance.toInt(); + m_isInstance = (bool)isinstance.toInt(); m_instanceName = qElement.attribute("instancename", ""); QString showstereo = qElement.attribute("showstereotype", "0"); - m_bShowStereotype = (bool)showstereo.toInt(); + m_showStereotype = (bool)showstereo.toInt(); return true; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/umlwidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/umlwidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/umlwidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/umlwidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -12,18 +12,18 @@ #define UMLWIDGET_H #include -#include #include #include "basictypes.h" #include "widgetbase.h" #include "associationwidgetlist.h" #include "optionstate.h" +#include "umlscene.h" class UMLWidgetController; class UMLObject; -class UMLView; +class UMLScene; class UMLDoc; class ListPopupMenu; class IDChangeLog; @@ -39,7 +39,7 @@ * @author Paul Hensgen * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ -class UMLWidget : public WidgetBase, public Q3CanvasRectangle +class UMLWidget : public WidgetBase, public UMLSceneRectangle { Q_OBJECT public: @@ -48,21 +48,21 @@ /** * Creates a UMLWidget object. * - * @param view The view to be displayed on. + * @param scene The view to be displayed on. * @param o The UMLObject to represent. * @param widgetController The UMLWidgetController of this UMLWidget */ - UMLWidget( UMLView * view, UMLObject * o, UMLWidgetController *widgetController = 0 ); + UMLWidget(UMLScene * scene, UMLObject * o, UMLWidgetController *widgetController = 0 ); /** * Creates a UMLWidget object. * - * @param view The view to be displayed on. + * @param scene The view to be displayed on. * @param id The id of the widget. * The default value (id_None) will prompt generation of a new ID. * @param widgetController The UMLWidgetController of this UMLWidget */ - explicit UMLWidget( UMLView * view, Uml::IDType id = Uml::id_None, UMLWidgetController *widgetController = 0 ); + explicit UMLWidget(UMLScene * scene, Uml::IDType id = Uml::id_None, UMLWidgetController *widgetController = 0 ); /** * Standard deconstructor @@ -108,10 +108,10 @@ void setUseFillColour(bool fc); /** - * Read property of bool m_bUseFillColour. + * Read property of bool m_useFillColour. */ bool getUseFillColour() const { - return m_bUseFillColour; + return m_useFillColour; } /** @@ -179,11 +179,11 @@ * @return Returns the state of whether the widget is selected. */ bool getSelected() const { - return m_bSelected; + return m_selected; } void setSelectedFlag(bool _select) { - m_bSelected = _select; + m_selected = _select; } /** @@ -191,7 +191,7 @@ * * @param v The view the widget is on. */ - void setView(UMLView * v); + void setScene(UMLScene * v); /** * Activate the object after serializing it from a QDataStream @@ -220,7 +220,7 @@ * @param offsetY y position to start the drawing. * */ - virtual void draw(QPainter & p, int offsetX, int offsetY) = 0; + virtual void paint(QPainter & p, int offsetX, int offsetY) = 0; /** * Set the pen. @@ -246,7 +246,7 @@ * @return The moving state. */ bool getStartMove() { - return m_bStartMove; + return m_startMove; } /** @@ -278,51 +278,51 @@ * Gets the x-coordinate. */ int getX() const { - return (int)Q3CanvasItem::x(); + return (int)UMLSceneItem::x(); } /** * Gets the y-coordinate. */ int getY() const { - return (int)Q3CanvasItem::y(); + return (int)UMLSceneItem::y(); } /** * Gets the z-coordinate. */ int getZ() const { - return (int)Q3CanvasItem::z(); + return (int)UMLSceneItem::z(); } /** * Returns the height of widget. */ int getHeight() const { - return Q3CanvasRectangle::height(); + return UMLSceneRectangle::height(); } /** * Returns the width of the widget. */ int getWidth() const { - return Q3CanvasRectangle::width(); + return UMLSceneRectangle::width(); } /** * Sets the size. - * If m_pView->getSnapComponentSizeToGrid() is true, then + * If m_scene->getSnapComponentSizeToGrid() is true, then * set the next larger size that snaps to the grid. */ void setSize(int width,int height); /** - * Set m_bIgnoreSnapToGrid. + * Set m_ignoreSnapToGrid. */ void setIgnoreSnapToGrid(bool to); /** - * Return the value of m_bIgnoreSnapToGrid. + * Return the value of m_ignoreSnapToGrid. */ bool getIgnoreSnapToGrid() const; @@ -352,45 +352,45 @@ } /** - * Returns m_bUsesDiagramFillColour + * Returns m_usesDiagramFillColour */ bool getUsesDiagramFillColour() const { - return m_bUsesDiagramFillColour; + return m_usesDiagramFillColour; } /** - * Returns m_bUsesDiagramUseFillColour + * Returns m_usesDiagramUseFillColour */ bool getUsesDiagramUseFillColour() const { - return m_bUsesDiagramUseFillColour; + return m_usesDiagramUseFillColour; } /** - * Sets m_bUsesDiagramFillColour + * Sets m_usesDiagramFillColour */ void setUsesDiagramFillColour(bool usesDiagramFillColour) { - m_bUsesDiagramFillColour = usesDiagramFillColour; + m_usesDiagramFillColour = usesDiagramFillColour; } /** - * Sets m_bUsesDiagramUseFillColour + * Sets m_usesDiagramUseFillColour */ void setUsesDiagramUseFillColour(bool usesDiagramUseFillColour) { - m_bUsesDiagramUseFillColour = usesDiagramUseFillColour; + m_usesDiagramUseFillColour = usesDiagramUseFillColour; } /** - * Write property of bool m_bIsInstance + * Write property of bool m_isInstance */ void setIsInstance(bool isInstance) { - m_bIsInstance = isInstance; + m_isInstance = isInstance; } /** - * Read property of bool m_bIsInstance + * Read property of bool m_isInstance */ bool isInstance() const { - return m_bIsInstance; + return m_isInstance; } /** @@ -424,7 +424,7 @@ /** * Show a properties dialog for a UMLWidget. */ - virtual void showProperties(); + virtual void showPropertiesDialog(); /** * Returns true if the Activate method has been called for this instance @@ -477,7 +477,7 @@ void adjustUnselectedAssocs(int x, int y); /** - * Set the m_bActivated flag of a widget but does not perform the Activate method + * Set the m_activated flag of a widget but does not perform the Activate method * * @param Active Status of activation is to be set. */ @@ -602,14 +602,14 @@ /** * This flag indicates if the UMLWidget uses the Diagram FillColour */ - bool m_bUseFillColour; + bool m_useFillColour; /** * true by default, false if the colours have * been explicitly set for this widget */ - bool m_bUsesDiagramFillColour; - bool m_bUsesDiagramUseFillColour; + bool m_usesDiagramFillColour; + bool m_usesDiagramUseFillColour; /** * Color of the background of the widget @@ -636,7 +636,7 @@ /** * Holds whether this widget is a component instance (i.e. on a deployment diagram) */ - bool m_bIsInstance; + bool m_isInstance; /** * The instance name (used if on a deployment diagram) @@ -646,31 +646,31 @@ /** * Should the stereotype be displayed */ - bool m_bShowStereotype; + bool m_showStereotype; ///////////////// End of Data Loaded/Saved ////////////////////////// - bool m_bSelected, m_bStartMove; + bool m_selected, m_startMove; int m_nPosX; int m_origZ; ListPopupMenu *m_pMenu; bool m_menuIsEmbedded; UMLDoc *m_pDoc; ///< shortcut for UMLApp::app()->getDocument() - bool m_bResizable; + bool m_resizable; QFontMetrics *m_pFontMetrics[FT_INVALID]; /** * It is true if the Activate Function has been called for this * class instance */ - bool m_bActivated; + bool m_activated; /** * Change Widget Behaviour */ - bool m_bIgnoreSnapToGrid; - bool m_bIgnoreSnapComponentSizeToGrid; + bool m_ignoreSnapToGrid; + bool m_ignoreSnapComponentSizeToGrid; /** * Controller for user interaction events. @@ -710,14 +710,14 @@ /** * Captures a color change signal. * - * @param viewID The id of the object behind the widget. + * @param sceneID The id of the object behind the widget. */ virtual void slotColorChanged(Uml::IDType viewID); /** * Captures a linewidth change signal. * - * @param viewID The id of the object behind the widget. + * @param sceneID The id of the object behind the widget. */ virtual void slotLineWidthChanged(Uml::IDType viewID); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/usecasewidget.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/usecasewidget.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/usecasewidget.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/usecasewidget.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -11,25 +11,34 @@ // own header file #include "usecasewidget.h" -// system includes -#include -// local includes +// app includes #include "usecase.h" #include "umlview.h" -UseCaseWidget::UseCaseWidget(UMLView * view, UMLUseCase *o) - : UMLWidget(view, o) +/** + * Creates a UseCase widget. + * @param view The parent of the widget. + * @param o The UMLObject to represent. + */ +UseCaseWidget::UseCaseWidget(UMLScene * scene, UMLUseCase *o) + : UMLWidget(scene, o) { UMLWidget::setBaseType(WidgetBase::wt_UseCase); //updateComponentSize(); Doing this during loadFromXMI() gives futile updates. // Instead, it is done afterwards by UMLWidget::activate() } +/** + * Destructor. + */ UseCaseWidget::~UseCaseWidget() { } -void UseCaseWidget::draw(QPainter & p, int offsetX, int offsetY) +/** + * Overrides the standard paint event. + */ +void UseCaseWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); if ( UMLWidget::getUseFillColour() ) @@ -50,10 +59,23 @@ p.setPen(Qt::black); p.drawText(offsetX + UC_MARGIN, offsetY + textStartY, w - UC_MARGIN * 2, fontHeight, Qt::AlignCenter, name()); setPenFromSettings(p); - if(m_bSelected) + if(m_selected) drawSelected(&p, offsetX, offsetY); } +/** + * Saves this UseCase to file. + */ +void UseCaseWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) +{ + QDomElement usecaseElement = qDoc.createElement( "usecasewidget" ); + UMLWidget::saveToXMI( qDoc, usecaseElement ); + qElement.appendChild( usecaseElement ); +} + +/** + * Overrides method from UMLWidget + */ QSize UseCaseWidget::calculateSize() { const UMLWidget::FontType ft = ( m_pObject->isAbstract() ? FT_BOLD_ITALIC : FT_BOLD ); @@ -67,10 +89,3 @@ return QSize(width, height); } - -void UseCaseWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) -{ - QDomElement usecaseElement = qDoc.createElement( "usecasewidget" ); - UMLWidget::saveToXMI( qDoc, usecaseElement ); - qElement.appendChild( usecaseElement ); -} diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/usecasewidget.h kdesdk-4.7.95/umbrello/umbrello/widgets/usecasewidget.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/usecasewidget.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/usecasewidget.h 2011-12-20 21:00:11.000000000 +0000 @@ -1,10 +1,11 @@ /*************************************************************************** + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * copyright (C) 2002-2009 * + * copyright (C) 2002-2011 * * Umbrello UML Modeller Authors * ***************************************************************************/ @@ -13,16 +14,21 @@ #include "umlwidget.h" +class UMLUseCase; + #define UC_MARGIN 5 #define UC_WIDTH 60 #define UC_HEIGHT 30 -class UMLUseCase; /** - * This class is the graphical version of a UMLUseCase. A UseCaseWidget is created - * by a @ref UMLView. An UseCaseWidget belongs to only one @ref UMLView instance. - * When the @ref UMLView instance that this class belongs to, it will be automatically deleted. + * This class is the graphical version of a UMLUseCase. The + * UseCaseWidget class inherits from the @ref UMLWidget class + * which adds most of the functionality to this class. + + * A UseCaseWidget is created by a @ref UMLView. An UseCaseWidget belongs to only one + * @ref UMLView instance. When the @ref UMLView instance that this class belongs to, + * it will be automatically deleted. * * If the @ref UMLUseCase class that this UseCaseWidget is displaying is deleted, the @ref UMLView will * make sure that this instance is also deleted. @@ -37,35 +43,16 @@ class UseCaseWidget : public UMLWidget { public: - - /** - * Creates a UseCase widget. - * @param view The parent of the widget. - * @param o The UMLObject to represent. - */ - UseCaseWidget(UMLView * view, UMLUseCase *o); - - /** - * Destructor. - */ + UseCaseWidget(UMLScene * scene, UMLUseCase *o); virtual ~UseCaseWidget(); - /** - * Overrides the standard paint event. - */ - void draw(QPainter & p, int offsetX, int offsetY); - - /** - * Saves this UseCase to file. - */ - void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); + virtual void paint(QPainter & p, int offsetX, int offsetY); - // For loading we can use the loadFromXMI() inherited from UMLWidget. + // For loading we can use the loadFromXMI() inherited from + // UMLWidget. + virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); protected: - /** - * Overrides method from UMLWidget - */ QSize calculateSize(); }; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widgetbase.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/widgetbase.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/widgetbase.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widgetbase.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -14,37 +14,37 @@ #include "optionstate.h" #include "uml.h" #include "umldoc.h" -#include "umlview.h" +#include "umlscene.h" #include "umlobject.h" /** * Creates a WidgetBase object. * - * @param view The view to be displayed on. + * @param scene The view to be displayed on. */ -WidgetBase::WidgetBase(UMLView *view) : QObject(view) +WidgetBase::WidgetBase(UMLScene *scene) + : m_scene(scene) { - init(view); + init(); } /** * Initialize members. */ -void WidgetBase::init(UMLView *view, WidgetType type /* = wt_UMLWidget */) +void WidgetBase::init(WidgetType type /* = wt_UMLWidget */) { - m_pView = view; m_Type = type; m_pObject = NULL; - if (m_pView) { - m_bUsesDiagramLineColour = true; - m_bUsesDiagramLineWidth = true; - const Settings::OptionState& optionState = m_pView->optionState(); + if (m_scene) { + m_usesDiagramLineColour = true; + m_usesDiagramLineWidth = true; + const Settings::OptionState& optionState = m_scene->optionState(); m_LineColour = optionState.uiState.lineColor; m_LineWidth = optionState.uiState.lineWidth; } else { - uError() << "WidgetBase constructor: SERIOUS PROBLEM - m_pView is NULL"; - m_bUsesDiagramLineColour = false; - m_bUsesDiagramLineWidth = false; + uError() << "WidgetBase constructor: SERIOUS PROBLEM - m_scene is NULL"; + m_usesDiagramLineColour = false; + m_usesDiagramLineWidth = false; m_LineColour = QColor("black"); m_LineWidth = 0; // initialize with 0 to have valid start condition } @@ -85,9 +85,9 @@ * Deliver a pointer to the connected UMLView * ( needed esp. by event handling of LinePath ). */ -UMLView* WidgetBase::umlScene() const +UMLScene* WidgetBase::umlScene() const { - return m_pView; + return m_scene; } /** @@ -186,7 +186,7 @@ void WidgetBase::setLineColor(const QColor &colour) { m_LineColour = colour; - m_bUsesDiagramLineColour = false; + m_usesDiagramLineColour = false; } /** @@ -205,48 +205,48 @@ void WidgetBase::setLineWidth(uint width) { m_LineWidth = width; - m_bUsesDiagramLineWidth = false; + m_usesDiagramLineWidth = false; } /** - * Returns m_bUsesDiagramLineColour + * Returns m_usesDiagramLineColour */ bool WidgetBase::usesDiagramLineColour() const { - return m_bUsesDiagramLineColour; + return m_usesDiagramLineColour; } /** - * Sets m_bUsesDiagramLineColour + * Sets m_usesDiagramLineColour */ void WidgetBase::setUsesDiagramLineColour(bool usesDiagramLineColour) { - m_bUsesDiagramLineColour = usesDiagramLineColour; + m_usesDiagramLineColour = usesDiagramLineColour; } /** - * Returns m_bUsesDiagramLineWidth + * Returns m_usesDiagramLineWidth */ bool WidgetBase::usesDiagramLineWidth() const { - return m_bUsesDiagramLineWidth; + return m_usesDiagramLineWidth; } /** - * Sets m_bUsesDiagramLineWidth + * Sets m_usesDiagramLineWidth */ void WidgetBase::setUsesDiagramLineWidth(bool usesDiagramLineWidth) { - m_bUsesDiagramLineWidth = usesDiagramLineWidth; + m_usesDiagramLineWidth = usesDiagramLineWidth; } void WidgetBase::saveToXMI( QDomDocument & /*qDoc*/, QDomElement & qElement ) { - if (m_bUsesDiagramLineColour) { + if (m_usesDiagramLineColour) { qElement.setAttribute( "linecolor", "none" ); } else { qElement.setAttribute( "linecolor", m_LineColour.name() ); } - if (m_bUsesDiagramLineWidth) { + if (m_usesDiagramLineWidth) { qElement.setAttribute( "linewidth", "none" ); } else { qElement.setAttribute( "linewidth", m_LineWidth ); @@ -264,19 +264,37 @@ QString lineWidth = qElement.attribute( "linewidth", "none" ); if (lineColor != "none") { setLineColor( QColor(lineColor) ); - m_bUsesDiagramLineColour = false; - } else if (m_Type != WidgetBase::wt_Box && m_pView != NULL) { - setLineColor( m_pView->getLineColor() ); - m_bUsesDiagramLineColour = true; + m_usesDiagramLineColour = false; + } else if (m_Type != WidgetBase::wt_Box && m_scene != NULL) { + setLineColor( m_scene->getLineColor() ); + m_usesDiagramLineColour = true; } if (lineWidth != "none") { setLineWidth( lineWidth.toInt() ); - m_bUsesDiagramLineWidth = false; - } else if ( m_pView ) { - setLineWidth( m_pView->getLineWidth() ); - m_bUsesDiagramLineWidth = true; + m_usesDiagramLineWidth = false; + } else if ( m_scene ) { + setLineWidth( m_scene->getLineWidth() ); + m_usesDiagramLineWidth = true; } return true; } +/** + * Assignment operator + */ +WidgetBase& WidgetBase::operator=(const WidgetBase& other) +{ + m_Type = other.m_Type; + m_scene = other.m_scene; + m_pObject = other.m_pObject; + m_Doc = other.m_Doc; + m_nId = other.m_nId; + m_LineColour = other.m_LineColour; + m_LineWidth = other.m_LineWidth; + m_usesDiagramLineColour = other.m_usesDiagramLineColour; + m_usesDiagramLineWidth = other.m_usesDiagramLineWidth; + + return *this; +} + #include "widgetbase.moc" diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widgetbase.h kdesdk-4.7.95/umbrello/umbrello/widgets/widgetbase.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/widgetbase.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widgetbase.h 2011-12-20 21:00:11.000000000 +0000 @@ -15,11 +15,12 @@ #include #include +#include #include // forward declarations class UMLDoc; -class UMLView; +class UMLScene; class UMLObject; /** @@ -66,7 +67,7 @@ wt_Category // has UMLObject representation }; - explicit WidgetBase(UMLView * view); + explicit WidgetBase(UMLScene * scene); virtual ~WidgetBase(); UMLObject* umlObject() const; @@ -79,7 +80,7 @@ void setBaseType(WidgetType type); QLatin1String baseTypeStr() const; - UMLView* umlScene() const; + UMLScene* umlScene() const; UMLDoc* umlDoc() const; QString documentation() const; @@ -100,11 +101,13 @@ virtual bool loadFromXMI( QDomElement & qElement ); virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); + WidgetBase& operator=(const WidgetBase& other); + protected: - void init(UMLView *view, WidgetType type = wt_UMLWidget); + void init(WidgetType type = wt_UMLWidget); WidgetType m_Type; ///< Type of widget. - UMLView *m_pView; + UMLScene *m_scene; UMLObject *m_pObject; QString m_Doc; ///< Only used if m_pObject is not set. @@ -130,7 +133,7 @@ * been explicitly set for this widget. * These are saved to XMI. */ - bool m_bUsesDiagramLineColour, m_bUsesDiagramLineWidth; + bool m_usesDiagramLineColour, m_usesDiagramLineWidth; }; diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widget_factory.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/widget_factory.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/widget_factory.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widget_factory.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -60,60 +60,60 @@ namespace Widget_Factory { -UMLWidget *createWidget(UMLView *view, UMLObject *o) +UMLWidget *createWidget(UMLScene *scene, UMLObject *o) { - QPoint pos = view->getPos(); + QPoint pos = scene->getPos(); int y = pos.y(); - Uml::DiagramType diagramType = view->type(); + Uml::DiagramType diagramType = scene->type(); UMLObject::ObjectType type = o->baseType(); UMLWidget *newWidget = NULL; switch (type) { case UMLObject::ot_Actor: if (diagramType == Uml::DiagramType::Sequence) { - ObjectWidget *ow = new ObjectWidget(view, o, view->getLocalID()); + ObjectWidget *ow = new ObjectWidget(scene, o, scene->getLocalID()); ow->setDrawAsActor(true); y = ow->topMargin(); newWidget = ow; } else - newWidget = new ActorWidget(view, static_cast(o)); + newWidget = new ActorWidget(scene, static_cast(o)); break; case UMLObject::ot_UseCase: - newWidget = new UseCaseWidget(view, static_cast(o)); + newWidget = new UseCaseWidget(scene, static_cast(o)); break; case UMLObject::ot_Package: - newWidget = new PackageWidget(view, static_cast(o)); + newWidget = new PackageWidget(scene, static_cast(o)); break; case UMLObject::ot_Component: - newWidget = new ComponentWidget(view, static_cast(o)); + newWidget = new ComponentWidget(scene, static_cast(o)); if (diagramType == Uml::DiagramType::Deployment) { newWidget->setIsInstance(true); } break; case UMLObject::ot_Node: - newWidget = new NodeWidget(view, static_cast(o)); + newWidget = new NodeWidget(scene, static_cast(o)); break; case UMLObject::ot_Artifact: - newWidget = new ArtifactWidget(view, static_cast(o)); + newWidget = new ArtifactWidget(scene, static_cast(o)); break; case UMLObject::ot_Datatype: - newWidget = new DatatypeWidget(view, static_cast(o)); + newWidget = new DatatypeWidget(scene, static_cast(o)); break; case UMLObject::ot_Enum: - newWidget = new EnumWidget(view, static_cast(o)); + newWidget = new EnumWidget(scene, static_cast(o)); break; case UMLObject::ot_Entity: - newWidget = new EntityWidget(view, static_cast(o)); + newWidget = new EntityWidget(scene, static_cast(o)); break; case UMLObject::ot_Interface: if (diagramType == Uml::DiagramType::Sequence || diagramType == Uml::DiagramType::Collaboration) { - ObjectWidget *ow = new ObjectWidget(view, o, view->getLocalID() ); + ObjectWidget *ow = new ObjectWidget(scene, o, scene->getLocalID() ); if (diagramType == Uml::DiagramType::Sequence) { y = ow->topMargin(); } newWidget = ow; } else { UMLClassifier *c = static_cast(o); - ClassifierWidget* interfaceWidget = new ClassifierWidget(view, c); + ClassifierWidget* interfaceWidget = new ClassifierWidget(scene, c); if (diagramType == Uml::DiagramType::Component || diagramType == Uml::DiagramType::Deployment) { interfaceWidget->setDrawAsCircle(true); } @@ -124,12 +124,12 @@ //see if we really want an object widget or class widget if (diagramType == Uml::DiagramType::Class || diagramType == Uml::DiagramType::Component) { UMLClassifier *c = static_cast(o); - ClassifierWidget *cw = new ClassifierWidget(view, c); + ClassifierWidget *cw = new ClassifierWidget(scene, c); if (diagramType == Uml::DiagramType::Component) cw->setDrawAsCircle(true); newWidget = cw; } else { - ObjectWidget *ow = new ObjectWidget(view, o, view->getLocalID() ); + ObjectWidget *ow = new ObjectWidget(scene, o, scene->getLocalID() ); if (diagramType == Uml::DiagramType::Sequence) { y = ow->topMargin(); } @@ -137,7 +137,7 @@ } break; case UMLObject::ot_Category: - newWidget = new CategoryWidget(view, static_cast(o)); + newWidget = new CategoryWidget(scene, static_cast(o)); break; default: uWarning() << "trying to create an invalid widget"; @@ -175,7 +175,7 @@ } UMLWidget* makeWidgetFromXMI(const QString& tag, - const QString& idStr, UMLView *view) + const QString& idStr, UMLScene *scene) { UMLWidget *widget = NULL; @@ -184,33 +184,33 @@ //FIXME while boxes and texts are just diagram objects, activities and // states should be UMLObjects if (tag == "statewidget" || tag == "UML:StateWidget") { - widget = new StateWidget(view, StateWidget::Normal, Uml::id_Reserved); + widget = new StateWidget(scene, StateWidget::Normal, Uml::id_Reserved); } else if (tag == "notewidget" || tag == "UML:NoteWidget") { - widget = new NoteWidget(view, NoteWidget::Normal, Uml::id_Reserved); + widget = new NoteWidget(scene, NoteWidget::Normal, Uml::id_Reserved); } else if (tag == "boxwidget") { - widget = new BoxWidget(view, Uml::id_Reserved); + widget = new BoxWidget(scene, Uml::id_Reserved); } else if (tag == "floatingtext" || tag == "UML:FloatingTextWidget") { - widget = new FloatingTextWidget(view, Uml::TextRole::Floating, "", Uml::id_Reserved); + widget = new FloatingTextWidget(scene, Uml::TextRole::Floating, "", Uml::id_Reserved); } else if (tag == "activitywidget" || tag == "UML:ActivityWidget") { - widget = new ActivityWidget(view, ActivityWidget::Initial, Uml::id_Reserved); + widget = new ActivityWidget(scene, ActivityWidget::Initial, Uml::id_Reserved); } else if (tag == "messagewidget") { - widget = new MessageWidget(view, Uml::sequence_message_asynchronous, Uml::id_Reserved); + widget = new MessageWidget(scene, Uml::sequence_message_asynchronous, Uml::id_Reserved); } else if (tag == "forkjoin") { - widget = new ForkJoinWidget(view, false, Uml::id_Reserved); + widget = new ForkJoinWidget(scene, false, Uml::id_Reserved); } else if (tag == "preconditionwidget") { - widget = new PreconditionWidget(view, NULL, Uml::id_Reserved); + widget = new PreconditionWidget(scene, NULL, Uml::id_Reserved); } else if (tag == "combinedFragmentwidget") { - widget = new CombinedFragmentWidget(view, CombinedFragmentWidget::Ref, Uml::id_Reserved); + widget = new CombinedFragmentWidget(scene, CombinedFragmentWidget::Ref, Uml::id_Reserved); } else if (tag == "signalwidget") { - widget = new SignalWidget(view, SignalWidget::Send, Uml::id_Reserved); + widget = new SignalWidget(scene, SignalWidget::Send, Uml::id_Reserved); } else if (tag == "floatingdashlinewidget") { - widget = new FloatingDashLineWidget(view, Uml::id_Reserved); + widget = new FloatingDashLineWidget(scene, Uml::id_Reserved); } else if (tag == "objectnodewidget") { - widget = new ObjectNodeWidget(view, ObjectNodeWidget::Normal, Uml::id_Reserved); + widget = new ObjectNodeWidget(scene, ObjectNodeWidget::Normal, Uml::id_Reserved); } else if (tag == "regionwidget") { - widget = new RegionWidget(view, Uml::id_Reserved); + widget = new RegionWidget(scene, Uml::id_Reserved); } else if (tag == "pinwidget") { - widget = new PinWidget(view, NULL, Uml::id_Reserved); + widget = new PinWidget(scene, NULL, Uml::id_Reserved); } else { @@ -227,42 +227,42 @@ if (tag == "actorwidget" || tag == "UML:ActorWidget") { if (validateObjType(UMLObject::ot_Actor, o, id)) - widget = new ActorWidget(view, static_cast(o)); + widget = new ActorWidget(scene, static_cast(o)); } else if (tag == "usecasewidget" || tag == "UML:UseCaseWidget") { if (validateObjType(UMLObject::ot_UseCase, o, id)) - widget = new UseCaseWidget(view, static_cast(o)); + widget = new UseCaseWidget(scene, static_cast(o)); } else if (tag == "classwidget" || tag == "UML:ClassWidget") { if (validateObjType(UMLObject::ot_Class, o, id)) - widget = new ClassifierWidget(view, static_cast(o)); + widget = new ClassifierWidget(scene, static_cast(o)); } else if (tag == "packagewidget") { if (validateObjType(UMLObject::ot_Package, o, id)) - widget = new PackageWidget(view, static_cast(o)); + widget = new PackageWidget(scene, static_cast(o)); } else if (tag == "componentwidget") { if (validateObjType(UMLObject::ot_Component, o, id)) - widget = new ComponentWidget(view, static_cast(o)); + widget = new ComponentWidget(scene, static_cast(o)); } else if (tag == "nodewidget") { if (validateObjType(UMLObject::ot_Node, o, id)) - widget = new NodeWidget(view, static_cast(o)); + widget = new NodeWidget(scene, static_cast(o)); } else if (tag == "artifactwidget") { if (validateObjType(UMLObject::ot_Artifact, o, id)) - widget = new ArtifactWidget(view, static_cast(o)); + widget = new ArtifactWidget(scene, static_cast(o)); } else if (tag == "interfacewidget") { if (validateObjType(UMLObject::ot_Interface, o, id)) - widget = new ClassifierWidget(view, static_cast(o)); + widget = new ClassifierWidget(scene, static_cast(o)); } else if (tag == "datatypewidget") { if (validateObjType(UMLObject::ot_Datatype, o, id)) - widget = new DatatypeWidget(view, static_cast(o)); + widget = new DatatypeWidget(scene, static_cast(o)); } else if (tag == "enumwidget") { if (validateObjType(UMLObject::ot_Enum, o, id)) - widget = new EnumWidget(view, static_cast(o)); + widget = new EnumWidget(scene, static_cast(o)); } else if (tag == "entitywidget") { if (validateObjType(UMLObject::ot_Entity, o, id)) - widget = new EntityWidget(view, static_cast(o)); + widget = new EntityWidget(scene, static_cast(o)); } else if (tag == "categorywidget") { if (validateObjType(UMLObject::ot_Category, o, id)) - widget = new CategoryWidget(view, static_cast(o)); + widget = new CategoryWidget(scene, static_cast(o)); } else if (tag == "objectwidget" || tag == "UML:ObjectWidget") { - widget = new ObjectWidget(view, o ); + widget = new ObjectWidget(scene, o ); } else { uWarning() << "Trying to create an unknown widget:" << tag; } diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widget_factory.h kdesdk-4.7.95/umbrello/umbrello/widgets/widget_factory.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/widget_factory.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widget_factory.h 2011-12-20 21:00:11.000000000 +0000 @@ -15,7 +15,7 @@ #include // forward declarations -class UMLView; +class UMLScene; class UMLObject; class UMLWidget; @@ -28,13 +28,13 @@ /** * Create a UMLWidget in the given view and representing the given document object. */ - UMLWidget *createWidget(UMLView *view, UMLObject *docObj); + UMLWidget *createWidget(UMLScene *scene, UMLObject *docObj); /** * Create a UMLWidget according to the given XMI tag. */ UMLWidget* makeWidgetFromXMI(const QString& tag, - const QString& idStr, UMLView *view); + const QString& idStr, UMLScene *scene); } // end namespace Widget_Factory diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widget_utils.cpp kdesdk-4.7.95/umbrello/umbrello/widgets/widget_utils.cpp --- kdesdk-4.7.90/umbrello/umbrello/widgets/widget_utils.cpp 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widget_utils.cpp 2011-12-20 21:00:11.000000000 +0000 @@ -12,7 +12,6 @@ #include "widget_utils.h" // qt includes -#include #include #include @@ -50,12 +49,12 @@ return NULL; } -Q3CanvasRectangle *decoratePoint(const QPoint& p) +UMLSceneRectangle *decoratePoint(const QPoint& p) { const int SIZE = 4; UMLView *currentView = UMLApp::app()->currentView(); - Q3CanvasRectangle *rect; - rect = new Q3CanvasRectangle(p.x() - SIZE / 2, + UMLSceneRectangle *rect; + rect = new UMLSceneRectangle(p.x() - SIZE / 2, p.y() - SIZE / 2, SIZE, SIZE, currentView->canvas()); rect->setBrush( QBrush(Qt::blue) ); diff -Nru kdesdk-4.7.90/umbrello/umbrello/widgets/widget_utils.h kdesdk-4.7.95/umbrello/umbrello/widgets/widget_utils.h --- kdesdk-4.7.90/umbrello/umbrello/widgets/widget_utils.h 2011-07-27 18:25:25.000000000 +0000 +++ kdesdk-4.7.95/umbrello/umbrello/widgets/widget_utils.h 2011-12-20 21:00:11.000000000 +0000 @@ -16,9 +16,7 @@ #include "basictypes.h" #include "umlwidgetlist.h" #include "messagewidgetlist.h" - -// forward declarations -class Q3CanvasRectangle; +#include "umlscene.h" /** * General purpose widget utilities. @@ -44,7 +42,7 @@ * @param p the base point * @return the decoration point */ -Q3CanvasRectangle *decoratePoint(const QPoint& p); +UMLSceneRectangle *decoratePoint(const QPoint& p); }