Skip to content

Commit 187ef56

Browse files
committed
Update file browser filters for all files and IOU images
1 parent 9707071 commit 187ef56

10 files changed

+17
-17
lines changed

gns3/dialogs/symbol_selection_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def getSymbol(self):
184184
def _symbolBrowserSlot(self):
185185

186186
# supported image file formats
187-
file_formats = "Image files (*.svg *.bmp *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm *.gif);;All files (*.*)"
187+
file_formats = "Image files (*.svg *.bmp *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm *.gif);;All files (*)"
188188
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Image", SymbolSelectionDialog._symbols_dir, file_formats)
189189
if not path:
190190
return

gns3/graphics_view.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def importConfigActionSlot(self):
12551255
path, _ = QtWidgets.QFileDialog.getOpenFileName(self,
12561256
"Import {}".format(os.path.basename(config_file)),
12571257
self._import_config_directory,
1258-
"All files (*.*);;Config files (*.cfg)",
1258+
"All files (*);;Config files (*.cfg)",
12591259
"Config files (*.cfg)")
12601260
if not path:
12611261
continue
@@ -1302,7 +1302,7 @@ def exportConfigActionSlot(self):
13021302

13031303
for item in items:
13041304
for config_file in item.node().configFiles():
1305-
path, ok = QtWidgets.QFileDialog.getSaveFileName(self, "Export file", os.path.join(self._export_config_directory, item.node().name() + "_" + os.path.basename(config_file)), "All files (*.*);;Config files (*.cfg)")
1305+
path, ok = QtWidgets.QFileDialog.getSaveFileName(self, "Export file", os.path.join(self._export_config_directory, item.node().name() + "_" + os.path.basename(config_file)), "All files (*);;Config files (*.cfg)")
13061306
if not path:
13071307
continue
13081308
self._export_config_directory = os.path.dirname(path)

