]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/commands.cpp
q3map2: code simplification
[xonotic/netradiant.git] / radiant / commands.cpp
index 1fab3bdcb67b7c178682b3287c33c5dffc382e80..9c1b7682246febb16f70c082faba1da1b418dbd2 100644 (file)
@@ -87,7 +87,7 @@ typedef std::map<CopiedString, Toggle> Toggles;
 
 Toggles g_toggles;
 
-void GlobalToggles_insert( const char* name, const Callback<void()>& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator ){
+void GlobalToggles_insert( const char* name, const Callback<void()>& callback, const Callback<void(const Callback<void(bool)> &)>& exportCallback, const Accelerator& accelerator ){
        bool added = g_toggles.insert( Toggles::value_type( name, Toggle( callback, GlobalShortcuts_insert( name, accelerator ), exportCallback ) ) ).second;
        ASSERT_MESSAGE( added, "toggle already registered: " << makeQuoted( name ) );
 }
@@ -161,7 +161,7 @@ void connect_accelerator( const char *name ){
 struct command_list_dialog_t : public ModalDialog
 {
        command_list_dialog_t()
-               : m_close_button( *this, eIDCANCEL ), m_list( NULL ), m_command_iter(), m_model( NULL ), m_waiting_for_key( false ){
+               : m_close_button( *this, eIDCANCEL ), m_list( ui::null ), m_command_iter(), m_model( ui::null ), m_waiting_for_key( false ){
        }
        ModalDialogButton m_close_button;
 
@@ -220,7 +220,7 @@ void accelerator_edit_button_clicked( ui::Button btn, gpointer dialogptr ){
                return;
        }
        dialog.m_command_iter = iter;
-       dialog.m_model = ui::TreeModel(model);
+       dialog.m_model = ui::TreeModel::from(model);
 
        // 2. disallow changing the row
        //gtk_widget_set_sensitive(dialog.m_list, false);
@@ -306,7 +306,7 @@ public:
                        StringOutputStream msg;
                        msg << "The command " << name << " is already assigned to the key " << accelerator << ".\n\n"
                                << "Do you want to unassign " << name << " first?";
-                       auto r = widget.window().alert( msg.c_str(), "Key already used", ui::alert_type::YESNOCANCEL );
+                       auto r = ui::alert( widget.window(), msg.c_str(), "Key already used", ui::alert_type::YESNOCANCEL );
                        if ( r == ui::alert_response::YES ) {
                                // clear the ACTUAL accelerator too!
                                disconnect_accelerator( name );
@@ -403,9 +403,9 @@ void DoCommandListDlg(){
                hbox.pack_start( scr, TRUE, TRUE, 0 );
 
                {
-                       ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
+                       auto store = ui::ListStore::from(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
 
-                       auto view = ui::TreeView(ui::TreeModel(store));
+                       auto view = ui::TreeView(ui::TreeModel::from(store._handle));
                        dialog.m_list = view;
 
                        gtk_tree_view_set_enable_search(view, false ); // annoying