2005-02-27 Stefan Jahn <stefan@lkcc.org>

* qucs-help/main.cpp, qucs-edit/main.cpp (main): Made the
        QucsHelp and QucsEdit applications relocatable using the
        environment variable QUCSDIR.

2005-02-26  Stefan Jahn  <stefan@lkcc.org>

        * main.cpp (main): Made the Qucs application relocatable
        using the environment variable QUCSDIR.
This commit is contained in:
raimi 2005-02-28 09:30:41 +00:00
parent 22795a8cc6
commit 05b5dd1ad3
18 changed files with 458 additions and 306 deletions

View File

@ -1,3 +1,9 @@
2005-02-27 Stefan Jahn <stefan@lkcc.org>
* qucs-help/main.cpp, qucs-edit/main.cpp (main): Made the
QucsHelp and QucsEdit applications relocatable using the
environment variable QUCSDIR.
2005-02-23 Stefan Jahn <stefan@lkcc.org>
* THANKS: Corrected Toyoyuki Ishikawa's name at all locations

2
NEWS
View File

@ -26,7 +26,7 @@ files.
Version 0.0.5
-------------
* translations into French, Japanese and Hungarian
* translations into Hebrew, French, Japanese and Hungarian
* some new components and diagrams
* some new graph styles (stars, circles, ...)
* manual axes scale for diagrams

View File

@ -138,6 +138,9 @@ else
QT_INC="$QT_DEF"
QT_MTS="non-threaded"
fi
case $host_os in
*mingw32* ) QT_LIB="$QT_LIB -lqtmain"; QT_INC="$QT_INC -DQT_DLL -DUNICODE" ;;
esac
unset enable_mt
# Check library path to Qt.

View File

