Kaydet (Commit) 05f24922 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>
(cherry picked from commit 7e09b365)
Reviewed-on: https://gerrit.libreoffice.org/19068
üst 0f878457
......@@ -19,7 +19,7 @@ import uno
from .WWHID import *
from .FTPDialogResources import FTPDialogResources
from ..ui.UnoDialog2 import UnoDialog2
from ..ui.WizardDialog import WizardDialog
from ..ui.UIConsts import UIConsts
from ..ui.event.DataAware import DataAware
from ..ui.event.UnoDataAware import UnoDataAware
......@@ -36,11 +36,6 @@ from com.sun.star.ucb import InteractiveNetworkResolveNameException
from com.sun.star.ucb import OpenCommandArgument2
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/>
# The Dialog enables the user:
# (*) entering FTP server and user information.
......@@ -55,7 +50,10 @@ from com.sun.star.ucb.OpenMode import FOLDERS
# I use here the DataAware concept to automatically update
# the members ip, username, and password (via the methods setXXX(...))
# 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
# status-display. "unknown" is the status when the user first
......@@ -97,7 +95,7 @@ class FTPDialog(UnoDialog2, UIConsts):
# @throws Exception
def __init__(self, xmsf, p, oWizardResource):
super(FTPDialog, self).__init__(xmsf)
super(FTPDialog, self).__init__(xmsf, HID_FTP)
self.publish = p
templateDir = p.root.soTemplateDir
......@@ -113,8 +111,8 @@ class FTPDialog(UnoDialog2, UIConsts):
self.ucb = UCB(xmsf)
# set dialog properties...
self.setDialogProperties( True, 160, HelpIds.getHelpIdString(HID_FTP),
True, "FTPDialog", 167, 82, self.resources.resFTPDialog_title, 222)
self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
self.resources.resFTPDialog_title, 310)
# add controls to dialog
self.build()
......@@ -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)
self.btnOK = self.insertButton("btnOK", None,
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",
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,
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.
......
......@@ -21,8 +21,6 @@ class FTPDialogResources(object):
RID_COMMON_START = 500
def __init__(self, oWizardResource):
super(FTPDialogResources, self).__init__(xmsf, self.MODULE_NAME)
self.resFTPDialog_title = oWizardResource.getResText(
self.RID_FTPDIALOG_START + 0)
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