Skip to content

Commit

Permalink
- allow translations for alignment options (bnc#877910)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Jun 2, 2014
1 parent b073656 commit 74a64f0
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
6 changes: 6 additions & 0 deletions package/yast2-storage.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 02 17:08:44 CEST 2014 - aschnell@suse.de

- allow translations for alignment options (bnc#877910)
- version 3.1.29

-------------------------------------------------------------------
Wed May 21 14:53:21 CEST 2014 - gs@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-storage
Version: 3.1.28
Version: 3.1.29
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
59 changes: 35 additions & 24 deletions src/include/partitioning/ep-settings.rb
@@ -1,6 +1,6 @@
# encoding: utf-8

# Copyright (c) 2012 Novell, Inc.
# Copyright (c) [2012-2014] Novell, Inc.
#
# All Rights Reserved.
#
Expand All @@ -25,7 +25,9 @@
# Authors: Arvin Schnell <aschnell@suse.de>
module Yast
module PartitioningEpSettingsInclude

def initialize_partitioning_ep_settings(include_target)

textdomain "storage"


Expand Down Expand Up @@ -66,8 +68,26 @@ def initialize_partitioning_ep_settings(include_target)
# combo box entry
:path => _("Device Path")
}

@alignments = {
# combo box entry
:align_optimal => _("Optimal"),
# combo box entry
:align_cylinder => _("Cylinder")
}

@display_names = {
# combo box entry
:device => _("Device Name"),
# combo box entry
:id => _("Device ID"),
# combo box entry
:path => _("Device Path")
}

end


def CreateSettingsPanel(user_data)
user_data = deep_copy(user_data)
_PreselectVisibleFields = lambda do
Expand All @@ -94,10 +114,13 @@ def CreateSettingsPanel(user_data)
Item(Id(fs), FileSystems.GetName(fs, "Error"))
end

partalign_items = Builtins.maplist([:align_optimal, :align_cylinder]) do |pal|
Item(Id(pal), Builtins.substring(Builtins.sformat("%1", pal), 7))
alignment_items = Builtins.maplist(@alignments) do |item_id, label|
Item(Id(item_id), label)
end

display_name_items = Builtins.maplist(@display_names) do |item_id, label|
Item(Id(item_id), label)
end

UI.ReplaceWidget(
:tree_panel,
Expand All @@ -108,9 +131,7 @@ def CreateSettingsPanel(user_data)
VBox(
Left(
term(
:ComboBoxSelected,
Id(:default_mountby),
Opt(:notify),
:ComboBoxSelected, Id(:default_mountby), Opt(:notify),
# combo box label
_("Default Mount by"),
mount_by_items,
Expand All @@ -119,9 +140,7 @@ def CreateSettingsPanel(user_data)
),
Left(
term(
:ComboBoxSelected,
Id(:default_fs),
Opt(:notify),
:ComboBoxSelected, Id(:default_fs), Opt(:notify),
# combo box label
_("Default File System"),
filesystem_items,
Expand All @@ -130,31 +149,20 @@ def CreateSettingsPanel(user_data)
),
Left(
term(
:ComboBoxSelected,
Id(:part_align),
Opt(:notify),
:ComboBoxSelected, Id(:part_align), Opt(:notify),
# combo box label
_("Alignment of Newly Created Partitions"),
partalign_items,
alignment_items,
Id(Storage.GetPartitionAlignment)
)
),
VSpacing(1),
Left(
term(
:ComboBoxSelected,
Id(:display_name),
Opt(:notify),
:ComboBoxSelected, Id(:display_name), Opt(:notify),
# combo box label
_("Show Storage Devices by"),
[
# combo box entry
Item(Id(:device), _("Device Name")),
# combo box entry
Item(Id(:id), _("Device ID")),
# combo box entry
Item(Id(:path), _("Device Path"))
],
display_name_items,
Id(StorageSettings.GetDisplayName)
)
),
Expand Down Expand Up @@ -259,6 +267,8 @@ def HandleSettingsPanel(user_data, event)

nil
end


def DestroySettingsPanel(user_data)
user_data = deep_copy(user_data)
selected = Convert.convert(
Expand Down Expand Up @@ -288,5 +298,6 @@ def DestroySettingsPanel(user_data)

nil
end

end
end
2 changes: 2 additions & 0 deletions src/modules/StorageSettings.rb
Expand Up @@ -47,6 +47,7 @@ def main
@modified = false
end


def GetModified
@modified
end
Expand Down Expand Up @@ -150,6 +151,7 @@ def FilterOverview(fields)
Builtins.filter(fields) { |field| !Builtins.setcontains(hidden, field) }
end


def InvertVisibleFields(all_fields, selected)
all_fields = deep_copy(all_fields)
selected = deep_copy(selected)
Expand Down

0 comments on commit 74a64f0

Please sign in to comment.