[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kivio
From:       Peter Simonsson <psn () linux ! se>
Date:       2003-06-07 19:59:08
[Download RAW message or body]

CVS commit by psn: 

Add support for templates and add an empty and a basic flowchart template


  A            templates/Makefile.am   1.1
  A            templates/basic/.directory   1.1
  A            templates/basic/Makefile.am   1.1
  A            templates/basic/basicflow.desktop   1.1
  A            templates/basic/basicflow.kft   1.1
  A            templates/basic/basicflow.png   1.1
  A            templates/basic/empty.desktop   1.1
  A            templates/basic/empty.kft   1.1
  A            templates/basic/empty.png   1.1
  M +2 -9      Makefile.am   1.11
  M +13 -2     kiviopart/kivio_doc.cpp   1.57
  M +1 -0      kiviopart/kivio_factory.cpp   1.12
  M +2 -2      kiviopart/kivio_grid_data.cpp   1.4


--- koffice/kivio/Makefile.am  #1.10:1.11
@@ -1,11 +1,4 @@
-#1########################################################!@#$
-####   Makefile.am generated automatically by KDEStudio   ####
-#### WARNING! All changes made in this part will be lost! ####
-##############################################################
-SUBDIRS = kiviopart plugins
-EXTRA_DIST = kivio.studio res.cpp
-##############################################################
-####                  END KDEStudio part                  ####
-#2########################################################!@#$
+SUBDIRS = kiviopart plugins templates
+EXTRA_DIST = res.cpp
 
 package-messages:

--- koffice/kivio/kiviopart/kivio_doc.cpp  #1.56:1.57
@@ -184,8 +184,16 @@ bool KivioDoc::initDoc()
     KURL url(f);
     return openURL(url);
+  } else if ( ret == KoTemplateChooseDia::Template ) {
+    QFileInfo fileInfo( f );
+    QString fileName( fileInfo.dirPath( TRUE ) + "/" + fileInfo.baseName() + ".kft" \
); +    resetURL();
+    bool ok = loadNativeFormat( fileName );
+    KivioPage *t = createPage();
+    m_pMap->addPage( t );
+    setEmpty();
+    return ok;
   } else if ( ret == KoTemplateChooseDia::Empty ) {
     KivioPage *t = createPage();
     m_pMap->addPage( t );
-    resetURL();
     setEmpty();
     return true;
@@ -337,5 +345,8 @@ bool KivioDoc::loadXML( QIODevice *, con
   }
 
+  if(kivio.hasAttribute("gridIsShow")) {
   gridData.load(kivio,"grid");
+  }
+
   return true;
 }

--- koffice/kivio/kiviopart/kivio_factory.cpp  #1.11:1.12
@@ -83,4 +83,5 @@ KInstance* KivioFactory::global()
   {
     s_global = new KInstance(aboutData());
+    s_global->dirs()->addResourceType( "kivio_template", \
                KStandardDirs::kde_default("data") + "kivio/templates/" );
     s_global->dirs()->addResourceType( "toolbar", KStandardDirs::kde_default("data") \
+ "koffice/toolbar/");  s_global->iconLoader()->addAppDir("koffice");

--- koffice/kivio/kiviopart/kivio_grid_data.cpp  #1.3:1.4
@@ -55,5 +55,5 @@ void KivioGridData::load(const QDomEleme
   color = XmlReadColor(element, name + "Color", def);
 
-  isSnap = (bool)element.attribute(name + "IsSnap", "0").toInt();
-  isShow = (bool)element.attribute(name + "IsShow", "0").toInt();
+  isSnap = (bool)element.attribute(name + "IsSnap", "1").toInt();
+  isShow = (bool)element.attribute(name + "IsShow", "1").toInt();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic