#include "mainwindow.h"
#include <QTemporaryFile>
-
-
-
#define WIDGET(t,f) ((t*)findChild<t *>(#f))
typedef struct {
const char* data;
}
file.close();
}
- return false;
-
-
-
+ else {
+ errout << "Could not open attribute name file \"" << fileName << "\" for reading\n" << flush;
+ }
+ return false;
}
+
QString stripFileExtension(QString fileName)
{
int idx;
CFrmSettings::CFrmSettings()
{
- this->gvc=gvContext();
+ this->gvc = gvContext();
Ui_Dialog tempDia;
tempDia.setupUi(this);
- graph=NULL;
-
+ graph = NULL;
+#ifndef WIN32
+ QString pfx (GVEDIT_DATADIR);
+#endif
connect(WIDGET(QPushButton,pbAdd),SIGNAL(clicked()),this,SLOT(addSlot()));
connect(WIDGET(QPushButton,pbNew),SIGNAL(clicked()),this,SLOT(newSlot()));
scopeChangedSlot(0);
+#ifdef WIN32
loadAttrs("./attrs.txt",WIDGET(QComboBox,cbNameG),WIDGET(QComboBox,cbNameN),WIDGET(QComboBox,cbNameE));
+#else
+ loadAttrs(pfx + "/attrs.txt",WIDGET(QComboBox,cbNameG),WIDGET(QComboBox,cbNameN),WIDGET(QComboBox,cbNameE));
+#endif
setWindowIcon(QIcon(":/images/icon.png"));
}
void CFrmSettings::outputSlot()
{
- QString _filter="Output File(*."+WIDGET(QComboBox,cbExtension)->currentText()+")";
+ QString _filter = "Output File(*."+WIDGET(QComboBox,cbExtension)->currentText()+")";
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Graph As.."),"/",_filter);
if (!fileName.isEmpty())
WIDGET(QLineEdit,leOutput)->setText(fileName);
#endif
#include <stdio.h>
#include <QApplication>
+#include <QFile>
+/* #include <QTextStream> */
#include "mainwindow.h"
#ifdef HAVE_GETOPT_H
extern int Verbose;
+QTextStream errout (stderr, QIODevice::WriteOnly);
+
static char *useString =
"Usage: gvedit [-v?] <files>\n\
-v - verbose\n\
if (optopt == '?')
usage(0);
else
- fprintf(stderr,
- "%s : option -%c unrecognized - ignored\n",
- cmd, optopt);
+ errout << cmd << " : option -" << ((char)optopt) << " unrecognized - ignored\n" << flush;
break;
}
}
int main(int argc, char *argv[])
{
-
Q_INIT_RESOURCE(mdi);
+ int ret;
QApplication app(argc, argv);
char** files = parseArgs (argc, argv);
files++;
}
mainWin.show();
- return app.exec();
+ ret = app.exec();
+ return ret;
}