프로젝트

일반

사용자정보

개정판 ac2e45b1

IDac2e45b1d9a55c771f650fde82512316aa6ea0a2
상위 a8ffd808
하위 f688d463

함의성이(가) 4년 이상 전에 추가함

issue #1489: stream no ui test

Change-Id: I9ac4b49ee57bc3084b253f5e256e449816284c97

차이점 보기:

DTI_PID/DTI_PID/ImportTextFromCADDialog.py
239 239
        app_doc_data = AppDocData.instance()
240 240
        app_doc_data.saveConfigs(configs)
241 241

  
242
        QMessageBox.information(self, self.tr('Information'), self.tr('Save Success!'), QMessageBox.Close)
242
        QMessageBox.information(self, self.tr('Information'), self.tr('Successfully saved.'))
243 243
        """up to here"""
244 244

  
245 245
    def on_import_autocad(self):
DTI_PID/DTI_PID/ImportTextFromPDFDialog.py
79 79
        app_doc_data = AppDocData.instance()
80 80
        app_doc_data.saveConfigs(configs)
81 81

  
82
        QMessageBox.information(self, self.tr('Information'), self.tr('Save Success!'), QMessageBox.Close)
82
        QMessageBox.information(self, self.tr('Information'), self.tr('Successfully saved.'))
83 83

  
84 84
    def on_import_pdf(self):
85 85
        """import line and text from autocad"""
DTI_PID/DTI_PID/ItemDataFormatDialog.py
511 511

  
512 512
            docData.saveConfigs(configs)
513 513

  
514
        reply = QMessageBox.information(self, self.tr('Information'), self.tr('Save Success!'), QMessageBox.Ok,
515
                                        QMessageBox.Cancel)
514
        reply = QMessageBox.information(self, self.tr('Information'), self.tr('Successfully saved.'))
516 515
        if reply == QMessageBox.Ok:
517 516
            QDialog.accept(self)
518 517

  
DTI_PID/DTI_PID/StreamlineDialog.py
282 282
            item = self.ui.tableViewFromTo.model().item(row, column)
283 283
            item.setText(str(selected))
284 284
            item.setData(str(selected.uid), Qt.UserRole)
285
            
285 286
            item._new = True
287
            row = self.ui.tableViewStreamNo.selectionModel().currentIndex().row()
288
            self.ui.tableViewStreamNo.model().item(row, 1)._new = True
289

  
286 290
            App.mainWnd().graphicsView.useDefaultCommand()
287 291

  
288 292
        # save column index
......
302 306

  
303 307
    def on_save_from_to(self):
304 308
        """save current from/to data"""
305
        row = self.ui.tableViewStreamNo.selectionModel().currentIndex().row()
306
        stream_no = self.ui.tableViewStreamNo.model().item(row, 1).text()
309
        hmb_model = self.ui.tableViewStreamNo.model()
310
        changes = []
311

  
312
        for row in range(hmb_model.rowCount()):
313
            item = hmb_model.item(row, 1)
314
            if hasattr(item, '_new') and item._new:
315
                item._new = False
316
                changes.append(item.text())
317

  
318
        for stream_no, model in self._from_to_models.items():
319
            if stream_no not in changes:
320
                continue
321

  
322
            from_to_data = []
323

  
324
            for row in range(model.rowCount()):
325
                drawing_ = model.item(row, 0)
326
                drawing_uid = drawing_.data(Qt.UserRole)
327
                from_ = model.item(row, 1)
328
                from_uid = from_.data(Qt.UserRole)
329
                to_ = model.item(row, 2)
330
                to_uid = to_.data(Qt.UserRole)
307 331

  
308
        from_to_data = []
332
                if hasattr(drawing_, '_new') and drawing_._new:
333
                    drawing_._new = False
334
                if hasattr(from_, '_new') and from_._new:
335
                    from_._new = False
336
                if hasattr(to_, '_new') and to_._new:
337
                    to_._new = False
309 338

  
310
        model = self.ui.tableViewFromTo.model()
311
        for row in range(model.rowCount()):
312
            drawing_ = model.item(row, 0)
313
            drawing_uid = drawing_.data(Qt.UserRole)
314
            from_ = model.item(row, 1)
315
            from_uid = from_.data(Qt.UserRole)
316
            to_ = model.item(row, 2)
317
            to_uid = to_.data(Qt.UserRole)
339
                from_to_data.append((drawing_uid, from_uid, to_uid, stream_no))
318 340

  
319
            from_to_data.append((drawing_uid, from_uid, to_uid, stream_no))
341
            AppDocData.save_stream_line_data([stream_no, from_to_data])
320 342

  
321
        AppDocData.save_stream_line_data([stream_no, from_to_data])
343
        QMessageBox.about(self, self.tr("Information"), self.tr('Successfully saved.'))
322 344

  
323 345
    def accept(self):
324 346
        QDialog.accept(self)
DTI_PID/DTI_PID/TrainingEditorDialog.py
266 266
        self.boxItem.setText(boxchars)
267 267

  
268 268
        self.isChanged = False
269
        reply = QMessageBox.information(self, self.tr('Information'), self.tr('Save Success!'), QMessageBox.Ok,
269
        reply = QMessageBox.information(self, self.tr('Information'), self.tr('Successfully saved.'), QMessageBox.Ok,
270 270
                                        QMessageBox.Cancel)
271 271
        if reply == QMessageBox.Ok:
272 272
            QDialog.reject(self)

내보내기 Unified diff