Add Downloads to Browser
This commit is contained in:
parent
424cfa6131
commit
dbff7a46d6
3 changed files with 65 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <shlobj.h>
|
||||
|
@ -77,6 +78,14 @@ TFilePath getDesktopPath() {
|
|||
return TFilePath(dir.absolutePath().toStdString());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Downloads Path
|
||||
TFilePath getDownloadsPath() {
|
||||
QStringList stdLocs =
|
||||
QStandardPaths::standardLocations(QStandardPaths::DownloadLocation);
|
||||
if (stdLocs.isEmpty()) return TFilePath();
|
||||
return TFilePath(stdLocs[0]);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//=============================================================================
|
||||
|
@ -1121,6 +1130,13 @@ void DvDirModelRootNode::refreshChildren() {
|
|||
m_specialNodes.push_back(child);
|
||||
addChild(child);
|
||||
|
||||
child = new DvDirModelSpecialFileFolderNode(this, L"Downloads",
|
||||
getDownloadsPath());
|
||||
child->setPixmap(recolorPixmap(
|
||||
svgToPixmap(getIconThemePath("actions/16/downloads.svg"))));
|
||||
m_specialNodes.push_back(child);
|
||||
addChild(child);
|
||||
|
||||
DvDirModelStuffFolderNode *childstuff = new DvDirModelStuffFolderNode(this);
|
||||
for (int i = 0; i < childstuff->getChildCount(); i++) {
|
||||
DvDirModelSpecialFileFolderNode *node =
|
||||
|
|
48
toonz/sources/toonz/icons/dark/actions/16/downloads.svg
Normal file
48
toonz/sources/toonz/icons/dark/actions/16/downloads.svg
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="16px"
|
||||
height="16px"
|
||||
version="1.1"
|
||||
xml:space="preserve"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
|
||||
id="svg10"
|
||||
sodipodi:docname="downloads.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
|
||||
id="metadata16"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs14" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1776"
|
||||
inkscape:window-height="924"
|
||||
id="namedview12"
|
||||
showgrid="true"
|
||||
inkscape:zoom="45.6875"
|
||||
inkscape:cx="4.3009576"
|
||||
inkscape:cy="8.1071639"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg10"><inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid823" /></sodipodi:namedview>
|
||||
|
||||
|
||||
<path
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.25;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 5 1 L 5 9 L 1 9 L 8 15 L 15 9 L 11 9 L 11 1 L 5 1 z M 6 2 L 10 2 L 10 10 L 12.240234 10 L 8 13.496094 L 3.7382812 10 L 6 10 L 6 2 z "
|
||||
id="rect815" /></svg>
|
After Width: | Height: | Size: 1.8 KiB |
|
@ -55,6 +55,7 @@
|
|||
|
||||
<file>icons/dark/actions/16/tahoma2d.svg</file>
|
||||
<file>icons/dark/actions/16/plugins.svg</file>
|
||||
<file>icons/dark/actions/16/downloads.svg</file>
|
||||
|
||||
<!-- File / Common -->
|
||||
<file>icons/dark/actions/16/menu.svg</file>
|
||||
|
|
Loading…
Reference in a new issue