Skip to content
  • Mohammed Sadiq's avatar
    createformatdialog: Port to GtkBuilder templates · b1cfdf8f
    Mohammed Sadiq authored
    Currently we are using non-template builder ui files for UI
    for UI, we fetch all widgets and connect signal callbacks
    which is error prone.  Also, we create custom structs to pass
    data to some other functions and we have to deal with properly
    freeing them when done, which makes to code logic harder to
    read and understand.
    
    Porting to GtkBuiler templates shall make the code be a proper
    GObject class and has the following benifits:
    
    - all Object class members are initialized to 0/NULL by default
      and so we don't have to initialize them
    - we can bind signal callbacks and property changes with in the
      ui files.
    - GtkBuilder itself handles binding variables to appropriate
      widgets, and thus we will find bugs early during run time.
      ie, before the widget is even used.
    - The code logic is easier to understand
    - We don't want to pass random pointers to pass data and it's
      easy to free the data at once.
    
    This commit also removes support for buttons with stock icons and
    replaces gtk_dialog_run() so that it would be easier to port to GTK4
    b1cfdf8f