• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-samba-server / 10830818621

12 Sep 2024 12:29PM UTC coverage: 0.989%. First build
10830818621

push

github

lslezak
Import the changes from the OBS SLE15-SP6 project

44 of 4449 relevant lines covered (0.99%)

0.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/include/samba-server/wizards.rb
1
# encoding: utf-8
2

3
# ------------------------------------------------------------------------------
4
# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
5
#
6
#
7
# This program is free software; you can redistribute it and/or modify it under
8
# the terms of version 2 of the GNU General Public License as published by the
9
# Free Software Foundation.
10
#
11
# This program is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along with
16
# this program; if not, contact Novell, Inc.
17
#
18
# To contact Novell about this file by physical or electronic mail, you may find
19
# current contact information at www.novell.com.
20
# ------------------------------------------------------------------------------
21

22
# File:        include/samba-server/wizards.ycp
23
# Package:        Configuration of samba-server
24
# Summary:        Wizards definitions
25
# Authors:        Stanislav Visnovsky <stanislav.visnovsky@suse.cz>
26
#
27
# $Id$
28
module Yast
×
29
  module SambaServerWizardsInclude
×
30
    def initialize_samba_server_wizards(include_target)
×
31
      Yast.import "UI"
×
32

33
      textdomain "samba-server"
×
34

35
      Yast.import "Sequencer"
×
36
      Yast.import "Wizard"
×
37
      Yast.import "Label"
×
38
      Yast.import "Mode"
×
39

40
      Yast.import "SambaServer"
×
41

42
      Yast.include include_target, "samba-server/complex.rb"
×
43
      Yast.include include_target, "samba-server/dialogs.rb"
×
44
    end
×
45

46
    # Main workflow of the samba-server configuration
47
    # @return sequence result
48
    def MainSequence
×
49
      aliases = {
×
50
        "inst_step1"          => lambda { Installation_Step1() },
×
51
        "conf_tab"            => lambda { Installation_Conf_Tab() },
×
52
        "share_edit"          => lambda { EditShareDialog() },
×
53
        "share_add"           => lambda { AddShareDialog() },
×
54
        "passdb_edit"         => lambda { PassdbDialog() },
×
55
        "global_settings"     => lambda { GlobalSettingsDialog() },
×
56
        "ensure_root_account" => lambda { EnsureRootAccountDialog() },
×
57
        "ask_join_domain"     => lambda { AskJoinDomainDialog() }
×
58
      }
×
59

60
      sequence = {
×
61
        "ws_start"            => "inst_step1",
×
62
        "inst_step1"          => {
×
63
          :cancel => :cancel,
×
64
          :abort  => :abort,
×
65
          :next   => "conf_tab"
×
66
        },
×
67
        "conf_tab"            => {
×
68
          :cancel          => :cancel,
×
69
          :abort           => :abort,
×
70
          :add             => "share_add",
×
71
          :edit            => "share_edit",
×
72
          :passdb          => "passdb_edit",
×
73
          :global_settings => "global_settings",
×
74
          :next            => "ask_join_domain"
×
75
        },
×
76
        "ask_join_domain"     => {
×
77
          :cancel => "conf_tab",
×
78
          :error  => "conf_tab",
×
79
          :skip   => :finish,
×
80
          :abort  => :abort,
×
81
          :ok     => "ensure_root_account"
×
82
        },
×
83
        "ensure_root_account" => {
×
84
          :cancel => "conf_tab",
×
85
          :back   => "conf_tab",
×
86
          :abort  => :abort,
×
87
          :ok     => :finish
×
88
        },
×
89
        "global_settings"     => {
×
90
          :cancel => :cancel,
×
91
          :abort  => :abort,
×
92
          :next   => "conf_tab"
×
93
        },
×
94
        "share_edit"          => {
×
95
          :cancel => :cancel,
×
96
          :abort  => :abort,
×
97
          :next   => "conf_tab"
×
98
        },
×
99
        "share_add"           => {
×
100
          :cancel => :cancel,
×
101
          :abort  => :abort,
×
102
          :next   => "conf_tab"
×
103
        },
×
104
        "passdb_edit"         => {
×
105
          :abort  => :abort,
×
106
          :cancel => :cancel,
×
107
          :next   => "conf_tab"
×
108
        }
×
109
      }
×
110

111
      # setup the abort function
112
      #    SambaServer::AbortFunction = SambaServer::ServerReallyAbort;
113

114
      # run wizard only first time and not in autoyast
115
      if Mode.config || SambaServer.Configured
×
116
        Ops.set(sequence, "ws_start", "conf_tab")
×
117

118
        @return_tab = "shares" if !Mode.config
×
119
      end
×
120

121
      ret = Sequencer.Run(aliases, sequence)
×
122

123
      deep_copy(ret)
×
124
    end
×
125

126
    # Whole configuration of samba-server
127
    # @return sequence result
128
    def SambaServerSequence
×
129
      aliases = {
×
130
        "read"  => [lambda { ReadDialog() }, true],
×
131
        "main"  => lambda { MainSequence() },
×
132
        "write" => [lambda { WriteDialog() }, true]
×
133
      }
×
134

135
      sequence = {
×
136
        "ws_start" => "read",
×
137
        "read"     => { :abort => :abort, :next => "main" },
×
138
        "main"     => {
×
139
          :cancel => :abort,
×
140
          :abort  => :abort,
×
141
          :finish => "write"
×
142
        },
×
143
        "write"    => { :abort => :abort, :next => :next }
×
144
      }
×
145

146
      Wizard.CreateDialog
×
147
      Wizard.SetDesktopTitleAndIcon("org.opensuse.yast.SambaServer")
×
148

149
      ret = Sequencer.Run(aliases, sequence)
×
150

151
      UI.CloseDialog
×
152
      deep_copy(ret)
×
153
    end
×
154

155
    # Whole configuration of samba-server but without reading and writing.
156
    # For use with autoinstallation.
157
    # @return sequence result
158
    def SambaServerAutoSequence
×
159
      # Initialization dialog caption
160
      caption = _("Samba Server Configuration")
×
161
      # Initialization dialog contents
162
      contents = Label(_("Initializing..."))
×
163

164
      Wizard.CreateDialog
×
165
      Wizard.SetContentsButtons(
×
166
        caption,
×
167
        contents,
×
168
        "",
×
169
        Label.BackButton,
×
170
        Label.NextButton
×
171
      )
×
172

173
      ret = MainSequence()
×
174

175
      UI.CloseDialog
×
176
      deep_copy(ret)
×
177
    end
×
178
  end
×
179
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc