[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Project View to the Arduino IDE #11048

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Removed unnecessary Project View Sprite Images
  • Loading branch information
samigamer1999 committed Dec 9, 2020
commit 340fa2067ee04ff9286ff91b63eba8ba4b011ee4
The diff you're trying to view is too large. We only load the first 3000 changed files.
70 changes: 0 additions & 70 deletions app/src/processing/app/EditorProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,6 @@ public EditorProject(String path, Base base, Editor editor){
this.editor = editor;
fileExplorerPanel = new ProjectExplorer(fileRoot, editor);
projectToolbar = new ProjectToolbar(editor, this);
/*buttons_popup = new Label("Toggle Project View");
buttons_popup.setForeground(new Color(23, 161, 165));
buttons_popup.setBackground(new Color(23, 161, 165));
settingsbox = new JPanel();
settingsbox.setLayout(new BoxLayout(settingsbox, BoxLayout.LINE_AXIS));
settingsbox.setOpaque(true);
settingsbox.setBackground(new Color(23, 161, 165));
this.path = path;
Icon img = new ImageIcon(new ImageIcon("folder1.jpg").getImage().getScaledInstance(35, 30, Image.SCALE_DEFAULT));
settings = new JButton(img);

settings.setPreferredSize(new Dimension(25, 5));
settings.addActionListener(this);
settings.addMouseListener(this);
toggle = new JButton("T");
toggle.addActionListener(this);
toggle.addMouseListener(this);
//this.add(settings);
//settingsbox.add(new Label("Project View"));
JPanel buttons_panel = new JPanel();
buttons_panel.setLayout(new FlowLayout());
buttons_panel.setOpaque(false);
//settingsbox.setBackground(Color.WHITE);
settingsbox.add(settings);
settingsbox.add(toggle);
settingsbox.add(buttons_popup);
//settingsbox.add(Box.createHorizontalGlue());
//settingsbox.add(buttons_panel);
this.add(settingsbox, BorderLayout.NORTH);*/
this.add(projectToolbar, BorderLayout.NORTH);
this.add(fileExplorerPanel);

Expand All @@ -76,52 +47,11 @@ public void resetProject(File file){
path = file.getPath();
fileExplorerPanel.replaceWorkingDirectory(fileRoot);

// Resetting the sketchbook path
//PreferencesData.set("sketchbook.path", path);


editor.statusNotice(tr("Navigated to :")+path);
}


public void handleNavigate(){
/*chooser = new JFileChooser();
chooser.setCurrentDirectory(fileRoot);
chooser.setDialogTitle("Choose project directory : ");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
resetProject(chooser.getSelectedFile());
}
/*JDialog jDialog = new JDialog();
JTextField pathfield = new JTextField();
jDialog.setPreferredSize(new Dimension(400,400));
jDialog.setTitle("Choose the directory to navigate to :");
JPanel panel = new JPanel(new BorderLayout());
panel.add(pathfield, BorderLayout.NORTH);
JExplorerPanel navigator = new JExplorerPanel(new File("/home/sami"), editor);
panel.add(navigator, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel();
JButton open = new JButton("Open");
buttonPanel.add(open);
open.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
JButton cancel = new JButton("Cancel");
buttonPanel.add(cancel);
open.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jDialog.dispose();
}
});
panel.add(buttonPanel, BorderLayout.SOUTH);
jDialog.add(panel);
jDialog.pack();
jDialog.setLocationRelativeTo(null);
jDialog.setVisible(true);*/
if(!navigating) {
navigateDialog = new NavigateDialog(new File(System.getProperty("user.home")), fileRoot, this);
navigating = true;
Expand Down
4 changes: 2 additions & 2 deletions app/src/processing/app/ProjectToolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void run() {
}

private void loadButtons() {
Image allButtons = Theme.getThemeImage("projectButtons", this,
Image allButtons = Theme.getThemeImage("projectbuttons", this,
BUTTON_IMAGE_SIZE * BUTTON_COUNT,
BUTTON_IMAGE_SIZE * 3);
buttonImages = new Image[BUTTON_COUNT][3];
Expand All @@ -201,7 +201,7 @@ private void loadButtons() {
}

private void loadTouchBarImages() {
Image allButtonsRetina = Theme.getThemeImage("projectButtons", this,
Image allButtonsRetina = Theme.getThemeImage("projectbuttons", this,
BUTTON_IMAGE_SIZE * BUTTON_COUNT * 2,
BUTTON_IMAGE_SIZE * 3 * 2);
touchBarImages = new com.thizzer.jtouchbar.common.Image[BUTTON_COUNT][3];
Expand Down
36 changes: 36 additions & 0 deletions build/linux/arduino-1.8.14/arduino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"

for LIB in \
"$APPDIR"/java/lib/rt.jar \
"$APPDIR"/java/lib/tools.jar \
"$APPDIR"/lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH

LD_LIBRARY_PATH=$APPDIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

export PATH="${APPDIR}/java/bin:${PATH}"

export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`

JAVA=java
if [ -x "$APPDIR/java/bin/java" ]; then
JAVA=$APPDIR/java/bin/java
fi

# Collect options to java in an array, to properly handle whitespace in options
JAVA_OPTIONS=("-DAPP_DIR=$APPDIR")

# Only show the splash screen when no options are present
if [[ "$@" != *"--"* ]] ; then
JAVA_OPTIONS+=("-splash:$APPDIR/lib/splash.png")
fi

"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"

Binary file added build/linux/arduino-1.8.14/arduino-builder
Binary file not shown.
249 changes: 249 additions & 0 deletions build/linux/arduino-1.8.14/arduino-linux-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
#!/bin/bash
# arduino-linux-setup.sh : A simple Arduino setup script for Linux systems
# Copyright (C) 2015 Arduino Srl
#
# Author : Arturo Rinaldi
# E-mail : arty.net2@gmail.com
# Project URL : https://github.com/artynet/arduino-linux-setup
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
# Release v10 changelog :
#
# + Adding support for Slackware
# + Changed distribution not supported message
# + Changed distribution check sort order (thanks to thenktor @github.com)
# + Small fix for ArchLinux
#
# Release v9 changelog :
#
# + Adding support for ArchLinux
# + Adding support for systemd
# + Fixing a couple of wrong kernel entries
#
# Release v8 changelog :
#
# + rules are now created in /tmp folder
#
# Release v7 changelog :
#
# + Adding project URL
# + minor bugfixing
#
# Release v6 changelog :
#
# + removing sudocheck function and control
#
# Release v5 changelog :
#
# + adding UDEV rule for stm32 DFU mode
#
# Release v4 changelog :
#
# + The rules are generated in a temporary folder
#
# + the user should run it without sudo while having its permissions
#
# Release v3 changelog :
#
# + The most common linux distros are now fully supported
#
# + now the script checks for SUDO permissions
#

# if [[ $EUID != 0 ]] ; then
# echo This must be run as root!
# exit 1
# fi

refreshudev () {

echo ""
echo "Restarting udev"
echo ""

sudo udevadm control --reload-rules
sudo udevadm trigger

if [ -d /lib/systemd/ ]
then
sudo systemctl restart systemd-udevd
else
sudo service udev restart
fi

}

groupsfunc () {

echo ""
echo "******* Add User to dialout,tty, uucp, plugdev groups *******"
echo ""

sudo groupadd plugdev
sudo groupadd dialout
sudo usermod -a -G tty $1
sudo usermod -a -G dialout $1
sudo usermod -a -G uucp $1
sudo usermod -a -G plugdev $1

}

acmrules () {

echo ""
echo "# Setting serial port rules"
echo ""

cat <<EOF
KERNEL=="ttyUSB[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1"
KERNEL=="ttyACM[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="$1"
EOF

}

openocdrules () {

echo ""
echo "# Adding Arduino M0/M0 Pro, Primo UDEV Rules for CMSIS-DAP port"
echo ""

cat <<EOF
ACTION!="add|change", GOTO="openocd_rules_end"
SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"

#Please keep this list sorted by VID:PID

#CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"

LABEL="openocd_rules_end"
EOF

}

avrisprules () {

echo ""
echo "# Adding AVRisp UDEV rules"
echo ""

cat <<EOF
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avrisp_end"
# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="660", GROUP="dialout"

LABEL="avrisp_end"
EOF

}

dfustm32rules () {

echo ""
echo "# Adding STM32 bootloader mode UDEV rules"
echo ""

cat <<EOF
# Example udev rules (usually placed in /etc/udev/rules.d)
# Makes STM32 DfuSe device writeable for the "plugdev" group

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev", TAG+="uaccess"
EOF

}

dfuarduino101rules (){

echo ""
echo "# Arduino 101 in DFU Mode"
echo ""

cat <<EOF
SUBSYSTEM=="tty", ENV{ID_REVISION}=="8087", ENV{ID_MODEL_ID}=="0ab6", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_CANDIDATE}="0"
SUBSYSTEM=="usb", ATTR{idVendor}=="8087", ATTR{idProduct}=="0aba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF

}

removemm () {

echo ""
echo "******* Removing modem manager *******"
echo ""

if [ -f /etc/SuSE-release ]
then
#Only for Suse
sudo zypper remove modemmanager
elif [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ]
then
#Only for Red Hat/Fedora/CentOS
sudo yum remove modemmanager
elif [ -f /etc/arch-release ]
then
#Only for ArchLinux
sudo pacman -Rdd modemmanager
elif [ -f /etc/slackware-version ]
then
#Only for Slackware
sudo removepkg ModemManager
elif [ -f /etc/lsb-release ] || [ -f /etc/debian_version ] || [ -f /etc/linuxmint/info ]
then
#Only for Ubuntu/Mint/Debian
sudo apt-get -y remove modemmanager
else
echo ""
echo "Your system is not supported, please remove the ModemManager package with your package manager!"
echo ""
fi

}


if [ "$1" = "" ]
then
echo ""
echo "Run the script with command ./arduino-linux-setup.sh \$USER"
echo ""
else

[ `whoami` != $1 ] && echo "" && echo "The user name is not the right one, please double-check it !" && echo "" && exit 1

groupsfunc $1

removemm

acmrules $1 > /tmp/90-extraacl.rules

openocdrules > /tmp/98-openocd.rules

avrisprules > /tmp/avrisp.rules

dfustm32rules > /tmp/40-dfuse.rules

dfuarduino101rules > /tmp/99-arduino-101.rules

sudo mv /tmp/*.rules /etc/udev/rules.d/

refreshudev

echo ""
echo "*********** Please Reboot your system ************"
echo ""
fi
Loading