Changeset View
Changeset View
Standalone View
Standalone View
utils/okteta/oktetawidget.cpp
Show All 20 Lines | |||||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #include "oktetawidget.h" | 23 | #include "oktetawidget.h" | ||
24 | 24 | | |||
25 | // plugin | 25 | // plugin | ||
26 | #include "oktetadocument.h" | 26 | #include "oktetadocument.h" | ||
27 | #include "oktetaplugin.h" | 27 | #include "oktetaplugin.h" | ||
28 | // Okteta Kasten | 28 | // Okteta Kasten | ||
29 | #include <bytearrayview.h> | 29 | #include <kasten/okteta/bytearrayview.h> | ||
30 | #include <bytearrayrawfilesynchronizerfactory.h> | 30 | //#include <kasten/okteta/bytearrayrafilesynchronizerfactory.h> | ||
31 | #include <overwriteonlycontroller.h> | 31 | //#include <kasten/okteta/overwriteonlycontroller.h> | ||
32 | #include <overwritemodecontroller.h> | 32 | #include <kasten/okteta/overwritemodecontroller.h> | ||
33 | #include <gotooffsetcontroller.h> | 33 | #include <kasten/okteta/gotooffsetcontroller.h> | ||
34 | #include <selectrangecontroller.h> | 34 | #include <kasten/okteta/selectrangecontroller.h> | ||
35 | #include <searchcontroller.h> | 35 | #include <kasten/okteta/searchcontroller.h> | ||
36 | #include <replacecontroller.h> | 36 | #include <kasten/okteta/replacecontroller.h> | ||
37 | #include <bookmarkscontroller.h> | 37 | #include <kasten/okteta/bookmarkscontroller.h> | ||
38 | #include <printcontroller.h> | 38 | #include <kasten/okteta/printcontroller.h> | ||
39 | #include <viewconfigcontroller.h> | 39 | #include <kasten/okteta/viewconfigcontroller.h> | ||
40 | #include <viewmodecontroller.h> | 40 | #include <kasten/okteta/viewmodecontroller.h> | ||
41 | #include <viewstatuscontroller.h> | 41 | #include <kasten/okteta/viewstatuscontroller.h> | ||
42 | #if KASTEN_VERSION == 2 | 42 | #include <kasten/okteta/viewprofilecontroller.h> | ||
43 | #include <viewprofilecontroller.h> | 43 | #include <kasten/okteta/viewprofilesmanagecontroller.h> | ||
44 | #include <viewprofilesmanagecontroller.h> | | |||
45 | #endif | | |||
46 | // Kasten | 44 | // Kasten | ||
47 | #include <readonlycontroller.h> | 45 | #include <kasten/readonlycontroller.h> | ||
48 | // #include <document/readonly/readonlybarcontroller.h> | 46 | // #include <document/readonly/readonlybarcontroller.h> | ||
49 | // #include <io/synchronize/synchronizecontroller.h> | 47 | // #include <io/synchronize/synchronizecontroller.h> | ||
50 | #include <clipboardcontroller.h> | 48 | #include <kasten/clipboardcontroller.h> | ||
51 | #include <insertcontroller.h> | 49 | #include <kasten/insertcontroller.h> | ||
52 | #include <copyascontroller.h> | 50 | #include <kasten/copyascontroller.h> | ||
53 | #include <exportcontroller.h> | 51 | #include <kasten/exportcontroller.h> | ||
54 | #include <versioncontroller.h> | 52 | #include <kasten/versioncontroller.h> | ||
55 | #include <zoomcontroller.h> | 53 | #include <kasten/zoomcontroller.h> | ||
56 | #include <zoombarcontroller.h> | 54 | #include <kasten/zoombarcontroller.h> | ||
57 | #include <selectcontroller.h> | 55 | #include <kasten/selectcontroller.h> | ||
58 | // KDevelop | 56 | // KDevelop | ||
59 | #include <sublime/view.h> | 57 | #include <sublime/view.h> | ||
60 | // KDE | 58 | // KDE | ||
61 | #include <KLocalizedString> | 59 | #include <KLocalizedString> | ||
62 | #include <QAction> | 60 | #include <QAction> | ||
63 | #include <KStandardAction> | 61 | #include <KStandardAction> | ||
64 | #include <KActionCollection> | 62 | #include <KActionCollection> | ||
65 | // Qt | 63 | // Qt | ||
66 | #include <QVBoxLayout> | 64 | #include <QVBoxLayout> | ||
67 | 65 | | |||
68 | 66 | | |||
69 | namespace KDevelop | 67 | namespace KDevelop | ||
70 | { | 68 | { | ||
71 | 69 | | |||
72 | OktetaWidget::OktetaWidget( QWidget* parent, Kasten::ByteArrayView* byteArrayView, OktetaPlugin* plugin ) | 70 | OktetaWidget::OktetaWidget( QWidget* parent, Kasten::ByteArrayView* byteArrayView, OktetaPlugin* plugin ) | ||
73 | : QWidget( parent ), | 71 | : QWidget( parent ), | ||
74 | KXMLGUIClient(), | 72 | KXMLGUIClient(), | ||
75 | mByteArrayView( byteArrayView ) | 73 | mByteArrayView( byteArrayView ) | ||
76 | { | 74 | { | ||
77 | setComponentData( plugin->componentData() ); | 75 | setComponentName( "kdevokteta" , "KDevelop Okteta"); | ||
78 | setXMLFile( "kdevokteta.rc" ); | 76 | setXMLFile( "kdevokteta.rc" ); | ||
79 | 77 | | |||
80 | setupActions(plugin); | 78 | setupActions(plugin); | ||
81 | 79 | | |||
82 | QVBoxLayout* layout = new QVBoxLayout( this ); | 80 | QVBoxLayout* layout = new QVBoxLayout( this ); | ||
83 | layout->setMargin( 0 ); | 81 | layout->setMargin( 0 ); | ||
84 | QWidget* widget = mByteArrayView->widget(); | 82 | QWidget* widget = mByteArrayView->widget(); | ||
85 | layout->addWidget( widget ); | 83 | layout->addWidget( widget ); | ||
Show All 16 Lines | 98 | // mControllers.append( new Kasten::CopyAsController(mProgram->viewManager(),mProgram->documentManager(),this) ); | |||
102 | mControllers.append( new Kasten::SearchController(this,this) ); | 100 | mControllers.append( new Kasten::SearchController(this,this) ); | ||
103 | mControllers.append( new Kasten::ReplaceController(this,this) ); | 101 | mControllers.append( new Kasten::ReplaceController(this,this) ); | ||
104 | // mControllers.append( new Kasten::GotoOffsetController(mGroupedViews,this) ); | 102 | // mControllers.append( new Kasten::GotoOffsetController(mGroupedViews,this) ); | ||
105 | // mControllers.append( new Kasten::SelectRangeController(mGroupedViews,this) ); | 103 | // mControllers.append( new Kasten::SelectRangeController(mGroupedViews,this) ); | ||
106 | mControllers.append( new Kasten::BookmarksController(this) ); | 104 | mControllers.append( new Kasten::BookmarksController(this) ); | ||
107 | mControllers.append( new Kasten::PrintController( this ) ); | 105 | mControllers.append( new Kasten::PrintController( this ) ); | ||
108 | mControllers.append( new Kasten::ViewConfigController(this) ); | 106 | mControllers.append( new Kasten::ViewConfigController(this) ); | ||
109 | mControllers.append( new Kasten::ViewModeController(this) ); | 107 | mControllers.append( new Kasten::ViewModeController(this) ); | ||
110 | #if KASTEN_VERSION == 2 | | |||
111 | Kasten::ByteArrayViewProfileManager* viewProfileManager = plugin->viewProfileManager(); | 108 | Kasten::ByteArrayViewProfileManager* viewProfileManager = plugin->viewProfileManager(); | ||
112 | mControllers.append( new Kasten::ViewProfileController(viewProfileManager, mByteArrayView->widget(), this) ); | 109 | mControllers.append( new Kasten::ViewProfileController(viewProfileManager, mByteArrayView->widget(), this) ); | ||
113 | mControllers.append( new Kasten::ViewProfilesManageController(this, viewProfileManager, mByteArrayView->widget()) ); | 110 | mControllers.append( new Kasten::ViewProfilesManageController(this, viewProfileManager, mByteArrayView->widget()) ); | ||
114 | // update the text of the viewprofiles_manage action, to make clear this is just for byte arrays | 111 | // update the text of the viewprofiles_manage action, to make clear this is just for byte arrays | ||
115 | QAction* viewprofilesManageAction = actionCollection()->action(QLatin1String("settings_viewprofiles_manage")); | 112 | QAction* viewprofilesManageAction = actionCollection()->action(QLatin1String("settings_viewprofiles_manage")); | ||
116 | viewprofilesManageAction->setText( i18nc("@action:inmenu", | 113 | viewprofilesManageAction->setText( i18nc("@action:inmenu", | ||
117 | "Manage Byte Array View Profiles...") ); | 114 | "Manage Byte Array View Profiles...") ); | ||
118 | #endif | | |||
119 | 115 | | |||
120 | // Kasten::StatusBar* bottomBar = static_cast<Kasten::StatusBar*>( statusBar() ); | 116 | // Kasten::StatusBar* bottomBar = static_cast<Kasten::StatusBar*>( statusBar() ); | ||
121 | // mControllers.append( new ViewStatusController(bottomBar) ); | 117 | // mControllers.append( new ViewStatusController(bottomBar) ); | ||
122 | // mControllers.append( new ReadOnlyBarController(bottomBar) ); | 118 | // mControllers.append( new ReadOnlyBarController(bottomBar) ); | ||
123 | // mControllers.append( new ZoomBarController(bottomBar) ); | 119 | // mControllers.append( new ZoomBarController(bottomBar) ); | ||
124 | 120 | | |||
125 | foreach( Kasten::AbstractXmlGuiController* controller, mControllers ) | 121 | foreach( Kasten::AbstractXmlGuiController* controller, mControllers ) | ||
126 | controller->setTargetModel( mByteArrayView ); | 122 | controller->setTargetModel( mByteArrayView ); | ||
Show All 34 Lines |