[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: [patch] initDoc in koffice/example usage
From: Brad Hards <bradh () frogmouth ! net>
Date: 2004-09-18 12:18:14
Message-ID: 200409182218.20440.bradh () frogmouth ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Fri, 17 Sep 2004 22:37 pm, David Faure wrote:
> While you're at it, please make sure InitDocEmpty is handled, and
> parentWidget is passed to KoTemplateChooseDia::choose() :)
Like this?
diff -u -4 -p -r1.19 example_part.cc
--- example_part.cc 12 Sep 2004 11:53:55 -0000 1.19
+++ example_part.cc 18 Sep 2004 12:14:40 -0000
@@ -33,16 +33,25 @@ bool ExamplePart::initDoc(InitDocFlags f
{
// If nothing is loaded, do initialize here
// Most KOffice applications use the template dialog here, with code like:
/*
+ if (flags==KoDocument::InitDocEmpty)
+ {
+ bool ok = loadNativeFormat( /* QString containing path to a sensible default \
template */ ); + resetURL();
+ setEmpty();
+ setModified( FALSE );
+ return ok;
+ }
+
KoTemplateChooseDia::DialogType dlgtype;
- if (initDocFlags() != KoDocument::InitDocFileNew )
+ if (flags != KoDocument::InitDocFileNew )
dlgtype = KoTemplateChooseDia::Everything;
else
dlgtype = KoTemplateChooseDia::OnlyTemplates;
- KoTemplateChooseDia::ReturnType ret = KoTemplateChooseDia::choose(
- .... )
+ // You need to read the doco for KoTemplateChooseDia::choose() to figure out \
what to do next :-) + KoTemplateChooseDia::ReturnType ret = \
KoTemplateChooseDia::choose(...., dlgtype, ... , parentWidget );
*/
return TRUE;
}
If OK, I'll sync it up with the KDevelop template.
Brad
[Attachment #5 (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic