This repository was archived by the owner on Aug 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1313 QFormLayout , QLineEdit )
1414
1515from pugdebug .gui .forms import PugdebugSettingsForm
16+ from pugdebug .models .projects import PugdebugProject
1617from pugdebug .models .settings import get_default_setting
1718
1819
@@ -25,6 +26,8 @@ def __init__(self, parent):
2526
2627 self .project_name = QLineEdit ()
2728
29+ self .accepted .connect (self .create_new_project )
30+
2831 self .setup_layout ()
2932
3033 self .load_settings ()
@@ -52,6 +55,11 @@ def setup_layout(self):
5255
5356 self .setLayout (box_layout )
5457
58+ def create_new_project (self ):
59+ project_name = self .project_name .text ()
60+ project = PugdebugProject (project_name )
61+ project .sync ()
62+
5563 def load_settings (self ):
5664 """Load default settings into the form"""
5765 for name , widget in self .form .widgets .items ():
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+
3+ """
4+ pugdebug - a standalone PHP debugger
5+ =========================
6+ copyright: (c) 2015 Robert Basic
7+ license: GNU GPL v3, see LICENSE for more details
8+ """
9+
10+ __author__ = "robertbasic"
11+
12+ from PyQt5 .QtCore import QCoreApplication , QSettings
13+
14+
15+ class PugdebugProject (QSettings ):
16+
17+ def __init__ (self , project_name ):
18+ project_name = project_name .lower ().replace (' ' , '-' )
19+ super (PugdebugProject , self ).__init__ (
20+ QSettings .IniFormat ,
21+ QSettings .UserScope ,
22+ QCoreApplication .organizationName (),
23+ project_name
24+ )
25+ self .setValue ('project' , project_name )
You can’t perform that action at this time.
0 commit comments