Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from pvanek/master

build for mac improvements and terminal plugin updates
  • Loading branch information...
commit 31198504ebd7b6a36e81310ce758e20e28b49c2d 2 parents 268134a + 207872e
Mezomish authored
62 CMakeLists.txt
View
@@ -7,10 +7,14 @@
# cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr (or whatever prefix you'd like)
# make
+# make install
+#
+# mac os x notes:
+# juffed.app is build by default. There are some additions to steps above.
+# "make install" is required to get plugins working
+# "make bundle" an optional make target to build bundle with all dependencies inside
+#
-option ( BUILD_PLUGINS "Build plugins from the externally linked SVN" ON )
-option ( APPLEBUNDLE "Build juffed as a Mac OS X bundle" OFF )
-option ( APPLEBUNDLE_STANDALONE "Pack APPLEBUNDLE with all its dependencies (libs)" OFF )
project (juffed)
cmake_minimum_required (VERSION 2.6.0)
@@ -147,7 +151,7 @@ target_link_libraries ( ${QSCI_ENGINE}
${QSCINTILLA_LIBRARY}
)
-if (APPLEBUNDLE)
+if (APPLE)
message ( STATUS "Building as an apple bundle" )
set ( APPLE_PREFIX "${CMAKE_INSTALL_PREFIX}/${JUFFED}.app/Contents" )
@@ -168,7 +172,7 @@ if (APPLEBUNDLE)
# this is a must to load the lib correctly
set_target_properties( ${JUFFLIB} PROPERTIES INSTALL_NAME_DIR "@executable_path/../MacOS" )
set_target_properties( ${QSCI_ENGINE} PROPERTIES INSTALL_NAME_DIR "@executable_path/../MacOS" )
-else (APPLEBUNDLE)
+else (APPLE)
set(GUI_TYPE "")
set(APPLE_BUNDLE_SOURCES "")
# now we want to use soversion etc.
@@ -181,7 +185,7 @@ else (APPLEBUNDLE)
set_target_properties( ${JUFFLIB} PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR} )
set_target_properties( ${QSCI_ENGINE} PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR} )
endif (NOT APPLE)
-endif (APPLEBUNDLE)
+endif (APPLE)
if ( MINGW )
add_definitions(
@@ -225,26 +229,22 @@ if ( UNIX )
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wextra")
endif ( UNIX )
-if (BUILD_PLUGINS AND EXISTS ${CMAKE_SOURCE_DIR}/plugins)
- message(STATUS "Plugins: all externally linked cmake-ready plugs will be built")
- set(JUFFED_CMAKE_PLUGINS 1)
- if (UNIX)
- set(JUFFED_PLUGINS_DIR ${LIB_INSTALL_DIR}/juffed/plugins)
- endif (UNIX)
- if (APPLEBUNDLE)
- set(JUFFED_PLUGINS_DIR ${APPLE_PREFIX}/plugins)
- endif (APPLEBUNDLE)
- if (WIN32)
- set(JUFFED_PLUGINS_DIR ${CMAKE_INSTALL_PREFIX}/plugins)
- endif(WIN32)
- message(STATUS "Plugins: location = ${JUFFED_PLUGINS_DIR}")
- # dive into external SVN link
- set(JUFFED_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
- set(JUFFED_LIBRARY ${JUFFLIB})
- add_subdirectory(plugins)
-else ()
- message(STATUS "Plugins: externally linked plugins will not be built")
-endif ()
+#
+# plugins
+message(STATUS "Plugins: all externally linked cmake-ready plugs will be built")
+set(JUFFED_CMAKE_PLUGINS 1)
+if (UNIX)
+ set(JUFFED_PLUGINS_DIR ${LIB_INSTALL_DIR}/juffed/plugins)
+endif (UNIX)
+if (APPLE)
+ set(JUFFED_PLUGINS_DIR ${APPLE_PREFIX}/plugins)
+endif (APPLE)
+if (WIN32)
+ set(JUFFED_PLUGINS_DIR ${CMAKE_INSTALL_PREFIX}/plugins)
+endif(WIN32)
+set(JUFFED_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
+set(JUFFED_LIBRARY ${JUFFLIB})
+add_subdirectory(plugins)
#set ( juffed_RCS
# src/app/juffed.rc
@@ -261,7 +261,7 @@ endif ()
####################
# Installs
####################
-if (NOT APPLEBUNDLE)
+if (NOT APPLE)
install ( TARGETS ${JUFFED} DESTINATION ${BIN_INSTALL_DIR} )
install ( TARGETS ${JUFFLIB} DESTINATION ${LIB_INSTALL_DIR} )
@@ -277,7 +277,7 @@ if (NOT APPLEBUNDLE)
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY )
add_custom_target ( uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-else (NOT APPLEBUNDLE)
+else (NOT APPLE)
install(CODE "message(STATUS \"Cleaning previously installed bundle (rm -r)\")")
install(CODE "execute_process(COMMAND rm -r ${CMAKE_INSTALL_PREFIX}/${JUFFED}.app)")
@@ -293,9 +293,11 @@ else (NOT APPLEBUNDLE)
# helper stuff to create real apple bundle.
# Black magic is summoned here...
- add_subdirectory( macosx )
+ # create a "transportable" bundle - all libs into the bundle: "make bundle" after make install
+ configure_file(macosx/bundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake @ONLY)
+ add_custom_target(bundle ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake)
-endif (NOT APPLEBUNDLE)
+endif (NOT APPLE)
# make dist custom target
4 macosx/CMakeLists.txt
View
@@ -1,4 +0,0 @@
-if (APPLEBUNDLE_STANDALONE)
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake @ONLY)
- install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/bundle.cmake)
-endif (APPLEBUNDLE_STANDALONE)
12 macosx/bundle.cmake.in
View
@@ -48,13 +48,13 @@ fixup_bundle(@CMAKE_INSTALL_PREFIX@/@JUFFED@.app "${inplugs}" @CMAKE_INSTALL_PRE
# FIXUP_BUNDLE copies it into MacOS dir. But we need it in plugins *tree*,
# not a flat dir.
-foreach (item IN LISTS inplugs)
+#foreach (item IN LISTS inplugs)
#message(STATUS "IN: ${item}")
- get_filename_component(fname ${item} NAME)
- message(STATUS "Moving ${fname} back to plugins tree: ${item}")
+# get_filename_component(fname ${item} NAME)
+# message(STATUS "Moving ${fname} back to plugins tree: ${item}")
#message(STATUS " ${fname}")
#message(STATUS " src: @CMAKE_INSTALL_PREFIX@/@JUFFED@.app/Contents/MacOS/${fname}")
#message(STATUS " tgt: ${item}")
- execute_process(COMMAND mv @CMAKE_INSTALL_PREFIX@/@JUFFED@.app/Contents/MacOS/${fname} ${item})
-endforeach()
-
+# execute_process(COMMAND mv @CMAKE_INSTALL_PREFIX@/@JUFFED@.app/Contents/MacOS/${fname} ${item})
+#endforeach()
+
13 macosx/strip_bundle.sh
View
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+#
+# Usage: strip_bundle.sh path/to/directory arch-to-keep
+# Example: strip_bundle.sh ./release/TOra.app x86_64
+# will provide x86_64 only content of the MacOS directory in the same place
+#
+
+echo "Generating new single-architecture bundle for arch: $2"
+echo "Into: $1.$2 (rename required)"
+
+ditto --rsrc --arch $2 $1 $1.$2
+
37 plugins/terminal/terminal/TerminalPlugin.cpp
View
@@ -10,23 +10,22 @@
#include "qtermwidget.h"
-Preferences::Preferences(QTermWidget * term, const QObject * parent,
- int colorIX, const QString & emulation,
- const QFont & font)
+
+Preferences::Preferences(const QObject *parent,
+ const QString &color,
+ const QString &emulation,
+ const QFont &font)
: QWidget()
{
setupUi(this);
- QStringList colorSchemes;
- colorSchemes << "White On Black" << \
- "Green On Black" << \
- "Black On Light Yellow";
- colorSchemaCombo->addItems(colorSchemes);
- colorSchemaCombo->setCurrentIndex(colorIX);
- connect(colorSchemaCombo, SIGNAL(currentIndexChanged(int)),
- parent, SLOT(colorSchemaChanged(int)));
+ colorSchemaCombo->addItems(QTermWidget::availableColorSchemes());
+ int cix = colorSchemaCombo->findText(color);
+ colorSchemaCombo->setCurrentIndex(cix != -1 ? cix : 0);
+ connect(colorSchemaCombo, SIGNAL(currentIndexChanged(const QString&)),
+ parent, SLOT(colorSchemaChanged(const QString &)));
-// emulationComboBox->addItems(term->availableKeyBindings());
+ emulationComboBox->addItems(QTermWidget::availableKeyBindings());
int eix = emulationComboBox->findText(emulation);
emulationComboBox->setCurrentIndex(eix != -1 ? eix : 0 );
connect(emulationComboBox, SIGNAL(currentIndexChanged(const QString&)),
@@ -43,7 +42,6 @@ Preferences::Preferences(QTermWidget * term, const QObject * parent,
TerminalPlugin::TerminalPlugin() : QObject(), JuffPlugin() {
-// w_ = new QWidget();
w_ = new QTermWidget();
w_->setScrollBarPosition(QTermWidget::ScrollBarRight);
w_->setWindowTitle(tr("Terminal"));
@@ -58,11 +56,11 @@ void TerminalPlugin::init()
{
prefFont.fromString(PluginSettings::getString(this, "TerminalFont"));
prefFontSize = prefFont.pointSize();
- prefColorScheme = PluginSettings::getInt(this, "TerminalColorScheme");
+ prefColorScheme = PluginSettings::getString(this, "TerminalColorScheme");
prefEmulation = PluginSettings::getString(this, "TerminalEmulation");
w_->setColorScheme(prefColorScheme);
w_->setTerminalFont(prefFont);
-// w_->setKeyBindings(prefEmulation);
+ w_->setKeyBindings(prefEmulation);
}
TerminalPlugin::~TerminalPlugin() {
@@ -98,7 +96,7 @@ Juff::ActionList TerminalPlugin::mainMenuActions(Juff::MenuID id) const
QWidget * TerminalPlugin::settingsPage() const
{
- return new Preferences(w_, this, prefColorScheme, prefEmulation, prefFont);
+ return new Preferences(this, prefColorScheme, prefEmulation, prefFont);
}
void TerminalPlugin::applySettings()
@@ -109,12 +107,12 @@ void TerminalPlugin::applySettings()
PluginSettings::set(this, "TerminalColorScheme", prefColorScheme);
w_->setColorScheme(prefColorScheme);
w_->setTerminalFont(prefFont);
-// w_->setKeyBindings(prefEmulation);
+ w_->setKeyBindings(prefEmulation);
}
-void TerminalPlugin::colorSchemaChanged(int val)
+void TerminalPlugin::colorSchemaChanged(const QString & val)
{
- prefColorScheme = val + 1;
+ prefColorScheme = val;
}
void TerminalPlugin::emulationChanged(const QString & val)
@@ -153,3 +151,4 @@ void TerminalPlugin::showTerminal()
}
Q_EXPORT_PLUGIN2(terminal, TerminalPlugin)
+
14 plugins/terminal/terminal/TerminalPlugin.h
View
@@ -23,8 +23,9 @@ class Preferences : public QWidget, Ui::Preferences
Q_OBJECT
public:
- Preferences(QTermWidget * term, const QObject * parent,
- int colorIX, const QString & emulation,
+ Preferences(const QObject * parent,
+ const QString &color,
+ const QString & emulation,
const QFont & font);
};
@@ -48,9 +49,9 @@ Q_INTERFACES(JuffPlugin)
void applySettings();
public slots:
- void colorSchemaChanged(int val);
- void emulationChanged(const QString & val);
- void fontChanged(const QFont & val);
+ void colorSchemaChanged(const QString &val);
+ void emulationChanged(const QString &val);
+ void fontChanged(const QFont &val);
void fontSizeChanged(int val);
private slots:
@@ -61,7 +62,7 @@ private slots:
QAction* termAct_;
QTermWidget * m_term;
- int prefColorScheme;
+ QString prefColorScheme;
QString prefEmulation;
QFont prefFont;
int prefFontSize;
@@ -70,3 +71,4 @@ private slots:
};
#endif
+
Please sign in to comment.
Something went wrong with that request. Please try again.