Kaydet (Commit) 7e09b365 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Caolán McNamara

tdf#92553: Web Wizard: Not open FTP Configure on Web Wizard Preview Setting

Inherit from WizardDialog instead of object
Define required constants for buttons
Remove or tweak calls to super methods
Fix call setDialogProperties which was wrong since unification of this method
See ee122cfd

With the patch, FTP dialog opens, we can also connect successfully to an ftp server
Still there are bugs to fix then, first of them directory selection

Change-Id: I86c3c9638114216627d92832c26ad780c12860b4
Reviewed-on: https://gerrit.libreoffice.org/18831Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 54a2c8c0
...@@ -19,7 +19,7 @@ import uno ...@@ -19,7 +19,7 @@ import uno
from .WWHID import * from .WWHID import *
from .FTPDialogResources import FTPDialogResources from .FTPDialogResources import FTPDialogResources
from ..ui.UnoDialog2 import UnoDialog2 from ..ui.WizardDialog import WizardDialog
from ..ui.UIConsts import UIConsts from ..ui.UIConsts import UIConsts
from ..ui.event.DataAware import DataAware from ..ui.event.DataAware import DataAware
from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.UnoDataAware import UnoDataAware
...@@ -36,11 +36,6 @@ from com.sun.star.ucb import InteractiveNetworkResolveNameException ...@@ -36,11 +36,6 @@ from com.sun.star.ucb import InteractiveNetworkResolveNameException
from com.sun.star.ucb import OpenCommandArgument2 from com.sun.star.ucb import OpenCommandArgument2
from com.sun.star.ucb.OpenMode import FOLDERS from com.sun.star.ucb.OpenMode import FOLDERS
#PushButtonType_OK_value = uno.getConstantByName( "com.sun.star.awt.PushButtonType.OK" )
#PushButtonType_CANCEL_value = uno.getConstantByName( "com.sun.star.awt.PushButtonType.CANCEL" )
#PushButtonType_HELP_value = uno.getConstantByName( "com.sun.star.awt.PushButtonType.HELP" )
# This is the FTP Dialog. <br/> # This is the FTP Dialog. <br/>
# The Dialog enables the user: # The Dialog enables the user:
# (*) entering FTP server and user information. # (*) entering FTP server and user information.
...@@ -55,7 +50,10 @@ from com.sun.star.ucb.OpenMode import FOLDERS ...@@ -55,7 +50,10 @@ from com.sun.star.ucb.OpenMode import FOLDERS
# I use here the DataAware concept to automatically update # I use here the DataAware concept to automatically update
# the members ip, username, and password (via the methods setXXX(...)) # the members ip, username, and password (via the methods setXXX(...))
# for details see the ui.events.DataAware classes. <br/> # for details see the ui.events.DataAware classes. <br/>
class FTPDialog(UnoDialog2, UIConsts): class FTPDialog(WizardDialog):
RES_OK = 2
RES_CANCEL = 3
RES_HELP = 4
# A Constant used for the setLabel(int) method to change the # A Constant used for the setLabel(int) method to change the
# status-display. "unknown" is the status when the user first # status-display. "unknown" is the status when the user first
...@@ -97,7 +95,7 @@ class FTPDialog(UnoDialog2, UIConsts): ...@@ -97,7 +95,7 @@ class FTPDialog(UnoDialog2, UIConsts):
# @throws Exception # @throws Exception
def __init__(self, xmsf, p, oWizardResource): def __init__(self, xmsf, p, oWizardResource):
super(FTPDialog, self).__init__(xmsf) super(FTPDialog, self).__init__(xmsf, HID_FTP)
self.publish = p self.publish = p
templateDir = p.root.soTemplateDir templateDir = p.root.soTemplateDir
...@@ -113,8 +111,8 @@ class FTPDialog(UnoDialog2, UIConsts): ...@@ -113,8 +111,8 @@ class FTPDialog(UnoDialog2, UIConsts):
self.ucb = UCB(xmsf) self.ucb = UCB(xmsf)
# set dialog properties... # set dialog properties...
self.setDialogProperties( True, 160, HelpIds.getHelpIdString(HID_FTP), self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
True, "FTPDialog", 167, 82, self.resources.resFTPDialog_title, 222) self.resources.resFTPDialog_title, 310)
# add controls to dialog # add controls to dialog
self.build() self.build()
...@@ -174,13 +172,13 @@ class FTPDialog(UnoDialog2, UIConsts): ...@@ -174,13 +172,13 @@ class FTPDialog(UnoDialog2, UIConsts):
(14, HelpIds.getHelpIdString(HID_FTP_BTN_PATH), self.resources.resbtnDir_value, "btnDir", 199, 112, 12, 16), self) (14, HelpIds.getHelpIdString(HID_FTP_BTN_PATH), self.resources.resbtnDir_value, "btnDir", 199, 112, 12, 16), self)
self.btnOK = self.insertButton("btnOK", None, self.btnOK = self.insertButton("btnOK", None,
PROPNAMES_BUTTON2, PROPNAMES_BUTTON2,
(14, HelpIds.getHelpIdString(HID_FTP_OK), self.resources.resbtnOK_value, "btnOK", 165, 142, PushButtonType_OK_value, 13, 50), self) (14, HelpIds.getHelpIdString(HID_FTP_OK), self.resources.resbtnOK_value, "btnOK", 165, 142, self.RES_OK, 13, 50), self)
self.btnCancel = self.insertButton("btnCancel", self.btnCancel = self.insertButton("btnCancel",
None, PROPNAMES_BUTTON2, None, PROPNAMES_BUTTON2,
(14, HelpIds.getHelpIdString(HID_FTP_CANCEL), self.resources.resbtnCancel_value, "btnCancel", 113, 142, PushButtonType_CANCEL_value, 14, 50), self) (14, HelpIds.getHelpIdString(HID_FTP_CANCEL), self.resources.resbtnCancel_value, "btnCancel", 113, 142, self.RES_CANCEL, 14, 50), self)
self.btnHelp = self.insertButton("btnHelp", None, self.btnHelp = self.insertButton("btnHelp", None,
PROPNAMES_BUTTON2, PROPNAMES_BUTTON2,
(14, "", self.resources.resbtnHelp_value, "btnHelp", 57, 142, PushButtonType_HELP_value, 15, 50), self) (14, "", self.resources.resbtnHelp_value, "btnHelp", 57, 142, self.RES_HELP, 15, 50), self)
# Make hostname, username and password text fields data aware. # Make hostname, username and password text fields data aware.
......
...@@ -21,8 +21,6 @@ class FTPDialogResources(object): ...@@ -21,8 +21,6 @@ class FTPDialogResources(object):
RID_COMMON_START = 500 RID_COMMON_START = 500
def __init__(self, oWizardResource): def __init__(self, oWizardResource):
super(FTPDialogResources, self).__init__(xmsf, self.MODULE_NAME)
self.resFTPDialog_title = oWizardResource.getResText( self.resFTPDialog_title = oWizardResource.getResText(
self.RID_FTPDIALOG_START + 0) self.RID_FTPDIALOG_START + 0)
self.reslblUsername_value = oWizardResource.getResText( self.reslblUsername_value = oWizardResource.getResText(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment