2008-11-27 Stefan Jahn <stefan@lkcc.org>

* Makefile.am (mac-install-apps): Added post install scripts for
        MacOSX.

2008-11-27  Stefan Jahn  <stefan@lkcc.org>

        * dialogs/vtabbutton.cpp (drawButton): Adjusted code to work with
        MacOSX as well.  Thanks to Gopala.

        * bitmaps/Makefile.am (MACICONS): Added MacOSX icons.

        * main.cpp (main): Initial position is centered on the screen.
This commit is contained in:
ela 2008-11-27 18:28:12 +00:00
parent 86bbfe283b
commit f7822cb17e
17 changed files with 160 additions and 43 deletions

View File

@ -1,3 +1,8 @@
2008-11-27 Stefan Jahn <stefan@lkcc.org>
* Makefile.am (mac-install-apps): Added post install scripts for
MacOSX.
2008-09-25 Stefan Jahn <stefan@lkcc.org>
* contrib/ps2sp: Renamed ps2sp.pl into ps2sp in order to avoid

30
Info.plist Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>@exec@</string>
<key>CFBundleGetInfoString</key>
<string>Qucs @version@ by the Qucs team. This program is licensed under the GNU GPL.</string>
<key>CFBundleIconFile</key>
<string>application.icns</string>
<key>CFBundleIdentifier</key>
<string>org.qucs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>@name@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>Qucs @version@</string>
<key>CFBundleSignature</key>
<string>qucs</string>
<key>CFBundleVersion</key>
<string>@version@</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

View File

@ -4,7 +4,7 @@
#
# Automake input file.
#
# Copyright (C) 2004, 2005, 2006 Stefan Jahn <stefan@lkcc.org>
# Copyright (C) 2004, 2005, 2006, 2008 Stefan Jahn <stefan@lkcc.org>
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,7 +25,79 @@
SUBDIRS = qucs qucs-edit qucs-help qucs-transcalc qucs-filter qucs-lib \
qucs-attenuator contrib $(RELEASEDIRS)
EXTRA_DIST = autogen.sh depcomp PLATFORMS RELEASE
EXTRA_DIST = autogen.sh depcomp PLATFORMS RELEASE Info.plist
# MacOSX specific installation of applications
if COND_MACOSX
app_PROGS = $(top_builddir)/qucs/qucs \
$(top_builddir)/qucs-attenuator/qucsattenuator \
$(top_builddir)/qucs-filter/qucsfilter \
$(top_builddir)/qucs-help/qucshelp \
$(top_builddir)/qucs-lib/qucslib \
$(top_builddir)/qucs-edit/qucsedit \
$(top_builddir)/qucs-transcalc/qucstrans
install-exec-hook: mac-install-apps mac-install-framework
mac-install-apps:
@echo "Creating MacOSX applications...";
@list='$(app_PROGS)'; for file in $$list; do \
app=`basename $$file` && \
$(mkinstalldirs) $(bindir)/$$app.app/Contents && \
$(mkinstalldirs) $(bindir)/$$app.app/Contents/Resources && \
$(mkinstalldirs) $(bindir)/$$app.app/Contents/MacOS && \
$(install_sh_PROGRAM) $$file $(bindir)/$$app.app/Contents/MacOS/ && \
strip $(bindir)/$$app.app/Contents/MacOS/$$app && \
case $$app in \
qucs) desc="Qucs";; \
qucsattenuator) desc="Qucs Attenuator";; \
qucsfilter) desc="Qucs Filter";; \
qucshelp) desc="Qucs Help";; \
qucslib) desc="Qucs Library";; \
qucsedit) desc="Qucs Editor";; \
qucstrans) desc="Qucs Transcalc";; \
esac && \
cat $(srcdir)/Info.plist | \
sed -e "s/@version@/$(PACKAGE_VERSION)/g" | \
sed -e "s/@name@/$$desc/g" | \
sed -e "s/@exec@/$$app/g" > \
$(bindir)/$$app.app/Contents/Info.plist && \
$(install_sh_DATA) $(srcdir)/qucs/bitmaps/$$app.icns \
$(bindir)/$$app.app/Contents/Resources/application.icns && \
echo "#!/bin/sh\n$(bindir)/$$app.app/Contents/MacOS/$$app \$$*\n" > \
$(bindir)/$$app && \
chmod +x $(bindir)/$$app; \
done
mac-install-framework:
@echo "Copying and setting up MacOSX/Qt framework...";
@if test -e "$(QTDIR)/lib/libqt.3.dylib"; then \
qtlib="$(QTDIR)/lib/libqt.3.dylib"; fi && \
if test -e "$(QTDIR)/lib/libqt-mt.3.dylib"; then \
qtlib="$(QTDIR)/lib/libqt-mt.3.dylib"; fi && \
if ! test -z "$$qtlib"; then \
$(mkinstalldirs) "$(bindir)/qucs.app/Contents/Frameworks"; \
cp "$$qtlib" "$(bindir)/qucs.app/Contents/Frameworks/"; \
qtlib=`basename $$qtlib`; \
install_name_tool -id "@executable_path/../Frameworks/$$qtlib" \
"$(bindir)/qucs.app/Contents/Frameworks/$$qtlib"; \
list='$(app_PROGS)'; for file in $$list; do \
app=`basename $$file` && \
install_name_tool -change $$qtlib \
"@executable_path/../../../qucs.app/Contents/Frameworks/$$qtlib" \
"$(bindir)/$$app.app/Contents/MacOS/$$app"; \
done; \
fi
uninstall-hook:
@list='$(app_PROGS)'; for file in $$list; do \
app=`basename $$file` && \
rm -rf $(bindir)/$$app.app; \
done
else
install-exec-hook:
uninstall-hook:
endif
CLEANFILES = *~ *.rej *.orig
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \

