ruby-netmon-qt 1.0.2 → 2.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b5ae43229614572636751dc0765e94da577124b603fdfe034464b9ed7b4aac7
4
- data.tar.gz: 810e536eb5b67bf68c419eae154567c006deb70ef59cdeeb403ec6eaf6c3ac9d
3
+ metadata.gz: ec8bdd6a57990ad26094807149172feac0d65dc8790a3788216085f545090144
4
+ data.tar.gz: c07ba1349e86146dee02190e0d6aae81c008387c37f3c23a2e6c4aea08bcf8c2
5
5
  SHA512:
6
- metadata.gz: 3b530cefa1913b5253f33dc071f220dc7c88742e6150a9f0c3664b6a4e96f8a6a9137bf6dd30cc9559beeb1ddb7ee875c19ffc271823557ef759a7b18babff99
7
- data.tar.gz: d96e4ed33ca77f5eb5e163d6ca618c2963ff309d4f7829fa0b33b1029a85a934f179a53fb1775c122a9873c5f954b8300af06a58789313f42fe7270742f41a08
6
+ metadata.gz: 23ce6e3b2d47265fc48fa4304a44b6915bf5b60bd511f0b659adba90adc7e0a239096e6e4db6819433c3dde6bcbcca6868deea45ebf9f9ba4363fd2c8e96b29c
7
+ data.tar.gz: 3f8b114bcfc95c85953c6280f49b4223d0b740ea979ef1c87d43d437024f6c2fc2e324106ff48dd2b1e46c1c3131065180e1985f08f501a8380a50d670127f7f
data/.rubocop.yml CHANGED
@@ -8,3 +8,7 @@ AllCops:
8
8
  Exclude:
9
9
  - "bin/**/*"
10
10
  - "tmp/**/*"
11
+
12
+ Style/GlobalVars:
13
+ AllowedVariables:
14
+ - '$qApp'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # NetmonQt
1
+ # RubyNetmonQt
2
2
 
3
3
  A simple network monitor on Linux.
4
4
 
@@ -18,7 +18,7 @@ gem install ruby-netmon-qt
18
18
  To launch the GUI:
19
19
 
20
20
  ```sh
21
- netmon-qt
21
+ ruby-netmon-qt
22
22
  ```
23
23
 
24
24
  ## Screenshot
@@ -1,4 +1,4 @@
1
- class ConnsTableView < RubyQt6::Bando::QWidget
1
+ class MainWindowConnsTableView < RubyQt6::Bando::QWidget
2
2
  class SortFilterProxyModel < RubyQt6::Bando::QSortFilterProxyModel
3
3
  def filter_accepts_row(source_row, source_parent)
