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 #include <khexedit/byteseditinterface.h>
00038 using namespace KHE;
00039
00040
00041
00042
00043
00044 DBAppInfoEditor::DBAppInfoEditor(char*appInfoData, int l, QWidget *parent) :
00045 KDialogBase(parent, "AppBlock Editor",false,
00046 i18n("Edit AppInfo Block"),
00047 Ok|Cancel),
00048 appInfo(appInfoData),
00049 len(l)
00050 {
00051 fAppInfoEdit = KHE::createBytesEditWidget( this, "fAppInfoEdit" );
00052 if( fAppInfoEdit )
00053 {
00054
00055 KHE::BytesEditInterface* fAppInfoEditIf = KHE::bytesEditInterface( fAppInfoEdit );
00056 Q_ASSERT( fAppInfoEditIf );
00057 if( fAppInfoEditIf )
00058 {
00059 fAppInfoEditIf->setData( (char*)appInfoData, l );
00060 fAppInfoEditIf->setMaxDataSize( l );
00061
00062
00063 fAppInfoEditIf->setReadOnly( true );
00064 }
00065 }
00066 else
00067 {
00068 QLabel*tmpW = new QLabel( i18n("To view the Application info block data, please install a hex editor (e.g. khexedit from kdeutils)."), this );
00069 tmpW->setBackgroundMode( Qt::PaletteMid );
00070 tmpW->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak);
00071 tmpW->setFrameShape( QFrame::Panel );
00072 tmpW->setFrameShadow( QFrame::Sunken );
00073 fAppInfoEdit = tmpW;
00074 }
00075 setMainWidget( fAppInfoEdit );
00076 fillWidgets();
00077 }
00078
00079
00080 DBAppInfoEditor::~DBAppInfoEditor()
00081 {
00082 }
00083
00084 void DBAppInfoEditor::slotOk()
00085 {
00086 KMessageBox::sorry(this, i18n("Changing the AppInfo block isn't yet supported by KPilot!"));
00087
00088
00089
00090
00091
00092
00093
00094
00095 KDialogBase::slotOk();
00096 }
00097
00098 void DBAppInfoEditor::fillWidgets()
00099 {
00100
00101 }
00102
00103
00104
00105 #include "dbAppInfoEditor.moc"
|