Example #1
0
 def __init__(self):
     # get world
     self._world = hWorld()
     self._projects = self._world.projects()
     # make window and tabs
     self.w = Window((self._width, self._height), self._title)
     x = self._padding
     y = self._padding
     self.w.tabs = Tabs(
                 (x, y,
                 -self._padding,
                 -(self._padding * 2) - self._bar_height) ,
                 [ "fonts", "project", "actions", "settings" ],
                 sizeStyle='small')
     _font_project = self.w.tabs[0]
     _preflight = self.w.tabs[1]
     _actions = self.w.tabs[2]
     _settings = self.w.tabs[3]
     #--------------
     # font project
     #--------------
     _x = self._padding
     _y = self._padding
     _popup_width = (self._width / 2)
     # projects
     _font_project._project = PopUpButton(
                 (_x, _y,
                 _popup_width, self._box_height),
                 self._projects,
                 callback=self.fonts_callback,
                 sizeStyle='small')
     #------------
     # font list
     _x = self._padding
     _y += (self._box_height + self._padding)
     _font_project.fonts_list = List(
                 (_x, _y,
                 -self._padding,
                 -(self._padding*2) - self._box_height ),
                 [],
                 drawFocusRing=False)
     #---------
     # masters
     _label = "masters"
     _y = - self._padding - self._box_height
     _checkbox_width = 60
     _font_project._masters = CheckBox(
                 (_x, _y,
                 _checkbox_width, self._box_height),
                 _label, value=self._font_project[_label],
                 callback=self.fonts_callback,
                 sizeStyle='small')
     # instances
     _label = "instances"
     _x += (_checkbox_width + self._padding)
     _checkbox_width = 70
     _font_project._instances = CheckBox(
                 (_x, _y,
                 _checkbox_width, self._box_height),
                 _label, value=self._font_project[_label],
                 callback=self.fonts_callback,
                 sizeStyle='small')
     # select all
     _label = "select all"
     _x += (_checkbox_width + self._padding)
     _checkbox_width = 90
     _font_project._select_all = CheckBox(
                 (_x, _y,
                 _checkbox_width, self._box_height),
                 _label,
                 callback=self.select_all_fonts_callback,
                 sizeStyle='small')
     #------------
     # load fonts
     self.get_project()
     self.get_fonts()
     #-----------
     # preflight
     #-----------
     # build checkboxes
     self._preflight_build()
     # select all
     _label = "select all"
     _x = self._padding
     _y = -(self._box_height + self._padding)
     _checkbox_width = 100
     _preflight._select_all = CheckBox(
                 (_x, _y,
                 _checkbox_width, self._box_height),
                 _label, value=False,
                 callback=self.select_all_preflight_callback,
                 sizeStyle='small')
     # apply
     _label = "apply"
     _x = -(self._button_width + self._padding)
     _y = -(self._box_height + self._padding)
     _preflight._apply_preflight = Button(
                 (_x, _y,
                 self._button_width, self._box_height),
                 _label,
                 callback=self.preflight_callback,
                 sizeStyle='small')
     #---------
     # actions
     #---------
     # patterns
     _x = _y = self._padding
     # build checkboxes
     self._actions_build()
     # select all
     _label = "select all"
     _y = -(self._box_height + self._padding)
     _checkbox_width = 100
     _actions._select_all = CheckBox(
                 (_x, _y,
                 _checkbox_width, self._box_height),
                 _label, value=False,
                 callback=self.select_all_actions_callback,
                 sizeStyle='small')
     # apply
     _label = "apply"
     _x = -(self._button_width + self._padding)
     _y = -(self._box_height + self._padding)
     _actions._apply_actions = Button(
                 (_x, _y,
                 self._button_width, self._box_height),
                 _label,
                 callback=self.actions_callback,
                 sizeStyle='small')
     #----------
     # settings
     #----------
     _x = self._padding
     _y = self._padding
     _col1 = (self._width - (self._padding*5))/4
     _col2 = _col1 # 134
     # root folder
     _label = "root folder"
     _settings._root_folder_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
                 sizeStyle='small')
     _settings._root_folder = EditText(
                 (_x + _col1, _y,
                 -self._padding, self._box_height),
                 hTools2.ROOT, readOnly=True,
                 sizeStyle='small')
     # test fonts
     _label = "test fonts"
     _y += (self._box_height + self._padding)
     _settings._ind_folder_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
                 sizeStyle='small')
     _settings._test_folder = EditText(
                 (_x + _col1, _y,
                 -self._padding, self._box_height),
                 self._world.settings.hDict['test'],
                 sizeStyle='small')
     # ftp server
     _label = "ftp server"
     _y += (self._box_height + self._padding)
     _settings._ftp_server_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
                 sizeStyle='small')
     _settings._ftp_server = EditText(
                 (_x + _col1, _y,
                 -self._padding, self._box_height),
                 self._world.settings.hDict['ftp']['url'],
                 sizeStyle='small')
     # ftp login
     _label = "ftp login"
     _y += (self._box_height + self._padding)
     _settings._ftp_login_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
             sizeStyle='small')
     _settings._ftp_login = EditText(
                 (_x + _col1, _y,
                 _col2, self._box_height),
                 self._world.settings.hDict['ftp']['login'],
                 sizeStyle='small')
     # password
     _label = "password"
     _x += (_col1 + _col2 + self._padding)
     _settings._ftp_password_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
                 sizeStyle='small')
     _x_ = -_col2 - self._padding
     _settings._ftp_password = EditText(
                 (_x_, _y,
                 _col2, self._box_height),
                 self._world.settings.hDict['ftp']['password'],
                 sizeStyle='small')
     # ftp folder
     _label = "ftp folder"
     _x = self._padding
     _y += (self._box_height + self._padding)
     _settings._ftp_folder_label = TextBox(
                 (_x, _y,
                 _col1, self._box_height),
                 _label,
                 sizeStyle='small')
     _settings._ftp_folder = EditText(
                 (_x + _col1, _y,
                 -self._padding, self._box_height),
                 self._world.settings.hDict['ftp']['folder'],
                 sizeStyle='small')
     # save
     _label = "save"
     _x = -(self._button_width + self._padding)
     _y = -(self._box_height + self._padding)
     _settings._save = Button(
                 (_x, _y,
                 self._button_width, self._box_height),
                 _label,
                 callback=self.save_settings_callback,
                 sizeStyle='small')
     # test ftp
     _label = "test ftp"
     _x += -(self._button_width + self._padding)
     _settings._test = Button(
                 (_x, _y,
                 self._button_width, self._box_height),
                 _label, callback=self.test_ftp_callback,
                 sizeStyle='small')
     #-------------
     # open window
     #-------------
     _x = self._width / 2
     _y = (self._padding + self._bar_height)
     # progress bar
     self.w.bar = ProgressBar(
                (_x, -_y,
                -self._padding,
                self._bar_height),
                isIndeterminate=True, sizeStyle='small')
     # open window
     self.w.open()