gns3/main_window.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def openApplianceActionSlot(self, *args):
428428
if not os.path.exists(self._appliance_dir):
429429
directory = Topology.instance().projectsDirPath()
430430
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Import appliance", directory,
431-
"All files (*.*);;GNS3 Appliance (*.gns3appliance *.gns3a)",
431+
"All files (*);;GNS3 Appliance (*.gns3appliance *.gns3a)",
432432
"GNS3 Appliance (*.gns3appliance *.gns3a)")
433433
if path:
434434
self.loadPath(path)
@@ -447,7 +447,7 @@ def openProjectActionSlot(self):
447447
if self._project_dir is None or not os.path.exists(self._project_dir):
448448
directory = Topology.instance().projectsDirPath()
449449
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Open project", directory,
450-
"All files (*.*);;GNS3 Project (*.gns3);;GNS3 Portable Project (*.gns3project *.gns3p);;NET files (*.net)",
450+
"All files (*);;GNS3 Project (*.gns3);;GNS3 Portable Project (*.gns3project *.gns3p);;NET files (*.net)",
451451
"GNS3 Project (*.gns3)")
452452
if path:
453453
self.loadPath(path)
@@ -920,7 +920,7 @@ def _insertImageActionSlot(self):
920920
Slot called when inserting an image on the scene.
921921
"""
922922
# supported image file formats
923-
file_formats = "Image files (*.svg *.bmp *.jpeg *.jpg *.gif *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;All files (*.*)"
923+
file_formats = "Image files (*.svg *.bmp *.jpeg *.jpg *.gif *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;All files (*)"
924924

925925
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Image", self._pictures_dir, file_formats)
926926
if not path:
@@ -1449,7 +1449,7 @@ def _importProjectActionSlot(self):
14491449
if not os.path.exists(directory):
14501450
directory = Topology.instance().projectsDirPath()
14511451
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Open portable project", directory,
1452-
"All files (*.*);;GNS3 Portable Project (*.gns3project *.gns3p)",
1452+
"All files (*);;GNS3 Portable Project (*.gns3project *.gns3p)",
14531453
"GNS3 Portable Project (*.gns3project *.gns3p)")
14541454
if path:
14551455
Topology.instance().importProject(path)

gns3/modules/dynamips/pages/dynamips_preferences_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _dynamipsPathBrowserSlot(self):
5151

5252
file_filter = ""
5353
if sys.platform.startswith("win"):
54-
file_filter = "Executable (*.exe);;All files (*.*)"
54+
file_filter = "Executable (*.exe);;All files (*)"
5555

5656
dynamips_path = shutil.which("dynamips")
5757
if sys.platform.startswith("darwin") and dynamips_path is None:

gns3/modules/dynamips/pages/ios_router_preferences_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def getIOSImage(cls, parent, server):
229229
path, _ = QtWidgets.QFileDialog.getOpenFileName(parent,
230230
"Select an IOS image",
231231
cls._default_images_dir,
232-
"All files (*.*);;IOS image (*.bin *.image)",
232+
"All files (*);;IOS image (*.bin *.image)",
233233
"IOS image (*.bin *.image)")
234234

235235
if not path:

gns3/modules/iou/pages/iou_device_preferences_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def getIOUImage(cls, parent, server):
291291
path, _ = QtWidgets.QFileDialog.getOpenFileName(parent,
292292
"Select an IOU image",
293293
cls._default_images_dir,
294-
"All file (*);;IOU image (*.bin *.image *.iol)",
295-
"IOU image (*.bin *.image *.iol)")
294+
"All file (*);;IOU image (x86_64* i86bi* *.bin *.image *.iol)",
295+
"IOU image (x86_64* i86bi* *.bin *.image *.iol)")
296296

297297
if not path:
298298
return

gns3/modules/traceng/pages/traceng_preferences_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _tracengPathBrowserSlot(self):
5151

5252
filter = ""
5353
if sys.platform.startswith("win"):
54-
filter = "Executable (*.exe);;All files (*.*)"
54+
filter = "Executable (*.exe);;All files (*)"
5555
traceng_path = shutil.which("traceng")
5656
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select TraceNG", traceng_path, filter)
5757
if not path:

gns3/modules/vpcs/pages/vpcs_preferences_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _vpcsPathBrowserSlot(self):
5151

5252
filter = ""
5353
if sys.platform.startswith("win"):
54-
filter = "Executable (*.exe);;All files (*.*)"
54+
filter = "Executable (*.exe);;All files (*)"
5555
vpcs_path = shutil.which("vpcs")
5656
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select VPCS", vpcs_path, filter)
5757
if not path:

gns3/pages/general_preferences_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _importConfigurationFileSlot(self):
195195
configuration_file_path = LocalConfig.instance().configFilePath()
196196
directory = os.path.dirname(configuration_file_path)
197197

198-
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Import configuration file", directory, "Configuration file (*.ini *.conf);;All files (*.*)")
198+
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Import configuration file", directory, "Configuration file (*.ini *.conf);;All files (*)")
199199
if not path:
200200
return
201201

@@ -240,7 +240,7 @@ def _exportConfigurationFileSlot(self):
240240
configuration_file_path = LocalConfig.instance().configFilePath()
241241
directory = os.path.dirname(configuration_file_path)
242242

243-
path, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Export configuration file", directory, "Configuration file (*.ini *.conf);;All files (*.*)")
243+
path, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Export configuration file", directory, "Configuration file (*.ini *.conf);;All files (*)")
244244
if not path:
245245
return
246246

gns3/pages/server_preferences_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _localServerBrowserSlot(self):
106106

107107
filter = ""
108108
if sys.platform.startswith("win"):
109-
filter = "Executable (*.exe);;All files (*.*)"
109+
filter = "Executable (*.exe);;All files (*)"
110110
server_path = shutil.which("gns3server")
111111
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select the local server", server_path, filter)
112112
if not path:
@@ -121,7 +121,7 @@ def _ubridgeBrowserSlot(self):
121121

122122
filter = ""
123123
if sys.platform.startswith("win"):
124-
filter = "Executable (*.exe);;All files (*.*)"
124+
filter = "Executable (*.exe);;All files (*)"
125125

126126
ubridge_path = shutil.which("ubridge")
127127
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select ubridge executable", ubridge_path, filter)

0 commit comments

Comments
 (0)