View File

@ -58,6 +58,13 @@ case $host_os in
esac
AM_CONDITIONAL(COND_WIN32, test x$WIN32 = xyes)
dnl Check for MacOSX.
case $host_os in
*darwin*) MACOSX=yes ;;
*) MACOSX=no ;;
esac
AM_CONDITIONAL(COND_MACOSX, test x$MACOSX = xyes)
dnl Yet another compiler check.
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -pipe"

View File

@ -1,3 +1,12 @@
2008-11-27 Stefan Jahn <stefan@lkcc.org>
* dialogs/vtabbutton.cpp (drawButton): Adjusted code to work with
MacOSX as well. Thanks to Gopala.
* bitmaps/Makefile.am (MACICONS): Added MacOSX icons.
* main.cpp (main): Initial position is centered on the screen.
2008-11-05 Stefan Jahn <stefan@lkcc.org>
* schematic_file.cpp (createSubNetlistPlain): Fixed netlist bug

View File

@ -61,11 +61,15 @@ PNGS = fileopen.png filesave.png editdelete.png editcut.png editcopy.png \
# application pictures
ICONS = big.button.qucs.xpm big.qucs.xpm tiny.button.qucs.xpm tiny.qucs.xpm
EXTRA_DIST = $(XPMS) $(PNGS) $(ICONS)
# application pictures
MACICONS = qucs.icns qucsattenuator.icns qucsfilter.icns qucshelp.icns \
qucslib.icns qucsedit.icns qucstrans.icns
EXTRA_DIST = $(XPMS) $(PNGS) $(ICONS) $(MACICONS)
# installation of pictures
picdatadir = ${prefix}/share/qucs/bitmaps
picdata_DATA = $(EXTRA_DIST)
picdata_DATA = $(XPMS) $(PNGS) $(ICONS)
CLEANFILES = *~
MAINTAINERCLEANFILES = Makefile.in

BIN
qucs/bitmaps/qucs.icns Normal file

Binary file not shown.

Binary file not shown.

BIN
qucs/bitmaps/qucsedit.icns Normal file

Binary file not shown.

Binary file not shown.

BIN
qucs/bitmaps/qucshelp.icns Normal file

Binary file not shown.

BIN
qucs/bitmaps/qucslib.icns Normal file

Binary file not shown.

