kgem 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -18,7 +18,7 @@ just type gem command.
18
18
  gem install kgem
19
19
 
20
20
  or download latest gems from github and rake to install gem.
21
- git clone git@github.com:rubytwiddler/kgem.git
21
+ git clone git://github.com/rubytwiddler/kgem.git
22
22
  cd kgem
23
23
  rake gem
24
24
  sudo rake installgem
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = "kgem"
9
- s.version = "0.1.0"
9
+ s.version = "0.1.1"
10
10
  s.author = "ruby.twiddler"
11
11
  s.email = "ruby.twiddler at gmail.com"
12
12
  s.homepage = "http://github.com/rubytwiddler/kgem/wiki"
@@ -12,7 +12,7 @@ APP_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
12
12
  APP_NAME = File.basename(APP_FILE).sub(/\.rb/, '')
13
13
  APP_DIR = File::dirname(File.expand_path(File.dirname(APP_FILE)))
14
14
  LIB_DIR = File::join(APP_DIR, "lib")
15
- APP_VERSION = "0.1.0"
15
+ APP_VERSION = "0.1.1"
16
16
 
17
17
 
18
18
  # standard libs
@@ -154,6 +154,7 @@ class DownloadedWin < Qt::Widget
154
154
  slots :updateList
155
155
  def updateList
156
156
  def allFilesInDir(dir)
157
+ return [] unless dir
157
158
  exDir = File.expand_path(dir)
158
159
  return [] unless File.directory?(exDir)
159
160
  Dir.chdir(exDir)
@@ -167,7 +168,7 @@ class DownloadedWin < Qt::Widget
167
168
  end
168
169
  end
169
170
 
170
- dirs = GemDirs + [ Settings.autoFetchDir.pathOrUrl ]
171
+ dirs = GemDirs + [ Settings.autoFetchDir ]
171
172
  gems = dirs.uniq.inject([]) do |res, dir|
172
173
  res + allFilesInDir(dir)
173
174
  end
@@ -238,7 +239,7 @@ class DownloadedWin < Qt::Widget
238
239
  fetchedGem = @gemFileList.currentGem
239
240
  fileName = fetchedGem.filePath
240
241
  if Settings.autoUnpackFlag then
241
- dir = Settings.autoUnpackDir.pathOrUrl
242
+ dir = Settings.autoUnpackDir
242
243
  else
243
244
  dir = KDE::FileDialog::getExistingDirectory(Settings.autoUnpackDir)
244
245
  return unless dir
@@ -237,7 +237,7 @@ Pristine All ?
237
237
  return unless @selectDownloadVerDlg.selectVersion(gem)
238
238
 
239
239
  if Settings.autoFetchFlag then
240
- dir = Settings.autoFetchDir.pathOrUrl
240
+ dir = Settings.autoFetchDir
241
241
  else
242
242
  dir = KDE::FileDialog::getExistingDirectory(Settings.autoFetchDir)
243
243
  return unless dir
@@ -114,6 +114,59 @@ def passiveMessage(text)
114
114
  end
115
115
 
116
116
 
117
+ #--------------------------------------------------------------------------
118
+ #
119
+ # Mandriva doesn't include kio smoke library.
120
+ # FolderSelectorLineEdit substitute KDE::UrlRequester
121
+ #
122
+ class FolderSelectorLineEdit< Qt::Widget
123
+ def initialize(dir=nil, parent=nil)
124
+ super(parent)
125
+
126
+ # setContentsMargins(0,0,0,0)
127
+
128
+ # widgets
129
+ @lineEdit = KDE::LineEdit.new
130
+ @lineEdit.text = dir if dir
131
+ @dirSelectBtn = KDE::PushButton.new(KDE::Icon.new('folder'),'')
132
+
133
+ # connect
134
+ connect(@dirSelectBtn, SIGNAL(:clicked), self, SLOT(:openSelectDlg))
135
+
136
+ # layout
137
+ lo = Qt::HBoxLayout.new do |l|
138
+ l.setContentsMargins(0,0,0,0)
139
+ l.addWidgets(@lineEdit, @dirSelectBtn)
140
+ end
141
+ setLayout(lo)
142
+ end
143
+
144
+ slots :openSelectDlg
145
+ def openSelectDlg
146
+ path = Qt::FileDialog::getExistingDirectory(self,'select folder', @lineEdit.text)
147
+ unless !path || path.empty?
148
+ @lineEdit.text = path
149
+ end
150
+ end
151
+
152
+ # for settings manager.
153
+ def objectName=(name)
154
+ @lineEdit.objectName = name
155
+ end
156
+
157
+ def folder
158
+ @LineEdit.text
159
+ end
160
+ # compatibility for UrlRequester
161
+ alias text folder
162
+
163
+ def folder=(dir)
164
+ @LineEdit.text = dir
165
+ end
166
+ end
167
+
168
+
169
+
117
170
 
