From: arif Date: Tue, 8 Mar 2011 19:55:50 +0000 (+0000) Subject: gvedit development X-Git-Tag: LAST_LIBGRAPH~32^2~945 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32bfe18cbcd1ce9d4f4dddf59aabc46293691b31;p=graphviz gvedit development --- diff --git a/cmd/gvedit/csettings.cpp b/cmd/gvedit/csettings.cpp index 0fbf2f698..898fdc9f5 100644 --- a/cmd/gvedit/csettings.cpp +++ b/cmd/gvedit/csettings.cpp @@ -114,6 +114,7 @@ CFrmSettings::CFrmSettings() tempDia.setupUi(this); graph=NULL; + connect(WIDGET(QPushButton,pbAdd),SIGNAL(clicked()),this,SLOT(addSlot())); connect(WIDGET(QPushButton,pbNew),SIGNAL(clicked()),this,SLOT(newSlot())); connect(WIDGET(QPushButton,pbOpen),SIGNAL(clicked()),this,SLOT(openSlot())); @@ -323,9 +324,11 @@ bool CFrmSettings::renderLayout() { QString prevFile(buildTempFile()); gvRenderFilename(gvc,graph,"jpg",(char*)prevFile.toUtf8().constData()); - if(!this->getActiveWindow()->loadPreview(prevFile)) + this->getActiveWindow()->loadPreview(prevFile); + +/* if(!this->getActiveWindow()->loadPreview(prevFile)) QMessageBox::information(this, tr("GVEdit"), - tr("Preview file can not be opened.")); + tr("Preview file can not be opened."));*/ } diff --git a/cmd/gvedit/imageviewer.cpp b/cmd/gvedit/imageviewer.cpp index 9ba9a2369..ed3521b8c 100644 --- a/cmd/gvedit/imageviewer.cpp +++ b/cmd/gvedit/imageviewer.cpp @@ -36,6 +36,9 @@ ImageViewer::ImageViewer() setWindowTitle(tr("")); resize(800, 600); + + setWindowIcon(QIcon(":/images/new.png")); + } //! [0] diff --git a/cmd/gvedit/mainwindow.cpp b/cmd/gvedit/mainwindow.cpp index 2a18bb19e..35701ef0d 100644 --- a/cmd/gvedit/mainwindow.cpp +++ b/cmd/gvedit/mainwindow.cpp @@ -48,6 +48,53 @@ static void LoadPlugins (QComboBox* cb, GVC_t* gvc, char* kind) }; freeList (lp, count); } +void CMainWindow::createConsole() +{ + QDockWidget *dock = new QDockWidget(tr("Output Console"), this); + QTextEdit* textEdit = new QTextEdit(dock); + + dock->setAllowedAreas(Qt::BottomDockWidgetArea| Qt::TopDockWidgetArea); + dock->setWidget(textEdit); + addDockWidget(Qt::BottomDockWidgetArea, dock); + QVBoxLayout* vL= new QVBoxLayout(dock); + dock->setLayout(vL); + + textEdit->setObjectName(QString::fromUtf8("textEdit")); +/* textEdit->setMinimumSize(QSize(0, 80)); + textEdit->setMaximumSize(QSize(16777215, 120));*/ + globTextEdit=textEdit; + agseterrf(errorPipe); + + vL->addWidget(textEdit); + vL->setContentsMargins(1,1,1,1); + + QFrame *fr=new QFrame(dock); + vL->addWidget(fr); + + QPushButton* logNewBtn=new QPushButton(QIcon(":/images/new.png"),"",fr); + QPushButton* logSaveBtn=new QPushButton(QIcon(":/images/save.png"),"",fr); + QHBoxLayout* consoleLayout = new QHBoxLayout(); + consoleLayout->addWidget(logNewBtn); + connect(logNewBtn,SIGNAL(clicked()),this,SLOT(slotNewLog())); + connect(logSaveBtn,SIGNAL(clicked()),this,SLOT(slotSaveLog())); + consoleLayout->addWidget(logSaveBtn); + consoleLayout->addStretch(); + + consoleLayout->setContentsMargins(1,1,1,1);; + consoleLayout->setContentsMargins(1,1,1,1); + + fr->setLayout(consoleLayout); + + QFrame *mainFrame=new QFrame(dock); + mainFrame->setLayout(vL); + + + dock->setWidget(mainFrame); + +} + + + CMainWindow::CMainWindow() { @@ -62,28 +109,14 @@ CMainWindow::CMainWindow() mdiArea->setObjectName(QString::fromUtf8("mdiArea")); verticalLayout->addWidget(mdiArea); - - QTextEdit* textEdit = new QTextEdit(centralwidget); - textEdit->setObjectName(QString::fromUtf8("textEdit")); - textEdit->setMinimumSize(QSize(0, 80)); - textEdit->setMaximumSize(QSize(16777215, 120)); - globTextEdit=textEdit; - agseterrf(errorPipe); - verticalLayout->addWidget(textEdit); - QFrame *fr=new QFrame(centralwidget); - verticalLayout->addWidget(fr); - + verticalLayout_2->setContentsMargins(1,1,1,1); verticalLayout_2->addLayout(verticalLayout); - QPushButton* logNewBtn=new QPushButton(QIcon(":/images/new.png"),"",fr); - QPushButton* logSaveBtn=new QPushButton(QIcon(":/images/save.png"),"",fr); - QHBoxLayout* consoleLayout = new QHBoxLayout(); - consoleLayout->addWidget(logNewBtn); - connect(logNewBtn,SIGNAL(clicked()),this,SLOT(slotNewLog())); - connect(logSaveBtn,SIGNAL(clicked()),this,SLOT(slotSaveLog())); - consoleLayout->addWidget(logSaveBtn); - consoleLayout->addStretch(); - fr->setLayout(consoleLayout); setCentralWidget(centralwidget); + centralwidget->layout()->setContentsMargins(1,1,1,1); + prevChild=NULL; + + createConsole(); + @@ -208,11 +241,30 @@ void CMainWindow::slotAbout() void CMainWindow::slotSettings() { + if(prevChild !=activeMdiChild()) + { + QString msg; + msg.append("working on "); + msg.append(activeMdiChild()->currentFile()); + msg.append("\n"); + errorPipe((char*)msg.toAscii().constData()); + prevChild=activeMdiChild(); + } frmSettings->showSettings(activeMdiChild()); } void CMainWindow::slotRun() { + + if(prevChild !=activeMdiChild()) + { + QString msg; + msg.append("working on "); + msg.append(activeMdiChild()->currentFile()); + msg.append("\n"); + errorPipe((char*)msg.toAscii().constData()); + prevChild=activeMdiChild(); + } if((activeMdiChild()) && (!activeMdiChild()->firstTime())) frmSettings->runSettings(activeMdiChild()); if((activeMdiChild()) && (activeMdiChild()->firstTime())) diff --git a/cmd/gvedit/mainwindow.h b/cmd/gvedit/mainwindow.h index a49c5ec7d..c20279037 100644 --- a/cmd/gvedit/mainwindow.h +++ b/cmd/gvedit/mainwindow.h @@ -60,7 +60,9 @@ protected: void closeEvent(QCloseEvent *event); + private: + void createConsole(); void actions(); void menus(); void updateMenus(); @@ -71,6 +73,7 @@ private: void writeSettings(); void loadPlugins(); MdiChild *activeMdiChild(); + MdiChild* prevChild; QMdiSubWindow *findMdiChild(const QString &fileName); QSignalMapper *windowMapper; diff --git a/cmd/gvedit/mdi.vcproj b/cmd/gvedit/mdi.vcproj index 9957cd44f..2b44ad031 100644 --- a/cmd/gvedit/mdi.vcproj +++ b/cmd/gvedit/mdi.vcproj @@ -137,8 +137,8 @@ Name="VCCLCompilerTool" AdditionalOptions="-Zm200 -w34100 -w34189" Optimization="2" - AdditionalIncludeDirectories=""$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\ActiveQt";debug;..\..\..\..\Qt\4.7.0\mkspecs\default;.\GeneratedFiles;..\..\lib\common;..\..\lib\pathplan;..\..\lib\cdt;..\..\lib\graph;..\..\lib\gvc" - PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT" + AdditionalIncludeDirectories=""C:\graphviz-ms\graphviz3\plugin\pango";C:\gtk\include\cairo;"C:\gtk\lib\glib-2.0\include";"C:\gtk\include\glib-2.0";"C:\gtk\include\pango-1.0";"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\ActiveQt";debug;..\..\..\..\Qt\4.7.0\mkspecs\default;.\GeneratedFiles;..\..\lib\common;..\..\lib\pathplan;..\..\lib\cdt;..\..\lib\graph;"$(SolutionDir)/";..\..\lib\gvc" + PreprocessorDefinitions="QT_NO_DEBUG;NDEBUG;_WINDOWS;UNICODE;WIN32;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;HAVE_GETOPT_H;WIN32_DLL" GeneratePreprocessedFile="0" ExceptionHandling="1" RuntimeLibrary="2" @@ -166,11 +166,11 @@ Name="VCLinkerTool" IgnoreImportLibrary="true" AdditionalOptions=""/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"" - AdditionalDependencies="qtmain.lib QtGuid4.lib QtCored4.lib gvc.lib graph.lib" + AdditionalDependencies="qtmain.lib QtGui4.lib QtCore4.lib gvc.lib graph.lib" OutputFile="c:/graphviz-ms/bin/$(ProjectName).exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""C:\graphviz-ms\bin";"$(QTDIR)\lib"" + AdditionalLibraryDirectories=""C:\graphviz-ms\bin";"$(QTDIR)\lib";C:\gtk\lib" GenerateDebugInformation="false" ProgramDatabaseFile="" SubSystem="2" @@ -215,10 +215,6 @@ RelativePath=".\csettings.cpp" > - - @@ -265,7 +261,7 @@ @@ -291,7 +287,7 @@ @@ -317,7 +313,7 @@ @@ -343,7 +339,7 @@ diff --git a/cmd/gvedit/mdi.vcproj.RESEARCH.arif.user b/cmd/gvedit/mdi.vcproj.RESEARCH.arif.user index f7501abe7..f69bb6e79 100644 --- a/cmd/gvedit/mdi.vcproj.RESEARCH.arif.user +++ b/cmd/gvedit/mdi.vcproj.RESEARCH.arif.user @@ -2,7 +2,7 @@ setFrameShadow(QFrame::Raised); layoutWidget1 = new QWidget(frame_2); layoutWidget1->setObjectName(QString::fromUtf8("layoutWidget1")); - layoutWidget1->setGeometry(QRect(2, 0, 436, 62)); + layoutWidget1->setGeometry(QRect(2, 0, 391, 62)); horizontalLayout_7 = new QHBoxLayout(layoutWidget1); horizontalLayout_7->setObjectName(QString::fromUtf8("horizontalLayout_7")); horizontalLayout_7->setContentsMargins(0, 0, 0, 0); diff --git a/cmd/gvedit/vc90.idb b/cmd/gvedit/vc90.idb index c2d61901c..4d1ddd37e 100644 Binary files a/cmd/gvedit/vc90.idb and b/cmd/gvedit/vc90.idb differ