@ -19,6 +19,8 @@
# include <config.h>
#endif
#include <stdlib.h>
#include <qapplication.h>
#include <qstring.h>
#include <qtextcodec.h>
@ -31,21 +33,13 @@
#include "qucsedit.h"
struct tQucsSettings {
int x, y, dx, dy; // position and size of main window
QFont font;
};
struct tQucsSettings QucsSettings
= {200, 100, 400, 400, // position and size
QFont("Helvetica", 12)};
tQucsSettings QucsSettings;
// #########################################################################
// Loads the settings file and stores the settings.
bool loadSettings()
{
QFile file(QDir::homeDirPath()+"/.qucs/editrc");
QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/editrc"));
if(!file.open(IO_ReadOnly)) return false; // settings file doesn't exist
QTextStream stream(&file);
@ -64,7 +58,7 @@ bool loadSettings()
}
file.close();
file.setName(QDir::homeDirPath()+"/.qucs/qucsrc");
file.setName(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/qucsrc"));
if(!file.open(IO_ReadOnly)) return true; // qucs settings not necessary
while(!stream.atEnd()) {
@ -92,7 +86,7 @@ bool saveApplSettings(QucsEdit *qucs)
return true; // nothing has changed
QFile file(QDir::homeDirPath()+"/.qucs/editrc");
QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/editrc"));
if(!file.open(IO_WriteOnly)) {
QMessageBox::warning(0, QObject::tr("Warning"),
QObject::tr("Cannot save settings !"));
@ -130,13 +124,34 @@ void showOptions()
int main(int argc, char *argv[])
{
// apply default settings
QucsSettings.x = 200;
QucsSettings.y = 100;
QucsSettings.dx = 400;
QucsSettings.dy = 400;
QucsSettings.font = QFont("Helvetica", 12);
// is application relocated?
char * var = getenv ("QUCSDIR");
if (var != NULL) {
QDir QucsDir = QDir (var);
QString QucsDirStr = QucsDir.canonicalPath ();
QucsSettings.BitmapDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/bitmaps/");
QucsSettings.LangDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
} else {
QucsSettings.BitmapDir = BITMAPDIR;
QucsSettings.LangDir = LANGUAGEDIR;
}
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );
tor.load( QString("qucs_") + QTextCodec::locale(), LANGUAGEDIR );
tor.load( QString("qucs_") + QTextCodec::locale(), QucsSettings.LangDir);
a.installTranslator( &tor );
bool readOnly = false;

View File

@ -34,7 +34,8 @@
QucsEdit::QucsEdit(const QString& FileName_, bool readOnly)
{
setIcon (QPixmap(BITMAPDIR "big.qucs.xpm")); // set application icon
// set application icon
setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
setCaption("QucsEdit " PACKAGE_VERSION " - " + tr("File: "));
QVBoxLayout *v = new QVBoxLayout(this);
@ -43,11 +44,13 @@ QucsEdit::QucsEdit(const QString& FileName_, bool readOnly)
v->addWidget(h);
QToolButton *ButtLoad = new QToolButton(h);
ButtLoad->setIconSet(QIconSet(QImage(BITMAPDIR "fileopen.png")));
ButtLoad->setIconSet(
QIconSet(QImage(QucsSettings.BitmapDir + "fileopen.png")));
connect(ButtLoad, SIGNAL(clicked()), SLOT(slotLoad()));
QToolButton *ButtSave = new QToolButton(h);
ButtSave->setIconSet(QIconSet(QImage(BITMAPDIR "filesave.png")));
ButtSave->setIconSet(
QIconSet(QImage(QucsSettings.BitmapDir + "filesave.png")));
connect(ButtSave, SIGNAL(clicked()), SLOT(slotSave()));
ButtSave->setDisabled(readOnly);

View File

@ -21,6 +21,15 @@
#include <qdialog.h>
#include <qtextedit.h>
struct tQucsSettings {
int x, y, dx, dy; // position and size of main window
QFont font;
QString BitmapDir;
QString LangDir;
};
extern tQucsSettings QucsSettings;
/**
*@author Michael Margraf
*/

View File

@ -19,6 +19,8 @@
# include <config.h>
#endif
#include <stdlib.h>
#include <qapplication.h>
#include <qstring.h>
#include <qtextcodec.h>
@ -33,21 +35,13 @@
#include "qucshelp.h"
QDir QucsHelpDir; // directory to find helps files
struct tQucsSettings {
int x, y, dx, dy; // position and size of main window
QFont font;
};
struct tQucsSettings QucsSettings
= {60, 30, 640, 400, // position and size
QFont("Helvetica", 12)};
tQucsSettings QucsSettings; // application settings
// #########################################################################
// Loads the settings file and stores the settings.
bool loadSettings()
{
QFile file(QDir::homeDirPath()+"/.qucs/helprc");
QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/helprc"));
if(!file.open(IO_ReadOnly)) return false; // settings file doesn't exist
QTextStream stream(&file);
@ -66,7 +60,7 @@ bool loadSettings()
}
file.close();
file.setName(QDir::homeDirPath()+"/.qucs/qucsrc");
file.setName(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/qucsrc"));
if(!file.open(IO_ReadOnly)) return true; // qucs settings not necessary
while(!stream.atEnd()) {
@ -94,7 +88,7 @@ bool saveApplSettings(QucsHelp *qucs)
return true; // nothing has changed
QFile file(QDir::homeDirPath()+"/.qucs/helprc");
QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/helprc"));
if(!file.open(IO_WriteOnly)) {
QMessageBox::warning(0, QObject::tr("Warning"),
QObject::tr("Cannot save settings !"));
@ -121,26 +115,50 @@ bool saveApplSettings(QucsHelp *qucs)
int main(int argc, char *argv[])
{
// apply default settings
QucsSettings.x = 60;
QucsSettings.y = 30;
QucsSettings.dx = 640;
QucsSettings.dy = 400;
QucsSettings.font = QFont("Helvetica", 12);
// is application relocated?
char * var = getenv ("QUCSDIR");
if (var != NULL) {
QDir QucsDir = QDir (var);
QString QucsDirStr = QucsDir.canonicalPath ();
QucsSettings.DocDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/docs/");
QucsSettings.BitmapDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/bitmaps/");
QucsSettings.LangDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
} else {
QucsSettings.DocDir = DOCDIR;
QucsSettings.BitmapDir = BITMAPDIR;
QucsSettings.LangDir = LANGUAGEDIR;
}
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );
tor.load( QString("qucs_") + QTextCodec::locale(), LANGUAGEDIR );
tor.load( QString("qucs_") + QTextCodec::locale(), QucsSettings.LangDir);
a.installTranslator( &tor );
QString locale = QTextCodec::locale();
QucsHelpDir = QString (DOCDIR) + locale;
QucsHelpDir = QucsSettings.DocDir + locale;
if (!QucsHelpDir.exists () || !QucsHelpDir.isReadable ()) {
int p = locale.find ('_');
if (p != -1) {
QucsHelpDir = QString (DOCDIR) + locale.left (p);
QucsHelpDir = QucsSettings.DocDir + locale.left (p);
if (!QucsHelpDir.exists () || !QucsHelpDir.isReadable ()) {
QucsHelpDir = QString (DOCDIR) + "en";
QucsHelpDir = QucsSettings.DocDir + "en";
}
}
else QucsHelpDir = QString (DOCDIR) + "en";
else QucsHelpDir = QucsSettings.DocDir + "en";
}
QString Page;

View File

@ -27,7 +27,8 @@
QucsHelp::QucsHelp(const QString& page)
{
setIcon (QPixmap(BITMAPDIR "big.qucs.xpm")); // set application icon
// set application icon
setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
setCaption(tr("Qucs Help System"));
QVBoxLayout *v = new QVBoxLayout(this);

View File

@ -21,7 +21,18 @@
#include <qdialog.h>
#include <qtextbrowser.h>
#include <qdir.h>
#include <qfont.h>
#include <qstring.h>
struct tQucsSettings {
int x, y, dx, dy; // position and size of main window
QFont font;
QString BitmapDir;
QString LangDir;
QString DocDir;
};
extern tQucsSettings QucsSettings;
extern QDir QucsHelpDir;
/**

View File

@ -1,3 +1,8 @@
2005-02-26 Stefan Jahn <stefan@lkcc.org>
* main.cpp (main): Made the Qucs application relocatable
using the environment variable QUCSDIR.
2005-02-23 Stefan Jahn <stefan@lkcc.org>
* qucs_fr.ts: Applied french translation updates by Vincent.

View File

@ -15,11 +15,9 @@
* *
***************************************************************************/
using namespace std;
#include "diagram.h"
#include "qucs.h"
#include "main.h"
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <math.h>
@ -34,12 +32,18 @@ using namespace std;
#include <qregexp.h>
#include <qdatetime.h>
#include "diagram.h"
#include "qucs.h"
#include "main.h"
#ifdef __MINGW32__
# define finite(x) _finite(x)
#endif
#define INVALID_STR QObject::tr(" <invalid>")
using namespace std;
Diagram::Diagram(int _cx, int _cy)
{
cx = _cx; cy = _cy;

View File

@ -198,5 +198,5 @@ void QucsSettingsDialog::slotDefaultValues()
BGColorButton->setPaletteBackgroundColor(QColor(255,250,225));
undoNumEdit->setText("20");
editorEdit->setText(BINARYDIR "qucsedit");
editorEdit->setText(QucsSettings.BinDir + "qucsedit");
}

View File

@ -19,10 +19,8 @@
# include <config.h>
#endif
#include "qucs.h"
#include "qucsview.h"
#include "main.h"
#include "node.h"
#include <stdlib.h>
#include <math.h>
#include <qapplication.h>
#include <qstring.h>
@ -33,15 +31,12 @@
#include <qmessagebox.h>
#include <qregexp.h>
#include <math.h>
#include <float.h>
#include "qucs.h"
#include "qucsview.h"
#include "main.h"
#include "node.h"
struct tQucsSettings QucsSettings
= {0, 0, 600, 400, // position and size
QFont("Helvetica", 12), 16.0,
QColor(255, 250, 225), 20,
BINARYDIR "qucsedit"};
tQucsSettings QucsSettings;
QFont savingFont; // to remember which font to save in "qucsrc"
@ -253,126 +248,158 @@ void str2num(const QString& s_, double& Number, QString& Unit, double& Factor)
#include <qregexp.h>
int main(int argc, char *argv[])
{
/*double zD = 1.0e5;
qDebug(StringNum(zD, 'e', -1));
#if 0
double zD = 1.0e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1234567e5;
qDebug(StringNum(zD, 'e', -1));
qDebug(" ");
zD = 1.1234567e5;
qDebug(StringNum(zD, 'e', -1));
qDebug(" ");
zD = 1.0e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.0e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1234567e5;
qDebug(StringNum(zD, 'f', -1));
qDebug(" ");
zD = 1.1234567e5;
qDebug(StringNum(zD, 'f', -1));
qDebug(" ");
zD = 1.0e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.0e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.12e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.123e5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1234567e5;
qDebug(StringNum(zD, 'g', -1));
qDebug(" ");
zD = 1.1234567e5;
qDebug(StringNum(zD, 'g', -1));
qDebug(" ");
// ------------------------------------
// ------------------------------------
zD = 1.0e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.0e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'e', -1));
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'e', -1));
qDebug("\n");
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'e', -1));
qDebug("\n");
zD = 1.0e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.0e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'f', -1));
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'f', -1));
qDebug(" ");
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'f', -1));
qDebug(" ");
zD = 1.0e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.0e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.12e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.123e-5;
qDebug(StringNum(zD, 'g', -1));
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'g', -1));
qDebug(" ");
zD = 1.1234567e-5;
qDebug(StringNum(zD, 'g', -1));
qDebug(" ");
return 0;
#endif
#if 0
double d, Factor;
QString Unit, s("-2.9E+02eco");
str2num(s, d, Unit, Factor);
qDebug("String: %s, Zahl: %g, Einheit: %s, Faktor: %g",
s.latin1(), d, Unit.latin1(), Factor);
return 0;*/
/*double d, Factor;
QString Unit, s("-2.9E+02eco");
str2num(s, d, Unit, Factor);
qDebug("String: %s, Zahl: %g, Einheit: %s, Faktor: %g",
s.latin1(), d, Unit.latin1(), Factor);
s = "2.5eco";
str2num(s, d, Unit, Factor);
qDebug("String: %s, Zahl: %g, Einheit: %s, Faktor: %g",
s.latin1(), d, Unit.latin1(), Factor);
return 0;
#endif
s = "2.5eco";
str2num(s, d, Unit, Factor);
qDebug("String: %s, Zahl: %g, Einheit: %s, Faktor: %g",
s.latin1(), d, Unit.latin1(), Factor);
return 0;
*/
QucsWorkDir.setPath(QDir::homeDirPath()+"/.qucs");
QucsHomeDir.setPath(QDir::homeDirPath()+"/.qucs");
// apply default settings
QucsSettings.x = 0;
QucsSettings.y = 0;
QucsSettings.dx = 600;
QucsSettings.dy = 400;
QucsSettings.font = QFont("Helvetica", 12);
QucsSettings.largeFontSize = 16.0;
QucsSettings.BGColor = QColor(255, 250, 225);
QucsSettings.maxUndo = 20;
// is application relocated?
char * var = getenv ("QUCSDIR");
if (var != NULL) {
QDir QucsDir = QDir (var);
QString QucsDirStr = QucsDir.canonicalPath ();
QucsSettings.BinDir =
QDir::convertSeparators (QucsDirStr + "/bin/");
QucsSettings.BitmapDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/bitmaps/");
QucsSettings.LangDir =
QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/");
} else {
QucsSettings.BinDir = BINARYDIR;
QucsSettings.BitmapDir = BITMAPDIR;
QucsSettings.LangDir = LANGUAGEDIR;
}
QucsSettings.Editor = QucsSettings.BinDir + "qucsedit";
QucsWorkDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
QucsHomeDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );
tor.load( QString("qucs_") + QTextCodec::locale(), LANGUAGEDIR );
tor.load( QString("qucs_") + QTextCodec::locale(), QucsSettings.LangDir);
a.installTranslator( &tor );
QucsMain = new QucsApp();

View File

@ -28,6 +28,11 @@ class Node;
class Diagram;
class Component;
// constants may be missing on windows systems
#include <math.h>
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795029
#endif
struct tQucsSettings {
int x, y, dx, dy; // position and size of main window
@ -37,6 +42,9 @@ struct tQucsSettings {
unsigned int maxUndo; // size of undo stack
QString Editor;
QString BinDir;
QString BitmapDir;
QString LangDir;
};
extern tQucsSettings QucsSettings; // extern because nearly everywhere used

View File

@ -17,6 +17,7 @@
#include "ellipsearc.h"
#include "filldialog.h"
#include "main.h"
#include <qpushbutton.h>
#include <qlineedit.h>

View File

@ -72,8 +72,8 @@ QucsApp::QucsApp()
tr("Data Display")+" (*.dpl);;"+
tr("Qucs Documents")+" (*.sch *.dpl);;"+
tr("Any File")+" (*)";
QucsWorkDir.setPath(QDir::homeDirPath()+"/.qucs");
QucsHomeDir.setPath(QDir::homeDirPath()+"/.qucs");
QucsWorkDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
QucsHomeDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
move (QucsSettings.x, QucsSettings.y);
resize(QucsSettings.dx, QucsSettings.dy);
@ -128,7 +128,8 @@ QucsApp::~QucsApp()
// #########################################################################
void QucsApp::initView()
{
setIcon (QPixmap(BITMAPDIR "big.qucs.xpm")); // set application icon
// set application icon
setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
QVBox *all = new QVBox(this); // only to fill the entire view area
QSplitter *Hsplit = new QSplitter(QSplitter::Horizontal, all);
@ -987,7 +988,7 @@ void QucsApp::slotGettingStarted()
void QucsApp::showHTML(const QString& Page)
{
QStringList com;
com << BINARYDIR "qucshelp" << Page;
com << QucsSettings.BinDir + "qucshelp" << Page;
QProcess *QucsHelp = new QProcess(com);
if(!QucsHelp->start()) {
QMessageBox::critical(this, tr("Error"), tr("Cannot start qucshelp!"));
@ -1127,7 +1128,7 @@ void QucsApp::slotSimulate()
sim->ProgText->insert(tr("done.\n"));
QStringList com;
com << BINARYDIR "qucsator" << "-b" << "-i"
com << QucsSettings.BinDir + "qucsator" << "-b" << "-i"
<< QucsHomeDir.filePath("netlist.txt")
<< "-o" << QucsWorkDir.filePath(view->Docs.current()->DataSet);
if(!sim->startProcess(com)) {
@ -1248,7 +1249,8 @@ void QucsApp::slotChangePage(QString Name)
if(!file.open(IO_ReadWrite)) { // if it doesn't exist, create
view->Docs.findRef(Doc);
QMessageBox::critical(this, tr("Error"),
tr("Cannot create ")+Info.dirPath(true)+"/"+Name);
tr("Cannot create ")+Info.dirPath(true)+
QDir::convertSeparators ("/")+Name);
return;
}
else new QListViewItem(ConDisplays, Info.fileName()); // add new name
@ -1305,7 +1307,7 @@ void QucsApp::slotOpenContent(QListViewItem *item)
QucsWorkDir.setPath(QucsHomeDir.path());
if(!QucsWorkDir.cd(ProjName+"_prj/")) {
if(!QucsWorkDir.cd(ProjName+QDir::convertSeparators ("_prj/"))) {
QMessageBox::critical(this, tr("Error"),
tr("Cannot access project directory: ")+
QucsWorkDir.path());
@ -1341,7 +1343,7 @@ void QucsApp::slotMenuCloseProject()
view->drawn = false;
setCaption("Qucs " PACKAGE_VERSION + tr(" - Project: "));
QucsWorkDir.setPath(QDir::homeDirPath()+"/.qucs");
QucsWorkDir.setPath(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs"));
Content->setColumnText(0,tr("Content of")); // column text
@ -1570,21 +1572,21 @@ void QucsApp::slotSetCompView(int index)
CompComps->clear(); // clear the IconView
if((index+1) >= CompChoose->count()) {
new QIconViewItem(CompComps, tr("Line"),
QImage(BITMAPDIR "line.xpm"));
QImage(QucsSettings.BitmapDir + "line.xpm"));
new QIconViewItem(CompComps, tr("Arrow"),
QImage(BITMAPDIR "arrow.xpm"));
QImage(QucsSettings.BitmapDir + "arrow.xpm"));
new QIconViewItem(CompComps, tr("Text"),
QImage(BITMAPDIR "text.xpm"));
QImage(QucsSettings.BitmapDir + "text.xpm"));
new QIconViewItem(CompComps, tr("Ellipse"),
QImage(BITMAPDIR "ellipse.xpm"));
QImage(QucsSettings.BitmapDir + "ellipse.xpm"));
new QIconViewItem(CompComps, tr("Rectangle"),
QImage(BITMAPDIR "rectangle.xpm"));
QImage(QucsSettings.BitmapDir + "rectangle.xpm"));
new QIconViewItem(CompComps, tr("filled Ellipse"),
QImage(BITMAPDIR "filledellipse.xpm"));
QImage(QucsSettings.BitmapDir + "filledellipse.xpm"));
new QIconViewItem(CompComps, tr("filled Rectangle"),
QImage(BITMAPDIR "filledrect.xpm"));
QImage(QucsSettings.BitmapDir + "filledrect.xpm"));
new QIconViewItem(CompComps, tr("Elliptic Arc"),
QImage(BITMAPDIR "ellipsearc.xpm"));
QImage(QucsSettings.BitmapDir + "ellipsearc.xpm"));
return;
}
@ -1595,43 +1597,43 @@ void QucsApp::slotSetCompView(int index)
case COMBO_nonlinear: Infos = &nonlinearComps[0]; break;
case COMBO_File:
new QIconViewItem(CompComps, tr("SPICE netlist"),
QImage(BITMAPDIR "spicefile.xpm"));
QImage(QucsSettings.BitmapDir + "spicefile.xpm"));
new QIconViewItem(CompComps, tr("1-port S parameter file"),
QImage(BITMAPDIR "spfile1.xpm"));
QImage(QucsSettings.BitmapDir + "spfile1.xpm"));
new QIconViewItem(CompComps, tr("2-port S parameter file"),
QImage(BITMAPDIR "spfile2.xpm"));
QImage(QucsSettings.BitmapDir + "spfile2.xpm"));
new QIconViewItem(CompComps, tr("3-port S parameter file"),
QImage(BITMAPDIR "spfile3.xpm"));
QImage(QucsSettings.BitmapDir + "spfile3.xpm"));
new QIconViewItem(CompComps, tr("4-port S parameter file"),
QImage(BITMAPDIR "spfile4.xpm"));
QImage(QucsSettings.BitmapDir + "spfile4.xpm"));
new QIconViewItem(CompComps, tr("5-port S parameter file"),
QImage(BITMAPDIR "spfile5.xpm"));
QImage(QucsSettings.BitmapDir + "spfile5.xpm"));
new QIconViewItem(CompComps, tr("6-port S parameter file"),
QImage(BITMAPDIR "spfile6.xpm"));
QImage(QucsSettings.BitmapDir + "spfile6.xpm"));
return;
case COMBO_Sims: Infos = &Simulations[0]; break;
case COMBO_Diagrams:
new QIconViewItem(CompComps, tr("Cartesian"),
QImage(BITMAPDIR "rect.xpm"));
QImage(QucsSettings.BitmapDir + "rect.xpm"));
new QIconViewItem(CompComps, tr("Polar"),
QImage(BITMAPDIR "polar.xpm"));
QImage(QucsSettings.BitmapDir + "polar.xpm"));
new QIconViewItem(CompComps, tr("Tabular"),
QImage(BITMAPDIR "tabular.xpm"));
QImage(QucsSettings.BitmapDir + "tabular.xpm"));
new QIconViewItem(CompComps, tr("Smith Chart"),
QImage(BITMAPDIR "smith.xpm"));
QImage(QucsSettings.BitmapDir + "smith.xpm"));
new QIconViewItem(CompComps, tr("Admittance Smith"),
QImage(BITMAPDIR "ysmith.xpm"));
QImage(QucsSettings.BitmapDir + "ysmith.xpm"));
new QIconViewItem(CompComps, tr("Polar-Smith Combi"),
QImage(BITMAPDIR "polarsmith.xpm"));
QImage(QucsSettings.BitmapDir + "polarsmith.xpm"));
new QIconViewItem(CompComps, tr("Smith-Polar Combi"),
QImage(BITMAPDIR "smithpolar.xpm"));
QImage(QucsSettings.BitmapDir + "smithpolar.xpm"));
return;
}
while(*Infos != 0) {
(**Infos) (Name, File, false);
new QIconViewItem(CompComps, Name,
QImage(BITMAPDIR+QString(File)+".xpm"));
QImage(QucsSettings.BitmapDir+QString(File)+".xpm"));
Infos++;
}
}