118
171
  #--------------------------------------------------------------------------
119
172
  #
@@ -313,6 +366,8 @@ class SettingsBase < KDE::ConfigSkeleton
313
366
  o.checked = val
314
367
  elsif o.kind_of? Qt::ComboBox
315
368
  o.currentIndex = val
369
+ elsif o.kind_of? KDE::LineEdit
370
+ o.text = val
316
371
  elsif o.kind_of? KDE::UrlRequester
317
372
  o.setUrl(val)
318
373
  end
@@ -334,6 +389,8 @@ class SettingsBase < KDE::ConfigSkeleton
334
389
  end
335
390
  elsif o.kind_of? Qt::ComboBox
336
391
  options.send(name, o.currentIndex)
392
+ elsif o.kind_of? KDE::LineEdit
393
+ options.send(name, o.text)
337
394
  elsif o.kind_of? KDE::UrlRequester
338
395
  options.send(name, o.url)
339
396
  else
@@ -16,10 +16,10 @@ class Settings < SettingsBase
16
16
 
17
17
  # folder settings.
18
18
  addBoolItem(:autoFetchFlag, false)
19
- addUrlItem(:autoFetchDir,
19
+ addStringItem(:autoFetchDir,
20
20
  File.join(KDE::GlobalSettings.downloadPath, 'gem_cache'))
21
21
  addBoolItem(:autoUnpackFlag, false)
22
- addUrlItem(:autoUnpackDir, File.join(KDE::GlobalSettings.downloadPath, 'gem_src'))
22
+ addStringItem(:autoUnpackDir, File.join(KDE::GlobalSettings.downloadPath, 'gem_src'))
23
23
  addBoolItem(:installLatestFlag, false)
24
24
  addBoolItem(:downloadLatestFlag, false)
25
25
 
@@ -51,16 +51,14 @@ class GeneralSettingsPage < Qt::Widget
51
51
 
52
52
  def createWidget
53
53
  @autoFetchCheckBox = Qt::CheckBox.new(i18n("Always Download gem in same directory."))
54
- @downloadUrl = KDE::UrlRequester.new(KDE::Url.new())
54
+ @downloadUrl = FolderSelectorLineEdit.new
55
55
  @downloadUrl.enabled = false
56
- @downloadUrl.mode = KDE::File::Directory | KDE::File::LocalOnly
57
56
  connect(@autoFetchCheckBox, SIGNAL('stateChanged(int)'),
58
57
  self, SLOT('autoFetchChanged(int)'))
59
58
 
60
59
  @autoUnpackCheckBox = Qt::CheckBox.new(i18n("Always Unpack gem in same directory."))
61
- @unpackUrl = KDE::UrlRequester.new(KDE::Url.new())
60
+ @unpackUrl = FolderSelectorLineEdit.new
62
61
  @unpackUrl.enabled = false
63
- @unpackUrl.mode = KDE::File::Directory | KDE::File::LocalOnly
64
62
  connect(@autoUnpackCheckBox, SIGNAL('stateChanged(int)'),
65
63
  self, SLOT('autoUnpackChanged(int)'))
66
64
  @installLatestCheckBox = Qt::CheckBox.new(i18n("Always Install latest version to skip version selection."))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kgem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - ruby.twiddler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-13 00:00:00 +09:00
18
+ date: 2010-09-14 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies: []
21
21