hide export for floatimages.
1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
11 extern Settings settings;
13 void ExportHTMLDialog::init()
15 dir=settings.readEntry ("/vym/export/html/dir","" );
16 lineEdit1->setText(dir);
18 if ( settings.readEntry ("/vym/export/html/image","yes")=="yes")
22 checkBox4->setChecked(image);
24 if ( settings.readEntry ("/vym/export/html/imageOnly","no")=="yes")
28 checkBox5_2->setChecked(imageOnly);
30 if ( settings.readEntry ("/vym/export/html/wiki","no")=="yes")
34 checkBox5->setChecked(wikistyle);
36 if ( settings.readEntry ("/vym/export/html/useHeading","no")=="yes")
40 checkBox4_2->setChecked(useHeading);
42 if ( settings.readEntry ("/vym/export/html/useURLImage","yes")=="yes")
46 checkBox6->setChecked(useURLImage);
48 if ( settings.readEntry ("/vym/export/html/showOutput","no")=="yes")
52 checkBox3->setChecked(showOutput);
54 stylepath=settings.readEntry
55 ("/vym/export/html/styles","styles");
56 scriptpath=settings.readEntry
57 ("/vym/export/html/scripts","scripts");
58 xsl=settings.readEntry
59 ("/vym/export/html/xsl","vym2html.xsl");
60 css=settings.readEntry
61 ("/vym/export/html/css","vym.css");
62 script=settings.readEntry
63 ("/vym/export/html/script","vym2html.sh");
65 proc = new QProcess( this );
66 connect( proc, SIGNAL(readyReadStdout()),
67 this, SLOT(readOutput()) );
69 dia=new ShowTextDialog ();
72 void ExportHTMLDialog::destroy()
78 void ExportHTMLDialog::browseDirectory()
80 QFileDialog fd( this, tr("VYM - Export HTML to directory"));
81 fd.setMode (QFileDialog::DirectoryOnly);
82 fd.setCaption(tr("VYM - Export HTML to directory"));
86 if ( fd.exec() == QDialog::Accepted )
88 dir=fd.selectedFile();
89 lineEdit1->setText (dir );
93 void ExportHTMLDialog::useWIKIpressed(bool b)
98 void ExportHTMLDialog::includeImage(bool b)
103 void ExportHTMLDialog::imgOnly(bool b)
108 void ExportHTMLDialog::useHeadingPressed(bool b)
113 void ExportHTMLDialog::useURLImagePressed(bool b)
118 void ExportHTMLDialog::showOut(bool b)
123 void ExportHTMLDialog::dirChanged()
125 dir=lineEdit1->text();
131 void ExportHTMLDialog::doExport (const QString &mapname)
133 // Save options to settings file
134 // (but don't save at destructor, which
135 // is called for "cancel", too)
136 settings.writeEntry ("/vym/export/html/dir",lineEdit1->text() );
139 settings.writeEntry ("/vym/export/html/wiki","yes");
141 settings.writeEntry ("/vym/export/html/wiki","no");
144 settings.writeEntry ("/vym/export/html/image","yes");
146 settings.writeEntry ("/vym/export/html/image","no");
149 settings.writeEntry ("/vym/export/html/imageOnly","yes");
151 settings.writeEntry ("/vym/export/html/imageOnly","no");
154 settings.writeEntry ("/vym/export/html/useHeading","yes");
156 settings.writeEntry ("/vym/export/html/useHeading","no");
159 settings.writeEntry ("/vym/export/html/showOutput","yes");
161 settings.writeEntry ("/vym/export/html/showOutput","no");
164 ("/vym/export/html/styles",stylepath);
166 ("/vym/export/html/scripts",scriptpath);
168 ("/vym/export/html/xsl",xsl);
170 ("/vym/export/html/css",css);
172 ("/vym/export/html/script",script);
174 proc->addArgument (scriptpath + "/" + script );
175 proc->addArgument(dir + maskPath(mapname) + ".xml");
176 proc->addArgument("-sp=" + stylepath +"/" + xsl );
177 proc->addArgument("-css=" + css );
178 if (image) proc->addArgument("-image" );
179 if (wikistyle) proc->addArgument("-wikistyle" );
180 if (useHeading) proc->addArgument("-useURLHeading" );
183 proc->addArgument("-useURLImage" );
184 QPixmap pm (flag_url_xpm);
185 pm.save (dir + "/flags/url.png","PNG");
188 dia->append ("vym is executing: " + proc->arguments().join(" ") );
189 if ( !proc->start() )
194 QStringList list = proc->arguments();
195 QStringList::Iterator it = list.begin();
196 while( it != list.end() )
201 QMessageBox::critical(0, tr("Critcal export error"),"Couldn't start script to export:\n"+s);
203 if (showOutput) dia->exec();
209 QString ExportHTMLDialog::getDir()
215 void ExportHTMLDialog::readOutput()
217 dia->append (proc->readStdout() );