프로젝트

일반

사용자정보

개정판 775be547

ID775be5474ab7162afffebff1ed9fc1c4107ad0f8
상위 b6603e12
하위 d3b7f082, 10182ed5

함의성이(가) 약 2년 전에 추가함

ff ui ongoing

Change-Id: I2b294e33b250b0ca6a1fee772da32974187c8816

차이점 보기:

DTI_PID/DTI_PID/App.py
50 50
            self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\{}'.format(configs[0].value))
51 51
            self.stylesheet_name = configs[0].value
52 52
        else:
53
            self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\coffee')
54
            self.stylesheet_name = 'coffee'
53
            self.loadStyleSheet(os.path.dirname(os.path.realpath(__file__)) + '\\pagefold')
54
            self.stylesheet_name = 'pagefold'
55 55

  
56 56
        # load language file
57 57
        self._translator = None
DTI_PID/DTI_PID/Configuration_UI.py
964 964
        self.horizontalLayout_12.setObjectName("horizontalLayout_12")
965 965
        self.radioButtonOpModeGeneral = QtWidgets.QRadioButton(self.groupBox_14)
966 966
        self.radioButtonOpModeGeneral.setObjectName("radioButtonOpModeGeneral")
967
        self.buttonGroup_14 = QtWidgets.QButtonGroup(ConfigurationDialog)
968
        self.buttonGroup_14.setObjectName("buttonGroup_14")
969
        self.buttonGroup_14.addButton(self.radioButtonOpModeGeneral)
967 970
        self.horizontalLayout_12.addWidget(self.radioButtonOpModeGeneral)
971
        self.radioButtonOpModeFF = QtWidgets.QRadioButton(self.groupBox_14)
972
        self.radioButtonOpModeFF.setObjectName("radioButtonOpModeFF")
973
        self.buttonGroup_14.addButton(self.radioButtonOpModeFF)
974
        self.horizontalLayout_12.addWidget(self.radioButtonOpModeFF)
968 975
        self.radioButtonOpModeInst = QtWidgets.QRadioButton(self.groupBox_14)
969 976
        self.radioButtonOpModeInst.setObjectName("radioButtonOpModeInst")
977
        self.buttonGroup_14.addButton(self.radioButtonOpModeInst)
970 978
        self.horizontalLayout_12.addWidget(self.radioButtonOpModeInst)
971 979
        self.gridLayout_36.addLayout(self.horizontalLayout_12, 0, 1, 1, 1)
972 980
        self.gridLayout_41.addLayout(self.gridLayout_36, 0, 0, 1, 1)
......
1185 1193
        self.groupBox_14.setTitle(_translate("ConfigurationDialog", "Project"))
1186 1194
        self.label_55.setText(_translate("ConfigurationDialog", "Operation Mode : "))
1187 1195
        self.radioButtonOpModeGeneral.setText(_translate("ConfigurationDialog", "General"))
1196
        self.radioButtonOpModeFF.setText(_translate("ConfigurationDialog", "Fire Fighting"))
1188 1197
        self.radioButtonOpModeInst.setText(_translate("ConfigurationDialog", "Instrument"))
1189 1198
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabETC), _translate("ConfigurationDialog", "ETC"))
1190 1199

  
DTI_PID/DTI_PID/ProjectDialog.py
13 13
        QDialog.__init__(self, parent)
14 14
        _translate = QtCore.QCoreApplication.translate
15 15

  
16
        self.delimiter = '!-!'
16 17
        self._selectedProject = None
17 18
        self.ui = Project_UI.Ui_ProjectDialog()
18 19
        self.ui.setupUi(self)
......
28 29
        self.ui.lineEditPassword.setEchoMode(QLineEdit.Password)
29 30
        self.ui.pushButtonTestConnection.clicked.connect(self.on_test_connection_clicked)
30 31
        self.changeProject()  # force fill project's properties
32
        self.ui.buttonGroup.buttonClicked.connect(self.changeTheme)
31 33
        self.ui.toolButton.clicked.connect(self.addProjectClick)
32 34
        self.ui.toolButtonDelete.clicked.connect(self.deleteProjectClick)
33 35
        self.setWindowTitle(_translate('Project Dialog', 'Project'))
