irecorder 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +19 -0
- data/README +45 -0
- data/Rakefile +72 -0
- data/bin/irecorder +9 -0
- data/bin/irecorder.rb +885 -0
- data/ext/Rakefile +27 -0
- data/lib/bbcnet.rb +271 -0
- data/lib/cache.rb +121 -0
- data/lib/download.rb +441 -0
- data/lib/irecorder_resource.rb +264 -0
- data/lib/logwin.rb +119 -0
- data/lib/mylibs.rb +462 -0
- data/lib/programmewin.rb +185 -0
- data/lib/settings.rb +376 -0
- data/lib/taskwin.rb +363 -0
- data/resources/bbcstyle.qss +443 -0
- metadata +107 -0
data/lib/taskwin.rb
ADDED
@@ -0,0 +1,363 @@
|
|
1
|
+
#-------------------------------------------------------------------------------------------
|
2
|
+
#
|
3
|
+
# Task Window
|
4
|
+
#
|
5
|
+
class TaskWindow < Qt::Widget
|
6
|
+
|
7
|
+
# column
|
8
|
+
SOURCE = 0
|
9
|
+
FILE = 1
|
10
|
+
LAPSE = 2
|
11
|
+
STATUS = 3
|
12
|
+
|
13
|
+
class TaskItem
|
14
|
+
attr_reader :sourceUrlItem, :savePathItem, :savePath
|
15
|
+
attr_reader :timeItem, :statusItem
|
16
|
+
attr_reader :process
|
17
|
+
alias :id :sourceUrlItem
|
18
|
+
|
19
|
+
def initialize(process, src, save, time, status)
|
20
|
+
@sourceUrlItem = Item.new(src)
|
21
|
+
@savePathItem = Item.new(File.basename(save))
|
22
|
+
@timeItem = Item.new(lapseText(time))
|
23
|
+
@statusItem = Item.new(status)
|
24
|
+
@process = process
|
25
|
+
@savePath = save
|
26
|
+
end
|
27
|
+
|
28
|
+
def sourceUrl
|
29
|
+
@sourceUrlItem.text
|
30
|
+
end
|
31
|
+
|
32
|
+
def time
|
33
|
+
@timeItem.text
|
34
|
+
end
|
35
|
+
|
36
|
+
def status
|
37
|
+
@statusItem.text
|
38
|
+
end
|
39
|
+
|
40
|
+
def updateTime(lapse)
|
41
|
+
@timeItem.text = lapseText(lapse)
|
42
|
+
end
|
43
|
+
|
44
|
+
def status=(str)
|
45
|
+
@statusItem.text = str
|
46
|
+
end
|
47
|
+
|
48
|
+
def lapseText(lapse)
|
49
|
+
a = Time.at(lapse).getgm.to_a
|
50
|
+
"%02d:%02d:%02d" % [a[2], a[1], a[0]]
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
#--------------------------------------------
|
57
|
+
#
|
58
|
+
#
|
59
|
+
class TaskTable < Qt::TableWidget
|
60
|
+
|
61
|
+
def initialize
|
62
|
+
super(0,4)
|
63
|
+
|
64
|
+
# Hash table : key column_0_item => TaskItem
|
65
|
+
@taskItemTbl = {}
|
66
|
+
self.selectionMode = Qt::AbstractItemView::SingleSelection
|
67
|
+
end
|
68
|
+
|
69
|
+
public
|
70
|
+
def taskItemAtRow(row)
|
71
|
+
i0 = item(row,0) # column_0_item is key to taskItem ID
|
72
|
+
i0 && taskItemFromId(i0)
|
73
|
+
end
|
74
|
+
|
75
|
+
def taskItemFromId(id)
|
76
|
+
@taskItemTbl[id]
|
77
|
+
end
|
78
|
+
|
79
|
+
def insertTaskItem(taskItem)
|
80
|
+
sortFlag = sortingEnabled
|
81
|
+
self.sortingEnabled = false
|
82
|
+
|
83
|
+
insertRow(0)
|
84
|
+
setItem(0,SOURCE, taskItem.sourceUrlItem)
|
85
|
+
setItem(0,FILE, taskItem.savePathItem)
|
86
|
+
setItem(0,LAPSE, taskItem.timeItem)
|
87
|
+
setItem(0,STATUS, taskItem.statusItem)
|
88
|
+
@taskItemTbl[taskItem.id] = taskItem
|
89
|
+
|
90
|
+
self.sortingEnabled = sortFlag
|
91
|
+
end
|
92
|
+
|
93
|
+
def each(&block)
|
94
|
+
a = []
|
95
|
+
rowCount.times do |r|
|
96
|
+
i = taskItemAtRow(r)
|
97
|
+
a << i if i
|
98
|
+
end
|
99
|
+
a.each do |i| block.call( i ) end
|
100
|
+
end
|
101
|
+
|
102
|
+
def deleteItem(i)
|
103
|
+
removeRow(i.id.row)
|
104
|
+
@taskItemTbl.delete(i.id)
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
# context menu : right click popup menu.
|
109
|
+
protected
|
110
|
+
def contextMenuEvent(e)
|
111
|
+
wItem = itemAt(e.pos)
|
112
|
+
if wItem
|
113
|
+
openContextPopup(e.globalPos, wItem)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
# open & exec contextMenu
|
121
|
+
def openContextPopup(pos, wItem)
|
122
|
+
poRow = wItem.row
|
123
|
+
poColumn = wItem.column
|
124
|
+
process = taskItemAtRow(wItem.row).process
|
125
|
+
|
126
|
+
menu = Qt::Menu.new
|
127
|
+
insertDefaultActions(menu, poColumn, process)
|
128
|
+
createPlayerMenu(menu, poColumn, process)
|
129
|
+
action = menu.exec(pos)
|
130
|
+
if action then
|
131
|
+
$log.code { "execute : '#{action.data.toString}'" }
|
132
|
+
cmd, exe = action.data.toString.split(/@/, 2)
|
133
|
+
$log.code { "cmd(#{cmd}), exe(#{exe})" }
|
134
|
+
if cmd =~ /^play/
|
135
|
+
playMedia(cmd, process, exe)
|
136
|
+
elsif self.respond_to?(cmd)
|
137
|
+
self.method(cmd).call(process, wItem)
|
138
|
+
else
|
139
|
+
$log.warn { "No method #{cmd} in contextmenu." }
|
140
|
+
end
|
141
|
+
end
|
142
|
+
menu.deleteLater
|
143
|
+
end
|
144
|
+
|
145
|
+
def insertDefaultActions(menu, poColumn, process)
|
146
|
+
a = menu.addAction(KDE::Icon.new('edit-copy'), 'Copy Text')
|
147
|
+
a.setVData('copyText@')
|
148
|
+
if poColumn == FILE
|
149
|
+
a = menu.addAction(KDE::Icon.new('kfm'), 'Open Folder')
|
150
|
+
a.setVData('openFolder@')
|
151
|
+
a = menu.addAction(KDE::Icon.new('kfm'), 'Open Temp Folder')
|
152
|
+
a.setVData('openTempFolder@')
|
153
|
+
end
|
154
|
+
if process.error?
|
155
|
+
a = menu.addAction(KDE::Icon.new('view-refresh'), 'Retry')
|
156
|
+
a.setVData('retryTask@')
|
157
|
+
if process.rawDownloaded?
|
158
|
+
a = menu.addAction(KDE::Icon.new('view-refresh'), 'Retry from Download')
|
159
|
+
a.setVData('retryDownload@')
|
160
|
+
end
|
161
|
+
a = menu.addAction(KDE::Icon.new('list-remove'), 'Remove')
|
162
|
+
a.setVData('removeTask@')
|
163
|
+
a = menu.addAction(KDE::Icon.new('list-remove-data'), 'Remove Task and Data')
|
164
|
+
a.setVData('removeTaskData@')
|
165
|
+
end
|
166
|
+
if process.running?
|
167
|
+
a = menu.addAction(KDE::Icon.new('edit-delete'), 'Cancel')
|
168
|
+
a.setVData('cancelTask@')
|
169
|
+
end
|
170
|
+
a = menu.addAction(KDE::Icon.new('edit-clear-list'), 'Clear All Finished.')
|
171
|
+
a.setVData('clearAllFinished@')
|
172
|
+
a = menu.addAction(KDE::Icon.new('edit-clear-list'), 'Clear All Errors.')
|
173
|
+
a.setVData('clearAllErrors@')
|
174
|
+
end
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
def createPlayerMenu(menu, poColumn, process)
|
179
|
+
case poColumn
|
180
|
+
when SOURCE
|
181
|
+
menu.addSeparator
|
182
|
+
createPlayers(menu, i18n('Play Source with'), "playSource@", '.wma')
|
183
|
+
when FILE
|
184
|
+
menu.addSeparator
|
185
|
+
if process.rawDownloaded? then
|
186
|
+
createPlayers(menu, i18n('Play File with'), "playMP3@", '.mp3')
|
187
|
+
end
|
188
|
+
if !process.finished? or File.exist?(process.rawFilePath) then
|
189
|
+
createPlayers(menu, i18n('Play Temp File with'), "playTemp@", '.wma')
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def createPlayers(menu, playText, playerCmd, url)
|
195
|
+
playersMenu = Qt::Menu.new(playText)
|
196
|
+
Mime::services(url).each do |s|
|
197
|
+
exeName = s.exec[/\w+/]
|
198
|
+
a = playersMenu.addAction(KDE::Icon.new(exeName), 'Play with ' + exeName)
|
199
|
+
a.setVData(playerCmd + s.exec)
|
200
|
+
end
|
201
|
+
menu.addMenu(playersMenu)
|
202
|
+
end
|
203
|
+
|
204
|
+
|
205
|
+
def playMedia(cmd, process, exe)
|
206
|
+
case cmd
|
207
|
+
when /Temp/
|
208
|
+
url = process.rawFilePath
|
209
|
+
when /Source/
|
210
|
+
url = process.sourceUrl
|
211
|
+
when /MP3/
|
212
|
+
url = process.outFilePath
|
213
|
+
end
|
214
|
+
|
215
|
+
playCmd, args = exe.split(/\s+/, 2)
|
216
|
+
args = args.split(/\s+/).map do |a|
|
217
|
+
a.gsub(/%\w/, url)
|
218
|
+
end
|
219
|
+
$log.debug { "execute cmd '#{playCmd}', args '#{args.inspect}'" }
|
220
|
+
proc = Qt::Process.new(self)
|
221
|
+
proc.start(playCmd, args)
|
222
|
+
end
|
223
|
+
|
224
|
+
# contextMenu Event
|
225
|
+
def copyText(process, wItem)
|
226
|
+
$app.clipboard.setText(wItem.text)
|
227
|
+
end
|
228
|
+
|
229
|
+
# contextMenu Event
|
230
|
+
def retryTask(process, wItem)
|
231
|
+
if process.error? then
|
232
|
+
process.retryTask
|
233
|
+
$log.info { "task restarted." }
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# contextMenu Event
|
238
|
+
def retryDownload(process, wItem)
|
239
|
+
if process.error? then
|
240
|
+
process.retryDownload
|
241
|
+
$log.info { "task restarted from download." }
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# contextMenu Event
|
246
|
+
def cancelTask(process, wItem)
|
247
|
+
if process.running? then
|
248
|
+
process.cancelTask
|
249
|
+
$log.info { "task canceled." }
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
# contextMenu Event
|
254
|
+
def removeTask(process, wItem)
|
255
|
+
if process.running? then
|
256
|
+
process.cancelTask
|
257
|
+
$log.info { "task removed." }
|
258
|
+
end
|
259
|
+
ti = taskItemAtRow(wItem.row)
|
260
|
+
deleteItem(ti)
|
261
|
+
end
|
262
|
+
|
263
|
+
# contextMenu Event
|
264
|
+
def removeTaskData(process, wItem)
|
265
|
+
if process.running? then
|
266
|
+
process.cancelTask
|
267
|
+
end
|
268
|
+
process.removeData
|
269
|
+
$log.info { "task and data removed." }
|
270
|
+
ti = taskItemAtRow(wItem.row)
|
271
|
+
deleteItem(ti)
|
272
|
+
end
|
273
|
+
|
274
|
+
# contextMenu Event
|
275
|
+
def openFolder(process, wItem)
|
276
|
+
outFilePath = File.dirname(process.outFilePath)
|
277
|
+
proc = Qt::Process.new(self)
|
278
|
+
proc.start('dolphin', [outFilePath ])
|
279
|
+
end
|
280
|
+
|
281
|
+
# contextMenu Event
|
282
|
+
def openTempFolder(process, wItem)
|
283
|
+
rawFilePath = File.dirname(process.rawFilePath)
|
284
|
+
proc = Qt::Process.new(self)
|
285
|
+
proc.start('dolphin', [rawFilePath])
|
286
|
+
end
|
287
|
+
|
288
|
+
# contextMenu Event
|
289
|
+
def clearAllFinished(process, wItem)
|
290
|
+
self.each do |i|
|
291
|
+
deleteItem(i) if i.process.finished?
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
# contextMenu Event
|
296
|
+
def clearAllErrors(process, wItem)
|
297
|
+
self.each do |i|
|
298
|
+
deleteItem(i) if i.process.error?
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
|
304
|
+
#--------------------------------------------
|
305
|
+
#
|
306
|
+
#
|
307
|
+
class Item < Qt::TableWidgetItem
|
308
|
+
def initialize(text)
|
309
|
+
super(text)
|
310
|
+
self.flags = Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled
|
311
|
+
self.toolTip = text
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
|
316
|
+
#--------------------------------------------
|
317
|
+
#
|
318
|
+
def initialize()
|
319
|
+
super
|
320
|
+
|
321
|
+
# create widgets
|
322
|
+
tvLayout = Qt::VBoxLayout.new
|
323
|
+
@table = TaskTable.new
|
324
|
+
tvLayout.addWidget(@table)
|
325
|
+
@table.setHorizontalHeaderLabels(['Source', 'File', 'Lapse', 'Status'])
|
326
|
+
@table.horizontalHeader.stretchLastSection = true
|
327
|
+
@table.selectionBehavior = Qt::AbstractItemView::SelectRows
|
328
|
+
@table.alternatingRowColors = true
|
329
|
+
|
330
|
+
setLayout(tvLayout)
|
331
|
+
|
332
|
+
# initialize variables
|
333
|
+
#
|
334
|
+
end
|
335
|
+
|
336
|
+
GroupName = "TaskWindow"
|
337
|
+
def writeSettings
|
338
|
+
config = $config.group(GroupName)
|
339
|
+
config.writeEntry('Header', @table.horizontalHeader.saveState)
|
340
|
+
end
|
341
|
+
|
342
|
+
def readSettings
|
343
|
+
config = $config.group(GroupName)
|
344
|
+
@table.horizontalHeader.restoreState(config.readEntry('Header', @table.horizontalHeader.saveState))
|
345
|
+
end
|
346
|
+
|
347
|
+
# return : added TaskItem
|
348
|
+
public
|
349
|
+
def addTask(process)
|
350
|
+
# insert at the top
|
351
|
+
src = process.sourceUrl
|
352
|
+
save = process.rawFileName
|
353
|
+
taskItem = TaskItem.new(process, src, save, 0, 'prepare')
|
354
|
+
@table.insertTaskItem(taskItem)
|
355
|
+
|
356
|
+
taskItem
|
357
|
+
end
|
358
|
+
|
359
|
+
def each(&block)
|
360
|
+
@table.each(&block)
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
@@ -0,0 +1,443 @@
|
|
1
|
+
* {
|
2
|
+
color: white;
|
3
|
+
background: rgb(10,10,10);
|
4
|
+
alternate-background-color: rgb(80,80,80);
|
5
|
+
border-color: rgb(82,0,45);
|
6
|
+
}
|
7
|
+
*:selected {
|
8
|
+
color: white;
|
9
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
10
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
11
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
12
|
+
}
|
13
|
+
|
14
|
+
*:hover {
|
15
|
+
color: rgb(255, 84, 174);
|
16
|
+
}
|
17
|
+
|
18
|
+
*:disabled {
|
19
|
+
color: rgb(40, 20, 255);
|
20
|
+
}
|
21
|
+
|
22
|
+
*:selected {
|
23
|
+
border: 1px solid rgb(255,84,174);
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
QLabel a {
|
28
|
+
text-decoration: underline; color: rgb(84, 174, 255);
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
/*
|
33
|
+
Popup & Menu
|
34
|
+
*/
|
35
|
+
|
36
|
+
QMenu {
|
37
|
+
border: 1px solid rgb(124,124,124);
|
38
|
+
background: rgb(60,60,60);
|
39
|
+
}
|
40
|
+
|
41
|
+
QMenu::item {
|
42
|
+
/* border: 1px solid red; */
|
43
|
+
/* background: rgb(60,60,60); */
|
44
|
+
}
|
45
|
+
|
46
|
+
QMenu::item:selected {
|
47
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
48
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
49
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
50
|
+
}
|
51
|
+
|
52
|
+
QMenu::separator {
|
53
|
+
height: 1px;
|
54
|
+
background: rgb(124,124,124);
|
55
|
+
margin: 1px 15px;
|
56
|
+
}
|
57
|
+
|
58
|
+
QMenu::icon {
|
59
|
+
border: 4px solid red;
|
60
|
+
selection-background-color: yellow;
|
61
|
+
selection-color: yellow;
|
62
|
+
background: green;
|
63
|
+
}
|
64
|
+
/*
|
65
|
+
QMenu::icon:pressed
|
66
|
+
QMenu::icon:selected
|
67
|
+
QMenu::icon:focus
|
68
|
+
*/
|
69
|
+
QMenu::icon:checked {
|
70
|
+
border: 4px solid red;
|
71
|
+
selection-background-color: yellow;
|
72
|
+
selection-color: yellow;
|
73
|
+
background: green;
|
74
|
+
}
|
75
|
+
|
76
|
+
/*
|
77
|
+
TextEdit
|
78
|
+
*/
|
79
|
+
QTextEdit {
|
80
|
+
border: 1px solid rgb(124,124,124);
|
81
|
+
background: rgb(30,30,30);
|
82
|
+
}
|
83
|
+
|
84
|
+
/*
|
85
|
+
PushButton
|
86
|
+
*/
|
87
|
+
QPushButton {
|
88
|
+
color: white;
|
89
|
+
font: bold normal "Nimbus Sans L";
|
90
|
+
border: 2px solid rgb(0,0,0);
|
91
|
+
border-radius: 4px;
|
92
|
+
padding: 4px 8px;
|
93
|
+
margin: 1px;
|
94
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
95
|
+
stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
|
96
|
+
stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
|
97
|
+
min-width: 3em;
|
98
|
+
}
|
99
|
+
|
100
|
+
QPushButton:checked {
|
101
|
+
color: white;
|
102
|
+
border-color: rgb(139,0,76);
|
103
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
104
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
105
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
106
|
+
}
|
107
|
+
|
108
|
+
QPushButton:hover {
|
109
|
+
color: rgb(255, 84, 174);
|
110
|
+
}
|
111
|
+
|
112
|
+
/*
|
113
|
+
disabled button's font color is not changable.
|
114
|
+
*/
|
115
|
+
QPushButton:disabled {
|
116
|
+
color: rgb(40, 200, 255);
|
117
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(11, 11, 11, 255), stop:0.427083 rgba(33, 33, 33, 255), stop:0.536458 rgba(61, 61, 61, 255), stop:1 rgba(75, 75, 75, 255))
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
/*
|
122
|
+
table
|
123
|
+
*/
|
124
|
+
QTableView {
|
125
|
+
border: 1px solid rgb(124,124,124);
|
126
|
+
background: rgb(30,30,30);
|
127
|
+
margin: 0px;
|
128
|
+
}
|
129
|
+
|
130
|
+
QTableView QTableCornerButton::section {
|
131
|
+
border: 1px solid rgb(40,40,40);
|
132
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
133
|
+
stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
|
134
|
+
stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
|
135
|
+
}
|
136
|
+
|
137
|
+
QTableView QHeaderView {
|
138
|
+
border: 1px solid rgb(40,40,40);
|
139
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
140
|
+
stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
|
141
|
+
stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
|
142
|
+
}
|
143
|
+
|
144
|
+
QTableView QHeaderView::section {
|
145
|
+
border: 1px solid rgb(120,120,120);
|
146
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
147
|
+
stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
|
148
|
+
stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
|
149
|
+
}
|
150
|
+
|
151
|
+
QTableView QHeaderView::section:checked {
|
152
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
153
|
+
stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
|
154
|
+
stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
QTableView {
|
159
|
+
selection-background-color: rgb(148,0,86);
|
160
|
+
/*
|
161
|
+
selection-background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
162
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
163
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
164
|
+
*/
|
165
|
+
}
|
166
|
+
|
167
|
+
|
168
|
+
/*
|
169
|
+
LineEdit
|
170
|
+
*/
|
171
|
+
QLineEdit, QLineEdit:hover {
|
172
|
+
color: white;
|
173
|
+
margin: 1px;
|
174
|
+
border: 1px solid rgb(180,180,180);
|
175
|
+
background: rgb(30,30,30);
|
176
|
+
}
|
177
|
+
QLineEdit:hover{
|
178
|
+
margin: 1px;
|
179
|
+
border: 1px solid rgb(220,220,220);
|
180
|
+
}
|
181
|
+
|
182
|
+
QLineEdit:focus {
|
183
|
+
margin: 0px;
|
184
|
+
border: 2px solid rgb(220,220,220);
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
/*
|
189
|
+
ScrollBar
|
190
|
+
vertical
|
191
|
+
*/
|
192
|
+
QScrollBar:vertical {
|
193
|
+
border: 1px solid rgb(60,60,60);
|
194
|
+
background: rgb(40,40,40);
|
195
|
+
width: 18px;
|
196
|
+
margin: 17px 0 17px 0;
|
197
|
+
}
|
198
|
+
QScrollBar::handle:vertical {
|
199
|
+
/* background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0.00520833 rgba(14, 14, 14, 255), stop:0.25 rgba(47, 47, 47, 255), stop:0.75 rgba(64, 64, 64, 255), stop:1 rgba(156, 156, 156, 255));
|
200
|
+
*/
|
201
|
+
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
202
|
+
stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
|
203
|
+
stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
|
204
|
+
min-height: 16px;
|
205
|
+
}
|
206
|
+
|
207
|
+
QScrollBar::sub-line:vertical, QScrollBar::add-line:vertical {
|
208
|
+
border: 1px solid rgb(40,40,40);
|
209
|
+
background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
|
210
|
+
stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
|
211
|
+
stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
|
212
|
+
height: 16px;
|
213
|
+
subcontrol-origin: margin;
|
214
|
+
}
|
215
|
+
|
216
|
+
QScrollBar::sub-line:vertical {
|
217
|
+
subcontrol-position: top;
|
218
|
+
}
|
219
|
+
|
220
|
+
QScrollBar::add-line:vertical {
|
221
|
+
subcontrol-position: bottom;
|
222
|
+
}
|
223
|
+
|
224
|
+
QScrollBar::up-arrow:vertical {
|
225
|
+
image: url(resources/up-arrow.png);
|
226
|
+
}
|
227
|
+
QScrollBar::down-arrow:vertical {
|
228
|
+
image: url(resources/down-arrow.png);
|
229
|
+
}
|
230
|
+
|
231
|
+
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
232
|
+
background: none;
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
/*
|
237
|
+
ScrollBar
|
238
|
+
Horizontal
|
239
|
+
*/
|
240
|
+
QScrollBar:horizontal {
|
241
|
+
border: 1px solid rgb(60,60,60);
|
242
|
+
background: rgb(40,40,40);
|
243
|
+
height: 18px;
|
244
|
+
margin: 0 17px 0 17px;
|
245
|
+
}
|
246
|
+
QScrollBar::handle:horizontal {
|
247
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
248
|
+
stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
|
249
|
+
stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
|
250
|
+
min-width: 16px;
|
251
|
+
}
|
252
|
+
|
253
|
+
QScrollBar::sub-line:horizontal, QScrollBar::add-line:horizontal {
|
254
|
+
border: 1px solid rgb(40,40,40);
|
255
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
256
|
+
stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
|
257
|
+
stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
|
258
|
+
width: 16px;
|
259
|
+
subcontrol-origin: margin;
|
260
|
+
}
|
261
|
+
|
262
|
+
QScrollBar::sub-line:horizontal {
|
263
|
+
subcontrol-position: left;
|
264
|
+
}
|
265
|
+
|
266
|
+
QScrollBar::add-line:horizontal {
|
267
|
+
subcontrol-position: right;
|
268
|
+
}
|
269
|
+
|
270
|
+
QScrollBar::left-arrow:horizontal {
|
271
|
+
image: url(resources/left-arrow.png);
|
272
|
+
}
|
273
|
+
QScrollBar::right-arrow:horizontal {
|
274
|
+
image: url(resources/right-arrow.png);
|
275
|
+
}
|
276
|
+
|
277
|
+
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
|
278
|
+
background: none;
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
/*
|
286
|
+
TabWidget. borrowed from qt4 manual example.
|
287
|
+
*/
|
288
|
+
QTabWidget::pane { /* The tab widget frame */
|
289
|
+
background: rgb(50,50,50);
|
290
|
+
border-top: 2px solid rgb(70,70,70);
|
291
|
+
}
|
292
|
+
|
293
|
+
QTabWidget::tab-bar {
|
294
|
+
left: 5px; /* move to the right by 5px */
|
295
|
+
}
|
296
|
+
|
297
|
+
/* Style the tab using the tab sub-control. Note that
|
298
|
+
it reads QTabBar _not_ QTabWidget */
|
299
|
+
QTabBar::tab {
|
300
|
+
color: white;
|
301
|
+
font: bold normal "Nimbus Sans L";
|
302
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
303
|
+
stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
|
304
|
+
stop:0.5 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
|
305
|
+
border: 2px solid rgb(0,0,0);
|
306
|
+
border-bottom-color: rgb(50,50,50); /* same as the pane color */
|
307
|
+
border-top-left-radius: 6px;
|
308
|
+
border-top-right-radius: 6px;
|
309
|
+
min-width: 4.5em;
|
310
|
+
padding: 2px;
|
311
|
+
}
|
312
|
+
|
313
|
+
QTabBar::tab:selected {
|
314
|
+
color: rgb(255, 84, 174);
|
315
|
+
background: rgb(50,50,50);
|
316
|
+
border-color: rgb(140,140,140) rgb(100,100,100) rgb(50,50,50);
|
317
|
+
}
|
318
|
+
|
319
|
+
QTabBar::tab:hover {
|
320
|
+
color: rgb(255, 84, 174);
|
321
|
+
}
|
322
|
+
|
323
|
+
QTabBar::tab:!selected {
|
324
|
+
margin-top: 2px; /* make non-selected tabs look smaller */
|
325
|
+
}
|
326
|
+
|
327
|
+
/* make use of negative margins for overlapping tabs */
|
328
|
+
QTabBar::tab:selected {
|
329
|
+
/* expand/overlap to the left and right by 4px */
|
330
|
+
margin-left: -4px;
|
331
|
+
margin-right: -4px;
|
332
|
+
}
|
333
|
+
|
334
|
+
QTabBar::tab:first:selected {
|
335
|
+
margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
|
336
|
+
}
|
337
|
+
|
338
|
+
QTabBar::tab:last:selected {
|
339
|
+
margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
|
340
|
+
}
|
341
|
+
|
342
|
+
QTabBar::tab:only-one {
|
343
|
+
margin: 0; /* if there is only one tab, we don't want overlapping margins */
|
344
|
+
}
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
/*
|
349
|
+
Dock Widget
|
350
|
+
*/
|
351
|
+
QDockWidget::title {
|
352
|
+
text-align: left;
|
353
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
354
|
+
stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
|
355
|
+
stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
|
356
|
+
padding-left: 10px;
|
357
|
+
}
|
358
|
+
|
359
|
+
|
360
|
+
/*
|
361
|
+
Channel ToolBox
|
362
|
+
*/
|
363
|
+
QToolBox#channelToolBox {
|
364
|
+
border: 0px solid rgb(42,40,41); /* rgb(171,164,169); */
|
365
|
+
}
|
366
|
+
|
367
|
+
/*
|
368
|
+
channel list
|
369
|
+
*/
|
370
|
+
QListWidget {
|
371
|
+
show-decoration-selected: 1;
|
372
|
+
border: 1px solid rgb(124,124,124);
|
373
|
+
background: rgb(30,30,30);
|
374
|
+
}
|
375
|
+
|
376
|
+
QListWidget::item:selected {
|
377
|
+
color: white;
|
378
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
379
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
380
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
381
|
+
}
|
382
|
+
|
383
|
+
QListWidget::item:hover {
|
384
|
+
color: rgb(255, 84, 174);
|
385
|
+
}
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
/*
|
390
|
+
[All/Hightlights/Most Popular] Switch Button
|
391
|
+
*/
|
392
|
+
QPushButton#switchButton, QToolBox#channelToolBox::tab {
|
393
|
+
color: white;
|
394
|
+
font: bold normal "Nimbus Sans L";
|
395
|
+
border: 2px solid rgb(0,0,0);
|
396
|
+
border-radius: 4px;
|
397
|
+
padding: 4px 4px;
|
398
|
+
margin: 1px;
|
399
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
400
|
+
stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
|
401
|
+
stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
|
402
|
+
min-width: 1.2em;
|
403
|
+
}
|
404
|
+
|
405
|
+
QPushButton#switchButton:checked, QToolBox#channelToolBox::tab:selected {
|
406
|
+
color: white;
|
407
|
+
border-color: rgb(139,0,76);
|
408
|
+
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
409
|
+
stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
|
410
|
+
stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
|
411
|
+
}
|
412
|
+
|
413
|
+
QPushButton#switchButton:hover, QToolBox#channelToolBox::tab:hover {
|
414
|
+
color: rgb(255, 84, 174);
|
415
|
+
}
|
416
|
+
|
417
|
+
|
418
|
+
/*
|
419
|
+
play & download button
|
420
|
+
*/
|
421
|
+
QPushButton#downloadButton, #playButton {
|
422
|
+
color: white;
|
423
|
+
background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
424
|
+
stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
|
425
|
+
stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
|
426
|
+
border-radius: 14px;
|
427
|
+
border: 2px solid rgb(0, 229, 65);
|
428
|
+
font: bold 10pt "Nimbus Sans L";
|
429
|
+
padding: 5px 20px;
|
430
|
+
}
|
431
|
+
|
432
|
+
QPushButton#downloadButton:hover, #playButton:hover {
|
433
|
+
color: rgb(170, 255, 0);
|
434
|
+
}
|
435
|
+
|
436
|
+
QPushButton#pushButtonDownLoad:pressed, #playButton:pressed {
|
437
|
+
color: rgb(255, 84, 174);
|
438
|
+
border-color: rgb(230, 0, 246);
|
439
|
+
}
|
440
|
+
|
441
|
+
QWebView {
|
442
|
+
color: white;
|
443
|
+
}
|