1+ # main_window.py
12from PySide6 .QtWidgets import QMainWindow , QWidget , QVBoxLayout , QHBoxLayout , QTableWidget , QTableWidgetItem , QPushButton , QTabWidget , QComboBox , QLineEdit , QLabel , QMessageBox , QFileDialog , QDialog , QGridLayout , QProgressDialog , QCheckBox , QTextEdit
23from PySide6 .QtCore import Qt , QThread , Signal
34from PySide6 .QtGui import QIcon
@@ -152,7 +153,7 @@ def setup_ui(self):
152153 row += 1
153154 runner_label = QLabel ("Default Runner:" )
154155 self .runner_combo = QComboBox ()
155- self .runner_combo .addItems (['Native' , 'Wine' , 'Proton' , 'Flatpak' , 'Snap' , ' Steam' ])
156+ self .runner_combo .addItems (['Native' , 'Wine' , 'Proton' , 'Flatpak' , 'Steam' ])
156157 self .runner_combo .setCurrentText (self .settings ['default_runner' ])
157158 self .runner_combo .setObjectName ('runner_combo' )
158159 self .runner_combo .currentTextChanged .connect (self .update_settings )
@@ -213,7 +214,7 @@ def setup_ui(self):
213214 about_layout = QVBoxLayout (about_widget )
214215 about_text = QTextEdit ()
215216 about_text .setReadOnly (True )
216- about_text .setText ("Hacker Launcher v1.0\n GitHub: https://github.com/HackerOS-Linux-System/Hacker-Launcher \n A launcher for running games with Proton/Wine easily." )
217+ about_text .setText ("Hacker Launcher v1.0\n GitHub: https://github.com/your-repo \n A launcher for running games with Proton/Wine easily." )
217218 about_layout .addWidget (about_text )
218219 tabs .addTab (about_widget , 'About' )
219220 layout .addWidget (tabs )
@@ -287,7 +288,7 @@ def add_game(self):
287288 row += 1
288289 runner_label = QLabel ('Runner:' )
289290 runner_combo = QComboBox ()
290- runner_combo .addItems (['Native' , 'Wine' , 'Proton' , 'Flatpak' , 'Snap' , ' Steam' ])
291+ runner_combo .addItems (['Native' , 'Wine' , 'Proton' , 'Flatpak' , 'Steam' ])
291292 runner_combo .setCurrentText (self .settings ['default_runner' ])
292293 dlg_layout .addWidget (runner_label , row , 0 )
293294 dlg_layout .addWidget (runner_combo , row , 1 , 1 , 2 )
@@ -303,22 +304,40 @@ def add_game(self):
303304 proton_widget .setVisible (runner_combo .currentText () == 'Proton' )
304305 dlg_layout .addWidget (proton_widget , row , 0 , 1 , 3 )
305306 row += 1
307+ prefix_label = QLabel ('Wine/Proton Prefix:' )
308+ prefix_edit = QLineEdit ()
309+ prefix_edit .setPlaceholderText ("Select or enter prefix path" )
310+ prefix_browse_btn = QPushButton (QIcon .fromTheme ("folder" ), 'Browse' )
311+ prefix_browse_btn .clicked .connect (lambda : prefix_edit .setText (QFileDialog .getExistingDirectory (self , 'Select Prefix Directory' )))
312+ prefix_widget = QWidget ()
313+ prefix_layout = QHBoxLayout ()
314+ prefix_layout .addWidget (prefix_label )
315+ prefix_layout .addWidget (prefix_edit )
316+ prefix_layout .addWidget (prefix_browse_btn )
317+ prefix_widget .setLayout (prefix_layout )
318+ prefix_widget .setVisible (runner_combo .currentText () in ['Wine' , 'Proton' ])
319+ dlg_layout .addWidget (prefix_widget , row , 0 , 1 , 3 )
320+ row += 1
306321 launch_label = QLabel ('Launch Options:' )
307322 launch_edit = QLineEdit ()
308323 launch_edit .setPlaceholderText ("e.g., --fullscreen --bigpicture --gamescope --adaptive-sync --width=1920 --height=1080" )
309324 dlg_layout .addWidget (launch_label , row , 0 )
310325 dlg_layout .addWidget (launch_edit , row , 1 , 1 , 2 )
311326 row += 1
312327 dxvk_check = QCheckBox ("Enable DXVK/VKD3D" )
328+ dxvk_check .setVisible (runner_combo .currentText () in ['Wine' , 'Proton' ])
313329 dlg_layout .addWidget (dxvk_check , row , 0 )
314330 row += 1
315331 esync_check = QCheckBox ("Enable Esync (Override)" )
332+ esync_check .setVisible (runner_combo .currentText () in ['Wine' , 'Proton' ])
316333 dlg_layout .addWidget (esync_check , row , 0 )
317334 row += 1
318335 fsync_check = QCheckBox ("Enable Fsync (Override)" )
336+ fsync_check .setVisible (runner_combo .currentText () in ['Wine' , 'Proton' ])
319337 dlg_layout .addWidget (fsync_check , row , 0 )
320338 row += 1
321339 dxvk_async_check = QCheckBox ("Enable DXVK Async (Override)" )
340+ dxvk_async_check .setVisible (runner_combo .currentText () in ['Wine' , 'Proton' ])
322341 dlg_layout .addWidget (dxvk_async_check , row , 0 )
323342 row += 1
324343 app_id_widget = QWidget ()
@@ -333,8 +352,13 @@ def add_game(self):
333352 row += 1
334353 def update_visibility (text ):
335354 proton_widget .setVisible (text == 'Proton' )
355+ prefix_widget .setVisible (text in ['Wine' , 'Proton' ])
336356 app_id_widget .setVisible (text == 'Steam' )
337357 browse_btn .setVisible (text != 'Steam' )
358+ dxvk_check .setVisible (text in ['Wine' , 'Proton' ])
359+ esync_check .setVisible (text in ['Wine' , 'Proton' ])
360+ fsync_check .setVisible (text in ['Wine' , 'Proton' ])
361+ dxvk_async_check .setVisible (text in ['Wine' , 'Proton' ])
338362 runner_combo .currentTextChanged .connect (update_visibility )
339363 button_layout = QHBoxLayout ()
340364 ok_btn = QPushButton (QIcon .fromTheme ("dialog-ok" ), 'Add Game' )
@@ -357,14 +381,15 @@ def update_visibility(text):
357381 enable_fsync = fsync_check .isChecked ()
358382 enable_dxvk_async = dxvk_async_check .isChecked ()
359383 app_id = app_id_edit .text () if runner == 'Steam' else ''
384+ prefix = prefix_edit .text () if runner in ['Wine' , 'Proton' ] else ''
360385 if runner == 'Proton' :
361386 runner = proton_combo .currentText ()
362- if not name or not ( exe or app_id ):
387+ if not name or ( runner != 'Steam' and not exe ) or ( runner == 'Steam' and not app_id ):
363388 QMessageBox .warning (self , 'Error' , 'Name and Executable/App ID required' )
364389 return
365- prefix = ''
366- if runner in ['Wine' ] or 'Proton' in runner :
390+ if runner in ['Wine' , 'Proton' ] and not prefix :
367391 prefix = os .path .join (self .config_manager .prefixes_dir , name .replace (' ' , '_' ))
392+ if prefix :
368393 os .makedirs (prefix , exist_ok = True )
369394 if os .name == 'posix' and ':' in exe :
370395 exe = exe .replace ('\\ ' , '/' ).replace ('C:' , '/drive_c' )
@@ -414,7 +439,7 @@ def configure_game(self):
414439 return
415440 name = self .games_list .item (selected , 0 ).text ()
416441 game = next ((g for g in self .games if g ['name' ] == name ), None )
417- if not game or game ['runner' ] in ['Native' , 'Flatpak' , 'Snap' , ' Steam' ]:
442+ if not game or game ['runner' ] in ['Native' , 'Flatpak' , 'Steam' ]:
418443 QMessageBox .information (self , 'Info' , 'No configuration needed for this runner' )
419444 return
420445 if not shutil .which ('winetricks' ):
0 commit comments