......
41 43
        if configs and configs[0].value:
42 44
            self.ui.lineEditUpdateURL.setText(configs[0].value)
43 45

  
46
    def changeTheme(self):
47
        if self.ui.radioButtonFireFighting.isChecked():
48
            self.load_stylesheet('americano')
49
        else:
50
            self.load_stylesheet('pagefold')
51

  
44 52
    def initComboBox(self):
45 53
        from AppDocData import AppDocData
46 54

  
......
77 85

  
78 86
        index = self.ui.comboBox.currentIndex()
79 87
        project = self.ui.comboBox.itemData(index)
80
        prj_desc = self.ui.lineEditProjectDesc.text()
88
        if self.ui.radioButtonFireFighting.isChecked():
89
            prj_desc = 'FireFighting' + self.delimiter +self.ui.lineEditProjectDesc.text()
90
        elif self.ui.radioButtonInstrument.isChecked():
91
            prj_desc = 'Instrument' + self.delimiter +self.ui.lineEditProjectDesc.text()
92
        else:
93
            prj_desc = 'General' + self.delimiter +self.ui.lineEditProjectDesc.text()
94
        
81 95
        prj_unit = self.ui.comboBoxProjectUnit.currentText()
82 96
        if project is not None:
83 97
            project.desc = prj_desc
......
104 118
    def reject(self):
105 119
        QDialog.reject(self)
106 120

  
121
    def load_stylesheet(self, file):
122
        """load stylesheets"""
123
        from AppDocData import Config
124

  
125
        QtWidgets.qApp.loadStyleSheet(os.path.join(os.path.dirname(os.path.realpath(__file__)), file))
126

  
127
        app_doc_data = AppDocData.instance()
128
        configs = [Config('app', 'stylesheet', file)]
129
        app_doc_data.saveAppConfigs(configs)
130

  
107 131
    def addProjectClick(self):
108 132
        _translate = QtCore.QCoreApplication.translate
109 133

  
......
116 140
            if selected_dir and not any(c.isspace() for c in selected_dir):
117 141
                prj_unit = self.ui.comboBoxProjectUnit.currentText()
118 142
                self.insertProjectInfo(dir=selected_dir, desc=self.ui.lineEditProjectDesc.text(), prj_unit=prj_unit)
143

  
144
                self.load_stylesheet('pagefold')
119 145
            else:
120 146
                QMessageBox.warning(self, self.tr('Message'), self.tr('Folder name should not contains space'))
121 147

  
......
143 169
        index = self.ui.comboBox.currentIndex()
144 170
        project = self.ui.comboBox.itemData(index)
145 171
        if project:
146
            self.ui.lineEditProjectDesc.setText(project.desc)
172
            _desc = project.desc.split(self.delimiter)
173
            if len(_desc) == 2:                
174
                if _desc[0] == 'General':
175
                    self.ui.radioButtonGeneral.setChecked(True)
176
                elif _desc[0] == 'FireFighting':
177
                    self.ui.radioButtonFireFighting.setChecked(True)
178
                elif _desc[0] == 'Instrument':
179
                    self.ui.radioButtonInstrument.setChecked(True)
180
                else:
181
                    self.ui.radioButtonGeneral.setChecked(True)
182
                self.ui.lineEditProjectDesc.setText(_desc[1])
183
            elif len(_desc) == 1:
184
                if _desc[0] == 'General':
185
                    self.ui.radioButtonGeneral.setChecked(True)
186
                    self.ui.lineEditProjectDesc.setText('')
187
                elif _desc[0] == 'FireFighting':
188
                    self.ui.radioButtonFireFighting.setChecked(True)
189
                    self.ui.lineEditProjectDesc.setText('')
190
                elif _desc[0] == 'Instrument':
191
                    self.ui.radioButtonInstrument.setChecked(True)
192
                    self.ui.lineEditProjectDesc.setText('')
193
                else:
194
                    self.ui.radioButtonGeneral.setChecked(True)
195
                    self.ui.lineEditProjectDesc.setText(_desc[0])
196
            else:
197
                self.ui.radioButtonGeneral.setChecked(True)
198
                self.ui.lineEditProjectDesc.setText('')
