Class: Idb::AppListDialog
- Inherits:
-
Qt::Dialog
- Object
- Qt::Dialog
- Idb::AppListDialog
- Defined in:
- lib/gui/app_list_dialog.rb
Instance Attribute Summary collapse
-
#app_list ⇒ Object
Returns the value of attribute app_list.
Instance Method Summary collapse
-
#initialize(*args) ⇒ AppListDialog
constructor
A new instance of AppListDialog.
- #refresh_app_list ⇒ Object
Constructor Details
#initialize(*args) ⇒ AppListDialog
Returns a new instance of AppListDialog.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/gui/app_list_dialog.rb', line 6 def initialize *args super *args setWindowTitle("App Selection") @layout = Qt::GridLayout.new setLayout(@layout) @app_list = Qt::ListWidget.new self @app_list.setSortingEnabled(true); @app_list.connect(SIGNAL('itemDoubleClicked(QListWidgetItem*)')) { |item| emit accept } @layout.addWidget @app_list, 0, 0, 1, 2 refresh_app_list = Qt::PushButton.new "Select" .setDefault true .connect(SIGNAL(:released)) {|x| accept() } = Qt::PushButton.new "Cancel" .connect(SIGNAL(:released)) {|x| reject() } @layout.addWidget , 1, 1 @layout.addWidget , 1, 0 setFixedHeight(500); setFixedWidth(400); end |
Instance Attribute Details
#app_list ⇒ Object
Returns the value of attribute app_list.
4 5 6 |
# File 'lib/gui/app_list_dialog.rb', line 4 def app_list @app_list end |
Instance Method Details
#refresh_app_list ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/gui/app_list_dialog.rb', line 43 def refresh_app_list if $device.ios_version == 8 box = Qt::MessageBox.new 1, "Refreshing...", "Refreshing uicache to ensure app information is up-to-date. This may take a few seconds." box.setStandardButtons(0) box.show box.raise # need to refresh iOS uicache in case app was installed after last reboot. # Otherwise the /var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist will be out of date $device.ops.execute "/bin/su mobile -c /usr/bin/uicache" box.hide end app_uuids = $device.get_app_uuids progress = Qt::ProgressDialog.new "Reading App list...", nil, 1, app_uuids.size, self progress.setAutoClose true progress.setWindowModality(Qt::WindowModal); progress.show progress.raise app_uuids.each { |uuid| a = App.new uuid i = AppListWidgetItem.new @app_list, 0 i.setText (a.bundle_id.to_s + " => " + a.bundle_name.to_s) i.app = a @app_list.add_item i progress.setValue(progress.value+1); } end |