Skip to content

Commit

Permalink
release 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Nov 13, 2014
1 parent 0460f41 commit cab0a0f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 28 deletions.
7 changes: 2 additions & 5 deletions BiliGui.desktop
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[Destkop Entry]
Type=Application
Name=Bilibili for Linux
Name[zh_CN]=哔哩哔哩
GenericName=Bilibili for Linux
GenericName[zh_CN]=哔哩哔哩
Comment=Watch videos from bilibili.tv
Comment[zh_CN]=观看 B 站视频
Exec=/home/marguerite/Public/danmaku2ass/BiliGui.rb
Exec=/home/marguerite/Public/BiliGui/BiliGui.rb
Icon=/home/marguerite/Public/BiliGui/bilibili.png
Terminal=false
Type=Application
Categories=AudioVideo;Video;Player;
42 changes: 30 additions & 12 deletions BiliGui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class QtApp < Qt::Widget

slots 'bilidan()'
slots 'clear()'
slots 'bilidanChoose()'

def initialize
super
Expand Down Expand Up @@ -40,21 +41,27 @@ def center
def init_ui
grid = Qt::GridLayout.new self

biliUrlLabel = Qt::Label.new "Please paste Bilibili URL below", self
bilidanPathLabel = Qt::Label.new "Please enter your bilidan's path:", self
@bilidanPath = Qt::LineEdit.new self
bilidanButton = Qt::PushButton.new 'Choose', self
biliUrlLabel = Qt::Label.new "Please paste Bilibili URL below", self
@urlArea = Qt::TextEdit.new self
@bilidanPath = Qt::LineEdit.new self
okButton = Qt::PushButton.new 'Fire!', self
@messageLabel = Qt::Label.new "", self
@messageLabel.setStyleSheet("color: #ff0000;")
okButton = Qt::PushButton.new 'Watch', self
clearButton = Qt::PushButton.new 'Clear', self

grid.addWidget bilidanPathLabel, 0, 0, 1, 1
grid.addWidget @bilidanPath, 0, 1, 1, 2
grid.addWidget biliUrlLabel, 1, 0, 1, 3
grid.addWidget @urlArea, 2, 0, 1, 3
grid.addWidget okButton, 3, 1, 1, 1
grid.addWidget clearButton, 3, 2, 1, 1
grid.setColumnStretch 3, 0

grid.addWidget bilidanButton, 0, 3, 1, 1
grid.addWidget biliUrlLabel, 1, 0, 1, 4
grid.addWidget @urlArea, 2, 0, 1, 4
grid.addWidget @messageLabel, 3, 0, 1, 1
grid.addWidget okButton, 3, 2, 1, 1
grid.addWidget clearButton, 3, 3, 1, 1
grid.setColumnStretch 1, 2

connect bilidanButton, SIGNAL('clicked()'), self, SLOT('bilidanChoose()')
connect okButton, SIGNAL('clicked()'), self, SLOT('bilidan()')
connect clearButton, SIGNAL('clicked()'), self, SLOT('clear()')
end
Expand All @@ -65,19 +72,30 @@ def bilidan
if urlText != "" then
if pathText != "" then
command = "#{pathText}/bilidan.py #{urlText}"
else
exec command
elsif File.exists?('./bilidan.py') then
command = "./bilidan.py #{urlText}"
exec command
else
error = "[ERR] you need to choose bilidan!"
@messageLabel.setText(error)
end
exec command
else
puts "[ERR] you have to paste an URL!"
error = "[ERR] you have to paste an URL!"
@messageLabel.setText(error)
end
end

def clear
@urlArea.clear()
end

def bilidanChoose
userHome = `echo $HOME`.gsub(/\n/,"")
bilidanBin = Qt::FileDialog.getOpenFileName(self, "Please choose your bilidan.py", "#{userHome}", "Python files (*.py)")
@bilidanPath.setText(bilidanBin)
end

end

app = Qt::Application.new ARGV
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
0.0.2
* decouple BiliDan and BiliGui
* add an option to choose Bilidan.py
* implement the error reporting system
0.0.1
* initial commit
* pretty basic, just paste a URL and calls BiliDan
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
== BiliGui ==
## BiliGui

Bilibili GUI for [BiliDan](https://github.com/m13253/BiliDan)

=== Installation ===
### Installation

You need ruby-qt. In openSUSE
You need ruby-qt. In openSUSE `sudo zypper in ruby-qt` will do the work

zypper in ruby-qt
#### Optional

will do the work

Then put BiliGui.rb to the same directory as your BiliDan goes.

And place BiliGui.desktop anywhere that is easy to you.
Place BiliGui.desktop anywhere that is easy to you.

Remeber to edit the absolute paths in BiliGui.desktop

=== License ===
### License

MIT
4 changes: 3 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
* capture console output in real time and print them on the GUI
* get exitStatus of the command then run next URL (multi URL paste support)
* load URLs from a file and save currently pasted URLs to a file
* separate BiliDan and BiliGui's locations
<del>* decouple BiliDan and BiliGui's locations</del> Done!
* let error message fade out
* config file system to avoid choose bilidan everytime!

0 comments on commit cab0a0f

Please sign in to comment.