199

  
147 200
            self.ui.comboBoxProjectUnit.setCurrentText(project.prj_unit)
148 201

  
149 202
            self.ui.radioButtonSQLite.setChecked(project.database.db_type == 'SQLite')
DTI_PID/DTI_PID/Project_UI.py
152 152
        self.horizontalLayout.setObjectName("horizontalLayout")
153 153
        self.radioButtonGeneral = QtWidgets.QRadioButton(ProjectDialog)
154 154
        self.radioButtonGeneral.setObjectName("radioButtonGeneral")
155
        self.buttonGroup = QtWidgets.QButtonGroup(ProjectDialog)
156
        self.buttonGroup.setObjectName("buttonGroup")
157
        self.buttonGroup.addButton(self.radioButtonGeneral)
155 158
        self.horizontalLayout.addWidget(self.radioButtonGeneral)
156 159
        self.radioButtonFireFighting = QtWidgets.QRadioButton(ProjectDialog)
157 160
        self.radioButtonFireFighting.setObjectName("radioButtonFireFighting")
161
        self.buttonGroup.addButton(self.radioButtonFireFighting)
158 162
        self.horizontalLayout.addWidget(self.radioButtonFireFighting)
159 163
        self.radioButtonInstrument = QtWidgets.QRadioButton(ProjectDialog)
160 164
        self.radioButtonInstrument.setObjectName("radioButtonInstrument")
165
        self.buttonGroup.addButton(self.radioButtonInstrument)
161 166
        self.horizontalLayout.addWidget(self.radioButtonInstrument)
162 167
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
163 168
        self.horizontalLayout.addItem(spacerItem)
DTI_PID/DTI_PID/UI/Configuration.ui
2012 2012
                  <property name="text">
2013 2013
                   <string>General</string>
2014 2014
                  </property>
2015
                  <attribute name="buttonGroup">
2016
                   <string notr="true">buttonGroup_14</string>
2017
                  </attribute>
2018
                 </widget>
2019
                </item>
2020
                <item>
2021
                 <widget class="QRadioButton" name="radioButtonOpModeFF">
2022
                  <property name="text">
2023
                   <string>Fire Fighting</string>
2024
                  </property>
2025
                  <attribute name="buttonGroup">
2026
                   <string notr="true">buttonGroup_14</string>
2027
                  </attribute>
2015 2028
                 </widget>
2016 2029
                </item>
2017 2030
                <item>
......
2019 2032
                  <property name="text">
2020 2033
                   <string>Instrument</string>
2021 2034
                  </property>
2035
                  <attribute name="buttonGroup">
2036
                   <string notr="true">buttonGroup_14</string>
2037
                  </attribute>
2022 2038
                 </widget>
2023 2039
                </item>
2024 2040
               </layout>
......
2165 2181
  <buttongroup name="buttonGroup_2"/>
2166 2182
  <buttongroup name="buttonGroup"/>
2167 2183
  <buttongroup name="buttonGroup_5"/>
2184
  <buttongroup name="buttonGroup_14"/>
2168 2185
 </buttongroups>
2169 2186
</ui>
DTI_PID/DTI_PID/UI/Project.ui
258 258
         <property name="text">
259 259
          <string>General</string>
260 260
         </property>
261
         <attribute name="buttonGroup">
262
          <string notr="true">buttonGroup</string>
263
         </attribute>
261 264
        </widget>
262 265
       </item>
263 266
       <item>
......
265 268
         <property name="text">
266 269
          <string>Fire Fighting</string>
267 270
         </property>
271
         <attribute name="buttonGroup">
272
          <string notr="true">buttonGroup</string>
273
         </attribute>
268 274
        </widget>
269 275
       </item>
270 276
       <item>
......
272 278
         <property name="text">
273 279
          <string>Instrument</string>
274 280
         </property>
281
         <attribute name="buttonGroup">
282
          <string notr="true">buttonGroup</string>
283
         </attribute>
275 284
        </widget>
276 285
       </item>
277 286
       <item>
......
361 370
   </hints>
362 371
  </connection>
363 372
 </connections>
373
 <buttongroups>
374
  <buttongroup name="buttonGroup"/>
375
 </buttongroups>
364 376
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)