diff --git a/BiliConfig.rb b/BiliConfig.rb index 2ae551f..8f18041 100644 --- a/BiliConfig.rb +++ b/BiliConfig.rb @@ -41,12 +41,12 @@ def initialize(name="biligui.conf", path=$configPath) end - def write(key, value) + def put(key, value) # if Key exists, then we should delete if @configEntries.key?(key) then - billMove(@config,"! line.index(key)") + biliMove(@config,"! line.index('" + key + "')") end diff --git a/BiliFile.rb b/BiliFile.rb index 4b52baf..1b2f124 100644 --- a/BiliFile.rb +++ b/BiliFile.rb @@ -6,6 +6,8 @@ def biliMove(file, newfile=file, condition) tmp = file + ".tmp" + p condition + open(file, 'r') do |f0| open(tmp, 'w') do |f1| f0.each_line do |line| diff --git a/BiliWidgets.rb b/BiliWidgets.rb index 7719f0a..1304b92 100644 --- a/BiliWidgets.rb +++ b/BiliWidgets.rb @@ -12,6 +12,7 @@ class BiliGui < Qt::MainWindow slots 'clear()' slots 'bilidanChoose()' + slots 'bilidanAutoSave()' slots 'bilidanPlay()' slots 'bilidanLogOut()' slots 'bilidanLogErr()' @@ -131,6 +132,7 @@ def init_ui grid_Settings.addWidget bilidanButton, 0, 2, 1, 1 grid_Settings.setColumnStretch 0, 0 + connect @bilidanPath, SIGNAL('textChanged(const QString)'), self, SLOT('bilidanAutoSave()') connect bilidanButton, SIGNAL('clicked()'), self, SLOT('bilidanChoose()') # player thread @@ -212,6 +214,13 @@ def bilidanChoose end end + def bilidanAutoSave + + p @bilidanPath.text + @@configw.put("BilidanPath", @bilidanPath.text) + + end + def biliWeb @biliweb = Qt::WebView.new diff --git a/doc/ChangeLog b/doc/ChangeLog index 4382a4c..b27d1e0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,6 @@ +0.0.10 +* autosave bilidan path in input area +* regression: can not set biligui config 0.0.9 * make it themeable (external stylesheet .qss) * clean module usage, don't need to create wrapper classes diff --git a/doc/TODO b/doc/TODO index 741a80f..14be237 100644 --- a/doc/TODO +++ b/doc/TODO @@ -6,7 +6,6 @@ * play history * query url to get title & author * BiliDaemon.rb to run background tasks -** autosave config * Playlist merge ** find all saved playlists ** merge into a temp big one