Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add missing function
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cab352edb93ecb009431a8489656335776e1e731
User & Date: brandon 2018-11-10 20:35:09
Context
2018-11-11
21:28
Fix missing argument to functions check-in: 21481e42af user: brandon tags: trunk
2018-11-10
20:35
Add missing function check-in: cab352edb9 user: brandon tags: trunk
2018-11-08
23:46
Tweak the default column widths check-in: b81d2abe51 user: brandon tags: trunk
Changes

Changes to src/grotesque/ui/gtk3/dialogs/editdialog.py.

112
113
114
115
116
117
118


119
120
121
122
123
124
125
....
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472

1473
1474
1475



1476
1477



1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490


1491
1492
1493
        return vbox

    def _match_partial_string(self, completion, key, tree_iter, sep, column):
        if sep:
            key = key.split(sep)[-1]
        model = completion.get_model()
        val = model.get_value(tree_iter, column)


        return key in val.lower() and val != "(All)"

    def _on_list_completion(self, completion, model, tree_iter, entry, sep):
        text = entry.get_text()
        if not text:
            return False
        val = model.get_value(tree_iter, 0)
................................................................................
                new_ifid = self.release_store.get_value(row_iter, 1)
            else:
                self.release_store[row_iter][0] = False
            row_iter = self.release_store.iter_next(row_iter)
        if new_ifid is None:
            return
        db.query.update_story(self.conn, self.story_id,
                        {"default_release": new_ifid})

    def _merge_releases_with_story(self, merge_id):
        release_rows = db.query.select_releases_by_story(self.conn, self.story_id)

        for release_row in release_rows:
            ifid = release_row["ifid"]
            db.query.update_release(self.conn, ifid, {"story_id": merge_id})



        db.query.delete_story(self.conn, self.story_id)
        self.load_story(merge_id)




    def _show_merge_story_dialog(self, new_title, merge_id):
        d = Gtk.MessageDialog(self, Gtk.DialogFlags.MODAL,
                              Gtk.MessageType.QUESTION,
                              Gtk.ButtonsType.YES_NO)
        d.set_markup("A story with the title \"{0}\" already exists in your "
                     "library. Would you like to merge this file with that "
                     "story?".format(new_title))
        response = d.run()
        d.destroy()
        if response == Gtk.ResponseType.YES:
            self._merge_releases_with_story(merge_id)
            self._merge_resources_with_story(merge_id)


            return True
        else:
            return False







>
>







 







|


|
>



>
>
>
|
<
>
>
>













>
>



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
....
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482

1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
        return vbox

    def _match_partial_string(self, completion, key, tree_iter, sep, column):
        if sep:
            key = key.split(sep)[-1]
        model = completion.get_model()
        val = model.get_value(tree_iter, column)
        if val is None:
            return False
        return key in val.lower() and val != "(All)"

    def _on_list_completion(self, completion, model, tree_iter, entry, sep):
        text = entry.get_text()
        if not text:
            return False
        val = model.get_value(tree_iter, 0)
................................................................................
                new_ifid = self.release_store.get_value(row_iter, 1)
            else:
                self.release_store[row_iter][0] = False
            row_iter = self.release_store.iter_next(row_iter)
        if new_ifid is None:
            return
        db.query.update_story(self.conn, self.story_id,
                              {"default_release": new_ifid})

    def _merge_releases_with_story(self, merge_id):
        release_rows = db.query.select_releases_by_story(self.conn,
                                                         self.story_id)
        for release_row in release_rows:
            ifid = release_row["ifid"]
            db.query.update_release(self.conn, ifid, {"story_id": merge_id})

    def _merge_resources_with_story(self, merge_id):
        resource_rows = db.query.select_resources_by_story(self.conn,
                                                           self.story_id)

        for resource_row in resource_rows:
            res_id = resource_row["id"]
            db.query.update_resource(self.conn, res_id, {"story_id": merge_id})

    def _show_merge_story_dialog(self, new_title, merge_id):
        d = Gtk.MessageDialog(self, Gtk.DialogFlags.MODAL,
                              Gtk.MessageType.QUESTION,
                              Gtk.ButtonsType.YES_NO)
        d.set_markup("A story with the title \"{0}\" already exists in your "
                     "library. Would you like to merge this file with that "
                     "story?".format(new_title))
        response = d.run()
        d.destroy()
        if response == Gtk.ResponseType.YES:
            self._merge_releases_with_story(merge_id)
            self._merge_resources_with_story(merge_id)
            db.query.delete_story(self.conn, self.story_id)
            self.load_story(merge_id)
            return True
        else:
            return False

Changes to src/grotesque/ui/gtk3/mainwindow.py.

273
274
275
276
277
278
279

280
281
282
283
284
285
286
287
                                self.library.update_filter_stores()
                                if sel:
                                    filter_select.select_path(sel)
                                else:
                                    self.library_paned.filter_view.select_all()
                        elif response == Gtk.ResponseType.REJECT:
                            db.remove_story(self.conn, story_id)

                            self.library.list_store.remove(row_iter)
                    edit_dialog.destroy()
            # If any errors were encountered during import, display them here.
            if len(import_thread.msg) > 0:
                d = Gtk.MessageDialog(self, Gtk.DialogFlags.MODAL,
                                      Gtk.MessageType.WARNING,
                                      Gtk.ButtonsType.OK)
                d_msg = 'Errors encountered while adding games:\n\n{0}'.format(







>
|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
                                self.library.update_filter_stores()
                                if sel:
                                    filter_select.select_path(sel)
                                else:
                                    self.library_paned.filter_view.select_all()
                        elif response == Gtk.ResponseType.REJECT:
                            db.remove_story(self.conn, story_id)
                            if row_iter is not None:
                                self.library.list_store.remove(row_iter)
                    edit_dialog.destroy()
            # If any errors were encountered during import, display them here.
            if len(import_thread.msg) > 0:
                d = Gtk.MessageDialog(self, Gtk.DialogFlags.MODAL,
                                      Gtk.MessageType.WARNING,
                                      Gtk.ButtonsType.OK)
                d_msg = 'Errors encountered while adding games:\n\n{0}'.format(