Example #2
0
 def __init__(self):
     self.world = hWorld()
     self.w = FloatingWindow(
                 (self._width,
                 self._height),
                 self._title)
     # FTP URL
     x = self._padding
     y = self._padding
     self.w.ftp_url_label = TextBox(
                 (x, y,
                 self._column_1,
                 self._box_height),
                 "FTP server",
                 sizeStyle="small")
     x += self._column_1
     self.w.ftp_url_value = EditText(
                 (x, y,
                 -self._padding,
                 self._box_height),
                 self.world.settings.hDict['ftp']['url'],
                 sizeStyle="small")
     # FTP login
     x = self._padding
     y += self._box_height + self._padding
     self.w.ftp_login_label = TextBox(
                 (x, y,
                 self._column_1,
                 self._box_height),
                 "FTP login",
                 sizeStyle="small")
     x += self._column_1
     self.w.ftp_login_value = EditText(
                 (x, y,
                 self._box_width_small,
                 self._box_height),
                 self.world.settings.hDict['ftp']['login'],
                 sizeStyle="small")
     # password
     x = (self._width / 2) + 10
     self.w.ftp_password_label = TextBox(
                 (x, y,
                 self._column_1,
                 self._box_height),
                 "password",
                 sizeStyle="small")
     x += self._column_1
     self.w.ftp_password_value = EditText(
                 (x, y,
                 self._box_width_small,
                 self._box_height),
                 '*' * len(self.world.settings.hDict['ftp']['password']),
                 callback=self._password_callback,
                 sizeStyle="small")
     # FTP folder
     x = self._padding
     y += self._box_height + self._padding
     self.w.ftp_folder_label = TextBox(
                 (x, y,
                 self._column_1,
                 self._box_height),
                 "FTP folder",
                 sizeStyle="small")
     x += self._column_1
     self.w.ftp_folder_value = EditText(
                 (x, y,
                 -self._padding,
                 self._box_height),
                 self.world.settings.hDict['ftp']['folder'],
                 sizeStyle="small")
     y += self._box_height + self._padding
     # save button
     x = self._padding
     _button_width = (self._width - (self._padding * 5)) / 4
     # print
     self.w.button_print = SquareButton(
                 (x, y,
                 _button_width,
                 self._button_2_height),
                 "print",
                 callback=self.print_callback,
                 sizeStyle="small")
     x += _button_width + self._padding
     # test ftp
     self.w.button_test_ftp = SquareButton(
                 (x, y,
                 _button_width,
                 self._button_2_height),
                 "test FTP",
                 callback=self.test_ftp_callback,
                 sizeStyle="small")
     x += _button_width + self._padding
     self.w.button_revert = SquareButton(
                 (x, y,
                 _button_width,
                 self._button_2_height),
                 "revert",
                 callback=self.revert_callback,
                 sizeStyle="small")
     x += _button_width + self._padding
     self.w.button_save = SquareButton(
                 (x, y,
                 _button_width,
                 self._button_2_height),
                 "save",
                 callback=self.save_callback,
                 sizeStyle="small")
     # open
     self.w.open()