Skip to content

Commit

Permalink
Merge 1516b4f into b21d3da
Browse files Browse the repository at this point in the history
  • Loading branch information
yodalee committed Jan 28, 2015
2 parents b21d3da + 1516b4f commit 71f5d86
Show file tree
Hide file tree
Showing 11 changed files with 510 additions and 536 deletions.
2 changes: 1 addition & 1 deletion qucs/qucs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ SET(QUCS_SRCS
mouseactions.cpp qucs_actions.cpp schematic_file.cpp
wirelabel.cpp node.cpp qucs_init.cpp
syntax.cpp misc.cpp messagedock.cpp
imagewriter.cpp printerwriter.cpp
imagewriter.cpp printerwriter.cpp projectView.cpp
)

SET(QUCS_HDRS
Expand Down
3 changes: 2 additions & 1 deletion qucs/qucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ qucs_SOURCES = node.cpp element.cpp qucsdoc.cpp wire.cpp mouseactions.cpp \
qucs.cpp main.cpp wirelabel.cpp qucs_init.cpp qucs_actions.cpp \
viewpainter.cpp mnemo.cpp schematic.cpp schematic_element.cpp textdoc.cpp \
schematic_file.cpp syntax.cpp module.cpp octave_window.cpp qrc_qucs.cpp \
messagedock.cpp misc.cpp imagewriter.cpp printerwriter.cpp
messagedock.cpp misc.cpp imagewriter.cpp printerwriter.cpp \
projectView.cpp

qrc_qucs.cpp: qucs.qrc
$(RCC) -o $@ $<
Expand Down
85 changes: 44 additions & 41 deletions qucs/qucs/dialogs/librarydialog.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
/***************************************************************************
librarydialog.cpp
-------------------
begin : Sun Jun 04 2006
copyright : (C) 2006 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* librarydialog.cpp - implementation of dialog to create library
*
* Copyright (C) 2006, Michael Margraf, michael.margraf@alumni.tu-berlin.de
* Copyright (C) 2014, Yodalee, lc85301@gmail.com
*
* This file is part of Qucs
*
* Qucs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qucs. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifdef HAVE_CONFIG_H
# include <config.h>
Expand All @@ -36,18 +42,17 @@
#include <QStackedWidget>
#include <QGroupBox>
#include <QDebug>
#include <QStringList>

#include "librarydialog.h"
#include "qucs.h"
#include "main.h"
#include "schematic.h"

extern SubMap FileList;

LibraryDialog::LibraryDialog(QucsApp *App_, QTreeWidgetItem *SchematicList)
: QDialog(App_)
LibraryDialog::LibraryDialog(QWidget *parent)
: QDialog(parent)
{
App = App_;
setWindowTitle(tr("Create Library"));

Expr.setPattern("[\\w_]+");
Expand Down Expand Up @@ -90,7 +95,7 @@ LibraryDialog::LibraryDialog(QucsApp *App_, QTreeWidgetItem *SchematicList)

QWidget *scrollWidget = new QWidget();

QVBoxLayout *checkBoxLayout = new QVBoxLayout();
checkBoxLayout = new QVBoxLayout();
scrollWidget->setLayout(checkBoxLayout);
scrollArea->setWidget(scrollWidget);

Expand Down Expand Up @@ -204,26 +209,6 @@ LibraryDialog::LibraryDialog(QucsApp *App_, QTreeWidgetItem *SchematicList)
hbox2->addWidget(close);
connect(close, SIGNAL(clicked()), SLOT(reject()));
msgLayout->addLayout(hbox2);

// ...........................................................
// insert all subcircuits of into checklist
QTreeWidgetItem *p ;
for(int i=0; i < SchematicList->childCount(); i++){
p = SchematicList->child(i);
if(p->parent() == 0)
break;
if(!p->text(1).isEmpty()){
QCheckBox *subCheck = new QCheckBox(p->text(0));
checkBoxLayout->addWidget(subCheck);
BoxList.append(subCheck);
}
}

if(BoxList.isEmpty()) {
ButtCreateNext->setEnabled(false);
QLabel *noProj = new QLabel(tr("No projects!"));
checkBoxLayout->addWidget(noProj);
}
}


Expand All @@ -233,6 +218,24 @@ LibraryDialog::~LibraryDialog()
delete Validator;
}

void
LibraryDialog::fillSchematicList(QStringList SchematicList)
{
// ...........................................................
// insert all subcircuits of into checklist
if (SchematicList.size() == 0) {
ButtCreateNext->setEnabled(false);
QLabel *noProj = new QLabel(tr("No projects!"));
checkBoxLayout->addWidget(noProj);
} else {
foreach(const QString &filename, SchematicList) {
QCheckBox *subCheck = new QCheckBox(filename);
checkBoxLayout->addWidget(subCheck);
BoxList.append(subCheck);
}
}
}

// ---------------------------------------------------------------
void LibraryDialog::slotCreateNext()
{
Expand Down
46 changes: 27 additions & 19 deletions qucs/qucs/dialogs/librarydialog.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
/***************************************************************************
librarydialog.h
-----------------
begin : Sun Jun 04 2006
copyright : (C) 2006 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/*
* librarydialog.h - declaration of dialog to create library
*
* Copyright (C) 2006, Michael Margraf, michael.margraf@alumni.tu-berlin.de
* Copyright (C) 2014, Yodalee, lc85301@gmail.com
*
* This file is part of Qucs
*
* Qucs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qucs. If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef LIBRARYDIALOG_H
#define LIBRARYDIALOG_H
Expand All @@ -32,7 +38,6 @@
#include <QStackedWidget>

class QLabel;
class QucsApp;
class QLineEdit;
class QTextEdit;
class QPushButton;
Expand All @@ -41,14 +46,17 @@ class QTreeWidgetItem;
class QGroupBox;
class QRegExpValidator;
class QStackedWidget;
class QStringList;


class LibraryDialog : public QDialog {
Q_OBJECT
public:
LibraryDialog(QucsApp*, QTreeWidgetItem*);
LibraryDialog(QWidget *);
~LibraryDialog();

void fillSchematicList(QStringList);

private slots:
void slotCreateNext();
void slotSave();
Expand All @@ -66,6 +74,7 @@ private slots:
private:
int curDescr;
QVBoxLayout *all; // the mother of all widgets
QVBoxLayout *checkBoxLayout;
QStackedWidget *stackedWidgets;
QLabel *theLabel;
QLabel *checkedCktName;
Expand All @@ -82,7 +91,6 @@ private slots:
QStringList Descriptions;
QCheckBox *checkDescr;

QucsApp *App;
QFile LibFile;
QDir LibDir;
QRegExp Expr;
Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/dialogs/qucssettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void QucsSettingsDialog::slotApply()
if(changed)
{
App->readProjects();
App->readProjectFiles();
App->slotUpdateTreeview();
App->repaint();
}

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/dialogs/searchdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* searchdialog.h - implementation of search dialog
* searchdialog.cpp - implementation of search dialog
*
* Copyright (C) 2006, Michael Margraf, michael.margraf@alumni.tu-berlin.de
* Copyright (C) 2014, Yodalee, lc85301@gmail.com
Expand Down

0 comments on commit 71f5d86

Please sign in to comment.