-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b8f1e5
commit 7811f57
Showing
5 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
require "ycp/ycp" | ||
require "ycp/i18n" | ||
require "ycp/exportable" | ||
require "ycp/ui" | ||
|
||
module YCP | ||
class ClientBase | ||
include I18n | ||
extend Exportable | ||
include YCP | ||
include UI | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
require "ycp/ycp" | ||
require "ycp/i18n" | ||
require "ycp/exportable" | ||
require "ycp/ui" | ||
|
||
module YCP | ||
class ModuleBase | ||
include I18n | ||
extend Exportable | ||
include YCP | ||
include UI | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "ycp/term" | ||
|
||
module YCP | ||
module UI | ||
|
||
# Define symbols for the UI | ||
UI_TERMS = [ :BarGraph, :Bottom, :CheckBox, :ColoredLabel, :ComboBox, :Date, | ||
:DownloadProgress, :DumbTab, :DummySpecialWidget, :Empty, :Frame, :HBox, :HBoxvHCenter, | ||
:HMultiProgressMeter, :HSpacing, :HSquash, :HStretch, :HVCenter, :HVSquash, | ||
:HVStretch, :HWeight, :Heading, :IconButton, :Image, :IntField, :Label, :Left, :LogView, | ||
:MarginBox, :MenuButton, :MinHeight, :MinSize, :MinWidth, :MultiLineEdit, | ||
:MultiSelectionBox, :PackageSelector, :PatternSelector, :PartitionSplitter, | ||
:Password, :PkgSpecial, :ProgressBar, :PushButton, :RadioButton, | ||
:RadioButtonGroup, :ReplacePoint, :RichText, :Right, :SelectionBox, :Slider, :Table, | ||
:TextEntry, :Time, :Top, :Tree, :VBox, :VCenter, :VMultiProgressMeter, :VSpacing, | ||
:VSquash, :VStretch, :VWeight, :Wizard, | ||
:id, :opt ] | ||
|
||
# for each symbol define a util function that will create a term | ||
UI_TERMS.each do | term_name | | ||
define_method(term_name) do | *args | | ||
YCP::Term.new(term_name, *args) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$LOAD_PATH << File.dirname(__FILE__) | ||
require "test_helper" | ||
|
||
require "ycp/ui" | ||
|
||
class UITest < YCP::TestCase | ||
include YCP::UI | ||
|
||
def test_shortcuts | ||
assert_equal YCP::Term.new(:HBox), HBox() | ||
assert_equal YCP::Term.new(:HBox, "test"), HBox("test") | ||
end | ||
end |