View File

@ -2621,7 +2621,7 @@ void QucsDoc::reloadGraphs()
{
QFileInfo Info(DocName);
for(Diagram *pd = Diags->first(); pd != 0; pd = Diags->next())
pd->loadGraphData(Info.dirPath()+"/"+DataSet);
pd->loadGraphData(Info.dirPath()+QDir::convertSeparators ("/")+DataSet);
}
// ---------------------------------------------------

View File

@ -19,15 +19,14 @@
# include <config.h>
#endif
#include "qucs.h"
#include "qucsview.h"
#include "qucsinit.h"
#include "qucsactions.h"
#include <qaction.h>
#include <qaccel.h>
#include <qmenubar.h>
#include "qucs.h"
#include "qucsview.h"
#include "qucsinit.h"
#include "qucsactions.h"
QucsInit::QucsInit()
{
@ -63,78 +62,86 @@ void QucsInit::initActions()
App->activeAction = 0; // no active action
App->fileNew = new QAction(tr("New"),
QIconSet(QImage(BITMAPDIR "filenew.png")),
tr("&New"), CTRL+Key_N, App);
App->fileNew =
new QAction(tr("New"),
QIconSet(QImage(QucsSettings.BitmapDir + "filenew.png")),
tr("&New"), CTRL+Key_N, App);
App->fileNew->setStatusTip(tr("Creates a new document"));
App->fileNew->setWhatsThis(
tr("New\n\nCreates a new schematic or data display document"));
tr("New\n\nCreates a new schematic or data display document"));
connect(App->fileNew, SIGNAL(activated()), App, SLOT(slotFileNew()));
App->fileOpen = new QAction(tr("Open File"),
QIconSet(QImage(BITMAPDIR "fileopen.png")),
tr("&Open..."), CTRL+Key_O, App);
App->fileOpen =
new QAction(tr("Open File"),
QIconSet(QImage(QucsSettings.BitmapDir + "fileopen.png")),
tr("&Open..."), CTRL+Key_O, App);
App->fileOpen->setStatusTip(tr("Opens an existing document"));
App->fileOpen->setWhatsThis(tr("Open File\n\nOpens an existing document"));
connect(App->fileOpen, SIGNAL(activated()), App, SLOT(slotFileOpen()));
App->fileSave = new QAction(tr("Save File"),
QIconSet(QImage(BITMAPDIR "filesave.png")),
tr("&Save"), CTRL+Key_S, App);
App->fileSave =
new QAction(tr("Save File"),
QIconSet(QImage(QucsSettings.BitmapDir + "filesave.png")),
tr("&Save"), CTRL+Key_S, App);
App->fileSave->setStatusTip(tr("Saves the current document"));
App->fileSave->setWhatsThis(tr("Save File\n\nSaves the current document"));
connect(App->fileSave, SIGNAL(activated()), App, SLOT(slotFileSave()));
App->fileSaveAs = new QAction(tr("Save File As"), tr("Save &as..."),
0, App);
App->fileSaveAs =
new QAction(tr("Save File As"), tr("Save &as..."), 0, App);
App->fileSaveAs->setStatusTip(
tr("Saves the current document under a new filename"));
App->fileSaveAs->setWhatsThis(
tr("Save As\n\nSaves the current document under a new filename"));
connect(App->fileSaveAs, SIGNAL(activated()), App, SLOT(slotFileSaveAs()));
App->fileSaveAll = new QAction(tr("Save All Files"),
QIconSet(QImage(BITMAPDIR "filesaveall.png")),
tr("Save &All"), 0, App);
App->fileSaveAll =
new QAction(tr("Save All Files"),
QIconSet(QImage(QucsSettings.BitmapDir + "filesaveall.png")),
tr("Save &All"), 0, App);
App->fileSaveAll->setStatusTip(tr("Saves all open documents"));
App->fileSaveAll->setWhatsThis(
tr("Save All Files\n\nSaves all open documents"));
connect(App->fileSaveAll, SIGNAL(activated()),
App, SLOT(slotFileSaveAll()));
connect(App->fileSaveAll, SIGNAL(activated()), App, SLOT(slotFileSaveAll()));
App->fileClose = new QAction(tr("Close File"),
QIconSet(QImage(BITMAPDIR "fileclose.png")),
tr("&Close"), CTRL+Key_W, App);
App->fileClose =
new QAction(tr("Close File"),
QIconSet(QImage(QucsSettings.BitmapDir + "fileclose.png")),
tr("&Close"), CTRL+Key_W, App);
App->fileClose->setStatusTip(tr("Closes the current document"));
App->fileClose->setWhatsThis(
tr("Close File\n\nCloses the current document"));
connect(App->fileClose, SIGNAL(activated()), App, SLOT(slotFileClose()));
App->symEdit = new QAction(tr("Edit Circuit Symbol"),
tr("Edit Circuit Symbol"), CTRL+Key_U, App);
App->symEdit =
new QAction(tr("Edit Circuit Symbol"),
tr("Edit Circuit Symbol"), CTRL+Key_U, App);
App->symEdit->setStatusTip(tr("Edits the symbol for this schematic"));
App->symEdit->setWhatsThis(
tr("Edit Circuit Symbol\n\nEdits the symbol for this schematic"));
connect(App->symEdit, SIGNAL(activated()), App, SLOT(slotSymbolEdit()));
App->fileSettings = new QAction(tr("Document Settings"),
tr("Document Settings..."), 0, App);
App->fileSettings =
new QAction(tr("Document Settings"),
tr("Document Settings..."), 0, App);
App->fileSettings->setStatusTip(tr("Document Settings"));
App->fileSettings->setWhatsThis(
tr("Settings\n\nSets properties of the file"));
connect(App->fileSettings, SIGNAL(activated()),
App, SLOT(slotFileSettings()));
App->filePrint = new QAction(tr("Print File"),
QIconSet(QImage(BITMAPDIR "fileprint.png")),
tr("&Print..."), CTRL+Key_P, App);
App->filePrint =
new QAction(tr("Print File"),
QIconSet(QImage(QucsSettings.BitmapDir + "fileprint.png")),
tr("&Print..."), CTRL+Key_P, App);
App->filePrint->setStatusTip(tr("Prints the current document"));
App->filePrint->setWhatsThis(
tr("Print File\n\nPrints the current document"));
connect(App->filePrint, SIGNAL(activated()), App, SLOT(slotFilePrint()));
App->filePrintSel = new QAction(tr("Print Selected Elements"),
tr("Print Selection..."), 0, App);
App->filePrintSel =
new QAction(tr("Print Selected Elements"),
tr("Print Selection..."), 0, App);
App->filePrintSel->setStatusTip(tr("Prints Selected Elements"));
App->filePrintSel->setWhatsThis(
tr("Print Selected Elements\n\n"
@ -147,23 +154,24 @@ void QucsInit::initActions()
App->fileQuit->setWhatsThis(tr("Exit\n\nQuits the application"));
connect(App->fileQuit, SIGNAL(activated()), App, SLOT(slotFileQuit()));
App->applSettings = new QAction(tr("Application Settings"),
tr("Application Settings..."), 0, App);
App->applSettings =
new QAction(tr("Application Settings"),
tr("Application Settings..."), 0, App);
App->applSettings->setStatusTip(tr("Application Settings"));
App->applSettings->setWhatsThis(
tr("Qucs Settings\n\nSets properties of the application"));
connect(App->applSettings, SIGNAL(activated()),
App, SLOT(slotApplSettings()));
App->alignTop = new QAction(tr("Align top"), tr("Align top"),
CTRL+Key_T, App);
App->alignTop =
new QAction(tr("Align top"), tr("Align top"), CTRL+Key_T, App);
App->alignTop->setStatusTip(tr("Align top selected elements"));
App->alignTop->setWhatsThis(
tr("Align top\n\nAlign selected elements to their upper edge"));
connect(App->alignTop, SIGNAL(activated()), App, SLOT(slotAlignTop()));
App->alignBottom = new QAction(tr("Align bottom"), tr("Align bottom"),
0, App);
App->alignBottom =
new QAction(tr("Align bottom"), tr("Align bottom"), 0, App);
App->alignBottom->setStatusTip(tr("Align bottom selected elements"));
App->alignBottom->setWhatsThis(
tr("Align bottom\n\nAlign selected elements to their lower edge"));
@ -190,8 +198,9 @@ void QucsInit::initActions()
"Distribute horizontally selected elements"));
connect(App->distrHor, SIGNAL(activated()), App, SLOT(slotDistribHoriz()));
App->distrVert = new QAction(tr("Distribute vertically"),
tr("Distribute vertically"), 0, App);
App->distrVert =
new QAction(tr("Distribute vertically"),
tr("Distribute vertically"), 0, App);
App->distrVert->setStatusTip(tr("Distribute equally vertically"));
App->distrVert->setWhatsThis(
tr("Distribute vertically\n\n"
@ -205,8 +214,9 @@ void QucsInit::initActions()
Acts->onGrid->setToggleAction(true);
connect(Acts->onGrid, SIGNAL(toggled(bool)), Acts, SLOT(slotOnGrid(bool)));
Acts->moveText = new QAction(tr("Move Component Text"),
tr("Move Component Text"), CTRL+Key_K, App);
Acts->moveText =
new QAction(tr("Move Component Text"),
tr("Move Component Text"), CTRL+Key_K, App);
Acts->moveText->setStatusTip(tr("Move Component Text"));
Acts->moveText->setWhatsThis(
tr("Move Component Text\n\nMoves the property text of components"));
@ -214,27 +224,30 @@ void QucsInit::initActions()
connect(Acts->moveText, SIGNAL(toggled(bool)),
Acts, SLOT(slotMoveText(bool)));
App->editCut = new QAction(tr("Cut"),
QIconSet(QImage(BITMAPDIR "editcut.png")),
tr("Cu&t"), CTRL+Key_X, App);
App->editCut =
new QAction(tr("Cut"),
QIconSet(QImage(QucsSettings.BitmapDir + "editcut.png")),
tr("Cu&t"), CTRL+Key_X, App);
App->editCut->setStatusTip(
tr("Cuts the selected section and puts it to the clipboard"));
App->editCut->setWhatsThis(
tr("Cut\n\nCuts the selected section and puts it to the clipboard"));
connect(App->editCut, SIGNAL(activated()), App, SLOT(slotEditCut()));
App->editCopy = new QAction(tr("Copy"),
QIconSet(QImage(BITMAPDIR "editcopy.png")),
tr("&Copy"), CTRL+Key_C, App);
App->editCopy =
new QAction(tr("Copy"),
QIconSet(QImage(QucsSettings.BitmapDir + "editcopy.png")),
tr("&Copy"), CTRL+Key_C, App);
App->editCopy->setStatusTip(
tr("Copies the selected section to the clipboard"));
App->editCopy->setWhatsThis(
tr("Copy\n\nCopies the selected section to the clipboard"));
connect(App->editCopy, SIGNAL(activated()), App, SLOT(slotEditCopy()));
Acts->editPaste = new QAction(tr("Paste"),
QIconSet(QImage(BITMAPDIR "editpaste.png")),
tr("&Paste"), CTRL+Key_V, App);
Acts->editPaste =
new QAction(tr("Paste"),
QIconSet(QImage(QucsSettings.BitmapDir + "editpaste.png")),
tr("&Paste"), CTRL+Key_V, App);
Acts->editPaste->setStatusTip(
tr("Pastes the clipboard contents to the cursor position"));
Acts->editPaste->setWhatsThis(
@ -243,15 +256,17 @@ void QucsInit::initActions()
connect(Acts->editPaste, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditPaste(bool)));
Acts->editDelete = new QAction(tr("Delete"),
QIconSet(QImage(BITMAPDIR "editdelete.png")),
tr("&Delete"), Key_Delete, App);
Acts->editDelete =
new QAction(tr("Delete"),
QIconSet(QImage(QucsSettings.BitmapDir + "editdelete.png")),
tr("&Delete"), Key_Delete, App);
Acts->editDelete->setStatusTip(tr("Deletes the selected components"));
Acts->editDelete->setWhatsThis(
tr("Delete\n\nDeletes the selected components"));
Acts->editDelete->setToggleAction(true);
connect(Acts->editDelete, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditDelete(bool)));
// to ease usage with notebooks, backspace can also be used to delete
mainAccel->connectItem(mainAccel->insertItem(Key_Backspace),
Acts->editDelete, SLOT(toggle()) );
@ -268,95 +283,104 @@ void QucsInit::initActions()
mainAccel->connectItem(mainAccel->insertItem(Key_Tab),
App, SLOT(slotNextTab()));
App->undo = new QAction(tr("Undo"), QIconSet(QImage(BITMAPDIR "undo.png")),
tr("&Undo"), CTRL+Key_Z, App);
App->undo =
new QAction(tr("Undo"),
QIconSet(QImage(QucsSettings.BitmapDir + "undo.png")),
tr("&Undo"), CTRL+Key_Z, App);
App->undo->setStatusTip(tr("Undoes the last command"));
App->undo->setWhatsThis(tr("Undo\n\nMakes the last action undone"));
connect(App->undo, SIGNAL(activated()), App, SLOT(slotEditUndo()));
App->redo = new QAction(tr("Redo"), QIconSet(QImage(BITMAPDIR "redo.png")),
tr("&Redo"), CTRL+Key_Y, App);
App->redo =
new QAction(tr("Redo"),
QIconSet(QImage(QucsSettings.BitmapDir + "redo.png")),
tr("&Redo"), CTRL+Key_Y, App);
App->redo->setStatusTip(tr("Redoes the last command"));
App->redo->setWhatsThis(tr("Redo\n\nRepeats the last action once more"));
connect(App->redo, SIGNAL(activated()), App, SLOT(slotEditRedo()));
App->projNew = new QAction(tr("New Project"), tr("&New Project..."),
0, App);
App->projNew = new QAction(tr("New Project"), tr("&New Project..."), 0, App);
App->projNew->setStatusTip(tr("Creates a new project"));
App->projNew->setWhatsThis(tr("New Project\n\nCreates a new project"));
connect(App->projNew, SIGNAL(activated()), App, SLOT(slotProjNewButt()));
App->projOpen = new QAction(tr("Open Project"), tr("&Open Project..."),
0, App);
App->projOpen =
new QAction(tr("Open Project"), tr("&Open Project..."), 0, App);
App->projOpen->setStatusTip(tr("Opens a project"));
App->projOpen->setWhatsThis(
tr("Open Project\n\nOpens an existing project"));
connect(App->projOpen, SIGNAL(activated()),
App, SLOT(slotMenuOpenProject()));
App->projDel = new QAction(tr("Delete Project"), tr("&Delete Project..."),
0, App);
App->projDel =
new QAction(tr("Delete Project"), tr("&Delete Project..."), 0, App);
App->projDel->setStatusTip(tr("Deletes a project"));
App->projDel->setWhatsThis(
tr("Delete Project\n\nDeletes an existing project"));
connect(App->projDel, SIGNAL(activated()), App, SLOT(slotMenuDelProject()));
App->projClose = new QAction(tr("Close Project"), tr("&Close Project"),
0, App);
App->projClose =
new QAction(tr("Close Project"), tr("&Close Project"), 0, App);
App->projClose->setStatusTip(tr("Close current project"));
App->projClose->setWhatsThis(
tr("Close Project\n\nCloses the current project"));
connect(App->projClose, SIGNAL(activated()),
App, SLOT(slotMenuCloseProject()));
App->magAll = new QAction(tr("View All"),
QIconSet(QImage(BITMAPDIR "viewmagfit.png")),
tr("View All"), 0, App);
App->magAll =
new QAction(tr("View All"),
QIconSet(QImage(QucsSettings.BitmapDir + "viewmagfit.png")),
tr("View All"), 0, App);
App->magAll->setStatusTip(tr("Views the whole page"));
App->magAll->setWhatsThis(tr("View All\n\nShows the whole page content"));
connect(App->magAll, SIGNAL(activated()), App, SLOT(slotShowAll()));
App->magOne = new QAction(tr("View 1:1"),
QIconSet(QImage(BITMAPDIR "viewmag1.png")),
tr("View 1:1"), Key_1, App);
App->magOne =
new QAction(tr("View 1:1"),
QIconSet(QImage(QucsSettings.BitmapDir + "viewmag1.png")),
tr("View 1:1"), Key_1, App);
App->magOne->setStatusTip(tr("Views without magnification"));
App->magOne->setWhatsThis(
tr("View 1:1\n\nShows the page content without magnification"));
connect(App->magOne, SIGNAL(activated()), App, SLOT(slotShowOne()));
Acts->magPlus = new QAction(tr("Zoom in"),
QIconSet(QImage(BITMAPDIR "viewmag+.png")),
tr("Zoom in"), Key_Plus, App);
Acts->magPlus =
new QAction(tr("Zoom in"),
QIconSet(QImage(QucsSettings.BitmapDir + "viewmag+.png")),
tr("Zoom in"), Key_Plus, App);
Acts->magPlus->setStatusTip(tr("Zooms into the current view"));
Acts->magPlus->setWhatsThis(tr("Zoom in\n\nZooms the current view"));
Acts->magPlus->setToggleAction(true);
connect(Acts->magPlus, SIGNAL(toggled(bool)), Acts, SLOT(slotZoomIn(bool)));
App->magMinus = new QAction(tr("Zoom out"),
QIconSet(QImage(BITMAPDIR "viewmag-.png")),
tr("Zoom out"), Key_Minus, App);
App->magMinus =
new QAction(tr("Zoom out"),
QIconSet(QImage(QucsSettings.BitmapDir + "viewmag-.png")),
tr("Zoom out"), Key_Minus, App);
App->magMinus->setStatusTip(tr("Zooms out the current view"));
App->magMinus->setWhatsThis(tr("Reduce\n\nZooms out the current view"));
connect(App->magMinus, SIGNAL(activated()), App, SLOT(slotZoomOut()));
Acts->select = new QAction(tr("Select"),
QIconSet(QImage(BITMAPDIR "pointer.png")),
tr("Select"), Key_Escape, App);
Acts->select =
new QAction(tr("Select"),
QIconSet(QImage(QucsSettings.BitmapDir + "pointer.png")),
tr("Select"), Key_Escape, App);
Acts->select->setStatusTip(tr("Select mode"));
Acts->select->setWhatsThis(tr("Select\n\nSelect mode"));
Acts->select->setToggleAction(true);
connect(Acts->select, SIGNAL(toggled(bool)), Acts, SLOT(slotSelect(bool)));
App->selectAll = new QAction(tr("Select All"), tr("Select All"),
CTRL+Key_A, App);
App->selectAll =
new QAction(tr("Select All"), tr("Select All"), CTRL+Key_A, App);
App->selectAll->setStatusTip(tr("Selects all elements"));
App->selectAll->setWhatsThis(
tr("Select All\n\nSelects all elements of the document"));
connect(App->selectAll, SIGNAL(activated()), App, SLOT(slotSelectAll()));
Acts->editRotate = new QAction(tr("Rotate"),
QIconSet(QImage(BITMAPDIR "rotate_ccw.png")),
tr("Rotate"), CTRL+Key_R, App);
Acts->editRotate =
new QAction(tr("Rotate"),
QIconSet(QImage(QucsSettings.BitmapDir + "rotate_ccw.png")),
tr("Rotate"), CTRL+Key_R, App);
Acts->editRotate->setStatusTip(tr("Rotates the selected component by 90°"));
Acts->editRotate->setWhatsThis(
tr("Rotate\n\nRotates the selected component by 90° counter-clockwise"));
@ -364,9 +388,10 @@ void QucsInit::initActions()
connect(Acts->editRotate, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditRotate(bool)));
Acts->editMirror = new QAction(tr("Mirror about X Axis"),
QIconSet(QImage(BITMAPDIR "mirror.png")),
tr("Mirror about X Axis"), CTRL+Key_J, App);
Acts->editMirror =
new QAction(tr("Mirror about X Axis"),
QIconSet(QImage(QucsSettings.BitmapDir + "mirror.png")),
tr("Mirror about X Axis"), CTRL+Key_J, App);
Acts->editMirror->setStatusTip(
tr("Mirrors the selected item about X axis"));
Acts->editMirror->setWhatsThis(
@ -375,9 +400,10 @@ void QucsInit::initActions()
connect(Acts->editMirror, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditMirrorX(bool)));
Acts->editMirrorY = new QAction(tr("Mirror about Y Axis"),
QIconSet(QImage(BITMAPDIR "mirrory.png")),
tr("Mirror about Y Axis"), CTRL+Key_M, App);
Acts->editMirrorY =
new QAction(tr("Mirror about Y Axis"),
QIconSet(QImage(QucsSettings.BitmapDir + "mirrory.png")),
tr("Mirror about Y Axis"), CTRL+Key_M, App);
Acts->editMirrorY->setStatusTip(
tr("Mirrors the selected item about Y axis"));
Acts->editMirrorY->setWhatsThis(
@ -386,27 +412,30 @@ void QucsInit::initActions()
connect(Acts->editMirrorY, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditMirrorY(bool)));
App->intoH = new QAction(tr("Go into Subcircuit"),
QIconSet(QImage(BITMAPDIR "bottom.png")),
tr("Go into Subcircuit"), CTRL+Key_I, App);
App->intoH =
new QAction(tr("Go into Subcircuit"),
QIconSet(QImage(QucsSettings.BitmapDir + "bottom.png")),
tr("Go into Subcircuit"), CTRL+Key_I, App);
App->intoH->setStatusTip(tr("Goes inside subcircuit"));
App->intoH->setWhatsThis(
tr("Go into Subcircuit\n\nGoes inside the selected subcircuit"));
connect(App->intoH, SIGNAL(activated()), App, SLOT(slotIntoHierarchy()));
// App->intoH->setEnabled(false);
App->popH = new QAction(tr("Pop out"),
QIconSet(QImage(BITMAPDIR "top.png")),
tr("Pop out"), CTRL+Key_H, App);
App->popH =
new QAction(tr("Pop out"),
QIconSet(QImage(QucsSettings.BitmapDir + "top.png")),
tr("Pop out"), CTRL+Key_H, App);
App->popH->setStatusTip(tr("Pop outside subcircuit"));
App->popH->setWhatsThis(
tr("Pop out\n\nGoes up one hierarchy level, i.e. leaves subcircuit"));
connect(App->popH, SIGNAL(activated()), App, SLOT(slotPopHierarchy()));
App->popH->setEnabled(false); // only enabled if useful !!!!
Acts->editActivate = new QAction(tr("Deactivate/Activate"),
QIconSet(QImage(BITMAPDIR "deactiv.png")),
tr("Deactivate/Activate"), CTRL+Key_D, App);
Acts->editActivate =
new QAction(tr("Deactivate/Activate"),
QIconSet(QImage(QucsSettings.BitmapDir + "deactiv.png")),
tr("Deactivate/Activate"), CTRL+Key_D, App);
Acts->editActivate->setStatusTip(
tr("Deactivate/Activate the selected item"));
Acts->editActivate->setWhatsThis(
@ -415,9 +444,10 @@ void QucsInit::initActions()
connect(Acts->editActivate, SIGNAL(toggled(bool)),
Acts, SLOT(slotEditActivate(bool)));
Acts->insEquation = new QAction(tr("Insert Equation"),
QIconSet(QImage(BITMAPDIR "equation.png")),
tr("Insert Equation"), 0, App);
Acts->insEquation =
new QAction(tr("Insert Equation"),
QIconSet(QImage(QucsSettings.BitmapDir + "equation.png")),
tr("Insert Equation"), 0, App);
Acts->insEquation->setStatusTip(tr("Inserts equation"));
Acts->insEquation->setWhatsThis(
tr("Insert Equation\n\nInserts a user defined equation"));
@ -425,9 +455,10 @@ void QucsInit::initActions()
connect(Acts->insEquation, SIGNAL(toggled(bool)),
Acts, SLOT(slotInsertEquation(bool)));
Acts->insGround = new QAction(tr("Insert Ground"),
QIconSet(QImage(BITMAPDIR "ground.png")),
tr("Insert Ground"), CTRL+Key_G, App);
Acts->insGround =
new QAction(tr("Insert Ground"),
QIconSet(QImage(QucsSettings.BitmapDir + "ground.png")),
tr("Insert Ground"), CTRL+Key_G, App);
Acts->insGround->setStatusTip(tr("Inserts ground"));
Acts->insGround->setWhatsThis(
tr("Insert Ground\n\nInserts a ground symbol"));
@ -435,27 +466,30 @@ void QucsInit::initActions()
connect(Acts->insGround, SIGNAL(toggled(bool)),
Acts, SLOT(slotInsertGround(bool)));
Acts->insPort = new QAction(tr("Insert Port"),
QIconSet(QImage(BITMAPDIR "port.png")),
tr("Insert Port"), 0, App);
Acts->insPort =
new QAction(tr("Insert Port"),
QIconSet(QImage(QucsSettings.BitmapDir + "port.png")),
tr("Insert Port"), 0, App);
Acts->insPort->setStatusTip(tr("Inserts port"));
Acts->insPort->setWhatsThis(tr("Insert Port\n\nInserts a port symbol"));
Acts->insPort->setToggleAction(true);
connect(Acts->insPort, SIGNAL(toggled(bool)),
Acts, SLOT(slotInsertPort(bool)));
Acts->insWire = new QAction(tr("Insert Wire"),
QIconSet(QImage(BITMAPDIR "wire.png")),
tr("Wire"), CTRL+Key_E, App);
Acts->insWire =
new QAction(tr("Insert Wire"),
QIconSet(QImage(QucsSettings.BitmapDir + "wire.png")),
tr("Wire"), CTRL+Key_E, App);
Acts->insWire->setStatusTip(tr("Inserts a wire"));
Acts->insWire->setWhatsThis(tr("Wire\n\nInserts a wire"));
Acts->insWire->setToggleAction(true);
connect(Acts->insWire, SIGNAL(toggled(bool)), Acts,
SLOT(slotSetWire(bool)));
Acts->insLabel = new QAction(tr("Insert Wire/Pin Label"),
QIconSet(QImage(BITMAPDIR "nodename.png")),
tr("Wire Label"), CTRL+Key_L, App);
Acts->insLabel =
new QAction(tr("Insert Wire/Pin Label"),
QIconSet(QImage(QucsSettings.BitmapDir + "nodename.png")),
tr("Wire Label"), CTRL+Key_L, App);
Acts->insLabel->setStatusTip(tr("Inserts a wire or pin label"));
Acts->insLabel->setWhatsThis(
tr("Wire Label\n\nInserts a wire or pin label"));
@ -463,26 +497,29 @@ void QucsInit::initActions()
connect(Acts->insLabel, SIGNAL(toggled(bool)),
Acts, SLOT(slotInsertLabel(bool)));
App->simulate = new QAction(tr("Simulate"),
QIconSet(QImage(BITMAPDIR "gear.png")),
tr("Simulate"), Key_F2, App);
App->simulate =
new QAction(tr("Simulate"),
QIconSet(QImage(QucsSettings.BitmapDir + "gear.png")),
tr("Simulate"), Key_F2, App);
App->simulate->setStatusTip(tr("Simulates the current schematic"));
App->simulate->setWhatsThis(
tr("Simulate\n\nSimulates the current schematic"));
connect(App->simulate, SIGNAL(activated()), App, SLOT(slotSimulate()));
App->dpl_sch = new QAction(tr("View Data Display/Schematic"),
QIconSet(QImage(BITMAPDIR "rebuild.png")),
tr("View Data Display/Schematic"), Key_F4, App);
App->dpl_sch =
new QAction(tr("View Data Display/Schematic"),
QIconSet(QImage(QucsSettings.BitmapDir + "rebuild.png")),
tr("View Data Display/Schematic"), Key_F4, App);
App->dpl_sch->setStatusTip(tr("Changes to data display or schematic page"));
App->dpl_sch->setWhatsThis(
tr("View Data Display/Schematic\n\n")+
tr("Changes to data display or schematic page"));
connect(App->dpl_sch, SIGNAL(activated()), App, SLOT(slotToPage()));
Acts->setMarker = new QAction(tr("Set Marker"),
QIconSet(QImage(BITMAPDIR "marker.png")),
tr("Set Marker on Graph"), CTRL+Key_B, App);
Acts->setMarker =
new QAction(tr("Set Marker"),
QIconSet(QImage(QucsSettings.BitmapDir + "marker.png")),
tr("Set Marker on Graph"), CTRL+Key_B, App);
Acts->setMarker->setStatusTip(tr("Sets a marker on a diagram's graph"));
Acts->setMarker->setWhatsThis(
tr("Set Marker\n\nSets a marker on a diagram's graph"));
@ -490,44 +527,46 @@ void QucsInit::initActions()
connect(Acts->setMarker, SIGNAL(toggled(bool)),
Acts, SLOT(slotSetMarker(bool)));
App->showMsg = new QAction(tr("Show Last Messages"),
tr("Show Last Messages"), Key_F5, App);
App->showMsg =
new QAction(tr("Show Last Messages"),
tr("Show Last Messages"), Key_F5, App);
App->showMsg->setStatusTip(tr("Shows last simulation messages"));
App->showMsg->setWhatsThis(
tr("Show Last Messages\n\nShows the messages of the last simulation"));
connect(App->showMsg, SIGNAL(activated()), App, SLOT(slotShowLastMsg()));
App->showNet = new QAction(tr("Show Last Netlist"), tr("Show Last Netlist"),
0, App);
App->showNet =
new QAction(tr("Show Last Netlist"), tr("Show Last Netlist"), 0, App);
App->showNet->setStatusTip(tr("Shows last simulation netlist"));
App->showNet->setWhatsThis(
tr("Show Last Netlist\n\nShows the netlist of the last simulation"));
connect(App->showNet, SIGNAL(activated()),
App, SLOT(slotShowLastNetlist()));
viewToolBar = new QAction(tr("Toolbar"), tr("Tool&bar"),
0, App, 0, true);
viewToolBar =
new QAction(tr("Toolbar"), tr("Tool&bar"), 0, App, 0, true);
viewToolBar->setStatusTip(tr("Enables/disables the toolbar"));
viewToolBar->setWhatsThis(tr("Toolbar\n\nEnables/disables the toolbar"));
connect(viewToolBar, SIGNAL(toggled(bool)),
this, SLOT(slotViewToolBar(bool)));
viewStatusBar = new QAction(tr("Statusbar"), tr("&Statusbar"),
0, App, 0, true);
viewStatusBar =
new QAction(tr("Statusbar"), tr("&Statusbar"), 0, App, 0, true);
viewStatusBar->setStatusTip(tr("Enables/disables the statusbar"));
viewStatusBar->setWhatsThis(
tr("Statusbar\n\nEnables/disables the statusbar"));
connect(viewStatusBar, SIGNAL(toggled(bool)),
this, SLOT(slotViewStatusBar(bool)));
App->helpIndex = new QAction(tr("Help Index"), tr("Help Index..."),
Key_F1, App);
App->helpIndex =
new QAction(tr("Help Index"), tr("Help Index..."), Key_F1, App);
App->helpIndex->setStatusTip(tr("Index of Qucs Help"));
App->helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help"));
connect(App->helpIndex, SIGNAL(activated()), App, SLOT(slotHelpIndex()));
App->helpGetStart = new QAction(tr("Getting Started"),
tr("Getting Started..."), 0, App);
App->helpGetStart =
new QAction(tr("Getting Started"),
tr("Getting Started..."), 0, App);
App->helpGetStart->setStatusTip(tr("Getting Started with Qucs"));
App->helpGetStart->setWhatsThis(
tr("Getting Started\n\nShort introduction into Qucs"));