66
77
88class SyncConnection :
9- FOLDER_SYNC_CONNECTION_LIST = {
10- "container" : names .quickWidget_scrollView_ScrollView ,
11- "type" : "ListView" ,
9+ FOLDER_SYNC_CONNECTION_TREE = {
10+ "container" : names .stack_stackedWidget_QStackedWidget ,
11+ "name" : "accountFoldersTreeView" ,
12+ "type" : "QTreeView" ,
1213 "visible" : True ,
1314 }
1415 FOLDER_SYNC_CONNECTION = {
@@ -18,21 +19,21 @@ class SyncConnection:
1819 "visible" : 1 ,
1920 }
2021 FOLDER_SYNC_CONNECTION_LABEL = {
21- "container" : names .quickWidget_scrollView_ScrollView ,
22- "type" : "Label" ,
23- "unnamed" : 1 ,
24- "visible" : True ,
22+ "container" : names .stackedWidget_accountFoldersTreeView_QTreeView ,
23+ "type" : "QModelIndex" ,
24+ "column" : 0 ,
2525 }
2626 FOLDER_SYNC_CONNECTION_MENU_BUTTON = {
27- "checkable " : False ,
28- "container" : names .quickWidget_scrollView_ScrollView ,
29- "type " : "Button " ,
30- "unnamed " : 1 ,
31- "visible" : True ,
27+ "columnIndex " : 1 ,
28+ "container" : names .stackedWidget_accountFoldersTreeView_QTreeView ,
29+ "name " : "buttonDelegateButton " ,
30+ "type " : "QPushButton" ,
31+ "visible" : 1 ,
3232 }
3333 MENU = {
3434 "type" : "QMenu" ,
3535 "window" : names .settings_OCC_SettingsDialog ,
36+ "name" : "folderOptionsMenu" ,
3637 "visible" : 1 ,
3738 }
3839 DISABLE_VFS_CONFIRMATION_BUTTON = {
@@ -47,16 +48,16 @@ class SyncConnection:
4748 "visible" : 1 ,
4849 }
4950 CANCEL_FOLDER_SYNC_CONNECTION_DIALOG = {
50- "name" : "CancelFolderSyncDialog " ,
51+ "name" : "cancelRemoveFolderSyncButton " ,
5152 "type" : "QPushButton" ,
5253 "visible" : 1 ,
53- "window" : names .confirm_Folder_Sync_Connection_Removal_QMessageBox ,
54+ "window" : names .confirmRemoveFolderSyncDialog_QMessageBox ,
5455 }
5556 REMOVE_FOLDER_SYNC_CONNECTION_BUTTON = {
56- "name" : "RemoveFolderSyncButton " ,
57+ "name" : "removeFolderSyncButton " ,
5758 "type" : "QPushButton" ,
5859 "visible" : 1 ,
59- "window" : names .confirm_Folder_Sync_Connection_Removal_QMessageBox ,
60+ "window" : names .confirmRemoveFolderSyncDialog_QMessageBox ,
6061 }
6162
6263 @staticmethod
@@ -68,17 +69,12 @@ def open_menu(sync_folder=""):
6869 selector = SyncConnection .FOLDER_SYNC_CONNECTION_LABEL .copy ()
6970 selector .update ({"text" : sync_folder })
7071
71- menu_button = None
72-
73- # get the parent of the sync folder label
74- parent = object .parent (
75- squish .waitForObject (selector )
76- ).parent .parent .parent .parent .parent
77- children = object .children (squish .waitForObject (parent ))
78- for obj in children :
79- # get sync folder menu button
80- if obj .id == "moreButton" :
81- menu_button = squish .waitForObject (obj )
72+ folder_sync_connection = squish .waitForObject (selector )
73+ squish .mouseClick (folder_sync_connection )
74+
75+ menu_button_selector = SyncConnection .FOLDER_SYNC_CONNECTION_MENU_BUTTON .copy ()
76+ menu_button_selector .update ({"rowIndex" : folder_sync_connection .row })
77+ menu_button = squish .waitForObject (menu_button_selector )
8278 squish .mouseClick (menu_button )
8379
8480 @staticmethod
@@ -155,11 +151,12 @@ def unselect_folder_in_selective_sync(folder_name):
155151
156152 @staticmethod
157153 def get_folder_connection_count ():
158- return squish .waitForObject (SyncConnection .FOLDER_SYNC_CONNECTION_LIST ).count
154+ tree = squish .waitForObject (SyncConnection .FOLDER_SYNC_CONNECTION_TREE )
155+ return tree .model ().rowCount ()
159156
160157 @staticmethod
161158 def remove_folder_sync_connection (sync_folder = "" ):
162- SyncConnection .perform_action ("Remove folder sync connection" , sync_folder )
159+ SyncConnection .perform_action ("Remove space sync connection" , sync_folder )
163160
164161 @staticmethod
165162 def cancel_folder_sync_connection_removal ():
0 commit comments