kpilot/kpilot
dbAppInfoEditor.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "options.h"
00029
00030 #include <qtextedit.h>
00031 #include <qlabel.h>
00032 #include <kdialogbase.h>
00033 #include <kmessagebox.h>
00034
00035 #include "dbAppInfoEditor.h"
00036
00037 #ifdef USE_KHEXEDIT
00038 #include <khexedit/byteseditinterface.h>
00039 using namespace KHE;
00040 #endif
00041
00042
00043
00044
00045
00046 DBAppInfoEditor::DBAppInfoEditor(char*appInfoData, int l, QWidget *parent) :
00047 KDialogBase(parent, "AppBlock Editor",false,
00048 i18n("Edit AppInfo Block"),
00049 Ok|Cancel),
00050 appInfo(appInfoData),
00051 len(l)
00052 {
00053 #ifdef USE_KHEXEDIT
00054 fAppInfoEdit = KHE::createBytesEditWidget( this, "fAppInfoEdit" );
00055 if( fAppInfoEdit )
00056 {
00057
00058 KHE::BytesEditInterface* fAppInfoEditIf = KHE::bytesEditInterface( fAppInfoEdit );
00059 Q_ASSERT( fAppInfoEditIf );
00060 if( fAppInfoEditIf )
00061 {
00062 fAppInfoEditIf->setData( (char*)appInfoData, l );
00063 fAppInfoEditIf->setMaxDataSize( l );
00064
00065
00066 fAppInfoEditIf->setReadOnly( true );
00067 }
00068 }
00069 else
00070 {
00071 QLabel*tmpW = new QLabel( i18n("To view the Application info block data, please install a hex editor (e.g. khexedit from kdeutils)."), this );
00072 tmpW->setBackgroundMode( Qt::PaletteMid );
00073 tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
00074 tmpW->setFrameShape( QFrame::Panel );
00075 tmpW->setFrameShadow( QFrame::Sunken );
00076 fAppInfoEdit = tmpW;
00077 }
00078 setMainWidget( fAppInfoEdit );
00079 #endif
00080 fillWidgets();
00081 }
00082
00083
00084 DBAppInfoEditor::~DBAppInfoEditor()
00085 {
00086 }
00087
00088 void DBAppInfoEditor::slotOk()
00089 {
00090 KMessageBox::sorry(this, i18n("Changing the AppInfo block isn't yet supported by KPilot!"));
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 KDialogBase::slotOk();
00106 }
00107
00108 void DBAppInfoEditor::fillWidgets()
00109 {
00110
00111 }
00112
00113
00114
00115 #include "dbAppInfoEditor.moc"
|