eric6/IconEditor/IconEditorWindow.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
child 8240
93b8a353c4bf
equal deleted inserted replaced
8221:0572a215bd2f 8222:5994b80b8760
1064 def __openIcon(self): 1064 def __openIcon(self):
1065 """ 1065 """
1066 Private slot to open an icon file. 1066 Private slot to open an icon file.
1067 """ 1067 """
1068 if self.__maybeSave(): 1068 if self.__maybeSave():
1069 if not self.__lastOpenPath: 1069 if (
1070 if self.__project and self.__project.isOpen(): 1070 not self.__lastOpenPath and
1071 self.__lastOpenPath = self.__project.getProjectPath() 1071 self.__project is not None and
1072 self.__project.isOpen()
1073 ):
1074 self.__lastOpenPath = self.__project.getProjectPath()
1072 1075
1073 fileName = E5FileDialog.getOpenFileNameAndFilter( 1076 fileName = E5FileDialog.getOpenFileNameAndFilter(
1074 self, 1077 self,
1075 self.tr("Open icon file"), 1078 self.tr("Open icon file"),
1076 self.__lastOpenPath, 1079 self.__lastOpenPath,
1096 """ 1099 """
1097 Private slot to save the icon with a new name. 1100 Private slot to save the icon with a new name.
1098 1101
1099 @return flag indicating success (boolean) 1102 @return flag indicating success (boolean)
1100 """ 1103 """
1101 if not self.__lastSavePath: 1104 if (
1102 if self.__project and self.__project.isOpen(): 1105 not self.__lastSavePath and
1103 self.__lastSavePath = self.__project.getProjectPath() 1106 self.__project is not None and
1107 self.__project.isOpen()
1108 ):
1109 self.__lastSavePath = self.__project.getProjectPath()
1104 if not self.__lastSavePath and self.__lastOpenPath: 1110 if not self.__lastSavePath and self.__lastOpenPath:
1105 self.__lastSavePath = self.__lastOpenPath 1111 self.__lastSavePath = self.__lastOpenPath
1106 1112
1107 fileName, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 1113 fileName, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
1108 self, 1114 self,

eric ide

mercurial