[aseprite] 56/250: Add "Open Folder" button in Preferences > Theme section

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit c37c790b47118b8938297d322fac40a779e4b3fb
Author: David Capello <davidcapello at gmail.com>
Date:   Fri Sep 18 12:39:46 2015 -0300

    Add "Open Folder" button in Preferences > Theme section
---
 data/widgets/options.xml         |  1 +
 src/app/commands/cmd_options.cpp | 19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/data/widgets/options.xml b/data/widgets/options.xml
index 5f5fa10..fe91dad 100644
--- a/data/widgets/options.xml
+++ b/data/widgets/options.xml
@@ -144,6 +144,7 @@
           <hbox>
 	    <button id="select_theme" text="&Select" width="60" />
 	    <boxfiller />
+	    <button id="open_theme_folder" text="Open &Folder" width="100" />
           </hbox>
         </vbox>
 
diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp
index 22b6dea..babc4c9 100644
--- a/src/app/commands/cmd_options.cpp
+++ b/src/app/commands/cmd_options.cpp
@@ -156,6 +156,7 @@ public:
 
     // Theme buttons
     selectTheme()->Click.connect(Bind<void>(&OptionsWindow::onSelectTheme, this));
+    openThemeFolder()->Click.connect(Bind<void>(&OptionsWindow::onOpenThemeFolder, this));
 
     onChangeGridScope();
     sectionListbox()->selectIndex(m_curSection);
@@ -333,9 +334,7 @@ private:
     if (themeList()->getItemsCount() > 0)
       return;
 
-    ResourceFinder rf;
-    rf.includeDataDir("skins");
-    std::string path = rf.defaultFilename();
+    std::string path = themeFolder();
     for (auto& fn : base::list_files(path)) {
       if (!base::is_directory(base::join_path(path, fn)))
         continue;
@@ -365,6 +364,20 @@ private:
     }
   }
 
+  void onOpenThemeFolder() {
+    ui::Alert::show(PACKAGE
+                    "<<%s"
+                    "||&OK", themeFolder().c_str());
+
+    launcher::open_folder(themeFolder());
+  }
+
+  static std::string themeFolder() {
+    ResourceFinder rf;
+    rf.includeDataDir("skins");
+    return rf.defaultFilename();
+  }
+
   Preferences& m_preferences;
   DocumentPreferences& m_globPref;
   DocumentPreferences& m_docPref;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list