thatsIch / sublime-rainmeter

Rainmeter Package for Sublime Text 3

Home Page:https://thatsich.github.io/sublime-rainmeter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhance first user experience

thatsIch opened this issue · comments

Currently the user just get a notification that Rainmeter could not be found, but it is better if some dialog or input would pop up where the user could enter the directory paths to the skin and rainmeter installation, if not found.

Apparently the tkinter library is for that. Not sure if it is ported through out Sublime Text though, needs integration testing in test environment.

Not possible.. ST3 does nto ship that part of the python standard libraries

Now I am running a custom script executing an open file dialog natively on windows looking like this:

@echo off
setlocal
set "ps=Add-Type -AssemblyName System.windows.forms | Out-Null;"
set "ps=%ps% [System.Windows.Forms.Application]::EnableVisualStyles();"
set "ps=%ps% $f=New-Object System.Windows.Forms.OpenFileDialog;"
set "ps=%ps% $f.Filter='Rainmeter Executable (Rainmeter.exe)|Rainmeter.exe|All files (*.*)|*.*';"
set "ps=%ps% $f.showHelp=$true;"
set "ps=%ps% $f.ShowDialog() | Out-Null;"
set "ps=%ps% $f.FileName"

for /f "delims=" %%I in ('powershell "%ps%"') do set "filename=%%I"

if defined filename (
    echo %filename%
) else (
    echo None
)

goto :EOF

I opted to use powershell directly to run it because going over the cmd is more error prone and slower also hiding the cmd call is more difficult. Since Rainmeter 4 requires Win 7+ anyways, ¯\(ツ)