4
4
  {
@@ -1,4 +1,4 @@
1
- class ConnsTableView < RubyQt6::Bando::QWidget
1
+ class MainWindowConnsTableView < RubyQt6::Bando::QWidget
2
2
  class StatusBar < RubyQt6::Bando::QWidget
3
3
  def initialize(storeproxymodel)
4
4
  super()
@@ -1,4 +1,4 @@
1
- class ConnsTableView < RubyQt6::Bando::QWidget
1
+ class MainWindowConnsTableView < RubyQt6::Bando::QWidget
2
2
  # rubocop:disable Layout
3
3
  COLUMN_CONNECTION_KEY = 0
4
4
  COLUMN_PROCESS_NAME = 1
@@ -2,7 +2,7 @@ require_relative "connstableview/sortfilterproxymodel"
2
2
  require_relative "connstableview/statusbar"
3
3
  require_relative "connstableview/store"
4
4
 
5
- class ConnsTableView < RubyQt6::Bando::QWidget
5
+ class MainWindowConnsTableView < RubyQt6::Bando::QWidget
6
6
  QSS_BUTTON_AUTOREFRESH = "
7
7
  QPushButton {
8
8
  background: #EFF0F1;
@@ -0,0 +1,28 @@
1
+ class MainWindow < RubyQt6::Bando::QMainWindow
2
+ private
3
+
4
+ def initialize_ui
5
+ initialize_central_widget
6
+ initialize_statusbar
7
+
8
+ set_context_menu_policy(Qt::NoContextMenu)
9
+ end
10
+
11
+ def initialize_central_widget
12
+ @connstableview = MainWindowConnsTableView.new
13
+
14
+ centralwidget = QWidget.new
15
+ mainlayout = QHBoxLayout.new(centralwidget)
16
+ mainlayout.add_widget(@connstableview)
17
+
18
+ set_central_widget(centralwidget)
19
+ end
20
+
21
+ def initialize_statusbar
22
+ statusbar = QStatusBar.new
23
+ statusbar.set_contents_margins(12, 0, 12, 0)
24
+ statusbar.add_permanent_widget(@connstableview.statusbar, 1)
25
+
26
+ set_status_bar(statusbar)
27
+ end
28
+ end
@@ -1,3 +1,6 @@
1
+ require_relative "mainwindow/components"
2
+ require_relative "mainwindow/ui"
3
+
1
4
  class MainWindow < RubyQt6::Bando::QMainWindow
2
5
  q_object do
3
6
  end
@@ -5,36 +8,12 @@ class MainWindow < RubyQt6::Bando::QMainWindow
5
8
  def initialize
6
9
  super
7
10
 
8
- initialize_central_widget
9
- initialize_statusbar
10
-
11
- set_context_menu_policy(Qt::NoContextMenu)
11
+ initialize_ui
12
12
  NetmonQt.settings.GET_mainwindow_geometry_and_restore_to(self)
13
13
  end
14
14
 
15
15
  def close_event(evt)
16
16
  NetmonQt.settings.PUT_mainwindow_geometry(self)
17
-
18
17
  _close_event(evt)
19
18
  end
20
-
21
- private
22
-
23
- def initialize_central_widget
24
- @connstableview = ConnsTableView.new
25
-
26
- centralwidget = QWidget.new
27
- mainlayout = QHBoxLayout.new(centralwidget)
28
- mainlayout.add_widget(@connstableview)
29
-
30
- set_central_widget(centralwidget)
31
- end
32
-
33
- def initialize_statusbar
34
- statusbar = QStatusBar.new
35
- statusbar.set_contents_margins(12, 0, 12, 0)
36
- statusbar.add_permanent_widget(@connstableview.statusbar, 1)
37
-
38
- set_status_bar(statusbar)
39
- end
40
19
  end
data/lib/netmon-qt/app.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require_relative "config"
2
2
  require_relative "lib"
3
3
 
4
- require_relative "app/components"
5
4
  require_relative "app/services"
6
5
  require_relative "app/views"
7
6
 
@@ -17,7 +16,8 @@ module NetmonQt
17
16
  end
18
17
 
19
18
  def exec
20
- Contrib::SigHandler.new(@app)
19
+ handler = Ctrlc::Handler.new
20
+ handler.exec
21
21
 
22
22
  @mainwindow.show
23
23
  @app.exec
@@ -1,12 +1,14 @@
1
- module Contrib
2
- class SigHandler < RubyQt6::Bando::QObject
1
+ module Ctrlc
2
+ class Handler < RubyQt6::Bando::QObject
3
3
  q_object do
4
4
  slot "_noop()"
5
5
  end
6
6
 
7
- def initialize(parent)
8
- super
7
+ def initialize
8
+ super($qApp)
9
+ end
9
10
 
11
+ def exec
10
12
  ["INT", "TERM"].each do |sig|
11
13
  Signal.trap(sig) { |_| QApplication.quit }
12
14
  end
@@ -0,0 +1 @@
1
+ require_relative "ctrlc/handler"
data/lib/netmon-qt/lib.rb CHANGED
@@ -1,2 +1,2 @@
1
- require_relative "lib/contrib"
1
+ require_relative "lib/ctrlc"
2
2
  require_relative "lib/netmon"
@@ -1,3 +1,3 @@
1
1
  module NetmonQt
2
- VERSION = "1.0.2"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-netmon-qt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Doe
@@ -37,11 +37,10 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '6.0'
40
- description: A simple network monitor on Linux.
41
40
  email:
42
41
  - johndoe@example.com
43
42
  executables:
44
- - netmon-qt
43
+ - ruby-netmon-qt
45
44
  extensions: []
46
45
  extra_rdoc_files: []
47
46
  files:
@@ -50,7 +49,7 @@ files:
50
49
  - LICENSE
51
50
  - README.md
52
51
  - Rakefile
53
- - exe/netmon-qt
52
+ - exe/ruby-netmon-qt
54
53
  - lib/netmon-qt.rb
55
54
  - lib/netmon-qt/app.rb
56
55
  - lib/netmon-qt/app/assets/README.md
@@ -326,21 +325,22 @@ files:
326
325
  - lib/netmon-qt/app/assets/flags/za.svg
327
326
  - lib/netmon-qt/app/assets/flags/zm.svg
328
327
  - lib/netmon-qt/app/assets/flags/zw.svg
329
- - lib/netmon-qt/app/components.rb
330
- - lib/netmon-qt/app/components/connstableview.rb
331
- - lib/netmon-qt/app/components/connstableview/sortfilterproxymodel.rb
332
- - lib/netmon-qt/app/components/connstableview/statusbar.rb
333
- - lib/netmon-qt/app/components/connstableview/store.rb
334
328
  - lib/netmon-qt/app/services.rb
335
329
  - lib/netmon-qt/app/services/conns_lookup_service.rb
336
330
  - lib/netmon-qt/app/views.rb
337
331
  - lib/netmon-qt/app/views/mainwindow.rb
332
+ - lib/netmon-qt/app/views/mainwindow/components.rb
333
+ - lib/netmon-qt/app/views/mainwindow/components/connstableview.rb
334
+ - lib/netmon-qt/app/views/mainwindow/components/connstableview/sortfilterproxymodel.rb
335
+ - lib/netmon-qt/app/views/mainwindow/components/connstableview/statusbar.rb
336
+ - lib/netmon-qt/app/views/mainwindow/components/connstableview/store.rb
337
+ - lib/netmon-qt/app/views/mainwindow/ui.rb
338
338
  - lib/netmon-qt/config.rb
339
339
  - lib/netmon-qt/config/initializers/qt6.rb
340
340
  - lib/netmon-qt/config/settings.rb
341
341
  - lib/netmon-qt/lib.rb
342
- - lib/netmon-qt/lib/contrib.rb
343
- - lib/netmon-qt/lib/contrib/sighandler.rb
342
+ - lib/netmon-qt/lib/ctrlc.rb
343
+ - lib/netmon-qt/lib/ctrlc/handler.rb
344
344
  - lib/netmon-qt/lib/netmon.rb
345
345
  - lib/netmon-qt/lib/netmon/connection.rb
346
346
  - lib/netmon-qt/lib/netmon/localaddresschecker.rb
@@ -348,11 +348,9 @@ files:
348
348
  - lib/netmon-qt/version.rb
349
349
  - misc/screenshots/mainwindow.png
350
350
  homepage: https://github.com/souk4711/ruby-netmon-qt
351
- licenses: []
352
- metadata:
353
- homepage_uri: https://github.com/souk4711/ruby-netmon-qt
354
- source_code_uri: https://github.com/souk4711/ruby-netmon-qt
355
- changelog_uri: https://github.com/souk4711/ruby-netmon-qt
351
+ licenses:
352
+ - GPL-3.0-only
353
+ metadata: {}
356
354
  rdoc_options: []
357
355
  require_paths:
358
356
  - lib
@@ -1 +0,0 @@
1
- require_relative "contrib/sighandler"
File without changes