Module: Yast::PrinterDialogsInclude

Defined in:
../../src/include/printer/dialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_printer_dialogs(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File '../../src/include/printer/dialogs.rb', line 30

def initialize_printer_dialogs(include_target)
  Yast.import "UI"

  textdomain "printer"

  Yast.import "Label"
  Yast.import "DialogTree"

  Yast.include include_target, "printer/helps.rb"
  Yast.include include_target, "printer/overview.rb"
  Yast.include include_target, "printer/printingvianetwork.rb"
  Yast.include include_target, "printer/sharing.rb"
  Yast.include include_target, "printer/policies.rb"
  Yast.include include_target, "printer/autoconfig.rb"

  @widgets_handling = {
    "OVERVIEW"        => {
      "widget"        => :custom,
      "custom_widget" => @widgetOverview,
      "init"          => fun_ref(method(:initOverview), "void (string)"),
      "handle"        => fun_ref(
        method(:handleOverview),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "overview", "")
    },
    "NETWORKPRINTING" => {
      "widget"        => :custom,
      "custom_widget" => @widgetNetworkPrinting,
      "init"          => fun_ref(
        method(:initNetworkPrinting),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleNetworkPrinting),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(
        @HELPS,
        "printing_via_network_dialog",
        ""
      )
    },
    "SHARING"         => {
      "widget"        => :custom,
      "custom_widget" => @widgetSharing,
      "init"          => fun_ref(method(:initSharing), "void (string)"),
      "handle"        => fun_ref(
        method(:handleSharing),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "sharing_dialog", "")
    },
    "POLICIES"        => {
      "widget"        => :custom,
      "custom_widget" => @widgetPolicies,
      "init"          => fun_ref(method(:initPolicies), "void (string)"),
      "handle"        => fun_ref(
        method(:handlePolicies),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "policies", "")
    },
    "AUTOCONFIG"      => {
      "widget"        => :custom,
      "custom_widget" => @widgetAutoconfig,
      "init"          => fun_ref(method(:initAutoconfig), "void (string)"),
      "handle"        => fun_ref(
        method(:handleAutoconfig),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "autoconfig", "")
    }
  }

  @tabs_description = {
    "overview"   => {
      "header"          => _("Printer Configurations"),
      "tree_item_label" => _("Printer Configurations"),
      "caption"         => _("Printer Configurations"),
      "contents"        => VBox("OVERVIEW"),
      "widget_names"    => ["OVERVIEW"]
    },
    "network"    => {
      "header"          => _("Print via Network"),
      "tree_item_label" => _("Print via Network"),
      "caption"         => _("Print via Network"),
      "contents"        => VBox("NETWORKPRINTING"),
      "widget_names"    => ["NETWORKPRINTING"]
    },
    "sharing"    => {
      "header"          => _("Share Printers"),
      "tree_item_label" => _("Share Printers"),
      "caption"         => _("Share Printers"),
      "contents"        => VBox("SHARING"),
      "widget_names"    => ["SHARING"]
    },
    "policies"   => {
      "header"          => _("Policies"),
      "tree_item_label" => _("Policies"),
      "caption"         => _("Policies"),
      "contents"        => VBox("POLICIES"),
      "widget_names"    => ["POLICIES"]
    },
    "autoconfig" => {
      "header"          => _("Automatic Configuration"),
      "tree_item_label" => _("Automatic Configuration"),
      "caption"         => _("Automatic Configuration"),
      "contents"        => VBox("AUTOCONFIG"),
      "widget_names"    => ["AUTOCONFIG"]
    }
  }

  @AutoDialog_widgets_handling = {
    "OVERVIEW"        => {
      "widget"        => :custom,
      "custom_widget" => @widgetOverview,
      "init"          => fun_ref(method(:initOverview), "void (string)"),
      "handle"        => fun_ref(
        method(:handleOverview),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "AutoYaSToverview", "")
    },
    "NETWORKPRINTING" => {
      "widget"        => :custom,
      "custom_widget" => @widgetNetworkPrinting,
      "init"          => fun_ref(
        method(:initNetworkPrinting),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleNetworkPrinting),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(
        @HELPS,
        "printing_via_network_dialog",
        ""
      )
    }
  }

  @AutoDialog_tabs_description = {
    "overview" => {
      "header"          => _("AutoYaST Printer Configurations"),
      "tree_item_label" => _("Printer Configurations"),
      "caption"         => _("AutoYaST Printer Configurations"),
      "contents"        => VBox("OVERVIEW"),
      "widget_names"    => ["OVERVIEW"]
    },
    "network"  => {
      "header"          => _("AutoYaST Print via Network Settings"),
      "tree_item_label" => _("Print via Network"),
      "caption"         => _("AutoYaST Print via Network Settings"),
      "contents"        => VBox("NETWORKPRINTING"),
      "widget_names"    => ["NETWORKPRINTING"]
    }
  }
end

- (Object) runAutoDialog



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File '../../src/include/printer/dialogs.rb', line 221

def runAutoDialog
  caption = _("AutoYaST Settings for Printing with CUPS via Network")
  ret = DialogTree.ShowAndRun(
    {
      "ids_order"      => ["overview", "network"],
      "initial_screen" => "overview",
      "screens"        => @AutoDialog_tabs_description,
      "widget_descr"   => @AutoDialog_widgets_handling,
      # All the dialogs in "ids_order" are single (step) configuration dialogs
      # and according to the YaST Style Guide (dated Thu, 06 Nov 2008)
      # there is no longer a "abort" functionality which exits the whole module.
      # Instead this button is now named "Cancel" and its functionality is
      # to go back to the Overview dialog (i.e. what the "back" button would do)
      # because it reads "Cancel - Closes the window and returns to the overview."
      # Therefore the button with the "abort" functionality is not shown at all
      # and the button with the "back" functionality is named "Cancel".
      "abort_button"   => nil,
      "back_button"    => Label.CancelButton,
      "next_button"    => Label.OKButton
    }
  )
  ret
end

- (Object) runMainDialog



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File '../../src/include/printer/dialogs.rb', line 191

def runMainDialog
  caption = _("Detected Printers")
  ret = DialogTree.ShowAndRun(
    {
      "ids_order"      => [
        "overview",
        "network",
        "sharing",
        "policies",
        "autoconfig"
      ],
      "initial_screen" => "overview",
      "screens"        => @tabs_description,
      "widget_descr"   => @widgets_handling,
      # All the dialogs in "ids_order" are single (step) configuration dialogs
      # and according to the YaST Style Guide (dated Thu, 06 Nov 2008)
      # there is no longer a "abort" functionality which exits the whole module.
      # Instead this button is now named "Cancel" and its functionality is
      # to go back to the Overview dialog (i.e. what the "back" button would do)
      # because it reads "Cancel - Closes the window and returns to the overview."
      # Therefore the button with the "abort" functionality is not shown at all
      # and the button with the "back" functionality is named "Cancel".
      "abort_button"   => nil,
      "back_button"    => Label.CancelButton,
      "next_button"    => Label.OKButton
    }
  )
  ret
end