BIN
qucs/bitmaps/qucstrans.icns Normal file

Binary file not shown.

View File

@ -27,7 +27,7 @@ VTabBar::VTabBar(VTabPosition p,QWidget* parent, const char* name): QWidget(pare
{
m_position = p;
m_layout = new QVBoxLayout(this);
m_layout->addStretch(800); //HACK to avoid spaces b/w buttons
m_layout->addStretch(800); //HACK to avoid spaces b/w buttons
m_index = 0;
m_tabsOff = true;
m_tabs.setAutoDelete( false );
@ -59,7 +59,7 @@ VTab* VTabBar::findTab(int _id)
}
return 0l;
}
void VTabBar::setTabToolTip(VTab *tab,const QString &tip)
{
QToolTip::add(tab,tip);
@ -155,19 +155,6 @@ void VTabBar::switchOffAllTabs()
emit allTabsOff();
}
QSize VTabBar::sizeHint()
{
VTab * c = m_tabs.first();
const int width = c->sizeHint().width();
int height = 350;
for ( ; c; c = m_tabs.next() )
{
height += c->sizeHint().height();
}
return QSize(width,height);
}
void VTabBar::setPosition(VTabPosition p_pos)
{
if(m_position == p_pos)

View File

@ -39,17 +39,16 @@ public:
virtual ~VTabBar();
VTab* addTab(const QString& caption,int id = -1);
virtual QSize sizeHint();
VTab* findTab(int id);
void setTabToolTip(VTab *tab,const QString &tip);
void setTabToolTip(int id,const QString &tip);
void removeTab(VTab *tab);
void removeTab(int id);
bool isAllTabsOff();
public slots:
void setCurrentTab(VTab *tab);
void setCurrentTab(int id);
void setPosition(VTabPosition p_pos);
@ -59,7 +58,7 @@ signals:
void activatedTab(int p_id);
void activatedTab(VTab *tab);
void allTabsOff();
private slots:
void setTabState(int p_id,bool state);

View File

@ -72,27 +72,26 @@ QSize VTab::sizeHint() const
void VTab::drawButton(QPainter *p)
{
const QSize& sz = sizeHint();
QPixmap pm(sz.height(),sz.width());
pm.fill(eraseColor());
QPainter pa(&pm);
p->save();
QStyle::SFlags st = QStyle::Style_Default | QStyle::Style_Enabled;
if (isOn())
st|=QStyle::Style_On;
style().drawControl(QStyle::CE_PushButton,&pa,this, QRect(0,0,pm.width(),pm.height()), colorGroup(),st);
style().drawControl(QStyle::CE_PushButtonLabel,&pa,this, QRect(0,0,pm.width(),pm.height()), colorGroup(),st);
pa.end();
QRect r(0, 0, height(), width());
const double x = width()/2;
const double y = height()/2;
p->translate(x,y);
if(m_position == TabLeft)
if (m_position == TabLeft) {
p->translate(0, height());
p->rotate(-90);
else
}
else {
p->translate(width(), 0);
p->rotate(90);
p->translate(-y,-x);
p->drawPixmap(0,0,pm);
}
style().drawControl(QStyle::CE_PushButton, p, this, r, colorGroup(), st);
style().drawControl(QStyle::CE_PushButtonLabel, p, this, r, colorGroup(), st);
p->restore();
}
void VTab::setText(const QString &s)

View File

@ -472,15 +472,21 @@ bool checkVersion(QString& Line)
int main(int argc, char *argv[])
{
// 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.maxUndo = 20;
QucsSettings.NodeWiring = 0;
// initially center the application
QApplication a(argc, argv);
QDesktopWidget *d = a.desktop();
int w = d->width();
int h = d->height();
QucsSettings.x = w/8;
QucsSettings.y = h/8;
QucsSettings.dx = w*3/4;
QucsSettings.dy = h*3/4;
// is application relocated?
char * var = getenv ("QUCSDIR");
if (var != NULL) {
@ -535,7 +541,6 @@ int main(int argc, char *argv[])
QucsSettings.AscoDir = "";
}
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );